hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
@@ -36,10 +36,10 @@ * 忙碌 1 * 禁用 2 */ public static final String OUT_FREE = "0"; public static final String OUT_BUSY = "1"; public static final String OUT_DISABLE = "2"; public static final List<String> OUT_DISABLE_ALL = Arrays.asList("1", "2"); public static final Integer OUT_FREE = 0; public static final Integer OUT_BUSY = 1; public static final Integer OUT_DISABLE = 2; public static final List<Integer> OUT_DISABLE_ALL = Arrays.asList(1, 2); /** hangzhoumesParent/moduleService/CacheGlassModule/src/main/java/com/mes/job/OpcCacheGlassNewTask.java
@@ -391,25 +391,25 @@ S7DataWL s7DataWLOne = s7SerializerWLOne.read(S7DataWL.class); S7DataWL s7DataWLTwo = s7SerializerWLTwo.read(S7DataWL.class); S7DataWLExtra s7DataWLExtraTwo = s7SerializerWLTwo.read(S7DataWLExtra.class); Integer oneOutStateEntity = s7DataWLOne.getSlotState(); Integer twoOutStateEntity = s7DataWLTwo.getSlotState(); Integer d06OutStateEntity = s7DataWLExtraTwo.getD06SlotState(); Integer oneOutState = s7DataWLOne.getSlotState(); Integer twoOutState = s7DataWLTwo.getSlotState(); Integer d06OutState = s7DataWLExtraTwo.getD06SlotState(); //状态有3中情况:0空闲 1忙碌 2禁用 String oneOutState = Const.OUT_DISABLE; String twoOutState = Const.OUT_DISABLE; String d06OutState = Const.OUT_DISABLE; // int oneOutState = Const.OUT_DISABLE; // int twoOutState = Const.OUT_DISABLE; // int d06OutState = Const.OUT_DISABLE; // if (null != oneOutStateEntity && null != oneOutStateEntity.getValue()) { // oneOutState = oneOutStateEntity.getValue().toString(); // } if (null != oneOutStateEntity) { oneOutState = oneOutStateEntity.toString(); } // if (null != oneOutStateEntity) { // oneOutState = oneOutStateEntity.toString(); // } // if (null != twoOutStateEntity && null != twoOutStateEntity.getValue()) { // twoOutState = twoOutStateEntity.getValue().toString(); // } if (null != twoOutStateEntity) { twoOutState = twoOutStateEntity.toString(); } // if (null != twoOutStateEntity) { // twoOutState = twoOutStateEntity.toString(); // } //两条线都为禁用则不出玻璃 if (Const.OUT_DISABLE.equals(oneOutState) && Const.OUT_DISABLE.equals(twoOutState)) { log.info("A09、A10为{},{}非自动状态,无法出片", oneOutState, oneOutState); @@ -418,23 +418,26 @@ // if (null != d06OutStateEntity && null != d06OutStateEntity.getValue()) { // d06OutState = d06OutStateEntity.getValue().toString(); // } if (null != d06OutStateEntity) { d06OutState = d06OutStateEntity.toString(); } // if (null != d06OutStateEntity) { // d06OutState = d06OutStateEntity.toString(); // } //获取d06片台状态 // 1:一对一的情况下不需要判断d06状态 // 2:一号线一对多的情况下,获取二号线磨边前片台D07的状态,D07非禁用时,二号线将按照D06片台状态觉得出片 // 3:二号线一对多的情况下,获取一号线磨边前片台C08的状态,C08非禁用时,一号线将按照D06片台状态觉得出片 if (cellFlag == 2) { if (deviceId == 1) { twoOutState = Const.OUT_DISABLE.equals(twoOutState) ? Const.OUT_DISABLE : d06OutState; // twoOutState = Const.OUT_DISABLE.equals(twoOutState) ? Const.OUT_DISABLE : d06OutState; twoOutState = twoOutState & d06OutState; } else { oneOutState = Const.OUT_DISABLE.equals(oneOutState) ? Const.OUT_DISABLE : d06OutState; oneOutState = oneOutState & d06OutState; // oneOutState = Const.OUT_DISABLE.equals(oneOutState) ? Const.OUT_DISABLE : d06OutState; } if (Const.OUT_BUSY.equals(oneOutState) && Const.OUT_BUSY.equals(twoOutState)) { log.info("A09、A10为{},{}非自动状态,无法出片", oneOutState, oneOutState); return Boolean.FALSE; } // if (Const.OUT_BUSY.equals(oneOutState) && Const.OUT_BUSY.equals(twoOutState)) { // log.info("A09、A10为{},{}非自动状态,无法出片", oneOutState, oneOutState); // return Boolean.FALSE; // } } log.info("开始执行出片/直通任务,任务信息为:{},表名为:{},设备id:{},开始时间:{},一号线状态:{},二号线状态:{}", @@ -449,7 +452,7 @@ } else if (Const.OUT_FREE.equals(oneOutState)) { cell = Const.ONE_OUT_TARGET_POSITION; } else { return Boolean.FALSE; cell = Const.TWO_OUT_TARGET_POSITION; } } if (Const.OUT_FREE.equals(oneOutState) && Const.OUT_FREE.equals(twoOutState)) { hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/vo/HollowAllFlowCardVO.java
@@ -28,6 +28,10 @@ * 是否直通 */ private Boolean isThroughSlot; /** * 已配对总数量 */ private int pairTotalCount; /** * 流程卡数据 hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/entity/vo/HollowBigStorageDetailsQueryVO.java
@@ -25,5 +25,13 @@ * 厚度 */ private int thickness; /** * 客户名称 */ private String customerName; /** * 产品名称 */ private String productName; } hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/mapper/HollowGlassRelationInfoMapper.java
@@ -35,6 +35,6 @@ * @param flowCardId * @return */ OrderDetailsDTO queryProductNameByFlowCardId(@Param("flowCardId") String flowCardId); OrderDetailsDTO queryProductNameByFlowCardId(@Param("flowCardId") String flowCardId,@Param("productName") String productName,@Param("customerName") String customerName); } hangzhoumesParent/moduleService/hollowGlassModule/src/main/java/com/mes/hollow/service/impl/HollowGlassRelationInfoServiceImpl.java
@@ -32,6 +32,7 @@ import java.util.Comparator; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -313,25 +314,33 @@ } Map<String, List<HollowBigStorageCageDetails>> listMap = detailsList.stream().collect(Collectors.groupingBy(HollowBigStorageCageDetails::getFlowCardId)); List<HollowAllFlowCardVO> resultList = new ArrayList<>(); AtomicInteger pairTotalCount = new AtomicInteger(); listMap.forEach((e, v) -> { HollowAllFlowCardVO hollowAllFlowCardVO = new HollowAllFlowCardVO(); HollowBigStorageCageDetails cageDetails = v.get(0); //按照流程卡获取对应的产品名称 OrderDetailsDTO orderDetails = baseMapper.queryProductNameByFlowCardId(cageDetails.getFlowCardId()); OrderDetailsDTO orderDetails = baseMapper.queryProductNameByFlowCardId(cageDetails.getFlowCardId(), query.getProductName(), query.getCustomerName()); if (null != orderDetails) { BeanUtils.copyProperties(orderDetails, hollowAllFlowCardVO); hollowAllFlowCardVO.setFlowCardId(e); if (cageDetails.getHollowSequence() == 0) { hollowAllFlowCardVO.setIsThroughSlot(Boolean.TRUE); } else { hollowAllFlowCardVO.setIsThroughSlot(Boolean.FALSE); } List<FlowCardGlassInfoDTO> flowCardInfoList = hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE); hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(flowCardInfoList); pairTotalCount.addAndGet(flowCardInfoList.get(0).getPairCount()); resultList.add(hollowAllFlowCardVO); } hollowAllFlowCardVO.setFlowCardId(e); if (cageDetails.getHollowSequence() == 0) { hollowAllFlowCardVO.setIsThroughSlot(Boolean.TRUE); } else { hollowAllFlowCardVO.setIsThroughSlot(Boolean.FALSE); } List<FlowCardGlassInfoDTO> flowCardInfoList = hollowBigStorageCageDetailsService.hollowIsAll(e, cageDetails.getTotalLayer(), Boolean.FALSE); hollowAllFlowCardVO.setFlowCardGlassInfoDTOList(flowCardInfoList); resultList.add(hollowAllFlowCardVO); }); if (CollectionUtil.isEmpty(resultList)) { return new ArrayList<>(); } sortFlowCardIdList(resultList); resultList.get(0).setPairTotalCount(pairTotalCount.get()); return resultList; } hangzhoumesParent/moduleService/hollowGlassModule/src/main/resources/mapper/HollowGlassRelationInfoMapper.xml
@@ -132,11 +132,17 @@ <select id="queryProductNameByFlowCardId" resultType="com.mes.hollow.entity.dto.OrderDetailsDTO"> select t.product_name, t1.customer_name from sd.order_detail t inner join sd.order t1 on t.order_id = t1.order_id inner join sd.order t1 on t.order_id = t1.order_id where (t.order_id, t.order_number) = ( select min(order_id) as order_id, min(order_number) as order_number from pp.flow_card where process_id = #{flowCardId} select min(order_id) as order_id, min(order_number) as order_number from pp.flow_card where process_id = #{flowCardId} <if test="productName != null and productName != ''"> and t.product_name like concat('%', #{productName}, '%') </if> <if test="customerName != null and customerName != ''"> and t1.customer_name like concat('%', #{customerName}, '%') </if> ) limit 1 </select>