|
|
@@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.uas.sso.core.Status;
|
|
|
import com.uas.sso.dao.AppealDao;
|
|
|
import com.uas.sso.entity.Appeal;
|
|
|
+import com.uas.sso.entity.User;
|
|
|
import com.uas.sso.entity.Userspace;
|
|
|
import com.uas.sso.service.AppealService;
|
|
|
+import com.uas.sso.service.UserService;
|
|
|
import com.uas.sso.service.UserspaceService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -27,11 +29,19 @@ public class AppealServiceImpl implements AppealService {
|
|
|
@Autowired
|
|
|
private UserspaceService userspaceService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserService userService;
|
|
|
+
|
|
|
@Override
|
|
|
public void submitResetPwd(Appeal appeal, String password) {
|
|
|
// 设置默认信息
|
|
|
appeal.setSubmitDate(new Timestamp(System.currentTimeMillis()));
|
|
|
- appeal.setSubmitInfo(JSON.toJSONString(new ModelMap("password", password)));
|
|
|
+ User user = userService.findOne(appeal.getSubmitterUU());
|
|
|
+ ModelMap data = new ModelMap();
|
|
|
+ data.put("password", password);
|
|
|
+ data.put("oldMobile", user.getMobile());
|
|
|
+ data.put("oldEmail", user.getEmail());
|
|
|
+ appeal.setSubmitInfo(JSON.toJSONString(data));
|
|
|
appeal.setStatus((short) Status.TO_BE_CERTIFIED.getCode());
|
|
|
appeal.setType(Appeal.Type.RESET_PASSWORD.getDesc());
|
|
|
|
|
|
@@ -41,6 +51,7 @@ public class AppealServiceImpl implements AppealService {
|
|
|
|
|
|
@Override
|
|
|
public void submitChangeAdmin(Appeal appeal, Userspace userspace, Long spaceUU) {
|
|
|
+ User newAdmin = userService.findByMobile(appeal.getMobile());
|
|
|
// 设置企业信息
|
|
|
userspace.setSpaceUU(spaceUU);
|
|
|
Userspace oldSpace = userspaceService.findOne(spaceUU);
|
|
|
@@ -48,7 +59,11 @@ public class AppealServiceImpl implements AppealService {
|
|
|
|
|
|
// 设置默认信息
|
|
|
appeal.setSubmitDate(new Timestamp(System.currentTimeMillis()));
|
|
|
- appeal.setSubmitInfo(JSON.toJSONString(userspace));
|
|
|
+ ModelMap data = new ModelMap(userspace);
|
|
|
+ data.put("newAdminName", newAdmin == null ? appeal.getContactName() : newAdmin.getVipName());
|
|
|
+ data.put("newAdminMobile", newAdmin == null ? appeal.getMobile() : newAdmin.getMobile());
|
|
|
+ data.put("newAdminEmail", newAdmin == null ? appeal.getContactTel() : newAdmin.getEmail());
|
|
|
+ appeal.setSubmitInfo(JSON.toJSONString(data));
|
|
|
appeal.setStatus((short) Status.TO_BE_CERTIFIED.getCode());
|
|
|
appeal.setType(Appeal.Type.CHANGE_ADMIN.getDesc());
|
|
|
|
|
|
@@ -61,7 +76,12 @@ public class AppealServiceImpl implements AppealService {
|
|
|
public void submitValidAccount(Appeal appeal, String password) {
|
|
|
// 设置默认信息
|
|
|
appeal.setSubmitDate(new Timestamp(System.currentTimeMillis()));
|
|
|
- appeal.setSubmitInfo(JSON.toJSONString(new ModelMap("password", password)));
|
|
|
+ User user = userService.findOne(appeal.getSubmitterUU());
|
|
|
+ ModelMap data = new ModelMap();
|
|
|
+ data.put("password", password);
|
|
|
+ data.put("oldMobile", user.getMobile());
|
|
|
+ data.put("oldEmail", user.getEmail());
|
|
|
+ appeal.setSubmitInfo(JSON.toJSONString(data));
|
|
|
appeal.setStatus((short) Status.TO_BE_CERTIFIED.getCode());
|
|
|
appeal.setType(Appeal.Type.VALID_ACCOUNT.getDesc());
|
|
|
|