From 1e30745cafcea3f57518b6f05b8f2a72454f8d8e Mon Sep 17 00:00:00 2001 From: wujian <14790700720@163.com> Date: 星期五, 19 七月 2024 23:13:10 +0800 Subject: [PATCH] fix4 --- jcdm-quartz/src/main/java/com/jcdm/quartz/task/RyTask.java | 40 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) diff --git a/jcdm-quartz/src/main/java/com/jcdm/quartz/task/RyTask.java b/jcdm-quartz/src/main/java/com/jcdm/quartz/task/RyTask.java index c9f410a..07b14f9 100644 --- a/jcdm-quartz/src/main/java/com/jcdm/quartz/task/RyTask.java +++ b/jcdm-quartz/src/main/java/com/jcdm/quartz/task/RyTask.java @@ -1,9 +1,12 @@ package com.jcdm.quartz.task; +import cn.hutool.core.collection.CollUtil; import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling; import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService; import com.jcdm.main.da.passingStationCollection.service.IDaPassingStationCollectionService; import com.jcdm.main.da.passingStationCollection.service.impl.DaPassingStationCollectionServiceImpl; +import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo; +import com.jcdm.main.om.productionOrde.service.impl.OmProductionOrdeInfoServiceImpl; import com.jcdm.main.webservice.service.ReceivingServices; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -11,7 +14,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.annotation.Resource; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * 瀹氭椂浠诲姟璋冨害娴嬭瘯 @@ -25,6 +31,11 @@ private DaPassingStationCollectionServiceImpl passingStationCollectionServiceImpl; @Autowired private IBsOrderSchedulingService bsOrderSchedulingService; + + @Resource + private OmProductionOrdeInfoServiceImpl omProductionOrdeInfoService; + + private static final Logger logger = LoggerFactory.getLogger("sys-user"); public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) { @@ -38,8 +49,37 @@ public void ryNoParams() { + logger.info("鎵ц瀹氭椂浠诲姟寮�濮�"); String a=passingStationCollectionServiceImpl.SelectSN("88","OP010"); + BsOrderScheduling bsOrderScheduling = new BsOrderScheduling(); + bsOrderScheduling.setRemarks("1"); + List<BsOrderScheduling> bsOrderSchedulingList = bsOrderSchedulingService.selectBsOrderSchedulingList(bsOrderScheduling); + if (CollUtil.isNotEmpty(bsOrderSchedulingList)){ + Map<String, List<BsOrderScheduling>> map = bsOrderSchedulingList.stream().collect(Collectors.groupingBy(BsOrderScheduling::getOrderNo)); + OmProductionOrdeInfo omProductionOrdeInfo = new OmProductionOrdeInfo(); + for (String s : map.keySet()) { + List<BsOrderScheduling> bsOrderSchedulings = map.get(s); + if (CollUtil.isNotEmpty(bsOrderSchedulings)){ + BsOrderScheduling scheduling = bsOrderSchedulings.get(0); + int size = bsOrderSchedulings.size(); + omProductionOrdeInfo.setPlanQty((long)size); + omProductionOrdeInfo.setActualQty((long)0); + omProductionOrdeInfo.setWorkOrderNo(s); + omProductionOrdeInfo.setProductCode(scheduling.getModel()); + omProductionOrdeInfo.setOrderStatus("2"); + omProductionOrdeInfo.setTypeZ(scheduling.getModel()); + omProductionOrdeInfoService.insertOmProductionOrdeInfo(omProductionOrdeInfo); + logger.info("鎻掑叆宸ュ崟锛寋}",s); + } + } + for (BsOrderScheduling scheduling : bsOrderSchedulingList) { + scheduling.setRemarks("0"); + bsOrderSchedulingService.updateBsOrderScheduling(scheduling); + } + + } System.out.println("鎵ц杩囩▼杩斿洖锛�" + a); + logger.info("瀹氭椂浠诲姟鎵ц缁撴潫"); } String url = "http://podqapp.cfmoto.com.cn:50100/XISOAPAdapter/MessageServlet?senderParty=&senderService=BC_MES&receiverParty=&receiverService=&interface=SI_ZPP_CF_BC_001_SYN_OUT&interfaceNamespace=http://cfmoto.com/xi/MES"; -- Gitblit v1.9.3