|
|
@@ -433,10 +433,18 @@ public class dispatch extends Controller {
|
|
|
if (Parameter.get("system.ccerp_dockswitch").equalsIgnoreCase("true")) {
|
|
|
ERPDocking erpDocking =new ERPDocking();
|
|
|
String result =erpDocking.closeErpSainvoice(rows.get(0).getString("billno"),true,this,sa_dispatchid);
|
|
|
- if(!result.equals("true")){
|
|
|
- return getErrReturnObject().setErrMsg(result).toString();
|
|
|
- }else {
|
|
|
-
|
|
|
+ if(!result.equals("true")){
|
|
|
+ return getErrReturnObject().setErrMsg(result).toString();
|
|
|
+ }else {
|
|
|
+ JSONArray jsonArray = erpDocking.queryErpSainvoice(rows.get(0).getString("billno"));
|
|
|
+ ArrayList<String> dispatchsqlList = new ArrayList<>();
|
|
|
+ if(!jsonArray.isEmpty()){
|
|
|
+ for (Object object1:jsonArray) {
|
|
|
+ JSONObject jsonObject = (JSONObject)object1;
|
|
|
+ dispatchsqlList.add("update sa_dispatch_items set outwarehouseqty="+jsonObject.getBigDecimalValue("fqty1")+" where rowno ="+jsonObject.getIntValue("frownum")+" and sa_dispatchid='"+sa_dispatchid+"' and siteid='"+siteid+"'");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ dbConnect.runSqlUpdate(dispatchsqlList);
|
|
|
}
|
|
|
}
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|