From 48c7ffb6e7137b4b62bfdc63be8aa72d085ba40e Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期三, 19 二月 2025 11:56:04 +0800
Subject: [PATCH] -换型bug修改

---
 jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java   |   13 +++++-
 jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java |   81 +++++++++++++++++++++++++++++++++++++++-
 2 files changed, 90 insertions(+), 4 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
index b74e37d..acd9409 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -309,6 +309,7 @@
         updateWrapper.set(BsFormulaChildInfo::getResults, result);
         updateWrapper.eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getLocationCode());
         updateWrapper.eq(BsFormulaChildInfo::getParamCode, bsFormulaChildInfo.getParamCode());
+        updateWrapper.eq(BsFormulaChildInfo::getProductCode, bsFormulaChildInfo.getProductCode());
         boolean update = bsFormulaChildInfoService.update(new BsFormulaChildInfo(), updateWrapper);
         return AjaxResult.success(update);
     }
@@ -367,7 +368,8 @@
     @Override
     public AjaxResult jrmWorkpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) {
         this.clearCollectDataAndResultsByProcessesCode(bsFormulaChildInfo);
-        daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
+//        daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
+        daParamCollectionService.jrmPushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode(), bsFormulaChildInfo.getProductCode());
         return AjaxResult.success();
     }
 
@@ -382,6 +384,7 @@
         String result = "1";
         BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo();
         getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode());
+        getMaterTwo.setProductCode(bsFormulaChildInfo.getProductCode());
         getMaterTwo.setOperationType("2");
         List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo);
         List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList());
@@ -519,7 +522,12 @@
     public AjaxResult workpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) {
         this.clearCollectDataAndResultsByProcessesCode(bsFormulaChildInfo);
         try {
-            daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
+            String locationCode = bsFormulaChildInfo.getLocationCode();
+            if(locationCode.equals("POP301")||locationCode.equals("PPOP241")||locationCode.equals("PPOP242")){
+                daParamCollectionService.jrmPushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode(),bsFormulaChildInfo.getProductCode());
+            }else {
+                daParamCollectionService.pushGeelycvMesFeedback(bsFormulaChildInfo.getProductBarcode(), bsFormulaChildInfo.getLocationCode());
+            }
         }catch (Exception e){
         }
         return AjaxResult.success();
@@ -530,6 +538,7 @@
         Boolean b = true;
         BsFormulaChildInfo getMaterTwo = new BsFormulaChildInfo();
         getMaterTwo.setProcessesCode(bsFormulaChildInfo.getLocationCode());
+        getMaterTwo.setProductCode(bsFormulaChildInfo.getProductCode());
         getMaterTwo.setOperationType("2");
         List<BsFormulaChildInfo> operationType = bsFormulaChildInfoMapper.selectBsFormulaChildInfoList(getMaterTwo);
         List<String> collect = operationType.stream().map(BsFormulaChildInfo::getResults).collect(Collectors.toList());
diff --git a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
index e15299d..3a5d735 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java
@@ -527,12 +527,16 @@
             parentVO.setTotalResult("1");
             List<ChildVO> listChildVo = new ArrayList<>();
 
+            String productModel = "PE01B";
+            OmProductionOrdeInfo orderOne = omProductionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, packID));
+            productModel = orderOne.getProductCode();
+
             for (DaParamCollectionTemp daParamCollection : paramList) {
                 ChildVO childVO = new ChildVO();
                 childVO.setItemCode(daParamCollection.getParamCode());
                 List<DaCollectionParamConf> paramConfOneList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>()
                         .eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())
-                        .eq(DaCollectionParamConf::getProductModel, "PE01B")
+                        .eq(DaCollectionParamConf::getProductModel, productModel)
                 );
                 DaCollectionParamConf paramConfOne = paramConfOneList.get(0);
                 if(paramConfOne!=null){
@@ -597,6 +601,10 @@
             parentVO.setTotalResult("1");
             List<ChildVO> listChildVo = new ArrayList<>();
 
+            String productModel = "PE01B";
+            OmProductionOrdeInfo orderOne = omProductionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, packID));
+            productModel = orderOne.getProductCode();
+
             for (DaParamCollection daParamCollection : paramList) {
                 ChildVO childVO = new ChildVO();
                 childVO.setItemCode(daParamCollection.getParamCode());
@@ -604,7 +612,7 @@
 //                DaCollectionParamConf paramConfOne = daCollectionParamConfService.getOne(new LambdaQueryWrapper<DaCollectionParamConf>().eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode()));
                 List<DaCollectionParamConf> paramConfOneList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>()
                         .eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())
-                        .eq(DaCollectionParamConf::getProductModel, "PE01B")
+                        .eq(DaCollectionParamConf::getProductModel, productModel)
                 );
                 DaCollectionParamConf paramConfOne = paramConfOneList.get(0);
                 if(paramConfOne!=null){
@@ -892,6 +900,75 @@
         }
     }
 
+    @Override
+    public void jrmPushGeelycvMesFeedback(String packID, String stationCode, String productCode) {
+        logger.info("杩涘叆浜哄伐宸ヤ綅鎺ㄩ�佸伐鍘侻ES鏁版嵁鏂规硶-pushGeelycvMesFeedback-宸ヤ綅{}-pack鐮亄}",stationCode,packID);
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//        String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
+        String url = "https://imes-group.geelycv.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
+        String totalResult = "0";
+        List<DaParamCollectionTemp> paramList = daParamCollectionTempService.list(new LambdaQueryWrapper<DaParamCollectionTemp>().eq(DaParamCollectionTemp::getSfcCode, packID).eq(DaParamCollectionTemp::getLocationCode, stationCode));
+        if(paramList.size() > 0){
+            ParentVO parentVO = new ParentVO();
+            parentVO.setSiteCode("3983");
+            parentVO.setRecordId(String.valueOf(Instant.now().toEpochMilli()));
+            parentVO.setStationCode(stationCode);
+            parentVO.setProductNum(packID);
+            parentVO.setTotalResult("1");
+            List<ChildVO> listChildVo = new ArrayList<>();
+
+            for (DaParamCollectionTemp daParamCollection : paramList) {
+                ChildVO childVO = new ChildVO();
+                childVO.setItemCode(daParamCollection.getParamCode());
+                List<DaCollectionParamConf> paramConfOneList = daCollectionParamConfService.list(new LambdaQueryWrapper<DaCollectionParamConf>()
+                        .eq(DaCollectionParamConf::getCollectParameterId, daParamCollection.getParamCode())
+                        .eq(DaCollectionParamConf::getProductModel, productCode)
+                );
+                DaCollectionParamConf paramConfOne = paramConfOneList.get(0);
+                if(paramConfOne!=null){
+                    childVO.setItemType(paramConfOne.getSpareField1());
+                    childVO.setItemText(paramConfOne.getCollectParameterName());
+                }else {
+                    childVO.setItemType("3");
+                    childVO.setItemText("");
+                }
+                childVO.setItemValue(daParamCollection.getParamValue());
+
+                if(daParamCollection.getParamValue().equals("1")){
+                    childVO.setCheckResult("1");
+                }else if(daParamCollection.getParamValue().equals("2")){
+                    childVO.setCheckResult("0");
+                    parentVO.setTotalResult("0");
+                    totalResult = "1";
+                }else {
+                    childVO.setCheckResult("1");
+                }
+                childVO.setCheckTime(format.format(daParamCollection.getCollectionTime()));
+                listChildVo.add(childVO);
+
+            }
+            parentVO.setCheckList(listChildVo);
+            try{
+                CompletableFuture<Void> cp1 = CompletableFuture.runAsync(() -> {
+                    logger.info("宸ヤ綅{}---寮�濮嬫墽琛屽紓姝ユ柟娉�---pack鐮佹槸{}"+stationCode,packID);
+                    HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
+                    logger.info("宸ヤ綅{}---寮傛鏂规硶鎵ц缁撴潫---pack鐮佹槸{}"+stationCode,packID);
+                    logger.info("鎵嬪姩宸ヤ綅{}浼犲伐鍘傚叆鍙俈O{}---pack鐮佹槸{}" + stationCode,new Gson().toJson(parentVO),packID);
+                    logger.info("鎵嬪姩宸ヤ綅{}浼犲伐鍘侻ES寮傛鏂规硶{}---pack鐮佹槸{}"+stationCode,execute.body(),packID);
+
+                    DaParamCollectionTemp daParamCollectionTemp = new DaParamCollectionTemp();
+                    daParamCollectionTemp.setSfcCode(packID);
+                    daParamCollectionTemp.setLocationCode(stationCode);
+                    int i = daParamCollectionTempService.deleteDaParamCollectionTempBySfcCodeAndLocationCode(daParamCollectionTemp);
+                    logger.info("鍒犻櫎涓存椂琛ㄦ暟鎹潯鏁皗}-宸ヤ綅{}-pack鐮亄}",i,stationCode,packID);
+                });
+            }catch (Exception e){
+                System.out.println(e.getMessage());
+            }
+            logger.info("缁撴潫浜哄伐宸ヤ綅鎺ㄩ�佸伐鍘侻ES鏁版嵁鏂规硶-pushGeelycvMesFeedback-宸ヤ綅{}-pack鐮亄}",stationCode,packID);
+        }
+    }
+
     public static String getRandomNumberBetween(double min, double max) {
         return String.format("%.1f",min + (Math.random() * (max - min)));
     }

--
Gitblit v1.9.3