From ccb810bdcabb3a10b7463acbdb0aa66c44d9c0bc Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期五, 15 八月 2025 18:32:43 +0800
Subject: [PATCH] 对接ERP基础接口

---
 rsf-server/src/main/java/com/vincent/rsf/server/api/controller/ReceiveMsgController.java |   62 +++++++++++++++++++++++++++++-
 1 files changed, 59 insertions(+), 3 deletions(-)

diff --git a/rsf-server/src/main/java/com/vincent/rsf/server/api/controller/ReceiveMsgController.java b/rsf-server/src/main/java/com/vincent/rsf/server/api/controller/ReceiveMsgController.java
index e38d229..13816d9 100644
--- a/rsf-server/src/main/java/com/vincent/rsf/server/api/controller/ReceiveMsgController.java
+++ b/rsf-server/src/main/java/com/vincent/rsf/server/api/controller/ReceiveMsgController.java
@@ -1,12 +1,17 @@
 package com.vincent.rsf.server.api.controller;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.vincent.rsf.framework.common.R;
+import com.vincent.rsf.framework.exception.CoolException;
 import com.vincent.rsf.server.api.controller.params.BaseMatParms;
 import com.vincent.rsf.server.api.controller.params.OrderParams;
+import com.vincent.rsf.server.api.controller.params.QueryOrderParam;
 import com.vincent.rsf.server.api.service.ReceiveMsgService;
+import com.vincent.rsf.server.common.domain.BaseParam;
+import com.vincent.rsf.server.common.domain.PageParam;
 import com.vincent.rsf.server.common.utils.ExcelUtil;
+import com.vincent.rsf.server.manager.entity.Loc;
 import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate;
-import com.vincent.rsf.server.manager.entity.excel.MatnrsTemplate;
 import com.vincent.rsf.server.manager.service.MatnrService;
 import com.vincent.rsf.server.system.controller.BaseController;
 import io.swagger.annotations.Api;
@@ -21,6 +26,8 @@
 import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 
 /**
  * @author Ryan
@@ -38,6 +45,7 @@
     private ReceiveMsgService receiveMsgService;
     @Autowired
     private MatnrService matnrService;
+
 
     /**
      * @author Ryan
@@ -59,6 +67,23 @@
         }
     }
 
+
+    /**
+     * @author Ryan
+     * @date 2025/8/15
+     * @description: DO鍗曞悓姝�
+     * @version 1.0
+     */
+    @ApiOperation("鍑哄簱閫氱煡鍗�(DO鍗曞悓姝�)")
+    @PostMapping("/sync/delivery")
+    public R syncDelivery(@RequestBody List<OrderParams> orders) {
+        if (!receiveMsgService.syncPurchasee(orders)) {
+            return R.error("淇濆瓨澶辫触");
+        } else {
+            return R.ok("淇濆瓨鎴愬姛锛侊紒");
+        }
+    }
+
     /**
      * @author Ryan
      * @description 鍚屾璐ㄦ缁撴灉淇℃伅
@@ -72,16 +97,47 @@
         AsnOrderTemplate template = ExcelUtil.mockData(AsnOrderTemplate.class);
         List<AsnOrderTemplate> list = new ArrayList<>();
         list.add(template);
-         ExcelUtil.build(ExcelUtil.create(list, AsnOrderTemplate.class), response);
+        ExcelUtil.build(ExcelUtil.create(list, AsnOrderTemplate.class), response);
         System.out.println(template);
 //        return R.ok();
     }
 
+
     @ApiOperation("鍩虹鐗╂枡淇℃伅鍚屾")
     @PostMapping("/sync/base/matnrs")
     public R syncMatnrs(@RequestBody List<BaseMatParms> matnrs) {
-
+        if (Objects.isNull(matnrs)) {
+            return R.error("鍙傛暟涓嶈兘涓虹┖锛�1");
+        }
+        receiveMsgService.syncMatnrs(matnrs);
         return R.ok();
     }
 
+    @ApiOperation("鏌ヨ鍗曟嵁鐘舵��")
+    @PostMapping("/query/order")
+    public R queryOrderStatus(@RequestBody QueryOrderParam queryParams) {
+        if (Objects.isNull(queryParams)) {
+            throw new CoolException("鍙傛暟涓嶈兘涓虹┖锛侊紒");
+        }
+       return receiveMsgService.queryOrderStatus(queryParams);
+    }
+
+
+    /**
+     * @author Ryan
+     * @date 2025/8/15
+     * @description: 搴撲綅鏄庣粏鍚屾
+     * @version 1.0
+     */
+    @PostMapping("/sync/locs/detls")
+    @ApiOperation("搴撲綅淇℃伅鏄庣粏鍚屾")
+    public R syncLocDetls(@RequestBody Map<String, Object> map) {
+        BaseParam baseParam = buildParam(map, BaseParam.class);
+        PageParam<Loc, BaseParam> pageParam = new PageParam<>(baseParam, Loc.class);
+        QueryWrapper<Loc> wrapper = pageParam.buildWrapper(true);
+
+        return receiveMsgService.syncLocsDetl(pageParam, wrapper);
+    }
+
+
 }

--
Gitblit v1.9.1