V1.0.2.REALESE
Showing
14 changed files
with
51 additions
and
47 deletions
| ... | @@ -73,7 +73,9 @@ public class AsyncMqProducer { | ... | @@ -73,7 +73,9 @@ public class AsyncMqProducer { |
| 73 | boolean async = asyncMqSend.async(); | 73 | boolean async = asyncMqSend.async(); |
| 74 | if (async) { | 74 | if (async) { |
| 75 | // 异步 | 75 | // 异步 |
| 76 | this.threadPoolTaskExecutor.execute(()->this.sendMqMessage(tableOperationMsg)); | 76 | log.info("send message success"); |
| 77 | this.sendMqMessage(tableOperationMsg); | ||
| 78 | log.info("send message end"); | ||
| 77 | } else { | 79 | } else { |
| 78 | // 同步 | 80 | // 同步 |
| 79 | this.sendMqMessage(tableOperationMsg); | 81 | this.sendMqMessage(tableOperationMsg); | ... | ... |
| ... | @@ -25,18 +25,6 @@ public class MemberController { | ... | @@ -25,18 +25,6 @@ public class MemberController { |
| 25 | @Autowired | 25 | @Autowired |
| 26 | private MemberService memberService; | 26 | private MemberService memberService; |
| 27 | 27 | ||
| 28 | /* @GetMapping(value = "/pageMembers") | ||
| 29 | @ApiOperation("查询Member") | ||
| 30 | public ResultInfo pageMembers(MemberQueryCriteria criteria, Pageable pageable) { | ||
| 31 | return ResultInfo.successPage(memberService.queryAll(criteria,pageable)); | ||
| 32 | } | ||
| 33 | |||
| 34 | @GetMapping(value = "/findById/{id}") | ||
| 35 | @ApiOperation("查询指定Member") | ||
| 36 | public ResultInfo findById(@PathVariable("id") Long id) { | ||
| 37 | return ResultInfo.success(memberService.findById(id)); | ||
| 38 | } | ||
| 39 | */ | ||
| 40 | @Log | 28 | @Log |
| 41 | @PostMapping(value = "/create") | 29 | @PostMapping(value = "/create") |
| 42 | @ApiOperation("新增Member") | 30 | @ApiOperation("新增Member") |
| ... | @@ -46,14 +34,9 @@ public class MemberController { | ... | @@ -46,14 +34,9 @@ public class MemberController { |
| 46 | } | 34 | } |
| 47 | 35 | ||
| 48 | @Log | 36 | @Log |
| 49 | @PutMapping(value = "/doUpdateVip") | 37 | @PostMapping(value = "/doUpdateVip") |
| 50 | @ApiOperation("修改Member等级") | 38 | @ApiOperation("修改Member等级") |
| 51 | public ResultInfo doUpdateVip(Long memberId , Integer vip) { | 39 | public ResultInfo doUpdateVip(@RequestBody Member member) { |
| 52 | Assert.isNull(memberId,"MemberController -->> doUpdateVip -->>【memberId】 not be null!!"); | ||
| 53 | Assert.isNull(vip,"MemberController -->> doUpdateVip -->>【vip】 not be null!!"); | ||
| 54 | Member member = new Member(); | ||
| 55 | member.setId(memberId); | ||
| 56 | member.setVip(vip); | ||
| 57 | memberService.update(member); | 40 | memberService.update(member); |
| 58 | return ResultInfo.success(); | 41 | return ResultInfo.success(); |
| 59 | } | 42 | } | ... | ... |
| ... | @@ -26,8 +26,8 @@ public class CouponOperationController { | ... | @@ -26,8 +26,8 @@ public class CouponOperationController { |
| 26 | @Log | 26 | @Log |
| 27 | @PostMapping(value = "/grantCouponByManual") | 27 | @PostMapping(value = "/grantCouponByManual") |
| 28 | @ApiOperation("手动发放优惠券") | 28 | @ApiOperation("手动发放优惠券") |
| 29 | public ResultInfo grantCouponByManual(Long memberId , Long userId , List<TempCoupon> tempCouponList) { | 29 | public ResultInfo grantCouponByManual(List<TempCoupon> tempCouponList) { |
| 30 | this.couponOperationService.grantCouponByManual(memberId,userId,tempCouponList); | 30 | this.couponOperationService.grantCouponByManual(tempCouponList); |
| 31 | return ResultInfo.success(); | 31 | return ResultInfo.success(); |
| 32 | } | 32 | } |
| 33 | 33 | ... | ... |
| ... | @@ -89,7 +89,7 @@ public class PointsOperationController { | ... | @@ -89,7 +89,7 @@ public class PointsOperationController { |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | @Log | 91 | @Log |
| 92 | @PostMapping(value = "/customPoints") | 92 | @PostMapping(value = "/consumePoints") |
| 93 | @ApiOperation("积分消耗") | 93 | @ApiOperation("积分消耗") |
| 94 | public ResultInfo customPoints(@Validated @RequestBody TempPoints tempPoints) { | 94 | public ResultInfo customPoints(@Validated @RequestBody TempPoints tempPoints) { |
| 95 | this.pointsOperationService.customPoints(tempPoints); | 95 | this.pointsOperationService.customPoints(tempPoints); | ... | ... |
| ... | @@ -22,9 +22,7 @@ public interface CouponOperationService { | ... | @@ -22,9 +22,7 @@ public interface CouponOperationService { |
| 22 | 22 | ||
| 23 | /** | 23 | /** |
| 24 | * 系统手动发放优惠券 | 24 | * 系统手动发放优惠券 |
| 25 | * @param memberId | ||
| 26 | * @param userId | ||
| 27 | * @param tempCouponList | 25 | * @param tempCouponList |
| 28 | */ | 26 | */ |
| 29 | void grantCouponByManual(Long memberId,Long userId ,List<TempCoupon> tempCouponList); | 27 | void grantCouponByManual(List<TempCoupon> tempCouponList); |
| 30 | } | 28 | } | ... | ... |
| 1 | package com.topdraw.business.process.service; | 1 | package com.topdraw.business.process.service; |
| 2 | 2 | ||
| 3 | import com.topdraw.common.ResultInfo; | ||
| 3 | import com.topdraw.module.mq.DataSyncMsg; | 4 | import com.topdraw.module.mq.DataSyncMsg; |
| 4 | 5 | ||
| 5 | /** | 6 | /** |
| ... | @@ -14,7 +15,7 @@ public interface TaskOperationService { | ... | @@ -14,7 +15,7 @@ public interface TaskOperationService { |
| 14 | * | 15 | * |
| 15 | * @param content 任务对象 | 16 | * @param content 任务对象 |
| 16 | */ | 17 | */ |
| 17 | void dealTask(String content); | 18 | ResultInfo dealTask(String content); |
| 18 | 19 | ||
| 19 | 20 | ||
| 20 | } | 21 | } | ... | ... |
| ... | @@ -61,16 +61,12 @@ public class CouponOperationServiceImpl implements CouponOperationService { | ... | @@ -61,16 +61,12 @@ public class CouponOperationServiceImpl implements CouponOperationService { |
| 61 | 61 | ||
| 62 | /** | 62 | /** |
| 63 | * 手动发放优惠券 | 63 | * 手动发放优惠券 |
| 64 | * @param memberId 会员id | ||
| 65 | * @param userId 账户id | ||
| 66 | * @param tempCouponList | 64 | * @param tempCouponList |
| 67 | */ | 65 | */ |
| 68 | @Override | 66 | @Override |
| 69 | public void grantCouponByManual(Long memberId,Long userId ,List<TempCoupon> tempCouponList) { | 67 | public void grantCouponByManual(List<TempCoupon> tempCouponList) { |
| 70 | // 优惠券领取、使用历史记录表 | 68 | // 优惠券领取、使用历史记录表 |
| 71 | for (TempCoupon tempCoupon : tempCouponList) { | 69 | for (TempCoupon tempCoupon : tempCouponList) { |
| 72 | tempCoupon.setMemberId(memberId); | ||
| 73 | tempCoupon.setUserId(userId); | ||
| 74 | this.refresh(tempCoupon); | 70 | this.refresh(tempCoupon); |
| 75 | } | 71 | } |
| 76 | } | 72 | } | ... | ... |
| ... | @@ -23,6 +23,7 @@ import com.topdraw.business.basicdata.task.service.TaskService; | ... | @@ -23,6 +23,7 @@ import com.topdraw.business.basicdata.task.service.TaskService; |
| 23 | import com.topdraw.business.basicdata.task.template.domain.TaskTemplate; | 23 | import com.topdraw.business.basicdata.task.template.domain.TaskTemplate; |
| 24 | import com.topdraw.business.basicdata.task.template.service.TaskTemplateService; | 24 | import com.topdraw.business.basicdata.task.template.service.TaskTemplateService; |
| 25 | import com.topdraw.business.process.domian.*; | 25 | import com.topdraw.business.process.domian.*; |
| 26 | import com.topdraw.common.ResultInfo; | ||
| 26 | import com.topdraw.module.mq.DataSyncMsg; | 27 | import com.topdraw.module.mq.DataSyncMsg; |
| 27 | import com.topdraw.util.*; | 28 | import com.topdraw.util.*; |
| 28 | import lombok.extern.slf4j.Slf4j; | 29 | import lombok.extern.slf4j.Slf4j; |
| ... | @@ -79,7 +80,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -79,7 +80,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
| 79 | private static final Integer POINTS_MIN = 1; | 80 | private static final Integer POINTS_MIN = 1; |
| 80 | 81 | ||
| 81 | @Override | 82 | @Override |
| 82 | public void dealTask(String content) { | 83 | public ResultInfo dealTask(String content) { |
| 83 | 84 | ||
| 84 | DataSyncMsg dataSyncMsg = JSONUtil.parseMsg2Object(content, DataSyncMsg.class); | 85 | DataSyncMsg dataSyncMsg = JSONUtil.parseMsg2Object(content, DataSyncMsg.class); |
| 85 | DataSyncMsg.MsgData msgData = dataSyncMsg.getMsg(); | 86 | DataSyncMsg.MsgData msgData = dataSyncMsg.getMsg(); |
| ... | @@ -88,6 +89,12 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -88,6 +89,12 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
| 88 | 89 | ||
| 89 | long l = System.currentTimeMillis(); | 90 | long l = System.currentTimeMillis(); |
| 90 | 91 | ||
| 92 | // 检查当前会员的黑名单状态 | ||
| 93 | boolean b = this.validatedMemberBlackStatus(memberId); | ||
| 94 | if (!b) { | ||
| 95 | return ResultInfo.forbidden(" 会员已被加入黑名单"); | ||
| 96 | } | ||
| 97 | |||
| 91 | // 1.通过任务标识获取任务模板,通过模板参数获取具体的模板 | 98 | // 1.通过任务标识获取任务模板,通过模板参数获取具体的模板 |
| 92 | TaskTemplate taskTemplate = this.getTaskTemplate(event); | 99 | TaskTemplate taskTemplate = this.getTaskTemplate(event); |
| 93 | // 2.通过任务模板获取对应的任务列表 | 100 | // 2.通过任务模板获取对应的任务列表 |
| ... | @@ -105,6 +112,8 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -105,6 +112,8 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
| 105 | 112 | ||
| 106 | long r = System.currentTimeMillis(); | 113 | long r = System.currentTimeMillis(); |
| 107 | LOG.info("总耗时======>>>>>" + (r-l)); | 114 | LOG.info("总耗时======>>>>>" + (r-l)); |
| 115 | return ResultInfo.success(); | ||
| 116 | |||
| 108 | 117 | ||
| 109 | } | 118 | } |
| 110 | 119 | ||
| ... | @@ -113,13 +122,13 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -113,13 +122,13 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
| 113 | * @param memberId | 122 | * @param memberId |
| 114 | * @return | 123 | * @return |
| 115 | */ | 124 | */ |
| 116 | private boolean validatedMember(Long memberId) { | 125 | private boolean validatedMemberBlackStatus(Long memberId) { |
| 117 | log.info("validatedMember -->>【memberId】 -->> " + memberId); | 126 | log.info("validatedMember -->>【memberId】 -->> " + memberId); |
| 118 | MemberDTO memberDTO = this.memberService.findById(memberId); | 127 | MemberDTO memberDTO = this.memberService.findById(memberId); |
| 119 | Long blackStatus = memberDTO.getBlackStatus(); | 128 | Long blackStatus = memberDTO.getBlackStatus(); |
| 120 | // TODO 检查balckStatus无法获取的原因 | 129 | // TODO 检查balckStatus无法获取的原因 |
| 121 | if (Objects.isNull(blackStatus) || blackStatus == 1) { | 130 | if (Objects.nonNull(blackStatus) && blackStatus == 1) { |
| 122 | log.error("validatedMember -->> 会员不存在或者已被加入黑名单 【blackStatus】 -->> " + blackStatus); | 131 | log.error("validatedMember -->> 会员已被加入黑名单 【blackStatus】 -->> " + blackStatus); |
| 123 | return false; | 132 | return false; |
| 124 | } | 133 | } |
| 125 | return true; | 134 | return true; |
| ... | @@ -653,7 +662,8 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -653,7 +662,8 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
| 653 | } | 662 | } |
| 654 | } | 663 | } |
| 655 | 664 | ||
| 656 | 665 | } else { | |
| 666 | return true; | ||
| 657 | } | 667 | } |
| 658 | return false; | 668 | return false; |
| 659 | } | 669 | } | ... | ... |
| 1 | #配置数据源 | 1 | #配置数据源 |
| 2 | spring: | 2 | spring: |
| 3 | datasource: | 3 | datasource: |
| 4 | # 测试/演示库 | 4 | # 测试/演示库url: |
| 5 | # url: jdbc:log4jdbc:mysql://139.196.192.242:3306/tj_user_0819?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | 5 | url: jdbc:log4jdbc:mysql://139.196.192.242:3306/tj_user_0819?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false |
| 6 | # username: root | ||
| 7 | # password: Tjlh@2017 | ||
| 8 | |||
| 9 | url: jdbc:log4jdbc:mysql://47.100.212.170:3306/ucs?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | ||
| 10 | username: root | 6 | username: root |
| 11 | password: Tjlh@2021 | 7 | password: Tjlh@2017 |
| 8 | |||
| 9 | |||
| 10 | # url: jdbc:log4jdbc:mysql://47.100.212.170:3306/ucs?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | ||
| 11 | # username: root | ||
| 12 | # password: Tjlh@2021 | ||
| 12 | 13 | ||
| 13 | # url: jdbc:log4jdbc:mysql://122.112.214.149:3306/tj_user?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | 14 | # url: jdbc:log4jdbc:mysql://122.112.214.149:3306/tj_user?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false |
| 14 | # username: root | 15 | # username: root | ... | ... |
| ... | @@ -20,6 +20,16 @@ public class MemberControllerTest extends BaseTest { | ... | @@ -20,6 +20,16 @@ public class MemberControllerTest extends BaseTest { |
| 20 | MemberController memberController; | 20 | MemberController memberController; |
| 21 | 21 | ||
| 22 | @Test | 22 | @Test |
| 23 | public void doUpdateVip(){ | ||
| 24 | Member member = new Member(); | ||
| 25 | member.setId(5L); | ||
| 26 | member.setVip(4); | ||
| 27 | String s = JSON.toJSONString(member); | ||
| 28 | ResultInfo byId = this.memberController.doUpdateVip(member); | ||
| 29 | LOG.info("===>>>"+byId); | ||
| 30 | } | ||
| 31 | |||
| 32 | @Test | ||
| 23 | public void update(){ | 33 | public void update(){ |
| 24 | Member member = new Member(); | 34 | Member member = new Member(); |
| 25 | member.setId(5L); | 35 | member.setId(5L); | ... | ... |
| ... | @@ -45,7 +45,7 @@ public class CouponOperationControllerTest extends BaseTest { | ... | @@ -45,7 +45,7 @@ public class CouponOperationControllerTest extends BaseTest { |
| 45 | 45 | ||
| 46 | String s = JSON.toJSONString(tempCouponList); | 46 | String s = JSON.toJSONString(tempCouponList); |
| 47 | // tempCouponList.add(tempCoupon1); | 47 | // tempCouponList.add(tempCoupon1); |
| 48 | ResultInfo byId = this.couponOperationController.grantCouponByManual(memberId,userId,tempCouponList); | 48 | ResultInfo byId = this.couponOperationController.grantCouponByManual(tempCouponList); |
| 49 | LOG.info("===>>>"+byId); | 49 | LOG.info("===>>>"+byId); |
| 50 | } | 50 | } |
| 51 | 51 | ... | ... |
| ... | @@ -33,7 +33,7 @@ public class TaskOperationControllerTest extends BaseTest { | ... | @@ -33,7 +33,7 @@ public class TaskOperationControllerTest extends BaseTest { |
| 33 | DataSyncMsg.MsgData msgData = new DataSyncMsg.MsgData(); | 33 | DataSyncMsg.MsgData msgData = new DataSyncMsg.MsgData(); |
| 34 | msgData.setEvent(6); // 类型 1-登录 2-观影 3-参加活动 4-订购 5-优享会员 6-签到 | 34 | msgData.setEvent(6); // 类型 1-登录 2-观影 3-参加活动 4-订购 5-优享会员 6-签到 |
| 35 | msgData.setRemarks("remark"); | 35 | msgData.setRemarks("remark"); |
| 36 | msgData.setMemberId(4L); | 36 | msgData.setMemberId(2261L); |
| 37 | msgData.setDeviceType(2); | 37 | msgData.setDeviceType(2); |
| 38 | msgData.setAppCode("WEI_XIN_GOLD_PANDA"); | 38 | msgData.setAppCode("WEI_XIN_GOLD_PANDA"); |
| 39 | dataSyncMsg.setMsg(msgData); | 39 | dataSyncMsg.setMsg(msgData); | ... | ... |
| 1 | package com.topdraw.test.business.process.service; | 1 | package com.topdraw.test.business.process.service; |
| 2 | 2 | ||
| 3 | import com.alibaba.fastjson.JSONObject; | ||
| 3 | import com.topdraw.business.basicdata.member.domain.Member; | 4 | import com.topdraw.business.basicdata.member.domain.Member; |
| 4 | import com.topdraw.business.process.service.MemberOperationService; | 5 | import com.topdraw.business.process.service.MemberOperationService; |
| 5 | import com.topdraw.BaseTest; | 6 | import com.topdraw.BaseTest; |
| ... | @@ -43,6 +44,8 @@ public class MemberOperationServiceTest extends BaseTest { | ... | @@ -43,6 +44,8 @@ public class MemberOperationServiceTest extends BaseTest { |
| 43 | member.setUserIptvId(1L); | 44 | member.setUserIptvId(1L); |
| 44 | member.setBindIptvPlatformType(0); | 45 | member.setBindIptvPlatformType(0); |
| 45 | member.setUpdateTime(TimestampUtil.now()); | 46 | member.setUpdateTime(TimestampUtil.now()); |
| 47 | String s = JSONObject.toJSONString(member); | ||
| 48 | |||
| 46 | this.memberOperationService.doUpdateMemberInfo(member); | 49 | this.memberOperationService.doUpdateMemberInfo(member); |
| 47 | } | 50 | } |
| 48 | 51 | ... | ... |
| ... | @@ -46,7 +46,7 @@ public class PointsOperationServiceTest extends BaseTest { | ... | @@ -46,7 +46,7 @@ public class PointsOperationServiceTest extends BaseTest { |
| 46 | 46 | ||
| 47 | @Test | 47 | @Test |
| 48 | public void cleanInvalidAvailablePoints() { | 48 | public void cleanInvalidAvailablePoints() { |
| 49 | Long memberId = 10L; | 49 | Long memberId = 169L; |
| 50 | this.pointsOperationService.cleanInvalidPointsAndCalculateCurrentPoints(memberId); | 50 | this.pointsOperationService.cleanInvalidPointsAndCalculateCurrentPoints(memberId); |
| 51 | } | 51 | } |
| 52 | 52 | ... | ... |
-
Please register or sign in to post a comment