Browse Source

增加错误信息

dev
zhangyuan 3 years ago
parent
commit
293cf49010
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -40,6 +40,7 @@ public enum EpmetErrorCode {
PASSWORD_NOT_FIT(8010,"两次填写的密码不一致"),
PASSWORD_OUT_OF_ORDER(8011,"密码必须8-20个字符,而且同时包含大小写字母和数字"),
PASSWORD_UPDATE_FAILED(8012,"密码修改失败"),
GOV_STAFF_ACCOUNT_NOT_EXISTS(8013,"手机号未注册,请联系贵单位管理员,确认其录入手机与您所持手机号相同"),
MOBILE_HAS_BEEN_USED(8101, "该手机号已注册,请更换手机号或使用原绑定的微信账号登录"),
MOBILE_CODE_ERROR(8102, "验证码错误"),
AUTO_CONFIRM_FAILED(8103, "党员注册失败"),

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -163,8 +163,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
//判断用户是否存在
List<CustomerStaffDTO> customerStaffDTOList = baseDao.listCustomerStaffByAccount(userAccount);
if (null == customerStaffDTOList || customerStaffDTOList.size() == 0) {
logger.warn(String.format("根据账户查询用户异常,账户:[%s],code[%s],msg[%s]", userAccount, EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg()));
return new Result().error(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode());
logger.warn(String.format("根据账户查询用户异常,账户:[%s],code[%s],msg[%s]", userAccount, EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getMsg()));
return new Result().error(EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode());
}
return new Result<List<CustomerStaffDTO>>().ok(customerStaffDTOList);
}
@ -731,9 +731,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
List<CustomerStaffDTO> customerStaffDTOList = baseDao.selectStaffByAccount(formDTO);
if (null == customerStaffDTOList || customerStaffDTOList.size() < NumConstant.ONE) {
logger.warn(String.format("根据客户Id和账户查询用户异常,客户Id:[%s],手机号:[%s],code[%s],msg[%s]",
formDTO.getCustomerId(), formDTO.getUserAccount(), EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode(),
EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getMsg()));
throw new RenException(EpmetErrorCode.GOV_STAFF_NOT_EXISTS.getCode());
formDTO.getCustomerId(), formDTO.getUserAccount(), EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode(),
EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getMsg()));
throw new RenException(EpmetErrorCode.GOV_STAFF_ACCOUNT_NOT_EXISTS.getCode());
}
return customerStaffDTOList;
}

Loading…
Cancel
Save