Sfoglia il codice sorgente

立仓对接优化

shenjingwei 6 mesi fa
parent
commit
3af57ac6d5

+ 4 - 0
src/custom/beans/period/Period.java

@@ -26,6 +26,10 @@ public class Period {
         return get(controller.dbConnect, controller.siteid, date);
     }
 
+    public static String get(DBConnect dbConnect, String siteid, Date date) throws YosException {
+        return get(dbConnect, siteid, new SimpleDateFormat("yyyy-MM-dd").format(date));
+    }
+
     public static String get(DBConnect dbConnect, String siteid, String date) throws YosException {
         Rows rows = dbConnect.runSqlQuery("select CONCAT(year, '-',LPAD(month, 2, '0')) period from st_period where siteid='" + siteid + "' and begdate<='" + date + "' and '" + date + "'<=enddate");
         if (rows.size() != 1) {

+ 2 - 0
src/custom/service/GetStockBillFromMQWms.java

@@ -1,5 +1,6 @@
 package service;
 
+import beans.period.Period;
 import beans.stockbill.Stockbill;
 import common.ServiceController;
 import common.YosException;
@@ -107,6 +108,7 @@ public class GetStockBillFromMQWms extends ServiceController {
                 stStockbill.setValue("billno", billno);
                 stStockbill.setValue("siteid", "MD");
                 stStockbill.setDateValue("billdate");
+                stStockbill.setValue("period", Period.get(dbConnect, "MD", getDate()));
                 stStockbill.setValue("stockid", stockid);
                 stStockbill.setValue("remarks", "谈桥立仓入库生成");
                 stStockbill.setValue("createby", "u8");

+ 3 - 0
src/custom/service/GetStockBillFromTQWms.java

@@ -1,5 +1,6 @@
 package service;
 
+import beans.period.Period;
 import beans.stockbill.Stockbill;
 import common.ServiceController;
 import common.YosException;
@@ -113,6 +114,7 @@ public class GetStockBillFromTQWms extends ServiceController {
                 stStockbill.setValue("billno", billno);
                 stStockbill.setValue("siteid", "MD");
                 stStockbill.setDateValue("billdate");
+                stStockbill.setValue("period", Period.get(dbConnect, "MD", getDate()));
                 stStockbill.setValue("stockid", stockid);
                 stStockbill.setValue("remarks", "谈桥立仓入库生成");
                 stStockbill.setValue("createby", "wms");
@@ -255,6 +257,7 @@ public class GetStockBillFromTQWms extends ServiceController {
                 stStockbill.setValue("departmentid", depRowsMap.get("101").get(0).getLong("departmentid"));
                 stStockbill.setValue("sa_supplierid", suppRowsMap.get("MDCXP-013").get(0).getLong("sa_supplierid"));
                 stStockbill.setValue("billdate", createdate);
+                stStockbill.setValue("period", Period.get(dbConnect, "MD", createdate));
                 stStockbill.setValue("stockid", stockid);
                 stStockbill.setValue("remarks", "wms入库");
                 stStockbill.setValue("createby", "wms");