Commit 62b01199 62b01199b34c62c2593180f82947f8ced10257da by xianghan

1.同步master

1 parent bae5eb27
......@@ -45,5 +45,4 @@ public class UserWeixinController {
return ResultInfo.success();
}
}
......
package com.topdraw.business.module.user.weixin.subscribe.domain;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import lombok.Data;
import lombok.experimental.Accessors;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import java.sql.Timestamp;
import java.util.UUID;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* @author XiangHan
......
......@@ -360,6 +360,12 @@ public class UserOperationController {
// 大屏账户
String platformAccount = iptvUserInfo.getString("platformAccount");
if (StringUtils.isBlank(platformAccount)) {
log.warn("绑定失败,platformAccount is null ");
return ResultInfo.failure("绑定失败");
}
try {
String headimgurl = iptvUserInfo.get("headimgurl").toString();
......
......@@ -470,18 +470,29 @@ public class UserOperationServiceImpl implements UserOperationService {
// 修改会员信息
MemberDTO _memberDTO1 = this.doUpdateMemberByMemberDTO(memberDTO);
log.info("发送关注消息至大屏侧,发送的账号信息 ==>> {} || 会员信息 ==>> {}", _userWeixinDTO , _memberDTO1);
// 同步至iptv
((UserOperationServiceImpl)AopContext.currentProxy()).asyncSubscribe(new MemberAndWeixinUserDTO(_memberDTO1, _userWeixinDTO));
// 大屏信息
JSONObject iptvUserInfo = resources.getIptvUserInfo();
if (Objects.nonNull(iptvUserInfo)) {
log.info("存储的大小屏账号信息 iptvUserInfo ==>> {}" , iptvUserInfo);
if (Objects.nonNull(iptvUserInfo)) {
// 大屏账户
String platformAccount = iptvUserInfo.getString("platformAccount");
log.info("存储的大屏账号信息 platformAccount ==>> {}" , platformAccount);
log.info("绑定开始");
if (StringUtils.isBlank(platformAccount)) {
log.warn("绑定失败,platformAccount is null ");
return false;
}
// 绑定
this.bind(memberDTO, platformAccount);
log.info("绑定结束");
}
// 保存关注记录
......@@ -557,6 +568,7 @@ public class UserOperationServiceImpl implements UserOperationService {
// 会员
MemberDTO memberDTO = this.findMemberByUserWeixinDTO(userWeixinDTO);
memberDTO.setUserIptvId(null);
// 修改会员vip,如果没有购买会员则取消团粉
MemberDTO _memberDTO = this.doUpdateMemberVip(memberDTO, 0);
......@@ -1015,6 +1027,10 @@ public class UserOperationServiceImpl implements UserOperationService {
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public void bind(MemberDTO memberDTO, UserTvDTO userTvDTO) {
String platformAccount = userTvDTO.getPlatformAccount();
if (StringUtils.isBlank(platformAccount)) {
return;
}
// 绑定
this.bind(memberDTO,platformAccount);
}
......@@ -1027,8 +1043,9 @@ public class UserOperationServiceImpl implements UserOperationService {
*/
@Override
public UserTvDTO bind(MemberDTO memberDTO, String platformAccount) {
log.info("bind start");
MemberDTO memberDTO1 = this.memberService.findByCode(memberDTO.getCode());
log.info("查询会员信息 ==>> {}", memberDTO1);
if (Objects.nonNull(memberDTO1.getUserIptvId())) {
UserTvDTO userTvDTO = this.userTvService.findById(memberDTO1.getUserIptvId());
return userTvDTO;
......@@ -1036,6 +1053,7 @@ public class UserOperationServiceImpl implements UserOperationService {
// 大屏账户
UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount);
log.info("查询大屏账号信息 ==>> {}", userTvDTO);
if (Objects.isNull(userTvDTO)) {
throw new BadRequestException(GlobeExceptionMsg.IPTV_IS_NULL);
}
......@@ -1072,6 +1090,10 @@ public class UserOperationServiceImpl implements UserOperationService {
// 修改会员
MemberDTO _memberDTO = this.doUpdateMemberByMemberDTO(memberDTO);
_memberDTO.setPlatformAccount(platformAccount);
log.info("发送到大屏侧的消息对象 会员信息 ==>> {} || 账号信息 ==>> {}", _memberDTO , _userTvDTO);
// 同步至iptv
((UserOperationServiceImpl)AopContext.currentProxy()).asyncAppletBind(new MemberAndUserTvDTO(_memberDTO, _userTvDTO));
......