Merge remote-tracking branch 'origin/master' into master
正在显示
12 个修改的文件
包含
169 行增加
和
49 行删除
... | @@ -71,7 +71,9 @@ public class DateUtils { | ... | @@ -71,7 +71,9 @@ public class DateUtils { |
71 | }; | 71 | }; |
72 | 72 | ||
73 | public static void main(String[] args) { | 73 | public static void main(String[] args) { |
74 | System.out.println( formatDate("2024-01","yyyy-MM")); | 74 | System.out.println( ); |
75 | |||
76 | System.out.println(getHbMonth(formatDate("2024-01-01","yyyy-MM"))); | ||
75 | } | 77 | } |
76 | /*** | 78 | /*** |
77 | * 字符串日期格式化 | 79 | * 字符串日期格式化 |
... | @@ -591,6 +593,8 @@ public class DateUtils { | ... | @@ -591,6 +593,8 @@ public class DateUtils { |
591 | return previousMonth.format(formatter); // 环比 | 593 | return previousMonth.format(formatter); // 环比 |
592 | } | 594 | } |
593 | 595 | ||
596 | |||
597 | |||
594 | /** | 598 | /** |
595 | * 获取同比时间 | 599 | * 获取同比时间 |
596 | * @param date | 600 | * @param date | ... | ... |
... | @@ -43,7 +43,7 @@ | ... | @@ -43,7 +43,7 @@ |
43 | <!-- 根据入库单ids,获取水厂结算单详情--> | 43 | <!-- 根据入库单ids,获取水厂结算单详情--> |
44 | <select id="queryWaterDepartSettlementByMaterialIds" resultType="com.skua.modules.erp.vo.ErpSettlementItemVO"> | 44 | <select id="queryWaterDepartSettlementByMaterialIds" resultType="com.skua.modules.erp.vo.ErpSettlementItemVO"> |
45 | select d.depart_name, dc.contract_name ,dc.project_name, dc.contract_code, dm.distribut_price 'unit_price' , pm.good_brand , pm.good_origin, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, dm.tax_amount , | 45 | select d.depart_name, dc.contract_name ,dc.project_name, dc.contract_code, dm.distribut_price 'unit_price' , pm.good_brand , pm.good_origin, mf.jishu_file_path, mf.appearance_info, mf.matched_info ,mf.handle_msg,mf.sender_sign,mf.receiver_sign, dm.tax_amount , |
46 | round(dm.distribut_price * mi.material_num,2) total_price, round(pm.distribut_price * mi.material_num *100 /(100+ ifnull(dm.tax_amount,0)) ,2) total_price_tax, | 46 | round(dm.distribut_price * mi.material_num,2) total_price, round(pm.unit_price * mi.material_num *100 /(100+ ifnull(dm.tax_amount,0)) ,2) total_price_tax, |
47 | mi.depart_id , mi.distribut_contract_id ,mi.purchase_contract_id, mi.material_num, | 47 | mi.depart_id , mi.distribut_contract_id ,mi.purchase_contract_id, mi.material_num, |
48 | mi.arrive_time ,mi.remark,mi.sparepart_type,mi.sparepart_id,mi.sparepart_name,mi.sparepart_code,mi.specification, mi.measuring_unit,mi.good_code,mi.id 'material_in_id' | 48 | mi.arrive_time ,mi.remark,mi.sparepart_type,mi.sparepart_id,mi.sparepart_name,mi.sparepart_code,mi.specification, mi.measuring_unit,mi.good_code,mi.id 'material_in_id' |
49 | from erp_material_in mi | 49 | from erp_material_in mi | ... | ... |
... | @@ -115,7 +115,7 @@ public class OperationReportServiceImpl implements IOperationReportService { | ... | @@ -115,7 +115,7 @@ public class OperationReportServiceImpl implements IOperationReportService { |
115 | //水电耗高于控制目标--水务公司列表 | 115 | //水电耗高于控制目标--水务公司列表 |
116 | dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ydh,dhcmbzyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime()); | 116 | dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ydh,dhcmbzyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime()); |
117 | sql = "select * from ( "; | 117 | sql = "select * from ( "; |
118 | sql += " select d.depart_name 'departName', aaa.depart_id , avg(aaa.ydh) realConsume , IFNULL(tc.target_power,2) 'targetConsume' ,GROUP_CONCAT(aaa.dhcmbzyy) 'causeAnalysis' from "+ dataViewName4411+" aaa";; | 118 | sql += " select d.depart_name 'departName', aaa.depart_id , round(avg(aaa.ydh),2) realConsume , IFNULL(tc.target_power,2) 'targetConsume' ,GROUP_CONCAT(aaa.dhcmbzyy) 'causeAnalysis' from "+ dataViewName4411+" aaa";; |
119 | sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')"; | 119 | sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')"; |
120 | sql += " left join sys_depart d on d.id = aaa.depart_id "; | 120 | sql += " left join sys_depart d on d.id = aaa.depart_id "; |
121 | sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume "; | 121 | sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume "; |
... | @@ -126,7 +126,7 @@ public class OperationReportServiceImpl implements IOperationReportService { | ... | @@ -126,7 +126,7 @@ public class OperationReportServiceImpl implements IOperationReportService { |
126 | //药剂成本高于控制目标--水务公司列表 | 126 | //药剂成本高于控制目标--水务公司列表 |
127 | dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"yyh,yhcyqyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime()); | 127 | dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"yyh,yhcyqyy", departId, seasonTimeVO.getStartTime(), seasonTimeVO.getEndTime()); |
128 | sql = "select * from ( "; | 128 | sql = "select * from ( "; |
129 | sql += " select d.depart_name 'departName', aaa.depart_id , avg(aaa.yyh) realConsume , IFNULL(tc.target_drug,2) 'targetConsume' ,GROUP_CONCAT(aaa.yhcyqyy) 'causeAnalysis' from "+ dataViewName4411+" aaa";; | 129 | sql += " select d.depart_name 'departName', aaa.depart_id , round(avg(aaa.yyh),2) realConsume , IFNULL(tc.target_drug,2) 'targetConsume' ,GROUP_CONCAT(aaa.yhcyqyy) 'causeAnalysis' from "+ dataViewName4411+" aaa";; |
130 | sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')"; | 130 | sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year='2024')"; |
131 | sql += " left join sys_depart d on d.id = aaa.depart_id "; | 131 | sql += " left join sys_depart d on d.id = aaa.depart_id "; |
132 | sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume "; | 132 | sql += " group by aaa.depart_id )bbb where bbb.realConsume > bbb.targetConsume "; | ... | ... |
... | @@ -163,10 +163,10 @@ public class EquipmentCenterController { | ... | @@ -163,10 +163,10 @@ public class EquipmentCenterController { |
163 | @AutoLog(value = "设备中心-MTTR&MTBF详情") | 163 | @AutoLog(value = "设备中心-MTTR&MTBF详情") |
164 | @ApiOperation(value = "设备中心-MTTR&MTBF详情", notes = "设备中心-MTTR&MTBF详情") | 164 | @ApiOperation(value = "设备中心-MTTR&MTBF详情", notes = "设备中心-MTTR&MTBF详情") |
165 | @GetMapping(value = "/equipmentMFDetails") | 165 | @GetMapping(value = "/equipmentMFDetails") |
166 | public Result<List<Map>> equipmentMFDetails(ReportStatisticsDTO reportStatisticsDTO) { | 166 | public Result<List<ContrastDetailVO>> equipmentMFDetails(ReportStatisticsDTO reportStatisticsDTO) { |
167 | Result<List<Map>> result = new Result<List<Map>>(); | 167 | Result<List<ContrastDetailVO>> result = new Result<List<ContrastDetailVO>>(); |
168 | setDepartIds(reportStatisticsDTO); | 168 | setDepartIds(reportStatisticsDTO); |
169 | List<Map> equipmentMFDetails = iProductionEquipmentService.getEquipmentMFDetails(reportStatisticsDTO); | 169 | List<ContrastDetailVO> equipmentMFDetails = iProductionEquipmentService.getEquipmentMFDetailsNew(reportStatisticsDTO.getDepartIds(),reportStatisticsDTO.getStartTime(),reportStatisticsDTO.getEndTime()); |
170 | result.setResult(equipmentMFDetails); | 170 | result.setResult(equipmentMFDetails); |
171 | result.setSuccess(true); | 171 | result.setSuccess(true); |
172 | return result; | 172 | return result; | ... | ... |
... | @@ -54,6 +54,9 @@ public class ReportStatisticsDTO { | ... | @@ -54,6 +54,9 @@ public class ReportStatisticsDTO { |
54 | @ApiModelProperty(value = "1总公司2分公司3厂站") | 54 | @ApiModelProperty(value = "1总公司2分公司3厂站") |
55 | private Integer isCompany; | 55 | private Integer isCompany; |
56 | 56 | ||
57 | @ApiModelProperty(value = "分类数量") | ||
58 | private String totalCount; | ||
59 | |||
57 | 60 | ||
58 | @ApiModelProperty(value = "去年同比开始时间") | 61 | @ApiModelProperty(value = "去年同比开始时间") |
59 | private String lastYearStartTime; | 62 | private String lastYearStartTime; | ... | ... |
... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ... | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
5 | import com.skua.modules.equipment.dto.ReportStatisticsDTO; | 5 | import com.skua.modules.equipment.dto.ReportStatisticsDTO; |
6 | import com.skua.modules.equipment.entity.SysUser; | 6 | import com.skua.modules.equipment.entity.SysUser; |
7 | import com.skua.modules.equipment.pojo.Equipment; | 7 | import com.skua.modules.equipment.pojo.Equipment; |
8 | import com.skua.modules.equipment.vo.ContrastDetailVO; | ||
8 | import com.skua.modules.equipment.vo.EquipmentNewMaintenancePlanVO; | 9 | import com.skua.modules.equipment.vo.EquipmentNewMaintenancePlanVO; |
9 | import com.skua.modules.equipment.vo.EquipmentStatisticsCountVO; | 10 | import com.skua.modules.equipment.vo.EquipmentStatisticsCountVO; |
10 | import com.skua.modules.equipment.vo.ProportionStatisticsVO; | 11 | import com.skua.modules.equipment.vo.ProportionStatisticsVO; |
... | @@ -134,6 +135,8 @@ public interface ProductionEquipmentMapper { | ... | @@ -134,6 +135,8 @@ public interface ProductionEquipmentMapper { |
134 | 135 | ||
135 | //一年MTBF | 136 | //一年MTBF |
136 | List<Map> getOneYearMTBF(); | 137 | List<Map> getOneYearMTBF(); |
138 | //MTBF 详情 | ||
139 | public List<ContrastDetailVO> getEquipmentMFDetailsNew(@Param("departIds") String departIds, @Param("startTime")String startTime, @Param("endTime")String endTime); | ||
137 | 140 | ||
138 | //半年完成率 | 141 | //半年完成率 |
139 | List<Map> getHalfIntactCompleteRate(); | 142 | List<Map> getHalfIntactCompleteRate(); | ... | ... |
... | @@ -146,7 +146,7 @@ | ... | @@ -146,7 +146,7 @@ |
146 | 146 | ||
147 | <select id="getLevelByTime" resultType="com.skua.modules.equipment.vo.ProportionStatisticsVO" | 147 | <select id="getLevelByTime" resultType="com.skua.modules.equipment.vo.ProportionStatisticsVO" |
148 | parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO"> | 148 | parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO"> |
149 | select aaa.item_text as category, ifnull(COUNT( ei.id ),0) AS'hour' from equipment_info ei | 149 | select ei.equipment_level ,aaa.item_text as category, ifnull(COUNT( ei.id ),0) AS'hour' from equipment_info ei |
150 | left join ( | 150 | left join ( |
151 | select t.item_value , t.item_text from sys_dict_item t where t.dict_id in (select id from sys_dict where dict_code = 'equipment-equipment_level') | 151 | select t.item_value , t.item_text from sys_dict_item t where t.dict_id in (select id from sys_dict where dict_code = 'equipment-equipment_level') |
152 | ) aaa on aaa.item_value = ei.equipment_level | 152 | ) aaa on aaa.item_value = ei.equipment_level |
... | @@ -164,46 +164,25 @@ | ... | @@ -164,46 +164,25 @@ |
164 | </select> | 164 | </select> |
165 | <select id="getTypeByTime" parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO" | 165 | <select id="getTypeByTime" parameterType="com.skua.modules.equipment.dto.ReportStatisticsDTO" |
166 | resultType="com.skua.modules.equipment.vo.ProportionStatisticsVO"> | 166 | resultType="com.skua.modules.equipment.vo.ProportionStatisticsVO"> |
167 | SELECT | 167 | SELECT ei.equipment_type, |
168 | t1.des as category, | 168 | ec.des as category, |
169 | t1.equipmentNum as hour, | 169 | ifnull(COUNT( ei.id ),0) as hour, |
170 | CONCAT( ROUND( IFNULL( t1.equipmentNum, 0 ) / t2.equipmentTotal, 3 )* 100, '%' ) AS proportion | 170 | CONCAT( ROUND( IFNULL( COUNT( ei.id ), 0 ) / ${totalCount}, 2 )* 100, '%' ) AS proportion |
171 | FROM | ||
172 | ( | ||
173 | SELECT | ||
174 | ec.des, | ||
175 | COUNT( ei.id ) equipmentNum | ||
176 | FROM | 171 | FROM |
177 | equipment_info ei | 172 | equipment_info ei |
178 | LEFT JOIN equipment_category ec ON ec.id = ei.equipment_type | 173 | LEFT JOIN equipment_category ec ON ec.id = ei.equipment_type |
179 | LEFT JOIN sys_dict_item sdi ON sdi.item_value = ei.equipment_level | ||
180 | WHERE | 174 | WHERE |
181 | ei.del_flag = 1 | 175 | ei.del_flag = 1 |
182 | AND sdi.dict_id = '77c2f3bd6d16dec67f2ea11d84b6000e' | 176 | and ei.equipment_level = #{equipmentLevel} |
183 | <if test="equipmentLevel !=null and equipmentLevel !=''"> | 177 | <if test="startTime != null "> |
184 | AND sdi.item_text = #{equipmentLevel} | 178 | and ei.create_time >= #{startTime} |
185 | </if> | 179 | </if> |
186 | <if test="endTime !=null and endTime !=''"> | 180 | <if test="endTime != null "> |
187 | AND ei.create_time <= #{endTime} | 181 | and ei.create_time <= #{endTime} |
188 | </if> | 182 | </if> |
183 | |||
189 | GROUP BY | 184 | GROUP BY |
190 | ei.equipment_type | 185 | ei.equipment_type |
191 | ) t1,( | ||
192 | SELECT | ||
193 | count( ei.id ) AS equipmentTotal | ||
194 | FROM | ||
195 | equipment_info ei | ||
196 | LEFT JOIN sys_dict_item sdi ON sdi.item_value = ei.equipment_level | ||
197 | WHERE | ||
198 | ei.del_flag = 1 | ||
199 | AND sdi.dict_id = '77c2f3bd6d16dec67f2ea11d84b6000e' | ||
200 | <if test="equipmentLevel !=null and equipmentLevel !=''"> | ||
201 | AND sdi.item_text = #{equipmentLevel} | ||
202 | </if> | ||
203 | <if test="endTime !=null and endTime !=''"> | ||
204 | AND ei.create_time <= #{endTime} | ||
205 | </if> | ||
206 | ) t2 | ||
207 | </select> | 186 | </select> |
208 | <select id="getEquipmentStatisticsDetailsHeadquarters" | 187 | <select id="getEquipmentStatisticsDetailsHeadquarters" |
209 | resultType="com.skua.modules.equipment.vo.EquipmentNewMaintenancePlanVO" | 188 | resultType="com.skua.modules.equipment.vo.EquipmentNewMaintenancePlanVO" |
... | @@ -682,6 +661,43 @@ | ... | @@ -682,6 +661,43 @@ |
682 | MONTH DESC | 661 | MONTH DESC |
683 | ) AS t | 662 | ) AS t |
684 | </select> | 663 | </select> |
664 | |||
665 | <select id="getEquipmentMFDetailsNew" resultType="com.skua.modules.equipment.vo.ContrastDetailVO"> | ||
666 | select d.depart_name ,aaa.runTime , bbb.*,(SELECT COUNT( id ) AS increase FROM equipment_info ei WHERE ei.del_flag = 1 ) AS increase | ||
667 | from sys_depart d | ||
668 | left join ( | ||
669 | SELECT eor.factory_id ,IFNULL( SUM( SUBSTRING( run_time, 1, 2 ) ), 0 ) / 24 AS runTime | ||
670 | FROM equipment_operation_record eor | ||
671 | WHERE 1=1 | ||
672 | <if test="startDate != null and startDate != ''"> | ||
673 | and eor.create_time >= #{startDate} | ||
674 | </if> | ||
675 | <if test="endDate != null and endDate != ''"> | ||
676 | and eor.create_time <= #{endDate} | ||
677 | </if> | ||
678 | group by eor.factory_id | ||
679 | )aaa on aaa.factory_id = d.id | ||
680 | |||
681 | left join ( | ||
682 | SELECT er.depart_id,COUNT( DISTINCT info_id ) AS equips,COUNT( er.id ) AS failures, round( IFNULL(SUM( UNIX_TIMESTAMP( er.reality_maintenance_end_time )- UNIX_TIMESTAMP( er.repair_date ) ),0)/60/60/24 ,2) AS downtime | ||
683 | FROM equipment_repair er | ||
684 | WHERE er.del_flag = 1 | ||
685 | <if test="startDate != null and startDate != ''"> | ||
686 | and er.create_time >= #{startDate} | ||
687 | </if> | ||
688 | <if test="endDate != null and endDate != ''"> | ||
689 | and er.create_time <= #{endDate} | ||
690 | </if> | ||
691 | AND | ||
692 | )bbb on bbb.depart_id = d.id | ||
693 | where d.depart_type = 1 | ||
694 | <if test="departIds != null "> | ||
695 | and d.depart_id in(${departIds}) | ||
696 | </if> | ||
697 | </select> | ||
698 | |||
699 | |||
700 | |||
685 | <select id="getHalfIntactCompleteRate" resultType="java.util.Map"> | 701 | <select id="getHalfIntactCompleteRate" resultType="java.util.Map"> |
686 | SELECT t.MONTH AS month, | 702 | SELECT t.MONTH AS month, |
687 | ( | 703 | ( | ... | ... |
... | @@ -48,9 +48,11 @@ public interface IProductionEquipmentService { | ... | @@ -48,9 +48,11 @@ public interface IProductionEquipmentService { |
48 | 48 | ||
49 | //MF | 49 | //MF |
50 | List<ContrastVO> getEquipmentMF(ReportStatisticsDTO reportStatisticsDTO); | 50 | List<ContrastVO> getEquipmentMF(ReportStatisticsDTO reportStatisticsDTO); |
51 | 51 | // MF 详情 | |
52 | List<Map> getEquipmentMFDetails(ReportStatisticsDTO reportStatisticsDTO); | 52 | List<Map> getEquipmentMFDetails(ReportStatisticsDTO reportStatisticsDTO); |
53 | 53 | ||
54 | public List<ContrastDetailVO> getEquipmentMFDetailsNew(String departIds,String startTime,String endTime); | ||
55 | |||
54 | //维护完成率趋势 | 56 | //维护完成率趋势 |
55 | List<ContrastVO> getMaintainCompleteRate(ReportStatisticsDTO reportStatisticsDTO); | 57 | List<ContrastVO> getMaintainCompleteRate(ReportStatisticsDTO reportStatisticsDTO); |
56 | //维护完成率趋势详情 | 58 | //维护完成率趋势详情 | ... | ... |
... | @@ -78,9 +78,9 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -78,9 +78,9 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
78 | ABEquipmentNum = productionEquipmentMapper.getEquipmentNum("1970-01-01 00:00:00", reportStatisticsDTO.getEndTime(), "C"); | 78 | ABEquipmentNum = productionEquipmentMapper.getEquipmentNum("1970-01-01 00:00:00", reportStatisticsDTO.getEndTime(), "C"); |
79 | //这个月新增 | 79 | //这个月新增 |
80 | increase = productionEquipmentMapper.getEquipmentNum(reportStatisticsDTO.getStartTime(), reportStatisticsDTO.getEndTime(), null); | 80 | increase = productionEquipmentMapper.getEquipmentNum(reportStatisticsDTO.getStartTime(), reportStatisticsDTO.getEndTime(), null); |
81 | DateFormat format = new SimpleDateFormat("yyyy-MM"); | 81 | // DateFormat format = new SimpleDateFormat("yyyy-MM"); |
82 | String lastMonth = null; | 82 | String lastMonth = DateUtils.getHbMonth(DateUtils.formatDate(reportStatisticsDTO.getStartTime(),"yyyy-MM")); |
83 | Date parse = null; | 83 | /* Date parse = null; |
84 | try { | 84 | try { |
85 | parse = format.parse(reportStatisticsDTO.getTime()); | 85 | parse = format.parse(reportStatisticsDTO.getTime()); |
86 | Calendar calendar = Calendar.getInstance(); | 86 | Calendar calendar = Calendar.getInstance(); |
... | @@ -89,7 +89,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -89,7 +89,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
89 | lastMonth = format.format(calendar.getTime()); | 89 | lastMonth = format.format(calendar.getTime()); |
90 | } catch (Exception e) { | 90 | } catch (Exception e) { |
91 | e.getMessage(); | 91 | e.getMessage(); |
92 | } | 92 | }*/ |
93 | |||
93 | //设备完好率 | 94 | //设备完好率 |
94 | //求总停机天数 | 95 | //求总停机天数 |
95 | Map downtime = productionEquipmentMapper.getDowntime(reportStatisticsDTO.getStartTime(), reportStatisticsDTO.getEndTime()); | 96 | Map downtime = productionEquipmentMapper.getDowntime(reportStatisticsDTO.getStartTime(), reportStatisticsDTO.getEndTime()); |
... | @@ -97,7 +98,10 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -97,7 +98,10 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
97 | if (null != downtime.get("downtime")) { | 98 | if (null != downtime.get("downtime")) { |
98 | downtime1 = downtime.get("downtime").toString(); | 99 | downtime1 = downtime.get("downtime").toString(); |
99 | } | 100 | } |
101 | |||
102 | if (increase > 0) { | ||
100 | v = (increase * 30 - Double.parseDouble(downtime1)) / (increase * 30); | 103 | v = (increase * 30 - Double.parseDouble(downtime1)) / (increase * 30); |
104 | } | ||
101 | repairNum = downtime.get("repairNum").toString(); | 105 | repairNum = downtime.get("repairNum").toString(); |
102 | goodDay = 30 - Double.parseDouble(downtime1); | 106 | goodDay = 30 - Double.parseDouble(downtime1); |
103 | //上月的设备完好率 | 107 | //上月的设备完好率 |
... | @@ -119,7 +123,10 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -119,7 +123,10 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
119 | repairPlanNum = productionEquipmentMapper.getTaskNum(reportStatisticsDTO.getTime() + MONTH_START, reportStatisticsDTO.getTime() + MONTH_END, null); | 123 | repairPlanNum = productionEquipmentMapper.getTaskNum(reportStatisticsDTO.getTime() + MONTH_START, reportStatisticsDTO.getTime() + MONTH_END, null); |
120 | //维护完成台数 | 124 | //维护完成台数 |
121 | repairCompleteNum = productionEquipmentMapper.getTaskNum(reportStatisticsDTO.getTime() + MONTH_START, reportStatisticsDTO.getTime() + MONTH_END, 1); | 125 | repairCompleteNum = productionEquipmentMapper.getTaskNum(reportStatisticsDTO.getTime() + MONTH_START, reportStatisticsDTO.getTime() + MONTH_END, 1); |
126 | if(repairPlanNum != null && repairPlanNum.intValue() > 0 ){ | ||
122 | repairCompleteRate = (double) repairCompleteNum / repairPlanNum * 100; | 127 | repairCompleteRate = (double) repairCompleteNum / repairPlanNum * 100; |
128 | } | ||
129 | |||
123 | //环比 | 130 | //环比 |
124 | Integer repairNum1 = productionEquipmentMapper.getTaskNum(lastMonth + MONTH_START, lastMonth + MONTH_END, null); | 131 | Integer repairNum1 = productionEquipmentMapper.getTaskNum(lastMonth + MONTH_START, lastMonth + MONTH_END, null); |
125 | Integer finish = productionEquipmentMapper.getTaskNum(lastMonth + MONTH_START, lastMonth + MONTH_END, 1); | 132 | Integer finish = productionEquipmentMapper.getTaskNum(lastMonth + MONTH_START, lastMonth + MONTH_END, 1); |
... | @@ -164,7 +171,10 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -164,7 +171,10 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
164 | } else { | 171 | } else { |
165 | downtime1 = downtime.get("downtime").toString(); | 172 | downtime1 = downtime.get("downtime").toString(); |
166 | } | 173 | } |
174 | if(increase > 0){ | ||
167 | v = (increase * 365 - Double.parseDouble(downtime1)) / (increase * 365); | 175 | v = (increase * 365 - Double.parseDouble(downtime1)) / (increase * 365); |
176 | } | ||
177 | |||
168 | repairNum = downtime.get("repairNum").toString(); | 178 | repairNum = downtime.get("repairNum").toString(); |
169 | goodDay = 365 - Double.parseDouble(downtime1); | 179 | goodDay = 365 - Double.parseDouble(downtime1); |
170 | //上一年的设备完好率 | 180 | //上一年的设备完好率 |
... | @@ -191,7 +201,10 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -191,7 +201,10 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
191 | repairPlanNum = productionEquipmentMapper.getTaskNum(reportStatisticsDTO.getTime() + YEAR_START, reportStatisticsDTO.getTime() + YEAR_END, null); | 201 | repairPlanNum = productionEquipmentMapper.getTaskNum(reportStatisticsDTO.getTime() + YEAR_START, reportStatisticsDTO.getTime() + YEAR_END, null); |
192 | //维护完成台数 | 202 | //维护完成台数 |
193 | repairCompleteNum = productionEquipmentMapper.getTaskNum(reportStatisticsDTO.getTime() + YEAR_START, reportStatisticsDTO.getTime() + YEAR_END, 1); | 203 | repairCompleteNum = productionEquipmentMapper.getTaskNum(reportStatisticsDTO.getTime() + YEAR_START, reportStatisticsDTO.getTime() + YEAR_END, 1); |
204 | if(repairPlanNum != null && repairPlanNum.intValue() > 0 ){ | ||
194 | repairCompleteRate = (double) repairCompleteNum / repairPlanNum * 100; | 205 | repairCompleteRate = (double) repairCompleteNum / repairPlanNum * 100; |
206 | } | ||
207 | |||
195 | //环比 | 208 | //环比 |
196 | Integer repairNum1 = productionEquipmentMapper.getTaskNum(lastYear + YEAR_START, lastYear + YEAR_END, null); | 209 | Integer repairNum1 = productionEquipmentMapper.getTaskNum(lastYear + YEAR_START, lastYear + YEAR_END, null); |
197 | Integer finish = productionEquipmentMapper.getTaskNum(lastYear + YEAR_START, lastYear + YEAR_END, 1); | 210 | Integer finish = productionEquipmentMapper.getTaskNum(lastYear + YEAR_START, lastYear + YEAR_END, 1); |
... | @@ -258,7 +271,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -258,7 +271,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
258 | List<ProportionStatisticsVO> levelByTime = productionEquipmentMapper.getLevelByTime(reportStatisticsDTO); | 271 | List<ProportionStatisticsVO> levelByTime = productionEquipmentMapper.getLevelByTime(reportStatisticsDTO); |
259 | if (levelByTime.size() > 0) { | 272 | if (levelByTime.size() > 0) { |
260 | levelByTime.forEach(l -> { | 273 | levelByTime.forEach(l -> { |
261 | reportStatisticsDTO.setEquipmentLevel(l.getCategory()); | 274 | reportStatisticsDTO.setEquipmentLevel(l.getEquipmentLevel()); |
275 | reportStatisticsDTO.setTotalCount(l.getHour()); | ||
262 | List<ProportionStatisticsVO> typeByTime = productionEquipmentMapper.getTypeByTime(reportStatisticsDTO); | 276 | List<ProportionStatisticsVO> typeByTime = productionEquipmentMapper.getTypeByTime(reportStatisticsDTO); |
263 | l.setProportionStatisticsVOList(typeByTime); | 277 | l.setProportionStatisticsVOList(typeByTime); |
264 | }); | 278 | }); |
... | @@ -389,7 +403,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -389,7 +403,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
389 | List<Map<String,Object>> mapList = commonSqlService.queryForList(dict_sql); | 403 | List<Map<String,Object>> mapList = commonSqlService.queryForList(dict_sql); |
390 | List<String> categoryNameList = new ArrayList<>(); | 404 | List<String> categoryNameList = new ArrayList<>(); |
391 | List<String> categoryIdList = new ArrayList<>();*/ | 405 | List<String> categoryIdList = new ArrayList<>();*/ |
392 | String startTime; | 406 | /* String startTime; |
393 | String endTime = DateUtils.getDateByAfterMonth(0);//当前日期 | 407 | String endTime = DateUtils.getDateByAfterMonth(0);//当前日期 |
394 | if (6 == reportStatisticsDTO.getTimeUnit()) { | 408 | if (6 == reportStatisticsDTO.getTimeUnit()) { |
395 | startTime = DateUtils.getDateByAfterMonth(-6); | 409 | startTime = DateUtils.getDateByAfterMonth(-6); |
... | @@ -397,7 +411,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -397,7 +411,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
397 | startTime = DateUtils.getDateByAfterMonth(-12); | 411 | startTime = DateUtils.getDateByAfterMonth(-12); |
398 | } | 412 | } |
399 | reportStatisticsDTO.setStartTime(startTime); | 413 | reportStatisticsDTO.setStartTime(startTime); |
400 | reportStatisticsDTO.setEndTime(endTime); | 414 | reportStatisticsDTO.setEndTime(endTime);*/ |
401 | return productionEquipmentMapper.getEquipmentStatisticsDetailsNew(pageList,reportStatisticsDTO); | 415 | return productionEquipmentMapper.getEquipmentStatisticsDetailsNew(pageList,reportStatisticsDTO); |
402 | } | 416 | } |
403 | @Override | 417 | @Override |
... | @@ -657,8 +671,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -657,8 +671,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
657 | //平均修复时间 | 671 | //平均修复时间 |
658 | List<Map> MTTR = new ArrayList<>(); | 672 | List<Map> MTTR = new ArrayList<>(); |
659 | if (6 == reportStatisticsDTO.getTimeUnit()) { | 673 | if (6 == reportStatisticsDTO.getTimeUnit()) { |
660 | MTBF = productionEquipmentMapper.getHalfIntactMTBF(); //平均故障时间 | 674 | MTBF = productionEquipmentMapper.getHalfIntactMTBF(); //平均故障时间 半年MTBF |
661 | MTTR = productionEquipmentMapper.getHalfIntactMTTR(); | 675 | MTTR = productionEquipmentMapper.getHalfIntactMTTR();//半年MTTR |
662 | } else { | 676 | } else { |
663 | MTBF = productionEquipmentMapper.getOneYearMTBF(); | 677 | MTBF = productionEquipmentMapper.getOneYearMTBF(); |
664 | MTTR = productionEquipmentMapper.getOneYearMTTR(); | 678 | MTTR = productionEquipmentMapper.getOneYearMTTR(); |
... | @@ -801,6 +815,10 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -801,6 +815,10 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
801 | return listMF; | 815 | return listMF; |
802 | } | 816 | } |
803 | 817 | ||
818 | |||
819 | public List<ContrastDetailVO> getEquipmentMFDetailsNew(String departIds,String startTime,String endTime) { | ||
820 | return productionEquipmentMapper.getEquipmentMFDetailsNew(departIds, startTime, endTime); | ||
821 | } | ||
804 | @Override | 822 | @Override |
805 | public List<ContrastVO> getMaintainCompleteRate(ReportStatisticsDTO reportStatisticsDTO) { | 823 | public List<ContrastVO> getMaintainCompleteRate(ReportStatisticsDTO reportStatisticsDTO) { |
806 | List<ContrastVO> contrastVOS = new ArrayList<>(); | 824 | List<ContrastVO> contrastVOS = new ArrayList<>(); | ... | ... |
1 | package com.skua.modules.equipment.vo; | ||
2 | |||
3 | import com.skua.core.util.DoubleOperaUtils; | ||
4 | import io.swagger.annotations.ApiModel; | ||
5 | import io.swagger.annotations.ApiModelProperty; | ||
6 | import lombok.Data; | ||
7 | import org.apache.commons.lang3.StringUtils; | ||
8 | |||
9 | /*************************** | ||
10 | *<pre> | ||
11 | * @Project Name : cdxr | ||
12 | * @Package : com.skua.modules.equipment.vo | ||
13 | * @File Name : ContrastVO | ||
14 | * @Author : luowei | ||
15 | * @Date : 2022/11/17 11:12 | ||
16 | * @Purpose :对比 | ||
17 | * @History : | ||
18 | *</pre> | ||
19 | ***************************/ | ||
20 | @Data | ||
21 | @ApiModel(value="设备分析:MTTR&MTBF详情", description="设备分析:MTTR&MTBF详情") | ||
22 | public class ContrastDetailVO { | ||
23 | //月份 | ||
24 | @ApiModelProperty(value = "厂站名称") | ||
25 | private String departName; | ||
26 | |||
27 | |||
28 | @ApiModelProperty(value = "运行时间") | ||
29 | private String runTime; | ||
30 | @ApiModelProperty(value = "故障数") | ||
31 | private String failures; | ||
32 | @ApiModelProperty(value = "故障设备数量") | ||
33 | private String equips; | ||
34 | @ApiModelProperty(value = "停机时间") | ||
35 | private String downtime; | ||
36 | @ApiModelProperty(value = "设备总数量") | ||
37 | private String increase; | ||
38 | |||
39 | |||
40 | //维修 | ||
41 | @ApiModelProperty(value = "维修") | ||
42 | private Double repairNum; | ||
43 | //保养 | ||
44 | @ApiModelProperty(value = "保养") | ||
45 | private Double maintainNum; | ||
46 | |||
47 | |||
48 | public Double getRepairNum() { | ||
49 | repairNum = 0.00d; | ||
50 | if (StringUtils.isNotEmpty(failures) && StringUtils.isNotEmpty(equips) && !failures.equals("0") && !equips.equals("0")) { | ||
51 | repairNum = Double.parseDouble(runTime) / Integer.parseInt(failures) / Integer.parseInt(equips); | ||
52 | repairNum = DoubleOperaUtils.bigDecimalRound(repairNum,2); | ||
53 | } | ||
54 | return repairNum; | ||
55 | } | ||
56 | |||
57 | public Double getMaintainNum() { | ||
58 | maintainNum =0.00d; | ||
59 | if (StringUtils.isNotEmpty(increase) && !increase.equals("0")) { | ||
60 | maintainNum = Double.parseDouble(downtime) / Integer.parseInt(increase); | ||
61 | maintainNum = DoubleOperaUtils.bigDecimalRound(maintainNum,2); | ||
62 | } | ||
63 | return maintainNum; | ||
64 | } | ||
65 | } |
... | @@ -19,6 +19,8 @@ import java.util.List; | ... | @@ -19,6 +19,8 @@ import java.util.List; |
19 | public class ProportionStatisticsVO { | 19 | public class ProportionStatisticsVO { |
20 | //类别 | 20 | //类别 |
21 | private String category; | 21 | private String category; |
22 | //类别等级id | ||
23 | private String equipmentLevel; | ||
22 | //占比 | 24 | //占比 |
23 | private String proportion = "0%"; | 25 | private String proportion = "0%"; |
24 | // 小时 | 26 | // 小时 | ... | ... |
... | @@ -53,4 +53,11 @@ public class InspectionTaskOverviewDetailVO { | ... | @@ -53,4 +53,11 @@ public class InspectionTaskOverviewDetailVO { |
53 | } | 53 | } |
54 | return processedAbnormalRate; | 54 | return processedAbnormalRate; |
55 | } | 55 | } |
56 | |||
57 | public Integer getNormalInspectionTaskCount() { | ||
58 | normalInspectionTaskCount = checkedInspectionTaskCount - abnormalInspectionTaskCount; | ||
59 | return normalInspectionTaskCount; | ||
60 | } | ||
61 | |||
62 | |||
56 | } | 63 | } | ... | ... |
-
请 注册 或 登录 后发表评论