| | |
| | | //获取running运行的日志记录 |
| | | List<MdcEquipmentRunningSection> list = this.equipmentRunningTracesLog(equipment.getEquipmentid()); |
| | | if (list != null && !list.isEmpty()) { |
| | | //List<MdcEquipmentRunningSection> equipList = addSequenceNumber(list); //添加程序号 |
| | | this.ergodicTrim(list); |
| | | super.saveBatch(list); |
| | | List<MdcEquipmentRunningSection> equipList = addSequenceNumber(list); //添加程序号 |
| | | this.ergodicTrim(equipList); |
| | | super.saveBatch(equipList); |
| | | } |
| | | //获取报警的日志记录 |
| | | List<MdcEquipmentRunningSection> errorList = this.equipmentRunningTracesErrorLog(equipment.getEquipmentid()); |
| | |
| | | this.dataSynchronizationHandler(list, errorList); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设备运行日志添加程序号 |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | | public List<MdcEquipmentRunningSection> addSequenceNumber(List<MdcEquipmentRunningSection> list) { |
| | | if (list == null || list.size() < 1) { |
| | | return Collections.emptyList(); |
| | | } |
| | | Equipment equip = null; |
| | | for (MdcEquipmentRunningSection e : list) { |
| | | if (e.getStatus() == 3) { |
| | | equip = equipmentService.getOne(new LambdaQueryWrapper<Equipment>().eq(Equipment::getEquipmentid, e.getEquipmentId())); |
| | | if (StringUtils.isNotBlank(equip.getDrivetype()) && equip.getDrivetype().startsWith("FANUC")) { |
| | | List<EquipmentMachingDto> esList = equipmentWorkLineService.getEquipProgramNum(equip.getDrivetype(), equip.getEquipmentid(), |
| | | e.getStartTime(), e.getEndTime()); |
| | | if (esList != null && esList.size() > 1) { |
| | | e.setSequenceNumber(esList.get(0).getProgramnumber()); |
| | | } |
| | | } else if (StringUtils.isNotBlank(equip.getDrivetype()) && equip.getDrivetype().startsWith("SIEMENS")) { |
| | | List<EquipmentMachingDto> esList = equipmentWorkLineService.getEquipmentSequencenumber(equip.getDrivetype() + "_" + equip.getEquipmentid(), e.getStartTime(), e.getEndTime()); |
| | | if (esList != null && esList.size() > 1) { |
| | | e.setSequenceNumber(esList.get(0).getSequencenumber()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | |
| | | return this.baseMapper.findAlarmCountByDate(startDate, endDate, vo); |
| | | } |
| | | |
| | | @Override |
| | | public List<MdcEquipmentRunningSection> selectRunningData(String equipmentId, Date startDate, Date endDate) { |
| | | return this.baseMapper.selectRunningData(equipmentId, startDate, endDate); |
| | | } |
| | | |
| | | private Map<String, List<MdcEquipmentRunningSectionDto>> logCharts(MdcEquipmentRunningSectionVo equipmentRunningSectionVo, String date) { |
| | | Map<String, List<MdcEquipmentRunningSectionDto>> map = new HashMap<>(); |
| | | List<MdcEquipmentRunningSectionDto> normal = new ArrayList<>(); |