From 6937054d440079d8164f5251210bf30bea243716 Mon Sep 17 00:00:00 2001 From: limingyu Date: Fri, 15 Dec 2023 13:59:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E5=85=AC=E5=8F=B8=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E7=AB=AF=E9=A9=BE=E9=A9=B6=E8=88=B1=E5=8D=B1=E9=99=A9=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E7=BB=9F=E8=AE=A1=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/HomeHighRiskWorkController.java | 22 +- .../highriskwork/HighWorkMapper.java | 12 + .../service/highriskwork/HighWorkService.java | 24 + .../impl/HighWorkServiceImpl.java | 21 + .../highriskwork/HighWorkMapper.xml | 515 ++++++++++++++++++ 5 files changed, 591 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zcloud/controller/home/HomeHighRiskWorkController.java b/src/main/java/com/zcloud/controller/home/HomeHighRiskWorkController.java index c30e063c..71ddef6f 100644 --- a/src/main/java/com/zcloud/controller/home/HomeHighRiskWorkController.java +++ b/src/main/java/com/zcloud/controller/home/HomeHighRiskWorkController.java @@ -11,6 +11,7 @@ import com.zcloud.service.system.DepartmentService; import com.zcloud.service.system.DictionariesService; import com.zcloud.service.system.UsersService; import com.zcloud.util.Jurisdiction; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -48,7 +49,12 @@ public class HomeHighRiskWorkController extends BaseController { /*风险管控 数据统计*/ //获取高危作业统计数据(申请数[COUNTAPPLY],审批中[COUNTAPPROVE],归档[COUNTARCHIVE]) - PageData data = highworkService.statisticsHighRiskWorkByState(pd); + PageData data = new PageData(); + if (StringUtils.equals("035958e685cf4850bc40151c5e0617a6",pd.getString("CORPINFO_ID"))) { //一公司 + data = highworkService.statisticsHighRiskWorkByStateFirst(pd); + } else { + data = highworkService.statisticsHighRiskWorkByState(pd); + } map.put("pd", data); map.put("result", errInfo); @@ -70,7 +76,12 @@ public class HomeHighRiskWorkController extends BaseController { pd = this.getPageData(); pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); // 企业 page.setPd(pd); - List varList = highworkService.listHighRiskWork(page); + List varList = new ArrayList<>(); + if (StringUtils.equals("035958e685cf4850bc40151c5e0617a6",pd.getString("CORPINFO_ID"))) { // 一公司 + varList = highworkService.listHighRiskWorkFirst(page); + } else { + varList = highworkService.listHighRiskWork(page); + } map.put("varList", varList); map.put("result", errInfo); return map; @@ -93,7 +104,12 @@ public class HomeHighRiskWorkController extends BaseController { Map chartData = new HashMap(); List legendData = Arrays.asList(new String[]{"动火作业", "临时用电作业", "盲板作业", "高处作业", "有限空间作业", "吊装作业"}); - List workChart = highworkService.statisticsAllHighRiskWork(pd); //统计高危作业里各作业数 + List workChart = new ArrayList<>(); + if (StringUtils.equals("035958e685cf4850bc40151c5e0617a6",pd.getString("CORPINFO_ID"))) { //一公司 + workChart = highworkService.statisticsAllHighRiskWorkFirst(pd); //统计高危作业里各作业数 + } else { + workChart = highworkService.statisticsAllHighRiskWork(pd); //统计高危作业里各作业数 + } List seriesData = new ArrayList(); for (int i = 0; i < legendData.size(); i++) { PageData pie = new PageData(); diff --git a/src/main/java/com/zcloud/mapper/datasource/highriskwork/HighWorkMapper.java b/src/main/java/com/zcloud/mapper/datasource/highriskwork/HighWorkMapper.java index 092cbf84..7cc81fa2 100644 --- a/src/main/java/com/zcloud/mapper/datasource/highriskwork/HighWorkMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/highriskwork/HighWorkMapper.java @@ -100,5 +100,17 @@ public interface HighWorkMapper{ List listAllHighRiskWorkLocation(PageData pd); void editacceptancapplication(PageData pd); + + List listHighRiskWorkFirst(Page page); + + PageData statisticsHighRiskWorkByStateFirst(PageData pd); + + /** + * 统计高危作业里各作业数(一公司) + * @param pd + * @return + * @throws Exception + */ + List statisticsAllHighRiskWorkFirst(PageData pd); } diff --git a/src/main/java/com/zcloud/service/highriskwork/HighWorkService.java b/src/main/java/com/zcloud/service/highriskwork/HighWorkService.java index efb6cfe7..635369d9 100644 --- a/src/main/java/com/zcloud/service/highriskwork/HighWorkService.java +++ b/src/main/java/com/zcloud/service/highriskwork/HighWorkService.java @@ -103,5 +103,29 @@ public interface HighWorkService{ * @throws Exception */ List listAllHighRiskWorkLocation(PageData pd)throws Exception; + + /** + * 作业实时情况展示(一公司) + * @param page + * @return + * @throws Exception + */ + List listHighRiskWorkFirst(Page page)throws Exception; + + /** + * 获取高危作业统计数据(申请数[COUNTAPPLY],审批中[COUNTAPPROVE],归档[COUNTARCHIVE])(一公司) + * @param pd + * @return + * @throws Exception + */ + PageData statisticsHighRiskWorkByStateFirst(PageData pd)throws Exception; + + /** + * 统计高危作业里各作业数(一公司) + * @param pd + * @return + * @throws Exception + */ + List statisticsAllHighRiskWorkFirst(PageData pd)throws Exception; } diff --git a/src/main/java/com/zcloud/service/highriskwork/impl/HighWorkServiceImpl.java b/src/main/java/com/zcloud/service/highriskwork/impl/HighWorkServiceImpl.java index 15fd4ce5..11068f77 100644 --- a/src/main/java/com/zcloud/service/highriskwork/impl/HighWorkServiceImpl.java +++ b/src/main/java/com/zcloud/service/highriskwork/impl/HighWorkServiceImpl.java @@ -176,5 +176,26 @@ public class HighWorkServiceImpl implements HighWorkService { public List listAllHighRiskWorkLocation(PageData pd) throws Exception { return highworkMapper.listAllHighRiskWorkLocation(pd); } + + @Override + public List listHighRiskWorkFirst(Page page) throws Exception { + return highworkMapper.listHighRiskWorkFirst(page); + } + + @Override + public PageData statisticsHighRiskWorkByStateFirst(PageData pd) throws Exception { + return highworkMapper.statisticsHighRiskWorkByStateFirst(pd); + } + + /** + * 统计高危作业里各作业数(一公司) + * @param pd + * @return + * @throws Exception + */ + @Override + public List statisticsAllHighRiskWorkFirst(PageData pd) throws Exception { + return highworkMapper.statisticsAllHighRiskWorkFirst(pd); + } } diff --git a/src/main/resources/mybatis/datasource/highriskwork/HighWorkMapper.xml b/src/main/resources/mybatis/datasource/highriskwork/HighWorkMapper.xml index 8851147b..aa62c068 100644 --- a/src/main/resources/mybatis/datasource/highriskwork/HighWorkMapper.xml +++ b/src/main/resources/mybatis/datasource/highriskwork/HighWorkMapper.xml @@ -877,4 +877,519 @@ ) f + + + + + + +