Explorar o código

-- 中间表ERP需求单状态修改接口添加
-- 中间表ERP条码扫描记录数据添加修改

stars hai 1 ano
pai
achega
1107251d25

+ 12 - 1
src/main/java/com/warewms/controller/ErpWriteBackController.java

@@ -2,6 +2,7 @@ package com.warewms.controller;
 
 import com.warewms.common.utils.R;
 import com.warewms.entity.erp.ErpBarCodeList;
+import com.warewms.entity.erp.ErpOrderList;
 import com.warewms.service.impl.ErpSyncServiceImpl;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,7 +20,7 @@ public class ErpWriteBackController {
     private ErpSyncServiceImpl erpSyncService;
 
     /**
-     * 中间表写入数据
+     * 中间表写入数据(叉车扫描条码记录表)
      */
     @ResponseBody
     @PostMapping("writeData")
@@ -27,4 +28,14 @@ public class ErpWriteBackController {
         erpSyncService.writeBack(erpBarCodeListList);
         return R.ok();
     }
+
+    /**
+     * 中间表修改数据(需求单扫描状态修改)
+     */
+    @ResponseBody
+    @PostMapping("updaOrderStatus")
+    public R updaOrderStatus(@RequestParam ErpOrderList erpOrderList){
+        erpSyncService.updaErpStatus(erpOrderList);
+        return R.ok();
+    }
 }

+ 3 - 0
src/main/java/com/warewms/service/ErpSyncService.java

@@ -1,6 +1,7 @@
 package com.warewms.service;
 
 import com.warewms.entity.erp.ErpBarCodeList;
+import com.warewms.entity.erp.ErpOrderList;
 
 import java.util.List;
 
@@ -8,4 +9,6 @@ public interface ErpSyncService {
     void erpSync();
 
     void writeBack(List<ErpBarCodeList> erpBarCodeListList);
+
+    void updaErpStatus(ErpOrderList erpOrderList);
 }

+ 18 - 3
src/main/java/com/warewms/service/impl/ErpSyncServiceImpl.java

@@ -1,7 +1,6 @@
 package com.warewms.service.impl;
 
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.jfinal.kit.Kv;
 import com.jfinal.plugin.activerecord.Db;
 import com.jfinal.plugin.activerecord.Record;
@@ -15,7 +14,6 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -118,13 +116,30 @@ public class ErpSyncServiceImpl implements ErpSyncService {
             param.set("inout",erpBarCodeList.getInOut());
             param.set("stockID",erpBarCodeList.getStockId());
             param.set("boxid",erpBarCodeList.getBoxNo());
+            param.set("erpResult",erpBarCodeList.getErpResult());
             param.set("createUser", erpBarCodeList.getCreateUser());
             param.set("createDate",erpBarCodeList.getCreateDate());
-            param.set("wmsMark","N");
+            //param.set("wmsMark","N");
             SqlPara sqlPara = Db.getSqlPara("erp.insertBarcodeList",param);
             if (Db.update(sqlPara) == 0) {
                 throw new RRException("writeBack失败!");
             }
         }
     }
+
+    @Override
+    public void updaErpStatus(ErpOrderList erpOrderList) {
+
+        Kv param = Kv.create();
+        param.put("orderState", erpOrderList.getOrderState());
+        param.put("orderNo", erpOrderList.getOrderNo());
+        param.put("orderName", erpOrderList.getOrderName());
+        SqlPara update = Db.getSqlPara("erp.updaErpStatus", param);
+
+        if(Db.update(update) == 0){
+            throw new RRException("updaOrderStatus——修改ERP需求单状态失败!");
+        }
+    }
+
+
 }

+ 7 - 2
src/main/resources/sql/erp.sql

@@ -30,6 +30,11 @@
     update ERP_ORDER_LIST set wms_mark = 'Y' where order_no = #para(orderNo) and order_name = #para(orderName)
 #end
 
+#sql("updaErpStatus")
+    update ERP_ORDER_LIST set ORDER_STATE = #para(orderState)
+    where order_no = #para(orderNo) and order_name = #para(orderName)
+#end
+
 #sql("insertBarcodeList")
     INSERT INTO [dbo].[ERP_BARCODE_LIST]
     (    [BARCODE]
@@ -40,9 +45,9 @@
         ,[IN_OUT]
         ,[STOCKID]
         ,[BOXID]
+        ,[ERP_RESULT]
         ,[CREATE_USER]
         ,[CREATE_DATE]
-        ,[WMS_MARK]
         ,[DB])
     VALUES
         (   #para(barcode)
@@ -53,9 +58,9 @@
             ,#para(inout)
             ,#para(stockID)
             ,#para(boxid)
+            ,#para(erpResult)
             ,#para(createUser)
             ,#para(createDate)
-            ,#para(wmsMark)
             ,'YH'
 #end