1.去除消费任务时的部分查询,直接将消息传递至uce
Showing
8 changed files
with
16 additions
and
41 deletions
... | @@ -12,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired; | ... | @@ -12,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired; |
12 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | 12 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
13 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
14 | 14 | ||
15 | import java.util.Objects; | ||
16 | |||
15 | /** | 17 | /** |
16 | * | 18 | * |
17 | */ | 19 | */ |
... | @@ -34,8 +36,10 @@ public class ExpOperationServiceImpl implements ExpOperationService { | ... | @@ -34,8 +36,10 @@ public class ExpOperationServiceImpl implements ExpOperationService { |
34 | public void asyncExpDetail(ExpDetail expDetail) { | 36 | public void asyncExpDetail(ExpDetail expDetail) { |
35 | String code = expDetail.getMemberCode(); | 37 | String code = expDetail.getMemberCode(); |
36 | MemberDTO memberDTO = this.memberService.findByCode(code); | 38 | MemberDTO memberDTO = this.memberService.findByCode(code); |
39 | if (Objects.nonNull(memberDTO.getId())) { | ||
37 | expDetail.setMemberId(memberDTO.getId()); | 40 | expDetail.setMemberId(memberDTO.getId()); |
38 | |||
39 | this.expDetailService.create(expDetail); | 41 | this.expDetailService.create(expDetail); |
40 | } | 42 | } |
43 | |||
44 | } | ||
41 | } | 45 | } | ... | ... |
... | @@ -7,29 +7,18 @@ import com.topdraw.business.module.member.service.dto.MemberDTO; | ... | @@ -7,29 +7,18 @@ import com.topdraw.business.module.member.service.dto.MemberDTO; |
7 | import com.topdraw.business.module.points.available.domain.PointsAvailable; | 7 | import com.topdraw.business.module.points.available.domain.PointsAvailable; |
8 | import com.topdraw.business.module.points.available.service.PointsAvailableService; | 8 | import com.topdraw.business.module.points.available.service.PointsAvailableService; |
9 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableDTO; | 9 | import com.topdraw.business.module.points.available.service.dto.PointsAvailableDTO; |
10 | import com.topdraw.business.module.points.detail.detailhistory.service.PointsDetailHistoryService; | ||
11 | import com.topdraw.business.module.points.detail.domain.PointsDetail; | 10 | import com.topdraw.business.module.points.detail.domain.PointsDetail; |
12 | import com.topdraw.business.module.points.detail.service.PointsDetailService; | 11 | import com.topdraw.business.module.points.detail.service.PointsDetailService; |
13 | import com.topdraw.business.module.points.service.PointsService; | ||
14 | import com.topdraw.business.process.domian.TempPoints; | ||
15 | import com.topdraw.business.process.service.PointsOperationService; | 12 | import com.topdraw.business.process.service.PointsOperationService; |
16 | import com.topdraw.business.process.service.member.MemberOperationService; | ||
17 | import com.topdraw.util.IdWorker; | ||
18 | import com.topdraw.util.TimestampUtil; | ||
19 | import com.topdraw.utils.StringUtils; | 13 | import com.topdraw.utils.StringUtils; |
20 | import lombok.extern.slf4j.Slf4j; | 14 | import lombok.extern.slf4j.Slf4j; |
21 | import org.springframework.beans.BeanUtils; | ||
22 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
23 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | 16 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
24 | import org.springframework.stereotype.Service; | 17 | import org.springframework.stereotype.Service; |
25 | import org.springframework.transaction.annotation.Propagation; | 18 | import org.springframework.transaction.annotation.Propagation; |
26 | import org.springframework.transaction.annotation.Transactional; | 19 | import org.springframework.transaction.annotation.Transactional; |
27 | import org.springframework.util.CollectionUtils; | ||
28 | 20 | ||
29 | import javax.validation.constraints.NotNull; | ||
30 | import java.time.LocalDateTime; | ||
31 | import java.util.*; | 21 | import java.util.*; |
32 | import java.util.stream.Collectors; | ||
33 | 22 | ||
34 | /** | 23 | /** |
35 | * | 24 | * |
... | @@ -56,23 +45,29 @@ public class PointsOperationServiceImpl implements PointsOperationService { | ... | @@ -56,23 +45,29 @@ public class PointsOperationServiceImpl implements PointsOperationService { |
56 | return; | 45 | return; |
57 | } | 46 | } |
58 | MemberDTO memberDTO = this.memberService.findByCode(code); | 47 | MemberDTO memberDTO = this.memberService.findByCode(code); |
48 | if (Objects.nonNull(memberDTO.getId())) { | ||
59 | member.setId(memberDTO.getId()); | 49 | member.setId(memberDTO.getId()); |
60 | this.memberService.doUpdateMemberPoints(member); | 50 | this.memberService.doUpdateMemberPoints(member); |
61 | } | 51 | } |
52 | } | ||
62 | 53 | ||
63 | public void asyncPointsAvailable(PointsAvailable pointsAvailable) { | 54 | public void asyncPointsAvailable(PointsAvailable pointsAvailable) { |
64 | String memberCode = pointsAvailable.getMemberCode(); | 55 | String memberCode = pointsAvailable.getMemberCode(); |
65 | MemberDTO memberDTO = this.memberService.findByCode(memberCode); | 56 | MemberDTO memberDTO = this.memberService.findByCode(memberCode); |
57 | if (Objects.nonNull(memberDTO.getId())) { | ||
66 | pointsAvailable.setMemberId(memberDTO.getId()); | 58 | pointsAvailable.setMemberId(memberDTO.getId()); |
67 | this.pointsAvailableService.create4Custom(pointsAvailable); | 59 | this.pointsAvailableService.create4Custom(pointsAvailable); |
68 | } | 60 | } |
61 | } | ||
69 | 62 | ||
70 | public void asyncPointsDetail(PointsDetail pointsDetail) { | 63 | public void asyncPointsDetail(PointsDetail pointsDetail) { |
71 | String memberCode = pointsDetail.getMemberCode(); | 64 | String memberCode = pointsDetail.getMemberCode(); |
72 | MemberDTO memberDTO = this.memberService.findByCode(memberCode); | 65 | MemberDTO memberDTO = this.memberService.findByCode(memberCode); |
66 | if (Objects.nonNull(memberDTO.getId())) { | ||
73 | pointsDetail.setMemberId(memberDTO.getId()); | 67 | pointsDetail.setMemberId(memberDTO.getId()); |
74 | this.pointsDetailService.create4Custom(pointsDetail); | 68 | this.pointsDetailService.create4Custom(pointsDetail); |
75 | } | 69 | } |
70 | } | ||
76 | 71 | ||
77 | public void asyncDeletePointsAvailable(PointsAvailable pointsAvailable) { | 72 | public void asyncDeletePointsAvailable(PointsAvailable pointsAvailable) { |
78 | String code = pointsAvailable.getCode(); | 73 | String code = pointsAvailable.getCode(); | ... | ... |
1 | package com.topdraw.config.redis; | 1 | package com.topdraw.config; |
2 | 2 | ||
3 | /** | 3 | /** |
4 | * @author : | 4 | * @author : |
5 | * @description: | 5 | * @description: |
6 | * @function : | 6 | * @function : |
7 | * @date :Created in 2022/6/18 17:22 | 7 | * @date :Created in 2022/6/13 11:22 |
8 | * @version: : | 8 | * @version: : |
9 | * @modified By: | 9 | * @modified By: |
10 | * @since : modified in 2022/6/18 17:22 | 10 | * @since : modified in 2022/6/13 11:22 |
11 | */ | 11 | */ |
12 | public class RedisKeyConstant { | 12 | public interface ResponseStatus { |
13 | 13 | ||
14 | Integer OK = 00000; | ||
14 | 15 | ||
15 | public static final String CACHE_PLATFROMACCOUNT_PLAYDURATION = "ucc::play::playduration::"; | ||
16 | } | 16 | } | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
... | @@ -28,23 +28,4 @@ public class DataSyncMsg implements Serializable { | ... | @@ -28,23 +28,4 @@ public class DataSyncMsg implements Serializable { |
28 | // 消息体 | 28 | // 消息体 |
29 | private String msgData; | 29 | private String msgData; |
30 | 30 | ||
31 | /** | ||
32 | * 消息体 | ||
33 | */ | ||
34 | @Data | ||
35 | @AllArgsConstructor | ||
36 | @NoArgsConstructor | ||
37 | public static class MsgData { | ||
38 | private Long memberId; // 会员id | ||
39 | private String memberCode; | ||
40 | private Long orderId; | ||
41 | private Long activityId; | ||
42 | private Long mediaId; | ||
43 | private Long itemId; | ||
44 | private String description; | ||
45 | |||
46 | private String param; | ||
47 | private String platformAccount; | ||
48 | } | ||
49 | |||
50 | } | 31 | } | ... | ... |
This diff is collapsed.
Click to expand it.
... | @@ -18,11 +18,6 @@ public class RestTemplateTest extends BaseTest { | ... | @@ -18,11 +18,6 @@ public class RestTemplateTest extends BaseTest { |
18 | @Autowired | 18 | @Autowired |
19 | RestTemplateClient apiUtil; | 19 | RestTemplateClient apiUtil; |
20 | 20 | ||
21 | @Test | ||
22 | public void t(){ | ||
23 | JSONObject memberInfo = this.apiUtil.getMemberInfo(5L); | ||
24 | System.out.println(memberInfo); | ||
25 | } | ||
26 | 21 | ||
27 | @Test | 22 | @Test |
28 | public void error(){ | 23 | public void error(){ | ... | ... |
-
Please register or sign in to post a comment