|
|
@@ -131,23 +131,20 @@ public class AppealServiceImpl implements AppealService {
|
|
|
Assert.notNull(isPass, "审核状态不能为空");
|
|
|
Appeal appeal = assertAppealExist(appealId);
|
|
|
|
|
|
- // UserAccount account = SystemSession.getUserAccount();
|
|
|
-
|
|
|
appeal.setAuditor("系统管理员");
|
|
|
appeal.setAuditDate(new Timestamp(System.currentTimeMillis()));
|
|
|
appeal.setStatus((short) (isPass ? 2 : 3));
|
|
|
appealDao.save(appeal);
|
|
|
|
|
|
-
|
|
|
if (!isPass) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// 审核通过之后,更新用户和企业信息
|
|
|
- Map map = JacksonUtils.fromJson(appeal.getSubmitInfo(), Map.class);
|
|
|
- Assert.notNull(map, "申诉提交信息不能为空");
|
|
|
-
|
|
|
if (RESET_PASS.equals(appeal.getType()) || VALID_MOBILE.equals(appeal.getType())) {
|
|
|
+ Map map = JacksonUtils.fromJson(appeal.getSubmitInfo(), Map.class);
|
|
|
+ Assert.notNull(map, "申诉提交信息不能为空");
|
|
|
+
|
|
|
User user = assertUserExist(appeal.getSubmitterUU());
|
|
|
user.setMobile(appeal.getMobile());
|
|
|
|
|
|
@@ -161,32 +158,36 @@ public class AppealServiceImpl implements AppealService {
|
|
|
}
|
|
|
userDao.save(user);
|
|
|
} else if (CHANGE_ADMIN.equals(appeal.getType())) {
|
|
|
- Long spaceUU = ((Integer) map.get("spaceUU")).longValue();
|
|
|
- Assert.notNull(map, "更换管理员申诉企业UU不能为空");
|
|
|
+ JSONObject jsonObject = JacksonUtils.fromJson(appeal.getSubmitInfo(), JSONObject.class);
|
|
|
+ Assert.notNull(jsonObject, "更换管理员提交信息不能为空");
|
|
|
|
|
|
- Userspace space = assertSpaceExist(spaceUU);
|
|
|
- User user = userDao.findByMobile(appeal.getMobile());
|
|
|
+ Userspace userSpace = jsonObject.getObject("userspace", Userspace.class);
|
|
|
+ Assert.notNull(userSpace, "更换管理员的企业信息不能为空");
|
|
|
+ Assert.notNull(userSpace.getSpaceUU(), "更换管理员申诉企业UU不能为空");
|
|
|
+
|
|
|
+ String newAdminMobile = jsonObject.getString("newAdminMobile");
|
|
|
+ Assert.hasText(newAdminMobile, "更换的管理员手机不能为空");
|
|
|
+
|
|
|
+ Userspace space = assertSpaceExist(userSpace.getSpaceUU());
|
|
|
+ User user = userDao.findByMobile(newAdminMobile);
|
|
|
if (user == null) {
|
|
|
- JSONObject jsonObject = JacksonUtils.fromJson(appeal.getSubmitInfo(), JSONObject.class);
|
|
|
- Assert.notNull(jsonObject, "必需更新的新管理员信息");
|
|
|
-
|
|
|
- User adminUser = JacksonUtils.fromJson(jsonObject.getString("admin"), User.class);
|
|
|
- Assert.notNull(adminUser, "更新的新管理员信息无效");
|
|
|
-
|
|
|
- user = userDao.findByMobile(adminUser.getMobile());
|
|
|
- if (user == null) {
|
|
|
- AddNewUserInfo newUserInfo = new AddNewUserInfo();
|
|
|
- newUserInfo.setVipName(adminUser.getVipName());
|
|
|
- newUserInfo.setEmail(adminUser.getEmail());
|
|
|
- newUserInfo.setMobile(adminUser.getMobile());
|
|
|
- newUserInfo.setPassword("123456");
|
|
|
- user = userService.addNewUser(newUserInfo);
|
|
|
- }
|
|
|
+ String newAdminName = jsonObject.getString("newAdminName");
|
|
|
+ Assert.hasText(newAdminName, "更换的管理员姓名不能为空");
|
|
|
+
|
|
|
+ String newAdminEmail = jsonObject.getString("newAdminEmail");
|
|
|
+ Assert.hasText(newAdminEmail, "更换的管理员邮件不能为空");
|
|
|
+
|
|
|
+ AddNewUserInfo newUserInfo = new AddNewUserInfo();
|
|
|
+ newUserInfo.setVipName(newAdminName);
|
|
|
+ newUserInfo.setEmail(newAdminEmail);
|
|
|
+ newUserInfo.setMobile(newAdminMobile);
|
|
|
+ newUserInfo.setPassword("111111");
|
|
|
+ user = userService.addNewUser(newUserInfo);
|
|
|
}
|
|
|
|
|
|
// 记录管理员更换记录
|
|
|
AdminChangeRecord record = new AdminChangeRecord();
|
|
|
- record.setSpaceUU(spaceUU);
|
|
|
+ record.setSpaceUU(userSpace.getSpaceUU());
|
|
|
|
|
|
User oldAdmin = space.getAdmin();
|
|
|
record.setSponsorName(appeal.getContactName());
|
|
|
@@ -195,8 +196,6 @@ public class AppealServiceImpl implements AppealService {
|
|
|
record.setOldAdminName(oldAdmin.getVipName());
|
|
|
record.setOldAdminTel(oldAdmin.getMobile());
|
|
|
|
|
|
- // UserAccount accountUser = SystemSession.getUserAccount();
|
|
|
-
|
|
|
record.setAuditorName("系统管理员");
|
|
|
record.setAuditorTel("123456789");
|
|
|
record.setAuditTime(new Date());
|
|
|
@@ -209,11 +208,11 @@ public class AppealServiceImpl implements AppealService {
|
|
|
space.setAdmin(user);
|
|
|
space.setAdminUU(user.getUserUU());
|
|
|
// 更新企业信息
|
|
|
- space.setSpaceName((String) map.get("spaceName"));
|
|
|
- space.setCorporation((String) map.get("corporation"));
|
|
|
- space.setBusinessCode((String) map.get("businessCode"));
|
|
|
- space.setBusinessCodeImage((String) map.get("businessCodeImage"));
|
|
|
- space.setRegAddress((String) map.get("regAddress"));
|
|
|
+ space.setSpaceName(userSpace.getSpaceName());
|
|
|
+ space.setCorporation(userSpace.getCorporation());
|
|
|
+ space.setBusinessCode(userSpace.getBusinessCode());
|
|
|
+ space.setBusinessCodeImage(userSpace.getBusinessCodeImage());
|
|
|
+ space.setRegAddress(userSpace.getRegAddress());
|
|
|
// 更新企业认证状态
|
|
|
space.setValidCode((short) 2);
|
|
|
spaceDao.save(space);
|