Explorar o código

回传ERP出入库完成

k %!s(int64=2) %!d(string=hai) anos
pai
achega
a040973871

+ 16 - 5
ruoyi-admin/src/main/java/com/ruoyi/init/StartService.java

@@ -53,16 +53,27 @@ public class StartService implements CommandLineRunner {
 
     }
 
-    // 同步ERP表,插入mysql
-    public void syncService(){
+    // 同步ERP表,sqlserver插入redis
+    public void yongHuErp() throws Exception {
+        HttpRequest.postData(SyncServiceImpl.ERP_SYNC_URL);
+    }
+
+    // 同步ERP表,redis插入mysql
+    public void syncService() {
         iSyncService.syncSkuType();
         iSyncService.syncSku();
         iSyncService.syncSkuBarcode();
         iSyncService.syncOrderList();
     }
 
-    // 同步ERP表,sqlserver插入redis
-    public void yongHuErp() throws Exception {
-        HttpRequest.postData(SyncServiceImpl.ERP_SYNC_URL);
+    // 回传ERP入库单
+    public void callBackAsn() {
+        iSyncService.callBackAsn();
     }
+
+    // 回传ERP出库单
+    public void callBackOrder() {
+        iSyncService.callBackOrder();
+    }
+
 }

+ 1 - 1
ruoyi-admin/src/test/java/com/ruoyi/admin/test/base/WarehouseTest.java

@@ -346,7 +346,7 @@ public class WarehouseTest {
         erpOrderList.setOrderNo(8);
         erpOrderList.setOrderState("2");
         boolean b = syncService.writeBack(erpBarCodeListList);
-        boolean b1 = syncService.updaErpOrderStatus(erpOrderList);
+        boolean b1 = syncService.updateErpOrderStatus(erpOrderList);
         System.out.println(b + "|" + b1);
     }
 

+ 6 - 1
warewms-ams/src/main/java/com/ruoyi/ams/erp/service/ISyncService.java

@@ -16,5 +16,10 @@ public interface ISyncService {
     void syncOrderList();
 
     boolean writeBack(List<ErpBarCodeList> erpBarCodeListList) throws Exception;
-    boolean updaErpOrderStatus(ErpOrderList erpOrderList) throws Exception;
+
+    boolean updateErpOrderStatus(ErpOrderList erpOrderList) throws Exception;
+
+    void callBackAsn();
+
+    void callBackOrder();
 }

+ 15 - 1
warewms-ams/src/main/java/com/ruoyi/ams/erp/service/impl/SyncServiceImpl.java

@@ -155,9 +155,23 @@ public class SyncServiceImpl implements ISyncService {
     }
 
     @Override
-    public boolean updaErpOrderStatus(ErpOrderList erpOrderList) throws Exception {
+    public boolean updateErpOrderStatus(ErpOrderList erpOrderList) throws Exception {
         String jsonString = JSON.toJSONString(erpOrderList);
         String result = HttpRequest.postData(SyncServiceImpl.ERP_UPDATE_STATUS_URL, jsonString);
         return result.equals("200");
     }
+
+    @Override
+    public void callBackAsn() {
+        // 查出入库单(单头状态为99,edi_send_flag为空或者为0)
+        // 查出所有明细
+        // 循环明细调updateErpOrderStatus方法 setOrderState setOrderName setOrderNo
+        // 成功之后修改edi_send_flag为1
+
+    }
+
+    @Override
+    public void callBackOrder() {
+        // 同入库
+    }
 }