修复第一次进入 ,系统自动注册失败的问题

master
huan.xu 4 years ago
parent e490449c58
commit 75cd1faf5e
  1. 8
      blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/controller/LoginController.java
  2. 7
      blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/mapper/AssessUserMapper.java
  3. 8
      blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/AssessUserService.java
  4. 5
      blockchain-server/blockchain-server-yyyf/src/main/java/com/blockchain/server/yyyf/service/impl/AssessUserServiceImpl.java
  5. 4
      blockchain-server/blockchain-server-yyyf/src/main/resources/mapper/AssessUserMapper.xml

@ -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);
}
}

@ -52,4 +52,11 @@ public interface AssessUserMapper extends Mapper<AssessUser> {
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);
}

@ -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);
}

@ -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

@ -131,4 +131,8 @@
where au.id=m.assess_user_id and au.q_user_id=#{qUserId} and au.id=#{assessUserId}
</select>
<select id="countUserByTel" resultType="java.lang.Integer">
select count(1) from dapp_u_user_main where mobile_phone = #{tel}
</select>
</mapper>

Loading…
Cancel
Save