From f81142913f84c597540072127e3358b86f66ef8d Mon Sep 17 00:00:00 2001 From: liukewei Date: Wed, 24 Jan 2024 10:44:29 +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 --- .../ehs/EhsIndexStatisticsController.java | 11 ++++++++++- .../controller/ehs/EhsMyMessageController.java | 2 +- .../ehs/EhsNoticeMessageController.java | 4 +++- .../mapper/EhsIndexStatisticsMapper.java | 1 + .../service/EhsIndexStatisticsService.java | 1 + .../impl/EhsIndexStatisticsServiceImpl.java | 15 +++++++++++++++ .../com/ruoyi/ehsMaterial/domain/EhsMaterial.java | 2 ++ .../service/impl/EhsMyMessageServiceImpl.java | 7 ++++--- .../ehsRisk/service/impl/EhsRiskServiceImpl.java | 4 ++++ .../mapper/ehs/EhsIndexStatisticsMapper.xml | 15 +++++++++++++++ .../resources/mapper/ehs/EhsMaterialMapper.xml | 5 +++-- .../resources/mapper/ehs/EhsMyMessageMapper.xml | 2 +- .../mapper/ehs/EhsNoticeMessageMapper.xml | 2 +- .../main/resources/mapper/ehs/EhsRiskMapper.xml | 1 - ruoyi-ui/src/api/ehs/ehsExamples.js | 9 ++++++++- ruoyi-ui/src/layout/components/Navbar.vue | 6 +++--- ruoyi-ui/src/views/ehs/ehsExamples/index.vue | 12 ++++++------ ruoyi-ui/src/views/ehs/ehsExamples/indexHD.vue | 2 +- ruoyi-ui/src/views/ehs/ehsMaterial/index.vue | 10 ++++++---- ruoyi-ui/src/views/ehs/ehsRisk/index.vue | 13 +++++++------ 20 files changed, 92 insertions(+), 32 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsIndexStatisticsController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsIndexStatisticsController.java index b3ca15f..0f787e7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsIndexStatisticsController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsIndexStatisticsController.java @@ -181,5 +181,14 @@ public class EhsIndexStatisticsController extends BaseController { } return AjaxResult.success(row); } - + /** + * 隐患类型分析统计 + */ + @ApiOperation("隐患整改进度分析统计") + @GetMapping("/getHiddenDangerStatusMapList") + public AjaxResult getHiddenDangerStatusMapList() + { + List> list = ehsIndexStatisticsService.getHiddenDangerStatusMapList(); + return AjaxResult.success(list); + } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java index 1197477..9fcf4ca 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMyMessageController.java @@ -229,7 +229,7 @@ public class EhsMyMessageController extends BaseController String myMsgType ="m"+classFirst.toString(); ehsMaterial.setIsSendQuantity(1); List list = ehsMaterialService.selectEhsMaterialList(ehsMaterial); - String[] MaterialIds = list.stream().map(item -> item.getMaterialId().toString()).toArray(String[]::new); + String[] MaterialIds = list.stream().map(item -> item.getMaterialDetailId().toString()).toArray(String[]::new); String strmIds = StringUtils.join(MaterialIds,","); EhsMyMessage ehsMyMessage = new EhsMyMessage(); ehsMyMessage.setMyMessageType(myMsgType); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageController.java index aed01c1..9718089 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsNoticeMessageController.java @@ -209,7 +209,9 @@ public class EhsNoticeMessageController extends BaseController EhsMyMessage msgNew = new EhsMyMessage(); msgNew.setMyMessageKey(noticeMessageId.toString()); msgNew.setMyMessageState("Y"); - ehsMyMessageService.saveMyMessage(msgNew); + msgNew.setMyUserId(SecurityUtils.getUserId()); + msgNew.setMyMessageType("1"); + ehsMyMessageService.updatebyKeyUserId(msgNew); return success(ehsNoticeMessage); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/mapper/EhsIndexStatisticsMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/mapper/EhsIndexStatisticsMapper.java index cdb1a1c..ebf38d8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/mapper/EhsIndexStatisticsMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/mapper/EhsIndexStatisticsMapper.java @@ -25,5 +25,6 @@ public interface EhsIndexStatisticsMapper { List> geteconomicTypeMapList(@Param("deptId") Long deptId); List> getenterpriseScaleMapList(@Param("deptId") Long deptId); List> getHiddenDangerTypeMapList(@Param("deptId") Long deptId); + List> getHiddenDangerStatusMapList(@Param("deptId") Long deptId); List> getHiddenDangerDataMapList(@Param("yearStr") String yearStr,@Param("deptId") Long deptId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/service/EhsIndexStatisticsService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/service/EhsIndexStatisticsService.java index 22a5243..1620c4f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/service/EhsIndexStatisticsService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/service/EhsIndexStatisticsService.java @@ -35,4 +35,5 @@ public interface EhsIndexStatisticsService { List> getenterpriseScaleMapList(); List> getHiddenDangerTypeMapList(); List> getHiddenDangerDataMapList(String yearStr); + List> getHiddenDangerStatusMapList( ); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/service/impl/EhsIndexStatisticsServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/service/impl/EhsIndexStatisticsServiceImpl.java index 0f6fbe5..d313e88 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/service/impl/EhsIndexStatisticsServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsIndexStatistics/service/impl/EhsIndexStatisticsServiceImpl.java @@ -172,4 +172,19 @@ public class EhsIndexStatisticsServiceImpl implements EhsIndexStatisticsService } return mapper.getHiddenDangerDataMapList(yearStr,deptId); } + + @Override + public List> getHiddenDangerStatusMapList() { + Long deptId = null; + // 如果登录用户不是超级管理员,并且他的部门不是唐河县应急管理局(根节点),那么只能查询当前登录用户他的部门创建的公文 + SysUser currentUser = SecurityUtils.getLoginUser().getUser(); + List roleIds = currentUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()); + Long deptParentId = currentUser.getDept().getParentId(); + if (!roleIds.contains(1L) && + deptParentId != null && + deptParentId.longValue() != 0) { + deptId = currentUser.getDept().getDeptId().longValue(); + } + return mapper.getHiddenDangerStatusMapList(deptId); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/domain/EhsMaterial.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/domain/EhsMaterial.java index de85c0f..fb61907 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/domain/EhsMaterial.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/domain/EhsMaterial.java @@ -71,5 +71,7 @@ public class EhsMaterial extends BaseEntity private String sendQuantity; @TableField(exist = false) private Integer isSendQuantity; + @TableField(exist = false) + private Long materialDetailId; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/impl/EhsMyMessageServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/impl/EhsMyMessageServiceImpl.java index 5e98e20..b5e5b44 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/impl/EhsMyMessageServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMyMessage/service/impl/EhsMyMessageServiceImpl.java @@ -78,11 +78,12 @@ public class EhsMyMessageServiceImpl extends ServiceImpl impl @Override public List selectEhsRiskList(EhsRisk ehsRisk) { + if(SecurityUtils.getLoginUser().getUser().getDept().getParentId()!=null && + SecurityUtils.getLoginUser().getUser().getDept().getParentId().longValue()!=0) { + ehsRisk.setDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId().longValue()); + } return ehsRiskMapper.selectEhsRiskList(ehsRisk); } /** diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsIndexStatisticsMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsIndexStatisticsMapper.xml index 93409c2..228bdf4 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsIndexStatisticsMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsIndexStatisticsMapper.xml @@ -225,6 +225,21 @@ SELECT GROUP BY e.hidden_danger_type +