| | |
| | | import com.github.xingshuangs.iot.protocol.s7.serializer.S7Serializer; |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import com.mes.alarm.entity.ProductAlarmInfo; |
| | | import com.mes.alarm.service.ProductAlarmInfoService; |
| | | import com.mes.base.entity.HollowBigStorageCageBaseInfo; |
| | | import com.mes.bigstoragecagetask.entity.BigStorageCageTask; |
| | | import com.mes.bigstoragecagetask.service.BigStorageCageTaskService; |
| | |
| | | @Qualifier("CMJ1ModbusTcp") |
| | | ModbusTcp CMJ1ModbusTcp; |
| | | |
| | | @Resource |
| | | private ProductAlarmInfoService productAlarmInfoService; |
| | | |
| | | private static final String BIG_STORAGE_CAGE_IN_TWO_TASK = "big_storage_cage_in_two_task"; |
| | | private static final String BIG_STORAGE_CAGE_OUT_TWO_TASK = "big_storage_cage_out_two_task"; |
| | | |
| | | private static final List<Integer> ONE_LINE_FIRST = Arrays.asList(930, 931, 932); |
| | | private static final List<Integer> TWO_LINE_FIRST = Arrays.asList(931, 930, 932); |
| | | |
| | | |
| | | private static final String ALARM_MODULE = "中空"; |
| | | private static final String ALARM_TYPE = "中空大理片"; |
| | | private static final String ALARM_CODE_SIZE = "sizeSame"; |
| | | private static final String ALARM_CODE_ID = "idSame"; |
| | | |
| | | /** |
| | | * 直通格子 |
| | | */ |
| | |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void inBigStorageTask() throws Exception { |
| | | public void inBigStorageTask() { |
| | | List<ProductAlarmInfo> alarmInfos = productAlarmInfoService.list(new LambdaQueryWrapper<ProductAlarmInfo>() |
| | | .eq(ProductAlarmInfo::getState, Const.LOAD_RAW_GLASS_NEW) |
| | | .eq(ProductAlarmInfo::getAlarmModule, ALARM_MODULE) |
| | | .eq(ProductAlarmInfo::getAlarmType, ALARM_TYPE)); |
| | | if (CollectionUtil.isNotEmpty(alarmInfos)) { |
| | | log.info("界面报警,等待人工干预处理"); |
| | | return; |
| | | } |
| | | S7DataZKDLPOne s7DataZKDLPOne = s7SerializerZKDLPOne.read(S7DataZKDLPOne.class); |
| | | log.info("进片任务读取s7DataZKDLPOne:{}", s7DataZKDLPOne); |
| | | Boolean inkageEntity = s7DataZKDLPOne.getMesControl(); |
| | | if (true != inkageEntity) { |
| | | if (!inkageEntity) { |
| | | log.info("当前为非联机状态,结束进片任务"); |
| | | return; |
| | | } |
| | | String requestEntity = s7DataZKDLPOne.getRequestMes().toString(); |
| | | if (!"1".equals(requestEntity)) { |
| | | Integer requestEntity = s7DataZKDLPOne.getRequestMes(); |
| | | if (1 != requestEntity) { |
| | | log.info("当前未收到进片请求,结束进片任务"); |
| | | return; |
| | | } |
| | | String mesReplyEntity = s7DataZKDLPOne.getMesReply().toString(); |
| | | if ("1".equals(mesReplyEntity)) { |
| | | Integer mesReplyEntity = s7DataZKDLPOne.getMesReply(); |
| | | if (1 == mesReplyEntity) { |
| | | log.info("有正在执行的任务,结束进片任务"); |
| | | return; |
| | | } |
| | | |
| | | List<BigStorageCageTask> inTaskList = new ArrayList(); |
| | | String fromOpcUa = s7DataZKDLPOne.getFrom1().toString(); |
| | | Integer from = s7DataZKDLPOne.getFrom1(); |
| | | List<String> glassIdList = new ArrayList<>(); |
| | | List<String> requestWords = s7DataZKDLPOne.getIds(); |
| | | for (int i = 1; i <= 6; i++) { |
| | |
| | | if (null != requestWord && !requestWord.isEmpty()) { |
| | | BigStorageCageTask task = new BigStorageCageTask(); |
| | | task.setGlassId(requestWord); |
| | | task.setStartSlot(Integer.parseInt(fromOpcUa)); |
| | | task.setStartSlot(from); |
| | | inTaskList.add(task); |
| | | glassIdList.add(requestWord); |
| | | continue; |
| | |
| | | for (Map.Entry<String, Long> entry : glassCountMap.entrySet()) { |
| | | if (entry.getValue() > 1) { |
| | | log.info("进片玻璃{}存在相同,结束本次任务", entry.getKey()); |
| | | ProductAlarmInfo alarmInfo = new ProductAlarmInfo(); |
| | | alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW); |
| | | alarmInfo.setAlarmModule(ALARM_MODULE); |
| | | alarmInfo.setAlarmType(ALARM_TYPE); |
| | | alarmInfo.setAlarmCode(ALARM_CODE_ID); |
| | | alarmInfo.setAlarmMessage(entry.getKey()); |
| | | productAlarmInfoService.save(alarmInfo); |
| | | //向plc发送报警:同一车进片玻璃存在相同 |
| | | s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setAlramSignal(2); |
| | |
| | | if (CollectionUtil.isNotEmpty(detailsList)) { |
| | | log.info("理片笼存在相同的进片玻璃{},结束本次任务", detailsList); |
| | | //向plc发送报警:理片笼存在相同的进片玻璃 |
| | | List<String> sameGlassIds = detailsList.stream() |
| | | .map(HollowBigStorageCageDetails::getGlassId) |
| | | .collect(Collectors.toList()); |
| | | ProductAlarmInfo alarmInfo = new ProductAlarmInfo(); |
| | | alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW); |
| | | alarmInfo.setAlarmModule(ALARM_MODULE); |
| | | alarmInfo.setAlarmType(ALARM_TYPE); |
| | | alarmInfo.setAlarmCode(ALARM_CODE_ID); |
| | | alarmInfo.setAlarmMessage(sameGlassIds.toString()); |
| | | productAlarmInfoService.save(alarmInfo); |
| | | s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | s7DataZKDLPOne.setAlramSignal(4); |
| | | s7SerializerZKDLPOne.write(s7DataZKDLPOne); |
| | |
| | | List<HollowBigStorageCageHistoryTask> historyTasks = new ArrayList<>(); |
| | | |
| | | Integer glassGap = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_GLASS_GAP); |
| | | try { |
| | | log.info("开始计算目标格子,玻璃id有:{}", inTaskList); |
| | | if (slotMaxHeight > Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) && glassInfoList.get(0).getThickness() < slotMaxthickness) { |
| | | for (BigStorageCageTask task : inTaskList) { |
| | | GlassInfo info = glassListMap.get(task.getGlassId()).get(0); |
| | | HollowBigStorageDTO bigStorageDTO = hollowGlassRelationInfoService.queryHollowTargetSlot(info.getFlowCardId(), |
| | | |
| | | log.info("开始计算目标格子,玻璃id有:{}", inTaskList); |
| | | if (slotMaxHeight > Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) && glassInfoList.get(0).getThickness() < slotMaxthickness) { |
| | | for (BigStorageCageTask task : inTaskList) { |
| | | GlassInfo info = glassListMap.get(task.getGlassId()).get(0); |
| | | HollowBigStorageDTO bigStorageDTO = null; |
| | | try { |
| | | bigStorageDTO = hollowGlassRelationInfoService.queryHollowTargetSlot(info.getFlowCardId(), info.getGlassType(), |
| | | info.getWidth(), info.getHeight(), info.getTotalLayer(), info.getLayer()); |
| | | // 临时更新格子的剩余尺寸:防止相邻玻璃进同一格子造成剩余尺寸不足,玻璃越界的情况,任务完成后再次更新大理片笼表剩余宽度(按照笼内玻璃数量更新大理片笼剩余尺寸) |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, bigStorageDTO.getRemainWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap) |
| | | .eq(HollowBigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | task.setTargetSlot(bigStorageDTO.getSlot()); |
| | | task.setGlassId(info.getGlassId()); |
| | | //存放历史任务 |
| | | HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(task, historyTask); |
| | | historyTask.setTaskType(Const.BIG_STORAGE_AFTER_IN); |
| | | historyTask.setGlassCount(glassInfoList.size()); |
| | | historyTask.setTaskState(Const.ENGINEERING_NEW); |
| | | historyTasks.add(historyTask); |
| | | //存放详情数据 |
| | | HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails(); |
| | | BeanUtils.copyProperties(bigStorageDTO, cageDetails); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | cageDetails.setState(Const.GLASS_STATE_NEW); |
| | | cageDetails.setSequence(bigStorageDTO.getSlotSequence()); |
| | | cageDetails.setGap(glassGap); |
| | | cageDetails.setId(null); |
| | | hollowBigStorageCageDetailsService.save(cageDetails); |
| | | } catch (Exception exception) { |
| | | log.info("进片任务执行中发生异常:{}", exception); |
| | | //保存故障信息 |
| | | ProductAlarmInfo alarmInfo = new ProductAlarmInfo(); |
| | | alarmInfo.setState(Const.LOAD_RAW_GLASS_NEW); |
| | | alarmInfo.setAlarmModule(ALARM_MODULE); |
| | | alarmInfo.setAlarmType(ALARM_TYPE); |
| | | alarmInfo.setAlarmCode(ALARM_CODE_SIZE); |
| | | alarmInfo.setAlarmMessage(info.getGlassId()); |
| | | productAlarmInfoService.save(alarmInfo); |
| | | //重置详情表数据 |
| | | hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | | .set(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_TAKE) |
| | | .eq(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_NEW)); |
| | | //重置中空关系表数据 |
| | | hollowGlassRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassRelationInfo>() |
| | | .set(HollowGlassRelationInfo::getGlassId, cageDetails.getGlassId()) |
| | | .set(HollowGlassRelationInfo::getTemperingLayoutId, cageDetails.getTemperingLayoutId()) |
| | | .set(HollowGlassRelationInfo::getTemperingFeedSequence, cageDetails.getTemperingFeedSequence()) |
| | | .set(HollowGlassRelationInfo::getEngineerId, cageDetails.getEngineerId()) |
| | | .set(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_OCCUPY) |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, bigStorageDTO.getFlowCardId()) |
| | | .eq(HollowGlassRelationInfo::getLayer, bigStorageDTO.getLayer()) |
| | | .eq(HollowGlassRelationInfo::getVirtualSlot, bigStorageDTO.getVirtualSlot()) |
| | | .eq(HollowGlassRelationInfo::getSlotSequence, bigStorageDTO.getSlotSequence()) |
| | | .eq(HollowGlassRelationInfo::getHollowSequence, bigStorageDTO.getHollowSequence()) |
| | | .set(HollowGlassRelationInfo::getGlassId, null) |
| | | .set(HollowGlassRelationInfo::getTemperingLayoutId, null) |
| | | .set(HollowGlassRelationInfo::getTemperingFeedSequence, null) |
| | | .set(HollowGlassRelationInfo::getEngineerId, null) |
| | | .set(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_NEW) |
| | | .eq(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_OCCUPY) |
| | | ); |
| | | //将格子尺寸恢复 |
| | | hollowBigStorageCageService.resetCage(); |
| | | return; |
| | | } |
| | | } else { |
| | | BigStorageCageTask task = inTaskList.get(0); |
| | | task.setTargetSlot(THROUGH_SLOT); |
| | | |
| | | // 临时更新格子的剩余尺寸:防止相邻玻璃进同一格子造成剩余尺寸不足,玻璃越界的情况,任务完成后再次更新大理片笼表剩余宽度(按照笼内玻璃数量更新大理片笼剩余尺寸) |
| | | hollowBigStorageCageService.update(new LambdaUpdateWrapper<HollowBigStorageCage>() |
| | | .set(HollowBigStorageCage::getRemainWidth, bigStorageDTO.getRemainWidth() - Math.max(info.getWidth(), info.getHeight()) - glassGap) |
| | | .eq(HollowBigStorageCage::getSlot, bigStorageDTO.getSlot())); |
| | | task.setTargetSlot(bigStorageDTO.getSlot()); |
| | | task.setGlassId(info.getGlassId()); |
| | | //存放历史任务 |
| | | HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(task, historyTask); |
| | |
| | | historyTask.setGlassCount(glassInfoList.size()); |
| | | historyTask.setTaskState(Const.ENGINEERING_NEW); |
| | | historyTasks.add(historyTask); |
| | | GlassInfo info = glassInfoList.get(0); |
| | | //存放详情数据 |
| | | HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails(); |
| | | BeanUtils.copyProperties(bigStorageDTO, cageDetails); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | cageDetails.setSlot(THROUGH_SLOT); |
| | | cageDetails.setState(Const.GLASS_STATE_NEW); |
| | | cageDetails.setDeviceId(0); |
| | | cageDetails.setSequence(0); |
| | | cageDetails.setHollowSequence(0); |
| | | cageDetails.setSequence(bigStorageDTO.getSlotSequence()); |
| | | cageDetails.setGap(glassGap); |
| | | cageDetails.setFilmsId(info.getFilmsid()); |
| | | cageDetails.setId(null); |
| | | hollowBigStorageCageDetailsService.save(cageDetails); |
| | | hollowGlassRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassRelationInfo>() |
| | | .set(HollowGlassRelationInfo::getGlassId, cageDetails.getGlassId()) |
| | | .set(HollowGlassRelationInfo::getTemperingLayoutId, cageDetails.getTemperingLayoutId()) |
| | | .set(HollowGlassRelationInfo::getTemperingFeedSequence, cageDetails.getTemperingFeedSequence()) |
| | | .set(HollowGlassRelationInfo::getEngineerId, cageDetails.getEngineerId()) |
| | | .set(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_OCCUPY) |
| | | .eq(HollowGlassRelationInfo::getFlowCardId, bigStorageDTO.getFlowCardId()) |
| | | .eq(HollowGlassRelationInfo::getLayer, bigStorageDTO.getLayer()) |
| | | .eq(HollowGlassRelationInfo::getVirtualSlot, bigStorageDTO.getVirtualSlot()) |
| | | .eq(HollowGlassRelationInfo::getSlotSequence, bigStorageDTO.getSlotSequence()) |
| | | .eq(HollowGlassRelationInfo::getHollowSequence, bigStorageDTO.getHollowSequence()) |
| | | ); |
| | | } |
| | | } catch (Exception exception) { |
| | | log.info("进片任务执行中发生异常:{}", exception); |
| | | hollowGlassRelationInfoService.update(new LambdaUpdateWrapper<HollowGlassRelationInfo>() |
| | | .set(HollowGlassRelationInfo::getGlassId, null) |
| | | .set(HollowGlassRelationInfo::getTemperingLayoutId, null) |
| | | .set(HollowGlassRelationInfo::getTemperingFeedSequence, null) |
| | | .set(HollowGlassRelationInfo::getEngineerId, null) |
| | | .set(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_NEW) |
| | | .eq(HollowGlassRelationInfo::getState, Const.HOLLOW_RELATION_OCCUPY) |
| | | ); |
| | | } else { |
| | | BigStorageCageTask task = inTaskList.get(0); |
| | | task.setTargetSlot(THROUGH_SLOT); |
| | | //存放历史任务 |
| | | HollowBigStorageCageHistoryTask historyTask = new HollowBigStorageCageHistoryTask(); |
| | | BeanUtils.copyProperties(task, historyTask); |
| | | historyTask.setTaskType(Const.BIG_STORAGE_AFTER_IN); |
| | | historyTask.setGlassCount(glassInfoList.size()); |
| | | historyTask.setTaskState(Const.ENGINEERING_NEW); |
| | | historyTasks.add(historyTask); |
| | | GlassInfo info = glassInfoList.get(0); |
| | | HollowBigStorageCageDetails cageDetails = new HollowBigStorageCageDetails(); |
| | | BeanUtils.copyProperties(info, cageDetails); |
| | | cageDetails.setSlot(THROUGH_SLOT); |
| | | cageDetails.setState(Const.GLASS_STATE_NEW); |
| | | cageDetails.setDeviceId(0); |
| | | cageDetails.setSequence(0); |
| | | cageDetails.setHollowSequence(0); |
| | | cageDetails.setGap(glassGap); |
| | | cageDetails.setFilmsId(info.getFilmsid()); |
| | | cageDetails.setId(null); |
| | | hollowBigStorageCageDetailsService.save(cageDetails); |
| | | } |
| | | |
| | | //历史数据入库 |
| | | hollowBigStorageCageHistoryTaskService.saveBatch(historyTasks); |
| | | //向opc发送启动信号 |
| | |
| | | S7DataZKDLPTwo s7DataZKDLPTwo = s7SerializerZKDLPTwo.read(S7DataZKDLPTwo.class); |
| | | log.info("出片任务读取s7DataZKDLPTwo:{}", s7DataZKDLPTwo); |
| | | Boolean inkageEntity = s7DataZKDLPTwo.getMesControl(); |
| | | if (true != inkageEntity) { |
| | | if (!inkageEntity) { |
| | | log.info("当前为非联机状态,结束进片任务"); |
| | | return; |
| | | } |
| | | String requestEntity = s7DataZKDLPTwo.getRequestMes().toString(); |
| | | if (!"1".equals(requestEntity)) { |
| | | Integer requestEntity = s7DataZKDLPTwo.getRequestMes(); |
| | | if (1 != requestEntity) { |
| | | log.info("当前未收到出片请求,结束出片任务"); |
| | | return; |
| | | } |
| | | //获取出片任务表 |
| | | List<BigStorageCageTask> outTaskList = getOutTaskList(s7DataZKDLPTwo); |
| | | |
| | | if (CollectionUtil.isNotEmpty(outTaskList)) { |
| | | log.info("有正在执行的出片任务,结束本次出片任务"); |
| | | return; |
| | | } |
| | | |
| | | //获取空闲且领取任务的数据信息,没有任务直接走玻璃调度 |
| | | //获取所有空闲的线路信息 |
| | | HashMap<Integer, Boolean> map = new HashMap<>(); |
| | | //获取空闲且领取任务的数据信息,没有任务直接走玻璃调度 |
| | | try { |
| | | if (CMJ1ModbusTcp.checkConnected()) { |
| | | Boolean oneEntity = CMJ1ModbusTcp.readUInt16(42027 - 40001) != 0; |
| | | map.put(930, oneEntity); |
| | | Boolean oneState = CMJ1ModbusTcp.readUInt16(42027 - 40001) != 0; |
| | | map.put(930, oneState); |
| | | } else { |
| | | map.put(930, Boolean.FALSE); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | //nothing |
| | | log.info("一线空闲状态获取异常"); |
| | |
| | | //nothing |
| | | log.info("二/三线线空闲状态获取异常"); |
| | | } |
| | | List<Integer> resultList = new ArrayList<>(); |
| | | if (redisUtil.getCacheObject("priorityHollowSwitch")) { |
| | | resultList = TWO_LINE_FIRST; |
| | | } else { |
| | | resultList = ONE_LINE_FIRST; |
| | | } |
| | | |
| | | HollowGlassOutRelationInfo hollowGlassOutRelationInfo = null; |
| | | int cell = -1; |
| | | for (int i = 930; i <= 932; i++) { |
| | | for (Integer i : resultList) { |
| | | if (null == hollowGlassOutRelationInfo) { |
| | | Boolean entity = map.get(i); |
| | | cell = i; |
| | |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | .orderByAsc(HollowGlassOutRelationInfo::getId) |
| | | .last("limit 1") |
| | | ); |
| | | } |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | for (int i = 930; i <= 932; i++) { |
| | | for (Integer i : resultList) { |
| | | if (null == hollowGlassOutRelationInfo) { |
| | | cell = i; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | .orderByAsc(HollowGlassOutRelationInfo::getId) |
| | | .last("limit 1") |
| | | ); |
| | | } else { |
| | | break; |
| | |
| | | // 获取当前中空任务未完成出片的玻璃信息 |
| | | List<HollowGlassQueueInfo> unFinishHollowQueueList = hollowGlassQueueInfoService.list(new LambdaQueryWrapper<HollowGlassQueueInfo>() |
| | | .eq(HollowGlassQueueInfo::getFlowCardId, hollowGlassOutRelationInfo.getFlowCardId()) |
| | | .eq(HollowGlassQueueInfo::getCell, cell) |
| | | .eq(HollowGlassQueueInfo::getCell, hollowGlassOutRelationInfo.getCell()) |
| | | .eq(HollowGlassQueueInfo::getState, Const.TEMPERING_NEW) |
| | | .orderByAsc(HollowGlassQueueInfo::getHollowSequence)); |
| | | if (CollectionUtil.isNotEmpty(unFinishHollowQueueList)) { |
| | |
| | | List<String> glassList = noDealTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()); |
| | | hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | | .set(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .notIn(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .in(HollowBigStorageCageDetails::getGlassId, glassList)); |
| | | |
| | | } else { |
| | |
| | | hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | | .set(HollowBigStorageCageDetails::getSlot, item.getStartSlot()) |
| | | .set(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .notIn(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .eq(HollowBigStorageCageDetails::getGlassId, item.getGlassId())); |
| | | } |
| | | } |
| | |
| | | } |
| | | baseInfoList = resultList; |
| | | } else { |
| | | //大于总层数先取totalLyaer倍数数量的玻璃,保证大车上的玻璃成对传 |
| | | //大于总层数先取totalLayer倍数数量的玻璃,保证大车上的玻璃成对传 |
| | | int remainCount = templist.size() % totalLayer; |
| | | if (targetSlot == 930) { |
| | | baseInfoList = templist.subList(0, totalLayer); |
| | | int tempSequence = templist.get(0).getHollowSequence(); |
| | | List<T> resultList = new ArrayList<>(); |
| | | for (int i = 0; i < templist.size(); i++) { |
| | | if (tempSequence == list.get(i).getHollowSequence()) { |
| | | resultList.add(templist.get(i)); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | baseInfoList = resultList; |
| | | } else { |
| | | baseInfoList = templist.subList(0, templist.size() - remainCount); |
| | | } |
| | |
| | | hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | | .set(HollowBigStorageCageDetails::getState, state) |
| | | .set(Const.BIG_STORAGE_AFTER_DISPATCH.equals(taskType), HollowBigStorageCageDetails::getSlot, targetSlot) |
| | | .ne(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | .notIn(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_OUT, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .in(HollowBigStorageCageDetails::getGlassId, glassIds)); |
| | | try { |
| | | s7DataZKDLPTwo = new S7DataZKDLPTwo(); |