|
@@ -60,6 +60,7 @@ import org.springblade.system.user.excel.UserExcel2;
|
|
|
import org.springblade.system.user.excel.UserImporter;
|
|
|
import org.springblade.system.user.service.IUserService;
|
|
|
import org.springblade.system.user.util.AesInfoUtil;
|
|
|
+import org.springblade.system.user.vo.DeptUserVO;
|
|
|
import org.springblade.system.user.vo.UserVO;
|
|
|
import org.springblade.system.user.wrapper.UserWrapper;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
@@ -164,6 +165,33 @@ public class UserController {
|
|
|
@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
|
|
|
public R submit(@Valid @RequestBody UserDTO user) {
|
|
|
CacheUtil.clear(USER_CACHE);
|
|
|
+ // 内控系统拆分
|
|
|
+ List<DeptUserVO> deptList = user.getDeptList();
|
|
|
+ if (deptList != null && deptList.size() >= 1) {
|
|
|
+ String deptId = "";
|
|
|
+ String postId = "";
|
|
|
+ String isLaderpostId = "";
|
|
|
+ for (int i = 0; i < deptList.size(); i++) {
|
|
|
+ DeptUserVO deptUserVO = deptList.get(i);
|
|
|
+ if (i == 0) {
|
|
|
+ deptId += deptUserVO.getDeptId() + "";
|
|
|
+ postId += deptUserVO.getPostId() + "";
|
|
|
+ if (deptUserVO.getIsLader() == 1) {
|
|
|
+ isLaderpostId = deptUserVO.getDeptId() + "";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ deptId += "," + deptUserVO.getDeptId();
|
|
|
+ postId += "," + deptUserVO.getPostId() + ",";
|
|
|
+ if (deptUserVO.getIsLader() == 1) {
|
|
|
+ isLaderpostId = "," + deptUserVO.getDeptId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ user.setPostId(postId);
|
|
|
+ user.setDeptId(deptId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
return R.status(userService.submit(user));
|
|
|
}
|
|
|
|
|
@@ -185,8 +213,34 @@ public class UserController {
|
|
|
@PostMapping("/update")
|
|
|
@ApiOperationSupport(order = 5)
|
|
|
@ApiOperation(value = "修改", notes = "传入User")
|
|
|
- public R update(@Valid @RequestBody User user) {
|
|
|
+ public R update(@Valid @RequestBody UserDTO user) {
|
|
|
CacheUtil.clear(USER_CACHE);
|
|
|
+ // 内控系统拆分
|
|
|
+ List<DeptUserVO> deptList = user.getDeptList();
|
|
|
+ if (deptList != null && deptList.size() >= 1) {
|
|
|
+ String deptId = "";
|
|
|
+ String postId = "";
|
|
|
+ String isLaderpostId = "";
|
|
|
+ for (int i = 0; i < deptList.size(); i++) {
|
|
|
+ DeptUserVO deptUserVO = deptList.get(i);
|
|
|
+ if (i == 0) {
|
|
|
+ deptId += deptUserVO.getDeptId() + "";
|
|
|
+ postId += deptUserVO.getPostId() + "";
|
|
|
+ if (deptUserVO.getIsLader() == 1) {
|
|
|
+ isLaderpostId = deptUserVO.getDeptId() + "";
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ deptId += "," + deptUserVO.getDeptId();
|
|
|
+ postId += "," + deptUserVO.getPostId() + ",";
|
|
|
+ if (deptUserVO.getIsLader() == 1) {
|
|
|
+ isLaderpostId = "," + deptUserVO.getDeptId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ user.setIsLader(isLaderpostId);
|
|
|
+ user.setPostId(postId);
|
|
|
+ user.setDeptId(deptId);
|
|
|
+ }
|
|
|
return R.status(userService.updateUser(user));
|
|
|
}
|
|
|
|