|
@@ -514,6 +514,9 @@ public class UserController extends BaseController {
|
|
|
@RequestMapping(value = "infoEdit")
|
|
|
public String infoEdit(User user, boolean __ajax, HttpServletResponse response, Model model,HttpServletRequest request) {
|
|
|
User currentUser = UserUtils.getUser();
|
|
|
+ WorkStaffBasicInfo workStaffBasicInfo = new WorkStaffBasicInfo();
|
|
|
+ workStaffBasicInfo.setUserId(currentUser.getId());
|
|
|
+
|
|
|
if (StringUtils.isNotBlank(user.getName())){
|
|
|
if(Global.isDemoMode()){
|
|
|
model.addAttribute("message", "演示模式,不允许操作!");
|
|
@@ -521,8 +524,11 @@ public class UserController extends BaseController {
|
|
|
}
|
|
|
|
|
|
String name = user.getName();
|
|
|
+ workStaffBasicInfo.setName(name);
|
|
|
if(!name.equals(currentUser.getName())){
|
|
|
currentUser.setName(user.getName());
|
|
|
+ workStaffBasicInfo.setName(user.getName());
|
|
|
+
|
|
|
long time = System.currentTimeMillis();
|
|
|
String realPathPhoto = Global.getUserfilesBaseDir() + Global.USERFILES_BASE_URL +time+ "/img/";
|
|
|
FileUtils.createDirectory(realPathPhoto);
|
|
@@ -570,16 +576,27 @@ public class UserController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(user.getEmail() !=null )
|
|
|
+ if (StringUtils.isNotBlank(user.getEmail())) {
|
|
|
currentUser.setEmail(user.getEmail());
|
|
|
- if(user.getPhone() !=null )
|
|
|
+ workStaffBasicInfo.setEmail(user.getEmail());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(user.getPhone())) {
|
|
|
currentUser.setPhone(user.getPhone());
|
|
|
- if(user.getMobile() !=null )
|
|
|
+ workStaffBasicInfo.setPhone(user.getPhone());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(user.getMobile())) {
|
|
|
currentUser.setMobile(user.getMobile());
|
|
|
- if(user.getRemarks() !=null )
|
|
|
+ workStaffBasicInfo.setMobile(user.getMobile());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(user.getRemarks())) {
|
|
|
currentUser.setRemarks(user.getRemarks());
|
|
|
+ workStaffBasicInfo.setRemarks(user.getRemarks());
|
|
|
+ }
|
|
|
|
|
|
systemService.updateUserInfo(currentUser);
|
|
|
+ //同步sys_user和work_staff_basic_info表
|
|
|
+ workStaffBasicInfoService.updateWorkStaffBasicInfo(workStaffBasicInfo);
|
|
|
+
|
|
|
if(__ajax){//手机访问
|
|
|
AjaxJson j = new AjaxJson();
|
|
|
j.setSuccess(true);
|
|
@@ -594,7 +611,7 @@ public class UserController extends BaseController {
|
|
|
model.addAttribute("user", currentUser);
|
|
|
model.addAttribute("Global", new Global());
|
|
|
return "modules/sys/userInfoEdit";
|
|
|
- }
|
|
|
+}
|
|
|
|
|
|
@ResponseBody
|
|
|
@RequestMapping(value = "getComName")
|