From a846f28bef985e7671f0b469fb73541cbfb08a93 Mon Sep 17 00:00:00 2001
From: admin <15939171744@163.com>
Date: 星期六, 01 六月 2024 11:15:39 +0800
Subject: [PATCH] -

---
 jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java |   59 ++++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 48 insertions(+), 11 deletions(-)

diff --git a/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java b/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
index d588819..de25159 100644
--- a/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
+++ b/jcdm-main/src/main/java/com/jcdm/main/restful/qingYan/service/ExternalInterface.java
@@ -1,6 +1,7 @@
 package com.jcdm.main.restful.qingYan.service;
 
 import cn.hutool.core.collection.CollUtil;
+import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
@@ -9,6 +10,7 @@
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.jcdm.common.core.domain.AjaxResult;
+import com.jcdm.common.utils.StringUtils;
 import com.jcdm.main.bs.formulaChild.domain.BsFormulaChildInfo;
 import com.jcdm.main.bs.formulaChild.service.IBsFormulaChildInfoService;
 import com.jcdm.main.constant.Constants;
@@ -20,9 +22,7 @@
 import com.jcdm.main.da.testDeviceInterface.service.IDaTestDeviceInterfaceService;
 import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo;
 import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService;
-import com.jcdm.main.restful.qingYan.doman.ChildVO;
-import com.jcdm.main.restful.qingYan.doman.ParentVO;
-import com.jcdm.main.restful.qingYan.doman.PostEntity;
+import com.jcdm.main.restful.qingYan.doman.*;
 import org.aspectj.weaver.loadtime.Aj;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -54,8 +54,11 @@
     @Autowired
     private IBsFormulaChildInfoService bsFormulaChildInfoService;
 
+    private IDaPassingStationCollectionService passingStationCollectionService;
 
-    String url = "https://imes-uat-group.geelycv-test.com/api/mom-open/restful/aMesSysIntegration/deviceResultFeedback";
+//    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";
 
     /**
      * 瀵煎嚭鐐规浠诲姟鍒楄〃
@@ -147,7 +150,17 @@
         daTestDeviceInterface.setProductNum(parentVO.getProductNum());
         daTestDeviceInterface.setTotalResult(parentVO.getTotalResult());
         daTestDeviceInterface.setCheckList(s);
+        daTestDeviceInterface.setCreateTime(new Date());
         daTestDeviceInterfaceService.save(daTestDeviceInterface);
+        if(parentVO.getStationCode().contains("OP480")){
+            if(StringUtils.isNotBlank(parentVO.getProductNum())){
+                OmProductionOrdeInfo one = omProductionOrdeInfoService.getOne(new LambdaQueryWrapper<OmProductionOrdeInfo>().eq(OmProductionOrdeInfo::getProductNum, parentVO.getProductNum()));
+                if(ObjectUtil.isNotNull(one)){
+                    one.setTrolleyYard("");
+                    omProductionOrdeInfoService.saveOrUpdate(one);
+                }
+            }
+        }
         HttpResponse execute = HttpRequest.post(url).body(JSONUtil.toJsonStr(parentVO)).execute();
         return AjaxResult.success(execute.body());
     }
@@ -155,9 +168,30 @@
     @GetMapping("/productionWorkOrderRequest")
     public AjaxResult productionWorkOrderRequest(){
         List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list();
-
-        return AjaxResult.success(list);
+        List<RestFulOrder> restFulOrders = new ArrayList<>();
+        for (OmProductionOrdeInfo omProductionOrdeInfo : list) {
+            RestFulOrder order = new RestFulOrder();
+            order.setProductionOrderNum(omProductionOrdeInfo.getWorkOrderNo());
+            order.setProductNum(omProductionOrdeInfo.getProductNum());
+            order.setMaterialCode(omProductionOrdeInfo.getMaterialCode());
+            order.setStationCode(omProductionOrdeInfo.getStationCode());
+            order.setPlanQty(omProductionOrdeInfo.getPlanQty());
+            restFulOrders.add(order);
+        }
+        return AjaxResult.success(restFulOrders);
     }
+
+    @GetMapping("/getQualityData")
+    public AjaxResult getQualityData(){
+        List<DaPassingStationCollection> qualified = daPassingStationCollectionService.list(new LambdaQueryWrapper<DaPassingStationCollection>().eq(DaPassingStationCollection::getOutRsSign, "1"));
+        List<DaPassingStationCollection> unQualified = daPassingStationCollectionService.list(new LambdaQueryWrapper<DaPassingStationCollection>().eq(DaPassingStationCollection::getOutRsSign, "2"));
+        Map<String,Integer> map = new HashMap<>();
+        map.put("qualified",qualified.size());
+        map.put("unQualified",unQualified.size());
+        return AjaxResult.success(map);
+    }
+
+
 
     @GetMapping("/productionOrderComponentRequest")
     public AjaxResult productionOrderComponentRequest(BsFormulaChildInfo bsFormulaChildInfo){
@@ -166,11 +200,14 @@
                 .eq(BsFormulaChildInfo::getProcessesCode, bsFormulaChildInfo.getProcessesCode())
                 .eq(BsFormulaChildInfo::getOperationType, "2")
         );
-        List<String> materialCode = list.stream().map(BsFormulaChildInfo::getMaterialCode).collect(Collectors.toList());
-        List<String> operationSteps = list.stream().map(BsFormulaChildInfo::getOperationSteps).collect(Collectors.toList());
-        map.put("materialCode",materialCode);
-        map.put("operationSteps",operationSteps);
-        return AjaxResult.success(map);
+        List<ProductionOrderComponentRequest> requests = new ArrayList<>();
+        for (BsFormulaChildInfo info : list) {
+            ProductionOrderComponentRequest request = new ProductionOrderComponentRequest();
+            request.setMaterialCode(info.getMaterialCode());
+            request.setOperationSteps(info.getOperationSteps());
+            requests.add(request);
+        }
+        return AjaxResult.success(requests);
     }
 
 

--
Gitblit v1.9.3