Commit 0f17a33a 0f17a33a3bf76cad215979b4932b067a38af7e0b by xianghan

1.添加日志

1 parent 2477a356
...@@ -7,7 +7,6 @@ import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO; ...@@ -7,7 +7,6 @@ import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO;
7 import com.topdraw.business.process.service.member.MemberProfileOperationService; 7 import com.topdraw.business.process.service.member.MemberProfileOperationService;
8 import com.topdraw.common.ResultInfo; 8 import com.topdraw.common.ResultInfo;
9 import com.topdraw.business.module.member.profile.domain.MemberProfile; 9 import com.topdraw.business.module.member.profile.domain.MemberProfile;
10 import com.topdraw.business.module.member.profile.service.MemberProfileService;
11 import lombok.extern.slf4j.Slf4j; 10 import lombok.extern.slf4j.Slf4j;
12 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.validation.annotation.Validated; 12 import org.springframework.validation.annotation.Validated;
......
...@@ -4,8 +4,6 @@ import com.topdraw.annotation.AnonymousAccess; ...@@ -4,8 +4,6 @@ import com.topdraw.annotation.AnonymousAccess;
4 import com.topdraw.business.module.user.iptv.domain.UserTv; 4 import com.topdraw.business.module.user.iptv.domain.UserTv;
5 import com.topdraw.business.module.user.iptv.service.UserTvService; 5 import com.topdraw.business.module.user.iptv.service.UserTvService;
6 import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO; 6 import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO;
7 import com.topdraw.business.module.user.weixin.domain.UserWeixin;
8 import com.topdraw.business.module.user.weixin.service.UserWeixinService;
9 import com.topdraw.common.ResultInfo; 7 import com.topdraw.common.ResultInfo;
10 import com.topdraw.exception.BadRequestException; 8 import com.topdraw.exception.BadRequestException;
11 import com.topdraw.exception.GlobeExceptionMsg; 9 import com.topdraw.exception.GlobeExceptionMsg;
......
...@@ -82,9 +82,15 @@ public class UserOperationController { ...@@ -82,9 +82,15 @@ public class UserOperationController {
82 log.info("userOperation ==>> updateVipByUserId ==>> param ==>> [{}]",resources); 82 log.info("userOperation ==>> updateVipByUserId ==>> param ==>> [{}]",resources);
83 83
84 Integer vip = resources.getVip(); 84 Integer vip = resources.getVip();
85 if (Objects.isNull(vip) || vip < 1) {
86 return ResultInfo.failure("手动修改vip异常,参数错误,vip为空或者小于1");
87 }
85 Timestamp vipExpireTime = resources.getVipExpireTime(); 88 Timestamp vipExpireTime = resources.getVipExpireTime();
86 // 微信账号id 89 // 微信账号id
87 Long userId = resources.getUserId(); 90 Long userId = resources.getUserId();
91 if (Objects.isNull(userId)) {
92 return ResultInfo.failure("手动修改vip异常,参数错误,小屏账号id为空");
93 }
88 UserWeixinDTO userWeixinDTO = this.userOperationService.findById(userId); 94 UserWeixinDTO userWeixinDTO = this.userOperationService.findById(userId);
89 95
90 Long memberId = userWeixinDTO.getMemberId(); 96 Long memberId = userWeixinDTO.getMemberId();
...@@ -92,8 +98,12 @@ public class UserOperationController { ...@@ -92,8 +98,12 @@ public class UserOperationController {
92 98
93 MemberOperationBean memberOperationBean = new MemberOperationBean(); 99 MemberOperationBean memberOperationBean = new MemberOperationBean();
94 memberOperationBean.setMemberCode(memberDTO.getCode()); 100 memberOperationBean.setMemberCode(memberDTO.getCode());
95 memberOperationBean.setVip(vip); 101 if (vip < memberDTO.getVip()) {
102 vip = memberDTO.getVip();
103 } else {
96 memberOperationBean.setVipExpireTime(vipExpireTime); 104 memberOperationBean.setVipExpireTime(vipExpireTime);
105 }
106 memberOperationBean.setVip(vip);
97 107
98 MemberDTO memberDTO1 = this.memberOperationService.doUpdateVipByMemberCode(memberOperationBean); 108 MemberDTO memberDTO1 = this.memberOperationService.doUpdateVipByMemberCode(memberOperationBean);
99 109
...@@ -503,7 +513,11 @@ public class UserOperationController { ...@@ -503,7 +513,11 @@ public class UserOperationController {
503 String memberCode = resources.getMemberCode(); 513 String memberCode = resources.getMemberCode();
504 if (StringUtils.isBlank(memberCode) && Objects.nonNull(memberId)) { 514 if (StringUtils.isBlank(memberCode) && Objects.nonNull(memberId)) {
505 memberCode = this.memberService.findCodeById(memberId); 515 memberCode = this.memberService.findCodeById(memberId);
516 } else if (StringUtils.isNotBlank(memberCode) && Objects.isNull(memberId)) {
517 MemberDTO memberDTO = this.memberService.findByCode(memberCode);
518 memberCode = memberDTO.getCode();
506 } 519 }
520
507 String platformAccount = resources.getPlatformAccount(); 521 String platformAccount = resources.getPlatformAccount();
508 if (StringUtils.isBlank(platformAccount)) 522 if (StringUtils.isBlank(platformAccount))
509 throw new BadRequestException(GlobeExceptionMsg.IPTV_PLATFORM_ACCOUNT_IS_NULL); 523 throw new BadRequestException(GlobeExceptionMsg.IPTV_PLATFORM_ACCOUNT_IS_NULL);
......
...@@ -110,17 +110,17 @@ public class MemberOperationServiceImpl implements MemberOperationService { ...@@ -110,17 +110,17 @@ public class MemberOperationServiceImpl implements MemberOperationService {
110 public MemberDTO doUpdateVipByMemberCode(MemberOperationBean resources) { 110 public MemberDTO doUpdateVipByMemberCode(MemberOperationBean resources) {
111 Integer nowVip = resources.getVip(); 111 Integer nowVip = resources.getVip();
112 Long memberId = resources.getMemberId(); 112 Long memberId = resources.getMemberId();
113 String memberCode = resources.getMemberCode();
113 Timestamp vipExpireTime = resources.getVipExpireTime(); 114 Timestamp vipExpireTime = resources.getVipExpireTime();
114 115
115 MemberDTO memberDTO = this.memberService.findById(memberId); 116 MemberDTO memberDTO = this.memberService.findByCode(memberCode);
116 117
117 String memberCode = memberDTO.getCode();
118 Integer vip = memberDTO.getVip(); 118 Integer vip = memberDTO.getVip();
119 119
120 Member member = new Member(); 120 Member member = new Member();
121 member.setId(memberDTO.getId()); 121 member.setId(memberDTO.getId());
122 member.setCode(memberCode); 122 member.setCode(memberCode);
123 member.setVip(vip); 123 member.setVip(nowVip);
124 member.setVipExpireTime(vipExpireTime); 124 member.setVipExpireTime(vipExpireTime);
125 125
126 MemberDTO memberDTO_ = this.memberService.doUpdateMemberVipAndVipExpireTime(member); 126 MemberDTO memberDTO_ = this.memberService.doUpdateMemberVipAndVipExpireTime(member);
......