Merge remote-tracking branch 'origin/master' into master
正在显示
6 个修改的文件
包含
134 行增加
和
14 行删除
... | @@ -514,6 +514,8 @@ public class EquipmentController { | ... | @@ -514,6 +514,8 @@ public class EquipmentController { |
514 | String energyLevel = equipmentDTO.getEquipmentInfo().getEnergyLevel();//能耗等级 | 514 | String energyLevel = equipmentDTO.getEquipmentInfo().getEnergyLevel();//能耗等级 |
515 | //Integer isSpecial = equipmentDTO.getEquipmentInfo().getIsSpecial(); | 515 | //Integer isSpecial = equipmentDTO.getEquipmentInfo().getIsSpecial(); |
516 | String isMeterage = equipmentDTO.getEquipmentInfo().getIsMeterage();//是否计量设备 | 516 | String isMeterage = equipmentDTO.getEquipmentInfo().getIsMeterage();//是否计量设备 |
517 | String orderFiled = equipmentDTO.getOrderFiled(); | ||
518 | boolean orderType = equipmentDTO.isOrderType(); | ||
517 | 519 | ||
518 | List<String> equipmentLevelList = null; | 520 | List<String> equipmentLevelList = null; |
519 | Base base = BaseFactory.JOIN().select(EquipmentAsset.class).select(EquipmentInfo.class).select(EquipmentBrand.class).select(EquipmentCategory.class) | 521 | Base base = BaseFactory.JOIN().select(EquipmentAsset.class).select(EquipmentInfo.class).select(EquipmentBrand.class).select(EquipmentCategory.class) |
... | @@ -540,8 +542,12 @@ public class EquipmentController { | ... | @@ -540,8 +542,12 @@ public class EquipmentController { |
540 | .like(StringUtils.isNotEmpty(equipmentCode), "equipment_code", equipmentCode) | 542 | .like(StringUtils.isNotEmpty(equipmentCode), "equipment_code", equipmentCode) |
541 | .eq(StringUtils.isNotEmpty(equipmentStatus), "equipment_status", equipmentStatus) | 543 | .eq(StringUtils.isNotEmpty(equipmentStatus), "equipment_status", equipmentStatus) |
542 | .like(StringUtils.isNotEmpty(installPosition), EquipmentInfo::getInstallPosition, installPosition) | 544 | .like(StringUtils.isNotEmpty(installPosition), EquipmentInfo::getInstallPosition, installPosition) |
543 | .eq(StringUtils.isNotEmpty(equipmentDTO.getEquipmentInfo().getId()), "equipment_info.id", equipmentDTO.getEquipmentInfo().getId()) | 545 | .eq(StringUtils.isNotEmpty(equipmentDTO.getEquipmentInfo().getId()), "equipment_info.id", equipmentDTO.getEquipmentInfo().getId()); |
544 | .orderBy(true,false,"equipment_info.create_time"); | 546 | if (StringUtils.isNotEmpty(orderFiled)) { |
547 | base.orderBy(true,orderType,"equipment_info." + orderFiled); | ||
548 | }else { | ||
549 | base.orderBy(true,false,"equipment_info.create_time"); | ||
550 | } | ||
545 | Page<Map<String, Object>> mapPage = (Page<Map<String, Object>>) base.queryForPage(new Page<>(equipmentDTO.getPageNo(), equipmentDTO.getPageSize())); | 551 | Page<Map<String, Object>> mapPage = (Page<Map<String, Object>>) base.queryForPage(new Page<>(equipmentDTO.getPageNo(), equipmentDTO.getPageSize())); |
546 | 552 | ||
547 | // 转义 | 553 | // 转义 | ... | ... |
... | @@ -19,8 +19,9 @@ public class EquipmentDTO { | ... | @@ -19,8 +19,9 @@ public class EquipmentDTO { |
19 | private EquipmentAsset equipmentAsset = new EquipmentAsset(); | 19 | private EquipmentAsset equipmentAsset = new EquipmentAsset(); |
20 | private EquipmentInfo equipmentInfo = new EquipmentInfo(); | 20 | private EquipmentInfo equipmentInfo = new EquipmentInfo(); |
21 | private List<EquipmentInfoExtParam> equipmentInfoExtParams = new ArrayList<EquipmentInfoExtParam>(); | 21 | private List<EquipmentInfoExtParam> equipmentInfoExtParams = new ArrayList<EquipmentInfoExtParam>(); |
22 | |||
23 | private Long pageNo = 1L; | 22 | private Long pageNo = 1L; |
24 | private Long pageSize = 10L; | 23 | private Long pageSize = 10L; |
24 | private String orderFiled;//排序字段 | ||
25 | private boolean orderType;//排序类型,true:升序,false:降序 | ||
25 | 26 | ||
26 | } | 27 | } | ... | ... |
... | @@ -158,7 +158,7 @@ public class InspectionAnalysisController { | ... | @@ -158,7 +158,7 @@ public class InspectionAnalysisController { |
158 | @GetMapping("/getInspectionTaskIndicators") | 158 | @GetMapping("/getInspectionTaskIndicators") |
159 | public Result<InspectionTaskIndicatorsVO> getInspectionTaskIndicators(String startDate,String endDate){ | 159 | public Result<InspectionTaskIndicatorsVO> getInspectionTaskIndicators(String startDate,String endDate){ |
160 | Result<InspectionTaskIndicatorsVO> result = new Result<>(); | 160 | Result<InspectionTaskIndicatorsVO> result = new Result<>(); |
161 | InspectionTaskIndicatorsVO inspectionTaskIndicatorsVO = inspectionAnalysisService.getInspectionTaskIndicators(startDate,endDate); | 161 | InspectionTaskIndicatorsVO inspectionTaskIndicatorsVO = inspectionAnalysisService.getInspectionTaskIndicatorsNew(startDate,endDate); |
162 | result.setSuccess(true); | 162 | result.setSuccess(true); |
163 | result.setResult(inspectionTaskIndicatorsVO); | 163 | result.setResult(inspectionTaskIndicatorsVO); |
164 | return result; | 164 | return result; |
... | @@ -188,7 +188,7 @@ public class InspectionAnalysisController { | ... | @@ -188,7 +188,7 @@ public class InspectionAnalysisController { |
188 | @GetMapping("/getInspectionTaskOverview") | 188 | @GetMapping("/getInspectionTaskOverview") |
189 | public Result<InspectionTaskOverviewVO> getInspectionTaskOverview(String startDate, String endDate){ | 189 | public Result<InspectionTaskOverviewVO> getInspectionTaskOverview(String startDate, String endDate){ |
190 | Result<InspectionTaskOverviewVO> result = new Result<>(); | 190 | Result<InspectionTaskOverviewVO> result = new Result<>(); |
191 | InspectionTaskOverviewVO inspectionTaskIndicatorVO = inspectionAnalysisService.getInspectionTaskOverview(startDate,endDate); | 191 | InspectionTaskOverviewVO inspectionTaskIndicatorVO = inspectionAnalysisService.getInspectionTaskOverviewNew(startDate,endDate); |
192 | result.setSuccess(true); | 192 | result.setSuccess(true); |
193 | result.setResult(inspectionTaskIndicatorVO); | 193 | result.setResult(inspectionTaskIndicatorVO); |
194 | return result; | 194 | return result; |
... | @@ -221,7 +221,7 @@ public class InspectionAnalysisController { | ... | @@ -221,7 +221,7 @@ public class InspectionAnalysisController { |
221 | @GetMapping("/getInspectionEquipIndicators") | 221 | @GetMapping("/getInspectionEquipIndicators") |
222 | public Result<InspectionEquipIndicatorsVO> getInspectionEquipIndicators(String startDate, String endDate){ | 222 | public Result<InspectionEquipIndicatorsVO> getInspectionEquipIndicators(String startDate, String endDate){ |
223 | Result<InspectionEquipIndicatorsVO> result = new Result<>(); | 223 | Result<InspectionEquipIndicatorsVO> result = new Result<>(); |
224 | InspectionEquipIndicatorsVO inspectionEquipIndicatorsVO = inspectionAnalysisService.getInspectionEquipIndicators(startDate,endDate); | 224 | InspectionEquipIndicatorsVO inspectionEquipIndicatorsVO = inspectionAnalysisService.getInspectionEquipIndicatorsNew(startDate,endDate); |
225 | result.setSuccess(true); | 225 | result.setSuccess(true); |
226 | result.setResult(inspectionEquipIndicatorsVO); | 226 | result.setResult(inspectionEquipIndicatorsVO); |
227 | return result; | 227 | return result; |
... | @@ -251,7 +251,7 @@ public class InspectionAnalysisController { | ... | @@ -251,7 +251,7 @@ public class InspectionAnalysisController { |
251 | @GetMapping("/getInspectionEquipOverview") | 251 | @GetMapping("/getInspectionEquipOverview") |
252 | public Result<InspectionEquipOverviewVO> getInspectionEquipOverview(String startDate, String endDate){ | 252 | public Result<InspectionEquipOverviewVO> getInspectionEquipOverview(String startDate, String endDate){ |
253 | Result<InspectionEquipOverviewVO> result = new Result<>(); | 253 | Result<InspectionEquipOverviewVO> result = new Result<>(); |
254 | InspectionEquipOverviewVO inspectionEquipOverviewVO = inspectionAnalysisService.getInspectionEquipOverview(startDate,endDate); | 254 | InspectionEquipOverviewVO inspectionEquipOverviewVO = inspectionAnalysisService.getInspectionEquipOverviewNew(startDate,endDate); |
255 | result.setSuccess(true); | 255 | result.setSuccess(true); |
256 | result.setResult(inspectionEquipOverviewVO); | 256 | result.setResult(inspectionEquipOverviewVO); |
257 | return result; | 257 | return result; | ... | ... |
... | @@ -26,9 +26,12 @@ public interface InspectionPointFillGroupMapper extends BaseMapper<InspectionPoi | ... | @@ -26,9 +26,12 @@ public interface InspectionPointFillGroupMapper extends BaseMapper<InspectionPoi |
26 | "\tleft join inspection_fill_choice ifc on ifi.id = ifc.inspection_fill_id ${ew.customSqlSegment}") | 26 | "\tleft join inspection_fill_choice ifc on ifi.id = ifc.inspection_fill_id ${ew.customSqlSegment}") |
27 | List<InspectionPointFillGroupAndFillVO> getList(@Param(Constants.WRAPPER) QueryWrapper<InspectionPointFillGroupAndFillVO> inspectionPointFillGroupAndFillVOQueryWrapper); | 27 | List<InspectionPointFillGroupAndFillVO> getList(@Param(Constants.WRAPPER) QueryWrapper<InspectionPointFillGroupAndFillVO> inspectionPointFillGroupAndFillVOQueryWrapper); |
28 | 28 | ||
29 | @Select("select 'sys_struct_dict' node_type,id,'' parent_id,struct_name title from sys_struct_dict ssd where ssd.depart_id = #{departId}\n" + | 29 | @Select("SELECT * FROM\t(\tSELECT 'sys_struct_dict' AS node_type,ssd.id,'' AS parent_id,ssd.struct_name AS title,ssd.sort_num,NULL AS equipment_name\n" + |
30 | "union all\n" + | 30 | "\tFROM sys_struct_dict ssd WHERE ssd.depart_id = #{departId}\n" + |
31 | "select 'equip_info' node_type,ei.id,ssd.id parent_id,ei.equipment_name title from equipment_info ei left join sys_struct_dict ssd on " + | 31 | "\tUNION ALL SELECT\n" + |
32 | " ei.structures = ssd.id where ssd.depart_id = #{departId}") | 32 | "\t\t'equip_info' AS node_type,ei.id,ssd.id AS parent_id,ei.equipment_name AS title,ssd.sort_num,ei.equipment_name -- 用于排序\n" + |
33 | "\tFROM equipment_info ei LEFT JOIN sys_struct_dict ssd ON ei.structures = ssd.id \n" + | ||
34 | "\tWHERE ssd.depart_id = #{departId}\n" + | ||
35 | "\t) AS combined_result ORDER BY node_type DESC,sort_num,equipment_name;") | ||
33 | List<InspectionStructEquipVO> getSysStructDictAndEquipInfo(@Param("departId") String departId); | 36 | List<InspectionStructEquipVO> getSysStructDictAndEquipInfo(@Param("departId") String departId); |
34 | } | 37 | } | ... | ... |
... | @@ -20,7 +20,7 @@ public interface IInspectionAnalysisService { | ... | @@ -20,7 +20,7 @@ public interface IInspectionAnalysisService { |
20 | * @return | 20 | * @return |
21 | */ | 21 | */ |
22 | InspectionTaskIndicatorsVO getInspectionTaskIndicators(String startDate, String endDate); | 22 | InspectionTaskIndicatorsVO getInspectionTaskIndicators(String startDate, String endDate); |
23 | 23 | InspectionTaskIndicatorsVO getInspectionTaskIndicatorsNew(String startDate, String endDate); | |
24 | /*** | 24 | /*** |
25 | * 巡检分析-巡检任务指标-详情 | 25 | * 巡检分析-巡检任务指标-详情 |
26 | * @param departIds | 26 | * @param departIds |
... | @@ -36,7 +36,7 @@ public interface IInspectionAnalysisService { | ... | @@ -36,7 +36,7 @@ public interface IInspectionAnalysisService { |
36 | * @return | 36 | * @return |
37 | */ | 37 | */ |
38 | InspectionEquipIndicatorsVO getInspectionEquipIndicators(String startDate, String endDate); | 38 | InspectionEquipIndicatorsVO getInspectionEquipIndicators(String startDate, String endDate); |
39 | 39 | InspectionEquipIndicatorsVO getInspectionEquipIndicatorsNew(String startDate, String endDate); | |
40 | /*** | 40 | /*** |
41 | * 巡检分析-巡检设备指标--详情 | 41 | * 巡检分析-巡检设备指标--详情 |
42 | * @param startDate | 42 | * @param startDate |
... | @@ -52,6 +52,7 @@ public interface IInspectionAnalysisService { | ... | @@ -52,6 +52,7 @@ public interface IInspectionAnalysisService { |
52 | * @return | 52 | * @return |
53 | */ | 53 | */ |
54 | InspectionTaskOverviewVO getInspectionTaskOverview(String startDate, String endDate); | 54 | InspectionTaskOverviewVO getInspectionTaskOverview(String startDate, String endDate); |
55 | InspectionTaskOverviewVO getInspectionTaskOverviewNew(String startDate, String endDate); | ||
55 | 56 | ||
56 | /*** | 57 | /*** |
57 | * 巡检分析-巡检任务概况 | 58 | * 巡检分析-巡检任务概况 |
... | @@ -69,6 +70,8 @@ public interface IInspectionAnalysisService { | ... | @@ -69,6 +70,8 @@ public interface IInspectionAnalysisService { |
69 | */ | 70 | */ |
70 | InspectionEquipOverviewVO getInspectionEquipOverview(String startDate, String endDate); | 71 | InspectionEquipOverviewVO getInspectionEquipOverview(String startDate, String endDate); |
71 | 72 | ||
73 | InspectionEquipOverviewVO getInspectionEquipOverviewNew(String startDate, String endDate); | ||
74 | |||
72 | /*** | 75 | /*** |
73 | * 巡检分析-巡检设备概况-详情 | 76 | * 巡检分析-巡检设备概况-详情 |
74 | * @param departIds | 77 | * @param departIds | ... | ... |
... | @@ -492,6 +492,30 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -492,6 +492,30 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
492 | } | 492 | } |
493 | 493 | ||
494 | 494 | ||
495 | public InspectionTaskIndicatorsVO getInspectionTaskIndicatorsNew(String startDate, String endDate){ | ||
496 | InspectionTaskOverviewVO inspectionTaskOverviewVO = getInspectionTaskOverviewNew( startDate, endDate); | ||
497 | InspectionTaskIndicatorsVO inspectionTaskIndicatorsVO = new InspectionTaskIndicatorsVO(); | ||
498 | //完成率 | ||
499 | String completionRate = "0"; | ||
500 | completionRate = numberFormat.format(inspectionTaskOverviewVO.getCheckedInspectionTaskCount() / (double) inspectionTaskOverviewVO.getTotalInspectionTaskCount() * 100); | ||
501 | //未检率 | ||
502 | String unCompletionRate = "0"; | ||
503 | unCompletionRate = numberFormat.format( inspectionTaskOverviewVO.getNotCheckedInspectionTaskCount()/ (double) inspectionTaskOverviewVO.getTotalInspectionTaskCount() * 100); | ||
504 | //异常率 | ||
505 | String abnormalRate = "0"; | ||
506 | abnormalRate = numberFormat.format(inspectionTaskOverviewVO.getAbnormalInspectionTaskCount() / (double) inspectionTaskOverviewVO.getCheckedInspectionTaskCount() * 100); | ||
507 | //异常项处理率 | ||
508 | // String processedAbnormalRate = "0"; | ||
509 | // if (abnormalItemsCount != 0) { | ||
510 | // processedAbnormalRate = numberFormat.format(processedAbnormalItemsCount / (double)abnormalItemsCount * 100); | ||
511 | // } | ||
512 | inspectionTaskIndicatorsVO.setCompletionRate(completionRate); | ||
513 | inspectionTaskIndicatorsVO.setUnCompletionRate(unCompletionRate); | ||
514 | inspectionTaskIndicatorsVO.setAbnormalRate(abnormalRate); | ||
515 | |||
516 | return inspectionTaskIndicatorsVO; | ||
517 | } | ||
518 | |||
495 | 519 | ||
496 | /*** | 520 | /*** |
497 | * 巡检分析-巡检任务指标-详情 | 521 | * 巡检分析-巡检任务指标-详情 |
... | @@ -503,6 +527,7 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -503,6 +527,7 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
503 | public List<InspectionEquipIndicatorsDetailVO> getInspectionTaskIndicatorsDetail(String departIds, String startDate, String endDate){ | 527 | public List<InspectionEquipIndicatorsDetailVO> getInspectionTaskIndicatorsDetail(String departIds, String startDate, String endDate){ |
504 | return inspectionAnalysisMapper.getInspectionEquipIndicatorsDetail(departIds, startDate, endDate); | 528 | return inspectionAnalysisMapper.getInspectionEquipIndicatorsDetail(departIds, startDate, endDate); |
505 | } | 529 | } |
530 | |||
506 | /*** | 531 | /*** |
507 | * 巡检分析-巡检设备指标 | 532 | * 巡检分析-巡检设备指标 |
508 | * @param startDate | 533 | * @param startDate |
... | @@ -634,6 +659,37 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -634,6 +659,37 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
634 | return inspectionEquipIndicatorsVO; | 659 | return inspectionEquipIndicatorsVO; |
635 | } | 660 | } |
636 | 661 | ||
662 | public InspectionEquipIndicatorsVO getInspectionEquipIndicatorsNew(String startDate, String endDate) { | ||
663 | InspectionEquipIndicatorsVO inspectionEquipIndicatorsVO = new InspectionEquipIndicatorsVO(); | ||
664 | |||
665 | |||
666 | InspectionEquipOverviewVO inspectionEquipOverviewNew = getInspectionEquipOverviewNew(startDate, endDate); | ||
667 | //完成率 | ||
668 | String finishRate = "0"; | ||
669 | finishRate = numberFormat.format( inspectionEquipOverviewNew.getCheckedInspectionEquipCount() / (double) inspectionEquipOverviewNew.getTotalInspectionEquipCount() * 100); | ||
670 | //覆盖率 | ||
671 | String completionRate = "0"; | ||
672 | completionRate = numberFormat.format( inspectionEquipOverviewNew.getCheckedInspectionEquipCount() / (double) inspectionEquipOverviewNew.getTotalInspectionEquipCount() * 100); | ||
673 | |||
674 | //未检率 | ||
675 | String unCompletionRate = "0"; | ||
676 | unCompletionRate = numberFormat.format(inspectionEquipOverviewNew.getNotCheckedInspectionEquipCount() / (double) inspectionEquipOverviewNew.getTotalInspectionEquipCount() * 100); | ||
677 | //异常率 | ||
678 | String abnormalRate = "0"; | ||
679 | abnormalRate = numberFormat.format( inspectionEquipOverviewNew.getAbnormalInspectionEquipCount() / (double) inspectionEquipOverviewNew.getCheckedInspectionEquipCount() * 100); | ||
680 | //异常项处理率 | ||
681 | String processedAbnormalRate = "0"; | ||
682 | /* if (abnormalItemsCount != 0) { | ||
683 | processedAbnormalRate = numberFormat.format(processedAbnormalItemsCount / (double) abnormalItemsCount * 100); | ||
684 | }*/ | ||
685 | inspectionEquipIndicatorsVO.setFinishRate(finishRate); | ||
686 | inspectionEquipIndicatorsVO.setCompletionRate(completionRate); | ||
687 | inspectionEquipIndicatorsVO.setUnCompletionRate(unCompletionRate); | ||
688 | inspectionEquipIndicatorsVO.setAbnormalRate(abnormalRate); | ||
689 | inspectionEquipIndicatorsVO.setProcessedAbnormalRate(processedAbnormalRate); | ||
690 | return inspectionEquipIndicatorsVO; | ||
691 | } | ||
692 | |||
637 | /*** | 693 | /*** |
638 | * 巡检分析-巡检设备指标--详情 | 694 | * 巡检分析-巡检设备指标--详情 |
639 | * @param startDate | 695 | * @param startDate |
... | @@ -757,6 +813,31 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -757,6 +813,31 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
757 | return inspectionTaskOverviewVO; | 813 | return inspectionTaskOverviewVO; |
758 | } | 814 | } |
759 | 815 | ||
816 | public InspectionTaskOverviewVO getInspectionTaskOverviewNew(String startDate, String endDate) { | ||
817 | String departIds = BaseContextHandler.getDeparts(); | ||
818 | InspectionTaskOverviewVO inspectionTaskOverviewVO = new InspectionTaskOverviewVO(); | ||
819 | String sql = "select count(1) 'totalInspectionTaskCount' , sum(CASE WHEN t.task_state = '1' THEN 1 ELSE 0 END) AS 'inProgressInspectionTaskCount' ,"; | ||
820 | sql += " sum(CASE WHEN t.task_state = '2' THEN 1 ELSE 0 END) AS 'checkedInspectionTaskCount',sum(CASE WHEN t.task_state = '3' THEN 1 ELSE 0 END) AS 'notCheckedInspectionTaskCount' "; | ||
821 | sql += " from inspection_task t where 1=1 AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= '"+startDate+"' AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= '"+endDate+"' "; | ||
822 | sql += " and depart_id in ("+JSUtils.quoteEach(departIds,",")+")"; | ||
823 | Map<String, Object> dataMap = commonSqlService.queryForMap(sql); | ||
824 | |||
825 | sql = " select count(cc.inspection_task_id) 'abnormalInspectionTaskCount' from ( "; | ||
826 | sql += " SELECT t.depart_id, itfc.inspection_task_id FROM inspection_task_fill_content itfc ,inspection_task t WHERE inspection_task_id =t.id and t.task_state IN ('2') "; | ||
827 | sql += " AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') >= '"+startDate+"' AND DATE_FORMAT(t.inspection_cycle_start_date,'%Y-%m-%d') <= '"+endDate+"' "; | ||
828 | sql += " and t.depart_id in ("+JSUtils.quoteEach(departIds,",")+")"; | ||
829 | sql += " AND choice_state = '0' GROUP BY itfc.inspection_task_id ,t.depart_id) cc "; | ||
830 | Integer abnormalInspectionTaskCount = getJdbcTemplate().queryForObject(sql,Integer.class); | ||
831 | |||
832 | |||
833 | inspectionTaskOverviewVO.setTotalInspectionTaskCount( ConvertUtils.getInt(dataMap.get("totalInspectionTaskCount"),0)); | ||
834 | inspectionTaskOverviewVO.setCheckedInspectionTaskCount( ConvertUtils.getInt(dataMap.get("checkedInspectionTaskCount"),0)); | ||
835 | inspectionTaskOverviewVO.setNotCheckedInspectionTaskCount(ConvertUtils.getInt(dataMap.get("notCheckedInspectionTaskCount"),0)); | ||
836 | inspectionTaskOverviewVO.setNormalInspectionTaskCount(ConvertUtils.getInt(dataMap.get("checkedInspectionTaskCount"),0) - ConvertUtils.getInt(abnormalInspectionTaskCount,0) ); | ||
837 | inspectionTaskOverviewVO.setAbnormalInspectionTaskCount(abnormalInspectionTaskCount); | ||
838 | return inspectionTaskOverviewVO; | ||
839 | } | ||
840 | |||
760 | 841 | ||
761 | /*** | 842 | /*** |
762 | * 巡检分析-巡检任务概况 | 843 | * 巡检分析-巡检任务概况 |
... | @@ -882,6 +963,27 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -882,6 +963,27 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
882 | } | 963 | } |
883 | 964 | ||
884 | 965 | ||
966 | public InspectionEquipOverviewVO getInspectionEquipOverviewNew(String startDate, String endDate){ | ||
967 | String departIds = BaseContextHandler.getDeparts(); | ||
968 | InspectionEquipOverviewVO inspectionEquipOverviewVO = new InspectionEquipOverviewVO(); | ||
969 | String sql = getTotalInspectionEquipSql(departIds,startDate, endDate); | ||
970 | Integer totalInspectionEquipCount = getJdbcTemplate().queryForObject(sql,Integer.class);//应监测 | ||
971 | |||
972 | sql = " SELECT count( DISTINCT aaa.equip_info_id) FROM inspection_task_fill_content isfc "+getCheckedInspectionEquipCommonSql(departIds,startDate,endDate,null);//已检测 | ||
973 | Integer checkedInspectionEquipCount = getJdbcTemplate().queryForObject(sql,Integer.class); | ||
974 | |||
975 | sql = " SELECT count( DISTINCT aaa.equip_info_id) FROM inspection_task_fill_content isfc "+getCheckedInspectionEquipCommonSql(departIds,startDate,endDate,"0");//异常 | ||
976 | Integer abnormalInspectionEquipCount = getJdbcTemplate().queryForObject(sql,Integer.class); | ||
977 | |||
978 | inspectionEquipOverviewVO.setTotalInspectionEquipCount(totalInspectionEquipCount); | ||
979 | inspectionEquipOverviewVO.setCheckedInspectionEquipCount(checkedInspectionEquipCount); | ||
980 | inspectionEquipOverviewVO.setNotCheckedInspectionEquipCount(totalInspectionEquipCount - checkedInspectionEquipCount); | ||
981 | inspectionEquipOverviewVO.setNormalInspectionEquipCount(checkedInspectionEquipCount - abnormalInspectionEquipCount); | ||
982 | inspectionEquipOverviewVO.setAbnormalInspectionEquipCount(abnormalInspectionEquipCount); | ||
983 | // inspectionEquipOverviewVO.setProcessedAbnormalRate(processedAbnormalRate); | ||
984 | return inspectionEquipOverviewVO; | ||
985 | } | ||
986 | |||
885 | /*** | 987 | /*** |
886 | * 巡检分析-巡检设备概况-详情 | 988 | * 巡检分析-巡检设备概况-详情 |
887 | * @param departIds | 989 | * @param departIds |
... | @@ -1060,6 +1162,12 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -1060,6 +1162,12 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
1060 | //获取已检设备的id集合 | 1162 | //获取已检设备的id集合 |
1061 | private String getCheckedInspectionEquipIds(String departIds,String startDate,String endDate,String choice_state){ | 1163 | private String getCheckedInspectionEquipIds(String departIds,String startDate,String endDate,String choice_state){ |
1062 | String sql = " SELECT aaa.equip_info_id FROM inspection_task_fill_content isfc "; | 1164 | String sql = " SELECT aaa.equip_info_id FROM inspection_task_fill_content isfc "; |
1165 | sql += " "+getCheckedInspectionEquipCommonSql(departIds,startDate,endDate,choice_state); | ||
1166 | sql += " GROUP BY aaa.equip_info_id "; | ||
1167 | return sql; | ||
1168 | } | ||
1169 | private String getCheckedInspectionEquipCommonSql(String departIds,String startDate,String endDate,String choice_state){ | ||
1170 | String sql = " "; | ||
1063 | sql += " left join ( "; | 1171 | sql += " left join ( "; |
1064 | sql += " SELECT equip_info_id ,inspection_point_fill_group_id ,inspection_fill_group_id ,inspection_task_id FROM inspection_task_point_fill_group "; | 1172 | sql += " SELECT equip_info_id ,inspection_point_fill_group_id ,inspection_fill_group_id ,inspection_task_id FROM inspection_task_point_fill_group "; |
1065 | sql += " WHERE inspection_task_id IN ( select id FROM inspection_task WHERE inspection_cycle_start_date >= '"+startDate+" 00:00:00' AND inspection_cycle_start_date <= '"+endDate+" 23:59:59' AND task_state IN ('2','3') "; | 1173 | sql += " WHERE inspection_task_id IN ( select id FROM inspection_task WHERE inspection_cycle_start_date >= '"+startDate+" 00:00:00' AND inspection_cycle_start_date <= '"+endDate+" 23:59:59' AND task_state IN ('2','3') "; |
... | @@ -1073,7 +1181,6 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService | ... | @@ -1073,7 +1181,6 @@ public class InspectionAnalysisServiceImpl implements IInspectionAnalysisService |
1073 | if(StringUtils.isNotEmpty(choice_state)){ | 1181 | if(StringUtils.isNotEmpty(choice_state)){ |
1074 | sql += " AND choice_state = '"+choice_state+"' "; | 1182 | sql += " AND choice_state = '"+choice_state+"' "; |
1075 | } | 1183 | } |
1076 | sql += " GROUP BY aaa.equip_info_id "; | ||
1077 | return sql; | 1184 | return sql; |
1078 | } | 1185 | } |
1079 | 1186 | ... | ... |
-
请 注册 或 登录 后发表评论