From 9732936d8db5f396cfaee6c9178f06b9d53ee46d Mon Sep 17 00:00:00 2001
From: 18516761980 <tqsxp@163.com>
Date: 星期一, 24 十月 2022 07:30:22 +0800
Subject: [PATCH] #lsh

---
 src/main/java/com/zy/asrs/controller/OpenController.java |  117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 114 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/zy/asrs/controller/OpenController.java b/src/main/java/com/zy/asrs/controller/OpenController.java
index cb34a46..d173e1a 100644
--- a/src/main/java/com/zy/asrs/controller/OpenController.java
+++ b/src/main/java/com/zy/asrs/controller/OpenController.java
@@ -4,7 +4,9 @@
 import com.core.annotations.AppAuth;
 import com.core.common.*;
 import com.core.exception.CoolException;
+import com.zy.asrs.entity.TestMast;
 import com.zy.asrs.entity.param.*;
+import com.zy.asrs.service.ApiLogService;
 import com.zy.asrs.service.OpenService;
 import com.zy.common.model.DetlDto;
 import com.zy.common.web.BaseController;
@@ -13,9 +15,7 @@
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * Created by vincent on 2022/4/8
@@ -32,6 +32,8 @@
 
     @Autowired
     private OpenService openService;
+    @Autowired
+    private ApiLogService apiLogService;
 
     @PostMapping("/order/matSync/default/v1")
     @AppAuth(memo = "鍟嗗搧淇℃伅鍚屾鎺ュ彛")
@@ -204,4 +206,113 @@
         System.out.println(JSON.toJSONString(param1));
     }
 
+    /*...........................璧e窞鏂板..............浠ヤ笅.............璧e窞鏂板...........................*/
+    @PostMapping("/rpc/watchDog/auth/v1")
+//    @AppAuth(memo = "蹇冭烦鎺ュ彛璋冪敤")
+    public synchronized R hostName(@RequestHeader(required = false) String appkey,
+                                   @RequestBody(required = false) HeartBeat param,
+                                   HttpServletRequest request){
+        appkey="ea1f0459efc02a79f046f982767939ae";
+        auth(appkey, param, request);
+        if (Cools.isEmpty(param)) {
+            return R.parse(BaseRes.PARAM);
+        }
+
+        //........
+        System.out.println(String.format("id:%s,hostName:%s,requestTime:%s",
+                param.getId(),param.getHostName(),param.getRequestTime()));
+
+        return R.ok();
+    }
+
+    @PostMapping("/rpc/pakIn/auth/v1")
+//    @AppAuth(memo = "鍏ュ簱閫氱煡鍗曟帴鍙h皟鐢�")
+    public synchronized R combPack(@RequestHeader(required = false) String appkey,
+                                   @RequestBody(required = false) CombParam param,
+                                   HttpServletRequest request){
+        appkey="ea1f0459efc02a79f046f982767939ae";
+        auth(appkey, param, request);
+        if (Cools.isEmpty(param)) {
+            return R.parse(BaseRes.PARAM);
+        }
+        //鐢熸垚鍏ュ簱閫氱煡妗�
+        openService.combPACK(param);
+
+        Map<String,Boolean> map=new HashMap<>();
+        apiLogService.save(
+                "mes鐢宠鍏ュ簱",
+                "172.28.15.251",
+                null,
+                "127.0.0.1",
+                JSON.toJSONString("PackNo:"+param.getPackNo()
+                        +" PackName:"+param.getPackName()
+                        +" RequestTime:"+param.getRequestTime()
+                        +" SettingTimes:"+param.getSettingTimes()),
+                "172.28.15.251",
+                true
+        );
+        map.put("isComplete",true);
+        return R.ok(map);
+    }
+    @PostMapping("/rpc/pakOut/auth/v1")
+//    @AppAuth(memo = "鍑哄簱閫氱煡鍗曟帴鍙h皟鐢�")
+    public synchronized R combpakOut(@RequestHeader(required = false) String appkey,
+                                   @RequestBody(required = false) CombParam param,
+                                   HttpServletRequest request){
+
+        auth(appkey, param, request);
+        if (Cools.isEmpty(param)) {
+            return R.parse(BaseRes.PARAM);
+        }
+        //鍑哄簱寮�濮�
+        openService.combPackOut(param);
+
+        Map<String,Boolean> map=new HashMap<>();
+        map.put("isComplete",true);
+        return R.ok(map);
+    }
+
+    @PostMapping("/rpv/infoReview/auth/v1")
+//    @AppAuth(memo = "娴嬭瘯鏉$爜淇℃伅澶嶆牳璇锋眰")
+    public synchronized R infoReview(@RequestHeader(required = false) String appkey,
+                                   @RequestBody(required = false) Review param,
+                                   HttpServletRequest request){
+        appkey="ea1f0459efc02a79f046f982767939ae";
+        auth(appkey, param, request);
+        if (Cools.isEmpty(param)) {
+            return R.parse(BaseRes.PARAM);
+        }
+        TestMast testMast = openService.infoReview(param);
+        if (testMast.getStatus()==3){
+            return R.ok();
+        }else if (testMast.getStatus()==2){
+            return R.error("绛夊緟鍛樺伐鎿嶄綔");
+        }
+        return R.error();
+    }
+    @PostMapping("/rpv/testFinish/auth/v1")
+//    @AppAuth(memo = "娴嬭瘯瀹屾垚")
+    public synchronized R testFinish(@RequestHeader(required = false) String appkey,
+                                @RequestBody(required = false) Review param,
+                                HttpServletRequest request){
+        appkey="ea1f0459efc02a79f046f982767939ae";
+        auth(appkey, param, request);
+        Map<String,Boolean> map=new HashMap<>();
+
+        if (Cools.isEmpty(param)) {
+            return R.parse(BaseRes.PARAM);
+        }
+        if (param.getTestResult().equals("OK")){
+            map.put("isComplete",openService.testFinish(param));
+        }else if(param.getTestResult().equals("NG")){
+            openService.testNG(param);
+            map.put("isComplete",false);
+        }else{
+            map.put("isComplete",false);
+        }
+        return R.ok(map);
+    }
+
+    /*...........................璧e窞鏂板..............浠ヤ笂.............璧e窞鏂板...........................*/
+
 }

--
Gitblit v1.9.1