From 75cd1faf5e2d2ce386dcff43e3b7a56546348d02 Mon Sep 17 00:00:00 2001 From: "huan.xu" <275942173@qq.com> Date: Wed, 30 Dec 2020 08:38:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AC=AC=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=20=EF=BC=8C=E7=B3=BB=E7=BB=9F=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=B3=A8=E5=86=8C=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/yyyf/controller/LoginController.java | 8 ++++++++ .../blockchain/server/yyyf/mapper/AssessUserMapper.java | 7 +++++++ .../blockchain/server/yyyf/service/AssessUserService.java | 8 ++++++++ .../server/yyyf/service/impl/AssessUserServiceImpl.java | 5 +++++ .../src/main/resources/mapper/AssessUserMapper.xml | 4 ++++ 5 files changed, 32 insertions(+) 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} + +