Commit 815a2c7e 815a2c7e40571313b781c27ccfedaa171d9e863b by xianghan

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

1 parent e33e7a1b
...@@ -33,6 +33,7 @@ import com.topdraw.weixin.util.WeixinUtil; ...@@ -33,6 +33,7 @@ import com.topdraw.weixin.util.WeixinUtil;
33 import io.swagger.annotations.Api; 33 import io.swagger.annotations.Api;
34 import io.swagger.annotations.ApiOperation; 34 import io.swagger.annotations.ApiOperation;
35 import lombok.extern.slf4j.Slf4j; 35 import lombok.extern.slf4j.Slf4j;
36 import org.assertj.core.util.Arrays;
36 import org.springframework.beans.BeanUtils; 37 import org.springframework.beans.BeanUtils;
37 import org.springframework.beans.factory.annotation.Autowired; 38 import org.springframework.beans.factory.annotation.Autowired;
38 import org.springframework.util.Assert; 39 import org.springframework.util.Assert;
...@@ -41,9 +42,8 @@ import org.springframework.web.bind.annotation.*; ...@@ -41,9 +42,8 @@ import org.springframework.web.bind.annotation.*;
41 42
42 import java.io.IOException; 43 import java.io.IOException;
43 import java.net.URLDecoder; 44 import java.net.URLDecoder;
44 import java.util.List; 45 import java.time.LocalDateTime;
45 import java.util.Map; 46 import java.util.*;
46 import java.util.Objects;
47 47
48 @Api("账户处理") 48 @Api("账户处理")
49 @RestController 49 @RestController
...@@ -392,6 +392,7 @@ public class UserOperationController { ...@@ -392,6 +392,7 @@ public class UserOperationController {
392 } 392 }
393 393
394 /***************************************************************************************/ 394 /***************************************************************************************/
395 String platformAccount1 = "";
395 // 关注未绑定 396 // 关注未绑定
396 if (result.equalsIgnoreCase(SUBSCRIBE)) { 397 if (result.equalsIgnoreCase(SUBSCRIBE)) {
397 // 小屏会员 398 // 小屏会员
...@@ -423,13 +424,26 @@ public class UserOperationController { ...@@ -423,13 +424,26 @@ public class UserOperationController {
423 } 424 }
424 425
425 // 大小屏绑定 426 // 大小屏绑定
426 this.userOperationService.bind(memberDTO,platformAccount); 427 UserTvDTO userTvDTO = this.userOperationService.bind(memberDTO, platformAccount);
428 if (userTvDTO != null) {
429 platformAccount1 = userTvDTO.getPlatformAccount();
430 }
431
427 } 432 }
428 /****************************************************************************************/ 433 /****************************************************************************************/
434 List<Object> resultList = new ArrayList<>();
435 resultList.add(result);
436 resultList.add(platformAccount1);
429 437
430 return ResultInfo.success(result); 438 ResultInfo<Object> success = ResultInfo.success(resultList);
439 return success;
431 } 440 }
432 441
442 /**
443 *
444 * @param resources
445 * @return
446 */
433 @PostMapping(value = "/saveUserWeixinPhone") 447 @PostMapping(value = "/saveUserWeixinPhone")
434 @ApiOperation("保存用户手机号信息") 448 @ApiOperation("保存用户手机号信息")
435 @AnonymousAccess 449 @AnonymousAccess
......
...@@ -146,6 +146,6 @@ public interface UserOperationService { ...@@ -146,6 +146,6 @@ public interface UserOperationService {
146 146
147 void bind(MemberDTO memberDTO, UserTvDTO userTvDTO); 147 void bind(MemberDTO memberDTO, UserTvDTO userTvDTO);
148 148
149 void bind(MemberDTO memberDTO, String platformAccount); 149 UserTvDTO bind(MemberDTO memberDTO, String platformAccount);
150 150
151 } 151 }
......
...@@ -1580,7 +1580,14 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -1580,7 +1580,14 @@ public class UserOperationServiceImpl implements UserOperationService {
1580 } 1580 }
1581 1581
1582 @Override 1582 @Override
1583 public void bind(MemberDTO memberDTO, String platformAccount) { 1583 public UserTvDTO bind(MemberDTO memberDTO, String platformAccount) {
1584
1585 MemberDTO memberDTO1 = this.memberService.getByCode(memberDTO.getCode());
1586 if (Objects.nonNull(memberDTO1.getUserIptvId())) {
1587 UserTvDTO userTvDTO = this.userTvService.findById(memberDTO1.getUserIptvId());
1588 return userTvDTO;
1589 }
1590
1584 // 大屏账户 1591 // 大屏账户
1585 UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount); 1592 UserTvDTO userTvDTO = this.userTvService.findByPlatformAccount(platformAccount);
1586 if (Objects.isNull(userTvDTO)) { 1593 if (Objects.isNull(userTvDTO)) {
...@@ -1598,6 +1605,8 @@ public class UserOperationServiceImpl implements UserOperationService { ...@@ -1598,6 +1605,8 @@ public class UserOperationServiceImpl implements UserOperationService {
1598 1605
1599 // 修改会员 1606 // 修改会员
1600 this.doUpdateMemberByMemberDTO(memberDTO0); 1607 this.doUpdateMemberByMemberDTO(memberDTO0);
1608
1609 return null;
1601 } 1610 }
1602 1611
1603 /** 1612 /**
......