daijiajun 部门管理中页面功能,页面出初始化,条件查询,添加部门中部门负责人选择

main
admin 3 days ago
parent 3503b1a504
commit 58b6768ad1
  1. 76
      src/main/java/com/keyware/htey/controller/Department/DepartmentController.java
  2. 233
      src/main/java/com/keyware/htey/controller/project/ProjectKtController.java
  3. 33
      src/main/java/com/keyware/htey/controller/user/UserController.java
  4. 9
      src/main/java/com/keyware/htey/entity/department/Department.java
  5. 6
      src/main/java/com/keyware/htey/entity/user/User.java
  6. 3
      src/main/java/com/keyware/htey/mybatis/itf/DepartmentMapper.java
  7. 3
      src/main/java/com/keyware/htey/mybatis/itf/OFourColumMapper.java
  8. 10
      src/main/java/com/keyware/htey/mybatis/itf/UserMapper.java
  9. 35
      src/main/java/com/keyware/htey/service/impl/DepartmentServiceImpl.java
  10. 10
      src/main/java/com/keyware/htey/service/impl/OFourColumServiceImpl.java
  11. 28
      src/main/java/com/keyware/htey/service/impl/UserServiceImpl.java
  12. 5
      src/main/java/com/keyware/htey/service/itf/DepartmentService.java
  13. 2
      src/main/java/com/keyware/htey/service/itf/OFourColumService.java
  14. 13
      src/main/java/com/keyware/htey/service/itf/UserService.java
  15. 9
      src/main/java/com/keyware/htey/utli/Constant.java
  16. 31
      src/main/resources/mapper/DepartmentMapper.xml
  17. 10
      src/main/resources/mapper/OFourColumMapper.xml
  18. 161
      src/main/resources/mapper/UserMapper.xml
  19. 4
      src/main/resources/mapper/UserRoleMapper.xml

@ -4,7 +4,10 @@ import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.keyware.htey.entity.department.Department; import com.keyware.htey.entity.department.Department;
import com.keyware.htey.entity.user.AuditLog;
import com.keyware.htey.service.itf.AuditLogService;
import com.keyware.htey.service.itf.DepartmentService; import com.keyware.htey.service.itf.DepartmentService;
import com.keyware.htey.utli.Constant;
import com.keyware.htey.utli.JsonUtils; import com.keyware.htey.utli.JsonUtils;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponse;
@ -33,6 +36,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
public class DepartmentController { public class DepartmentController {
@Autowired @Autowired
private DepartmentService departmentService; private DepartmentService departmentService;
@Autowired
private AuditLogService auditLogService;
@GetMapping("/selectById") @GetMapping("/selectById")
@ResponseBody @ResponseBody
@ -47,11 +52,8 @@ public class DepartmentController {
* @date 2025/1/7 * @date 2025/1/7
* @description 新增部门表 * @description 新增部门表
*/ */
@RequestMapping( @RequestMapping(value = {"/addDepartment"}, method = {RequestMethod.POST},
value = {"/addDepartment"}, produces = {"application/json; charset=utf-8"})
method = {RequestMethod.POST},
produces = {"application/json; charset=utf-8"}
)
@ResponseBody @ResponseBody
@Operation(summary = "新增部门表", description = "返回新增部门信息") @Operation(summary = "新增部门表", description = "返回新增部门信息")
@ApiResponse(responseCode = "200", description = "成功新增部门信息") @ApiResponse(responseCode = "200", description = "成功新增部门信息")
@ -69,11 +71,9 @@ public class DepartmentController {
* @date 2025/1/7 * @date 2025/1/7
* @description 修改部门 * @description 修改部门
*/ */
@RequestMapping( @RequestMapping(value = {"/updateDepartment"},
value = {"/updateDepartment"},
method = {RequestMethod.POST}, method = {RequestMethod.POST},
produces = {"application/json; charset=utf-8"} produces = {"application/json; charset=utf-8"})
)
@ResponseBody @ResponseBody
@Operation(summary = "修改部门", description = "返回修改部门信息") @Operation(summary = "修改部门", description = "返回修改部门信息")
@ApiResponse(responseCode = "200", description = "成功修改部门信息") @ApiResponse(responseCode = "200", description = "成功修改部门信息")
@ -102,11 +102,8 @@ public class DepartmentController {
return departmentService.removeById(id); return departmentService.removeById(id);
} }
@RequestMapping( @RequestMapping(value = {"/getParentId"}, method = {RequestMethod.GET},
value = {"/getParentId"}, produces = {"application/json; charset=utf-8"})
method = {RequestMethod.GET},
produces = {"application/json; charset=utf-8"}
)
@ResponseBody @ResponseBody
@Operation(summary = "查询部门父节点信息", description = "返回部门父节点信息") @Operation(summary = "查询部门父节点信息", description = "返回部门父节点信息")
@ApiResponse(responseCode = "200", description = "成功部门父节点信息") @ApiResponse(responseCode = "200", description = "成功部门父节点信息")
@ -120,4 +117,55 @@ public class DepartmentController {
return JsonUtils.arrayListToJsonString(department); return JsonUtils.arrayListToJsonString(department);
} }
@RequestMapping(
value = {"/select"},
method = {RequestMethod.POST},
produces = {"application/json; charset=utf-8"}
)
@ResponseBody
@Operation(summary = "查询部门列表信息", description = "返回查询部门列表")
@ApiResponse(responseCode = "200", description = "成功返回查询部门列表")
public List<Department> select(@RequestBody Department department, @RequestParam(defaultValue = "0") int pageNum,
@RequestParam(defaultValue = "10") int pageSize) {
AuditLog auditLog = new AuditLog();
department.setPageSize(pageSize);
department.setPageNum(pageNum);
if ("请输入部门名称...".equals(department.getDeptName())) {
department.setDeptName(null);
}
//if ("sysadmin".equals(this.getUser_idFormSession("userId"))) {
// department.setIsSys("sysadmin");
//}
department.setProjectSource(Constant.projectName);
List<Department> departmentList = this.departmentService.selectByDeparmentInfo(department);
//List<Department> parentNameList = new ArrayList();
//Department vo;
//for (Iterator var5 = departmentList.iterator(); var5.hasNext(); parentNameList.add(vo)) {
// vo = (Department)var5.next();
// Integer selectUserCountByDeptId = this.userService.selectUserCountByDeptId(vo.getId());
// if (selectUserCountByDeptId != null) {
// vo.setUserCount(selectUserCountByDeptId);
// }
//
// Department selectByPrimaryKey = this.departmentService.selectByPrimaryKey(vo.getParentId());
// if (selectByPrimaryKey != null) {
// vo.setParentName(selectByPrimaryKey.getDeptName());
// }
//}
String logName = "查询部门列表";
String logNameType = "部门管理";
//String comments = this.getUser_idFormSession("userName") + "查询部门列表,查询关键字为:" + department.getDeptName() ==
// null ? "" : department.getDeptName();
//todo 获取登录人信息
String comments = "查询部门列表,查询关键字为:" + department.getDeptName() == null ? ""
: department.getDeptName();
auditLog.setLogName(logName);
auditLog.setLogNameType(logNameType);
auditLog.setComments(comments);
auditLogService.addAuditLog(auditLog);
return departmentList;
}
} }

@ -0,0 +1,233 @@
package com.keyware.htey.controller.project;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.keyware.htey.entity.department.Department;
import com.keyware.htey.entity.organizeassets.OFourColum;
import com.keyware.htey.entity.user.User;
import com.keyware.htey.service.itf.DepartmentService;
import com.keyware.htey.service.itf.OFourColumService;
import com.keyware.htey.service.itf.UserService;
import com.keyware.htey.utli.Constant;
import com.keyware.htey.utli.JsonUtils;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author daijiajun
* @version V1.0
* @description 对与项目管理模块业务的处理
* @Package com.keyware.htey.controller.project
* @date 2025/1/15 15:43
*/
@Controller
@RequestMapping("/projectKt")
@Tag(name = "项目管理模块 API", description = "部门表数据接口")
@Slf4j
public class ProjectKtController {
@Autowired
private OFourColumService fourColumService;
@Resource
private DepartmentService departmentService;
@Autowired
private UserService userService;
@Autowired
private OFourColumService oFourColumService;
@RequestMapping(
value = {"/selectDepartUser"},
method = {RequestMethod.POST},
produces = {"application/json; charset=utf-8"}
)
@ResponseBody
@Operation(summary = "查询部门负责人", description = "返回部门负责人信息")
@ApiResponse(responseCode = "200", description = "部门负责人返回成功")
public String selectDepartUser(@RequestBody User user, @RequestParam(required = false) String setDocumentDepartId,
@RequestParam(required = false) String headId) {
List<User> list = new ArrayList();
String departId = user.getDepartId() == null ? "" : user.getDepartId();
String set_document_departId = setDocumentDepartId == null ? "" : setDocumentDepartId;
String source = user.getSecret() == null ? "" : user.getSecret();
String userName = user.getUserNameForSerch();
if (user.getSystemLevel() != "" && user.getSystemLevel() != null) {
user.setSystemLevel(getSeq(user.getSystemLevel()).toString());
}
log.info("查询条件=" + userName);
String projectClassIficationName = user.getUesrRankName() == null ? "" : user.getUesrRankName();
String projectClassIfication = user.getUesrRankId() == null ? "" : user.getUesrRankId();
String customer = Constant.customer;
if ("sysadmin".equals(Constant.userId)) {
user.setIsSys("sysadmin");
}
user.setFlag("1");
List users;
Iterator userIterator;
if (!"".equals(set_document_departId)) {
Department department = this.departmentService.selectByPrimaryKey(set_document_departId);
if (department != null) {
users = null;
if (customer != null && customer.equals("siyuan17suo")) {
if (userName != null && !"搜索您想寻找的...".equals(userName)) {
user.setUserNameForSerch(userName);
user.setDepartId(department.getParentId());
user.setProjectSource(Constant.projectName);
users = this.userService.selectByUserInfo17suo(user);
} else {
users = this.userService.selectDepartUser17suo(department.getParentId());
}
userIterator = users.iterator();
while (userIterator.hasNext()) {
User u = (User)userIterator.next();
if (("内部".equals(projectClassIficationName) || "秘密".equals(projectClassIficationName))
&& !"10".equals(u.getSecret()) && !"20".equals(u.getSecret()) && !"30".equals(
u.getSecret())) {
userIterator.remove();
}
if ("机密".equals(projectClassIficationName) && !"20".equals(u.getSecret()) && !"30".equals(
u.getSecret())) {
userIterator.remove();
}
}
}
return JsonUtils.arrayListToJsonString(users);
}
} else {
HashSet selectByparentId;
String deptId;
if (customer == null || !customer.equals("siyuan17suo") && !customer.equals("guiyangshiyuan")) {
if (StringUtils.hasText(userName)) {
if (!"搜索您想寻找的...".equals(userName)) {
user.setUserNameForSerch(userName);
}
users = this.userService.selectByUserInfo(user);
list.addAll(users);
} else if (!"".equals(source)) {
user.setDepartId(departId);
users = this.userService.selectByUserInfo(user);
list.addAll(users);
} else {
selectByparentId = this.departmentService.selectByparentId(departId);
user.setDepartId(departId);
users = this.userService.selectByUserInfo(user);
list.addAll(users);
userIterator = selectByparentId.iterator();
while (userIterator.hasNext()) {
deptId = (String)userIterator.next();
user.setDepartId(deptId);
users = this.userService.selectByUserInfo(user);
list.addAll(users);
}
}
} else {
if (StringUtils.hasText(userName)) {
if (!"搜索您想寻找的...".equals(userName)) {
user.setUserNameForSerch(userName);
}
users = this.userService.selectByUserInfo17suo(user);
list.addAll(users);
} else if (!"".equals(source)) {
user.setDepartId(departId);
// users = this.userService.selectByUserInfo17suo(user);
users = userService.selectByUser(user);
list.addAll(users);
} else {
selectByparentId = this.departmentService.selectByparentId(departId);
user.setDepartId(departId);
// users = this.userService.selectByUserInfo17suo(user);
users = userService.selectByUser(user);
list.addAll(users);
userIterator = selectByparentId.iterator();
while (userIterator.hasNext()) {
deptId = (String)userIterator.next();
if (deptId != "" && deptId != null) {
user.setDepartId(deptId);
users = userService.selectByUser(user);
list.addAll(users);
}
}
}
Iterator<User> iterator = list.iterator();
while (iterator.hasNext()) {
User u = (User)iterator.next();
if (("内部".equals(projectClassIficationName) || "秘密".equals(projectClassIficationName))
&& !"10".equals(u.getSecret()) && !"20".equals(u.getSecret()) && !"30".equals(u.getSecret())) {
iterator.remove();
}
if ("机密".equals(projectClassIficationName) && !"20".equals(u.getSecret()) && !"30".equals(
u.getSecret())) {
iterator.remove();
}
}
}
}
List listnew = new ArrayList();
Iterator var21 = list.iterator();
while (var21.hasNext()) {
User user1 = (User)var21.next();
if (!listnew.contains(user1)) {
listnew.add(user1);
}
}
if (!StringUtils.isEmpty(projectClassIfication)) {
OFourColum oFourColum = oFourColumService.selectByPrimaryKey(projectClassIfication);
if (oFourColum != null) {
Iterator iterator = listnew.iterator();
while (iterator.hasNext()) {
User next = (User)iterator.next();
if (!StringUtils.isEmpty(next.getSecret())) {
OFourColum oFourColum1 = oFourColumService.selectByPrimaryKey(next.getSecret());
if (oFourColum1 != null && oFourColum.getSeq() > oFourColum1.getSeq() || oFourColum1 == null) {
iterator.remove();
}
}
}
}
}
if (!StringUtils.isEmpty(headId)) {
listnew = (List)listnew.stream().filter(o -> !((User)o).getId().equals(headId)).collect(
Collectors.toList());
}
return JsonUtils.toJson(listnew);
}
public Integer getSeq(String id) {
OFourColum OFourColum = null;
if (!StringUtils.isEmpty(id)) {
OFourColum = fourColumService.selectByPrimaryKey(id);
}
if (Objects.isNull(OFourColum)) {
return null;
}
return OFourColum.getSeq();
}
}

@ -1,8 +1,11 @@
package com.keyware.htey.controller.user; package com.keyware.htey.controller.user;
import java.util.ArrayList;
import java.util.Base64; import java.util.Base64;
import java.util.Date; import java.util.Date;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -61,6 +64,8 @@ public class UserController {
private DepartmentService departmentService; private DepartmentService departmentService;
@Autowired @Autowired
private UsersecretService usersecretService; private UsersecretService usersecretService;
//@Autowired
//private SessionDAO sessionDAO;
/** /**
* @author yangmengchuan * @author yangmengchuan
@ -491,7 +496,7 @@ public class UserController {
userService.updateByPrimaryKey(user); userService.updateByPrimaryKey(user);
User oneUser = userService.selectByPrimaryKey(userId); User oneUser = userService.selectByPrimaryKey(userId);
if (oneUser == null) { if (oneUser == null) {
log.error("id为[" + userId + "]"); log.error("不存在id为[" + userId + "]");
return Constant.ERROE_MESSAGE; return Constant.ERROE_MESSAGE;
} }
if ("".equals(userNames)) { if ("".equals(userNames)) {
@ -606,7 +611,7 @@ public class UserController {
for (String userId : listId) { for (String userId : listId) {
User user = this.userService.selectByPrimaryKey(userId); User user = this.userService.selectByPrimaryKey(userId);
if (user == null) { if (user == null) {
log.error("id为[" + userId + "]"); log.error("不存在id为[" + userId + "]");
return Constant.ERROE_MESSAGE; return Constant.ERROE_MESSAGE;
} }
if ("".equals(userNames)) { if ("".equals(userNames)) {
@ -766,11 +771,11 @@ public class UserController {
if (!oldUser.getSex().equals(user.getSex())) { if (!oldUser.getSex().equals(user.getSex())) {
oldUserRankId = "女"; oldUserRankId = "女";
userRankId = "女"; userRankId = "女";
if ("0".equals(oldUser.getSex())) { if (Constant.UESR_SEX_MAN.equals(oldUser.getSex())) {
oldUserRankId = "男"; oldUserRankId = "男";
} }
if ("0".equals(user.getSex())) { if (Constant.UESR_SEX_MAN.equals(user.getSex())) {
userRankId = "男"; userRankId = "男";
} }
@ -809,11 +814,11 @@ public class UserController {
if (!oldUser.getUesrRankId().equals(user.getUesrRankId())) { if (!oldUser.getUesrRankId().equals(user.getUesrRankId())) {
oldUserRankId = "普通"; oldUserRankId = "普通";
userRankId = "普通"; userRankId = "普通";
if ("d453bf52e571451996a8f5c251f7eb8d".equals(oldUser.getUesrRankId())) { if (Constant.UESR_RANK_ID_SECRET.equals(oldUser.getUesrRankId())) {
oldUserRankId = "秘密"; oldUserRankId = "秘密";
} }
if ("d453bf52e571451996a8f5c251f7eb8d".equals(user.getUesrRankId())) { if (Constant.UESR_RANK_ID_SECRET.equals(user.getUesrRankId())) {
userRankId = "秘密"; userRankId = "秘密";
} }
@ -860,4 +865,20 @@ public class UserController {
} }
return ajaxMessage; return ajaxMessage;
} }
@RequestMapping(
value = {"/selectLoginList"},
produces = {"application/json; charset=utf-8"}
)
@ResponseBody
@Operation(summary = "查询已登录用户", description = "返回查询已登录用户信息")
@ApiResponse(responseCode = "200", description = "查询已登录用户成功")
public List<User> selectLoginList(String userNameForSerch) {
//Collection<Session> sessions = this.sessionDAO.getActiveSessions();
List<String> list = new ArrayList();
Map<String, String> maploginIp = new HashMap();
Map<String, String> maploginTime = new HashMap();
//Iterator var7 = sessions.iterator();
return new ArrayList<>();
}
} }

@ -2,6 +2,7 @@ package com.keyware.htey.entity.department;
import java.io.Serializable; import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
@ -28,4 +29,12 @@ public class Department implements Serializable {
private String charge; private String charge;
private String isSys; private String isSys;
private String projectSource; private String projectSource;
@TableField(exist = false)
private Integer userCount;
@TableField(exist = false)
private String parentName;
@TableField(exist = false)
private int pageNum;
@TableField(exist = false)
private int pageSize;
} }

@ -42,6 +42,9 @@ public class User implements Serializable {
private String logoutTime; private String logoutTime;
private String projectSource; private String projectSource;
private String uesrRankId; private String uesrRankId;
private byte[] imgData;
@TableField(exist = false)
private String uesrRankName;
@TableField(exist = false) @TableField(exist = false)
private String deptName; private String deptName;
@TableField(exist = false) @TableField(exist = false)
@ -58,5 +61,6 @@ public class User implements Serializable {
private int pageNum; private int pageNum;
@TableField(exist = false) @TableField(exist = false)
private int pageSize; private int pageSize;
private byte[] imgData; @TableField(exist = false)
private String systemLevel;
} }

@ -21,4 +21,7 @@ public interface DepartmentMapper extends BaseMapper<Department> {
List<Department> getParentId(@Param("parentId") String var1, @Param("isSys") String var2, List<Department> getParentId(@Param("parentId") String var1, @Param("isSys") String var2,
@Param("projectSource") String var3); @Param("projectSource") String var3);
List<Department> selectByDeparmentInfo(Department var1);
List<Department> selectByparentId(@Param("parentId") String var1, @Param("projectSource") String var2);
} }

@ -3,6 +3,7 @@ package com.keyware.htey.mybatis.itf;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.keyware.htey.entity.organizeassets.OFourColum; import com.keyware.htey.entity.organizeassets.OFourColum;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/** /**
* @author yangmengchuan * @author yangmengchuan
@ -11,5 +12,5 @@ import org.apache.ibatis.annotations.Mapper;
*/ */
@Mapper @Mapper
public interface OFourColumMapper extends BaseMapper<OFourColum> { public interface OFourColumMapper extends BaseMapper<OFourColum> {
OFourColum selectByPrimaryKey(@Param("id") String id);
} }

@ -43,4 +43,14 @@ public interface UserMapper extends BaseMapper<User> {
@Param("pageSize") int pageSize, @Param("projectSource") String var2); @Param("pageSize") int pageSize, @Param("projectSource") String var2);
int delPwdResetList(List var1); int delPwdResetList(List var1);
Integer selectUserCountByDeptId(@Param("deptId") String var1, @Param("projectSource") String var2);
List<User> selectDepartUser17suo(@Param("departId") String var1, @Param("projectSource") String var2);
List<User> selectByUserInfo17suo1(User var1);
List<User> selectByUserInfo(User var1);
List<User> selectDepartUser(@Param("departId") String var1, @Param("projectSource") String var2);
} }

@ -1,5 +1,7 @@
package com.keyware.htey.service.impl; package com.keyware.htey.service.impl;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -31,4 +33,37 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
public List<Department> getParentId(String parentId, String isSys, String projectRsource) { public List<Department> getParentId(String parentId, String isSys, String projectRsource) {
return this.departmentMapper.getParentId(parentId, isSys, projectRsource); return this.departmentMapper.getParentId(parentId, isSys, projectRsource);
} }
@Override
public List<Department> selectByDeparmentInfo(Department department) {
department.setProjectSource(Constant.projectName);
return this.departmentMapper.selectByDeparmentInfo(department);
}
@Override
public HashSet<String> selectByparentId(String parentId) {
HashSet<String> hashSet = new HashSet();
return this.recursionDeptId(hashSet, parentId);
}
private HashSet<String> recursionDeptId(HashSet<String> hashSet, String parentId) {
if (parentId == null) {
parentId = "";
}
List<Department> selectByparentId = this.departmentMapper.selectByparentId(parentId, Constant.projectName);
if (selectByparentId.size() == 0) {
hashSet.add(parentId);
return hashSet;
} else {
Department department;
for (Iterator var4 = selectByparentId.iterator(); var4.hasNext(); hashSet = this.recursionDeptId(hashSet,
department.getId())) {
department = (Department)var4.next();
hashSet.add(department.getId());
}
return hashSet;
}
}
} }

@ -14,4 +14,14 @@ public class OFourColumServiceImpl extends ServiceImpl<OFourColumMapper, OFourCo
@Autowired @Autowired
private OFourColumMapper oFourColumMapper; private OFourColumMapper oFourColumMapper;
@Override
public OFourColum selectByPrimaryKey(String id) {
// OFourColum oFourColum = jedisClientSingle.getObject(FOUR_COLUMN + id);
// if (oFourColum == null) {
// oFourColum = oFourColumMapper.selectByPrimaryKey(id);
// jedisClientSingle.setObject(FOUR_COLUMN + id, oFourColum);
// }
OFourColum oFourColum = oFourColumMapper.selectByPrimaryKey(id);
return oFourColum;
}
} }

@ -99,4 +99,32 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
public int delPwdResetList(List listId) { public int delPwdResetList(List listId) {
return this.userMapper.delPwdResetList(listId); return this.userMapper.delPwdResetList(listId);
} }
@Override
public Integer selectUserCountByDeptId(String deptId) {
return this.userMapper.selectUserCountByDeptId(deptId, Constant.projectName);
}
@Override
public List<User> selectDepartUser17suo(String parentId) {
return this.userMapper.selectDepartUser17suo(parentId, Constant.projectName);
}
@Override
public List<User> selectByUser(User var1) {
var1.setProjectSource(Constant.projectName);
return userMapper.selectByUserInfo17suo1(var1);
}
@Override
public List<User> selectByUserInfo(User user) {
user.setProjectSource(Constant.projectName);
return this.userMapper.selectByUserInfo(user);
}
@Override
public List<User> selectDepartUser(String departId) {
return this.userMapper.selectDepartUser(departId, Constant.projectName);
}
} }

@ -1,5 +1,6 @@
package com.keyware.htey.service.itf; package com.keyware.htey.service.itf;
import java.util.HashSet;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@ -11,4 +12,8 @@ public interface DepartmentService extends IService<Department> {
Department selectByPrimaryKey(String var1); Department selectByPrimaryKey(String var1);
List<Department> getParentId(String var1, String var2, String var3); List<Department> getParentId(String var1, String var2, String var3);
List<Department> selectByDeparmentInfo(Department var1);
HashSet<String> selectByparentId(String var1);
} }

@ -4,5 +4,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.keyware.htey.entity.organizeassets.OFourColum; import com.keyware.htey.entity.organizeassets.OFourColum;
public interface OFourColumService extends IService<OFourColum> { public interface OFourColumService extends IService<OFourColum> {
OFourColum selectByPrimaryKey(String id);
} }

@ -4,7 +4,6 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.keyware.htey.entity.user.User; import com.keyware.htey.entity.user.User;
import org.springframework.web.bind.annotation.RequestParam;
public interface UserService extends IService<User> { public interface UserService extends IService<User> {
@ -33,6 +32,18 @@ public interface UserService extends IService<User> {
int deleteByPrimaryKey(List<String> var1); int deleteByPrimaryKey(List<String> var1);
void deleteUserRoleByUserId(String var1); void deleteUserRoleByUserId(String var1);
List<User> pwdResetList(String var1, int pageNum, int pageSize); List<User> pwdResetList(String var1, int pageNum, int pageSize);
int delPwdResetList(List var1); int delPwdResetList(List var1);
Integer selectUserCountByDeptId(String var1);
List<User> selectDepartUser17suo(String var1);
List<User> selectByUser(User var1);
List<User> selectByUserInfo(User var1);
List<User> selectDepartUser(String var1);
} }

@ -11,4 +11,13 @@ public class Constant {
public static String RULE_NUMBER = "kw"; public static String RULE_NUMBER = "kw";
public static Integer userCount = 0; public static Integer userCount = 0;
public static String ERROE_MESSAGE = "系统错误,请联系管理员"; public static String ERROE_MESSAGE = "系统错误,请联系管理员";
public static String UESR_RANK_ID_SECRET = "d453bf52e571451996a8f5c251f7eb8d";
public static String UESR_SEX_MAN = "0";
//public static String customer = getUser_idFormSession("customCode");
public static String customer = "siyuan17suo";
//public static String userId = this.getUser_idFormSession("userId")
public static String userId = "admin";
} }

@ -17,6 +17,10 @@
<result column="CHARGE" property="charge" jdbcType="VARCHAR"/> <result column="CHARGE" property="charge" jdbcType="VARCHAR"/>
<result column="IS_SYS" property="isSys" jdbcType="VARCHAR"/> <result column="IS_SYS" property="isSys" jdbcType="VARCHAR"/>
<result column="PROJECT_SOURCE" property="projectSource" jdbcType="VARCHAR"/> <result column="PROJECT_SOURCE" property="projectSource" jdbcType="VARCHAR"/>
<result column="userCount" property="userCount" jdbcType="INTEGER"/>
<result column="parentName" property="parentName" jdbcType="VARCHAR"/>
<result column="pageNum" property="pageNum" jdbcType="INTEGER"/>
<result column="pageSize" property="pageSize" jdbcType="INTEGER"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@ -51,4 +55,31 @@
and IS_SYS = '0' and IS_SYS = '0'
</if> </if>
</select> </select>
<select id="selectByDeparmentInfo" parameterType="com.keyware.htey.entity.department.Department"
resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from DEPARTMENT
where 1=1
and DEPARTMENT.project_source= #{projectSource,jdbcType=VARCHAR}
<if test="isSys != 'sysadmin'">
and IS_SYS = '0'
</if>
<if test="deptName != null and deptName != ''">
and DEPT_NAME like '%'||#{deptName,jdbcType=VARCHAR}||'%'
</if>
<if test="deptNumber != null and deptNumber != ''">
and DEPT_NUMBER like '%'||#{deptNumber,jdbcType=VARCHAR}||'%'
</if>
LIMIT #{pageNum},#{pageSize}
order by DEPT_CREATE_TIME DESC
</select>
<select id="selectByparentId" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from DEPARTMENT
where PARENT_ID = #{parentId}
and PROJECT_SOURCE=#{projectSource}
</select>
</mapper> </mapper>

@ -11,4 +11,14 @@
<result column="IS_DEFAULT" property="formLevel" jdbcType="VARCHAR"/> <result column="IS_DEFAULT" property="formLevel" jdbcType="VARCHAR"/>
<result column="FORM_LEVEL" property="isDefault" jdbcType="VARCHAR"/> <result column="FORM_LEVEL" property="isDefault" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List">
ID
,NAME, CODE, DESCRIBE, PARENT_ID,SEQ,IS_DEFAULT,FORM_LEVEL
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from KT_O_FOUR_COLUM
where ID = #{id,jdbcType=VARCHAR}
</select>
</mapper> </mapper>

@ -33,6 +33,9 @@
<result column="pageNum" property="pageNum" jdbcType="INTEGER"/> <result column="pageNum" property="pageNum" jdbcType="INTEGER"/>
<result column="pageSize" property="pageSize" jdbcType="INTEGER"/> <result column="pageSize" property="pageSize" jdbcType="INTEGER"/>
<result column="IMG_DATA" property="imgData" jdbcType="BLOB"/> <result column="IMG_DATA" property="imgData" jdbcType="BLOB"/>
<result column="IS_SYS" property="isSys" jdbcType="VARCHAR"/>
<result column="PROJECT_SOURCE" property="projectSource" jdbcType="VARCHAR"/>
<result column="systemLevel" property="systemLevel" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
@ -442,4 +445,162 @@
#{item} #{item}
</foreach> </foreach>
</update> </update>
<select id="selectUserCountByDeptId" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT count(*)
from K_USER
where K_USER.DEPART_ID = #{deptId,jdbcType=VARCHAR}
and IS_SYS = '0'
and PROJECT_SOURCE = #{projectSource}
</select>
<select id="selectDepartUser17suo" resultMap="BaseResultMap">
select K_USER.ID, K_USER.USER_ID, K_USER.USER_NAME, K_USER.DEPART_ID, USERSECRET.SECRET
from K_USER
left join USERSECRET on K_USER.ID = USERSECRET.ID
where K_USER.USER_STATUS = '0'
and K_USER.PROJECT_SOURCE = #{projectSource,jdbcType=VARCHAR}
<if test="departId != null and departId !=''">
and K_USER.DEPART_ID=#{departId,jdbcType=VARCHAR}
</if>
</select>
<select id="selectByUserInfo17suo1" resultMap="BaseResultMap" parameterType="com.keyware.htey.entity.user.User">
select
K_USER.ID,
K_USER.USER_ID,
K_USER.USER_NAME,
K_USER.PASSWORD,
K_USER.DEPART_ID,
K_USER.USER_CREATION_TIME,
K_USER.USER_PWD_MODIF_TIME,
K_USER.USER_STATUS,
K_USER.USER_LOCK,
K_USER.USER_PWD_ERROR,
K_USER.USER_PWD_ERROR_DATE,
K_USER.EXIT_TIME,
K_USER.PASSWORD_OLD,
K_USER.POST,
K_USER.EMAIL,
K_USER.OFFICE_TELEPHONE,
K_USER.USER_NUMBER,
K_USER.ID_CARD,
K_USER.MOBILE_PHONE,
K_USER.SEX,
K_USER.HOME_PHONE,
K_USER.LOGOUT,
K_USER.INIT_PWD_TIME,
K_USER.SORT ,
K_USER.LOGOUT_TIME,
K_USER.UESR_RANK_ID,
DEPARTMENT.DEPT_NAME,
USERSECRET.SECRET
from K_USER
left join DEPARTMENT on K_USER.DEPART_ID = DEPARTMENT.ID
left join USERSECRET on K_USER.ID = USERSECRET.ID
left join KT_O_FOUR_COLUM on K_USER.UESR_RANK_ID = KT_O_FOUR_COLUM.ID
where K_USER.LOGOUT != '1'
and K_USER.PROJECT_SOURCE = #{projectSource,jdbcType=VARCHAR}
<if test="flag != null">
and K_USER.USER_ID != 'safesecret'
and K_USER.USER_ID != 'safeaudit'
and K_USER.USER_ID != 'admin'
</if>
<if test="id != null">
and K_USER.ID = #{id,jdbcType=VARCHAR}
</if>
<if test="userId != null">
and K_USER.USER_ID = #{userId,jdbcType=VARCHAR}
</if>
<if test="isSys != 'sysadmin'">
and K_USER.IS_SYS = '0'
</if>
<if test="userNameForSerch != null">
and (K_USER.USER_NAME like '%'||#{userNameForSerch,jdbcType=VARCHAR}||'%' )
</if>
<if test="departId != null and departId != ''">
and K_USER.DEPART_ID=#{departId,jdbcType=VARCHAR}
</if>
<if test="post != null and post != ''">
and K_USER.POST=#{post,jdbcType=VARCHAR}
</if>
<if test="userStatus == null">
and K_USER.USER_STATUS = '0'
</if>
<if test="userNumber != null and userNumber != ''">
and K_USER.USER_NUMBER = #{userNumber,jdbcType=VARCHAR}
</if>
<if test="systemLevel != null and systemLevel != ''">
and KT_O_FOUR_COLUM.SEQ &gt;= #{systemLevel,jdbcType=INTEGER}
</if>
order by SORT asc
</select>
<select id="selectByUserInfo" resultMap="BaseResultMap" parameterType="com.keyware.htey.entity.user.User">
select
K_USER.ID,
K_USER.USER_ID,
K_USER.USER_NAME,
K_USER.PASSWORD,
K_USER.DEPART_ID,
K_USER.USER_CREATION_TIME,
K_USER.USER_PWD_MODIF_TIME,
K_USER.USER_STATUS,
K_USER.USER_LOCK,
K_USER.USER_PWD_ERROR,
K_USER.USER_PWD_ERROR_DATE,
K_USER.EXIT_TIME,K_USER.PASSWORD_OLD,
K_USER.POST, K_USER.EMAIL, K_USER.OFFICE_TELEPHONE,
K_USER.USER_NUMBER, K_USER.ID_CARD, K_USER.MOBILE_PHONE,
K_USER.SEX, K_USER.HOME_PHONE,K_USER.LOGOUT,K_USER.INIT_PWD_TIME,K_USER.SORT ,K_USER.LOGOUT_TIME,
K_USER.UESR_RANK_ID,
DEPARTMENT.DEPT_NAME
from K_USER
left join DEPARTMENT on K_USER.DEPART_ID = DEPARTMENT.ID
where K_USER.LOGOUT != '1'
and K_USER.PROJECT_SOURCE = #{projectSource,jdbcType=VARCHAR}
<if test="flag != null">
and K_USER.USER_ID != 'safesecret'
and K_USER.USER_ID != 'safeaudit'
and K_USER.USER_ID != 'admin'
</if>
<if test="id != null">
and K_USER.ID = #{id,jdbcType=VARCHAR}
</if>
<if test="userId != null">
and K_USER.USER_ID = #{userId,jdbcType=VARCHAR}
</if>
<if test="isSys != 'sysadmin'">
and K_USER.IS_SYS = '0'
</if>
<if test="userNameForSerch != null and userNameForSerch!=''">
<!-- and ("user_name" like '%'||#{userNameForSerch,jdbcType=VARCHAR}||'%' or user_id like '%'||#{userNameForSerch,jdbcType=VARCHAR}||'%')
项目管理,快速搜索,只出还有搜索条件的名称
-->
and (K_USER.USER_NAME like '%'||#{userNameForSerch,jdbcType=VARCHAR}||'%')
</if>
<if test="departId != null and departId != ''">
and K_USER.DEPART_ID=#{departId,jdbcType=VARCHAR}
</if>
<if test="post != null and post != ''">
and K_USER.POST=#{post,jdbcType=VARCHAR}
</if>
<if test="userStatus == null">
and K_USER.USER_STATUS = '0'
</if>
<if test="userNumber != null and userNumber != ''">
and K_USER.USER_NUMBER = #{userNumber,jdbcType=VARCHAR}
</if>
order by SORT asc
</select>
<select id="selectDepartUser" resultMap="BaseResultMap">
select ID, USER_ID, USER_NAME, DEPART_ID
from K_USER
where USER_STATUS = '0'
and PROJECT_SOURCE = #{projectSource,jdbcType=VARCHAR}
<if test="departId != null and departId !=''">
and DEPART_ID=#{departId,jdbcType=VARCHAR}
</if>
</select>
</mapper> </mapper>

@ -7,6 +7,8 @@
</resultMap> </resultMap>
<delete id="deleteByUserId" parameterType="java.lang.String"> <delete id="deleteByUserId" parameterType="java.lang.String">
delete from USER_ROLE where USER_ID = #{userId,jdbcType=VARCHAR} delete
from USER_ROLE
where USER_ID = #{userId,jdbcType=VARCHAR}
</delete> </delete>
</mapper> </mapper>

Loading…
Cancel
Save