From 317d21981520b527d971929586505ddf0a1a1d71 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期四, 04 一月 2024 14:27:00 +0800
Subject: [PATCH] #

---
 zy-asrs-openapi/src/main/java/com/zy/asrs/openapi/controller/ApiController.java |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/zy-asrs-openapi/src/main/java/com/zy/asrs/openapi/controller/ApiController.java b/zy-asrs-openapi/src/main/java/com/zy/asrs/openapi/controller/ApiController.java
index 123c454..944eed3 100644
--- a/zy-asrs-openapi/src/main/java/com/zy/asrs/openapi/controller/ApiController.java
+++ b/zy-asrs-openapi/src/main/java/com/zy/asrs/openapi/controller/ApiController.java
@@ -5,10 +5,11 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.zy.asrs.common.openapi.entity.HostKey;
 import com.zy.asrs.common.openapi.entity.param.GenerateOrderPakInParam;
+import com.zy.asrs.common.openapi.service.ApiService;
 import com.zy.asrs.common.openapi.service.HostKeyService;
 import com.zy.asrs.common.web.BaseController;
 import com.zy.asrs.common.wms.entity.DocType;
-import com.zy.asrs.common.wms.service.DocTypeService;
+import com.zy.asrs.framework.annotations.AppAuth;
 import com.zy.asrs.framework.common.BaseRes;
 import com.zy.asrs.framework.common.Cools;
 import com.zy.asrs.framework.common.R;
@@ -29,12 +30,16 @@
     @Autowired
     private HostKeyService hostKeyService;
     @Autowired
-    private DocTypeService docTypeService;
+    private ApiService apiService;
 
+    /**
+     * 鐢熸垚鍏ュ簱璁㈠崟
+     */
     @PostMapping("/generateOrderPakIn")
+    @AppAuth(memo = "鐢熸垚鍏ュ簱璁㈠崟")
     public synchronized R generateOrderPakIn(@RequestHeader(required = false) String appkey,
                                            @RequestBody GenerateOrderPakInParam param) {
-        auth(appkey, param, true);
+        HostKey hostKey = auth(appkey, param, true);
         if (Cools.isEmpty(param)) {
             return R.parse(BaseRes.PARAM);
         }
@@ -47,18 +52,23 @@
         if (Cools.isEmpty(param.getOrderDetails())) {
             return R.error("鍗曟嵁鏄庣粏[orderDetails]涓嶈兘涓虹┖");
         }
-//        openService.pakinOrderCreate(param);
+        param.setHostId(hostKey.getHostId());
+        apiService.generateOrderPakIn(param);
         return R.ok();
     }
 
+    /**
+     * 鑾峰彇璁㈠崟绫诲瀷
+     */
     @PostMapping("/getOrderType")
     public synchronized R getOrderType(@RequestHeader(required = false) String appkey) {
         auth(appkey, null, false);
-        List<DocType> list = docTypeService.list();
+        List<DocType> list = apiService.getOrderType();
         return R.ok().add(list);
     }
 
     private HostKey auth(String appkey, Object obj, boolean signCheck) {
+        request.setAttribute("cache", obj);
         if (Cools.isEmpty(appkey)) {
             throw new CoolException("璁よ瘉澶辫触锛岃纭appKey鏃犺锛�");
         }

--
Gitblit v1.9.1