|
|
@@ -2036,10 +2036,10 @@ public class Order extends Controller {
|
|
|
Rows enterprisefinancerows =enterprisefinanceQuerySQL.query();
|
|
|
|
|
|
|
|
|
- RowsMap enterprisefinancerowsMap =enterprisefinancerows.toRowsMap("sys_enterpriseid");
|
|
|
- RowsMap enterpriserowsMap = orderRows_result.toRowsMap("sys_enterpriseid");
|
|
|
+ //RowsMap enterprisefinancerowsMap =enterprisefinancerows.toRowsMap("sys_enterpriseid");
|
|
|
+ RowsMap addressMap = orderRows_result.toRowsMap("address");
|
|
|
RowsMap deliveryrowsMap = orderRows_result.toRowsMap("delivery");
|
|
|
- Set<String> enterpriseSet = enterpriserowsMap.keySet();
|
|
|
+ Set<String> addressSet = addressMap.keySet();
|
|
|
Set<String> deliverySet = deliveryrowsMap.keySet();
|
|
|
for(Object object :noneeddeliverys){
|
|
|
deliverySet.remove((String)object);
|
|
|
@@ -2056,16 +2056,16 @@ public class Order extends Controller {
|
|
|
RowsMap accountbalancerowsMap = accountbalancerows.toRowsMap("sys_enterpriseid");
|
|
|
|
|
|
Rows departmenthrrows =dbConnect.runSqlQuery("select t1.*,t2.depname from sys_departmenthrid t1 left join sys_department t2 on t1.departmentid=t2.departmentid where t1.hrid="+hrid);
|
|
|
- for(String sys_enterpriseid :enterpriseSet){
|
|
|
+ for(String address :addressSet){
|
|
|
for(String delivery:deliverySet){
|
|
|
- if(enterpriserowsMap.get(sys_enterpriseid).toRowsMap("delivery").containsKey(delivery)){
|
|
|
- Rows orderdetailRows = enterpriserowsMap.get(sys_enterpriseid).toRowsMap("delivery").get(delivery);
|
|
|
+ if(addressMap.get(address).toRowsMap("delivery").containsKey(delivery)){
|
|
|
+ Rows orderdetailRows = addressMap.get(address).toRowsMap("delivery").get(delivery);
|
|
|
long st_stockbillid = createTableID("st_stockbill");
|
|
|
InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "st_stockbill");
|
|
|
insertSQL.setUniqueid(st_stockbillid);
|
|
|
insertSQL.setSiteid(siteid);
|
|
|
- insertSQL.setValue("sys_enterpriseid", sys_enterpriseid);
|
|
|
- insertSQL.setValue("rec_contactsid", orderdetailRows.get(0).getLong("rec_contactsid"));
|
|
|
+ insertSQL.setValue("sys_enterpriseid", orderdetailRows.get(0).getLong("sys_enterpriseid"));
|
|
|
+ insertSQL.setValue("rec_contactsid", orderdetailRows.get(0).getLong("rec_contactsid"));
|
|
|
insertSQL.setValue("sa_accountclassid",accountbalancerows.isNotEmpty()?accountbalancerows.get(0).getLong("sa_accountclassid"):0);
|
|
|
insertSQL.setValue("departmentid", departmenthrrows.isNotEmpty()?departmenthrrows.get(0).getLong("departmentid"):0);
|
|
|
insertSQL.setValue("stockid", 0);
|
|
|
@@ -2173,7 +2173,7 @@ public class Order extends Controller {
|
|
|
}
|
|
|
dbConnect.runSqlUpdate(sqlList);
|
|
|
HashMap<String,Object> result=new HashMap<>();
|
|
|
- String success= "已生成"+enterpriseSet.size()+" 家经销商,共"+stockbillcount+"张出库单;失败"+errRows_result.toRowsMap("agentnum").size()+"家经销商,共"+errRows_result.toRowsMap("sonum").size()+"张订单!";
|
|
|
+ String success= "已生成"+addressSet.size()+" 家经销商,共"+stockbillcount+"张出库单;失败"+errRows_result.toRowsMap("agentnum").size()+"家经销商,共"+errRows_result.toRowsMap("sonum").size()+"张订单!";
|
|
|
result.put("success",success);
|
|
|
result.put("errinfo",errRows_result);
|
|
|
return getSucReturnObject().setData(result).toString();
|