diff --git a/admin/src/main/java/com/cwhelp/admin/system/controller/RoleController.java b/admin/src/main/java/com/cwhelp/admin/system/controller/RoleController.java index f315724..f98d8ce 100644 --- a/admin/src/main/java/com/cwhelp/admin/system/controller/RoleController.java +++ b/admin/src/main/java/com/cwhelp/admin/system/controller/RoleController.java @@ -16,9 +16,11 @@ import com.cwhelp.component.actionLog.annotation.ActionLog; import com.cwhelp.component.actionLog.annotation.EntityParam; import com.cwhelp.component.shiro.ShiroUtil; import com.cwhelp.modules.business.domain.BssEmployee; +import com.cwhelp.modules.system.domain.Dict; import com.cwhelp.modules.system.domain.Menu; import com.cwhelp.modules.system.domain.Role; import com.cwhelp.modules.system.domain.User; +import com.cwhelp.modules.system.enums.DictTypeEnum; import com.cwhelp.modules.system.service.MenuService; import com.cwhelp.modules.system.service.RoleService; import com.cwhelp.modules.system.service.UserService; @@ -34,6 +36,7 @@ import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; +import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -82,7 +85,27 @@ public class RoleController { public String toRole(@RequestParam(value = "ids") BssEmployee bssEmployee, Model model) { User user = userService.getByName(bssEmployee.getPhoneNum()); if (ObjectUtils.isEmpty(user)) { - throw new ResultException(ResultEnum.USER_NOE_EXIST); + User sessionUser = ShiroUtil.getSubject(); + User newUser = new User(); + newUser.setUsername(bssEmployee.getPhoneNum()); + newUser.setNickname(bssEmployee.getName()); + // 对密码进行加密 + String salt = ShiroUtil.getRandomSalt(); + //默认密码为身份证号 + String encrypt = ShiroUtil.encrypt(bssEmployee.getCard(), salt); + newUser.setPassword(encrypt); + newUser.setSalt(salt); + newUser.setBssPlatform(bssEmployee.getBssDept().getBssPlatform()); + newUser.setSex(bssEmployee.getSex()); + newUser.setDept(sessionUser.getDept()); + newUser.setType("2"); + newUser.setEmail(bssEmployee.getEmail()); + newUser.setPhone(bssEmployee.getPhoneNum()); + newUser.setRemark("系统生成"); + newUser.setCreateDate(new Date()); + newUser.setUpdateDate(new Date()); + user = userService.save(newUser); +// throw new ResultException(ResultEnum.USER_NOE_EXIST); } // 获取指定用户角色列表 Set authRoles = user.getRoles(); diff --git a/admin/src/main/java/com/cwhelp/admin/system/controller/UserController.java b/admin/src/main/java/com/cwhelp/admin/system/controller/UserController.java index ccd2588..337bdeb 100644 --- a/admin/src/main/java/com/cwhelp/admin/system/controller/UserController.java +++ b/admin/src/main/java/com/cwhelp/admin/system/controller/UserController.java @@ -296,7 +296,6 @@ public class UserController { UploadProjectProperties properties = SpringContextUtil.getBean(UploadProjectProperties.class); String fuPath = properties.getFilePath(); String spPath = properties.getStaticPath().replace("*", ""); - String s = fuPath + p.replace(spPath, ""); File file = new File(fuPath + p.replace(spPath, "")); if (file.exists()) { FileCopyUtils.copy(new FileInputStream(file), response.getOutputStream()); diff --git a/admin/src/main/resources/static/favicon.ico b/admin/src/main/resources/static/favicon.ico index d9362c7..7aa1af1 100644 Binary files a/admin/src/main/resources/static/favicon.ico and b/admin/src/main/resources/static/favicon.ico differ diff --git a/admin/src/main/resources/static/images/char-ccmiao.png b/admin/src/main/resources/static/images/char-ccmiao.png deleted file mode 100644 index c495484..0000000 Binary files a/admin/src/main/resources/static/images/char-ccmiao.png and /dev/null differ diff --git a/admin/src/main/resources/static/images/chat-left-picture.jpg b/admin/src/main/resources/static/images/chat-left-picture.jpg deleted file mode 100644 index 3aec55d..0000000 Binary files a/admin/src/main/resources/static/images/chat-left-picture.jpg and /dev/null differ diff --git a/admin/src/main/resources/static/images/chat-right-picture.jpg b/admin/src/main/resources/static/images/chat-right-picture.jpg deleted file mode 100644 index bad9f94..0000000 Binary files a/admin/src/main/resources/static/images/chat-right-picture.jpg and /dev/null differ diff --git a/admin/src/main/resources/static/images/chat-single-dog.png b/admin/src/main/resources/static/images/chat-single-dog.png deleted file mode 100644 index 1ecce40..0000000 Binary files a/admin/src/main/resources/static/images/chat-single-dog.png and /dev/null differ diff --git a/admin/src/main/resources/templates/business/employee/add.html b/admin/src/main/resources/templates/business/employee/add.html index b40e134..ebdf849 100644 --- a/admin/src/main/resources/templates/business/employee/add.html +++ b/admin/src/main/resources/templates/business/employee/add.html @@ -40,6 +40,13 @@ +
+ +
+
+
+
+
diff --git a/admin/src/main/resources/templates/business/employee/detail.html b/admin/src/main/resources/templates/business/employee/detail.html index f1a6a7b..539db31 100644 --- a/admin/src/main/resources/templates/business/employee/detail.html +++ b/admin/src/main/resources/templates/business/employee/detail.html @@ -32,6 +32,10 @@ 邮箱 + + + 性别 + 学历 diff --git a/admin/src/main/resources/templates/business/employee/index.html b/admin/src/main/resources/templates/business/employee/index.html index f191999..c2dab99 100644 --- a/admin/src/main/resources/templates/business/employee/index.html +++ b/admin/src/main/resources/templates/business/employee/index.html @@ -63,6 +63,7 @@ 职位 手机号码 身份证号码 + 性别 邮箱 学历 创建时间 @@ -81,6 +82,7 @@ 手机号码 身份证号码 邮箱 + 邮箱 学历 创建时间 更新时间 diff --git a/admin/src/main/resources/templates/system/main/userInfo.html b/admin/src/main/resources/templates/system/main/userInfo.html index 6890288..569aac2 100644 --- a/admin/src/main/resources/templates/system/main/userInfo.html +++ b/admin/src/main/resources/templates/system/main/userInfo.html @@ -20,7 +20,7 @@
- +
diff --git a/admin/src/main/resources/templates/system/user/add.html b/admin/src/main/resources/templates/system/user/add.html index 10d7b33..c9445e2 100644 --- a/admin/src/main/resources/templates/system/user/add.html +++ b/admin/src/main/resources/templates/system/user/add.html @@ -42,7 +42,7 @@
diff --git a/modules/system/src/main/java/com/cwhelp/modules/business/domain/BssEmployee.java b/modules/system/src/main/java/com/cwhelp/modules/business/domain/BssEmployee.java index 7e4df02..c2eff3d 100644 --- a/modules/system/src/main/java/com/cwhelp/modules/business/domain/BssEmployee.java +++ b/modules/system/src/main/java/com/cwhelp/modules/business/domain/BssEmployee.java @@ -47,6 +47,7 @@ public class BssEmployee implements Serializable { private String phoneNum; // 身份证号码 private String card; + private String sex; // 邮箱 private String email; // 学历 diff --git a/sdoc/应用环境.xlsx b/sdoc/应用环境.xlsx new file mode 100644 index 0000000..1279d65 Binary files /dev/null and b/sdoc/应用环境.xlsx differ