diff --git a/src/main/java/com/bonus/aqgqj/basis/controller/SamplesManageController.java b/src/main/java/com/bonus/aqgqj/basis/controller/SamplesManageController.java index 77bce3d..3be0370 100644 --- a/src/main/java/com/bonus/aqgqj/basis/controller/SamplesManageController.java +++ b/src/main/java/com/bonus/aqgqj/basis/controller/SamplesManageController.java @@ -130,7 +130,7 @@ public class SamplesManageController { * @description 派工 */ @PostMapping("dispatchWork") - @DecryptAndVerify(decryptedClass = SamplesManageDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = SamplesManageDto.class) @LogAnnotation(operModul = "收样管理", operation = "派工", operDesc = "业务级事件", operType = "新增") @PreAuthorize("@pms.hasPermission('sys:samples:dispatch')") public ServerResponse dispatchWork(EncryptedReq vo) { diff --git a/src/main/java/com/bonus/aqgqj/basis/controller/TestReportManageController.java b/src/main/java/com/bonus/aqgqj/basis/controller/TestReportManageController.java index fc5bdbe..94b5c40 100644 --- a/src/main/java/com/bonus/aqgqj/basis/controller/TestReportManageController.java +++ b/src/main/java/com/bonus/aqgqj/basis/controller/TestReportManageController.java @@ -1,48 +1,31 @@ package com.bonus.aqgqj.basis.controller; -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.io.FileUtil; -import cn.hutool.core.io.IoUtil; -import cn.hutool.poi.excel.ExcelUtil; -import cn.hutool.poi.excel.ExcelWriter; import com.bonus.aqgqj.annotation.DecryptAndVerify; import com.bonus.aqgqj.annotation.LogAnnotation; -import com.bonus.aqgqj.basis.entity.dto.ParamsDto; import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto; import com.bonus.aqgqj.basis.service.TestReportManageService; import com.bonus.aqgqj.system.vo.EncryptedReq; import com.bonus.aqgqj.utils.DateTimeHelper; import com.bonus.aqgqj.utils.ServerResponse; -import com.bonus.aqgqj.utils.StringHelper; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import freemarker.template.Configuration; import freemarker.template.Template; import io.swagger.annotations.Api; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.Cell; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.FileSystemResource; -import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; -import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.net.URLEncoder; -import java.text.ParseException; import java.util.*; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; /** @@ -122,7 +105,7 @@ public class TestReportManageController { * @description 新增收样数据 */ @PostMapping("addSamples") - @DecryptAndVerify(decryptedClass = TestReportManageDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = TestReportManageDto.class) @LogAnnotation(operModul = "检测报告管理", operation = "新增收样数据", operDesc = "业务级事件", operType = "新增") @PreAuthorize("@pms.hasPermission('sys:samples:add')") public ServerResponse addSamples(EncryptedReq vo) { @@ -151,7 +134,7 @@ public class TestReportManageController { * @description 派工 */ @PostMapping("dispatchWork") - @DecryptAndVerify(decryptedClass = TestReportManageDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = TestReportManageDto.class) @LogAnnotation(operModul = "检测报告管理", operation = "派工", operDesc = "业务级事件", operType = "新增") @PreAuthorize("@pms.hasPermission('sys:samples:dispatch')") public ServerResponse dispatchWork(EncryptedReq vo) { @@ -163,31 +146,15 @@ public class TestReportManageController { } } -// /** -// * @description 一级页面下载 -// */ -// @PostMapping("download") -//// @DecryptAndVerify(decryptedClass = TestReportManageDto.class)//加解密统一管理 -// @LogAnnotation(operModul = "检测报告管理", operation = "下载", operDesc = "业务级事件", operType = "新增") -// @PreAuthorize("@pms.hasPermission('sys:samples:dispatch')") -// public ServerResponse download(EncryptedReq vo) { -// try { -// TestReportManageDto voo=new TestReportManageDto(); -// voo.setId(25); -// return testReportManageService.download(voo); -// } catch (Exception e) { -// log.error(e.toString(), e); -// return ServerResponse.createErroe("操作失败"); -// } -// } - @PostMapping(value = "viewTestData") - @DecryptAndVerify(decryptedClass = TestReportManageDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = TestReportManageDto.class) + @LogAnnotation(operModul = "检测报告管理", operation = "试验数据详情", operDesc = "业务级事件", operType = "查询") public ServerResponse viewTestData(EncryptedReq data) { return testReportManageService.viewTestData(data.getData()); } @GetMapping("/downloadReport") + @LogAnnotation(operModul = "检测报告管理", operation = "合格证下载", operDesc = "业务级事件", operType = "查询") public void downloadReport(HttpServletRequest request, HttpServletResponse response){ // 处理请求参数 TestReportManageDto vo = new TestReportManageDto(); @@ -255,22 +222,9 @@ public class TestReportManageController { } } - // 创建临时word文件 - private File createDoc(String fileName, Map map, Template template) { - // 添加时间戳以确保文件名唯一 - String uniqueFileName = fileName + "_" + System.currentTimeMillis() + ".doc"; - File f = new File(uniqueFileName); - try { - Writer w = new OutputStreamWriter(new FileOutputStream(f), "utf-8"); - template.process(map, w); - w.close(); - } catch (Exception ex) { - ex.printStackTrace(); - } - return f; - } - - // 创建临时word文件 + /** + * 创建临时word文件 + */ private File createDoc(Map map, Template template) { File f = null; try { @@ -297,6 +251,7 @@ public class TestReportManageController { @GetMapping("/download") + @LogAnnotation(operModul = "检测报告管理", operation = "检测报告下载", operDesc = "业务级事件", operType = "查询") public ResponseEntity downloadFile(HttpServletRequest request) { File tempZipFile = null; try { @@ -313,12 +268,4 @@ public class TestReportManageController { } } - private byte[] generateExcelData(String fileName) { - // Implement this method to generate Excel file data - // For now, returning empty byte array as placeholder - return new byte[0]; - } - - - } diff --git a/src/main/java/com/bonus/aqgqj/basis/dao/SamplesManageDao.java b/src/main/java/com/bonus/aqgqj/basis/dao/SamplesManageDao.java index 250da01..d543e56 100644 --- a/src/main/java/com/bonus/aqgqj/basis/dao/SamplesManageDao.java +++ b/src/main/java/com/bonus/aqgqj/basis/dao/SamplesManageDao.java @@ -6,6 +6,10 @@ import org.apache.ibatis.annotations.Mapper; import java.util.List; +/** + * 收样管理 + * @author: hay + */ @Mapper public interface SamplesManageDao { diff --git a/src/main/java/com/bonus/aqgqj/basis/dao/TestReportManageDao.java b/src/main/java/com/bonus/aqgqj/basis/dao/TestReportManageDao.java index 0ff7054..f4cefb5 100644 --- a/src/main/java/com/bonus/aqgqj/basis/dao/TestReportManageDao.java +++ b/src/main/java/com/bonus/aqgqj/basis/dao/TestReportManageDao.java @@ -1,15 +1,16 @@ package com.bonus.aqgqj.basis.dao; -import com.bonus.aqgqj.basis.entity.dto.ParamsDto; import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto; import com.bonus.aqgqj.basis.entity.vo.*; -import com.bonus.aqgqj.utils.ServerResponse; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; import java.util.List; import java.util.Map; +/** + * @author hay + */ @Mapper public interface TestReportManageDao { diff --git a/src/main/java/com/bonus/aqgqj/basis/dao/ToolsManageDao.java b/src/main/java/com/bonus/aqgqj/basis/dao/ToolsManageDao.java index 696eb2e..a51918f 100644 --- a/src/main/java/com/bonus/aqgqj/basis/dao/ToolsManageDao.java +++ b/src/main/java/com/bonus/aqgqj/basis/dao/ToolsManageDao.java @@ -1,19 +1,9 @@ package com.bonus.aqgqj.basis.dao; -import com.bonus.aqgqj.base.entity.DtreeVo; import com.bonus.aqgqj.basis.entity.dto.ToolsManageDto; -import com.bonus.aqgqj.model.PasswordConfig; -import com.bonus.aqgqj.model.SysUser; -import com.bonus.aqgqj.system.vo.LoginUser; -import com.bonus.aqgqj.system.vo.Org; -import com.bonus.aqgqj.system.vo.UserDto; -import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Update; import java.util.List; -import java.util.Map; /** * @author hay diff --git a/src/main/java/com/bonus/aqgqj/basis/service/TestReportManageService.java b/src/main/java/com/bonus/aqgqj/basis/service/TestReportManageService.java index b1e6c38..bc169d6 100644 --- a/src/main/java/com/bonus/aqgqj/basis/service/TestReportManageService.java +++ b/src/main/java/com/bonus/aqgqj/basis/service/TestReportManageService.java @@ -1,6 +1,5 @@ package com.bonus.aqgqj.basis.service; -import com.bonus.aqgqj.basis.entity.dto.ParamsDto; import com.bonus.aqgqj.basis.entity.dto.TestReportManageDto; import com.bonus.aqgqj.utils.ServerResponse; import org.springframework.core.io.FileSystemResource; @@ -12,7 +11,7 @@ import java.io.IOException; import java.util.List; /** - * 工器具个体管理 + * 检测报告管理 * @author hay */ public interface TestReportManageService { @@ -87,6 +86,7 @@ public interface TestReportManageService { * 检测报告下载 * @param request * @param tempZipFile + * @throws IOException * @return */ ResponseEntity downloadFile(HttpServletRequest request, File tempZipFile) throws IOException; diff --git a/src/main/java/com/bonus/aqgqj/basis/service/impl/SamplesManageServiceImpl.java b/src/main/java/com/bonus/aqgqj/basis/service/impl/SamplesManageServiceImpl.java index dad55c9..95a2440 100644 --- a/src/main/java/com/bonus/aqgqj/basis/service/impl/SamplesManageServiceImpl.java +++ b/src/main/java/com/bonus/aqgqj/basis/service/impl/SamplesManageServiceImpl.java @@ -1,23 +1,16 @@ package com.bonus.aqgqj.basis.service.impl; -import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.bonus.aqgqj.basis.dao.SamplesManageDao; -import com.bonus.aqgqj.basis.dao.ToolsManageDao; import com.bonus.aqgqj.basis.entity.dto.SamplesManageDto; -import com.bonus.aqgqj.basis.entity.dto.ToolsManageDto; import com.bonus.aqgqj.basis.service.SamplesManageService; -import com.bonus.aqgqj.basis.service.ToolsManageService; import com.bonus.aqgqj.utils.*; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.time.DateUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.List; /** diff --git a/src/main/java/com/bonus/aqgqj/basis/service/impl/TestReportManageServiceImpl.java b/src/main/java/com/bonus/aqgqj/basis/service/impl/TestReportManageServiceImpl.java index 29cfcc2..abd5723 100644 --- a/src/main/java/com/bonus/aqgqj/basis/service/impl/TestReportManageServiceImpl.java +++ b/src/main/java/com/bonus/aqgqj/basis/service/impl/TestReportManageServiceImpl.java @@ -37,9 +37,8 @@ import java.io.ByteArrayOutputStream; import java.util.zip.ZipEntry; /** -* @description 工器具个体管理 +* @description 检测报告管理 * @author hay -* @date 2024/7/20 16:10 */ @Slf4j @Service @@ -242,7 +241,6 @@ public class TestReportManageServiceImpl implements TestReportManageService { try (FileOutputStream fos = new FileOutputStream(zipFile); ZipOutputStream zos = new ZipOutputStream(fos)) { TestReportManageDto testVo = (TestReportManageDto) serverResponse.getData(); - log.info("sj--->{}",testVo); //将数据传给检测报告生成的方法 try { generateReport(testVo,zos); diff --git a/src/main/java/com/bonus/aqgqj/system/controller/RoleController.java b/src/main/java/com/bonus/aqgqj/system/controller/RoleController.java index 558deeb..d389ff3 100644 --- a/src/main/java/com/bonus/aqgqj/system/controller/RoleController.java +++ b/src/main/java/com/bonus/aqgqj/system/controller/RoleController.java @@ -37,7 +37,7 @@ public class RoleController { private RoleDao roleDao; @PostMapping(value = "getList") - @DecryptAndVerify(decryptedClass = Role.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = Role.class) @LogAnnotation(operModul = "角色管理", operation = "查询用列表", operDesc = "系统级事件",operType="查询") @PreAuthorize("@pms.hasPermission('sys:role:query')" ) public ServerResponse listRoles(EncryptedReq data) { @@ -53,7 +53,7 @@ public class RoleController { } @PostMapping(value = "add") - @DecryptAndVerify(decryptedClass = RoleDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = RoleDto.class) @LogAnnotation(operModul = "角色管理", operation = "新增角色", operDesc = "系统级事件",operType="新增") @PreAuthorize("@pms.hasPermission('sys:role:add')" ) public ServerResponse add(EncryptedReq data) { @@ -67,7 +67,7 @@ public class RoleController { } @PostMapping(value = "update") - @DecryptAndVerify(decryptedClass = RoleDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = RoleDto.class) @LogAnnotation(operModul = "角色管理", operation = "修改角色", operDesc = "系统级事件",operType="修改") @PreAuthorize("@pms.hasPermission('sys:role:add')" ) public ServerResponse update(EncryptedReq data) { @@ -94,7 +94,7 @@ public class RoleController { } @PostMapping(value = "getById") - @DecryptAndVerify(decryptedClass = Role.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = Role.class) @LogAnnotation(operModul = "角色管理", operation = "查询角色信息", operDesc = "系统级事件",operType="查询") @PreAuthorize("@pms.hasPermission('sys:role:query')" ) public ServerResponse getById(EncryptedReq data) { @@ -122,7 +122,7 @@ public class RoleController { } @PostMapping(value = "getByUserId") - @DecryptAndVerify(decryptedClass = Role.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = Role.class) @LogAnnotation(operModul = "角色管理", operation = "根据用户id查询角色", operDesc = "系统级事件",operType="查询") @PreAuthorize("@pms.hasPermission('sys:role:query')" ) public ServerResponse getByUserId(EncryptedReq data) { @@ -136,7 +136,7 @@ public class RoleController { } @PostMapping(value = "delById") - @DecryptAndVerify(decryptedClass = Role.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = Role.class) @LogAnnotation(operModul = "角色管理", operation = "删除角色", operDesc = "系统级事件",operType="删除") @PreAuthorize("@pms.hasPermission('sys:role:del')" ) public ServerResponse delete(EncryptedReq data) { diff --git a/src/main/java/com/bonus/aqgqj/system/controller/SysOrgController.java b/src/main/java/com/bonus/aqgqj/system/controller/SysOrgController.java index 57e3a7c..0e55a35 100644 --- a/src/main/java/com/bonus/aqgqj/system/controller/SysOrgController.java +++ b/src/main/java/com/bonus/aqgqj/system/controller/SysOrgController.java @@ -39,7 +39,7 @@ public class SysOrgController { * @date 2023/10/8 9:19 */ @PostMapping(value = "getOrgList") - @DecryptAndVerify(decryptedClass = SysOrgDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = SysOrgDto.class) @LogAnnotation(operModul = "系统管理-组织机构管理", operation = "查询组织机构列表", operDesc = "系统级事件", operType = "查询") @PreAuthorize("@pms.hasPermission('sys:sysOrg:query')") public ServerResponse getOrgList(EncryptedReq dto) { @@ -71,7 +71,7 @@ public class SysOrgController { * @date 2023/10/8 11:10 */ @PostMapping("addSysOrg") - @DecryptAndVerify(decryptedClass = SysOrgVo.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = SysOrgVo.class) @LogAnnotation(operModul = "系统管理-组织机构管理", operation = "新增组织机构", operDesc = "系统级事件", operType = "新增") @PreAuthorize("@pms.hasPermission('sys:sysOrg:add')") public ServerResponse addSysOrg(EncryptedReq vo) { @@ -87,7 +87,7 @@ public class SysOrgController { * @date 2023/10/8 11:26 */ @PostMapping("updateSysOrg") - @DecryptAndVerify(decryptedClass = SysOrgVo.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = SysOrgVo.class) @LogAnnotation(operModul = "系统管理-组织机构管理", operation = "修改组织机构", operDesc = "系统级事件", operType = "修改") @PreAuthorize("@pms.hasPermission('sys:sysOrg:add')") public ServerResponse updateSysOrg(EncryptedReq vo) { @@ -108,7 +108,7 @@ public class SysOrgController { } @PostMapping("delSysOrg") - @DecryptAndVerify(decryptedClass = SysOrgVo.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = SysOrgVo.class) @LogAnnotation(operModul = "系统管理-组织机构管理", operation = "删除组织机构", operDesc = "系统级事件", operType = "删除") @PreAuthorize("@pms.hasPermission('sys:sysOrg:del')") public ServerResponse delSysOrg(EncryptedReq vo) { @@ -123,7 +123,7 @@ public class SysOrgController { * @date 2023/10/7 11:20 */ @PostMapping("getSysOrgById") - @DecryptAndVerify(decryptedClass = SysOrgVo.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = SysOrgVo.class) public ServerResponse getSysOrgById(EncryptedReq vo) { return service.getSysOrgById(vo.getData()); } @@ -136,7 +136,7 @@ public class SysOrgController { * @date 2023/10/7 11:24 */ @PostMapping("isRepeat") - @DecryptAndVerify(decryptedClass = RepeatEntity.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = RepeatEntity.class) public ServerResponse isRepeat(EncryptedReq vo) { return service.isRepeat(vo); } diff --git a/src/main/java/com/bonus/aqgqj/system/controller/UserController.java b/src/main/java/com/bonus/aqgqj/system/controller/UserController.java index 3136dbc..f53775a 100644 --- a/src/main/java/com/bonus/aqgqj/system/controller/UserController.java +++ b/src/main/java/com/bonus/aqgqj/system/controller/UserController.java @@ -47,7 +47,7 @@ public class UserController { private UserDao userDao; @PostMapping(value = "getList") - @DecryptAndVerify(decryptedClass = SysUser.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = SysUser.class) @LogAnnotation(operModul = "系统管理-用户管理", operation = "查询用列表", operDesc = "系统级事件",operType="查询") @PreAuthorize("@pms.hasPermission('sys:user:query')" ) public ServerResponse listUsers(EncryptedReq data) { @@ -64,7 +64,7 @@ public class UserController { @PostMapping(value = "add") - @DecryptAndVerify(decryptedClass = UserDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = UserDto.class) @LogAnnotation(operModul = "系统管理-用户管理", operation = "新增用户", operDesc = "系统级事件",operType="新增") @PreAuthorize("@pms.hasPermission('sys:user:add')") public ServerResponse saveUser(EncryptedReq data) { @@ -88,7 +88,7 @@ public class UserController { } @PostMapping(value = "addTemp") - @DecryptAndVerify(decryptedClass = UserDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = UserDto.class) @LogAnnotation(operModul = "系统管理-用户管理", operation = "新增用户", operDesc = "系统级事件",operType="新增") @PreAuthorize("@pms.hasPermission('sys:user:add')") public ServerResponse saveUserTemp(EncryptedReq data) { @@ -126,7 +126,7 @@ public class UserController { @PostMapping(value = "update") - @DecryptAndVerify(decryptedClass = UserDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = UserDto.class) @LogAnnotation(operModul = "系统管理-用户管理", operation = "修改用户", operDesc = "系统级事件",operType="修改") @PreAuthorize("@pms.hasPermission('sys:user:add')") public ServerResponse updateUser(EncryptedReq data) { @@ -152,7 +152,7 @@ public class UserController { //@PreAuthorize("hasAuthority('sys:user:password')") @PostMapping(value = "changePassword") - @DecryptAndVerify(decryptedClass = SysUser.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = SysUser.class) @LogAnnotation(operModul = "系统管理-用户管理", operation = "用户修改密码", operDesc = "系统级事件",operType="修改") public ServerResponse changePassword(EncryptedReq data) { try { @@ -166,7 +166,7 @@ public class UserController { @PostMapping(value = "password") - @DecryptAndVerify(decryptedClass = SysUser.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = SysUser.class) @LogAnnotation(operModul = "系统管理-用户管理", operation = "管理员修改密码", operDesc = "系统级事件",operType="修改") public ServerResponse password(EncryptedReq data) { try { @@ -190,7 +190,7 @@ public class UserController { } @PostMapping(value = "getById") - @DecryptAndVerify(decryptedClass = UserDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = UserDto.class) @LogAnnotation(operModul = "系统管理-用户管理", operation = "查询用户信息", operDesc = "系统级事件",operType="查询") @PreAuthorize("@pms.hasPermission('sys:user:query')") public ServerResponse user(EncryptedReq data) { @@ -226,7 +226,7 @@ public class UserController { } @PostMapping(value = "delById") - @DecryptAndVerify(decryptedClass = UserDto.class)//加解密统一管理 + @DecryptAndVerify(decryptedClass = UserDto.class) @LogAnnotation(operModul = "系统管理-用户管理", operation = "注销用户", operDesc = "系统级事件",operType="删除") @PreAuthorize("@pms.hasPermission('sys:user:del')") public ServerResponse delUser(EncryptedReq data) { @@ -258,22 +258,26 @@ public class UserController { StringBuilder regexBuilder = new StringBuilder("^"); StringBuilder prompt = new StringBuilder("密码格式错误,需包括"); - if (pwdStrength.contains("1")) { // 包含数字 + if (pwdStrength.contains("1")) { + // 包含数字 regexBuilder.append("(?=.*\\d)"); prompt.append("(数字)"); } - if (pwdStrength.contains("2")) { // 包含小写字母 + if (pwdStrength.contains("2")) { + // 包含小写字母 regexBuilder.append("(?=.*[a-z])"); prompt.append("(小写字母)"); } - if (pwdStrength.contains("3")) { // 包含大写字母 + if (pwdStrength.contains("3")) { + // 包含大写字母 regexBuilder.append("(?=.*[A-Z])"); prompt.append("(大写字母)"); } - if (pwdStrength.contains("4")) { // 包含特殊字符 + if (pwdStrength.contains("4")) { + // 包含特殊字符 regexBuilder.append("(?=.*[@#$%^&+=])"); prompt.append("(特殊字符)"); } diff --git a/src/main/java/com/bonus/aqgqj/system/dao/RoleDao.java b/src/main/java/com/bonus/aqgqj/system/dao/RoleDao.java index cf5ad45..f5c80ab 100644 --- a/src/main/java/com/bonus/aqgqj/system/dao/RoleDao.java +++ b/src/main/java/com/bonus/aqgqj/system/dao/RoleDao.java @@ -11,7 +11,10 @@ import org.apache.ibatis.annotations.Options; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; - +/** + * 角色 + * @author bns + */ @Mapper public interface RoleDao { @@ -40,7 +43,11 @@ public interface RoleDao { */ Role getById(Long id); - + /** + * 根据角色名查询角色 + * @param name + * @return + */ Role getRole(String name); /** @@ -51,24 +58,49 @@ public interface RoleDao { @Update("update sys_role t set t.role_name = #{name},t.role_code = #{roleCode}, t.remarks = #{remarks},org_id=#{orgId},state=#{state}, update_time = now() where t.role_id = #{id}") int update(Role role); + /** + * 根据用户id查询角色 + * @param userId + * @return + */ @Select("select * from sys_role r inner join sys_role_user ru on r.id = ru.roleId where ru.userId = #{userId}") List listByUserId(Long userId); + /** + * 删除角色权限 + * @param roleId + * @return + */ @Delete("delete from sys_role_menu where role_id = #{roleId}") int deleteRolePermission(Long roleId); + /** + * 保存角色权限 + * @param roleId + * @param permissionIds + * @return + */ int saveRolePermission(@Param("roleId") Long roleId, @Param("permissionIds") List permissionIds); - + /** + * 删除角色 + * @param id + * @return + */ int delete(Long id); + /** + * 删除角色用户 + * @param roleId + * @return + */ @Delete("delete from sys_role_user where roleId = #{roleId}") int deleteRoleUser(Long roleId); /** + * 获取用户使用该角色数量 * @param id * @return int - * @description 获取用户使用该角色数量 * @author cwchen * @date 2023/10/28 14:47 */ diff --git a/src/main/java/com/bonus/aqgqj/system/dao/SysOrgMapper.java b/src/main/java/com/bonus/aqgqj/system/dao/SysOrgMapper.java index 391147a..e0ce19b 100644 --- a/src/main/java/com/bonus/aqgqj/system/dao/SysOrgMapper.java +++ b/src/main/java/com/bonus/aqgqj/system/dao/SysOrgMapper.java @@ -16,17 +16,17 @@ import java.util.List; public interface SysOrgMapper { /** + * 查询组织机构列表 * @param data * @return List - * @description 查询组织机构列表 * @author cwchen * @date 2023/10/8 9:21 */ List getOrgList(SysOrgDto data); /** + * 组织机构树 * @return List - * @description 组织机构树 * @author cwchen * @date 2023/10/8 10:31 */ @@ -41,26 +41,26 @@ public interface SysOrgMapper { void addOrUpdateSysOrg(SysOrgVo data); /** + * 验证某字段是否存在 * @param entity * @return int - * @description 验证某字段是否存在 * @author cwchen * @date 2023/10/8 11:22 */ int isRepeat(RepeatEntity entity); /** + * 删除组织机构 * @param data - * @description 删除组织机构 * @author cwchen * @date 2023/10/8 11:29 */ void delSysOrg(SysOrgVo data); /** + * 查询组织机构详情 * @param data * @return SysOrgVo - * @description 查询组织机构详情 * @author cwchen * @date 2023/10/8 13:08 */ diff --git a/src/main/java/com/bonus/aqgqj/system/dao/UserDao.java b/src/main/java/com/bonus/aqgqj/system/dao/UserDao.java index dcd1f40..c162d97 100644 --- a/src/main/java/com/bonus/aqgqj/system/dao/UserDao.java +++ b/src/main/java/com/bonus/aqgqj/system/dao/UserDao.java @@ -47,9 +47,20 @@ public interface UserDao { */ SysUser getUserCode(String userCode); + /** + * 修改密码 + * @param id + * @param password + * @return + */ @Update("update sys_user t set t.password = #{password} where t.id = #{id}") int changePassword(@Param("id") Long id, @Param("password") String password); + /** + * 查询用户数量 + * @param params + * @return + */ Integer count(@Param("params") Map params); /** @@ -59,9 +70,20 @@ public interface UserDao { */ List list(SysUser user); + /** + * 删除用户角色 + * @param userId + * @return + */ @Delete("delete from sys_role_user where userId = #{userId}") int deleteUserRole(Long userId); + /** + * 保存用户角色 + * @param userId + * @param roleIds + * @return + */ int saveUserRoles(@Param("userId") Long userId, @Param("roleIds") List roleIds); /** @@ -71,10 +93,24 @@ public interface UserDao { */ int update(SysUser user); + /** + * 查询密码配置 + * @return + */ PasswordConfig getPasswordConfigById(); + /** + * 修改密码 + * @param user + * @return + */ int password(SysUser user); + /** + * 删除用户 + * @param id + * @return + */ int delUser(Long id); /** @@ -98,6 +134,14 @@ public interface UserDao { List getLockUser(@Param("state")String state,@Param("type")String type); + /** + * 更新用户状态 + * @param username + * @param state + * @param delFlag + * @param id + * @return + */ void updateUserState(@Param("username")String username,@Param("state") String state,@Param("delFlag") String delFlag,@Param("id")Long id); /** diff --git a/src/main/java/com/bonus/aqgqj/system/service/RoleService.java b/src/main/java/com/bonus/aqgqj/system/service/RoleService.java index 1d24541..cb73836 100644 --- a/src/main/java/com/bonus/aqgqj/system/service/RoleService.java +++ b/src/main/java/com/bonus/aqgqj/system/service/RoleService.java @@ -6,6 +6,10 @@ import com.bonus.aqgqj.utils.ServerResponse; import java.util.List; +/** + * 角色服务 + * @author bns + */ public interface RoleService { /** @@ -15,6 +19,11 @@ public interface RoleService { */ ServerResponse saveRole(RoleDto roleDto); + /** + * 删除角色 + * @param id + * @return + */ ServerResponse deleteRole(Long id); /** @@ -31,6 +40,11 @@ public interface RoleService { */ Role getById(Long id); + /** + * 根据用户id查询角色 + * @param userId + * @return + */ List listByUserId(Long userId); /** diff --git a/src/main/java/com/bonus/aqgqj/system/service/SysOrgService.java b/src/main/java/com/bonus/aqgqj/system/service/SysOrgService.java index d00a845..061afb0 100644 --- a/src/main/java/com/bonus/aqgqj/system/service/SysOrgService.java +++ b/src/main/java/com/bonus/aqgqj/system/service/SysOrgService.java @@ -15,17 +15,17 @@ import java.util.List; */ public interface SysOrgService { /** + * 查询组织机构列表 * @param data * @return PageInfo - * @description 查询组织机构列表 * @author cwchen * @date 2023/10/8 9:20 */ List getOrgList(SysOrgDto data); /** + * 组织机构树 * @return ServerResponse - * @description 组织机构树 * @author cwchen * @date 2023/10/8 10:29 */ diff --git a/src/main/java/com/bonus/aqgqj/system/service/UserService.java b/src/main/java/com/bonus/aqgqj/system/service/UserService.java index 250e99d..32719e7 100644 --- a/src/main/java/com/bonus/aqgqj/system/service/UserService.java +++ b/src/main/java/com/bonus/aqgqj/system/service/UserService.java @@ -10,6 +10,10 @@ import com.bonus.aqgqj.utils.ServerResponse; import java.util.List; import java.util.Map; +/** + * 用户管理 + * @author bns + */ public interface UserService { /** @@ -40,10 +44,24 @@ public interface UserService { */ SysUser getUserCode(String userCode); + /** + * 修改密码 + * @param user + * @return + */ ServerResponse changePassword(SysUser user); + /** + * 管理员修改密码 + * @param user + */ void password(SysUser user); + /** + * 查询用户数量 + * @param params + * @return + */ int count(Map params); /** @@ -60,8 +78,17 @@ public interface UserService { */ UserDto getById(Long id); + /** + * 删除用户 + * @param id + * @return + */ int delUser(Long id); + /** + * 查询密码配置 + * @return + */ PasswordConfig getPasswordConfigById(); /** @@ -77,10 +104,16 @@ public interface UserService { */ SysUser getPhone(String phone); + /** + * 查询账号 + * @param state + * @param type + * @return + */ List getLockUser(String state,String type); /** - * + * 修改用户状态 * @param loginName * @param state */ diff --git a/src/main/java/com/bonus/aqgqj/system/service/impl/RoleServiceImpl.java b/src/main/java/com/bonus/aqgqj/system/service/impl/RoleServiceImpl.java index 35f43c2..d649d8c 100644 --- a/src/main/java/com/bonus/aqgqj/system/service/impl/RoleServiceImpl.java +++ b/src/main/java/com/bonus/aqgqj/system/service/impl/RoleServiceImpl.java @@ -16,7 +16,9 @@ import org.springframework.util.CollectionUtils; import com.bonus.aqgqj.system.dao.RoleDao; import com.bonus.aqgqj.system.vo.RoleDto; import com.bonus.aqgqj.model.Role; - +/** + * @author :bns + */ @Service public class RoleServiceImpl implements RoleService { diff --git a/src/main/java/com/bonus/aqgqj/system/service/impl/UserServiceImpl.java b/src/main/java/com/bonus/aqgqj/system/service/impl/UserServiceImpl.java index 7a5c280..9ac5408 100644 --- a/src/main/java/com/bonus/aqgqj/system/service/impl/UserServiceImpl.java +++ b/src/main/java/com/bonus/aqgqj/system/service/impl/UserServiceImpl.java @@ -24,6 +24,9 @@ import com.bonus.aqgqj.system.service.UserService; import javax.annotation.Resource; +/** + * @author bns + */ @Slf4j @Service public class UserServiceImpl implements UserService {