1.优化
Showing
5 changed files
with
28 additions
and
10 deletions
| ... | @@ -73,16 +73,17 @@ public class MemberOperationController { | ... | @@ -73,16 +73,17 @@ public class MemberOperationController { |
| 73 | member.setVipExpireTime(vipExpireTime); | 73 | member.setVipExpireTime(vipExpireTime); |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | this.createVipHistory(memberDTO.getId(), vip, vipExpireTime); | 76 | this.createVipHistory(memberDTO.getId(), memberDTO.getCode(), vip, vipExpireTime); |
| 77 | 77 | ||
| 78 | this.memberOperationService.update(member); | 78 | this.memberOperationService.updateMemberVip(member); |
| 79 | return ResultInfo.success(); | 79 | return ResultInfo.success(); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | 82 | ||
| 83 | private void createVipHistory(Long memberId, Integer vip , Timestamp vipExpireTime){ | 83 | private void createVipHistory(Long memberId, String code, Integer vip , Timestamp vipExpireTime){ |
| 84 | BuyVipBean buyVipBean = new BuyVipBean(); | 84 | BuyVipBean buyVipBean = new BuyVipBean(); |
| 85 | buyVipBean.setMemberId(memberId); | 85 | buyVipBean.setMemberId(memberId); |
| 86 | buyVipBean.setMemberCode(code); | ||
| 86 | buyVipBean.setVip(vip); | 87 | buyVipBean.setVip(vip); |
| 87 | buyVipBean.setVipExpireTime(vipExpireTime); | 88 | buyVipBean.setVipExpireTime(vipExpireTime); |
| 88 | this.memberOperationService.buyVipByMemberId(buyVipBean); | 89 | this.memberOperationService.buyVipByMemberId(buyVipBean); | ... | ... |
| ... | @@ -99,7 +99,7 @@ public class UserOperationController { | ... | @@ -99,7 +99,7 @@ public class UserOperationController { |
| 99 | 99 | ||
| 100 | this.createVipHistory(userId, vip, vipExpireTime); | 100 | this.createVipHistory(userId, vip, vipExpireTime); |
| 101 | 101 | ||
| 102 | this.memberOperationService.update(member); | 102 | this.memberOperationService.updateMemberVip(member); |
| 103 | 103 | ||
| 104 | return ResultInfo.success(); | 104 | return ResultInfo.success(); |
| 105 | } | 105 | } | ... | ... |
| ... | @@ -10,6 +10,7 @@ import com.topdraw.business.module.member.service.MemberService; | ... | @@ -10,6 +10,7 @@ import com.topdraw.business.module.member.service.MemberService; |
| 10 | import com.topdraw.business.module.member.service.dto.MemberDTO; | 10 | import com.topdraw.business.module.member.service.dto.MemberDTO; |
| 11 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; | 11 | import com.topdraw.business.module.member.viphistory.domain.MemberVipHistory; |
| 12 | import com.topdraw.business.module.member.viphistory.service.MemberVipHistoryService; | 12 | import com.topdraw.business.module.member.viphistory.service.MemberVipHistoryService; |
| 13 | import com.topdraw.business.module.task.domain.Task; | ||
| 13 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; | 14 | import com.topdraw.business.module.user.weixin.domain.UserWeixin; |
| 14 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; | 15 | import com.topdraw.business.module.user.weixin.service.UserWeixinService; |
| 15 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; | 16 | import com.topdraw.business.module.user.weixin.service.dto.UserWeixinDTO; |
| ... | @@ -18,6 +19,7 @@ import com.topdraw.business.process.service.member.MemberOperationService; | ... | @@ -18,6 +19,7 @@ import com.topdraw.business.process.service.member.MemberOperationService; |
| 18 | import com.topdraw.business.process.service.member.MemberProfileOperationService; | 19 | import com.topdraw.business.process.service.member.MemberProfileOperationService; |
| 19 | import com.topdraw.exception.EntityNotFoundException; | 20 | import com.topdraw.exception.EntityNotFoundException; |
| 20 | import com.topdraw.util.TimestampUtil; | 21 | import com.topdraw.util.TimestampUtil; |
| 22 | import org.springframework.aop.framework.AopContext; | ||
| 21 | import org.springframework.beans.BeanUtils; | 23 | import org.springframework.beans.BeanUtils; |
| 22 | import org.springframework.beans.factory.annotation.Autowired; | 24 | import org.springframework.beans.factory.annotation.Autowired; |
| 23 | import org.springframework.cache.annotation.CacheConfig; | 25 | import org.springframework.cache.annotation.CacheConfig; |
| ... | @@ -48,6 +50,10 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -48,6 +50,10 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 48 | @Autowired | 50 | @Autowired |
| 49 | private ThreadPoolTaskExecutor threadPoolTaskExecutor; | 51 | private ThreadPoolTaskExecutor threadPoolTaskExecutor; |
| 50 | 52 | ||
| 53 | |||
| 54 | @AsyncMqSend | ||
| 55 | public void asyncUpdateMemberVip(MemberDTO me) {} | ||
| 56 | |||
| 51 | // @CachePut(key = "#resources.memberId") | 57 | // @CachePut(key = "#resources.memberId") |
| 52 | @Override | 58 | @Override |
| 53 | public MemberDTO buyVipByUserId(BuyVipBean resources) { | 59 | public MemberDTO buyVipByUserId(BuyVipBean resources) { |
| ... | @@ -115,7 +121,6 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -115,7 +121,6 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 115 | } | 121 | } |
| 116 | 122 | ||
| 117 | @AsyncMqSend | 123 | @AsyncMqSend |
| 118 | // @CachePut(value = "ucs::member", key = "#resources.id") | ||
| 119 | @Override | 124 | @Override |
| 120 | public MemberDTO update(Member resources) { | 125 | public MemberDTO update(Member resources) { |
| 121 | MemberDTO memberDTO = this.memberService.update(resources); | 126 | MemberDTO memberDTO = this.memberService.update(resources); |
| ... | @@ -174,6 +179,13 @@ public class MemberOperationServiceImpl implements MemberOperationService { | ... | @@ -174,6 +179,13 @@ public class MemberOperationServiceImpl implements MemberOperationService { |
| 174 | } | 179 | } |
| 175 | 180 | ||
| 176 | @Override | 181 | @Override |
| 182 | public MemberDTO updateMemberVip(Member member) { | ||
| 183 | MemberDTO memberDTO = this.update(member); | ||
| 184 | ((MemberOperationServiceImpl) AopContext.currentProxy()).asyncUpdateMemberVip(memberDTO); | ||
| 185 | return memberDTO; | ||
| 186 | } | ||
| 187 | |||
| 188 | @Override | ||
| 177 | public MemberProfileDTO getMemberProfileAndCheckVip(Long memberId, String appid) { | 189 | public MemberProfileDTO getMemberProfileAndCheckVip(Long memberId, String appid) { |
| 178 | 190 | ||
| 179 | // 会员加密信息 | 191 | // 会员加密信息 | ... | ... |
| ... | @@ -86,4 +86,9 @@ public interface MemberOperationService { | ... | @@ -86,4 +86,9 @@ public interface MemberOperationService { |
| 86 | */ | 86 | */ |
| 87 | MemberDTO doUpdateMemberCoupon(Member resources); | 87 | MemberDTO doUpdateMemberCoupon(Member resources); |
| 88 | 88 | ||
| 89 | /** | ||
| 90 | * | ||
| 91 | * @param member | ||
| 92 | */ | ||
| 93 | MemberDTO updateMemberVip(Member member); | ||
| 89 | } | 94 | } | ... | ... |
| ... | @@ -2,12 +2,12 @@ | ... | @@ -2,12 +2,12 @@ |
| 2 | spring: | 2 | spring: |
| 3 | datasource: | 3 | datasource: |
| 4 | # 测试/演示库url: | 4 | # 测试/演示库url: |
| 5 | # url: jdbc:log4jdbc:mysql://122.112.214.149:3306/tj_user_admin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | 5 | url: jdbc:log4jdbc:mysql://122.112.214.149:3306/tj_user_admin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false |
| 6 | # username: root | ||
| 7 | # password: root | ||
| 8 | url: jdbc:log4jdbc:mysql://139.196.145.150:3306/ucs-small-sichuan?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | ||
| 9 | username: root | 6 | username: root |
| 10 | password: Tjlh@2021 | 7 | password: root |
| 8 | # url: jdbc:log4jdbc:mysql://139.196.145.150:3306/ucs-small-sichuan?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false | ||
| 9 | # username: root | ||
| 10 | # password: Tjlh@2021 | ||
| 11 | 11 | ||
| 12 | driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy | 12 | driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy |
| 13 | #Druid | 13 | #Druid | ... | ... |
-
Please register or sign in to post a comment