|
@@ -1,5 +1,6 @@
|
|
|
package beans.wms;
|
|
package beans.wms;
|
|
|
|
|
|
|
|
|
|
+import camundajar.impl.scala.Int;
|
|
|
import common.BaseClass;
|
|
import common.BaseClass;
|
|
|
import common.Controller;
|
|
import common.Controller;
|
|
|
import common.YosException;
|
|
import common.YosException;
|
|
@@ -7,6 +8,7 @@ import common.data.*;
|
|
|
import common.data.db.DBConnect;
|
|
import common.data.db.DBConnect;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 立体仓库对接
|
|
* 立体仓库对接
|
|
@@ -110,9 +112,20 @@ public class Wms {
|
|
|
Rows rows = tqwms.runSqlQuery("select top(1) OutPlanID from TOutInt where BillNo='" + billno + "' order by CreateDate desc ");
|
|
Rows rows = tqwms.runSqlQuery("select top(1) OutPlanID from TOutInt where BillNo='" + billno + "' order by CreateDate desc ");
|
|
|
long OutPlanID = rows.get(0).getLong("OutPlanID");
|
|
long OutPlanID = rows.get(0).getLong("OutPlanID");
|
|
|
|
|
|
|
|
|
|
+ HashMap<String, Integer> itemMap = new HashMap<>();
|
|
|
|
|
+ for (Row stockbillitemsRow : stockbillitemsRows) {
|
|
|
|
|
+ String itemno = stockbillitemsRow.getString("itemno");
|
|
|
|
|
+ int qty = stockbillitemsRow.getInteger("qty");
|
|
|
|
|
+ if (itemMap.containsKey(itemno)) {
|
|
|
|
|
+ itemMap.put(itemno, itemMap.get(itemno) + qty);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ itemMap.put(itemno, qty);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String createdate = BaseClass.getDateTime_Str();
|
|
String createdate = BaseClass.getDateTime_Str();
|
|
|
ArrayList<String> sqlist = new ArrayList<>();
|
|
ArrayList<String> sqlist = new ArrayList<>();
|
|
|
- for (Row stockbillitemsRow : stockbillitemsRows) {
|
|
|
|
|
|
|
+ for (String itemno : itemMap.keySet()) {
|
|
|
SQL = "insert into TOutDetailInt(OutPlanID,BillNo,CreateDate,IsDeleted,OutDate,MaterialCode,PlanOutQuantity,OutQuantity,Status)";
|
|
SQL = "insert into TOutDetailInt(OutPlanID,BillNo,CreateDate,IsDeleted,OutDate,MaterialCode,PlanOutQuantity,OutQuantity,Status)";
|
|
|
SQL = SQL + " select ";
|
|
SQL = SQL + " select ";
|
|
|
SQL = SQL + " '" + OutPlanID + "',";// 对应出库通知单主表ID
|
|
SQL = SQL + " '" + OutPlanID + "',";// 对应出库通知单主表ID
|
|
@@ -120,8 +133,8 @@ public class Wms {
|
|
|
SQL = SQL + " '" + createdate + "',";// 创建日期
|
|
SQL = SQL + " '" + createdate + "',";// 创建日期
|
|
|
SQL = SQL + " 0,";// 是否删除
|
|
SQL = SQL + " 0,";// 是否删除
|
|
|
SQL = SQL + " '" + billdate + "',";// 出库日期
|
|
SQL = SQL + " '" + billdate + "',";// 出库日期
|
|
|
- SQL = SQL + " '" + stockbillitemsRow.getString("itemno") + "',";// 品号
|
|
|
|
|
- SQL = SQL + " " + stockbillitemsRow.getString("qty") + ",";// 出库数量
|
|
|
|
|
|
|
+ SQL = SQL + " '" + itemno + "',";// 品号
|
|
|
|
|
+ SQL = SQL + " " + itemMap.get(itemno) + ",";// 出库数量
|
|
|
SQL = SQL + " 0,";// 已出库数量
|
|
SQL = SQL + " 0,";// 已出库数量
|
|
|
SQL = SQL + " 0";// 状态:0:WMS未处理 1:WMS正在出库 2:WMS出库完成 10:ERP出库完成
|
|
SQL = SQL + " 0";// 状态:0:WMS未处理 1:WMS正在出库 2:WMS出库完成 10:ERP出库完成
|
|
|
sqlist.add(SQL);
|
|
sqlist.add(SQL);
|