|
|
@@ -111,41 +111,44 @@ public class AppealServiceImpl implements AppealService {
|
|
|
appeal.setStatus((short) (isPass ? 2 : 3));
|
|
|
appealDao.save(appeal);
|
|
|
|
|
|
+
|
|
|
+ if (!isPass) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// 审核通过之后,更新用户和企业信息
|
|
|
- if (isPass) {
|
|
|
- Map map = JacksonUtils.fromJson(appeal.getSubmitInfo(), Map.class);
|
|
|
- Assert.notNull(map, "申诉提交信息不能为空");
|
|
|
+ Map map = JacksonUtils.fromJson(appeal.getSubmitInfo(), Map.class);
|
|
|
+ Assert.notNull(map, "申诉提交信息不能为空");
|
|
|
|
|
|
- if (RESET_PASS.equals(appeal.getType()) || VALID_MOBILE.equals(appeal.getType())) {
|
|
|
- User user = assertUserExist(appeal.getSubmitterUU());
|
|
|
- user.setMobile(appeal.getMobile());
|
|
|
+ if (RESET_PASS.equals(appeal.getType()) || VALID_MOBILE.equals(appeal.getType())) {
|
|
|
+ User user = assertUserExist(appeal.getSubmitterUU());
|
|
|
+ user.setMobile(appeal.getMobile());
|
|
|
|
|
|
- if (RESET_PASS.equals(appeal.getType())) {
|
|
|
- String password = (String) map.get("password");
|
|
|
+ if (RESET_PASS.equals(appeal.getType())) {
|
|
|
+ String password = (String) map.get("password");
|
|
|
|
|
|
- if (StringUtils.isEmpty(password) || password.length() < 32) {
|
|
|
- throw new ValidationFailedException("重置密码不存在或密码未被加密");
|
|
|
- }
|
|
|
- user.setPassword(password);
|
|
|
- }
|
|
|
- userDao.save(user);
|
|
|
- } else if (CHANGE_ADMIN.equals(appeal.getType())) {
|
|
|
- Long spaceUU = ((Integer) map.get("spaceUU")).longValue();
|
|
|
- Assert.notNull(map, "更换管理员申诉企业UU不能为空");
|
|
|
-
|
|
|
- Userspace space = assertSpaceExist(spaceUU);
|
|
|
- User user = userDao.findByMobile(appeal.getMobile());
|
|
|
- if (user == null) {
|
|
|
- throw new ValidationFailedException(
|
|
|
- String.format("拥有手机号[%s]的用户不存在", appeal.getMobile()));
|
|
|
+ if (StringUtils.isEmpty(password) || password.length() < 32) {
|
|
|
+ throw new ValidationFailedException("重置密码不存在或密码未被加密");
|
|
|
}
|
|
|
-
|
|
|
- space.setAdmin(user);
|
|
|
- space.setAdminUU(user.getUserUU());
|
|
|
- spaceDao.save(space);
|
|
|
- } else {
|
|
|
- logger.info("暂无支持申诉类型");
|
|
|
+ user.setPassword(password);
|
|
|
+ }
|
|
|
+ userDao.save(user);
|
|
|
+ } else if (CHANGE_ADMIN.equals(appeal.getType())) {
|
|
|
+ Long spaceUU = ((Integer) map.get("spaceUU")).longValue();
|
|
|
+ Assert.notNull(map, "更换管理员申诉企业UU不能为空");
|
|
|
+
|
|
|
+ Userspace space = assertSpaceExist(spaceUU);
|
|
|
+ User user = userDao.findByMobile(appeal.getMobile());
|
|
|
+ if (user == null) {
|
|
|
+ throw new ValidationFailedException(
|
|
|
+ String.format("拥有手机号[%s]的用户不存在", appeal.getMobile()));
|
|
|
}
|
|
|
+
|
|
|
+ space.setAdmin(user);
|
|
|
+ space.setAdminUU(user.getUserUU());
|
|
|
+ spaceDao.save(space);
|
|
|
+ } else {
|
|
|
+ logger.info("暂无支持申诉类型");
|
|
|
}
|
|
|
}
|
|
|
|