Merge remote-tracking branch 'origin/master' into master
正在显示
5 个修改的文件
包含
73 行增加
和
15 行删除
... | @@ -529,6 +529,8 @@ public class EquipmentController { | ... | @@ -529,6 +529,8 @@ public class EquipmentController { |
529 | String isMeterage = equipmentDTO.getEquipmentInfo().getIsMeterage();//是否计量设备 | 529 | String isMeterage = equipmentDTO.getEquipmentInfo().getIsMeterage();//是否计量设备 |
530 | String orderFiled = equipmentDTO.getOrderFiled(); | 530 | String orderFiled = equipmentDTO.getOrderFiled(); |
531 | boolean orderType = equipmentDTO.isOrderType(); | 531 | boolean orderType = equipmentDTO.isOrderType(); |
532 | String startTime = equipmentDTO.getStartTime(); | ||
533 | String endTime = equipmentDTO.getEndTime(); | ||
532 | 534 | ||
533 | List<String> equipmentLevelList = null; | 535 | List<String> equipmentLevelList = null; |
534 | Base base = BaseFactory.JOIN().select(EquipmentAsset.class).select(EquipmentInfo.class).select(EquipmentBrand.class).select(EquipmentCategory.class) | 536 | Base base = BaseFactory.JOIN().select(EquipmentAsset.class).select(EquipmentInfo.class).select(EquipmentBrand.class).select(EquipmentCategory.class) |
... | @@ -555,7 +557,9 @@ public class EquipmentController { | ... | @@ -555,7 +557,9 @@ public class EquipmentController { |
555 | .like(StringUtils.isNotEmpty(equipmentCode), "equipment_code", equipmentCode) | 557 | .like(StringUtils.isNotEmpty(equipmentCode), "equipment_code", equipmentCode) |
556 | .eq(StringUtils.isNotEmpty(equipmentStatus), "equipment_status", equipmentStatus) | 558 | .eq(StringUtils.isNotEmpty(equipmentStatus), "equipment_status", equipmentStatus) |
557 | .like(StringUtils.isNotEmpty(installPosition), EquipmentInfo::getInstallPosition, installPosition) | 559 | .like(StringUtils.isNotEmpty(installPosition), EquipmentInfo::getInstallPosition, installPosition) |
558 | .eq(StringUtils.isNotEmpty(equipmentDTO.getEquipmentInfo().getId()), "equipment_info.id", equipmentDTO.getEquipmentInfo().getId()); | 560 | .eq(StringUtils.isNotEmpty(equipmentDTO.getEquipmentInfo().getId()), "equipment_info.id", equipmentDTO.getEquipmentInfo().getId()) |
561 | .ge(StringUtils.isNotEmpty(startTime), "equipment_info.create_time", startTime) | ||
562 | .le(StringUtils.isNotEmpty(endTime), "equipment_info.create_time", endTime); | ||
559 | if (StringUtils.isNotEmpty(orderFiled)) { | 563 | if (StringUtils.isNotEmpty(orderFiled)) { |
560 | base.orderBy(true,orderType,"equipment_info." + getFiledName(orderFiled)); | 564 | base.orderBy(true,orderType,"equipment_info." + getFiledName(orderFiled)); |
561 | }else { | 565 | }else { | ... | ... |
... | @@ -9,8 +9,10 @@ import com.skua.common.constant.BusinessConstant; | ... | @@ -9,8 +9,10 @@ import com.skua.common.constant.BusinessConstant; |
9 | import com.skua.core.api.vo.Result; | 9 | import com.skua.core.api.vo.Result; |
10 | import com.skua.core.aspect.annotation.AutoLog; | 10 | import com.skua.core.aspect.annotation.AutoLog; |
11 | import com.skua.core.context.BaseContextHandler; | 11 | import com.skua.core.context.BaseContextHandler; |
12 | import com.skua.core.util.ConvertUtils; | ||
12 | import com.skua.modules.base.service.IBaseService; | 13 | import com.skua.modules.base.service.IBaseService; |
13 | import com.skua.modules.common.service.ICommonSqlService; | 14 | import com.skua.modules.common.service.ICommonSqlService; |
15 | import com.skua.modules.equipment.service.IEquipmentAnalysisService; | ||
14 | import com.skua.modules.equipment.service.IEquipmentMaintainTaskService; | 16 | import com.skua.modules.equipment.service.IEquipmentMaintainTaskService; |
15 | import com.skua.modules.equipment.service.IEquipmentRepairService; | 17 | import com.skua.modules.equipment.service.IEquipmentRepairService; |
16 | import com.skua.modules.equipment.vo.EquipmentMaintainRepairReportVO; | 18 | import com.skua.modules.equipment.vo.EquipmentMaintainRepairReportVO; |
... | @@ -19,6 +21,7 @@ import com.skua.modules.equipment.vo.EquipmentRepairForm; | ... | @@ -19,6 +21,7 @@ import com.skua.modules.equipment.vo.EquipmentRepairForm; |
19 | import com.skua.modules.system.entity.SysDepart; | 21 | import com.skua.modules.system.entity.SysDepart; |
20 | import com.skua.modules.system.service.ISysDepartService; | 22 | import com.skua.modules.system.service.ISysDepartService; |
21 | import com.skua.tool.dfs.CaseWhen; | 23 | import com.skua.tool.dfs.CaseWhen; |
24 | import com.skua.tool.util.DigitalUtils; | ||
22 | import com.skua.tool.util.JSUtils; | 25 | import com.skua.tool.util.JSUtils; |
23 | import io.swagger.annotations.Api; | 26 | import io.swagger.annotations.Api; |
24 | import io.swagger.annotations.ApiOperation; | 27 | import io.swagger.annotations.ApiOperation; |
... | @@ -50,6 +53,8 @@ public class EquipmentInfoMonthReportController { | ... | @@ -50,6 +53,8 @@ public class EquipmentInfoMonthReportController { |
50 | private IEquipmentRepairService equipmentRepairService; | 53 | private IEquipmentRepairService equipmentRepairService; |
51 | @Autowired | 54 | @Autowired |
52 | private IBaseService baseService; | 55 | private IBaseService baseService; |
56 | @Autowired | ||
57 | private IEquipmentAnalysisService equipmentAnalysisService; | ||
53 | 58 | ||
54 | @AutoLog(value = "设备月报-设备管理情况") | 59 | @AutoLog(value = "设备月报-设备管理情况") |
55 | @ApiOperation(value = "设备月报-设备管理情况", notes = "设备月报-设备管理情况") | 60 | @ApiOperation(value = "设备月报-设备管理情况", notes = "设备月报-设备管理情况") |
... | @@ -243,7 +248,7 @@ public class EquipmentInfoMonthReportController { | ... | @@ -243,7 +248,7 @@ public class EquipmentInfoMonthReportController { |
243 | sql += " left join (select t.depart_id , (sum(t.plan_cost)/10000) 'plan_cost' from equipment_maintain_plan t where t.release_status = '1' and t.start_time >= '"+startDate+" 00:00:00' and t.end_time <='"+endDate+" 23:59:59' group by t.depart_id )bbb on bbb.depart_id = d.id "; | 248 | sql += " left join (select t.depart_id , (sum(t.plan_cost)/10000) 'plan_cost' from equipment_maintain_plan t where t.release_status = '1' and t.start_time >= '"+startDate+" 00:00:00' and t.end_time <='"+endDate+" 23:59:59' group by t.depart_id )bbb on bbb.depart_id = d.id "; |
244 | sql += " left join ( select depart_id, (ifnull(sum(total_cost),0)/10000) 'repair_cost' from equipment_repair where reality_maintenance_end_time >= '"+startDate+" 00:00:00' and reality_maintenance_end_time <='"+endDate+" 23:59:59' group by depart_id ) ccc on ccc.depart_id = d.id "; | 249 | sql += " left join ( select depart_id, (ifnull(sum(total_cost),0)/10000) 'repair_cost' from equipment_repair where reality_maintenance_end_time >= '"+startDate+" 00:00:00' and reality_maintenance_end_time <='"+endDate+" 23:59:59' group by depart_id ) ccc on ccc.depart_id = d.id "; |
245 | sql += " left join (select depart_id,count(1) 'repair_form_total_count' from equipment_repair where repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' group by depart_id ) ddd on ddd.depart_id = d.id "; | 250 | sql += " left join (select depart_id,count(1) 'repair_form_total_count' from equipment_repair where repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' group by depart_id ) ddd on ddd.depart_id = d.id "; |
246 | sql += " left join ( select depart_id,count(1) 'repair_form_complete_count' from equipment_repair where finish_flag in ('ywx','yys') and reality_maintenance_end_time >= '"+startDate+" 00:00:00' and reality_maintenance_end_time <='"+endDate+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id "; | 251 | sql += " left join ( select depart_id,count(1) 'repair_form_complete_count' from equipment_repair where finish_flag in ('ywx','yys') and repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id "; |
247 | sql += " left join (select depart_id,count(1) 'complete_count' from inspection_task where task_state = '2' and task_start_time >= '"+startDate+" 00:00:00' and task_end_time <='"+endDate+" 23:59:59' group by depart_id ) fff on fff.depart_id = d.id "; | 252 | sql += " left join (select depart_id,count(1) 'complete_count' from inspection_task where task_state = '2' and task_start_time >= '"+startDate+" 00:00:00' and task_end_time <='"+endDate+" 23:59:59' group by depart_id ) fff on fff.depart_id = d.id "; |
248 | sql += " left join (select depart_id,count(1) 'total_count' from inspection_task where task_start_time >= '"+startDate+" 00:00:00' and task_end_time <='"+endDate+" 23:59:59' group by depart_id ) ggg on ggg.depart_id = d.id "; | 253 | sql += " left join (select depart_id,count(1) 'total_count' from inspection_task where task_start_time >= '"+startDate+" 00:00:00' and task_end_time <='"+endDate+" 23:59:59' group by depart_id ) ggg on ggg.depart_id = d.id "; |
249 | sql += " where d.depart_type = 1 "; | 254 | sql += " where d.depart_type = 1 "; |
... | @@ -251,8 +256,22 @@ public class EquipmentInfoMonthReportController { | ... | @@ -251,8 +256,22 @@ public class EquipmentInfoMonthReportController { |
251 | sql += " and d.id in ("+ JSUtils.quoteEach(departIds,",") +") "; | 256 | sql += " and d.id in ("+ JSUtils.quoteEach(departIds,",") +") "; |
252 | } | 257 | } |
253 | sql += " order by aaa.intact desc "; | 258 | sql += " order by aaa.intact desc "; |
254 | sql += " ) TTT where (TTT.intact+TTT.plan_cost+TTT.repair_cost+TTT.repair_form_complete_rate+TTT.repair_form_complete_count+TTT.inspection_complete_rate)>0"; | 259 | sql += " ) TTT where (TTT.intact+TTT.plan_cost+TTT.repair_cost+TTT.repair_form_complete_rate+TTT.repair_form_complete_count+TTT.inspection_complete_rate)>=0"; |
255 | return commonSqlService.queryForList(sql); | 260 | List<Map<String, Object>> queryMapList0 = commonSqlService.queryForList(sql); |
261 | List<Map<String, Object>> intactRateMapList = equipmentAnalysisService.equipmentInTactRateByDepart(new HashMap<String, Object>(){{ | ||
262 | put("startTime", startDate + BusinessConstant.startTimeSuffix); | ||
263 | put("endTime", endDate + BusinessConstant.endTimeSuffix); | ||
264 | put("departId", departIds); | ||
265 | }}); | ||
266 | for (Map<String, Object> item: queryMapList0) { | ||
267 | for (Map<String, Object> intactRateMap: intactRateMapList) { | ||
268 | if (item.get("depart_id").equals(intactRateMap.get("departId"))) { | ||
269 | item.put("intact", DigitalUtils.nPoint(ConvertUtils.getDouble(intactRateMap.get("intactRate"), 0) * 100, 2)); | ||
270 | break; | ||
271 | } | ||
272 | } | ||
273 | } | ||
274 | return queryMapList0; | ||
256 | } | 275 | } |
257 | //2 设备大修、更新开展情况 | 276 | //2 设备大修、更新开展情况 |
258 | private List<Map<String,Object>> equipmentMaintainList(String departIds,String startDate,String endDate){ | 277 | private List<Map<String,Object>> equipmentMaintainList(String departIds,String startDate,String endDate){ |
... | @@ -297,7 +316,7 @@ public class EquipmentInfoMonthReportController { | ... | @@ -297,7 +316,7 @@ public class EquipmentInfoMonthReportController { |
297 | String sql ="select d.depart_name, aaa.* from ("; | 316 | String sql ="select d.depart_name, aaa.* from ("; |
298 | sql += " select t.id 'info_id', t.depart_id , t.equipment_name, t.asset_amount, di.item_text 'equipment_level' from equipment_info t "; | 317 | sql += " select t.id 'info_id', t.depart_id , t.equipment_name, t.asset_amount, di.item_text 'equipment_level' from equipment_info t "; |
299 | sql += " left join sys_dict_item di on di.item_value = t.equipment_level "; | 318 | sql += " left join sys_dict_item di on di.item_value = t.equipment_level "; |
300 | sql += " where t.install_date >= '"+startDate+"' and t.install_date <= '"+endDate+"' "; | 319 | sql += " where t.create_time >= '"+startDate+"' and t.create_time <= '"+endDate+"' "; |
301 | sql += ")aaa left join sys_depart d on aaa.depart_id = d.id "; | 320 | sql += ")aaa left join sys_depart d on aaa.depart_id = d.id "; |
302 | if(StringUtils.isNotEmpty(departIds)){ | 321 | if(StringUtils.isNotEmpty(departIds)){ |
303 | sql += " and aaa.depart_id in ("+ JSUtils.quoteEach(departIds,",") +") "; | 322 | sql += " and aaa.depart_id in ("+ JSUtils.quoteEach(departIds,",") +") "; | ... | ... |
... | @@ -24,4 +24,8 @@ public class EquipmentDTO { | ... | @@ -24,4 +24,8 @@ public class EquipmentDTO { |
24 | private String orderFiled;//排序字段 | 24 | private String orderFiled;//排序字段 |
25 | private boolean orderType;//排序类型,true:升序,false:降序 | 25 | private boolean orderType;//排序类型,true:升序,false:降序 |
26 | 26 | ||
27 | private String startTime; | ||
28 | |||
29 | private String endTime; | ||
30 | |||
27 | } | 31 | } | ... | ... |
... | @@ -49,7 +49,7 @@ public class EquipmentAnalysisServiceImpl implements IEquipmentAnalysisService { | ... | @@ -49,7 +49,7 @@ public class EquipmentAnalysisServiceImpl implements IEquipmentAnalysisService { |
49 | .in(StringUtils.isNotEmpty(departId), "depart_id", departIdList) | 49 | .in(StringUtils.isNotEmpty(departId), "depart_id", departIdList) |
50 | .groupBy("depart_id"); | 50 | .groupBy("depart_id"); |
51 | List<Map<String, Object>> equipmentInfoList = equipmentInfoService.listMaps(queryWrapper0); | 51 | List<Map<String, Object>> equipmentInfoList = equipmentInfoService.listMaps(queryWrapper0); |
52 | // 机构 => 设备数量 | 52 | // 机构 => 设备数量 |
53 | Map<String, Integer> departId2EquipCountMap = equipmentInfoList.stream().collect(Collectors.toMap(item -> ConvertUtils.getString(item.get("depart_id")), item -> Integer.parseInt(ConvertUtils.getString(item.get("total"))), (v1, v2) -> v2)); | 53 | Map<String, Integer> departId2EquipCountMap = equipmentInfoList.stream().collect(Collectors.toMap(item -> ConvertUtils.getString(item.get("depart_id")), item -> Integer.parseInt(ConvertUtils.getString(item.get("total"))), (v1, v2) -> v2)); |
54 | // 查询设备的故障时间 | 54 | // 查询设备的故障时间 |
55 | QueryWrapper<EquipmentRepair> queryWrapper1 = new QueryWrapper<>(); | 55 | QueryWrapper<EquipmentRepair> queryWrapper1 = new QueryWrapper<>(); |
... | @@ -92,15 +92,17 @@ public class EquipmentAnalysisServiceImpl implements IEquipmentAnalysisService { | ... | @@ -92,15 +92,17 @@ public class EquipmentAnalysisServiceImpl implements IEquipmentAnalysisService { |
92 | String tmpDepartId = entry.getKey(); | 92 | String tmpDepartId = entry.getKey(); |
93 | int equipCount = entry.getValue(); | 93 | int equipCount = entry.getValue(); |
94 | // 计算完好率 | 94 | // 计算完好率 |
95 | long value0 = departId2Equip2FaultTimeMap.getOrDefault(tmpDepartId, new HashMap<>()).values().stream().mapToLong(item -> item).sum(); | 95 | long faultSecond = departId2Equip2FaultTimeMap.getOrDefault(tmpDepartId, new HashMap<>()).values().stream().mapToLong(item -> item).sum(); |
96 | long value1 = equipCount * interval; | 96 | long allSecond = equipCount * interval; |
97 | double intactRate = 1 - 1.0 * value0 / value1; | 97 | double intactRate = 1 - 1.0 * faultSecond / allSecond; |
98 | String departName = sysDepartDictMap.get(tmpDepartId); | 98 | String departName = sysDepartDictMap.get(tmpDepartId); |
99 | // 结果 | 99 | // 结果 |
100 | Map<String, Object> resMap = new HashMap<>(4); | 100 | Map<String, Object> resMap = new HashMap<>(4); |
101 | resMap.put("departId", tmpDepartId); | 101 | resMap.put("departId", tmpDepartId); |
102 | resMap.put("departName", departName); | 102 | resMap.put("departName", departName); |
103 | resMap.put("intactRate", intactRate); | 103 | resMap.put("intactRate", intactRate); |
104 | resMap.put("faultSecond", faultSecond); | ||
105 | resMap.put("intactSecond", allSecond - faultSecond); | ||
104 | resMapList.add(resMap); | 106 | resMapList.add(resMap); |
105 | } | 107 | } |
106 | return resMapList; | 108 | return resMapList; |
... | @@ -170,13 +172,15 @@ public class EquipmentAnalysisServiceImpl implements IEquipmentAnalysisService { | ... | @@ -170,13 +172,15 @@ public class EquipmentAnalysisServiceImpl implements IEquipmentAnalysisService { |
170 | long interval = DateUtils.dateStr2Sec(timeRangeArray[1], BusinessConstant.dateFormat) - DateUtils.dateStr2Sec(timeRangeArray[0], BusinessConstant.dateFormat) + 1; | 172 | long interval = DateUtils.dateStr2Sec(timeRangeArray[1], BusinessConstant.dateFormat) - DateUtils.dateStr2Sec(timeRangeArray[0], BusinessConstant.dateFormat) + 1; |
171 | Map<String, Long> equip2FaultTimeMap = entry.getValue(); | 173 | Map<String, Long> equip2FaultTimeMap = entry.getValue(); |
172 | // 计算完好率 | 174 | // 计算完好率 |
173 | long value0 = equip2FaultTimeMap.values().stream().mapToLong(Long::longValue).sum(); | 175 | long faultSecond = equip2FaultTimeMap.values().stream().mapToLong(Long::longValue).sum(); |
174 | long value1 = equipTotal * interval; | 176 | long allSecond = equipTotal * interval; |
175 | double intactRate = 1 - 1.0 * value0 / value1; | 177 | double intactRate = 1 - 1.0 * faultSecond / allSecond; |
176 | // 结果 | 178 | // 结果 |
177 | Map<String, Object> resMap = new HashMap<>(4); | 179 | Map<String, Object> resMap = new HashMap<>(4); |
178 | resMap.put("time", timeRange); | 180 | resMap.put("time", timeRange); |
179 | resMap.put("intactRate", intactRate); | 181 | resMap.put("intactRate", intactRate); |
182 | resMap.put("faultSecond", faultSecond); | ||
183 | resMap.put("intactSecond", allSecond - faultSecond); | ||
180 | resMapList.add(resMap); | 184 | resMapList.add(resMap); |
181 | } | 185 | } |
182 | return resMapList; | 186 | return resMapList; | ... | ... |
... | @@ -3,6 +3,7 @@ package com.skua.modules.equipment.service.impl; | ... | @@ -3,6 +3,7 @@ package com.skua.modules.equipment.service.impl; |
3 | import cn.hutool.core.util.StrUtil; | 3 | import cn.hutool.core.util.StrUtil; |
4 | import com.baomidou.mybatisplus.core.metadata.IPage; | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
6 | import com.skua.common.constant.BusinessConstant; | ||
6 | import com.skua.core.context.BaseContextHandler; | 7 | import com.skua.core.context.BaseContextHandler; |
7 | import com.skua.core.util.ConvertUtils; | 8 | import com.skua.core.util.ConvertUtils; |
8 | import com.skua.core.util.DoubleOperaUtils; | 9 | import com.skua.core.util.DoubleOperaUtils; |
... | @@ -10,9 +11,11 @@ import com.skua.modules.common.mapper.CommonSqlMapper; | ... | @@ -10,9 +11,11 @@ import com.skua.modules.common.mapper.CommonSqlMapper; |
10 | import com.skua.modules.common.service.ICommonSqlService; | 11 | import com.skua.modules.common.service.ICommonSqlService; |
11 | import com.skua.modules.equipment.dto.ReportStatisticsDTO; | 12 | import com.skua.modules.equipment.dto.ReportStatisticsDTO; |
12 | import com.skua.modules.equipment.mapper.ProductionEquipmentMapper; | 13 | import com.skua.modules.equipment.mapper.ProductionEquipmentMapper; |
14 | import com.skua.modules.equipment.service.IEquipmentAnalysisService; | ||
13 | import com.skua.modules.equipment.service.IProductionEquipmentService; | 15 | import com.skua.modules.equipment.service.IProductionEquipmentService; |
14 | import com.skua.modules.equipment.vo.*; | 16 | import com.skua.modules.equipment.vo.*; |
15 | import com.skua.tool.util.DateUtils; | 17 | import com.skua.tool.util.DateUtils; |
18 | import com.skua.tool.util.DigitalUtils; | ||
16 | import com.skua.tool.util.JSUtils; | 19 | import com.skua.tool.util.JSUtils; |
17 | import io.swagger.annotations.ApiModelProperty; | 20 | import io.swagger.annotations.ApiModelProperty; |
18 | import org.apache.commons.lang3.StringUtils; | 21 | import org.apache.commons.lang3.StringUtils; |
... | @@ -43,6 +46,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -43,6 +46,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
43 | private ProductionEquipmentMapper productionEquipmentMapper; | 46 | private ProductionEquipmentMapper productionEquipmentMapper; |
44 | @Autowired | 47 | @Autowired |
45 | private ICommonSqlService commonSqlService; | 48 | private ICommonSqlService commonSqlService; |
49 | @Autowired | ||
50 | private IEquipmentAnalysisService equipmentAnalysisService; | ||
46 | 51 | ||
47 | private static final String MONTH_START = "-01 00:00:00"; | 52 | private static final String MONTH_START = "-01 00:00:00"; |
48 | private static final String MONTH_END = "-31 23:59:59"; | 53 | private static final String MONTH_END = "-31 23:59:59"; |
... | @@ -74,6 +79,13 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -74,6 +79,13 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
74 | Double sbwhCost = 0d; //维护费用 | 79 | Double sbwhCost = 0d; //维护费用 |
75 | Double sbbyCost = 0d;//保养费用 | 80 | Double sbbyCost = 0d;//保养费用 |
76 | Double jjwxCost = 0d; //基建维修费用 | 81 | Double jjwxCost = 0d; //基建维修费用 |
82 | |||
83 | // 开始时间往前推一个月,方便计算环比 | ||
84 | String startTime0 = DateUtils.date2Str(DateUtils.prevMonth(DateUtils.str2Date(reportStatisticsDTO.getStartTime(), BusinessConstant.dateFormat)), BusinessConstant.dateFormat); | ||
85 | // endTime修改到本月月底 | ||
86 | int days = DateUtils.lengthOfSomeMonth(Integer.parseInt(reportStatisticsDTO.getEndTime().split("-")[0]), Integer.parseInt(reportStatisticsDTO.getEndTime().split("-")[1])); | ||
87 | String endTime0 = reportStatisticsDTO.getEndTime().substring(0, 7) + "-" + days + BusinessConstant.endTimeSuffix; | ||
88 | |||
77 | //ab总数 | 89 | //ab总数 |
78 | Integer ABEquipmentNum = 0; | 90 | Integer ABEquipmentNum = 0; |
79 | if (reportStatisticsDTO.getTimeUnit() != null && reportStatisticsDTO.getTimeUnit() == 3) { | 91 | if (reportStatisticsDTO.getTimeUnit() != null && reportStatisticsDTO.getTimeUnit() == 3) { |
... | @@ -245,21 +257,36 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -245,21 +257,36 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
245 | } | 257 | } |
246 | } | 258 | } |
247 | 259 | ||
260 | List<Map<String, Object>> inTactRateMapList = equipmentAnalysisService.equipmentInTactRateByTime(new HashMap<String, Object>(){{ | ||
261 | put("startTime", startTime0); | ||
262 | put("endTime", endTime0); | ||
263 | put("timeType", "month"); | ||
264 | put("departId", ""); | ||
265 | }}); | ||
266 | |||
248 | productionEquipmentVO.setEquipmentNum(equipmentNum); | 267 | productionEquipmentVO.setEquipmentNum(equipmentNum); |
249 | productionEquipmentVO.setAbEquipmentNum(ABEquipmentNum); | 268 | productionEquipmentVO.setAbEquipmentNum(ABEquipmentNum); |
250 | //本月新增 | 269 | //本月新增 |
251 | productionEquipmentVO.setIncrease(increase); | 270 | productionEquipmentVO.setIncrease(increase); |
252 | //设备完好率 | 271 | //设备完好率 |
253 | BigDecimal bigDecimal = new BigDecimal(ConvertUtils.getDou(v,0d)*100).setScale(2, BigDecimal.ROUND_HALF_UP); | 272 | BigDecimal bigDecimal = new BigDecimal(ConvertUtils.getDou(v,0d)*100).setScale(2, BigDecimal.ROUND_HALF_UP); |
254 | productionEquipmentVO.setEquipmentIntactRate(bigDecimal.toString() + "%"); | 273 | // productionEquipmentVO.setEquipmentIntactRate(bigDecimal.toString() + "%"); |
274 | productionEquipmentVO.setEquipmentIntactRate(DigitalUtils.nPoint(ConvertUtils.getDouble(inTactRateMapList.get(inTactRateMapList.size() - 1).get("intactRate"), 0D) * 100, 2) + "%"); | ||
255 | //设备完好总台日 | 275 | //设备完好总台日 |
256 | BigDecimal bigDecimal5 = new BigDecimal(goodDay).setScale(2, BigDecimal.ROUND_HALF_UP); | 276 | BigDecimal bigDecimal5 = new BigDecimal(goodDay).setScale(2, BigDecimal.ROUND_HALF_UP); |
257 | productionEquipmentVO.setEquipmentIntactDay(bigDecimal5.toString()); | 277 | // productionEquipmentVO.setEquipmentIntactDay(bigDecimal5.toString()); |
278 | // 从第2条开始算,因为开始时间往前推了一个月,方便计算环比 | ||
279 | long okSecond = 0L; | ||
280 | for (int i = 1; i < inTactRateMapList.size(); i++) { | ||
281 | okSecond += Long.parseLong(ConvertUtils.getString(inTactRateMapList.get(i).get("intactSecond"))); | ||
282 | } | ||
283 | productionEquipmentVO.setEquipmentIntactDay(DigitalUtils.nPoint(ConvertUtils.getDouble(okSecond, 0D) / 3600 / 24, 1)); | ||
258 | //维护台次 | 284 | //维护台次 |
259 | productionEquipmentVO.setMaintainUnits(repairNum); | 285 | productionEquipmentVO.setMaintainUnits(repairNum); |
260 | //设备完好率月环比 | 286 | //设备完好率月环比 |
261 | BigDecimal bigDecimal1 = new BigDecimal(goodDayRing).setScale(2, BigDecimal.ROUND_HALF_UP); | 287 | BigDecimal bigDecimal1 = new BigDecimal(goodDayRing).setScale(2, BigDecimal.ROUND_HALF_UP); |
262 | productionEquipmentVO.setEquipmentIntactRingRate(bigDecimal1.toString() + "%"); | 288 | // productionEquipmentVO.setEquipmentIntactRingRate(bigDecimal1.toString() + "%"); |
289 | productionEquipmentVO.setEquipmentIntactRingRate(DigitalUtils.nPoint(ConvertUtils.getDouble(inTactRateMapList.get(inTactRateMapList.size() - 2).get("intactRate"), 0D) * 100, 2) + "%"); | ||
263 | //维修计划完成率 | 290 | //维修计划完成率 |
264 | BigDecimal bigDecimal2 = new BigDecimal(repairCompleteRate).setScale(2, BigDecimal.ROUND_HALF_UP); | 291 | BigDecimal bigDecimal2 = new BigDecimal(repairCompleteRate).setScale(2, BigDecimal.ROUND_HALF_UP); |
265 | productionEquipmentVO.setRepairCompleteRate(bigDecimal2.toString() + "%"); | 292 | productionEquipmentVO.setRepairCompleteRate(bigDecimal2.toString() + "%"); | ... | ... |
-
请 注册 或 登录 后发表评论