修复可用积分查询报空
Showing
20 changed files
with
107 additions
and
47 deletions
... | @@ -38,7 +38,6 @@ public class AsyncMqProducer { | ... | @@ -38,7 +38,6 @@ public class AsyncMqProducer { |
38 | 38 | ||
39 | @After("sendMqMsg(asyncMqSend)") | 39 | @After("sendMqMsg(asyncMqSend)") |
40 | public void doAfter(JoinPoint joinPoint, AsyncMqSend asyncMqSend){ | 40 | public void doAfter(JoinPoint joinPoint, AsyncMqSend asyncMqSend){ |
41 | LOG.info("AsyncMqProducer ===>>> doAfter ====>> start"); | ||
42 | boolean open = asyncMqSend.open(); | 41 | boolean open = asyncMqSend.open(); |
43 | if (open) { | 42 | if (open) { |
44 | try { | 43 | try { |
... | @@ -47,11 +46,9 @@ public class AsyncMqProducer { | ... | @@ -47,11 +46,9 @@ public class AsyncMqProducer { |
47 | e.printStackTrace(); | 46 | e.printStackTrace(); |
48 | } | 47 | } |
49 | } | 48 | } |
50 | LOG.info("AsyncMqProducer ===>>> doAfter ====>> end ===>> " ); | ||
51 | } | 49 | } |
52 | 50 | ||
53 | private void doTask(JoinPoint joinPoint, AsyncMqSend asyncMqSend) { | 51 | private void doTask(JoinPoint joinPoint, AsyncMqSend asyncMqSend) { |
54 | LOG.info("AsyncMqProducer ===>>> doTask ====>> start ===>> " ); | ||
55 | 52 | ||
56 | String entityName = asyncMqSend.entityName(); | 53 | String entityName = asyncMqSend.entityName(); |
57 | String methodName = asyncMqSend.method(); | 54 | String methodName = asyncMqSend.method(); |
... | @@ -81,8 +78,6 @@ public class AsyncMqProducer { | ... | @@ -81,8 +78,6 @@ public class AsyncMqProducer { |
81 | // 同步 | 78 | // 同步 |
82 | this.sendMqMessage(tableOperationMsg); | 79 | this.sendMqMessage(tableOperationMsg); |
83 | } | 80 | } |
84 | |||
85 | LOG.info("AsyncMqProducer ===>>> doTask ====>> end ===>> " ); | ||
86 | } | 81 | } |
87 | 82 | ||
88 | private void sendMqMessage(TableOperationMsg tableOperationMsg){ | 83 | private void sendMqMessage(TableOperationMsg tableOperationMsg){ | ... | ... |
... | @@ -77,7 +77,7 @@ public interface PointsAvailableRepository extends JpaRepository<PointsAvailable | ... | @@ -77,7 +77,7 @@ public interface PointsAvailableRepository extends JpaRepository<PointsAvailable |
77 | */ | 77 | */ |
78 | @Query(value = "SELECT sum(upa.points) AS pointsExpire from uc_points_available upa where upa.member_id = ?1 and upa.expire_time >= now()" | 78 | @Query(value = "SELECT sum(upa.points) AS pointsExpire from uc_points_available upa where upa.member_id = ?1 and upa.expire_time >= now()" |
79 | ,nativeQuery = true) | 79 | ,nativeQuery = true) |
80 | long findAvailablePointsByMemberId(long memberId); | 80 | Long findAvailablePointsByMemberId(long memberId); |
81 | 81 | ||
82 | List<PointsAvailable> findByMemberIdOrderByExpireTime(Long memberId); | 82 | List<PointsAvailable> findByMemberIdOrderByExpireTime(Long memberId); |
83 | 83 | ... | ... |
... | @@ -154,7 +154,8 @@ public class PointsAvailableServiceImpl implements PointsAvailableService { | ... | @@ -154,7 +154,8 @@ public class PointsAvailableServiceImpl implements PointsAvailableService { |
154 | 154 | ||
155 | @Override | 155 | @Override |
156 | public long findAvailablePointsByMemberId(long memberId) { | 156 | public long findAvailablePointsByMemberId(long memberId) { |
157 | return this.PointsAvailableRepository.findAvailablePointsByMemberId(memberId); | 157 | Long availablePoints = this.PointsAvailableRepository.findAvailablePointsByMemberId(memberId); |
158 | return availablePoints == null ? 0L : availablePoints; | ||
158 | } | 159 | } |
159 | 160 | ||
160 | @Override | 161 | @Override | ... | ... |
... | @@ -13,4 +13,6 @@ import java.util.Optional; | ... | @@ -13,4 +13,6 @@ import java.util.Optional; |
13 | public interface PermanentRightsRepository extends JpaRepository<PermanentRights, Long>, JpaSpecificationExecutor<PermanentRights> { | 13 | public interface PermanentRightsRepository extends JpaRepository<PermanentRights, Long>, JpaSpecificationExecutor<PermanentRights> { |
14 | 14 | ||
15 | Optional<PermanentRights> findFirstByCode(String code); | 15 | Optional<PermanentRights> findFirstByCode(String code); |
16 | |||
17 | PermanentRights findByLevel(Integer level); | ||
16 | } | 18 | } | ... | ... |
... | @@ -47,4 +47,11 @@ public interface PermanentRightsService { | ... | @@ -47,4 +47,11 @@ public interface PermanentRightsService { |
47 | * @return PermanentRightsDTO | 47 | * @return PermanentRightsDTO |
48 | */ | 48 | */ |
49 | PermanentRightsDTO getByCode(String code); | 49 | PermanentRightsDTO getByCode(String code); |
50 | |||
51 | /** | ||
52 | * 通过会员等级获取对应的永久权益 | ||
53 | * @param level | ||
54 | * @return | ||
55 | */ | ||
56 | PermanentRightsDTO findByLevel(Integer level); | ||
50 | } | 57 | } | ... | ... |
... | @@ -87,4 +87,10 @@ public class PermanentRightsServiceImpl implements PermanentRightsService { | ... | @@ -87,4 +87,10 @@ public class PermanentRightsServiceImpl implements PermanentRightsService { |
87 | return StringUtils.isNotEmpty(code) ? PermanentRightsMapper.toDto(PermanentRightsRepository.findFirstByCode(code).orElseGet(PermanentRights::new)) | 87 | return StringUtils.isNotEmpty(code) ? PermanentRightsMapper.toDto(PermanentRightsRepository.findFirstByCode(code).orElseGet(PermanentRights::new)) |
88 | : new PermanentRightsDTO(); | 88 | : new PermanentRightsDTO(); |
89 | } | 89 | } |
90 | |||
91 | @Override | ||
92 | public PermanentRightsDTO findByLevel(Integer level) { | ||
93 | PermanentRights PermanentRights = PermanentRightsRepository.findByLevel(level); | ||
94 | return PermanentRightsMapper.toDto(PermanentRights); | ||
95 | } | ||
90 | } | 96 | } | ... | ... |
1 | package com.topdraw.business.basicdata.task.progress.repository; | 1 | package com.topdraw.business.basicdata.task.progress.repository; |
2 | 2 | ||
3 | import com.topdraw.business.basicdata.task.progress.domain.TrTaskProgress; | 3 | import com.topdraw.business.basicdata.task.progress.domain.TrTaskProgress; |
4 | import com.topdraw.business.basicdata.task.progress.service.dto.TrTaskProgressDTO; | ||
4 | import org.springframework.data.jpa.repository.JpaRepository; | 5 | import org.springframework.data.jpa.repository.JpaRepository; |
5 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; | 6 | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
7 | import org.springframework.data.jpa.repository.Query; | ||
6 | 8 | ||
9 | import java.util.List; | ||
7 | import java.util.Optional; | 10 | import java.util.Optional; |
8 | 11 | ||
9 | /** | 12 | /** |
... | @@ -12,4 +15,8 @@ import java.util.Optional; | ... | @@ -12,4 +15,8 @@ import java.util.Optional; |
12 | */ | 15 | */ |
13 | public interface TrTaskProgressRepository extends JpaRepository<TrTaskProgress, Long>, JpaSpecificationExecutor<TrTaskProgress> { | 16 | public interface TrTaskProgressRepository extends JpaRepository<TrTaskProgress, Long>, JpaSpecificationExecutor<TrTaskProgress> { |
14 | 17 | ||
18 | @Query(value = "select id, member_id, task_id , current_action_amount , \n" + | ||
19 | " target_action_amount , `status` , completion_time,create_time,update_time from uc_tr_task_progress where member_id = ?1 \n" + | ||
20 | " and task_id = ?2 and Date(completion_time) = ?3 ",nativeQuery = true) | ||
21 | List<TrTaskProgress> findByMemberIdAndTaskIdAndCompletionTime(Long memberId, Long taskId, String time1); | ||
15 | } | 22 | } | ... | ... |
... | @@ -43,4 +43,5 @@ public interface TrTaskProgressService { | ... | @@ -43,4 +43,5 @@ public interface TrTaskProgressService { |
43 | 43 | ||
44 | void delete(Long id); | 44 | void delete(Long id); |
45 | 45 | ||
46 | List<TrTaskProgressDTO> findByMemberIdAndTaskIdAndCompletionTime(Long memberId, Long taskId, String time1); | ||
46 | } | 47 | } | ... | ... |
... | @@ -83,5 +83,10 @@ public class TrTaskProgressServiceImpl implements TrTaskProgressService { | ... | @@ -83,5 +83,10 @@ public class TrTaskProgressServiceImpl implements TrTaskProgressService { |
83 | TrTaskProgressRepository.delete(TrTaskProgress); | 83 | TrTaskProgressRepository.delete(TrTaskProgress); |
84 | } | 84 | } |
85 | 85 | ||
86 | @Override | ||
87 | public List<TrTaskProgressDTO> findByMemberIdAndTaskIdAndCompletionTime(Long memberId, Long taskId, String time1) { | ||
88 | return TrTaskProgressMapper.toDto(this.TrTaskProgressRepository.findByMemberIdAndTaskIdAndCompletionTime(memberId,taskId,time1)); | ||
89 | } | ||
90 | |||
86 | 91 | ||
87 | } | 92 | } | ... | ... |
... | @@ -60,7 +60,6 @@ public class PointsOperationController { | ... | @@ -60,7 +60,6 @@ public class PointsOperationController { |
60 | @ApiOperation("新增PointsDetail") | 60 | @ApiOperation("新增PointsDetail") |
61 | public ResultInfo grantPointsByManual(@Validated @RequestBody TempPoints tempPoints) { | 61 | public ResultInfo grantPointsByManual(@Validated @RequestBody TempPoints tempPoints) { |
62 | Long memberId = tempPoints.getMemberId(); | 62 | Long memberId = tempPoints.getMemberId(); |
63 | LOG.info("PointsOperationController -->> grantPointsByManual -->> " + tempPoints); | ||
64 | this.pointsOperationService.grantPointsByManual(memberId,tempPoints); | 63 | this.pointsOperationService.grantPointsByManual(memberId,tempPoints); |
65 | return ResultInfo.success(); | 64 | return ResultInfo.success(); |
66 | } | 65 | } | ... | ... |
... | @@ -8,7 +8,10 @@ import com.topdraw.business.process.service.CouponOperationService; | ... | @@ -8,7 +8,10 @@ import com.topdraw.business.process.service.CouponOperationService; |
8 | import com.topdraw.business.process.service.MemberOperationService; | 8 | import com.topdraw.business.process.service.MemberOperationService; |
9 | import com.topdraw.business.process.domian.TempCoupon; | 9 | import com.topdraw.business.process.domian.TempCoupon; |
10 | import com.topdraw.business.process.service.RightsOperationService; | 10 | import com.topdraw.business.process.service.RightsOperationService; |
11 | import com.topdraw.util.RedissonUtil; | ||
11 | import com.topdraw.util.TimestampUtil; | 12 | import com.topdraw.util.TimestampUtil; |
13 | import org.redisson.api.RLock; | ||
14 | import org.redisson.api.RedissonClient; | ||
12 | import org.slf4j.Logger; | 15 | import org.slf4j.Logger; |
13 | import org.slf4j.LoggerFactory; | 16 | import org.slf4j.LoggerFactory; |
14 | import org.springframework.beans.BeanUtils; | 17 | import org.springframework.beans.BeanUtils; |
... | @@ -35,6 +38,8 @@ public class CouponOperationServiceImpl implements CouponOperationService { | ... | @@ -35,6 +38,8 @@ public class CouponOperationServiceImpl implements CouponOperationService { |
35 | MemberOperationService memberOperationService; | 38 | MemberOperationService memberOperationService; |
36 | @Autowired | 39 | @Autowired |
37 | RightsOperationService rightsOperationService; | 40 | RightsOperationService rightsOperationService; |
41 | @Autowired | ||
42 | RedissonClient redissonClient; | ||
38 | 43 | ||
39 | // 过期阀值(默认一个月) | 44 | // 过期阀值(默认一个月) |
40 | private static final Integer EXPIRE_FACTOR_MONTH = 1; | 45 | private static final Integer EXPIRE_FACTOR_MONTH = 1; |
... | @@ -83,8 +88,9 @@ public class CouponOperationServiceImpl implements CouponOperationService { | ... | @@ -83,8 +88,9 @@ public class CouponOperationServiceImpl implements CouponOperationService { |
83 | private void refreshMemberCoupon(TempCoupon tempCoupon) { | 88 | private void refreshMemberCoupon(TempCoupon tempCoupon) { |
84 | Long userId = tempCoupon.getUserId(); | 89 | Long userId = tempCoupon.getUserId(); |
85 | Long memberId = tempCoupon.getMemberId(); | 90 | Long memberId = tempCoupon.getMemberId(); |
86 | try{ | 91 | RLock rLock = this.redissonClient.getLock("refreshMemberCoupon" + memberId.toString()); |
87 | // reentrantLock.lock(); | 92 | try { |
93 | RedissonUtil.lock(rLock); | ||
88 | // 1.获取用户领取的总优惠券 | 94 | // 1.获取用户领取的总优惠券 |
89 | Long totalCouponCount = this.getTotalCoupon(userId); | 95 | Long totalCouponCount = this.getTotalCoupon(userId); |
90 | // 2.获取已过期的优惠券数量 | 96 | // 2.获取已过期的优惠券数量 |
... | @@ -99,9 +105,8 @@ public class CouponOperationServiceImpl implements CouponOperationService { | ... | @@ -99,9 +105,8 @@ public class CouponOperationServiceImpl implements CouponOperationService { |
99 | e.printStackTrace(); | 105 | e.printStackTrace(); |
100 | throw e; | 106 | throw e; |
101 | } finally { | 107 | } finally { |
102 | // reentrantLock.unlock(); | 108 | RedissonUtil.unlock(rLock); |
103 | } | 109 | } |
104 | |||
105 | } | 110 | } |
106 | 111 | ||
107 | 112 | ... | ... |
... | @@ -10,8 +10,11 @@ import com.topdraw.business.process.service.ExpOperationService; | ... | @@ -10,8 +10,11 @@ import com.topdraw.business.process.service.ExpOperationService; |
10 | import com.topdraw.business.process.service.MemberOperationService; | 10 | import com.topdraw.business.process.service.MemberOperationService; |
11 | import com.topdraw.business.process.domian.TempExp; | 11 | import com.topdraw.business.process.domian.TempExp; |
12 | import com.topdraw.util.IdWorker; | 12 | import com.topdraw.util.IdWorker; |
13 | import com.topdraw.util.RedissonUtil; | ||
13 | import com.topdraw.util.TimestampUtil; | 14 | import com.topdraw.util.TimestampUtil; |
14 | import com.topdraw.utils.StringUtils; | 15 | import com.topdraw.utils.StringUtils; |
16 | import org.redisson.api.RLock; | ||
17 | import org.redisson.api.RedissonClient; | ||
15 | import org.slf4j.Logger; | 18 | import org.slf4j.Logger; |
16 | import org.slf4j.LoggerFactory; | 19 | import org.slf4j.LoggerFactory; |
17 | import org.springframework.beans.BeanUtils; | 20 | import org.springframework.beans.BeanUtils; |
... | @@ -21,9 +24,6 @@ import org.springframework.util.CollectionUtils; | ... | @@ -21,9 +24,6 @@ import org.springframework.util.CollectionUtils; |
21 | 24 | ||
22 | import java.util.List; | 25 | import java.util.List; |
23 | import java.util.Objects; | 26 | import java.util.Objects; |
24 | import java.util.concurrent.locks.Lock; | ||
25 | import java.util.concurrent.locks.ReentrantLock; | ||
26 | import java.util.concurrent.locks.ReentrantReadWriteLock; | ||
27 | 27 | ||
28 | /** | 28 | /** |
29 | * | 29 | * |
... | @@ -39,6 +39,8 @@ public class ExpOperationServiceImpl implements ExpOperationService { | ... | @@ -39,6 +39,8 @@ public class ExpOperationServiceImpl implements ExpOperationService { |
39 | MemberOperationService memberOperationService; | 39 | MemberOperationService memberOperationService; |
40 | @Autowired | 40 | @Autowired |
41 | MemberLevelService memberLevelService; | 41 | MemberLevelService memberLevelService; |
42 | @Autowired | ||
43 | RedissonClient redissonClient; | ||
42 | 44 | ||
43 | @Override | 45 | @Override |
44 | public void grantPointsThroughTempExp(List<TempExp> tempExpList) { | 46 | public void grantPointsThroughTempExp(List<TempExp> tempExpList) { |
... | @@ -83,17 +85,28 @@ public class ExpOperationServiceImpl implements ExpOperationService { | ... | @@ -83,17 +85,28 @@ public class ExpOperationServiceImpl implements ExpOperationService { |
83 | * @param tempExp 成长值列表 | 85 | * @param tempExp 成长值列表 |
84 | */ | 86 | */ |
85 | private void refreshMemberExpAndLevel(TempExp tempExp) { | 87 | private void refreshMemberExpAndLevel(TempExp tempExp) { |
88 | |||
86 | Long memberId = tempExp.getMemberId(); | 89 | Long memberId = tempExp.getMemberId(); |
87 | // 1.获取当前成长值 | 90 | |
88 | MemberDTO memberDTO = this.getMemberInfoByMemberId(memberId); | 91 | RLock rLock = this.redissonClient.getLock("refresh" + memberId.toString()); |
89 | // 2.获取下一级需要的成长值 | 92 | try { |
90 | MemberLevelDTO memberLevelDTO = this.getNextLevelExp(memberDTO.getLevel()+1,1); | 93 | RedissonUtil.lock(rLock); |
91 | // 3.成长值累加 | 94 | // 1.获取当前成长值 |
92 | Long newExp = memberDTO.getExp() + tempExp.getRewardExp(); | 95 | MemberDTO memberDTO = this.getMemberInfoByMemberId(memberId); |
93 | // 4.成长值比较,判断是否升级 | 96 | // 2.获取下一级需要的成长值 |
94 | long i = this.compareExp(newExp,memberLevelDTO); | 97 | MemberLevelDTO memberLevelDTO = this.getNextLevelExp(memberDTO.getLevel() + 1, 1); |
95 | // 5.更新用户信息 | 98 | // 3.成长值累加 |
96 | this.updateMemberInfo(i,newExp,memberLevelDTO,memberId); | 99 | Long newExp = memberDTO.getExp() + tempExp.getRewardExp(); |
100 | // 4.成长值比较,判断是否升级 | ||
101 | long i = this.compareExp(newExp, memberLevelDTO); | ||
102 | // 5.更新用户信息 | ||
103 | this.updateMemberInfo(i, newExp, memberLevelDTO, memberId); | ||
104 | } catch (Exception e) { | ||
105 | e.printStackTrace(); | ||
106 | throw e; | ||
107 | } finally { | ||
108 | RedissonUtil.unlock(rLock); | ||
109 | } | ||
97 | } | 110 | } |
98 | 111 | ||
99 | /** | 112 | /** | ... | ... |
... | @@ -14,8 +14,11 @@ import com.topdraw.business.process.service.MemberOperationService; | ... | @@ -14,8 +14,11 @@ import com.topdraw.business.process.service.MemberOperationService; |
14 | import com.topdraw.business.process.service.PointsOperationService; | 14 | import com.topdraw.business.process.service.PointsOperationService; |
15 | import com.topdraw.business.process.domian.TempPoints; | 15 | import com.topdraw.business.process.domian.TempPoints; |
16 | import com.topdraw.util.IdWorker; | 16 | import com.topdraw.util.IdWorker; |
17 | import com.topdraw.util.RedissonUtil; | ||
17 | import com.topdraw.util.TimestampUtil; | 18 | import com.topdraw.util.TimestampUtil; |
18 | import com.topdraw.utils.StringUtils; | 19 | import com.topdraw.utils.StringUtils; |
20 | import io.swagger.models.auth.In; | ||
21 | import org.redisson.api.RLock; | ||
19 | import org.redisson.api.RedissonClient; | 22 | import org.redisson.api.RedissonClient; |
20 | import org.slf4j.Logger; | 23 | import org.slf4j.Logger; |
21 | import org.slf4j.LoggerFactory; | 24 | import org.slf4j.LoggerFactory; |
... | @@ -30,6 +33,9 @@ import java.sql.Time; | ... | @@ -30,6 +33,9 @@ import java.sql.Time; |
30 | import java.sql.Timestamp; | 33 | import java.sql.Timestamp; |
31 | import java.time.LocalDateTime; | 34 | import java.time.LocalDateTime; |
32 | import java.util.*; | 35 | import java.util.*; |
36 | import java.util.concurrent.ForkJoinPool; | ||
37 | import java.util.concurrent.ForkJoinTask; | ||
38 | import java.util.concurrent.RecursiveTask; | ||
33 | import java.util.stream.Collectors; | 39 | import java.util.stream.Collectors; |
34 | 40 | ||
35 | /** | 41 | /** |
... | @@ -319,16 +325,25 @@ public class PointsOperationServiceImpl implements PointsOperationService { | ... | @@ -319,16 +325,25 @@ public class PointsOperationServiceImpl implements PointsOperationService { |
319 | */ | 325 | */ |
320 | private void refresh(TempPoints tempPoints) { | 326 | private void refresh(TempPoints tempPoints) { |
321 | Long memberId = tempPoints.getMemberId(); | 327 | Long memberId = tempPoints.getMemberId(); |
322 | // 1.可用总积分 | 328 | RLock rLock = this.redissonClient.getLock("refresh" + memberId.toString()); |
323 | long currentPoints = this.findAvailablePointsByMemberId(memberId); | 329 | try { |
324 | // 2.添加积分明细,并计算总积分 | 330 | RedissonUtil.lock(rLock); |
325 | long totalPoints = this.doInsertTrPointsDetail(memberId, tempPoints,currentPoints); | 331 | // 1.可用总积分 |
326 | // 3.获取即将过期的积分 | 332 | long currentPoints = this.findAvailablePointsByMemberId(memberId); |
327 | long soonExpireTime = this.getSoonExpirePoints(memberId,tempPoints); | 333 | // 2.添加积分明细,并计算总积分 |
328 | // 4.更新会员的总积分 | 334 | long totalPoints = this.doInsertTrPointsDetail(memberId, tempPoints, currentPoints); |
329 | this.freshMemberCurrentPoints(memberId,totalPoints,soonExpireTime); | 335 | // 3.获取即将过期的积分 |
330 | // 5.添加可用积分 | 336 | long soonExpireTime = this.getSoonExpirePoints(memberId, tempPoints); |
331 | this.doInsertTrPointsAvailable(tempPoints); | 337 | // 4.更新会员的总积分 |
338 | this.freshMemberCurrentPoints(memberId, totalPoints, soonExpireTime); | ||
339 | // 5.添加可用积分 | ||
340 | this.doInsertTrPointsAvailable(tempPoints); | ||
341 | } catch (Exception e) { | ||
342 | e.printStackTrace(); | ||
343 | throw e; | ||
344 | } finally { | ||
345 | RedissonUtil.unlock(rLock); | ||
346 | } | ||
332 | } | 347 | } |
333 | 348 | ||
334 | /** | 349 | /** |
... | @@ -382,7 +397,8 @@ public class PointsOperationServiceImpl implements PointsOperationService { | ... | @@ -382,7 +397,8 @@ public class PointsOperationServiceImpl implements PointsOperationService { |
382 | * @return | 397 | * @return |
383 | */ | 398 | */ |
384 | private long findAvailablePointsByMemberId(long memberId){ | 399 | private long findAvailablePointsByMemberId(long memberId){ |
385 | return this.pointsAvailableService.findAvailablePointsByMemberId(memberId); | 400 | long availablePointsByMemberId = this.pointsAvailableService.findAvailablePointsByMemberId(memberId); |
401 | return availablePointsByMemberId; | ||
386 | } | 402 | } |
387 | 403 | ||
388 | /** | 404 | /** | ... | ... |
... | @@ -137,20 +137,25 @@ public class RightsOperationServiceImpl implements RightsOperationService { | ... | @@ -137,20 +137,25 @@ public class RightsOperationServiceImpl implements RightsOperationService { |
137 | * @param tempRightsMap | 137 | * @param tempRightsMap |
138 | */ | 138 | */ |
139 | private void refresh(Map<RightType, Object> tempRightsMap) { | 139 | private void refresh(Map<RightType, Object> tempRightsMap) { |
140 | |||
140 | /*threadPoolTaskExecutor.execute(()->{ | 141 | /*threadPoolTaskExecutor.execute(()->{ |
142 | // 积分 | ||
141 | this.grantPoint((List<TempPoints>)tempRightsMap.get(RightType.POINTS)); | 143 | this.grantPoint((List<TempPoints>)tempRightsMap.get(RightType.POINTS)); |
142 | }); | 144 | }); |
145 | |||
143 | threadPoolTaskExecutor.execute(()->{ | 146 | threadPoolTaskExecutor.execute(()->{ |
147 | // 成长值 | ||
144 | this.grantExp((List<TempExp>)tempRightsMap.get(RightType.EXP)); | 148 | this.grantExp((List<TempExp>)tempRightsMap.get(RightType.EXP)); |
145 | }); | 149 | }); |
150 | |||
146 | threadPoolTaskExecutor.execute(()->{ | 151 | threadPoolTaskExecutor.execute(()->{ |
152 | // 优惠券 | ||
147 | this.grantCoupon((List<TempCoupon>)tempRightsMap.get(RightType.COUPON)); | 153 | this.grantCoupon((List<TempCoupon>)tempRightsMap.get(RightType.COUPON)); |
148 | });*/ | 154 | });*/ |
149 | 155 | ||
150 | this.grantPoint((List<TempPoints>)tempRightsMap.get(RightType.POINTS)); | 156 | this.grantPoint((List<TempPoints>)tempRightsMap.get(RightType.POINTS)); |
151 | this.grantExp((List<TempExp>)tempRightsMap.get(RightType.EXP)); | 157 | this.grantExp((List<TempExp>)tempRightsMap.get(RightType.EXP)); |
152 | this.grantCoupon((List<TempCoupon>)tempRightsMap.get(RightType.COUPON)); | 158 | this.grantCoupon((List<TempCoupon>)tempRightsMap.get(RightType.COUPON)); |
153 | |||
154 | } | 159 | } |
155 | 160 | ||
156 | /** | 161 | /** | ... | ... |
This diff is collapsed.
Click to expand it.
... | @@ -15,7 +15,6 @@ public class RabbitMqConfig { | ... | @@ -15,7 +15,6 @@ public class RabbitMqConfig { |
15 | public static final String UC_QUEUE_FANOUT_IPTV = "uc.fanout.iptv"; | 15 | public static final String UC_QUEUE_FANOUT_IPTV = "uc.fanout.iptv"; |
16 | public static final String UC_QUEUE_FANOUT_WEIXIN = "uc.fanout.weixin"; | 16 | public static final String UC_QUEUE_FANOUT_WEIXIN = "uc.fanout.weixin"; |
17 | 17 | ||
18 | |||
19 | @Bean | 18 | @Bean |
20 | FanoutExchange ucFanoutExchange(){ | 19 | FanoutExchange ucFanoutExchange(){ |
21 | return ExchangeBuilder.fanoutExchange(UC_EXCHANGE_FANOUT).build(); | 20 | return ExchangeBuilder.fanoutExchange(UC_EXCHANGE_FANOUT).build(); |
... | @@ -41,6 +40,4 @@ public class RabbitMqConfig { | ... | @@ -41,6 +40,4 @@ public class RabbitMqConfig { |
41 | return BindingBuilder.bind(ucFanoutQueueWeiXin).to(ucFanoutExchange); | 40 | return BindingBuilder.bind(ucFanoutQueueWeiXin).to(ucFanoutExchange); |
42 | } | 41 | } |
43 | 42 | ||
44 | |||
45 | |||
46 | } | 43 | } | ... | ... |
... | @@ -62,15 +62,16 @@ spring: | ... | @@ -62,15 +62,16 @@ spring: |
62 | #连接超时时间 | 62 | #连接超时时间 |
63 | timeout: 5000 | 63 | timeout: 5000 |
64 | rabbitmq: | 64 | rabbitmq: |
65 | host: 122.112.214.149 # rabbitmq的连接地址 | 65 | host: 47.100.212.170 # rabbitmq的连接地址 |
66 | # host: 122.112.214.149 # rabbitmq的连接地址 | ||
66 | #host: 139.196.192.242 # rabbitmq的连接地址 | 67 | #host: 139.196.192.242 # rabbitmq的连接地址 |
67 | port: 5672 # rabbitmq的连接端口号 | 68 | port: 5672 # rabbitmq的连接端口号 |
68 | #virtual-host: /member_center # rabbitmq的虚拟host | 69 | #virtual-host: /member_center # rabbitmq的虚拟host |
69 | #username: member_center # rabbitmq的用户名 | 70 | #username: member_center # rabbitmq的用户名 |
70 | #password: Tjlh@2021 # rabbitmq的密码 | 71 | #password: Tjlh@2021 # rabbitmq的密码 |
71 | virtual-host: / # rabbitmq的虚拟host | 72 | virtual-host: test # rabbitmq的虚拟host |
72 | username: guest # rabbitmq的用户名 | 73 | username: omo_test # rabbitmq的用户名 |
73 | password: guest # rabbitmq的密码 | 74 | password: omo_test # rabbitmq的密码 |
74 | publisher-confirms: true #如果对异步消息需要回调必须设置为true | 75 | publisher-confirms: true #如果对异步消息需要回调必须设置为true |
75 | 76 | ||
76 | #jwt。依赖的common中有需要jwt的部分属性。 | 77 | #jwt。依赖的common中有需要jwt的部分属性。 | ... | ... |
... | @@ -55,7 +55,7 @@ public class PointsOperationControllerTest extends BaseTest { | ... | @@ -55,7 +55,7 @@ public class PointsOperationControllerTest extends BaseTest { |
55 | TempPoints tempPoints = new TempPoints(); | 55 | TempPoints tempPoints = new TempPoints(); |
56 | tempPoints.setPoints(10L); | 56 | tempPoints.setPoints(10L); |
57 | tempPoints.setPointsType(0); | 57 | tempPoints.setPointsType(0); |
58 | tempPoints.setMemberId(2L); | 58 | tempPoints.setMemberId(3L); |
59 | tempPoints.setRightsSendStrategy(0); | 59 | tempPoints.setRightsSendStrategy(0); |
60 | tempPoints.setAccountId(2L); | 60 | tempPoints.setAccountId(2L); |
61 | tempPoints.setExpireTime(Timestamp.valueOf("2021-10-27 09:00:00")); | 61 | tempPoints.setExpireTime(Timestamp.valueOf("2021-10-27 09:00:00")); | ... | ... |
... | @@ -24,7 +24,7 @@ public class TaskOperationControllerTest extends BaseTest { | ... | @@ -24,7 +24,7 @@ public class TaskOperationControllerTest extends BaseTest { |
24 | DataSyncMsg.MsgData msgData = new DataSyncMsg.MsgData(); | 24 | DataSyncMsg.MsgData msgData = new DataSyncMsg.MsgData(); |
25 | msgData.setEvent(1); | 25 | msgData.setEvent(1); |
26 | msgData.setRemarks("remark"); | 26 | msgData.setRemarks("remark"); |
27 | msgData.setMemberId(1L); | 27 | msgData.setMemberId(3L); |
28 | msgData.setDeviceType(2); | 28 | msgData.setDeviceType(2); |
29 | msgData.setAppCode("WEI_XIN_GOLD_PANDA"); | 29 | msgData.setAppCode("WEI_XIN_GOLD_PANDA"); |
30 | dataSyncMsg.setMsg(msgData); | 30 | dataSyncMsg.setMsg(msgData); | ... | ... |
... | @@ -16,7 +16,7 @@ public class TaskOperationServiceTest extends BaseTest { | ... | @@ -16,7 +16,7 @@ public class TaskOperationServiceTest extends BaseTest { |
16 | 16 | ||
17 | @Test | 17 | @Test |
18 | public void dealTaskTest() { | 18 | public void dealTaskTest() { |
19 | Long memberId = 2L; | 19 | Long memberId = 3L; |
20 | DataSyncMsg dataSyncMsg = new DataSyncMsg(); | 20 | DataSyncMsg dataSyncMsg = new DataSyncMsg(); |
21 | // dataSyncMsg.setEntityType(EntityType.MEMBER); | 21 | // dataSyncMsg.setEntityType(EntityType.MEMBER); |
22 | dataSyncMsg.setEventType(EventType.LOGIN.name()); | 22 | dataSyncMsg.setEventType(EventType.LOGIN.name()); | ... | ... |
-
Please register or sign in to post a comment