diff --git a/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/controller/LoginController.java b/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/controller/LoginController.java index 5664291..ef1d3d8 100644 --- a/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/controller/LoginController.java +++ b/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/controller/LoginController.java @@ -135,6 +135,14 @@ public class LoginController { assessUser.setBankcardInitMoney(examPaperDto.getBankcardInitMoney()); assessUser.setDigitwalletInitMoney(examPaperDto.getDigitwalletInitMoney()); needInit = true; + }else{ + String tel=assessUser.getTel(); + int count=assessUserService.countUserByTel(tel); + if(count==0){ + String code = String.format("%06d", new Random().nextInt(1000000)); + redisTemplate.opsForValue().set(YyyfConstant.REGISTER_KEY.concat(tel), code, YyyfConstant.TIME_OUT, TimeUnit.MINUTES); + yyyfLoginDto.setCode(code); + } } diff --git a/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/mapper/AssessUserMapper.java b/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/mapper/AssessUserMapper.java index c3fed8e..6ffdb7d 100644 --- a/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/mapper/AssessUserMapper.java +++ b/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/mapper/AssessUserMapper.java @@ -52,4 +52,11 @@ public interface AssessUserMapper extends Mapper { UserTimeMoneyDto getUserTimeMoneyDtoByAssessUserId(@Param("assessUserId") String assessUserId); UserTimeMoneyDto selectCurrentUserTimeMoneyDto(@Param("assessUserId") String assessUserId, @Param("qUserId")String qUserId); + /** + * @description 查询子系统是否有改电话号码注册成功 + * @date 2020-12-29 17:18:29 + * @param [tel] + * @return int + **/ + int countUserByTel(@Param("tel")String tel); } diff --git a/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/AssessUserService.java b/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/AssessUserService.java index be32c31..cd7cfda 100644 --- a/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/AssessUserService.java +++ b/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/AssessUserService.java @@ -116,4 +116,12 @@ public interface AssessUserService { * @return void **/ void initAllExamPaperDto(); + + /** + * @description 查询子系统是否有改电话号码注册成功 + * @date 2020-12-29 17:18:29 + * @param [tel] + * @return int + **/ + int countUserByTel(String tel); } diff --git a/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/impl/AssessUserServiceImpl.java b/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/impl/AssessUserServiceImpl.java index 4b88cae..f95f8da 100644 --- a/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/impl/AssessUserServiceImpl.java +++ b/blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/impl/AssessUserServiceImpl.java @@ -339,6 +339,11 @@ public class AssessUserServiceImpl implements AssessUserService { } } + @Override + public int countUserByTel(String tel) { + return this.assessUserMapper.countUserByTel(tel); + } + /** * @param [assessUserTarget, targetResultMap] * @return void diff --git a/blockchain-server/blockchain-server-yyyf/src/main/resources/mapper/AssessUserMapper.xml b/blockchain-server/blockchain-server-yyyf/src/main/resources/mapper/AssessUserMapper.xml index 49536b3..39b8db7 100644 --- a/blockchain-server/blockchain-server-yyyf/src/main/resources/mapper/AssessUserMapper.xml +++ b/blockchain-server/blockchain-server-yyyf/src/main/resources/mapper/AssessUserMapper.xml @@ -131,4 +131,8 @@ where au.id=m.assess_user_id and au.q_user_id=#{qUserId} and au.id=#{assessUserId} + +