|
|
@@ -302,6 +302,7 @@ public class sendplandetail extends Controller {
|
|
|
JSONArray detailarray = content.getJSONArray("details");
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
|
HashMap<String, HashMap<String, List<JSONObject>>> agentmap = new HashMap<String, HashMap<String, List<JSONObject>>>();
|
|
|
+ ArrayList<String> sys_enterpriseidList = new ArrayList<>();
|
|
|
for (Object object : detailarray) {
|
|
|
JSONObject jsonObject = (JSONObject) object;
|
|
|
if (jsonObject.getDouble("sendqty") <= 0) {
|
|
|
@@ -310,6 +311,7 @@ public class sendplandetail extends Controller {
|
|
|
sa_orderitemsids.add(jsonObject.getLongValue("sa_orderitemsid"));
|
|
|
String key = "";
|
|
|
String sys_enterpriseid = jsonObject.getString("sys_enterpriseid");
|
|
|
+ sys_enterpriseidList.add(sys_enterpriseid);
|
|
|
String topclassnum = jsonObject.getString("topclassnum");
|
|
|
key = topclassnum;
|
|
|
HashMap<String, List<JSONObject>> agent = null;
|
|
|
@@ -340,6 +342,7 @@ public class sendplandetail extends Controller {
|
|
|
|
|
|
ArrayList<Long> st_stockbillids = new ArrayList<Long>();
|
|
|
RowsMap itemRowsMap = SQLFactory.createQuerySQL(this, "plm_item", "*").setTableAlias("t1").addJoinTable(JOINTYPE.left, "st_stock", "t2", "t1.siteid = t2.siteid and t1.stockno = t2.stockno","stockid").setWhere("itemid", orderdetails.toArrayList("itemid")).query().toRowsMap("itemid");
|
|
|
+ RowsMap agentsRowsMap = SQLFactory.createQuerySQL(this, "sa_agents", "*").setWhere("sys_enterpriseid", sys_enterpriseidList).query().toRowsMap("sys_enterpriseid");
|
|
|
while (iter.hasNext()) {
|
|
|
Map.Entry entry = (Map.Entry) iter.next();
|
|
|
String sys_enterpriseid = (String) entry.getKey();
|
|
|
@@ -361,6 +364,7 @@ public class sendplandetail extends Controller {
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("st_stockbillid", st_stockbillid);
|
|
|
sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
+ sqlFactory.addParameter("logisticsmethod", agentsRowsMap.containsKey(sys_enterpriseid)?agentsRowsMap.get(sys_enterpriseid).get(0).getString("logisticsmethod"):"");
|
|
|
sqlFactory.addParameter("billno", createBillCode("stockbill"));
|
|
|
sqlFactory.addParameter("type", "销售出库");
|
|
|
sqlFactory.addParameter("rb", 1);
|
|
|
@@ -370,7 +374,7 @@ public class sendplandetail extends Controller {
|
|
|
sqlFactory.addParameter("outplace", firstItem.getStringValue("outplace"));
|
|
|
sqlFactory.addParameter("rec_contactsid", firstItem.getStringValue("rec_contactsid"));
|
|
|
sqlFactory.addParameter("delivery", "");
|
|
|
- sqlFactory.addParameter("logisticsmethod", firstItem.getStringValue("logisticsmethod"));
|
|
|
+ //sqlFactory.addParameter("logisticsmethod", firstItem.getStringValue("logisticsmethod"));
|
|
|
sqlFactory.addParameter("invoice_enterprisename", firstItem.getStringValue("invoicename"));
|
|
|
sqlFactory.addParameter("invoice_address", firstItem.getStringValue("invoiceaddress"));
|
|
|
sqlFactory.addParameter("invoice_taxno", firstItem.getStringValue("invoicetaxno"));
|
|
|
@@ -381,7 +385,7 @@ public class sendplandetail extends Controller {
|
|
|
sqlFactory.addParameter("outplace", "");
|
|
|
sqlFactory.addParameter("rec_contactsid", 0);
|
|
|
sqlFactory.addParameter("delivery", "");
|
|
|
- sqlFactory.addParameter("logisticsmethod", "");
|
|
|
+ //sqlFactory.addParameter("logisticsmethod", "");
|
|
|
sqlFactory.addParameter("invoice_enterprisename", "");
|
|
|
sqlFactory.addParameter("invoice_address","");
|
|
|
sqlFactory.addParameter("invoice_taxno", "");
|