From b7b60d8b793dd7ea3f6722baf9b8c0cee0e7d2c2 Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Fri, 26 Apr 2024 16:31:51 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=AF=BC=E5=87=BAbug=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zcloud/controller/hiddenApi/HiddenApiController.java | 4 ++-- .../mybatis/datasource/hiddenApi/HiddenApiMapper.xml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java b/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java index a8b87855..61e2004b 100644 --- a/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java +++ b/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java @@ -1052,7 +1052,7 @@ public class HiddenApiController extends BaseController { PageData vpd = new PageData(); vpd.put("var1", i + 1); //1 vpd.put("var2", Tools.isEmpty(varOList.get(i).getString("type1Name")) ? "" : varOList.get(i).getString("type1Name")); //2 - vpd.put("var3", Tools.isEmpty(varOList.get(i).getString("LEVEL")) ? "" : varOList.get(i).getString("LEVEL")); //3 + vpd.put("var3", Tools.isEmpty(varOList.get(i).getString("levelName")) ? "" : varOList.get(i).getString("levelName")); //3 vpd.put("var4", Tools.isEmpty(varOList.get(i).getString("POSITIONDESC")) ? "" : varOList.get(i).getString("POSITIONDESC")); //4 vpd.put("var5", Tools.isEmpty(varOList.get(i).getString("HIDDENDESCR")) ? "" : varOList.get(i).getString("HIDDENDESCR")); //5 vpd.put("var6", Tools.isEmpty(varOList.get(i).getString("RECTIFYDESCR")) ? "" : varOList.get(i).getString("RECTIFYDESCR")); //6 @@ -1062,7 +1062,7 @@ public class HiddenApiController extends BaseController { vpd.put("var10", Tools.isEmpty(varOList.get(i).getString("zgUserName")) ? "" : varOList.get(i).getString("zgUserName")); //10 vpd.put("var11", Tools.isEmpty(varOList.get(i).getString("conUsername")) ? "" : varOList.get(i).getString("conUsername")); //11 vpd.put("var12", Tools.isEmpty(varOList.get(i).getString("INVESTMENT_FUNDS")) ? "" : varOList.get(i).getString("INVESTMENT_FUNDS")); //12 - vpd.put("var13", Tools.isEmpty(varOList.get(i).getString("REVIEWTIME")) ? "" : varOList.get(i).getString("REVIEWTIME")); //13 + vpd.put("var13", Tools.isEmpty(varOList.get(i).getString("CHECK_TIME")) ? "" : varOList.get(i).getString("CHECK_TIME")+" 已完成"); //13 vpd.put("var14", Tools.isEmpty(varOList.get(i).getString("revieworName")) ? "" : varOList.get(i).getString("revieworName")); //14 vpd.put("var15", Tools.isEmpty(varOList.get(i).getString("INSPECTION_USER")) ? varOList.get(i).getString("CREATER_NAME") : varOList.get(i).getString("INSPECTION_USER")); //15 varList.add(vpd); diff --git a/src/main/resources/mybatis/datasource/hiddenApi/HiddenApiMapper.xml b/src/main/resources/mybatis/datasource/hiddenApi/HiddenApiMapper.xml index 81c29a8d..52249217 100644 --- a/src/main/resources/mybatis/datasource/hiddenApi/HiddenApiMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenApi/HiddenApiMapper.xml @@ -863,6 +863,8 @@ GROUP_CONCAT( su.NAME ) AS INSPECTION_USER, c.NAME AS CREATER_NAME, revieworUser.NAME AS revieworName, + bhc.CHECK_TIME, + type2.NAME AS levelName, f.* FROM bus_hidden f @@ -872,7 +874,8 @@ left join oa_department bhuUserDeptD on bhuUserDeptD.DEPARTMENT_ID = bhuUserDept.PARENT_ID left join vi_user_all zgUser on zgUser.user_id = f.RECTIFICATIONOR LEFT JOIN vi_user_all confirmUser on confirmUser.USER_ID = f.CONFIRM_USER - LEFT JOIN vi_user_all revieworUser on revieworUser.USER_ID = f.REVIEWOR + LEFT JOIN bus_hiddencheck bhc ON bhc.HIDDEN_ID = f.HIDDEN_ID + LEFT JOIN vi_user_all revieworUser ON revieworUser.USER_ID = bhc.USER_ID LEFT JOIN bus_hiddencheck hch on hch.HIDDEN_ID = f.HIDDEN_ID left join sys_dictionaries type1 on type1.bianma = f.HIDDENTYPE left join oa_department zgUserDept on zgUserDept.DEPARTMENT_ID = f.RECTIFICATIONDEPT @@ -882,6 +885,7 @@ left join bus_inspection_safetyenvironmental_inspector bi ON bi.INSPECTION_ID = isa.INSPECTION_ID LEFT JOIN vi_user_all su on su.USER_ID = bi.INSPECTION_USER_ID LEFT JOIN vi_user_all c ON c.USER_ID = f.CREATOR + LEFT JOIN sys_dictionaries type2 ON type2.bianma = f.HIDDENLEVEL WHERE f.ISDELETE = '0' and f.STATE not in ('0','7','8','100','101','102') From 809da102073e04e7dd5d20e773e10f6577ce0704 Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Mon, 6 May 2024 10:41:39 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E9=87=8D=E7=82=B9=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/dsno2/keyProjects/PersonnelManagementMapper.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/mybatis/dsno2/keyProjects/PersonnelManagementMapper.xml b/src/main/resources/mybatis/dsno2/keyProjects/PersonnelManagementMapper.xml index a3728f84..b3b8307e 100644 --- a/src/main/resources/mybatis/dsno2/keyProjects/PersonnelManagementMapper.xml +++ b/src/main/resources/mybatis/dsno2/keyProjects/PersonnelManagementMapper.xml @@ -202,6 +202,9 @@ and f.PTYPE = #{pd.PTYPE} + + and f.UNITS_ID = #{pd.UNITS_ID} + ORDER BY f.OPERATTIME DESC From 6dc35668e7b9095a0fb3e5b0495a8cba5d6a98bb Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Mon, 6 May 2024 15:39:44 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E5=AF=BC=E5=87=BAbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/bus/HiddenExcelController.java | 29 +++++++++++++++++++ .../hiddenApi/HiddenApiController.java | 23 +++++++++++++++ .../datasource/hiddenApi/HiddenApiMapper.xml | 26 +++++++++++++++-- 3 files changed, 76 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zcloud/controller/bus/HiddenExcelController.java b/src/main/java/com/zcloud/controller/bus/HiddenExcelController.java index d33ed894..b03cb86b 100644 --- a/src/main/java/com/zcloud/controller/bus/HiddenExcelController.java +++ b/src/main/java/com/zcloud/controller/bus/HiddenExcelController.java @@ -8,6 +8,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import com.zcloud.entity.Page; +import com.zcloud.entity.system.Department; import com.zcloud.service.hiddenApi.HiddenApiService; import org.apache.commons.lang.StringUtils; import org.apache.logging.log4j.util.Strings; @@ -59,6 +60,10 @@ public class HiddenExcelController extends BaseController { @Autowired private HiddenCheckService hiddenCheckService; + @Autowired + private DepartmentService departmentService; // 部门信息 + + @RequestMapping(value = "/exportExcelToSession") // // @RequiresPermissions("toExcel") @ResponseBody @@ -121,6 +126,30 @@ public class HiddenExcelController extends BaseController { List varList = new ArrayList(); List wertitles = this.setTitles(); + // 增加隐患整改部门查询 开始 + if(StringUtils.isNotBlank(pd.getString("RECTIFICATIONDEPT"))){ + String url ="department_list.html?DEPARTMENT_ID="; + List departments = departmentService.listAllDepartment(pd.getString("RECTIFICATIONDEPT"), url); + List departmentIds = new ArrayList<>(); + departmentIds.add(pd.getString("RECTIFICATIONDEPT")); + for(Department department:departments){ + departmentIds.add(department.getDEPARTMENT_ID()); + } + pd.put("departmentIds",departmentIds); + } + // 增加发现整改部门查询 开始 + if(StringUtils.isNotBlank(pd.getString("creatorUserDept"))){ + String url ="department_list.html?DEPARTMENT_ID="; + List departments = departmentService.listAllDepartment(pd.getString("creatorUserDept"), url); + List departmentIds = new ArrayList<>(); + departmentIds.add(pd.getString("creatorUserDept")); + for(Department department:departments){ + departmentIds.add(department.getDEPARTMENT_ID()); + } + pd.put("creatorUserDepts",departmentIds); + } + + // 增加隐患发现部门查询 结束 List hiddenListAll = getHiddenList(pd);// 获取 隐患数据 /** diff --git a/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java b/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java index 61e2004b..3486215d 100644 --- a/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java +++ b/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java @@ -1046,6 +1046,29 @@ public class HiddenApiController extends BaseController { titles.add("复查人"); //14 titles.add("检查人员"); //15 dataMap.put("titles", titles); + // 增加隐患整改部门查询 开始 + if(StringUtils.isNotBlank(pd.getString("RECTIFICATIONDEPT"))){ + String url ="department_list.html?DEPARTMENT_ID="; + List departments = departmentService.listAllDepartment(pd.getString("RECTIFICATIONDEPT"), url); + List departmentIds = new ArrayList<>(); + departmentIds.add(pd.getString("RECTIFICATIONDEPT")); + for(Department department:departments){ + departmentIds.add(department.getDEPARTMENT_ID()); + } + pd.put("departmentIds",departmentIds); + } + // 增加发现整改部门查询 开始 + if(StringUtils.isNotBlank(pd.getString("creatorUserDept"))){ + String url ="department_list.html?DEPARTMENT_ID="; + List departments = departmentService.listAllDepartment(pd.getString("creatorUserDept"), url); + List departmentIds = new ArrayList<>(); + departmentIds.add(pd.getString("creatorUserDept")); + for(Department department:departments){ + departmentIds.add(department.getDEPARTMENT_ID()); + } + pd.put("creatorUserDepts",departmentIds); + } + List varOList = hiddenApiService.listForExcel(pd); List varList = new ArrayList(); for(int i=0;i and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = hfu.USER_ID - where user.DEPARTMENT_ID = #{creatorUserDept} ) + where user.DEPARTMENT_ID in + + #{item} + + ) and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = hfu.USER_ID @@ -666,6 +670,13 @@ and f.STATE = '2' and (select count(1) from BUS_HIDDENCHECK bh where bh.HIDDEN_ID=f.HIDDEN_ID and bh.USER_ID=#{checkUser} )>0 + + AND + f.RECTIFICATIONDEPT IN + + #{item} + + GROUP BY f.HIDDEN_ID order by FIELD ( f.STATE, '-2' ) desc, f.DISCOVERYTIME desc @@ -922,7 +933,11 @@ and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = hfu.USER_ID - where user.DEPARTMENT_ID = #{creatorUserDept} ) + where user.DEPARTMENT_ID in + + #{item} + + ) and f.HIDDEN_ID in (select hfu.HIDDEN_ID from BUS_HIDDEN_USER hfu LEFT JOIN sys_user user on user.USER_ID = hfu.USER_ID @@ -992,6 +1007,13 @@ and f.STATE = '2' and (select count(1) from BUS_HIDDENCHECK bh where bh.HIDDEN_ID=f.HIDDEN_ID and bh.USER_ID=#{checkUser} )>0 + + AND + f.RECTIFICATIONDEPT IN + + #{item} + + GROUP BY f.HIDDEN_ID order by FIELD ( f.STATE, '-2' ) desc, f.DISCOVERYTIME desc From bb6c7d83619530e20584636e658ef18d2718c24b Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Tue, 7 May 2024 11:26:03 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E9=9A=90=E6=82=A3=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=86=85=E5=AE=B9=E5=B9=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hiddenApi/HiddenApiController.java | 15 ++++++++++++++- .../datasource/hiddenApi/HiddenApiMapper.java | 3 +++ .../service/hiddenApi/HiddenApiService.java | 2 ++ .../hiddenApi/impl/HiddenApiServiceImpl.java | 16 ++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java b/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java index 3486215d..6188c3a9 100644 --- a/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java +++ b/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java @@ -1771,10 +1771,23 @@ public class HiddenApiController extends BaseController { PageData pd = new PageData(); pd = this.getPageData(); if (pd.get("YEAR").equals("")){ - pd.put("YEAR","2024"); + String year = DateUtil.getYear(); + pd.put("YEAR",year); } List dataList = hiddenApiService.goSummaryTable(pd); + List dataTypeList = hiddenApiService.goSummaryTypeTable(pd); List varList = hiddenApiService.dealData(dataList); + List varTypeList = hiddenApiService.dealData(dataTypeList); + for(PageData pdDate:varList){ + for(PageData pdTypeDate:varTypeList){ + if(pdDate.getString("MONTH").equals(pdTypeDate.getString("MONTH"))){ + pdDate.put("wdbaqztCount",pdTypeDate.getString("wdbaqztCount")); + pdDate.put("gldqxCount",pdTypeDate.getString("gldqxCount")); + pdDate.put("hjdbaqysCount",pdTypeDate.getString("hjdbaqysCount")); + pdDate.put("rdbaqysCount",pdTypeDate.getString("rdbaqysCount")); + } + } + } map.put("varList", varList); map.put("result", errInfo); return map; diff --git a/src/main/java/com/zcloud/mapper/datasource/hiddenApi/HiddenApiMapper.java b/src/main/java/com/zcloud/mapper/datasource/hiddenApi/HiddenApiMapper.java index 92de566b..9d216829 100644 --- a/src/main/java/com/zcloud/mapper/datasource/hiddenApi/HiddenApiMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/hiddenApi/HiddenApiMapper.java @@ -87,5 +87,8 @@ public interface HiddenApiMapper { List goSummaryTable(PageData pd); List listForExcel(PageData pd); + + List goSummaryTypeTable(PageData pd); + } diff --git a/src/main/java/com/zcloud/service/hiddenApi/HiddenApiService.java b/src/main/java/com/zcloud/service/hiddenApi/HiddenApiService.java index 555bdd7c..fd5757d9 100644 --- a/src/main/java/com/zcloud/service/hiddenApi/HiddenApiService.java +++ b/src/main/java/com/zcloud/service/hiddenApi/HiddenApiService.java @@ -111,5 +111,7 @@ public interface HiddenApiService { public List dealData (List pd) throws Exception; public List listForExcel (PageData pd) throws Exception; + + public List goSummaryTypeTable (PageData pd) throws Exception; } diff --git a/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenApiServiceImpl.java b/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenApiServiceImpl.java index bba2bf79..f12a0576 100644 --- a/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenApiServiceImpl.java +++ b/src/main/java/com/zcloud/service/hiddenApi/impl/HiddenApiServiceImpl.java @@ -281,6 +281,17 @@ public class HiddenApiServiceImpl implements HiddenApiService{ return hiddenApiMapper.listForExcel(pd); } + /** + * 根据类型获取统计数据 + * @param pd + * @return + * @throws Exception + */ + @Override + public List goSummaryTypeTable(PageData pd) throws Exception { + return hiddenApiMapper.goSummaryTypeTable(pd); + } + public List dealData (List pdList) throws Exception{ ArrayList varList = new ArrayList<>(); PageData pd1 = new PageData(); @@ -372,6 +383,11 @@ public class HiddenApiServiceImpl implements HiddenApiService{ pd.put("TOTAL_COUNT_OTHER",pageData.getString("TOTAL_COUNT")); pd.put("REVISED_COUNT_OTHER",pageData.getString("REVISED_COUNT")); pd.put("COMPLERATE_OTHER",pageData.getString("COMPLERATE")); + }else { + pd.put("wdbaqztCount",pageData.getString("wdbaqztCount")); + pd.put("gldqxCount",pageData.getString("gldqxCount")); + pd.put("hjdbaqysCount",pageData.getString("hjdbaqysCount")); + pd.put("rdbaqysCount",pageData.getString("rdbaqysCount")); } pd.put("CREATE_MONTH",pageData.getString("CREATE_MONTH")); return pd; From 7806353850c350a8289727cf54034cd2f02721a9 Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Tue, 7 May 2024 11:26:47 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0sql=E6=8C=89=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datasource/hiddenApi/HiddenApiMapper.xml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/src/main/resources/mybatis/datasource/hiddenApi/HiddenApiMapper.xml b/src/main/resources/mybatis/datasource/hiddenApi/HiddenApiMapper.xml index bd650ae8..cd2c5bb1 100644 --- a/src/main/resources/mybatis/datasource/hiddenApi/HiddenApiMapper.xml +++ b/src/main/resources/mybatis/datasource/hiddenApi/HiddenApiMapper.xml @@ -1018,6 +1018,69 @@ order by FIELD ( f.STATE, '-2' ) desc, f.DISCOVERYTIME desc + + + From 9dd87ae260526c92d917d971c88666a28c0b4c0d Mon Sep 17 00:00:00 2001 From: zhaoyu Date: Tue, 7 May 2024 14:36:02 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E6=B6=88=E9=98=B2=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mybatis/datasource/firemanager/FirePonitMapper.xml | 10 +++++++++- .../datasource/firemanager/FireRecordMapper.xml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mybatis/datasource/firemanager/FirePonitMapper.xml b/src/main/resources/mybatis/datasource/firemanager/FirePonitMapper.xml index c8cbbf51..8ab49429 100644 --- a/src/main/resources/mybatis/datasource/firemanager/FirePonitMapper.xml +++ b/src/main/resources/mybatis/datasource/firemanager/FirePonitMapper.xml @@ -115,7 +115,8 @@ IFNULL( t.DEVICE_COUNT, 0 ) DEVICE_COUNT, d.`NAME` AS DEPARTMENT_NAME, u.`NAME` AS USERNAME, - r.FIRE_REGION_NAME + r.FIRE_REGION_NAME, + fp.FIRE_POINT_ID as POINT FROM bus_fire_point AS p LEFT JOIN bus_fire_qualified_photos fqp ON p.QUALIFIED_PHOTOS_ID = fqp.QUALIFIED_PHOTOS_ID @@ -123,6 +124,13 @@ LEFT JOIN ( SELECT count( FIRE_DEVICE_ID ) DEVICE_COUNT, FIRE_POINT_ID FROM bus_fire_device WHERE ISDELETE = 0 GROUP BY FIRE_POINT_ID ) t ON t.FIRE_POINT_ID = p.FIRE_POINT_ID LEFT JOIN sys_user AS u ON p.USER_ID = u.USER_ID LEFT JOIN oa_department AS d ON p.DEPARTMENT_ID = d.DEPARTMENT_ID + LEFT JOIN (SELECT DISTINCT + f.FIRE_POINT_ID + FROM + `bus_fire_device` f + LEFT JOIN bus_fire_device_prepared p ON f.FIRE_DEVICE_ID = p.FIRE_DEVICE_ID + WHERE + f.ISDELETE = '0') fp on fp.FIRE_POINT_ID = p.FIRE_POINT_ID WHERE r.CORPINFO_ID = #{pd.CORPINFO_ID} AND r.ISDELETE = 0 diff --git a/src/main/resources/mybatis/datasource/firemanager/FireRecordMapper.xml b/src/main/resources/mybatis/datasource/firemanager/FireRecordMapper.xml index 1c3b0c5d..6cf3beb4 100644 --- a/src/main/resources/mybatis/datasource/firemanager/FireRecordMapper.xml +++ b/src/main/resources/mybatis/datasource/firemanager/FireRecordMapper.xml @@ -897,7 +897,7 @@ GROUP BY FIRE_CHECK_ID - order by fr. CREATTIME + order by temp.FINISHED,fr. CREATTIME