Browse Source

修改信息、注册居民、认证党员之自动注册居民都不再校验身份证号客户内唯一

dev_shibei_match
yinzuomei 4 years ago
parent
commit
3fa03b586c
  1. 4
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java
  2. 2
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java
  3. 22
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java
  4. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java
  5. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java
  6. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java
  7. 30
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

4
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/PersonalCenterController.java

@ -3,6 +3,7 @@ package com.epmet.modules.mine.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.EditInfoFormDTO;
import com.epmet.dto.form.EditMobileFormDTO;
import com.epmet.dto.form.SendCodeFormDTO;
@ -51,6 +52,9 @@ public class PersonalCenterController {
*/
@PostMapping("editinfo")
public Result editInfo(@LoginUser TokenDto tokenDto, @RequestBody EditInfoFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,EditInfoFormDTO.AddUserShowGroup.class,EditInfoFormDTO.AddUserInternalGroup.class);
personalCenterService.editInfo(tokenDto, formDTO);
return new Result();
}

2
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/service/impl/PersonalCenterServiceImpl.java

@ -45,8 +45,6 @@ public class PersonalCenterServiceImpl implements PersonalCenterService {
@Override
public void editInfo(TokenDto tokenDto, EditInfoFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
Result result = epmetUserOpenFeignClient.editUserInfo(formDTO);
if (!result.success()) {
throw new RenException(result.getCode(), result.getMsg());

22
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
@ -17,36 +18,41 @@ import java.io.Serializable;
public class EditInfoFormDTO implements Serializable {
private static final long serialVersionUID = 1280489016677129419L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 头像
*/
@NotBlank(message = "头像不能为空")
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
/**
* 头像
*/
@NotBlank(message = "头像不能为空")
@NotBlank(message = "头像不能为空",groups = AddUserShowGroup.class)
private String headImgUrl;
/**
*
*/
@NotBlank(message = "姓不能为空")
@NotBlank(message = "姓不能为空",groups = AddUserShowGroup.class)
private String surname;
/**
*
*/
@NotBlank(message = "名不能为空")
@NotBlank(message = "名不能为空",groups = AddUserShowGroup.class)
private String name;
//@NotBlank(message = "身份证号不能为空")
@Length(max=18,message = "身份证号不能超过18位")
@Length(max=18,message = "身份证号不能超过18位",groups = AddUserShowGroup.class)
//别的小程序不统一升级,没办法限制必填。
private String idNum;
/**
* 路牌号
*/
@NotBlank(message = "路牌号不能为空")
@NotBlank(message = "路牌号不能为空",groups = AddUserShowGroup.class)
private String street;
/**
* 小区名称
@ -59,12 +65,12 @@ public class EditInfoFormDTO implements Serializable {
/**
* 昵称
*/
@NotBlank(message = "昵称不能为空")
@NotBlank(message = "昵称不能为空",groups = AddUserShowGroup.class)
private String nickname;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空")
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java

@ -57,7 +57,7 @@ public class InfoSubmitFromDTO implements Serializable {
private String name;
//@NotBlank(message = "身份证号不能为空")
//@Length(max=18,message = "身份证号不能超过18位")
@Length(max=18,message = "身份证号不能超过18位")
//别的小程序不统一升级,没办法限制必填。
private String idNum;

1
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java

@ -171,6 +171,7 @@ public class UserResiInfoController {
*/
@PostMapping("edituserinfo")
public Result editUserInfo(@RequestBody EditInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO,EditInfoFormDTO.AddUserShowGroup.class,EditInfoFormDTO.AddUserInternalGroup.class);
userResiInfoService.editUserInfo(formDTO);
return new Result();
}

1
epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java

@ -192,5 +192,6 @@ public interface UserBaseInfoService extends BaseService<UserBaseInfoEntity> {
UserBaseInfoDTO getUserIdByIdNum(String customerId, String idNum,String userId);
@Deprecated
Integer checkIdNum(String idNum, String customerId, String excludeUserId);
}

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

@ -27,7 +27,6 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -218,16 +217,17 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO);
return new Result().error(EpmetErrorCode.MOBILE_HAS_BEEN_USED.getCode());
}
//3、身份证号不为空时,判断当前客户下身份证号是否呀已经被使用
if (StringUtils.isNotBlank(userResiInfoDTO.getIdNum())) {
//2021-12-08新需求:同客户内不再校验身份证唯一
/*if (StringUtils.isNotBlank(userResiInfoDTO.getIdNum())) {
if (baseDao.selectCountByIdNum(userResiInfoDTO.getIdNum(), userResiInfoDTO.getCustomerId(),null) > NumConstant.ZERO) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "user_resi_info已存在该身份证号", "身份证号已被使用");
throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_resi_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg());
}
//判断user_base_info表是否存在相同的身份证号
if (userBaseInfoService.checkIdNum(userResiInfoDTO.getIdNum(), userResiInfoDTO.getCustomerId(), null) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "user_base_info已存在该身份证号", "身份证号已被使用");
throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_base_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg());
}
}
}*/
userResiRegisterVisitService.updateResiRegisterVisit(true, userResiInfoDTO);
//4:居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一
registerRelationService.saveRegisterRelation(userResiInfoDTO);
@ -311,15 +311,16 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
log.warn("手机号客户内不可用,没有更新用户信息,param:{}", JSON.toJSONString(userResiInfoDTO));
throw new RenException(EpmetErrorCode.THE_MOBILE_HAS_BEEN_USED.getCode(), EpmetErrorCode.THE_MOBILE_HAS_BEEN_USED.getMsg());
}
if(StringUtils.isNotBlank(userResiInfoDTO.getIdNum())){
//2021-12-08新需求:同客户内不再校验身份证唯一
/*if(StringUtils.isNotBlank(userResiInfoDTO.getIdNum())){
if (baseDao.selectCountByIdNum(userResiInfoDTO.getIdNum(), userResiInfoDTO.getCustomerId(),userResiInfoDTO.getUserId()) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "user_resi_info已存在该身份证号", "身份证号已被使用");
throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_resi_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg());
}
//判断user_base_info表是否存在相同的身份证号
if (userBaseInfoService.checkIdNum(userResiInfoDTO.getIdNum(), userResiInfoDTO.getCustomerId(), null) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "user_base_info已存在该身份证号", "身份证号已被使用");
throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_base_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg());
}
}
}*/
//居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一
registerRelationService.saveRegisterRelation(userResiInfoDTO);
//数据存入居民注册表
@ -394,19 +395,20 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
*/
@Override
public void editUserInfo(EditInfoFormDTO formDTO) {
if(StringUtils.isNotBlank(formDTO.getIdNum())){
//2021-12-08新需求:同客户内不再校验身份证唯一
/*if(StringUtils.isNotBlank(formDTO.getIdNum())){
if(formDTO.getIdNum().length()>18){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "user_resi_info已存在该身份证号", "身份证号至多18位");
}
//判断身份证号唯一,除了当前用户外没有人用过这个身份证号吧???
if(baseDao.selectCountByIdNum(formDTO.getIdNum(),formDTO.getCustomerId(),formDTO.getUserId())>0){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "user_resi_info已存在该身份证号", "身份证号已被使用");
throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_resi_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg());
}
//判断user_base_info表是否存在相同的身份证号
if (userBaseInfoService.checkIdNum(formDTO.getIdNum(), formDTO.getCustomerId(), formDTO.getUserId()) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "user_base_info已存在该身份证号", "身份证号已被使用");
throw new EpmetException(EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getCode(), "user_base_info已存在该身份证号", EpmetErrorCode.IDCARDNO_ALREADY_EXITS.getMsg());
}
}
}*/
//更新居民注册信息表
baseDao.updateByUserId(ConvertUtils.sourceToTarget(formDTO, UserResiInfoEntity.class));
//更新baseInfo

Loading…
Cancel
Save