daijiajun 用户管理及部门管理中的代码进行优化

main
admin 2 days ago
parent 3c2330aaef
commit dad3ce203e
  1. 275
      src/main/java/com/keyware/htey/controller/Department/DepartmentController.java
  2. 36
      src/main/java/com/keyware/htey/controller/humanResourceManagement/HumanResourceManagementController.java
  3. 189
      src/main/java/com/keyware/htey/controller/project/ProjectKtController.java
  4. 902
      src/main/java/com/keyware/htey/controller/user/UserController.java
  5. 3
      src/main/java/com/keyware/htey/service/impl/AuditLogServiceImpl.java
  6. 297
      src/main/java/com/keyware/htey/service/impl/DepartmentServiceImpl.java
  7. 4
      src/main/java/com/keyware/htey/service/impl/NumberBuilderServiceImpl.java
  8. 4
      src/main/java/com/keyware/htey/service/impl/OFourColumServiceImpl.java
  9. 1222
      src/main/java/com/keyware/htey/service/impl/UserServiceImpl.java
  10. 4
      src/main/java/com/keyware/htey/service/impl/UsersecretServiceImpl.java
  11. 14
      src/main/java/com/keyware/htey/service/itf/DepartmentService.java
  12. 39
      src/main/java/com/keyware/htey/service/itf/UserService.java

@ -2,18 +2,9 @@ package com.keyware.htey.controller.Department;
import java.util.List; import java.util.List;
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.entity.user.User;
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.service.itf.UserService;
import com.keyware.htey.utli.AjaxMessage; import com.keyware.htey.utli.AjaxMessage;
import com.keyware.htey.utli.Constant;
import com.keyware.htey.utli.DateUtils;
import com.keyware.htey.utli.IdComposeListUtil;
import com.keyware.htey.utli.IdGenerator;
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;
@ -21,7 +12,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -44,10 +34,6 @@ 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;
@Autowired
private UserService userService;
@GetMapping("/selectById") @GetMapping("/selectById")
@ResponseBody @ResponseBody
@ -68,11 +54,6 @@ public class DepartmentController {
@Operation(summary = "新增部门表", description = "返回新增部门信息") @Operation(summary = "新增部门表", description = "返回新增部门信息")
@ApiResponse(responseCode = "200", description = "成功新增部门信息") @ApiResponse(responseCode = "200", description = "成功新增部门信息")
public boolean addDepartment(@RequestBody Department department) { public boolean addDepartment(@RequestBody Department department) {
Department oneDepartment = departmentService.getOne(
new QueryWrapper<Department>().eq("id", department.getId()));
if (oneDepartment != null) {
return false;
}
return departmentService.save(department); return departmentService.save(department);
} }
@ -81,8 +62,7 @@ public class DepartmentController {
* @date 2025/1/7 * @date 2025/1/7
* @description 修改部门 * @description 修改部门
*/ */
@RequestMapping(value = {"/updateDepartment"}, @RequestMapping(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 = "返回修改部门信息")
@ -123,148 +103,34 @@ public class DepartmentController {
// isSys = "sysadmin"; // isSys = "sysadmin";
//} //}
List<?> department = this.departmentService.getParentId(id, isSys, projectResource); List<Department> department = this.departmentService.getParentId(id, isSys, projectResource);
return JsonUtils.arrayListToJsonString(department); return JsonUtils.arrayListToJsonString(department);
} }
@RequestMapping( @RequestMapping(value = {"/select"}, method = {RequestMethod.POST}, produces = {"application/json; charset=utf-8"})
value = {"/select"},
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 = "成功返回查询部门列表")
public List<Department> select(@RequestBody Department department, @RequestParam(defaultValue = "0") int pageNum, public List<Department> select(@RequestBody Department department, @RequestParam(defaultValue = "0") int pageNum,
@RequestParam(defaultValue = "10") int pageSize) { @RequestParam(defaultValue = "10") int pageSize) {
AuditLog auditLog = new AuditLog(); return departmentService.selectList(department, pageNum, pageSize);
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>();
//for(Department vo : departmentList){
// Integer selectUserCountByDeptId = userService.selectUserCountByDeptId(vo.getId());
// if(selectUserCountByDeptId != null)
// vo.setUserCount(selectUserCountByDeptId);
// Department selectByPrimaryKey = departmentService.selectByPrimaryKey(vo.getParentId());
// if(selectByPrimaryKey != null)
// vo.setParentName(selectByPrimaryKey.getDeptName());
// parentNameList.add(vo);
//
//}
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;
} }
@RequestMapping( @RequestMapping(value = {"/checkDepartMentName"}, method = {RequestMethod.POST},
value = {"/checkDepartMentName"}, 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 = "部门校验成功")
public AjaxMessage checkDepartMentName(String name) { public AjaxMessage checkDepartMentName(String name) {
AjaxMessage ajaxMessage = new AjaxMessage(); return departmentService.checkDepartMentName(name);
if (StringUtils.hasText(name)) {
List<Department> selectByDeparmentName = this.departmentService.selectByDeparmentName(name);
if (selectByDeparmentName.size() > 0) {
ajaxMessage.setCode("1");
ajaxMessage.setMessage("部门名称已存在");
}
}
return ajaxMessage;
} }
@RequestMapping( @RequestMapping(value = {"/add"}, method = {RequestMethod.POST}, produces = {"application/json; charset=utf-8"})
value = {"/add"},
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 = "部门添加成功")
public AjaxMessage add(@ModelAttribute Department department) { public AjaxMessage add(@ModelAttribute Department department) {
AjaxMessage ajaxMessage = new AjaxMessage(); return departmentService.add(department);
AuditLog auditLog = new AuditLog();
try {
Department departmentSelect = new Department();
departmentSelect.setDeptName(department.getDeptName());
List<Department> selectByDeparmentInfo = this.departmentService.selectByDeparmentInfoSelect(
departmentSelect);
if (selectByDeparmentInfo.size() > 0) {
ajaxMessage.setCode("0");
ajaxMessage.setMessage("部门名称已存在");
return ajaxMessage;
}
Department departmentSelect1 = new Department();
departmentSelect1.setDeptNumber(department.getDeptNumber());
List<Department> selectByDeparmentInfo1 = this.departmentService.selectByDeparmentInfoSelect(
departmentSelect1);
if (selectByDeparmentInfo1.size() > 0) {
ajaxMessage.setCode("0");
ajaxMessage.setMessage("部门编号已存在");
return ajaxMessage;
}
String deptId = IdGenerator.uuid32();
department.setId(deptId);
department.setIsSys("0");
department.setDeptCreateTime(DateUtils.getDateTime());
department.setTotalWorkers(0);
this.departmentService.insertSelective(department);
User user = new User();
user.setId(department.getCharge());
user.setDepartId(deptId);
this.userService.updateByPrimaryKeySelective(user);
ajaxMessage.setCode("1");
ajaxMessage.setMessage("保存成功");
StringBuilder info = new StringBuilder();
info.append("部门简称:" + department.getDepartAbbrevia() + ";");
info.append("上级部门:" + department.getParentName() + ";");
info.append("部门负责:" + department.getChargeName() + ";");
info.append("部门接口人:" + department.getInterfacePersonName() + ";");
info.append("上级主管领导:" + department.getSuperLeaderName() + ";");
info.append("部门管理人:" + department.getManagerName() + ";");
info.append("部门描述:" + department.getComments() + ";");
String logName = "添加部门";
String logNameType = "部门管理";
/*String comments = this.getUser_idFormSession("userName") + "添加" + department.getDeptName() + "部门,详细信息:"
+ info;*/
//todo 获取登录人信息
String comments = "添加" + department.getDeptName() + "部门,详细信息:" + info;
auditLog.setLogName(logName);
auditLog.setLogNameType(logNameType);
auditLog.setComments(comments);
auditLogService.addAuditLog(auditLog);
} catch (Exception var10) {
log.error("部门添加失败", var10);
var10.printStackTrace();
ajaxMessage.setCode("0");
ajaxMessage.setMessage(Constant.ERROE_MESSAGE);
}
return ajaxMessage;
} }
@RequestMapping(value = "/edit", method = RequestMethod.POST, produces = "application/json; charset=utf-8") @RequestMapping(value = "/edit", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
@ -272,105 +138,7 @@ public class DepartmentController {
@Operation(summary = "部门修改", description = "返回部门修改是否成功") @Operation(summary = "部门修改", description = "返回部门修改是否成功")
@ApiResponse(responseCode = "200", description = "部门添加修改") @ApiResponse(responseCode = "200", description = "部门添加修改")
public AjaxMessage edit(@ModelAttribute Department department) { public AjaxMessage edit(@ModelAttribute Department department) {
AjaxMessage ajaxMessage = new AjaxMessage(); return departmentService.edit(department);
AuditLog auditLog = new AuditLog();
try {
Department oldDepartment = departmentService.selectByPrimaryKey(department.getId());
departmentService.updateByPrimaryKeySelective(department);
ajaxMessage.setCode("1");
ajaxMessage.setMessage("保存成功");
StringBuilder info = new StringBuilder();
if (oldDepartment.getDepartAbbrevia() == null) {oldDepartment.setDepartAbbrevia("");}
if (!oldDepartment.getDepartAbbrevia().equals(department.getDepartAbbrevia())) {
info.append(
"部门简称从" + oldDepartment.getDepartAbbrevia() + "修改为" + department.getDepartAbbrevia() + ";");
}
if (oldDepartment.getParentId() == null) {oldDepartment.setParentId("");}
if (!oldDepartment.getParentId().equals(department.getParentId())) {
String oldName = "空";
String newName = "空";
if (StringUtils.hasText(oldDepartment.getParentId())) {
Department department1 = departmentService.selectByPrimaryKey(oldDepartment.getParentId());
oldName = department1.getDeptName();
}
if (StringUtils.hasText(department.getParentId())) {
Department department1 = departmentService.selectByPrimaryKey(department.getParentId());
newName = department1.getDeptName();
}
info.append("上级部门从" + oldName + "修改为" + newName + ";");
}
if (oldDepartment.getCharge() == null) {oldDepartment.setCharge("");}
if (!oldDepartment.getCharge().equals(department.getCharge())) {
String oldName = "空";
if (StringUtils.hasText(oldDepartment.getCharge())) {
User user = userService.selectByPrimaryKey(oldDepartment.getCharge());
oldName = user.getUserName();
}
info.append("部门负责人从" + oldName + "修改为" + department.getChargeName() + ";");
}
if (oldDepartment.getInterfacePerson() == null) {oldDepartment.setInterfacePerson("");}
if (!oldDepartment.getInterfacePerson().equals(department.getInterfacePerson())) {
String oldName = "空";
if (StringUtils.hasText(oldDepartment.getInterfacePerson())) {
String interfacePerson = oldDepartment.getInterfacePerson();
String[] split = interfacePerson.split(",");
for (String s : split) {
User user = userService.selectByPrimaryKey(s);
oldName += user.getUserName() + ",";
}
oldName = oldName.substring(0, oldName.length() - 1);
}
info.append("部门接口人从" + oldName + "修改为" + department.getInterfacePersonName() + ";");
}
if (oldDepartment.getSuperLeader() == null) {oldDepartment.setSuperLeader("");}
if (!oldDepartment.getSuperLeader().equals(department.getSuperLeader())) {
String oldName = "空";
if (StringUtils.hasText(oldDepartment.getSuperLeader())) {
String interfacePerson = oldDepartment.getSuperLeader();
String[] split = interfacePerson.split(",");
for (String s : split) {
User user = userService.selectByPrimaryKey(s);
oldName += user.getUserName() + ",";
}
oldName = oldName.substring(0, oldName.length() - 1);
}
info.append("上级主管领导从" + oldName + "修改为" + department.getSuperLeaderName() + ";");
}
if (oldDepartment.getManager() == null) {oldDepartment.setManager("");}
if (!oldDepartment.getManager().equals(department.getManager())) {
StringBuilder oldName = new StringBuilder("空");
if (StringUtils.hasText(oldDepartment.getManager())) {
String interfacePerson = oldDepartment.getManager();
String[] split = interfacePerson.split(",");
for (String s : split) {
User user = userService.selectByPrimaryKey(s);
oldName.append(user.getUserName()).append(",");
}
oldName = new StringBuilder(oldName.substring(0, oldName.length() - 1));
}
info.append("部门管理人从" + oldName + "修改为" + department.getManagerName() + ";");
}
if (oldDepartment.getComments() == null) {oldDepartment.setComments("");}
if (!oldDepartment.getComments().equals(department.getComments())) {
info.append("部门描述从" + oldDepartment.getComments() + "修改为" + department.getComments() + ";");
}
String logName = "修改部门信息";
String logNameType = "部门管理";
/*String comments = getUser_idFormSession("userName")+"修改了"+department.getDeptName()+"部门详细信息:" + info;*/
//todo 获取登录人信息
String comments = "修改了" + department.getDeptName() + "部门详细信息:" + info;
auditLog.setLogName(logName);
auditLog.setLogNameType(logNameType);
auditLog.setComments(comments);
auditLogService.addAuditLog(auditLog);
} catch (Exception e) {
log.error("修改失败", e);
e.printStackTrace();
ajaxMessage.setCode("0");
ajaxMessage.setMessage("系统错误,请联系管理员");
}
return ajaxMessage;
} }
@RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json; charset=utf-8") @RequestMapping(value = "/delete", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
@ -378,27 +146,6 @@ public class DepartmentController {
@Operation(summary = "部门删除", description = "返回部门删除是否成功") @Operation(summary = "部门删除", description = "返回部门删除是否成功")
@ApiResponse(responseCode = "200", description = "部门删除修改") @ApiResponse(responseCode = "200", description = "部门删除修改")
public String delete(@RequestBody List<Department> departments) { public String delete(@RequestBody List<Department> departments) {
List<String> listId = IdComposeListUtil.listDepartmentId(departments); return departmentService.delete(departments);
StringBuilder deparNames = new StringBuilder();
for (String id : listId) {
Department selectByPrimaryKey = departmentService.selectByPrimaryKey(id);
deparNames.append(selectByPrimaryKey.getDeptName()).append(",");
}
departmentService.deleteByPrimaryKey(listId);
if (deparNames.length() > 0) {
AuditLog auditLog = new AuditLog();
String logName = "删除部门";
String logNameType = "部门管理";
/*String comments = getUser_idFormSession("userName")+"删除了"+deparNames.substring(0, deparNames.length()
-1)+"部门";*/
//todo 获取登录人信息
String comments = "删除了" + deparNames.substring(0, deparNames.length() - 1) + "部门";
auditLog.setLogName(logName);
auditLog.setLogNameType(logNameType);
auditLog.setComments(comments);
auditLogService.addAuditLog(auditLog);
}
return "删除成功";
} }
} }

@ -1,16 +1,11 @@
package com.keyware.htey.controller.humanResourceManagement; package com.keyware.htey.controller.humanResourceManagement;
import com.keyware.htey.entity.user.AuditLog; import com.keyware.htey.service.itf.UserService;
import com.keyware.htey.service.itf.AuditLogService;
import com.keyware.htey.utli.AjaxMessage; import com.keyware.htey.utli.AjaxMessage;
import com.keyware.htey.utli.ExcelUtils;
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;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -25,7 +20,7 @@ import org.springframework.web.multipart.MultipartFile;
@Slf4j @Slf4j
public class HumanResourceManagementController { public class HumanResourceManagementController {
@Autowired @Autowired
private AuditLogService auditLogService; private UserService userService;
@RequestMapping(value = {"/analysisExcl"}, method = {RequestMethod.POST}, @RequestMapping(value = {"/analysisExcl"}, method = {RequestMethod.POST},
produces = {"application/json; charset=utf-8"}) produces = {"application/json; charset=utf-8"})
@ -33,31 +28,6 @@ public class HumanResourceManagementController {
@Operation(summary = "用户列表导入", description = "返回导入信息") @Operation(summary = "用户列表导入", description = "返回导入信息")
@ApiResponse(responseCode = "200", description = "成功导入信息") @ApiResponse(responseCode = "200", description = "成功导入信息")
public AjaxMessage analysisExcl(@RequestParam MultipartFile multipartfile) { public AjaxMessage analysisExcl(@RequestParam MultipartFile multipartfile) {
AjaxMessage ajaxMessage = new AjaxMessage(); return userService.analysisExcl(multipartfile);
try {
Workbook workbook = WorkbookFactory.create(multipartfile.getInputStream());
Sheet sheet = workbook.getSheetAt(0);
ExcelUtils.checkFirstRowName(ajaxMessage, sheet);
if ("0".equals(ajaxMessage.getCode())) {
return ajaxMessage;
}
AuditLog auditLog = new AuditLog();
String message = new ExcelUtils().insertUser(auditLog, sheet);
ajaxMessage.setCode("1");
ajaxMessage.setMessage(message);
// String comments = this.getUser_idFormSession("userName") + message;
String comments = message;
String logName = "批量导入";
String logNameType = "用户列表";
auditLog.setLogName(logName);
auditLog.setLogNameType(logNameType);
auditLog.setComments(comments);
auditLogService.addAuditLog(auditLog);
} catch (Exception var8) {
log.error("导入失败", var8);
var8.printStackTrace();
ajaxMessage.setCode("0");
}
return ajaxMessage;
} }
} }

@ -1,29 +1,13 @@
package com.keyware.htey.controller.project; 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.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.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.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
@ -42,14 +26,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Tag(name = "项目管理模块 API", description = "部门表数据接口") @Tag(name = "项目管理模块 API", description = "部门表数据接口")
@Slf4j @Slf4j
public class ProjectKtController { public class ProjectKtController {
@Autowired
private OFourColumService fourColumService;
@Resource
private DepartmentService departmentService;
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired
private OFourColumService oFourColumService;
@RequestMapping( @RequestMapping(
value = {"/selectDepartUser"}, value = {"/selectDepartUser"},
@ -61,171 +39,6 @@ public class ProjectKtController {
@ApiResponse(responseCode = "200", description = "部门负责人返回成功") @ApiResponse(responseCode = "200", description = "部门负责人返回成功")
public String selectDepartUser(@RequestBody User user, @RequestParam(required = false) String setDocumentDepartId, public String selectDepartUser(@RequestBody User user, @RequestParam(required = false) String setDocumentDepartId,
@RequestParam(required = false) String headId) { @RequestParam(required = false) String headId) {
List<User> list = new ArrayList(); return userService.selectDepartUser(user, setDocumentDepartId, headId);
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 = userService.selectByUser(user);
list.addAll(users);
} else {
selectByparentId = this.departmentService.selectByparentId(departId);
user.setDepartId(departId);
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();
} }
} }

@ -16,8 +16,7 @@ import org.springframework.stereotype.Service;
@Slf4j @Slf4j
public class AuditLogServiceImpl extends ServiceImpl<AuditLogMapper, AuditLog> implements AuditLogService { public class AuditLogServiceImpl extends ServiceImpl<AuditLogMapper, AuditLog> implements AuditLogService {
@Autowired @Autowired
private AuditLogMapper auditLogMapper; private AuditLogService auditLogService;
public boolean insertLog(AuditLog auditLog) { public boolean insertLog(AuditLog auditLog) {
//todo 登录人信息 //todo 登录人信息
//String userName = (String)session.getAttribute("userName"); //String userName = (String)session.getAttribute("userName");

@ -6,18 +6,31 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.entity.user.User;
import com.keyware.htey.mybatis.itf.DepartmentMapper; import com.keyware.htey.mybatis.itf.DepartmentMapper;
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.service.itf.UserService;
import com.keyware.htey.utli.AjaxMessage;
import com.keyware.htey.utli.Constant; import com.keyware.htey.utli.Constant;
import com.keyware.htey.utli.DateUtils;
import com.keyware.htey.utli.IdComposeListUtil;
import com.keyware.htey.utli.IdGenerator;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
@Service @Service
@Slf4j @Slf4j
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService { public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService {
@Autowired @Autowired
private DepartmentMapper departmentMapper; private DepartmentMapper departmentMapper;
@Autowired
private AuditLogService auditLogService;
@Autowired
private UserService userService;
@Override @Override
public List<Department> selectByDeparmentName(String deptName) { public List<Department> selectByDeparmentName(String deptName) {
@ -77,6 +90,7 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
record.setProjectSource(Constant.projectName); record.setProjectSource(Constant.projectName);
return this.departmentMapper.insertSelective(record); return this.departmentMapper.insertSelective(record);
} }
@Override @Override
public int updateByPrimaryKeySelective(Department record) { public int updateByPrimaryKeySelective(Department record) {
return departmentMapper.updateByPrimaryKeySelective(record); return departmentMapper.updateByPrimaryKeySelective(record);
@ -86,4 +100,287 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
public int deleteByPrimaryKey(List listId) { public int deleteByPrimaryKey(List listId) {
return departmentMapper.deleteByPrimaryKey(listId); return departmentMapper.deleteByPrimaryKey(listId);
} }
/**
* @param department
* @param pageNum
* @param pageSize
* @return java.util.List<com.keyware.htey.entity.department.Department>
* @description 查询部门列表信息
* @Author daijiajun
* @date 2025/1/17
**/
@Override
public List<Department> selectList(Department department, int pageNum, 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.selectByDeparmentInfo(department);
//List<Department> parentNameList = new ArrayList<Department>();
//for(Department vo : departmentList){
// Integer selectUserCountByDeptId = userService.selectUserCountByDeptId(vo.getId());
// if(selectUserCountByDeptId != null)
// vo.setUserCount(selectUserCountByDeptId);
// Department selectByPrimaryKey = selectByPrimaryKey(vo.getParentId());
// if(selectByPrimaryKey != null)
// vo.setParentName(selectByPrimaryKey.getDeptName());
// parentNameList.add(vo);
//
//}
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;
}
/**
* @param name
* @return com.keyware.htey.utli.AjaxMessage
* @description 部门校验
* @Author daijiajun
* @date 2025/1/17
**/
@Override
public AjaxMessage checkDepartMentName(String name) {
AjaxMessage ajaxMessage = new AjaxMessage();
if (StringUtils.hasText(name)) {
List<Department> selectByDeparmentName = this.selectByDeparmentName(name);
if (selectByDeparmentName.size() > 0) {
ajaxMessage.setCode("1");
ajaxMessage.setMessage("部门名称已存在");
}
}
return ajaxMessage;
}
/**
* @param department
* @return com.keyware.htey.utli.AjaxMessage
* @description 部门添加
* @Author daijiajun
* @date 2025/1/17
**/
@Override
public AjaxMessage add(Department department) {
AjaxMessage ajaxMessage = new AjaxMessage();
AuditLog auditLog = new AuditLog();
try {
Department departmentSelect = new Department();
departmentSelect.setDeptName(department.getDeptName());
List<Department> selectByDeparmentInfo = this.selectByDeparmentInfoSelect(
departmentSelect);
if (selectByDeparmentInfo.size() > 0) {
ajaxMessage.setCode("0");
ajaxMessage.setMessage("部门名称已存在");
return ajaxMessage;
}
Department departmentSelect1 = new Department();
departmentSelect1.setDeptNumber(department.getDeptNumber());
List<Department> selectByDeparmentInfo1 = this.selectByDeparmentInfoSelect(
departmentSelect1);
if (selectByDeparmentInfo1.size() > 0) {
ajaxMessage.setCode("0");
ajaxMessage.setMessage("部门编号已存在");
return ajaxMessage;
}
String deptId = IdGenerator.uuid32();
department.setId(deptId);
department.setIsSys("0");
department.setDeptCreateTime(DateUtils.getDateTime());
department.setTotalWorkers(0);
this.insertSelective(department);
User user = new User();
user.setId(department.getCharge());
user.setDepartId(deptId);
this.userService.updateByPrimaryKeySelective(user);
ajaxMessage.setCode("1");
ajaxMessage.setMessage("保存成功");
StringBuilder info = new StringBuilder();
info.append("部门简称:" + department.getDepartAbbrevia() + ";");
info.append("上级部门:" + department.getParentName() + ";");
info.append("部门负责:" + department.getChargeName() + ";");
info.append("部门接口人:" + department.getInterfacePersonName() + ";");
info.append("上级主管领导:" + department.getSuperLeaderName() + ";");
info.append("部门管理人:" + department.getManagerName() + ";");
info.append("部门描述:" + department.getComments() + ";");
String logName = "添加部门";
String logNameType = "部门管理";
/*String comments = this.getUser_idFormSession("userName") + "添加" + department.getDeptName() + "部门,详细信息:"
+ info;*/
//todo 获取登录人信息
String comments = "添加" + department.getDeptName() + "部门,详细信息:" + info;
auditLog.setLogName(logName);
auditLog.setLogNameType(logNameType);
auditLog.setComments(comments);
auditLogService.addAuditLog(auditLog);
} catch (Exception var10) {
log.error("部门添加失败", var10);
var10.printStackTrace();
ajaxMessage.setCode("0");
ajaxMessage.setMessage(Constant.ERROE_MESSAGE);
}
return ajaxMessage;
}
/**
* @param department
* @return com.keyware.htey.utli.AjaxMessage
* @description 部门修改
* @Author daijiajun
* @date 2025/1/17
**/
@Override
public AjaxMessage edit(Department department) {
AjaxMessage ajaxMessage = new AjaxMessage();
AuditLog auditLog = new AuditLog();
try {
Department oldDepartment = this.selectByPrimaryKey(department.getId());
this.updateByPrimaryKeySelective(department);
ajaxMessage.setCode("1");
ajaxMessage.setMessage("保存成功");
StringBuilder info = new StringBuilder();
if (oldDepartment.getDepartAbbrevia() == null) {oldDepartment.setDepartAbbrevia("");}
if (!oldDepartment.getDepartAbbrevia().equals(department.getDepartAbbrevia())) {
info.append(
"部门简称从" + oldDepartment.getDepartAbbrevia() + "修改为" + department.getDepartAbbrevia() + ";");
}
if (oldDepartment.getParentId() == null) {oldDepartment.setParentId("");}
if (!oldDepartment.getParentId().equals(department.getParentId())) {
String oldName = "空";
String newName = "空";
if (StringUtils.hasText(oldDepartment.getParentId())) {
Department department1 = this.selectByPrimaryKey(oldDepartment.getParentId());
oldName = department1.getDeptName();
}
if (StringUtils.hasText(department.getParentId())) {
Department department1 = this.selectByPrimaryKey(department.getParentId());
newName = department1.getDeptName();
}
info.append("上级部门从" + oldName + "修改为" + newName + ";");
}
if (oldDepartment.getCharge() == null) {oldDepartment.setCharge("");}
if (!oldDepartment.getCharge().equals(department.getCharge())) {
String oldName = "空";
if (StringUtils.hasText(oldDepartment.getCharge())) {
User user = userService.selectByPrimaryKey(oldDepartment.getCharge());
oldName = user.getUserName();
}
info.append("部门负责人从" + oldName + "修改为" + department.getChargeName() + ";");
}
if (oldDepartment.getInterfacePerson() == null) {oldDepartment.setInterfacePerson("");}
if (!oldDepartment.getInterfacePerson().equals(department.getInterfacePerson())) {
String oldName = "空";
if (StringUtils.hasText(oldDepartment.getInterfacePerson())) {
String interfacePerson = oldDepartment.getInterfacePerson();
String[] split = interfacePerson.split(",");
for (String s : split) {
User user = userService.selectByPrimaryKey(s);
oldName += user.getUserName() + ",";
}
oldName = oldName.substring(0, oldName.length() - 1);
}
info.append("部门接口人从" + oldName + "修改为" + department.getInterfacePersonName() + ";");
}
if (oldDepartment.getSuperLeader() == null) {oldDepartment.setSuperLeader("");}
if (!oldDepartment.getSuperLeader().equals(department.getSuperLeader())) {
String oldName = "空";
if (StringUtils.hasText(oldDepartment.getSuperLeader())) {
String interfacePerson = oldDepartment.getSuperLeader();
String[] split = interfacePerson.split(",");
for (String s : split) {
User user = userService.selectByPrimaryKey(s);
oldName += user.getUserName() + ",";
}
oldName = oldName.substring(0, oldName.length() - 1);
}
info.append("上级主管领导从" + oldName + "修改为" + department.getSuperLeaderName() + ";");
}
if (oldDepartment.getManager() == null) {oldDepartment.setManager("");}
if (!oldDepartment.getManager().equals(department.getManager())) {
StringBuilder oldName = new StringBuilder("空");
if (StringUtils.hasText(oldDepartment.getManager())) {
String interfacePerson = oldDepartment.getManager();
String[] split = interfacePerson.split(",");
for (String s : split) {
User user = userService.selectByPrimaryKey(s);
oldName.append(user.getUserName()).append(",");
}
oldName = new StringBuilder(oldName.substring(0, oldName.length() - 1));
}
info.append("部门管理人从" + oldName + "修改为" + department.getManagerName() + ";");
}
if (oldDepartment.getComments() == null) {oldDepartment.setComments("");}
if (!oldDepartment.getComments().equals(department.getComments())) {
info.append("部门描述从" + oldDepartment.getComments() + "修改为" + department.getComments() + ";");
}
String logName = "修改部门信息";
String logNameType = "部门管理";
/*String comments = getUser_idFormSession("userName")+"修改了"+department.getDeptName()+"部门详细信息:" + info;*/
//todo 获取登录人信息
String comments = "修改了" + department.getDeptName() + "部门详细信息:" + info;
auditLog.setLogName(logName);
auditLog.setLogNameType(logNameType);
auditLog.setComments(comments);
auditLogService.addAuditLog(auditLog);
} catch (Exception e) {
log.error("修改失败", e);
e.printStackTrace();
ajaxMessage.setCode("0");
ajaxMessage.setMessage(Constant.ERROE_MESSAGE);
}
return ajaxMessage;
}
/**
* @param departments
* @return java.lang.String
* @description 部门删除
* @Author daijiajun
* @date 2025/1/17
**/
@Override
public String delete(List<Department> departments) {
List<String> listId = IdComposeListUtil.listDepartmentId(departments);
StringBuilder deparNames = new StringBuilder();
for (String id : listId) {
Department selectByPrimaryKey = this.selectByPrimaryKey(id);
deparNames.append(selectByPrimaryKey.getDeptName()).append(",");
}
this.deleteByPrimaryKey(listId);
if (deparNames.length() > 0) {
AuditLog auditLog = new AuditLog();
String logName = "删除部门";
String logNameType = "部门管理";
/*String comments = getUser_idFormSession("userName")+"删除了"+deparNames.substring(0, deparNames.length()
-1)+"部门";*/
//todo 获取登录人信息
String comments = "删除了" + deparNames.substring(0, deparNames.length() - 1) + "部门";
auditLog.setLogName(logName);
auditLog.setLogNameType(logNameType);
auditLog.setComments(comments);
auditLogService.addAuditLog(auditLog);
}
return "删除成功";
}
} }

@ -2,6 +2,7 @@ package com.keyware.htey.service.impl;
import com.keyware.htey.entity.number.NumberBuilder; import com.keyware.htey.entity.number.NumberBuilder;
import com.keyware.htey.mybatis.itf.number.NumberBuilderMapper; import com.keyware.htey.mybatis.itf.number.NumberBuilderMapper;
import com.keyware.htey.service.itf.AuditLogService;
import com.keyware.htey.service.itf.number.NumberBuilderService; import com.keyware.htey.service.itf.number.NumberBuilderService;
import com.keyware.htey.utli.Constant; import com.keyware.htey.utli.Constant;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -17,7 +18,8 @@ import org.springframework.stereotype.Service;
public class NumberBuilderServiceImpl implements NumberBuilderService { public class NumberBuilderServiceImpl implements NumberBuilderService {
@Autowired @Autowired
private NumberBuilderMapper numberBuilderMapper; private NumberBuilderMapper numberBuilderMapper;
@Autowired
private AuditLogService auditLogService;
@Override @Override
public String getUserNumber() { public String getUserNumber() {
Integer userNumber = this.getNumber("user_code"); Integer userNumber = this.getNumber("user_code");

@ -3,6 +3,7 @@ package com.keyware.htey.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.keyware.htey.entity.organizeassets.OFourColum; import com.keyware.htey.entity.organizeassets.OFourColum;
import com.keyware.htey.mybatis.itf.OFourColumMapper; import com.keyware.htey.mybatis.itf.OFourColumMapper;
import com.keyware.htey.service.itf.AuditLogService;
import com.keyware.htey.service.itf.OFourColumService; import com.keyware.htey.service.itf.OFourColumService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -13,7 +14,8 @@ import org.springframework.stereotype.Service;
public class OFourColumServiceImpl extends ServiceImpl<OFourColumMapper, OFourColum> implements OFourColumService { public class OFourColumServiceImpl extends ServiceImpl<OFourColumMapper, OFourColum> implements OFourColumService {
@Autowired @Autowired
private OFourColumMapper oFourColumMapper; private OFourColumMapper oFourColumMapper;
@Autowired
private AuditLogService auditLogService;
@Override @Override
public OFourColum selectByPrimaryKey(String id) { public OFourColum selectByPrimaryKey(String id) {
// OFourColum oFourColum = jedisClientSingle.getObject(FOUR_COLUMN + id); // OFourColum oFourColum = jedisClientSingle.getObject(FOUR_COLUMN + id);

@ -5,6 +5,7 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.keyware.htey.entity.usersecret.UserSecret; import com.keyware.htey.entity.usersecret.UserSecret;
import com.keyware.htey.mybatis.itf.UsersecretMapper; import com.keyware.htey.mybatis.itf.UsersecretMapper;
import com.keyware.htey.service.itf.AuditLogService;
import com.keyware.htey.service.itf.UsersecretService; import com.keyware.htey.service.itf.UsersecretService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -15,7 +16,8 @@ import org.springframework.stereotype.Service;
public class UsersecretServiceImpl extends ServiceImpl<UsersecretMapper, UserSecret> implements UsersecretService { public class UsersecretServiceImpl extends ServiceImpl<UsersecretMapper, UserSecret> implements UsersecretService {
@Autowired @Autowired
private UsersecretMapper usersecretMapper; private UsersecretMapper usersecretMapper;
@Autowired
private AuditLogService auditLogService;
@Override @Override
public int insertSelective(UserSecret userSecret) { public int insertSelective(UserSecret userSecret) {
return this.usersecretMapper.insertSelective(userSecret); return this.usersecretMapper.insertSelective(userSecret);

@ -5,6 +5,10 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.keyware.htey.entity.department.Department; import com.keyware.htey.entity.department.Department;
import com.keyware.htey.utli.AjaxMessage;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
public interface DepartmentService extends IService<Department> { public interface DepartmentService extends IService<Department> {
List<Department> selectByDeparmentName(String var1); List<Department> selectByDeparmentName(String var1);
@ -24,4 +28,14 @@ public interface DepartmentService extends IService<Department> {
int updateByPrimaryKeySelective(Department record); int updateByPrimaryKeySelective(Department record);
int deleteByPrimaryKey(List listId); int deleteByPrimaryKey(List listId);
List<Department> selectList(Department department, int pageNum, int pageSize);
public AjaxMessage checkDepartMentName(String name);
public AjaxMessage add(Department department);
public AjaxMessage edit(Department department);
public String delete(List<Department> departments);
} }

@ -2,9 +2,16 @@ package com.keyware.htey.service.itf;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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 com.keyware.htey.utli.AjaxMessage;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
public interface UserService extends IService<User> { public interface UserService extends IService<User> {
@ -52,4 +59,36 @@ public interface UserService extends IService<User> {
@Param("pageNum") int pageNum); @Param("pageNum") int pageNum);
int updateByPrimaryKeySelective(User var1); int updateByPrimaryKeySelective(User var1);
AjaxMessage analysisExcl(MultipartFile multipartfile);
String selectDepartUser(User user, String setDocumentDepartId, String headId);
String viewInfo(String id);
AjaxMessage add(User user);
String updateUser(List<User> users, String logOut);
String updateLock(List<User> users);
AjaxMessage updateStatus(List<User> users);
String deleteUser(List<User> users);
List<User> selectByUserInfo17suo(User user, int pageNum, int pageSize);
String PwdReset(@RequestParam String userIds);
Page<User> selectLogOutUser(String name, int pageNum, int pageSize);
List<User> userPwdResetList(String name, int pageNum, int pageSize);
String delPwdResetList(String userIds);
AjaxMessage edit(User user, HttpServletRequest request);
List<User> selectLoginList(String userNameForSerch, int pageNum, int pageSize);
String selectDepartUser(User user, String setDocumentDepartId);
} }

Loading…
Cancel
Save