1.调整部分系统默认配置
Showing
9 changed files
with
205 additions
and
137 deletions
... | @@ -29,7 +29,7 @@ public class UserAppBind implements Serializable { | ... | @@ -29,7 +29,7 @@ public class UserAppBind implements Serializable { |
29 | @Transient | 29 | @Transient |
30 | private String password; | 30 | private String password; |
31 | @Transient | 31 | @Transient |
32 | private String headImgUrl; | 32 | private String headimgurl; |
33 | 33 | ||
34 | // 主键 | 34 | // 主键 |
35 | @Id | 35 | @Id | ... | ... |
... | @@ -40,7 +40,7 @@ public interface UserAppRepository extends JpaRepository<UserApp, Long>, JpaSpec | ... | @@ -40,7 +40,7 @@ public interface UserAppRepository extends JpaRepository<UserApp, Long>, JpaSpec |
40 | Integer updatePasswordById(Long id, String password); | 40 | Integer updatePasswordById(Long id, String password); |
41 | 41 | ||
42 | @Modifying | 42 | @Modifying |
43 | @Query(value = "UPDATE `uc_user_app` SET `update_time` = now(), `status` = -1 WHERE `id` = ?1", nativeQuery = true) | 43 | @Query(value = "UPDATE `uc_user_app` SET `update_time` = now(), `delete_time` = now(), `status` = -1 WHERE `id` = ?1", nativeQuery = true) |
44 | Integer appCancellation(Long id); | 44 | Integer appCancellation(Long id); |
45 | 45 | ||
46 | @Modifying | 46 | @Modifying | ... | ... |
1 | package com.topdraw.business.module.user.app.service.dto; | ||
2 | |||
3 | import com.topdraw.business.module.member.service.dto.MemberDTO; | ||
4 | import lombok.Data; | ||
5 | |||
6 | import java.io.Serializable; | ||
7 | |||
8 | /** | ||
9 | * @author : | ||
10 | * @description: | ||
11 | * @function : | ||
12 | * @date :Created in 2022/7/11 21:21 | ||
13 | * @version: : | ||
14 | * @modified By: | ||
15 | * @since : modified in 2022/7/11 21:21 | ||
16 | */ | ||
17 | @Data | ||
18 | public class AppRegisterDTO implements Serializable { | ||
19 | |||
20 | private UserAppDTO userAppDTO; | ||
21 | |||
22 | private MemberDTO memberDTO; | ||
23 | |||
24 | } |
1 | package com.topdraw.business.module.user.app.service.dto; | 1 | package com.topdraw.business.module.user.app.service.dto; |
2 | 2 | ||
3 | import lombok.Data; | 3 | import lombok.Data; |
4 | |||
5 | import javax.persistence.Transient; | ||
4 | import java.sql.Timestamp; | 6 | import java.sql.Timestamp; |
5 | import java.io.Serializable; | 7 | import java.io.Serializable; |
6 | 8 | ||
... | @@ -12,6 +14,11 @@ import java.io.Serializable; | ... | @@ -12,6 +14,11 @@ import java.io.Serializable; |
12 | @Data | 14 | @Data |
13 | public class UserAppDTO implements Serializable { | 15 | public class UserAppDTO implements Serializable { |
14 | 16 | ||
17 | private Integer accountType; | ||
18 | |||
19 | // 第三方账号 | ||
20 | private String account; | ||
21 | |||
15 | // ID | 22 | // ID |
16 | private Long id; | 23 | private Long id; |
17 | 24 | ... | ... |
... | @@ -3,7 +3,6 @@ package com.topdraw.business.process.rest; | ... | @@ -3,7 +3,6 @@ package com.topdraw.business.process.rest; |
3 | import cn.hutool.core.util.ObjectUtil; | 3 | import cn.hutool.core.util.ObjectUtil; |
4 | 4 | ||
5 | import com.alibaba.fastjson.JSON; | 5 | import com.alibaba.fastjson.JSON; |
6 | import com.alibaba.fastjson.JSONArray; | ||
7 | import com.alibaba.fastjson.JSONObject; | 6 | import com.alibaba.fastjson.JSONObject; |
8 | import com.topdraw.annotation.AnonymousAccess; | 7 | import com.topdraw.annotation.AnonymousAccess; |
9 | import com.topdraw.annotation.Log; | 8 | import com.topdraw.annotation.Log; |
... | @@ -33,7 +32,6 @@ import com.topdraw.exception.GlobeExceptionMsg; | ... | @@ -33,7 +32,6 @@ import com.topdraw.exception.GlobeExceptionMsg; |
33 | import com.topdraw.resttemplate.RestTemplateClient; | 32 | import com.topdraw.resttemplate.RestTemplateClient; |
34 | import com.topdraw.util.Base64Util; | 33 | import com.topdraw.util.Base64Util; |
35 | import com.topdraw.util.JSONUtil; | 34 | import com.topdraw.util.JSONUtil; |
36 | import com.topdraw.util.RegexUtil; | ||
37 | import com.topdraw.utils.RedisUtils; | 35 | import com.topdraw.utils.RedisUtils; |
38 | import com.topdraw.weixin.util.WeChatConstants; | 36 | import com.topdraw.weixin.util.WeChatConstants; |
39 | import com.topdraw.weixin.util.WeixinUtil; | 37 | import com.topdraw.weixin.util.WeixinUtil; |
... | @@ -184,7 +182,7 @@ public class UserOperationController { | ... | @@ -184,7 +182,7 @@ public class UserOperationController { |
184 | @ApiOperation("app账号绑定第三方账号") | 182 | @ApiOperation("app账号绑定第三方账号") |
185 | @AnonymousAccess | 183 | @AnonymousAccess |
186 | public ResultInfo appBindThirdAccount(@Validated @RequestBody UserAppBind resources) { | 184 | public ResultInfo appBindThirdAccount(@Validated @RequestBody UserAppBind resources) { |
187 | log.info("app账号绑定第三方账号,参数 ==>> [appBindUserAccount#{}]", resources); | 185 | log.info("app账号绑定第三方账号,参数 ==>> [appBindThirdAccount#{}]", resources); |
188 | 186 | ||
189 | String username = resources.getUsername(); | 187 | String username = resources.getUsername(); |
190 | if (StringUtils.isBlank(username)) { | 188 | if (StringUtils.isBlank(username)) { |
... | @@ -291,7 +289,11 @@ public class UserOperationController { | ... | @@ -291,7 +289,11 @@ public class UserOperationController { |
291 | if (!CollectionUtils.isEmpty(playDurationWithCategory)) { | 289 | if (!CollectionUtils.isEmpty(playDurationWithCategory)) { |
292 | GrowthReport growthReport = new GrowthReport(); | 290 | GrowthReport growthReport = new GrowthReport(); |
293 | growthReport.setPlatformAccount(platformAccount); | 291 | growthReport.setPlatformAccount(platformAccount); |
294 | growthReport.setData(JSONArray.toJSONString(playDurationWithCategory)); | 292 | |
293 | JSONObject jsonObject = new JSONObject(); | ||
294 | // jsonObject.put("playDurationWithCategory", JSONArray.toJSONString(playDurationWithCategory)); | ||
295 | jsonObject.put("playDurationWithCategory", playDurationWithCategory); | ||
296 | growthReport.setData(jsonObject.toJSONString()); | ||
295 | boolean result = this.userOperationService.saveGrowthReport(growthReport); | 297 | boolean result = this.userOperationService.saveGrowthReport(growthReport); |
296 | return ResultInfo.success(result); | 298 | return ResultInfo.success(result); |
297 | } | 299 | } | ... | ... |
... | @@ -15,6 +15,7 @@ import com.topdraw.business.module.member.service.dto.MemberSimpleDTO; | ... | @@ -15,6 +15,7 @@ import com.topdraw.business.module.member.service.dto.MemberSimpleDTO; |
15 | import com.topdraw.business.module.user.app.domain.*; | 15 | import com.topdraw.business.module.user.app.domain.*; |
16 | import com.topdraw.business.module.user.app.service.UserAppBindService; | 16 | import com.topdraw.business.module.user.app.service.UserAppBindService; |
17 | import com.topdraw.business.module.user.app.service.UserAppService; | 17 | import com.topdraw.business.module.user.app.service.UserAppService; |
18 | import com.topdraw.business.module.user.app.service.dto.AppRegisterDTO; | ||
18 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; | 19 | import com.topdraw.business.module.user.app.service.dto.UserAppBindDTO; |
19 | import com.topdraw.business.module.user.app.service.dto.UserAppDTO; | 20 | import com.topdraw.business.module.user.app.service.dto.UserAppDTO; |
20 | import com.topdraw.business.module.user.app.service.dto.UserAppSimpleDTO; | 21 | import com.topdraw.business.module.user.app.service.dto.UserAppSimpleDTO; |
... | @@ -52,7 +53,6 @@ import com.topdraw.exception.BadRequestException; | ... | @@ -52,7 +53,6 @@ import com.topdraw.exception.BadRequestException; |
52 | import com.topdraw.exception.EntityNotFoundException; | 53 | import com.topdraw.exception.EntityNotFoundException; |
53 | import com.topdraw.exception.GlobeExceptionMsg; | 54 | import com.topdraw.exception.GlobeExceptionMsg; |
54 | import com.topdraw.resttemplate.RestTemplateClient; | 55 | import com.topdraw.resttemplate.RestTemplateClient; |
55 | import com.topdraw.util.IdWorker; | ||
56 | import com.topdraw.util.TimestampUtil; | 56 | import com.topdraw.util.TimestampUtil; |
57 | import com.topdraw.utils.QueryHelp; | 57 | import com.topdraw.utils.QueryHelp; |
58 | import com.topdraw.utils.RedisUtils; | 58 | import com.topdraw.utils.RedisUtils; |
... | @@ -72,7 +72,6 @@ import org.springframework.util.CollectionUtils; | ... | @@ -72,7 +72,6 @@ import org.springframework.util.CollectionUtils; |
72 | 72 | ||
73 | import java.net.URLDecoder; | 73 | import java.net.URLDecoder; |
74 | import java.nio.charset.StandardCharsets; | 74 | import java.nio.charset.StandardCharsets; |
75 | import java.time.LocalDate; | ||
76 | import java.util.*; | 75 | import java.util.*; |
77 | import java.util.stream.Collectors; | 76 | import java.util.stream.Collectors; |
78 | 77 | ||
... | @@ -146,9 +145,18 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -146,9 +145,18 @@ public class UserOperationServiceImpl implements UserOperationService { |
146 | // 保存绑定关系 | 145 | // 保存绑定关系 |
147 | UserAppBind userAppBind = UserAppBindBuilder.build(_userAppDTO.getId(), resources.getAccount(), resources.getAccountType()); | 146 | UserAppBind userAppBind = UserAppBindBuilder.build(_userAppDTO.getId(), resources.getAccount(), resources.getAccountType()); |
148 | this.userAppBindService.create(userAppBind); | 147 | this.userAppBindService.create(userAppBind); |
148 | |||
149 | _userAppDTO.setAccount(resources.getAccount()); | ||
150 | _userAppDTO.setAccountType(resources.getAccountType()); | ||
149 | } | 151 | } |
150 | } | 152 | } |
151 | 153 | ||
154 | |||
155 | AppRegisterDTO appRegisterDTO = new AppRegisterDTO(); | ||
156 | appRegisterDTO.setMemberDTO(memberDTO); | ||
157 | appRegisterDTO.setUserAppDTO(_userAppDTO); | ||
158 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppRegister(appRegisterDTO); | ||
159 | |||
152 | return _userAppDTO; | 160 | return _userAppDTO; |
153 | 161 | ||
154 | } | 162 | } |
... | @@ -164,19 +172,29 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -164,19 +172,29 @@ public class UserOperationServiceImpl implements UserOperationService { |
164 | Integer accountType = resources.getAccountType(); | 172 | Integer accountType = resources.getAccountType(); |
165 | UserAppBindDTO userAppBindDTO = this.userAppBindService.findFirstByAccountAndAccountType(account, accountType); | 173 | UserAppBindDTO userAppBindDTO = this.userAppBindService.findFirstByAccountAndAccountType(account, accountType); |
166 | if (Objects.nonNull(userAppBindDTO.getId())) { | 174 | if (Objects.nonNull(userAppBindDTO.getId())) { |
167 | return this.userAppBindService.cancelUserAppBind(account, accountType); | 175 | |
176 | boolean result = this.userAppBindService.cancelUserAppBind(account, accountType); | ||
177 | /* if (result) { | ||
178 | UserAppBindDTO _userAppBindDTO = new UserAppBindDTO(); | ||
179 | _userAppBindDTO.setAccount(account); | ||
180 | _userAppBindDTO.setAccountType(accountType); | ||
181 | ((UserOperationServiceImpl) AopContext.currentProxy()).asyncCancelUserAppBind(_userAppBindDTO); | ||
182 | }*/ | ||
183 | return result; | ||
168 | } | 184 | } |
169 | return false; | 185 | return false; |
170 | } | 186 | } |
171 | 187 | ||
188 | |||
172 | @Override | 189 | @Override |
173 | @Transactional(rollbackFor = Exception.class) | 190 | @Transactional(rollbackFor = Exception.class) |
174 | public boolean appBindThirdAccount(UserAppBind resources) { | 191 | public boolean appBindThirdAccount(UserAppBind resources) { |
175 | String username = resources.getUsername(); | 192 | String username = resources.getUsername(); |
176 | String headImgUrl = resources.getHeadImgUrl(); | 193 | String headImgUrl = resources.getHeadimgurl(); |
177 | String nickname = resources.getNickname(); | 194 | String nickname = resources.getNickname(); |
178 | 195 | ||
179 | UserAppDTO userAppDTO = this.userAppService.findByUsername(username); | 196 | UserAppDTO userAppDTO = this.userAppService.findByUsername(username); |
197 | log.info("通过app账号查询app信息是否存在,[appBindThirdAccount#{}]", userAppDTO); | ||
180 | if (Objects.isNull(userAppDTO.getId())) { | 198 | if (Objects.isNull(userAppDTO.getId())) { |
181 | return false; | 199 | return false; |
182 | } | 200 | } |
... | @@ -184,35 +202,80 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -184,35 +202,80 @@ public class UserOperationServiceImpl implements UserOperationService { |
184 | if (Objects.isNull(userAppDTO.getHeadimgurl())) { | 202 | if (Objects.isNull(userAppDTO.getHeadimgurl())) { |
185 | UserApp userApp = new UserApp(); | 203 | UserApp userApp = new UserApp(); |
186 | userApp.setUsername(username); | 204 | userApp.setUsername(username); |
187 | if (StringUtils.isNotBlank(headImgUrl) && StringUtils.isNotBlank(nickname)) { | 205 | if (StringUtils.isNotBlank(headImgUrl)) { |
188 | if (headImgUrl.contains("http") || headImgUrl.contains("https")) { | 206 | if (headImgUrl.contains("http") || headImgUrl.contains("https")) { |
189 | String image = this.downloadWeixinImgeFromAppEngine(headImgUrl); | 207 | String image = this.downloadWeixinImgeFromAppEngine(headImgUrl); |
190 | userApp.setHeadimgurl(image); | 208 | userApp.setHeadimgurl(image); |
191 | } | 209 | } |
210 | } | ||
192 | userApp.setNickname(nickname); | 211 | userApp.setNickname(nickname); |
193 | this.userAppService.updateAppLastActiveTimeAndNicknameAndHeadImg(userApp); | 212 | log.info("同步app账号的昵称、头像,[appBindThirdAccount#{}]", userAppDTO); |
213 | boolean result = this.userAppService.updateAppLastActiveTimeAndNicknameAndHeadImg(userApp); | ||
214 | if (result) { | ||
215 | UserAppDTO userAppDTO1 = new UserAppDTO(); | ||
216 | BeanUtils.copyProperties(userApp, userAppDTO1); | ||
217 | ((UserOperationServiceImpl) AopContext.currentProxy()).asyncUpdateAppLastActiveTimeAndNicknameAndHeadImg(userAppDTO1); | ||
194 | } | 218 | } |
195 | } | 219 | } |
220 | |||
196 | String account = resources.getAccount(); | 221 | String account = resources.getAccount(); |
197 | Integer accountType = resources.getAccountType(); | 222 | Integer accountType = resources.getAccountType(); |
198 | UserAppBindDTO userAppBindDTO = this.userAppBindService.findFirstByAccountAndAccountType(account, accountType); | 223 | UserAppBindDTO userAppBindDTO = this.userAppBindService.findFirstByAccountAndAccountType(account, accountType); |
199 | if (Objects.nonNull(userAppBindDTO.getId())){ | 224 | if (Objects.nonNull(userAppBindDTO.getId())) { |
225 | resources.setUserAppId(userAppDTO.getId()); | ||
226 | boolean result = this.userAppBindService.updateValidStatusAndUserAppIdAndNickname(resources); | ||
227 | if (result) { | ||
228 | UserAppDTO userAppDTO1 = new UserAppDTO(); | ||
229 | userAppDTO1.setUsername(username); | ||
230 | userAppDTO1.setNickname(nickname); | ||
231 | userAppDTO1.setHeadimgurl(headImgUrl); | ||
232 | ((UserOperationServiceImpl) AopContext.currentProxy()).asyncUpdateAppLastActiveTimeAndNicknameAndHeadImg(userAppDTO1); | ||
233 | } | ||
234 | return result; | ||
235 | } else { | ||
200 | resources.setUserAppId(userAppDTO.getId()); | 236 | resources.setUserAppId(userAppDTO.getId()); |
201 | return this.userAppBindService.updateValidStatusAndUserAppIdAndNickname(resources); | 237 | resources.setStatus(1); |
238 | log.info("第三方账号不存在,新增关联关系[appBindThirdAccount#{}]", resources); | ||
239 | this.userAppBindService.create(resources); | ||
240 | |||
241 | UserAppDTO userAppDTO1 = new UserAppDTO(); | ||
242 | BeanUtils.copyProperties(resources, userAppDTO1); | ||
243 | userAppDTO1.setUsername(username); | ||
244 | ((UserOperationServiceImpl) AopContext.currentProxy()).asyncCreateUserAppBindThirdAccount(userAppDTO1); | ||
245 | return true; | ||
202 | } | 246 | } |
203 | return false; | ||
204 | } | 247 | } |
205 | 248 | ||
206 | @Override | 249 | @Override |
207 | public UserAppSimpleDTO updateAppInfo(UserApp resources) { | 250 | public UserAppSimpleDTO updateAppInfo(UserApp resources) { |
208 | return this.userAppService.updateAppInfo(resources); | 251 | |
252 | UserAppSimpleDTO userAppSimpleDTO = this.userAppService.updateAppInfo(resources); | ||
253 | if (Objects.nonNull(userAppSimpleDTO.getId())) { | ||
254 | UserAppDTO userAppDTO = new UserAppDTO(); | ||
255 | BeanUtils.copyProperties(resources, userAppDTO); | ||
256 | userAppDTO.setUsername(userAppSimpleDTO.getUsername()); | ||
257 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUpdateAppInfo(userAppDTO); | ||
209 | } | 258 | } |
259 | return userAppSimpleDTO; | ||
260 | } | ||
261 | |||
262 | |||
210 | 263 | ||
211 | @Override | 264 | @Override |
212 | public boolean updatePasswordById(UserApp resources) { | 265 | public boolean updatePasswordById(UserApp resources) { |
213 | return this.userAppService.updatePasswordById(resources); | 266 | UserAppDTO userAppDTO = this.userAppService.findById(resources.getId()); |
267 | if (Objects.nonNull(userAppDTO.getId())) { | ||
268 | if (this.userAppService.updatePasswordById(resources)) { | ||
269 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncUpdatePasswordByUsername(userAppDTO); | ||
270 | return true; | ||
271 | } | ||
272 | |||
273 | } | ||
274 | return false; | ||
214 | } | 275 | } |
215 | 276 | ||
277 | |||
278 | |||
216 | @Override | 279 | @Override |
217 | @Transactional(rollbackFor = Exception.class) | 280 | @Transactional(rollbackFor = Exception.class) |
218 | public boolean saveGrowthReport(GrowthReport growthReport) { | 281 | public boolean saveGrowthReport(GrowthReport growthReport) { |
... | @@ -224,13 +287,10 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -224,13 +287,10 @@ public class UserOperationServiceImpl implements UserOperationService { |
224 | return false; | 287 | return false; |
225 | } | 288 | } |
226 | 289 | ||
227 | |||
228 | String weekFirstDay = com.topdraw.util.DateUtil.getWeekFirstDay(); | 290 | String weekFirstDay = com.topdraw.util.DateUtil.getWeekFirstDay(); |
229 | String weekLastDay = com.topdraw.util.DateUtil.getWeekLastDay(); | 291 | String weekLastDay = com.topdraw.util.DateUtil.getWeekLastDay(); |
230 | GrowthReportDTO growthReportDTO = this.growthReportService.findByPlatformAccountAndStartDateAndEndDate(platformAccount, weekFirstDay, weekLastDay); | 292 | GrowthReportDTO growthReportDTO = this.growthReportService.findByPlatformAccountAndStartDateAndEndDate(platformAccount, weekFirstDay, weekLastDay); |
231 | |||
232 | if (Objects.isNull(growthReportDTO.getId())) { | 293 | if (Objects.isNull(growthReportDTO.getId())) { |
233 | |||
234 | Long id = userTvDTO.getId(); | 294 | Long id = userTvDTO.getId(); |
235 | Long memberId = userTvDTO.getMemberId(); | 295 | Long memberId = userTvDTO.getMemberId(); |
236 | growthReport.setUserId(id); | 296 | growthReport.setUserId(id); |
... | @@ -238,7 +298,6 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -238,7 +298,6 @@ public class UserOperationServiceImpl implements UserOperationService { |
238 | growthReport.setStartDate(weekFirstDay); | 298 | growthReport.setStartDate(weekFirstDay); |
239 | growthReport.setEndDate(weekLastDay); | 299 | growthReport.setEndDate(weekLastDay); |
240 | this.growthReportService.create(growthReport); | 300 | this.growthReportService.create(growthReport); |
241 | |||
242 | } else { | 301 | } else { |
243 | this.growthReportService.updateGrowthReportData(growthReportDTO.getId(), growthReport.getData()); | 302 | this.growthReportService.updateGrowthReportData(growthReportDTO.getId(), growthReport.getData()); |
244 | } | 303 | } |
... | @@ -256,16 +315,18 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -256,16 +315,18 @@ public class UserOperationServiceImpl implements UserOperationService { |
256 | if (b) { | 315 | if (b) { |
257 | List<UserAppBindDTO> userAppBindDTOS = this.userAppBindService.findByUserAppId(userAppDTO.getId()); | 316 | List<UserAppBindDTO> userAppBindDTOS = this.userAppBindService.findByUserAppId(userAppDTO.getId()); |
258 | if (!CollectionUtils.isEmpty(userAppBindDTOS)) { | 317 | if (!CollectionUtils.isEmpty(userAppBindDTOS)) { |
259 | List<Long> ids = userAppBindDTOS.stream().map(t -> t.getId()).collect(Collectors.toList()); | 318 | List<Long> ids = userAppBindDTOS.stream().map(UserAppBindDTO::getId).collect(Collectors.toList()); |
260 | this.userAppBindService.appCancellation(ids); | 319 | this.userAppBindService.appCancellation(ids); |
261 | } | 320 | } |
321 | |||
322 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppCancellation(userAppDTO); | ||
262 | } | 323 | } |
324 | |||
263 | } | 325 | } |
264 | 326 | ||
265 | return true; | 327 | return true; |
266 | } | 328 | } |
267 | 329 | ||
268 | |||
269 | /** | 330 | /** |
270 | * 创建大屏账户同时创建会员 | 331 | * 创建大屏账户同时创建会员 |
271 | * | 332 | * |
... | @@ -513,7 +574,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -513,7 +574,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
513 | /** | 574 | /** |
514 | * 服务号登录 | 575 | * 服务号登录 |
515 | * @param resources 微信信息 | 576 | * @param resources 微信信息 |
516 | * @return UserWeixinDTO | 577 | * @return UserWeiXinDTO |
517 | */ | 578 | */ |
518 | @Override | 579 | @Override |
519 | public UserWeixinDTO serviceLogin(UserWeixin resources) { | 580 | public UserWeixinDTO serviceLogin(UserWeixin resources) { |
... | @@ -528,10 +589,10 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -528,10 +589,10 @@ public class UserOperationServiceImpl implements UserOperationService { |
528 | /** | 589 | /** |
529 | * 小程序登录 | 590 | * 小程序登录 |
530 | * @param resources 微信 | 591 | * @param resources 微信 |
531 | * @return UserWeixinDTO | 592 | * @return UserWeiXinDTO |
532 | */ | 593 | */ |
533 | @Override | 594 | @Override |
534 | @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false, rollbackFor = Exception.class) | 595 | @Transactional(rollbackFor = Exception.class) |
535 | public UserWeixinDTO appletLogin(UserWeixin resources) { | 596 | public UserWeixinDTO appletLogin(UserWeixin resources) { |
536 | 597 | ||
537 | // 创建小屏账户同时创建会员 | 598 | // 创建小屏账户同时创建会员 |
... | @@ -606,27 +667,29 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -606,27 +667,29 @@ public class UserOperationServiceImpl implements UserOperationService { |
606 | // 修改会员信息 | 667 | // 修改会员信息 |
607 | memberDTO = this.memberService.doUpdateMemberVipAndVipExpireTime(member); | 668 | memberDTO = this.memberService.doUpdateMemberVipAndVipExpireTime(member); |
608 | log.info("发送关注消息至大屏侧,发送的账号信息 ==>> {} || 会员信息 ==>> {}", userWeixinDTO , memberDTO); | 669 | log.info("发送关注消息至大屏侧,发送的账号信息 ==>> {} || 会员信息 ==>> {}", userWeixinDTO , memberDTO); |
609 | // 同步至iptv | 670 | // 同步大屏侧 |
610 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncSubscribe(new MemberAndWeixinUserDTO(memberDTO, userWeixinDTO)); | 671 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncSubscribe(new MemberAndWeixinUserDTO(memberDTO, userWeixinDTO)); |
611 | 672 | ||
612 | // 大屏信息 | 673 | // 大屏信息 |
613 | JSONObject iptvUserInfo = resources.getIptvUserInfo(); | 674 | JSONObject visUserInfo = resources.getIptvUserInfo(); |
614 | log.info("存储的大小屏账号信息 iptvUserInfo ==>> {}" , iptvUserInfo); | 675 | log.info("存储的大小屏账号信息 iptvUserInfo ==>> {}" , visUserInfo); |
615 | if (Objects.nonNull(iptvUserInfo)) { | 676 | if (Objects.nonNull(visUserInfo)) { |
616 | // 大屏账户 | 677 | // 大屏账户 |
617 | String platformAccount = iptvUserInfo.getString("platformAccount"); | 678 | String platformAccount = visUserInfo.getString("platformAccount"); |
618 | 679 | ||
619 | if (StringUtils.isBlank(platformAccount)) { | 680 | if (StringUtils.isBlank(platformAccount)) { |
620 | 681 | ||
621 | platformAccount = iptvUserInfo.getString("platformUserId"); | 682 | platformAccount = visUserInfo.getString("platformUserId"); |
622 | 683 | ||
623 | if (StringUtils.isBlank(platformAccount)) { | 684 | if (StringUtils.isBlank(platformAccount)) { |
624 | platformAccount = iptvUserInfo.getString("nNO"); | 685 | platformAccount = visUserInfo.getString("nNO"); |
625 | } | 686 | } |
626 | 687 | ||
688 | if (StringUtils.isBlank(platformAccount)) { | ||
627 | log.error("关注后绑定失败,platformAccount is null "); | 689 | log.error("关注后绑定失败,platformAccount is null "); |
628 | return false; | 690 | return false; |
629 | } | 691 | } |
692 | } | ||
630 | 693 | ||
631 | log.info("存储的大屏账号信息 platformAccount ==>> {}" , platformAccount); | 694 | log.info("存储的大屏账号信息 platformAccount ==>> {}" , platformAccount); |
632 | // 绑定 | 695 | // 绑定 |
... | @@ -656,8 +719,6 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -656,8 +719,6 @@ public class UserOperationServiceImpl implements UserOperationService { |
656 | wechatSubscribeRecord.setOperationFlag(subscribe); | 719 | wechatSubscribeRecord.setOperationFlag(subscribe); |
657 | if (Objects.nonNull(sourceInfo)) { | 720 | if (Objects.nonNull(sourceInfo)) { |
658 | 721 | ||
659 | // wechatSubscribeRecord.setSourceInfo(JSONObject.toJSONString(sourceInfo)); | ||
660 | |||
661 | // 内容ID,entityId:实体ID | 722 | // 内容ID,entityId:实体ID |
662 | Object entityId = sourceInfo.get("entityId"); | 723 | Object entityId = sourceInfo.get("entityId"); |
663 | if (Objects.nonNull(entityId)) { | 724 | if (Objects.nonNull(entityId)) { |
... | @@ -892,10 +953,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -892,10 +953,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
892 | log.info("会员信息置空大屏的结果,memberDTO ==>> {}", memberDTO); | 953 | log.info("会员信息置空大屏的结果,memberDTO ==>> {}", memberDTO); |
893 | memberDTO.setPlatformAccount(platformAccount); | 954 | memberDTO.setPlatformAccount(platformAccount); |
894 | 955 | ||
895 | |||
896 | log.info("大屏解绑,重置大屏账号的主会员,查看当前会员是否是主账号 ==>>memberCode ==>> {} || 大屏账号 ==>> userTvDTO ==>> {}", userTvDTO); | ||
897 | if (StringUtils.isBlank(bindMemberCode)) { | 956 | if (StringUtils.isBlank(bindMemberCode)) { |
898 | |||
899 | UserTv userTv = new UserTv(); | 957 | UserTv userTv = new UserTv(); |
900 | userTv.setId(userTvDTO.getId()); | 958 | userTv.setId(userTvDTO.getId()); |
901 | userTv.setPriorityMemberCode(null); | 959 | userTv.setPriorityMemberCode(null); |
... | @@ -1105,7 +1163,6 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1105,7 +1163,6 @@ public class UserOperationServiceImpl implements UserOperationService { |
1105 | } else { | 1163 | } else { |
1106 | log.info("传过来的观影时间 ==>> {} 和今天的时间 ==>> {} 不相同,不做处理", userCollectionDetail.getCreateTime().getTime(), | 1164 | log.info("传过来的观影时间 ==>> {} 和今天的时间 ==>> {} 不相同,不做处理", userCollectionDetail.getCreateTime().getTime(), |
1107 | new Date().toInstant().getEpochSecond()); | 1165 | new Date().toInstant().getEpochSecond()); |
1108 | continue; | ||
1109 | } | 1166 | } |
1110 | 1167 | ||
1111 | } | 1168 | } |
... | @@ -1278,7 +1335,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1278,7 +1335,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
1278 | memberDTO.setPlatformAccount(platformAccount); | 1335 | memberDTO.setPlatformAccount(platformAccount); |
1279 | 1336 | ||
1280 | log.info("发送绑定消息至大屏侧, 会员信息 ==>> {} || 账号信息 ==>> {}", memberDTO , userTvDTO); | 1337 | log.info("发送绑定消息至大屏侧, 会员信息 ==>> {} || 账号信息 ==>> {}", memberDTO , userTvDTO); |
1281 | // 同步至iptv | 1338 | // 同步至大屏侧 |
1282 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); | 1339 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncMinaBind(new MemberAndUserTvDTO(memberDTO, userTvDTO)); |
1283 | 1340 | ||
1284 | this.updateUserTvSimplePriorityMemberCodeRedis(platformAccount, memberDTO.getCode()); | 1341 | this.updateUserTvSimplePriorityMemberCodeRedis(platformAccount, memberDTO.getCode()); |
... | @@ -1301,7 +1358,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1301,7 +1358,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
1301 | * | 1358 | * |
1302 | * @param unionId 身份唯一标识 | 1359 | * @param unionId 身份唯一标识 |
1303 | * @param appId 应用标识 | 1360 | * @param appId 应用标识 |
1304 | * @return UserWeixinDTO | 1361 | * @return UserWeiXinDTO |
1305 | */ | 1362 | */ |
1306 | private UserWeixinDTO findUserWeiXinByUnionIdAndAppId(String unionId, String appId) { | 1363 | private UserWeixinDTO findUserWeiXinByUnionIdAndAppId(String unionId, String appId) { |
1307 | return this.userWeixinService.findFirstByUnionidAndAppid(unionId, appId); | 1364 | return this.userWeixinService.findFirstByUnionidAndAppid(unionId, appId); |
... | @@ -1495,12 +1552,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1495,12 +1552,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
1495 | if (!CollectionUtils.isEmpty(collect)) { | 1552 | if (!CollectionUtils.isEmpty(collect)) { |
1496 | 1553 | ||
1497 | // 按绑定时间倒排 | 1554 | // 按绑定时间倒排 |
1498 | collect.sort(new Comparator<MemberDTO>() { | 1555 | collect.sort((memberDTO1, t1) -> t1.getBindIptvTime().compareTo(memberDTO1.getBindIptvTime())); |
1499 | @Override | ||
1500 | public int compare(MemberDTO memberDTO, MemberDTO t1) { | ||
1501 | return t1.getBindIptvTime().compareTo(memberDTO.getBindIptvTime()); | ||
1502 | } | ||
1503 | }); | ||
1504 | // 绑定新的主账号 | 1556 | // 绑定新的主账号 |
1505 | UserTv userTv = new UserTv(); | 1557 | UserTv userTv = new UserTv(); |
1506 | userTv.setId(userTvDTO.getId()); | 1558 | userTv.setId(userTvDTO.getId()); |
... | @@ -1568,6 +1620,24 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -1568,6 +1620,24 @@ public class UserOperationServiceImpl implements UserOperationService { |
1568 | } | 1620 | } |
1569 | 1621 | ||
1570 | 1622 | ||
1623 | |||
1624 | |||
1625 | |||
1626 | |||
1627 | @AsyncMqSend | ||
1628 | public void asyncCreateUserAppBindThirdAccount(UserAppDTO userAppDTO) {} | ||
1629 | @AsyncMqSend | ||
1630 | public void asyncUpdateAppLastActiveTimeAndNicknameAndHeadImg(UserAppDTO userAppDTO) { } | ||
1631 | @AsyncMqSend | ||
1632 | public void asyncCancelUserAppBind(UserAppBindDTO userAppBindDTO) {} | ||
1633 | @AsyncMqSend | ||
1634 | public void asyncUpdatePasswordByUsername(UserAppDTO userAppDTO) {} | ||
1635 | @AsyncMqSend | ||
1636 | public void asyncUpdateAppInfo(UserAppDTO userAppDTO) {} | ||
1637 | @AsyncMqSend | ||
1638 | public void asyncAppCancellation(UserAppDTO userAppDTO) {} | ||
1639 | @AsyncMqSend | ||
1640 | public void asyncAppRegister(AppRegisterDTO appRegisterDTO) {} | ||
1571 | @AsyncMqSend | 1641 | @AsyncMqSend |
1572 | public void asyncsaveGrowthReport(GrowthReport growthReport) {} | 1642 | public void asyncsaveGrowthReport(GrowthReport growthReport) {} |
1573 | @AsyncMqSend | 1643 | @AsyncMqSend | ... | ... |
... | @@ -23,13 +23,13 @@ import java.util.concurrent.TimeUnit; | ... | @@ -23,13 +23,13 @@ import java.util.concurrent.TimeUnit; |
23 | @Configuration | 23 | @Configuration |
24 | public class TheadPoolTaskExecutorConfiguration { | 24 | public class TheadPoolTaskExecutorConfiguration { |
25 | 25 | ||
26 | @Value("${task.pool.core-pool-size}") | 26 | @Value("${task.pool.core-pool-size:16}") |
27 | private Integer corePoolSize; | 27 | private Integer corePoolSize; |
28 | @Value("${task.pool.core-pool-size}") | 28 | @Value("${task.pool.core-pool-size:35}") |
29 | private Integer maxPoolSize; | 29 | private Integer maxPoolSize; |
30 | @Value("${task.pool.keep-alive-seconds}") | 30 | @Value("${task.pool.keep-alive-seconds:10}") |
31 | private Integer keepAliveSeconds; | 31 | private Integer keepAliveSeconds; |
32 | @Value("${task.pool.queue-capacity}") | 32 | @Value("${task.pool.queue-capacity:300}") |
33 | private Integer queueCapacity; | 33 | private Integer queueCapacity; |
34 | 34 | ||
35 | @Bean | 35 | @Bean | ... | ... |
... | @@ -28,23 +28,28 @@ spring: | ... | @@ -28,23 +28,28 @@ spring: |
28 | test-while-idle: true | 28 | test-while-idle: true |
29 | test-on-borrow: false | 29 | test-on-borrow: false |
30 | test-on-return: false | 30 | test-on-return: false |
31 | |||
32 | validation-query: select 1 | 31 | validation-query: select 1 |
33 | # 配置监控统计拦截的filters | 32 | # 配置监控统计拦截的filters |
34 | filters: stat | 33 | filters: stat |
35 | stat-view-servlet: | 34 | stat-view-servlet: |
36 | url-pattern: /druid/* | 35 | url-pattern: /druid/* |
37 | reset-enable: false | 36 | reset-enable: false |
38 | |||
39 | web-stat-filter: | 37 | web-stat-filter: |
40 | url-pattern: /* | 38 | url-pattern: /* |
41 | exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" | 39 | exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*" |
42 | 40 | jackson: | |
41 | time-zone: GMT+8 | ||
42 | data: | ||
43 | redis: | ||
44 | repositories: | ||
45 | enabled: false | ||
43 | #配置 Jpa | 46 | #配置 Jpa |
44 | jpa: | 47 | jpa: |
48 | properties: | ||
45 | hibernate: | 49 | hibernate: |
46 | # 生产环境设置成 none,避免程序运行时自动更新数据库结构 | 50 | dialect: org.hibernate.dialect.MySQL5InnoDBDialect |
47 | ddl-auto: none | 51 | ddl-auto: none |
52 | open-in-view: true | ||
48 | show-sql: false | 53 | show-sql: false |
49 | servlet: | 54 | servlet: |
50 | multipart: | 55 | multipart: |
... | @@ -89,7 +94,6 @@ jwt: | ... | @@ -89,7 +94,6 @@ jwt: |
89 | # 续期时间,2小时,单位毫秒 | 94 | # 续期时间,2小时,单位毫秒 |
90 | renew: 7200000 | 95 | renew: 7200000 |
91 | 96 | ||
92 | |||
93 | #是否允许生成代码,生产环境设置为false | 97 | #是否允许生成代码,生产环境设置为false |
94 | generator: | 98 | generator: |
95 | enabled: false | 99 | enabled: false |
... | @@ -97,53 +101,3 @@ generator: | ... | @@ -97,53 +101,3 @@ generator: |
97 | #是否开启 swagger-ui | 101 | #是否开启 swagger-ui |
98 | swagger: | 102 | swagger: |
99 | enabled: false | 103 | enabled: false |
... | \ No newline at end of file | ... | \ No newline at end of file |
100 | |||
101 | file: | ||
102 | path: system/file | ||
103 | avatar: system/avatar | ||
104 | upload: upload | ||
105 | # 文件大小 /M | ||
106 | maxSize: 100 | ||
107 | avatarMaxSize: 5 | ||
108 | |||
109 | service: | ||
110 | mq: | ||
111 | exchange: uce.exchange | ||
112 | queue: uce.queue | ||
113 | |||
114 | weixin: | ||
115 | list: | ||
116 | - appid: wxfaa765183a332521 | ||
117 | secret: b5c1c39cb95b45b599a02fd68b5fcf17 | ||
118 | token: | ||
119 | encodingAesKey: | ||
120 | imagePath: | ||
121 | content: 长按识别二维码,加入微信群。 | ||
122 | miniprogramState: formal | ||
123 | # 点击模板卡片后的默认跳转页面 | ||
124 | page: pages/index/main | ||
125 | # 生成带参数二维码的有效期 | ||
126 | qrCodeExpireSeconds: 86400 | ||
127 | env: dev | ||
128 | # 订阅号 | ||
129 | - appid: wx5d88c7fe99f89f32 | ||
130 | secret: b213afe99a469d4be576f330dad643b8 | ||
131 | token: topdraw | ||
132 | encodingAesKey: g3mYB6yx2ZiebxwKcI1H2iw3LlYNBHb7PqsVYFHUQzi | ||
133 | # 应用类型 小程序 服务号 订阅号, 当前基于订阅号有特殊逻辑 | ||
134 | appType: subscription | ||
135 | imagePath: /topdraw/app/user_center_service_te/upload/customer/weChat.png | ||
136 | content: 长按识别二维码,关注订阅号。 | ||
137 | miniprogramState: formal | ||
138 | # 点击模板卡片后的默认跳转页面 | ||
139 | page: pages/index/main | ||
140 | # 生成带参数二维码的有效期 | ||
141 | qrCodeExpireSeconds: 300 | ||
142 | env: dev | ||
143 | |||
144 | api: | ||
145 | uc-service: http://127.0.0.1:8446 | ||
146 | |||
147 | uc: | ||
148 | # 主会员是否启用,如果启用任务获得的积分将添加至小屏会员上 | ||
149 | validPriorityMember: 0 | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -2,40 +2,51 @@ server: | ... | @@ -2,40 +2,51 @@ server: |
2 | port: 8447 | 2 | port: 8447 |
3 | spring: | 3 | spring: |
4 | application: | 4 | application: |
5 | name: member-service | 5 | name: uc-engine |
6 | freemarker: | ||
7 | check-template-location: false | ||
8 | profiles: | 6 | profiles: |
9 | active: dev | 7 | active: dev |
10 | jackson: | ||
11 | time-zone: GMT+8 | ||
12 | data: | ||
13 | redis: | ||
14 | repositories: | ||
15 | enabled: false | ||
16 | 8 | ||
17 | #配置 Jpa | 9 | #mq |
18 | jpa: | 10 | service: |
19 | properties: | 11 | mq: |
20 | hibernate: | 12 | exchange: uce.exchange |
21 | dialect: org.hibernate.dialect.MySQL5InnoDBDialect | 13 | queue: uce.queue |
22 | open-in-view: true | ||
23 | 14 | ||
15 | weixin: | ||
16 | list: | ||
17 | - appid: wxfaa765183a332521 | ||
18 | secret: b5c1c39cb95b45b599a02fd68b5fcf17 | ||
19 | token: | ||
20 | encodingAesKey: | ||
21 | imagePath: | ||
22 | content: 长按识别二维码,加入微信群。 | ||
23 | miniprogramState: formal | ||
24 | # 点击模板卡片后的默认跳转页面 | ||
25 | page: pages/index/main | ||
26 | # 生成带参数二维码的有效期 | ||
27 | qrCodeExpireSeconds: 86400 | ||
28 | env: dev | ||
29 | # 订阅号 | ||
30 | - appid: wx5d88c7fe99f89f32 | ||
31 | secret: b213afe99a469d4be576f330dad643b8 | ||
32 | token: topdraw | ||
33 | encodingAesKey: g3mYB6yx2ZiebxwKcI1H2iw3LlYNBHb7PqsVYFHUQzi | ||
34 | # 应用类型 小程序 服务号 订阅号, 当前基于订阅号有特殊逻辑 | ||
35 | appType: subscription | ||
36 | imagePath: /topdraw/app/user_center_service_te/upload/customer/weChat.png | ||
37 | content: 长按识别二维码,关注订阅号。 | ||
38 | miniprogramState: formal | ||
39 | # 点击模板卡片后的默认跳转页面 | ||
40 | page: pages/index/main | ||
41 | # 生成带参数二维码的有效期 | ||
42 | qrCodeExpireSeconds: 300 | ||
43 | env: dev | ||
24 | 44 | ||
25 | task: | 45 | #第三方接口 |
26 | pool: | 46 | api: |
27 | # 核心线程池大小 | 47 | # ucs |
28 | core-pool-size: 16 | 48 | uc-service: http://127.0.0.1:8446 |
29 | # 最大线程数 | ||
30 | max-pool-size: 35 | ||
31 | # 活跃时间 | ||
32 | keep-alive-seconds: 10 | ||
33 | # 队列容量 | ||
34 | queue-capacity: 300 | ||
35 | 49 | ||
36 | #登录图形验证码有效时间/分钟 | 50 | uc: |
37 | loginCode: | 51 | # 主会员是否启用,如果启用任务获得的积分将添加至小屏会员上 |
38 | expiration: 2 | 52 | validPriorityMember: 0 |
39 | |||
40 | #默认上传图片类型 | ||
41 | default-image-type: -1 | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment