Commit 0f17a33a 0f17a33a3bf76cad215979b4932b067a38af7e0b by xianghan

1.添加日志

1 parent 2477a356
......@@ -7,7 +7,6 @@ import com.topdraw.business.module.member.profile.service.dto.MemberProfileDTO;
import com.topdraw.business.process.service.member.MemberProfileOperationService;
import com.topdraw.common.ResultInfo;
import com.topdraw.business.module.member.profile.domain.MemberProfile;
import com.topdraw.business.module.member.profile.service.MemberProfileService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
......
......@@ -4,8 +4,6 @@ import com.topdraw.annotation.AnonymousAccess;
import com.topdraw.business.module.user.iptv.domain.UserTv;
import com.topdraw.business.module.user.iptv.service.UserTvService;
import com.topdraw.business.module.user.iptv.service.dto.UserTvDTO;
import com.topdraw.business.module.user.weixin.domain.UserWeixin;
import com.topdraw.business.module.user.weixin.service.UserWeixinService;
import com.topdraw.common.ResultInfo;
import com.topdraw.exception.BadRequestException;
import com.topdraw.exception.GlobeExceptionMsg;
......
......@@ -82,9 +82,15 @@ public class UserOperationController {
log.info("userOperation ==>> updateVipByUserId ==>> param ==>> [{}]",resources);
Integer vip = resources.getVip();
if (Objects.isNull(vip) || vip < 1) {
return ResultInfo.failure("手动修改vip异常,参数错误,vip为空或者小于1");
}
Timestamp vipExpireTime = resources.getVipExpireTime();
// 微信账号id
Long userId = resources.getUserId();
if (Objects.isNull(userId)) {
return ResultInfo.failure("手动修改vip异常,参数错误,小屏账号id为空");
}
UserWeixinDTO userWeixinDTO = this.userOperationService.findById(userId);
Long memberId = userWeixinDTO.getMemberId();
......@@ -92,8 +98,12 @@ public class UserOperationController {
MemberOperationBean memberOperationBean = new MemberOperationBean();
memberOperationBean.setMemberCode(memberDTO.getCode());
memberOperationBean.setVip(vip);
if (vip < memberDTO.getVip()) {
vip = memberDTO.getVip();
} else {
memberOperationBean.setVipExpireTime(vipExpireTime);
}
memberOperationBean.setVip(vip);
MemberDTO memberDTO1 = this.memberOperationService.doUpdateVipByMemberCode(memberOperationBean);
......@@ -503,7 +513,11 @@ public class UserOperationController {
String memberCode = resources.getMemberCode();
if (StringUtils.isBlank(memberCode) && Objects.nonNull(memberId)) {
memberCode = this.memberService.findCodeById(memberId);
} else if (StringUtils.isNotBlank(memberCode) && Objects.isNull(memberId)) {
MemberDTO memberDTO = this.memberService.findByCode(memberCode);
memberCode = memberDTO.getCode();
}
String platformAccount = resources.getPlatformAccount();
if (StringUtils.isBlank(platformAccount))
throw new BadRequestException(GlobeExceptionMsg.IPTV_PLATFORM_ACCOUNT_IS_NULL);
......
......@@ -110,17 +110,17 @@ public class MemberOperationServiceImpl implements MemberOperationService {
public MemberDTO doUpdateVipByMemberCode(MemberOperationBean resources) {
Integer nowVip = resources.getVip();
Long memberId = resources.getMemberId();
String memberCode = resources.getMemberCode();
Timestamp vipExpireTime = resources.getVipExpireTime();
MemberDTO memberDTO = this.memberService.findById(memberId);
MemberDTO memberDTO = this.memberService.findByCode(memberCode);
String memberCode = memberDTO.getCode();
Integer vip = memberDTO.getVip();
Member member = new Member();
member.setId(memberDTO.getId());
member.setCode(memberCode);
member.setVip(vip);
member.setVip(nowVip);
member.setVipExpireTime(vipExpireTime);
MemberDTO memberDTO_ = this.memberService.doUpdateMemberVipAndVipExpireTime(member);
......