From 0a926b3ce629047a88dbc65cc38ec86c43520336 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期五, 07 三月 2025 16:33:09 +0800
Subject: [PATCH] -换型bug修改

---
 jcdm-main/src/main/java/com/jcdm/main/da/paramCollection/service/impl/DaParamCollectionServiceImpl.java |   79 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 78 insertions(+), 1 deletions(-)

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..2215dd3 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){
@@ -596,6 +600,10 @@
             parentVO.setProductNum(packID);
             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();
@@ -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