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 a8b87855..6188c3a9 100644 --- a/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java +++ b/src/main/java/com/zcloud/controller/hiddenApi/HiddenApiController.java @@ -1046,13 +1046,36 @@ 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 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; 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 + + + 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