| | |
| | | private ForbiddenUserIdentifyCodeMapper forbiddenUserIdentifyCodeMapper;
|
| | |
|
| | | @Override
|
| | | public void addIdentifyCode(ForbiddenUserIdentifyCode identifyCode) throws ForbiddenUserIdentifyCodeException {
|
| | | public void forbiddenIdentifyCode(ForbiddenUserIdentifyCode identifyCode) throws ForbiddenUserIdentifyCodeException {
|
| | | if (identifyCode == null || identifyCode.getType() == null
|
| | | || StringUtil.isNullOrEmpty(identifyCode.getIdentifyCode()))
|
| | | throw new ForbiddenUserIdentifyCodeException(1, "信息不完整");
|
| | |
|
| | | ForbiddenUserIdentifyCode old = listByTypeAndIdentifyCode(identifyCode.getType(),
|
| | | identifyCode.getIdentifyCode());
|
| | | if (old != null)
|
| | | throw new ForbiddenUserIdentifyCodeException(2, "信息已存在");
|
| | | if (old != null) {
|
| | | identifyCode.setId(old.getId());
|
| | | }
|
| | |
|
| | | identifyCode.setCreateTime(new Date());
|
| | | identifyCode.setEffective(true);
|
| | |
| | | typeEnum = ForbiddenUserIdentifyCodeTypeEnum.alipayAccount;
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | throw new ForbiddenUserIdentifyCodeException(1, "类型不匹配");
|
| | | }
|
| | |
|
| | | if (typeEnum == null) {
|
| | | throw new ForbiddenUserIdentifyCodeException(1, "类型不匹配");
|
| | | }
|
| | |
|
| | | ForbiddenUserIdentifyCode codeObject = listByTypeAndIdentifyCode(typeEnum ,identifyCode);
|
| | | if (codeObject == null) {
|
| | |
| | |
|
| | | forbiddenUserIdentifyCodeMapper.insertSelective(codeObject);
|
| | | } else {
|
| | | // 解封
|
| | | codeObject.setEffective(false);
|
| | | |
| | | Boolean effective = codeObject.getEffective();
|
| | | if (effective) {
|
| | | // 解封
|
| | | codeObject.setEffective(false);
|
| | | } else {
|
| | | // 封禁
|
| | | codeObject.setEffective(true);
|
| | | }
|
| | | |
| | | |
| | | codeObject.setUpdateTime(new Date());
|
| | | forbiddenUserIdentifyCodeMapper.updateByPrimaryKeySelective(codeObject);
|
| | | }
|