From ac3d2c5726c4d7af70bfe8860abc927f8428119d Mon Sep 17 00:00:00 2001 From: liukewei Date: Mon, 5 Feb 2024 17:33:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B4=AF=E8=AE=A1=E8=B7=9F=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ehs/EhsDocumentController.java | 6 +- .../ehs/EhsHiddenDangerController.java | 6 +- .../controller/system/SysUserController.java | 8 ++ .../common/core/domain/entity/SysDept.java | 11 ++ .../mapper/EhsDocTransferMapper.java | 2 +- .../service/IEhsDocTransferService.java | 2 +- .../impl/EhsDocTransferServiceImpl.java | 2 +- .../service/impl/EhsDocumentServiceImpl.java | 8 +- .../ehsMaterial/mapper/EhsMaterialMapper.java | 1 + .../service/IEhsMaterialService.java | 2 +- .../service/impl/EhsMaterialServiceImpl.java | 8 +- .../mapper/ehs/EhsDocumentMapper.xml | 5 +- .../mapper/ehs/EhsMaterialMapper.xml | 35 ++++- .../resources/mapper/system/SysDeptMapper.xml | 12 +- ruoyi-ui/src/api/system/user.js | 8 ++ ruoyi-ui/src/components/FileUpload/index.vue | 2 +- ruoyi-ui/src/views/ehs/ehsDocument/index.vue | 29 +++- .../src/views/ehs/ehsEnterprise/index.vue | 8 +- .../views/ehs/ehsFloodDroughtTeam/index.vue | 5 +- .../views/ehs/ehsFloodDroughtWorker/index.vue | 3 +- .../src/views/ehs/ehsHiddenDanger/index.vue | 10 +- .../src/views/ehs/ehsLawEnforce/index.vue | 131 +++++++++++------- ruoyi-ui/src/views/ehs/ehsMaterial/index.vue | 12 +- .../src/views/ehs/ehsRescueTeam/index.vue | 3 +- .../views/ehs/ehsRescueTeamWorker/index.vue | 2 +- ruoyi-ui/src/views/ehs/ehsRisk/index.vue | 12 +- ruoyi-ui/src/views/login.vue | 6 +- ruoyi-ui/src/views/system/dept/index.vue | 43 +++++- ruoyi-ui/src/views/system/user/index.vue | 28 +++- 29 files changed, 304 insertions(+), 106 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocumentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocumentController.java index 9943252..1957eb5 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocumentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsDocumentController.java @@ -147,8 +147,8 @@ public class EhsDocumentController extends BaseController { @Transactional @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { - ehsDocumentService.removeByIds(Arrays.asList(ids)); - boolean result = transferService.removeByDocumentIds(Arrays.asList(ids)); - return toAjax(result); + + int result = transferService.removeByDocumentIds(Arrays.asList(ids)); + return toAjax(ehsDocumentService.removeByIds(Arrays.asList(ids))); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsHiddenDangerController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsHiddenDangerController.java index de7f0c1..b9f9368 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsHiddenDangerController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsHiddenDangerController.java @@ -188,8 +188,12 @@ public class EhsHiddenDangerController extends BaseController ehsMyMessage.setMyUserId(SecurityUtils.getUserId()); EhsMyMessage msg = ehsMyMessageService.selectEhsMyMessageByMyMessageMax(ehsMyMessage); boolean isNew =false; + if(ehsHiddenDanger == null){ + ehsMyMessage.setMyMessageDesc(""); + return success(ehsMyMessage); + } if(msg==null ){ - if(StringUtils.isNotEmpty(ehsHiddenDanger.getOverTimeId())) + if(ehsHiddenDanger!=null && StringUtils.isNotEmpty(ehsHiddenDanger.getOverTimeId())) isNew = true; else isNew = false; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 256367b..af50681 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -248,4 +248,12 @@ public class SysUserController extends BaseController { return success(deptService.selectDeptTreeList(dept)); } + @PreAuthorize("@ss.hasPermi('system:user:list')") + @GetMapping("/deptTreeSelectByDeptType/{deptType}") + public AjaxResult deptTreeSelectByDeptType(@PathVariable("deptType") String deptType) + { + SysDept dept = new SysDept(); + dept.setDeptType(deptType); + return success(deptService.selectDeptTreeList(dept)); + } } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java index c9a11e3..b88562a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java @@ -56,6 +56,17 @@ public class SysDept extends BaseEntity @TableField(exist = false) private String deptIds; + /** 部门分类 */ + private String deptType; + + + public String getDeptType() { + return deptType; + } + + public void setDeptType(String deptType) { + this.deptType = deptType; + } public String getDeptIds() { return deptIds; diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/mapper/EhsDocTransferMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/mapper/EhsDocTransferMapper.java index 0f42a4c..8928cef 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/mapper/EhsDocTransferMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/mapper/EhsDocTransferMapper.java @@ -39,5 +39,5 @@ public interface EhsDocTransferMapper extends BaseMapper { * @param documentIds * @return */ - boolean removeByDocumentIds(List documentIds); + int removeByDocumentIds(List documentIds); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/IEhsDocTransferService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/IEhsDocTransferService.java index 8c831fe..46e8a72 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/IEhsDocTransferService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/IEhsDocTransferService.java @@ -39,5 +39,5 @@ public interface IEhsDocTransferService extends IService { * @param documentIds * @return */ - boolean removeByDocumentIds(List documentIds); + int removeByDocumentIds(List documentIds); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/impl/EhsDocTransferServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/impl/EhsDocTransferServiceImpl.java index bf1aa97..92ad18a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/impl/EhsDocTransferServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocTransfer/service/impl/EhsDocTransferServiceImpl.java @@ -62,7 +62,7 @@ public class EhsDocTransferServiceImpl extends ServiceImpl documentIds) { + public int removeByDocumentIds(List documentIds) { return ehsDocTransferMapper.removeByDocumentIds(documentIds); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java index 70e8d60..bebd262 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java @@ -50,8 +50,12 @@ public class EhsDocumentServiceImpl extends ServiceImpl selectEhsDocumentList(EhsDocument ehsDocument) { // 按部门区分权限,局端没有查询全部的权限 - SysUser currentUser = SecurityUtils.getLoginUser().getUser(); - ehsDocument.setDeptId(currentUser.getDept().getDeptId().longValue()); + /*SysUser currentUser = SecurityUtils.getLoginUser().getUser(); + ehsDocument.setDeptId(currentUser.getDept().getDeptId().longValue());*/ + if(SecurityUtils.getLoginUser().getUser().getDept().getParentId()!=null && + SecurityUtils.getLoginUser().getUser().getDept().getParentId().longValue()!=0) { + ehsDocument.setDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId().longValue()); + } return ehsDocumentMapper.selectEhsDocumentList(ehsDocument); } /*@Override diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/mapper/EhsMaterialMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/mapper/EhsMaterialMapper.java index 06fd7d5..e9ff92a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/mapper/EhsMaterialMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/mapper/EhsMaterialMapper.java @@ -27,4 +27,5 @@ public interface EhsMaterialMapper extends BaseMapper { * @return 物资信息包含 通用应急救援装备”“防汛抗旱应急救援装备”“森林防灭火应急救援装备”“救灾物资”集合 */ public List selectEhsMaterialList(EhsMaterial ehsMaterial); + public List selectEhsMateriallExportList(EhsMaterial ehsMaterial); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/IEhsMaterialService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/IEhsMaterialService.java index 6386543..ddc557d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/IEhsMaterialService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/IEhsMaterialService.java @@ -29,5 +29,5 @@ public interface IEhsMaterialService extends IService { */ public List selectEhsMaterialList(EhsMaterial ehsMaterial); public String importMaterial(List list,String classType, Boolean isUpdateSupport); - + public List selectEhsMateriallExportList(EhsMaterial ehsMaterial); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/impl/EhsMaterialServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/impl/EhsMaterialServiceImpl.java index 6e89273..1824360 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/impl/EhsMaterialServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/impl/EhsMaterialServiceImpl.java @@ -66,7 +66,13 @@ public class EhsMaterialServiceImpl extends ServiceImpl selectEhsMateriallExportList(EhsMaterial ehsMaterial){ + if(SecurityUtils.getLoginUser().getUser().getDept().getParentId()!=null && + SecurityUtils.getLoginUser().getUser().getDept().getParentId().longValue()!=0){ + ehsMaterial.setDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId().longValue()); + } + return ehsMaterialMapper.selectEhsMateriallExportList(ehsMaterial); + } private LambdaQueryWrapper buildQueryWrapper(EhsMaterial query) { Map params = query.getParams(); diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsDocumentMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsDocumentMapper.xml index 73ea733..7fb032e 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsDocumentMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsDocumentMapper.xml @@ -24,15 +24,16 @@ - select id, doc_name, doc_font, draft_dept, doc_type, doc_number, receive_time, status, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_document + select e.*, d.dept_name from ehs_document e + left join sys_dept d on e.dept_id = d.dept_id diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialMapper.xml index abd5619..02da977 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialMapper.xml @@ -36,7 +36,22 @@ on dt.material_id= m.material_id and dt.outbound_user_id is null group by dt.material_id ) a on a.material_id= m.material_id - + + SELECT + m1.class_name_mast class_Second,m2.class_name_sub material_Name, + m.*, d.dept_name, a.send_quantity, a.material_detail_id +FROM + ehs_material m + LEFT JOIN sys_dept d ON m.dept_id = d.dept_id + left join sys_dict_data dict on dict.dict_value=m.class_first and dict.dict_type ='material_class_fast' + left join material_class_master m1 on m1.class_mast_type = m.class_first and m.class_second=m1.class_mast_id + left join material_class_sub m2 on m2.class_mast_id=m.class_second and m2.class_sub_id=m.material_name and m2.class_mast_type=m.class_first + LEFT JOIN ( SELECT GROUP_CONCAT( send_quantity ) send_quantity, m.material_id, material_detail_id + FROM ehs_material m + LEFT JOIN ehs_material_detail dt ON dt.material_id = m.material_id AND dt.outbound_user_id IS NULL + GROUP BY dt.material_id + ) a ON a.material_id = m.material_id + - +