Browse Source

暂存

dev_shibei_match
yinzuomei 5 years ago
parent
commit
88639cbfc0
  1. 3
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  2. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  3. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

3
epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java

@ -115,8 +115,7 @@ public class GovLoginServiceImpl implements GovLoginService {
String rightSmsCode = captchaRedis.getSmsCode(formDTO.getMobile());
if (!formDTO.getSmsCode().equals(rightSmsCode)) {
logger.error(String.format("验证码错误code[%s],msg[%s]",EpmetErrorCode.MOBILE_CODE_ERROR.getCode(),EpmetErrorCode.MOBILE_CODE_ERROR.getMsg()));
//TODO 2020-05-21 校验验证码先去掉方便测试
//throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}
//3、查询用户所有的组织信息
List<String> customerIdList = new ArrayList<>();

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

@ -57,6 +57,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 党员认证
@ -150,8 +151,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
if (null != partyMemberInfoResult) {
return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode());
}
//TODO 方便测试屏蔽短信验证码
/*//生成短信验证码
//生成短信验证码
Map<String, String> message = (Map<String, String>) messageFeignClient.sendSmsCaptcha(fromDTO.getMobile()).getData();
if (null == message) {
return new Result().error(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode());
@ -160,7 +160,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
partyMemberInfoRedis.deleteUserMobileCodeByPattern(fromDTO.getUserId(), fromDTO.getMobile());
//将验证码存入Redis
partyMemberInfoRedis.setUserMobileCode(fromDTO.getUserId(), fromDTO.getMobile(), message.get("code"));*/
partyMemberInfoRedis.setUserMobileCode(fromDTO.getUserId(), fromDTO.getMobile(), message.get("code"));
//将访问记录更新到热心居民申请行为记录表
saveOrUpdateVisit(fromDTO.getVisitId(), null, PartyMemberConstant.OPERATE_OPERATE_SMS_CODE);

27
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

@ -26,19 +26,18 @@ import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constant.UserConstant;
import com.epmet.constant.UserRoleConstant;
import com.epmet.dao.UserResiInfoDao;
import com.epmet.dto.UserResiInfoDTO;
import com.epmet.dto.UserRoleDTO;
import com.epmet.dto.form.IssueInitiatorFormDTO;
import com.epmet.dto.form.UserResiInfoFormDTO;
import com.epmet.dto.form.UserResiInfoListFormDTO;
import com.epmet.dto.form.VerificationCodeFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.IssueInitiatorResultDTO;
import com.epmet.dto.result.SendVerificationCodeResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.entity.UserResiInfoEntity;
import com.epmet.feign.MessageFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.redis.UserResiInfoRedis;
import com.epmet.service.RegisterRelationService;
import com.epmet.service.UserResiInfoService;
@ -77,7 +76,7 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
@Autowired
private UserRoleService userRoleService;
@Autowired
private MessageFeignClient messageFeignClient;
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Override
public PageData<UserResiInfoDTO> page(Map<String, Object> params) {
@ -202,25 +201,25 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
**/
@Override
public Result getVerificationCode(VerificationCodeFormDTO verificationCodeFormDTO) {
Result result = new Result();
//1:更新居民注册访问记录表数据
userResiRegisterVisitService.updateResiVisitOperate(verificationCodeFormDTO);
//2:判断手机号是否可用
if (!getResiInfoByMobile(verificationCodeFormDTO.getMobile())) {
return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode());
}
//TODO 2020-05-23方便测试先屏蔽短信验证码发送
/*//3:调用短信服务 生成验证码发送短信
result = messageFeignClient.sendSmsCaptcha(verificationCodeFormDTO.getMobile());
Map<String,Object> map = (Map<String, Object>) result.getData();
if (null == map || null == map.get("code")) {
//3:调用短信服务 生成验证码发送短信
SendVerificationCodeFormDTO sendVerificationCodeFormDTO=new SendVerificationCodeFormDTO();
sendVerificationCodeFormDTO.setMobile(verificationCodeFormDTO.getMobile());
sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.USER_REGISTER);
Result<SendVerificationCodeResultDTO> result = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO);
if(!result.success()||null==result.getData()||StringUtils.isBlank(result.getData().getCode())){
return new Result().error(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode());
}
//4:删除缓存中可能存在的旧验证码
userResiInfoRedis.deleteOldUserMobileCode(verificationCodeFormDTO.getUserId(), verificationCodeFormDTO.getMobile());
//5:将验证码存入redis
userResiInfoRedis.setUserResiMobileCode(verificationCodeFormDTO.getUserId(),verificationCodeFormDTO.getMobile(),map.get("code").toString());*/
return result;
userResiInfoRedis.setUserResiMobileCode(verificationCodeFormDTO.getUserId(),verificationCodeFormDTO.getMobile(),result.getData().getCode());
return new Result();
}
@Override

Loading…
Cancel
Save