Commit 815a2c7e 815a2c7e40571313b781c27ccfedaa171d9e863b by xianghan

1.修复不能重复绑定的缺陷

1 parent e33e7a1b
......@@ -33,6 +33,7 @@ import com.topdraw.weixin.util.WeixinUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.assertj.core.util.Arrays;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
......@@ -41,9 +42,8 @@ import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.net.URLDecoder;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.time.LocalDateTime;
import java.util.*;
@Api("账户处理")
@RestController
......@@ -392,6 +392,7 @@ public class UserOperationController {
}
/***************************************************************************************/
String platformAccount1 = "";
// 关注未绑定
if (result.equalsIgnoreCase(SUBSCRIBE)) {
// 小屏会员
......@@ -423,13 +424,26 @@ public class UserOperationController {
}
// 大小屏绑定
this.userOperationService.bind(memberDTO,platformAccount);
UserTvDTO userTvDTO = this.userOperationService.bind(memberDTO, platformAccount);
if (userTvDTO != null) {
platformAccount1 = userTvDTO.getPlatformAccount();
}
}
/****************************************************************************************/
List<Object> resultList = new ArrayList<>();
resultList.add(result);
resultList.add(platformAccount1);
return ResultInfo.success(result);
ResultInfo<Object> success = ResultInfo.success(resultList);
return success;
}
/**
*
* @param resources
* @return
*/
@PostMapping(value = "/saveUserWeixinPhone")
@ApiOperation("保存用户手机号信息")
@AnonymousAccess
......
......@@ -146,6 +146,6 @@ public interface UserOperationService {
void bind(MemberDTO memberDTO, UserTvDTO userTvDTO);
void bind(MemberDTO memberDTO, String platformAccount);
UserTvDTO bind(MemberDTO memberDTO, String platformAccount);
}
......
......@@ -1580,7 +1580,14 @@ public class UserOperationServiceImpl implements UserOperationService {
}
@Override
public void bind(MemberDTO memberDTO, String platformAccount) {
public UserTvDTO bind(MemberDTO memberDTO, String platformAccount) {
MemberDTO memberDTO1 = this.memberService.getByCode(memberDTO.getCode());
if (Objects.nonNull(memberDTO1.getUserIptvId())) {
UserTvDTO userTvDTO = this.userTvService.findById(memberDTO1.getUserIptvId());
return userTvDTO;
}
// 大屏账户
UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount);
if (Objects.isNull(userTvDTO)) {
......@@ -1598,6 +1605,8 @@ public class UserOperationServiceImpl implements UserOperationService {
// 修改会员
this.doUpdateMemberByMemberDTO(memberDTO0);
return null;
}
/**
......