| | |
| | | package com.mes.hollow.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.smallbun.screw.core.util.StringUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | |
| | | import com.mes.hollow.entity.HollowFormulaDetails; |
| | | import com.mes.hollow.entity.HollowGlassOutRelationInfo; |
| | | import com.mes.hollow.entity.dto.*; |
| | | import com.mes.hollow.entity.request.HollowHistoryTaskRequest; |
| | | import com.mes.hollow.entity.request.HollowTaskRequest; |
| | | import com.mes.hollow.mapper.HollowGlassOutRelationInfoMapper; |
| | | import com.mes.hollow.service.HollowBigStorageCageDetailsService; |
| | |
| | | import com.mes.hollow.service.HollowGlassRelationInfoService; |
| | | import com.mes.hollowqueue.entity.HollowGlassQueueInfo; |
| | | import com.mes.hollowqueue.service.HollowGlassQueueInfoService; |
| | | import com.mes.tools.DateUtil; |
| | | import com.mes.utils.Blank; |
| | | import com.mes.utils.RedisUtil; |
| | | import freemarker.template.Configuration; |
| | |
| | | glassAndFrame.setFrameList(frameList); |
| | | glassAndFrameList.add(glassAndFrame); |
| | | }); |
| | | Collections.sort(glassAndFrameList, (s1, s2) -> Integer.parseInt(s1.getItemNum()) - Integer.parseInt(s2.getItemNum())); |
| | | details.setGlassAndFrameList(glassAndFrameList); |
| | | |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | return "success"; |
| | | } |
| | | |
| | | @Override |
| | | public Page<HollowGlassOutRelationInfo> queryHollowHistoryTask(HollowHistoryTaskRequest request) { |
| | | Page<HollowGlassOutRelationInfo> page = new Page<>(request.getPageNo(), request.getPageSize()); |
| | | if (null == request.getBeginDate()) { |
| | | request.setBeginDate(DateUtil.getBeginDate()); |
| | | request.setEndDate(DateUtil.getEndDate()); |
| | | } |
| | | LambdaQueryWrapper<HollowGlassOutRelationInfo> wrapper = new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, request.getCell()) |
| | | .like(StringUtils.isNotBlank(request.getFlowCardId()), HollowGlassOutRelationInfo::getFlowCardId, request.getFlowCardId()) |
| | | .in(CollectionUtil.isNotEmpty(request.getIsForceList()), HollowGlassOutRelationInfo::getIsForce, request.getIsForceList()) |
| | | .in(CollectionUtil.isNotEmpty(request.getStateList()), HollowGlassOutRelationInfo::getState, request.getStateList()) |
| | | .between(HollowGlassOutRelationInfo::getCreateTime, request.getBeginDate(), request.getEndDate()) |
| | | .orderByDesc(HollowGlassOutRelationInfo::getCreateTime); |
| | | return this.page(page, wrapper); |
| | | } |
| | | |
| | | |
| | |
| | | if (930 == request.getCell()) { |
| | | Map<Integer, List<HollowBigStorageCageDetails>> listMap = hollowBigStorageCageDetailsList.stream() |
| | | .collect(Collectors.groupingBy(HollowBigStorageCageDetails::getHollowSequence)); |
| | | List<List<HollowGlassQueueInfo>> disorderList = new ArrayList<>(); |
| | | for (Map.Entry<Integer, List<HollowBigStorageCageDetails>> entry : listMap.entrySet()) { |
| | | //创建队列接收不满足成对情况下:一对玻璃分几次上车的次序问题 |
| | | List<HollowGlassQueueInfo> tempList = new ArrayList<>(); |
| | |
| | | for (HollowBigStorageCageDetails item : reverse) { |
| | | remainWidth = remainWidth - (int) Math.max(item.getWidth(), item.getHeight()); |
| | | if (remainWidth < 0) { |
| | | hollowQueues.addAll(CollectionUtil.reverse(tempList)); |
| | | disorderList.add(CollectionUtil.reverse(tempList)); |
| | | tempList = new ArrayList<>(); |
| | | remainWidth = carWidth - (int) Math.max(item.getWidth(), item.getHeight()); |
| | | } |
| | |
| | | tempList.add(queueInfo); |
| | | remainWidth = remainWidth - glassGap; |
| | | } |
| | | hollowQueues.addAll(CollectionUtil.reverse(tempList)); |
| | | disorderList.add(CollectionUtil.reverse(tempList)); |
| | | HollowBigStorageCageDetails cageDetails = entry.getValue().get(0); |
| | | if (cageDetails.getIsPair() == 1) { |
| | | isPairCount = isPairCount - cageDetails.getTotalLayer(); |
| | |
| | | } |
| | | } |
| | | } |
| | | //防止玻璃中空线玻璃无序,将玻璃按照顺序重新排序 |
| | | Collections.sort(disorderList, (s1, s2) -> s1.get(0).getHollowSequence() - s2.get(0).getHollowSequence()); |
| | | for (List<HollowGlassQueueInfo> list : disorderList) { |
| | | hollowQueues.addAll(list); |
| | | } |
| | | } else { |
| | | loop: |
| | | for (HollowBigStorageCageDetails item : hollowBigStorageCageDetailsList) { |