hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OPCPlcSlicecage.java
@@ -72,7 +72,7 @@ task.setGlassId(requestWord.getValue() + ""); int isExistCount = bigStorageCageDetailsService.count(new LambdaQueryWrapper<BigStorageCageDetails>().in(BigStorageCageDetails::getGlassId, task.getGlassId()) .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)); if (isExistCount > 0) { if (isExistCount > 0 && "0".equals(targetSlotWord.getValue())) { task.setIsSame(1); } else { task.setIsSame(0); hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java
@@ -25,5 +25,7 @@ List<LackDetailsDTO> queryLackByFlowCard(String flowCardId); int queryLayerByFlowCardId(@Param("flowCardId") String flowCardId); void clearDirtyFlowCardData(@Param("flowCardId")String flowCardId, @Param("layer")int layer); } hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassOutRelationInfoServiceImpl.java
@@ -126,6 +126,7 @@ return this.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>() .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId) .ne(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_SUCCESS) .eq(HollowGlassOutRelationInfo::getCell, cell)); } @@ -135,6 +136,7 @@ return this.update(new LambdaUpdateWrapper<HollowGlassOutRelationInfo>() .set(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_PAUSE) .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId) .ne(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_SUCCESS) .eq(HollowGlassOutRelationInfo::getCell, cell)); } @@ -348,14 +350,15 @@ for (HollowBigStorageCageDetails item : reverse) { remainWidth = remainWidth - (int) Math.max(item.getWidth(), item.getHeight()); if (remainWidth < 0) { tempList = CollectionUtil.reverse(tempList); hollowQueues.addAll(CollectionUtil.reverse(tempList)); tempList = new ArrayList<>(); remainWidth = carWidth - (int) Math.max(item.getWidth(), item.getHeight()); } HollowGlassQueueInfo queueInfo = HollowBDetailToQueue(item, info.getId(), request.getCell()); tempList.add(queueInfo); remainWidth = remainWidth - glassGap; } hollowQueues.addAll(tempList); hollowQueues.addAll(CollectionUtil.reverse(tempList)); HollowBigStorageCageDetails cageDetails = entry.getValue().get(0); if (cageDetails.getIsPair() == 1) { isPairCount = isPairCount - cageDetails.getTotalLayer(); hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
@@ -10,6 +10,7 @@ import com.mes.glassinfo.service.GlassInfoService; import com.mes.hollow.entity.HollowBigStorageCage; import com.mes.hollow.entity.HollowBigStorageCageDetails; import com.mes.hollow.entity.HollowGlassOutRelationInfo; import com.mes.hollow.entity.HollowGlassRelationInfo; import com.mes.hollow.entity.dto.FlowCardGlassInfoDTO; import com.mes.hollow.entity.dto.HollowBigStorageDTO; @@ -19,6 +20,7 @@ import com.mes.hollow.mapper.HollowGlassRelationInfoMapper; import com.mes.hollow.service.HollowBigStorageCageDetailsService; import com.mes.hollow.service.HollowBigStorageCageService; import com.mes.hollow.service.HollowGlassOutRelationInfoService; import com.mes.hollow.service.HollowGlassRelationInfoService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; @@ -49,6 +51,8 @@ @Resource HollowGlassRelationInfoService hollowGlassRelationInfoService; @Resource HollowGlassOutRelationInfoService hollowGlassOutRelationInfoService; @Resource HollowBigStorageCageDetailsService hollowBigStorageCageDetailsService; @Value("${mes.slotWidth}") private Integer slotWidth; @@ -72,9 +76,18 @@ .last("limit 1") ); if (relationInfoOne == null) { //查看mes是否有对应的流程卡信息 int count = hollowGlassRelationInfoService.count(new LambdaQueryWrapper<HollowGlassRelationInfo>() .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId) .eq(HollowGlassRelationInfo::getLayer, layer)); if (count == 0) { generateHollowGlassInfo(flowCardId, totalLayer, layer); } else { //比较关系表及中空理片笼详情表的流程卡数据,处理脏数据:将不在笼内的流程卡匹配数据职位空 this.baseMapper.clearDirtyFlowCardData(flowCardId, layer); } //理片笼关系表中没有对应的数据,查看理片笼虚拟位置表是否有本工程下的所有玻璃虚拟信息 //虚拟位置表没有本工程下的所有玻璃虚拟信息,按照玻璃id生成本工程下所有玻璃的虚拟信息 generateHollowGlassInfo(flowCardId, totalLayer, layer); relationInfoOne = this.getOne(new LambdaQueryWrapper<HollowGlassRelationInfo>() .eq(HollowGlassRelationInfo::getFlowCardId, flowCardId) .eq(HollowGlassRelationInfo::getWidth, width) @@ -87,13 +100,27 @@ ); } //详情表内获取本组是否已经有玻璃在笼子内(0表示提前占用) int taskCount = hollowGlassOutRelationInfoService.count(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() .eq(HollowGlassOutRelationInfo::getFlowCardId, flowCardId)); HollowBigStorageCage storageCage = null; //如果不存在则选择笼内未用的新格子 if (taskCount > 0) { storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>() .eq(HollowBigStorageCage::getEnableState, Const.SLOT_ON).eq(HollowBigStorageCage::getRemainWidth, slotWidth) .le(HollowBigStorageCage::getMinThickness, relationInfoOne.getThickness()) .ge(HollowBigStorageCage::getMaxThickness, relationInfoOne.getThickness()) .orderByAsc(HollowBigStorageCage::getMaxThickness).last("limit 1")); HollowBigStorageDTO storageDTO = new HollowBigStorageDTO(); BeanUtils.copyProperties(storageCage, storageDTO); BeanUtils.copyProperties(relationInfoOne, storageDTO); return storageDTO; } //详情表内获取本组是否已经有玻璃在笼子内(0表示提前占用) List<HollowBigStorageCageDetails> hollowDetailsList = hollowBigStorageCageDetailsService.list(new LambdaQueryWrapper<HollowBigStorageCageDetails>() .eq(HollowBigStorageCageDetails::getFlowCardId, relationInfoOne.getFlowCardId()) .eq(HollowBigStorageCageDetails::getTotalLayer, totalLayer) .eq(HollowBigStorageCageDetails::getLayer, layer) .eq(HollowBigStorageCageDetails::getVirtualSlot, relationInfoOne.getVirtualSlot()) .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)); HollowBigStorageCage storageCage = null; //如果不存在则选择笼内未用的新格子 if (CollectionUtil.isEmpty(hollowDetailsList)) { storageCage = hollowBigStorageCageService.getOne(new LambdaQueryWrapper<HollowBigStorageCage>() hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/job/PushMessageToIndex.java
@@ -139,7 +139,7 @@ task.setGlassId(requestWord.getValue() + ""); int isExistCount = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>().in(HollowBigStorageCageDetails::getGlassId, task.getGlassId()) .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL_ZERO)); if (isExistCount > 0) { if (isExistCount > 0 && "0".equals(targetSlotWord.getValue() + "")) { task.setIsSame(1); } else { task.setIsSame(0); hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
@@ -19,6 +19,7 @@ <result column="thickness" property="thickness"/> <result column="lack_cout" property="lackCount"/> </resultMap> <select id="queryFlowCardIdMaxLayerGlassInfo" resultMap="baseMap"> with temp_flow as (SELECT t.process_id, t.order_id, @@ -128,4 +129,20 @@ from hollow_glass_relation_info where flow_card_id = #{flowCardId} </select> <update id="clearDirtyFlowCardData"> update hollow_glass_relation_info set glass_id = null, tempering_layout_id = null, tempering_feed_sequence = null, engineer_id = null, state = 0 where flow_card_id = #{flowCardId} and layer = #{layer} and glass_id not in ( select glass_id from hollow_big_storage_cage_details where flow_card_id = #{flowCardId} and layer = #{layer} and state = 100 ) </update> </mapper>