From cb868018b00c3b00bf2669223eb378ceb9c058b4 Mon Sep 17 00:00:00 2001 From: renzexin Date: Thu, 22 Aug 2024 16:32:23 +0800 Subject: [PATCH 1/9] =?UTF-8?q?fix=20=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chushang/security/entity/po/SysUser.java | 4 ++ .../chushang/system/entity/dto/DeptDTO.java | 9 +++ .../chushang/system/entity/dto/RoleDTO.java | 9 +++ .../system/controller/DeptController.java | 6 ++ .../system/controller/UserController.java | 69 ++++++++++++++++++- .../chushang/system/mapper/SysDeptMapper.java | 3 + .../chushang/system/mapper/SysRoleMapper.java | 3 + .../system/service/ISysDeptService.java | 3 + .../system/service/ISysRoleService.java | 3 + .../service/impl/SysDeptServiceImpl.java | 6 ++ .../service/impl/SysRoleServiceImpl.java | 6 ++ .../main/resources/mapper/SysDeptMapper.xml | 3 + .../main/resources/mapper/SysRoleMapper.xml | 3 + 13 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 chushang-modules/chushang-module-system/system-feign/src/main/java/com/chushang/system/entity/dto/DeptDTO.java create mode 100644 chushang-modules/chushang-module-system/system-feign/src/main/java/com/chushang/system/entity/dto/RoleDTO.java diff --git a/chushang-common/chushang-common-security/src/main/java/com/chushang/security/entity/po/SysUser.java b/chushang-common/chushang-common-security/src/main/java/com/chushang/security/entity/po/SysUser.java index d9bfcf8..9cbd8cf 100644 --- a/chushang-common/chushang-common-security/src/main/java/com/chushang/security/entity/po/SysUser.java +++ b/chushang-common/chushang-common-security/src/main/java/com/chushang/security/entity/po/SysUser.java @@ -100,6 +100,10 @@ public class SysUser extends BaseEntity { */ @TableField(exist = false) private Long roleId; + /** + * 备注 + */ + private String remark; public boolean isAdmin() { diff --git a/chushang-modules/chushang-module-system/system-feign/src/main/java/com/chushang/system/entity/dto/DeptDTO.java b/chushang-modules/chushang-module-system/system-feign/src/main/java/com/chushang/system/entity/dto/DeptDTO.java new file mode 100644 index 0000000..753a39a --- /dev/null +++ b/chushang-modules/chushang-module-system/system-feign/src/main/java/com/chushang/system/entity/dto/DeptDTO.java @@ -0,0 +1,9 @@ +package com.chushang.system.entity.dto; + +import lombok.Data; + +@Data +public class DeptDTO { + private Long deptId; + private String deptName; +} diff --git a/chushang-modules/chushang-module-system/system-feign/src/main/java/com/chushang/system/entity/dto/RoleDTO.java b/chushang-modules/chushang-module-system/system-feign/src/main/java/com/chushang/system/entity/dto/RoleDTO.java new file mode 100644 index 0000000..c2bce7b --- /dev/null +++ b/chushang-modules/chushang-module-system/system-feign/src/main/java/com/chushang/system/entity/dto/RoleDTO.java @@ -0,0 +1,9 @@ +package com.chushang.system.entity.dto; + +import lombok.Data; + +@Data +public class RoleDTO { + private Long roleId; + private String roleName; +} diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/DeptController.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/DeptController.java index 8dc8929..d651d66 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/DeptController.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/DeptController.java @@ -5,6 +5,7 @@ import com.chushang.common.log.annotation.SysLog; import com.chushang.common.log.enums.BusinessType; import com.chushang.security.annotation.RequiresPermissions; import com.chushang.security.utils.SecurityUtils; +import com.chushang.system.entity.dto.DeptDTO; import com.chushang.system.entity.dto.ListDeptDTO; import com.chushang.security.entity.po.SysDept; import com.chushang.system.service.ISysDeptService; @@ -158,4 +159,9 @@ public class DeptController { return AjaxResult.success(); } + public List getDept(){ + List deptDTOS = sysDeptService.getDept(); + return deptDTOS; + } + } diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java index 353dac3..56aba70 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java @@ -6,27 +6,38 @@ import com.chushang.common.core.util.StringUtils; import com.chushang.common.core.web.AjaxResult; import com.chushang.common.log.annotation.SysLog; import com.chushang.common.log.enums.BusinessType; +import com.chushang.datascope.annotation.DataScope; import com.chushang.security.annotation.RequiresPermissions; import com.chushang.security.service.TokenService; import com.chushang.security.utils.SecurityUtils; import com.chushang.system.entity.bo.PasswordForm; import com.chushang.system.entity.bo.RoleUser; import com.chushang.system.entity.bo.UserRole; +import com.chushang.system.entity.dto.DeptDTO; import com.chushang.system.entity.dto.ListUserDTO; +import com.chushang.system.entity.dto.RoleDTO; import com.chushang.system.entity.po.SysPost; import com.chushang.security.entity.po.SysRole; import com.chushang.security.entity.po.SysUser; import com.chushang.security.entity.vo.LoginUser; import com.chushang.system.service.*; +import org.apache.poi.ss.usermodel.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.cache.annotation.CacheRemove; import javax.validation.Valid; +import java.io.FileInputStream; +import java.io.IOException; import java.util.*; import java.util.stream.Collectors; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.web.multipart.MultipartFile; /** * @author by zhaowenyuan create 2022/8/18 17:50 */ @@ -34,6 +45,7 @@ import java.util.stream.Collectors; @RequestMapping(value = "/user") public class UserController { + private static final Logger log = LoggerFactory.getLogger(UserController.class); @Resource ISysUserService sysUserService; @Resource @@ -319,15 +331,68 @@ public class UserController { tokenService.forcedRetreat(userId); return AjaxResult.success(); } + @Autowired + private ISysDeptService sysDeptService; /** * todo 导入用户 */ @PostMapping(value = "/import") - @RequiresPermissions("system:user:import") +// @RequiresPermissions("system:user:import") public AjaxResult importUser(MultipartFile file){ - return AjaxResult.error("暂未开放"); + if(file.isEmpty()){ + return AjaxResult.error("文件不能为空"); + } + SysUser sysUser = new SysUser(); + //查部门 + List dept = sysDeptService.getDept(); + List role = sysRoleService.getRole(); + + try { + Workbook workbook = new XSSFWorkbook(file.getInputStream()); + Sheet sheet = workbook.getSheetAt(0); + DataFormatter format = new DataFormatter(); + for (Row row : sheet) { + HashSet roleIds = new HashSet<>(); + if(row.getRowNum()==0)continue; + sysUser.setNickName(format.formatCellValue(row.getCell(0))); + sysUser.setUsername(format.formatCellValue(row.getCell(1))); + sysUser.setPassword(format.formatCellValue(row.getCell(2))); + sysUser.setPhone(format.formatCellValue(row.getCell(3))); + if (format.formatCellValue(row.getCell(4)).equals("男")){ + sysUser.setGender(0); + }else if (format.formatCellValue(row.getCell(4)).equals("女")){ + sysUser.setGender(1); + } + String deptName = format.formatCellValue(row.getCell(5)); + for (DeptDTO deptDTO : dept) { + if(deptDTO.getDeptName().equals(deptName)){ + sysUser.setDeptId(deptDTO.getDeptId()); + break; + } + } + sysUser.setEmail(format.formatCellValue(row.getCell(6))); + String roleName = format.formatCellValue(row.getCell(7)); + String[] split = roleName.split(","); + for (RoleDTO roleDTO : role) { + for (String name : split) { + if(roleDTO.getRoleName().equals(name)){ + roleIds.add(roleDTO.getRoleId()); + } + } + } + sysUser.setRoleIds(roleIds); + sysUser.setRemark(format.formatCellValue(row.getCell(8))); + + System.out.println(sysUser); + //存库 + save(sysUser); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + return AjaxResult.success(); } /** diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/mapper/SysDeptMapper.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/mapper/SysDeptMapper.java index 9dfa1c0..8a9d0c1 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/mapper/SysDeptMapper.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/mapper/SysDeptMapper.java @@ -1,6 +1,7 @@ package com.chushang.system.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.chushang.system.entity.dto.DeptDTO; import com.chushang.system.entity.dto.ListDeptDTO; import com.chushang.security.entity.po.SysDept; import org.apache.ibatis.annotations.Param; @@ -30,4 +31,6 @@ public interface SysDeptMapper extends BaseMapper { @Select("SELECT dept_id FROM sys_dept WHERE dept_id = #{deptId} or find_in_set( #{deptId} , ancestors )") List listScopeDeptIdByDeptId(@Param("deptId") Long deptId); + + List getDept(); } diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/mapper/SysRoleMapper.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/mapper/SysRoleMapper.java index a4d37b7..a4b68c0 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/mapper/SysRoleMapper.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/mapper/SysRoleMapper.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.chushang.system.entity.dto.ListRoleDTO; import com.chushang.security.entity.po.SysRole; +import com.chushang.system.entity.dto.RoleDTO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -27,4 +28,6 @@ public interface SysRoleMapper extends BaseMapper { SysRole selectRoleById(Long roleId); Set selectRoleByUsername(String username); + + List getRole(); } diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/ISysDeptService.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/ISysDeptService.java index 8207433..adffa15 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/ISysDeptService.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/ISysDeptService.java @@ -6,6 +6,7 @@ import com.chushang.common.core.exception.ResultException; import com.chushang.common.core.text.Convert; import com.chushang.common.core.util.StringUtils; import com.chushang.common.mybatis.enums.Operator; +import com.chushang.system.entity.dto.DeptDTO; import com.chushang.system.entity.dto.ListDeptDTO; import com.chushang.security.entity.po.SysDept; import com.chushang.system.entity.vo.TreeSelect; @@ -123,4 +124,6 @@ public interface ISysDeptService extends IService { List listScopeDeptIdByRoleId(Long roleId); List listScopeDeptIdByDeptId(Long deptId); + + List getDept(); } diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/ISysRoleService.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/ISysRoleService.java index 7c75909..431ef6a 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/ISysRoleService.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/ISysRoleService.java @@ -12,6 +12,7 @@ import com.chushang.system.entity.bo.UserRole; import com.chushang.system.entity.dto.ListRoleDTO; import com.chushang.security.entity.po.SysRole; import com.chushang.security.entity.po.SysUser; +import com.chushang.system.entity.dto.RoleDTO; import java.util.Collection; import java.util.List; @@ -77,4 +78,6 @@ public interface ISysRoleService extends IService { void insertAuthUsers(Long roleId, Collection userIds); String selectRolesByUserName(String username); + + List getRole(); } diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/impl/SysDeptServiceImpl.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/impl/SysDeptServiceImpl.java index 692a185..7ef2000 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/impl/SysDeptServiceImpl.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/impl/SysDeptServiceImpl.java @@ -6,6 +6,7 @@ import com.chushang.common.core.exception.ResultException; import com.chushang.common.core.util.SpringUtils; import com.chushang.common.core.util.StringUtils; import com.chushang.datascope.annotation.DataScope; +import com.chushang.system.entity.dto.DeptDTO; import com.chushang.system.mapper.SysDeptMapper; import com.chushang.system.service.ISysUserService; import com.chushang.security.utils.SecurityUtils; @@ -116,6 +117,11 @@ public class SysDeptServiceImpl extends ServiceImpl impl return baseMapper.listScopeDeptIdByDeptId(deptId); } + @Override + public List getDept() { + return baseMapper.getDept(); + } + /** * 递归列表 */ diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/impl/SysRoleServiceImpl.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/impl/SysRoleServiceImpl.java index 7521eb5..690c8a1 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/impl/SysRoleServiceImpl.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/service/impl/SysRoleServiceImpl.java @@ -11,6 +11,7 @@ import com.chushang.datascope.annotation.DataScope; import com.chushang.security.utils.SecurityUtils; import com.chushang.system.entity.bo.RoleUser; import com.chushang.system.entity.bo.UserRole; +import com.chushang.system.entity.dto.RoleDTO; import com.chushang.system.mapper.SysRoleMapper; import com.chushang.system.service.ISysRoleMenuService; import com.chushang.system.entity.dto.ListRoleDTO; @@ -175,4 +176,9 @@ public class SysRoleServiceImpl extends ServiceImpl impl return CollectionUtil.isEmpty(roleList) ? StringUtils.EMPTY : roleList.stream().map(SysRole::getRoleName) .collect(Collectors.joining(",")); } + + @Override + public List getRole() { + return baseMapper.getRole(); + } } diff --git a/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysDeptMapper.xml b/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysDeptMapper.xml index 3e33066..ac47cbf 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysDeptMapper.xml +++ b/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysDeptMapper.xml @@ -49,6 +49,9 @@ order by d.parent_dept_id, d.order_num + update sys_dept set ancestors = diff --git a/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysRoleMapper.xml b/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysRoleMapper.xml index 1898a30..28f9f89 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysRoleMapper.xml +++ b/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysRoleMapper.xml @@ -89,4 +89,7 @@ where r.del_state = FALSE AND u.username = #{username} + From 73fa91c11f3bee3881efd7655487b92c87a4a5ef Mon Sep 17 00:00:00 2001 From: renzexin Date: Thu, 22 Aug 2024 16:42:04 +0800 Subject: [PATCH 2/9] =?UTF-8?q?fix=20=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/chushang/system/controller/UserController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java index 56aba70..40e5788 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java @@ -344,16 +344,15 @@ public class UserController { if(file.isEmpty()){ return AjaxResult.error("文件不能为空"); } - SysUser sysUser = new SysUser(); //查部门 List dept = sysDeptService.getDept(); List role = sysRoleService.getRole(); - try { Workbook workbook = new XSSFWorkbook(file.getInputStream()); Sheet sheet = workbook.getSheetAt(0); DataFormatter format = new DataFormatter(); for (Row row : sheet) { + SysUser sysUser = new SysUser(); HashSet roleIds = new HashSet<>(); if(row.getRowNum()==0)continue; sysUser.setNickName(format.formatCellValue(row.getCell(0))); From c4e6f8fcf2273eff4c19731f71037209472d82fa Mon Sep 17 00:00:00 2001 From: renzexin Date: Thu, 22 Aug 2024 16:49:11 +0800 Subject: [PATCH 3/9] =?UTF-8?q?fix=20=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chushang/system/controller/UserController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java index 40e5788..d61df7c 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java @@ -386,12 +386,16 @@ public class UserController { System.out.println(sysUser); //存库 - save(sysUser); + if(StringUtils.isNotEmpty(sysUser.getPassword())&&StringUtils.isNotEmpty(sysUser.getUsername())){ + save(sysUser); + }else if (StringUtils.isEmpty(sysUser.getPassword())||StringUtils.isEmpty(sysUser.getUsername())){ + log.error("用户名密码不能为空"); + } } } catch (IOException e) { throw new RuntimeException(e); } - return AjaxResult.success(); + return AjaxResult.success("导入成功"); } /** From 39eca08f6d0f47337ba9dc51e0d7e63247607da4 Mon Sep 17 00:00:00 2001 From: renzexin Date: Fri, 23 Aug 2024 10:06:53 +0800 Subject: [PATCH 4/9] =?UTF-8?q?fix=20=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/controller/WrkProjectController.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java index 79c2aee..3fa2cb5 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java @@ -64,6 +64,8 @@ public class WrkProjectController { public AjaxResult list(WrkProject project) { CommonParam commonParam = CommonParam.buildPageRequest(); + List createTimes = project.getCreateTimes(); + project.setCreateTimes(extendTimeRange(createTimes, " 00:00:00", " 23:59:59")); PageResult pageResult = projectService.pageList(project, commonParam); return AjaxResult.success(pageResult); } @@ -292,4 +294,13 @@ public class WrkProjectController { // + private List extendTimeRange(List timeList, String prefix, String suffix) { + if (timeList != null && timeList.size() >= 2) { + String startTime = timeList.get(0) + prefix; + String endTime = timeList.get(1) + suffix; + timeList.set(0, startTime); + timeList.set(1, endTime); + } + return timeList; + } } From 45b3fa35375f74450a110c85ed4c912703501d2c Mon Sep 17 00:00:00 2001 From: renzexin Date: Fri, 23 Aug 2024 10:16:09 +0800 Subject: [PATCH 5/9] =?UTF-8?q?fix=20=E8=A7=92=E8=89=B2=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chushang/system/controller/RoleController.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/RoleController.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/RoleController.java index 8b42c5b..4fc636d 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/RoleController.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/RoleController.java @@ -1,5 +1,6 @@ package com.chushang.system.controller; +import com.chushang.common.core.util.StringUtils; import com.chushang.common.core.web.AjaxResult; import com.chushang.common.log.annotation.SysLog; import com.chushang.common.log.enums.BusinessType; @@ -50,9 +51,12 @@ public class RoleController { @RequestParam(defaultValue = "10") Integer limit // 默认每页条数为10 ) { ListRoleDTO.Params params = new ListRoleDTO.Params(); - params.setBeginTime(beginTime); - params.setEndTime(endTime); - + if(StringUtils.isNotEmpty(beginTime)){ + params.setBeginTime(beginTime+" 00:00:00"); + } + if(StringUtils.isNotEmpty(endTime)){ + params.setEndTime(endTime+" 23:59:59"); + } ListRoleDTO listRole = new ListRoleDTO(); listRole.setRoleName(roleName); listRole.setRoleKey(roleKey); From b96cf66a3eb6a39009ee5b7e2483ba54e43a7b61 Mon Sep 17 00:00:00 2001 From: renzexin Date: Fri, 23 Aug 2024 15:57:23 +0800 Subject: [PATCH 6/9] =?UTF-8?q?fix=20=E6=89=B9=E9=87=8F=E6=B4=BE=E5=8D=95?= =?UTF-8?q?=20=E6=90=9C=E7=B4=A2=E4=B8=9A=E5=8A=A1=E5=91=98=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/SysUserMapper.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysUserMapper.xml b/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysUserMapper.xml index 184257a..ee75be6 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysUserMapper.xml +++ b/chushang-modules/chushang-module-system/system-service/src/main/resources/mapper/SysUserMapper.xml @@ -90,6 +90,10 @@ AND u.username like concat('%',#{listUser.username},'%') + + AND u.nick_name like concat('%',#{listUser.nickName},'%') + + AND d.dept_id = #{listUser.deptId} From 038562f5e4e1e6b38736240cc8edb95073ad6431 Mon Sep 17 00:00:00 2001 From: renzexin Date: Fri, 23 Aug 2024 16:13:50 +0800 Subject: [PATCH 7/9] =?UTF-8?q?fix=20=E5=95=86=E6=88=B7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspection/terminal/query/StoreQuery.java | 2 +- .../terminal/controller/StoreController.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/terminal/query/StoreQuery.java b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/terminal/query/StoreQuery.java index c439553..8ed4c81 100644 --- a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/terminal/query/StoreQuery.java +++ b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/terminal/query/StoreQuery.java @@ -116,7 +116,7 @@ public class StoreQuery extends CommonParam { */ @Condition(name = "create_time", type = Condition.ConditionType.between, tableName = "s") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss") - private List createTime; + private List createTime; /** * 创建时间 diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/terminal/controller/StoreController.java b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/terminal/controller/StoreController.java index 1ba09d4..8627772 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/terminal/controller/StoreController.java +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/terminal/controller/StoreController.java @@ -19,6 +19,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.validation.constraints.NotNull; +import java.util.List; /** * 商户信息表(st_store)表控制层 @@ -47,8 +48,19 @@ public class StoreController { @GetMapping("/page") @RequiresPermissions("ins:store:page") public AjaxResult pageList(@Validated StoreQuery query) { + List createTimes = query.getCreateTime(); + query.setCreateTime(extendTimeRange(createTimes, " 00:00:00", " 23:59:59")); return AjaxResult.success(storeService.pageList(query)); } + private List extendTimeRange(List timeList, String prefix, String suffix) { + if (timeList != null && timeList.size() >= 2) { + String startTime = timeList.get(0) + prefix; + String endTime = timeList.get(1) + suffix; + timeList.set(0, startTime); + timeList.set(1, endTime); + } + return timeList; + } /** * 修改商户 From 6ad30ac09210149093cc840f408ed854baa99e30 Mon Sep 17 00:00:00 2001 From: renzexin Date: Fri, 23 Aug 2024 16:22:29 +0800 Subject: [PATCH 8/9] =?UTF-8?q?fix=20=E9=A0=85=E7=9B=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chushang/inspection/project/query/ProjectQuery.java | 2 +- .../inspection/project/controller/WrkProjectController.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/project/query/ProjectQuery.java b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/project/query/ProjectQuery.java index ab02f2a..0414441 100644 --- a/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/project/query/ProjectQuery.java +++ b/chushang-modules/chushang-module-inspection/inspection-feign/src/main/java/com/chushang/inspection/project/query/ProjectQuery.java @@ -40,7 +40,7 @@ public class ProjectQuery extends CommonParam { */ @Condition(name = "create_time", type = Condition.ConditionType.between,tableName = "wrk_info") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = DatePattern.NORM_DATETIME_PATTERN) - private List createTimes; + private List createTimes; /** * 项目状态 */ diff --git a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java index 3fa2cb5..92cab75 100644 --- a/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java +++ b/chushang-modules/chushang-module-inspection/inspection-service/src/main/java/com/chushang/inspection/project/controller/WrkProjectController.java @@ -186,6 +186,8 @@ public class WrkProjectController { @RequiresPermissions("inspection:project:info") public AjaxResult projectData(ProjectQuery projectQuery) { + List createTimes = projectQuery.getCreateTimes(); + projectQuery.setCreateTimes(extendTimeRange(createTimes, " 00:00:00", " 23:59:59")); return AjaxResult.success(projectService.projectData(projectQuery)); } From 13d13f880590069138b1f7dc23b3bfd6ea5fd6ee Mon Sep 17 00:00:00 2001 From: Chujinwang <17638147107@163.com> Date: Sat, 24 Aug 2024 13:45:47 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=A6=81=E7=94=A8=E5=90=AF=E7=94=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/chushang/system/controller/UserController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java index d61df7c..078f4d5 100644 --- a/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java +++ b/chushang-modules/chushang-module-system/system-service/src/main/java/com/chushang/system/controller/UserController.java @@ -278,7 +278,7 @@ public class UserController { /** * 状态修改 */ - @RequiresPermissions("system:user:changeStatus") +// @RequiresPermissions("system:user:changeStatus") @SysLog(value = "用户状态", businessType = BusinessType.UPDATE) @PutMapping("/changeStatus") public AjaxResult changeStatus(@RequestBody SysUser user) @@ -384,7 +384,6 @@ public class UserController { sysUser.setRoleIds(roleIds); sysUser.setRemark(format.formatCellValue(row.getCell(8))); - System.out.println(sysUser); //存库 if(StringUtils.isNotEmpty(sysUser.getPassword())&&StringUtils.isNotEmpty(sysUser.getUsername())){ save(sysUser);