| | |
| | | private IMdcSystemParametersService mdcSystemParametersService; |
| | | |
| | | @Resource |
| | | private ISysDictService sysDictService; |
| | | |
| | | @Resource |
| | | private IEquipmentStatisticalInfoService equipmentStatisticalInfoService; |
| | | private IMdcEquipmentFaultInfoService mdcEquipmentFaultInfoService; |
| | | |
| | | /** |
| | | * 计算设备单日运行数据 |
| | |
| | | } |
| | | if (!result.isEmpty()) { |
| | | this.saveBatch(result); |
| | | List<DictModel> dictList = sysDictService.queryDictItemsByCode("data_synchronization_flag"); |
| | | if (dictList != null && !dictList.isEmpty() && "0".equals(dictList.get(0).getValue())) { |
| | | List<EquipmentStatisticalInfo> list = this.dataHandle(result); |
| | | equipmentStatisticalInfoService.saveBatch(list); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private List<EquipmentStatisticalInfo> dataHandle(List<MdcEquipmentStatisticalInfo> list) { |
| | | List<EquipmentStatisticalInfo> result = new ArrayList<>(); |
| | | list.forEach(item -> { |
| | | EquipmentStatisticalInfo equipmentStatisticalInfo = new EquipmentStatisticalInfo(); |
| | | equipmentStatisticalInfo.setEquipment(item.getEquipmentId()); |
| | | equipmentStatisticalInfo.setTheDate(item.getTheDate()); |
| | | equipmentStatisticalInfo.setClosedLong(item.getCloseLong()); |
| | | equipmentStatisticalInfo.setOpeningLong(item.getOpenLong()); |
| | | equipmentStatisticalInfo.setErroringLong(item.getErrorLong()); |
| | | equipmentStatisticalInfo.setProcessingLong(item.getProcessLong()); |
| | | equipmentStatisticalInfo.setWaitingLong(item.getWaitLong()); |
| | | result.add(equipmentStatisticalInfo); |
| | | }); |
| | | return result; |
| | | mdcEquipmentFaultInfoService.runningAllEquFaultStatistical(dateTime); |
| | | } |
| | | |
| | | private List<MdcEquipmentStatisticalInfo> equipmentStatisticalProcess(Equipment equipment, String dateTime) { |
| | |
| | | List<MdcEquipmentRunningSection> equipmentRunningSectionList = mdcEquipmentRunningSectionService.listForEquipmentStatisticalInfo(equipment.getEquipmentid(), startDate, endDate); |
| | | return this.statisticsData(equipmentRunningSectionList, planTime, startDate, endDate, equipment); |
| | | } else { |
| | | //待验证 |
| | | Date end = DateUtils.plusTime(initDate, 1); |
| | | endDate = DateUtils.setTimeForDay(end, planTime); |
| | | List<MdcEquipmentRunningSection> equipmentRunningSectionList = mdcEquipmentRunningSectionService.listForEquipmentStatisticalInfo(equipment.getEquipmentid(), startDate, endDate); |