| | |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | if (null == hollowGlassOutRelationInfo) { |
| | | cell = 930; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | |
| | | if (null == hollowGlassOutRelationInfo) { |
| | | cell = 931; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | |
| | | if (null != hollowGlassOutRelationInfo) { |
| | | //是否允许中空 |
| | |
| | | log.info("计算玻璃数量过程中出现错误,错误信息{}", e.getMessage()); |
| | | } |
| | | |
| | | // hollowGlassOutRelationInfoService.update |
| | | // 重置任务表数据 |
| | | bigStorageCageTaskService.updateOutTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK); |
| | | |
| | |
| | | */ |
| | | private <T extends HollowBigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, String tableName, int targetSlot, int state, int taskType, int totalLayer, int isForce) { |
| | | //任务数据:获取车子存放玻璃最大数量,玻璃间隔 |
| | | List<BigStorageCageTask> tempList = new ArrayList<>(); |
| | | List<T> tempTList = new ArrayList<>(); |
| | | List<T> templist = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | | Integer remainWidth = carWidth; |
| | | for (T e : list) { |
| | | if (tempList.size() >= outCarMaxSize || Math.max((int) e.getWidth(), (int) e.getHeight()) > remainWidth) { |
| | | if (templist.size() >= outCarMaxSize || Math.max((int) e.getWidth(), (int) e.getHeight()) > remainWidth) { |
| | | break; |
| | | } |
| | | //计算当前出片车剩尺寸 |
| | | remainWidth = remainWidth - Math.max((int) e.getWidth(), (int) e.getHeight()) - glassGap; |
| | | tempTList.add(e); |
| | | tempList.add(new BigStorageCageTask(e.getGlassId(), e.getSlot(), targetSlot, |
| | | 0)); |
| | | templist.add(e); |
| | | } |
| | | Assert.isFalse(CollectionUtil.isEmpty(tempList), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", tempList.size()); |
| | | List<BigStorageCageTask> bigStorageCageTaskList = tempList; |
| | | Assert.isFalse(CollectionUtil.isEmpty(templist), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", templist.size()); |
| | | List<T> baseInfoList = new ArrayList<>(); |
| | | if (1 != isForce) { |
| | | if (taskType == Const.BIG_STORAGE_AFTER_OUT) { |
| | | if (tempList.size() <= totalLayer) { |
| | | bigStorageCageTaskList = tempList; |
| | | //校验防止小于等于总层数玻璃片序不匹配的问题,该问题多出现在大片玻璃,3层 |
| | | if (templist.size() <= 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 { |
| | | int remainCount = tempList.size() % totalLayer; |
| | | bigStorageCageTaskList = tempList.subList(0, tempList.size() - remainCount); |
| | | //大于总层数先取totalLyaer倍数数量的玻璃,保证大车上的玻璃成对传 |
| | | int remainCount = templist.size() % totalLayer; |
| | | if (targetSlot == 930) { |
| | | baseInfoList = templist.subList(0, totalLayer); |
| | | } else { |
| | | baseInfoList = templist.subList(0, templist.size() - remainCount); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<String> glassIds = bigStorageCageTaskList.stream().map(BigStorageCageTask::getGlassId).collect(Collectors.toList()); |
| | | int glassCount = bigStorageCageTaskList.size(); |
| | | List<String> glassIds = baseInfoList.stream().map(T::getGlassId).collect(Collectors.toList()); |
| | | int glassCount = baseInfoList.size(); |
| | | List<BigStorageCageTask> bigStorageCageTaskList = new ArrayList<>(); |
| | | //生成出片任务条数不足6补全 |
| | | for (T t : baseInfoList) { |
| | | bigStorageCageTaskList.add(new BigStorageCageTask(t.getGlassId(), t.getSlot(), targetSlot, 0)); |
| | | } |
| | | while (bigStorageCageTaskList.size() < 6) { |
| | | bigStorageCageTaskList.add(new BigStorageCageTask("", 0, 0, 0)); |
| | | } |
| | |
| | | return history; |
| | | }).collect(Collectors.toList()); |
| | | hollowBigStorageCageHistoryTaskService.saveBatch(historyList); |
| | | |
| | | log.info("将出片玻璃{}玻璃状态改为出片中", glassIds); |
| | | hollowBigStorageCageDetailsService.update(new LambdaUpdateWrapper<HollowBigStorageCageDetails>() |
| | | .set(HollowBigStorageCageDetails::getState, state) |