1.修改部分接口返回值类型
Showing
3 changed files
with
14 additions
and
21 deletions
| ... | @@ -283,21 +283,21 @@ public class UserOperationController { | ... | @@ -283,21 +283,21 @@ public class UserOperationController { |
| 283 | @ApiOperation("同步大屏成长报告") | 283 | @ApiOperation("同步大屏成长报告") |
| 284 | @AnonymousAccess | 284 | @AnonymousAccess |
| 285 | public ResultInfo saveGrowthReport(@Validated @RequestBody String resources) { | 285 | public ResultInfo saveGrowthReport(@Validated @RequestBody String resources) { |
| 286 | log.info("同步大屏成长报告失败,参数 ==>> [saveGrowthReport#{}]", resources); | 286 | log.info("同步大屏成长报告,参数 ==>> [saveGrowthReport#{}]", resources); |
| 287 | GrowthReportRequest growthReportRequest = JSON.parseObject(new String(Base64Utils.decode(resources.getBytes())), GrowthReportRequest.class); | 287 | GrowthReportRequest growthReportRequest = JSON.parseObject(new String(Base64Utils.decode(resources.getBytes())), GrowthReportRequest.class); |
| 288 | 288 | ||
| 289 | String platformAccount = growthReportRequest.getPlatformAccount(); | 289 | String platformAccount = growthReportRequest.getPlatformAccount(); |
| 290 | log.info("同步大屏成长报告消息,大屏账号 ==>> [saveGrowthReport#{}]", platformAccount); | ||
| 290 | List<GrowthReportRequest.CategoryContent> playDurationWithCategory = growthReportRequest.getPlayDurationWithCategory(); | 291 | List<GrowthReportRequest.CategoryContent> playDurationWithCategory = growthReportRequest.getPlayDurationWithCategory(); |
| 292 | log.info("同步大屏成长报告消息主体,消息体 ==>> [saveGrowthReport#{}]", playDurationWithCategory); | ||
| 291 | if (!CollectionUtils.isEmpty(playDurationWithCategory)) { | 293 | if (!CollectionUtils.isEmpty(playDurationWithCategory)) { |
| 292 | GrowthReport growthReport = new GrowthReport(); | 294 | GrowthReport growthReport = new GrowthReport(); |
| 293 | growthReport.setPlatformAccount(platformAccount); | 295 | growthReport.setPlatformAccount(platformAccount); |
| 294 | 296 | ||
| 295 | JSONObject jsonObject = new JSONObject(); | 297 | JSONObject jsonObject = new JSONObject(); |
| 296 | // jsonObject.put("playDurationWithCategory", JSONArray.toJSONString(playDurationWithCategory)); | ||
| 297 | jsonObject.put("playDurationWithCategory", playDurationWithCategory); | 298 | jsonObject.put("playDurationWithCategory", playDurationWithCategory); |
| 298 | growthReport.setData(jsonObject.toJSONString()); | 299 | growthReport.setData(jsonObject.toJSONString()); |
| 299 | boolean result = this.userOperationService.saveGrowthReport(growthReport); | 300 | return this.userOperationService.saveGrowthReport(growthReport); |
| 300 | return ResultInfo.success(result); | ||
| 301 | } | 301 | } |
| 302 | 302 | ||
| 303 | return ResultInfo.failure("保存失败"); | 303 | return ResultInfo.failure("保存失败"); |
| ... | @@ -595,7 +595,7 @@ public class UserOperationController { | ... | @@ -595,7 +595,7 @@ public class UserOperationController { |
| 595 | } else { | 595 | } else { |
| 596 | 596 | ||
| 597 | // 账号存在,未关注 | 597 | // 账号存在,未关注 |
| 598 | if (userWeixinDTO.getStatus() != SUBSCRIBE_STATUS) { | 598 | if (!userWeixinDTO.getStatus().equals(SUBSCRIBE_STATUS)) { |
| 599 | result = UNSUBSCRIBE; | 599 | result = UNSUBSCRIBE; |
| 600 | } | 600 | } |
| 601 | 601 | ||
| ... | @@ -658,7 +658,7 @@ public class UserOperationController { | ... | @@ -658,7 +658,7 @@ public class UserOperationController { |
| 658 | String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8"); | 658 | String headimgurlDecode = URLDecoder.decode(headimgurl, "UTF-8"); |
| 659 | // String imageEncode = Base64Util.encode(headimgurlDecode); | 659 | // String imageEncode = Base64Util.encode(headimgurlDecode); |
| 660 | String image = RestTemplateClient.netImage(headimgurlDecode); | 660 | String image = RestTemplateClient.netImage(headimgurlDecode); |
| 661 | memberDTO.setAvatarUrl(StringUtils.isNotBlank(image) == true ? image:headimgurlDecode); | 661 | memberDTO.setAvatarUrl(StringUtils.isNotBlank(image) ? image:headimgurlDecode); |
| 662 | } | 662 | } |
| 663 | 663 | ||
| 664 | } | 664 | } |
| ... | @@ -693,8 +693,7 @@ public class UserOperationController { | ... | @@ -693,8 +693,7 @@ public class UserOperationController { |
| 693 | private String downloadWeixinImge(String headimgurl){ | 693 | private String downloadWeixinImge(String headimgurl){ |
| 694 | try { | 694 | try { |
| 695 | if (StringUtils.isNotBlank(headimgurl)) { | 695 | if (StringUtils.isNotBlank(headimgurl)) { |
| 696 | String image = RestTemplateClient.netImage(headimgurl); | 696 | return RestTemplateClient.netImage(headimgurl); |
| 697 | return image; | ||
| 698 | } | 697 | } |
| 699 | } catch (Exception e) { | 698 | } catch (Exception e) { |
| 700 | log.info("头像解析失败!!!"); | 699 | log.info("头像解析失败!!!"); | ... | ... |
| ... | @@ -214,7 +214,7 @@ public interface UserOperationService { | ... | @@ -214,7 +214,7 @@ public interface UserOperationService { |
| 214 | * @param growthReport | 214 | * @param growthReport |
| 215 | * @return | 215 | * @return |
| 216 | */ | 216 | */ |
| 217 | boolean saveGrowthReport(GrowthReport growthReport); | 217 | ResultInfo saveGrowthReport(GrowthReport growthReport); |
| 218 | 218 | ||
| 219 | 219 | ||
| 220 | boolean appCancellation(UserApp userApp); | 220 | boolean appCancellation(UserApp userApp); | ... | ... |
| ... | @@ -173,15 +173,7 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -173,15 +173,7 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 173 | Integer accountType = resources.getAccountType(); | 173 | Integer accountType = resources.getAccountType(); |
| 174 | UserAppBindDTO userAppBindDTO = this.userAppBindService.findFirstByAccountAndAccountType(account, accountType); | 174 | UserAppBindDTO userAppBindDTO = this.userAppBindService.findFirstByAccountAndAccountType(account, accountType); |
| 175 | if (Objects.nonNull(userAppBindDTO.getId())) { | 175 | if (Objects.nonNull(userAppBindDTO.getId())) { |
| 176 | 176 | return this.userAppBindService.cancelUserAppBind(account, accountType); | |
| 177 | boolean result = this.userAppBindService.cancelUserAppBind(account, accountType); | ||
| 178 | /* if (result) { | ||
| 179 | UserAppBindDTO _userAppBindDTO = new UserAppBindDTO(); | ||
| 180 | _userAppBindDTO.setAccount(account); | ||
| 181 | _userAppBindDTO.setAccountType(accountType); | ||
| 182 | ((UserOperationServiceImpl) AopContext.currentProxy()).asyncCancelUserAppBind(_userAppBindDTO); | ||
| 183 | }*/ | ||
| 184 | return result; | ||
| 185 | } | 177 | } |
| 186 | return false; | 178 | return false; |
| 187 | } | 179 | } |
| ... | @@ -279,13 +271,13 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -279,13 +271,13 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 279 | 271 | ||
| 280 | @Override | 272 | @Override |
| 281 | @Transactional(rollbackFor = Exception.class) | 273 | @Transactional(rollbackFor = Exception.class) |
| 282 | public boolean saveGrowthReport(GrowthReport growthReport) { | 274 | public ResultInfo saveGrowthReport(GrowthReport growthReport) { |
| 283 | String platformAccount = growthReport.getPlatformAccount(); | 275 | String platformAccount = growthReport.getPlatformAccount(); |
| 284 | 276 | ||
| 285 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); | 277 | UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); |
| 286 | if (Objects.isNull(userTvDTO.getId())) { | 278 | if (Objects.isNull(userTvDTO.getId())) { |
| 287 | log.error("保存成长报告失败,大屏信息不存在[saveGrowthReport#]"); | 279 | log.error("保存成长报告失败,大屏信息不存在[saveGrowthReport#]"); |
| 288 | return false; | 280 | return ResultInfo.failure("保存成长报告失败,大屏信息不存在"); |
| 289 | } | 281 | } |
| 290 | 282 | ||
| 291 | String weekFirstDay = com.topdraw.util.DateUtil.getWeekFirstDay(); | 283 | String weekFirstDay = com.topdraw.util.DateUtil.getWeekFirstDay(); |
| ... | @@ -298,14 +290,16 @@ public class UserOperationServiceImpl implements UserOperationService { | ... | @@ -298,14 +290,16 @@ public class UserOperationServiceImpl implements UserOperationService { |
| 298 | growthReport.setMemberId(memberId); | 290 | growthReport.setMemberId(memberId); |
| 299 | growthReport.setStartDate(weekFirstDay); | 291 | growthReport.setStartDate(weekFirstDay); |
| 300 | growthReport.setEndDate(weekLastDay); | 292 | growthReport.setEndDate(weekLastDay); |
| 293 | log.info("保存成长报告,参数[saveGrowthReport#{}]", growthReport); | ||
| 301 | this.growthReportService.create(growthReport); | 294 | this.growthReportService.create(growthReport); |
| 302 | } else { | 295 | } else { |
| 296 | log.info("修改成长报告,参数[saveGrowthReport#{}]", growthReport); | ||
| 303 | this.growthReportService.updateGrowthReportData(growthReportDTO.getId(), growthReport.getData()); | 297 | this.growthReportService.updateGrowthReportData(growthReportDTO.getId(), growthReport.getData()); |
| 304 | } | 298 | } |
| 305 | 299 | ||
| 306 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncsaveGrowthReport(growthReport); | 300 | ((UserOperationServiceImpl)AopContext.currentProxy()).asyncsaveGrowthReport(growthReport); |
| 307 | 301 | ||
| 308 | return false; | 302 | return ResultInfo.success("保存成功"); |
| 309 | } | 303 | } |
| 310 | 304 | ||
| 311 | @Override | 305 | @Override | ... | ... |
-
Please register or sign in to post a comment