代码更新

This commit is contained in:
2023-04-06 16:28:15 +08:00
parent 9dc7492132
commit c7b7fc8b1a

View File

@@ -251,7 +251,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
paramMesMst.put("item", paramArr);
// 调用接口回传
// new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
new LmsToMesServiceImpl().childRollFGOutboundComplete(paramMesMst);
jo_mst.put("upload_mes", "1");
jo_mst.put("is_upload", "1");
@@ -523,8 +523,8 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
// 调拨
if (StrUtil.equals(bill_type, "1004")) {
// 调拨
if (StrUtil.equals(bill_type, "0004")) {
// 回传sap
JSONArray paramSapMstArr = new JSONArray();
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0);
@@ -870,6 +870,48 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
// 调拨入库
if (StrUtil.equals(bill_type, "0004")) {
// 回传sap
JSONArray paramSapMstArr = new JSONArray();
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0);
JSONObject jsonDtl = wo_dtl.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").uniqueResult(0);
for (int j = 0; j < disArr.size(); j++) {
JSONObject jsonDis = disArr.getJSONObject(j);
JSONObject paramDis = new JSONObject();
paramDis.put("ZDBSQD", jsonDtl.getString("vbeln"));
paramDis.put("VBELN", jsonDtl.getString("source_bill_code"));
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
paramDis.put("MATNR", jsonMater.getString("material_code"));
paramDis.put("LGORT1", jo_mst.getString("stor_code"));
JSONObject jsonStorOut = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_id = '" + jo_mst.getString("out_stor_id") + "'").uniqueResult(0);
paramDis.put("LGORT2", jsonStorOut.getString("stor_code"));
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "'").uniqueResult(0);
paramDis.put("ZHL02", jsonSub.getString("width"));
paramDis.put("ZZWLHD", jsonSub.getString("thickness"));
paramDis.put("CHARG", jsonDis.getString("pcsn"));
paramDis.put("KALAB", jsonDis.getString("plan_qty"));
paramDis.put("WERKS", "2460");
paramSapMstArr.add(paramDis);
}
JSONObject param = new JSONObject();
param.put("HEAD", paramSapMstArr);
System.out.println(param.toString());
// 调用接口回传
new LmsToSapServiceImpl().returnOutDtl(param);
jo_mst.put("upload_sap", "1");
jo_mst.put("is_upload", "1");
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
jo_mst.put("upload_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
// 拆分入库回传mes
if (StrUtil.equals(bill_type, "0005")) {
JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag","2").addParam("iostorinv_id",jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
@@ -1153,7 +1195,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
// 调拨出库
if (StrUtil.equals(bill_type, "1004")) {
/* // 2.回传mes
// 回传mes
JSONObject paramMesMst = new JSONObject();
String userName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
String passWord = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
@@ -1185,47 +1227,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jo_mst.put("is_upload", "1");
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
jo_mst.put("upload_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);*/
// 回传sap
JSONArray paramSapMstArr = new JSONArray();
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0);
JSONObject jsonDtl = wo_dtl.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").uniqueResult(0);
for (int j = 0; j < disArr.size(); j++) {
JSONObject jsonDis = disArr.getJSONObject(j);
JSONObject paramDis = new JSONObject();
paramDis.put("ZDBSQD",jsonDtl.getString("vbeln"));
paramDis.put("VBELN",jsonDtl.getString("source_bill_code"));
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
paramDis.put("MATNR",jsonMater.getString("material_code"));
paramDis.put("LGORT1",jo_mst.getString("stor_code"));
JSONObject jsonStorOut = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_id = '" + jo_mst.getString("out_stor_id") + "'").uniqueResult(0);
paramDis.put("LGORT2",jsonStorOut.getString("stor_code"));
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "'").uniqueResult(0);
paramDis.put("ZHL02",jsonSub.getString("width"));
paramDis.put("ZZWLHD",jsonSub.getString("thickness"));
paramDis.put("CHARG",jsonDis.getString("pcsn"));
paramDis.put("KALAB",jsonDis.getString("plan_qty"));
paramDis.put("WERKS","2460");
paramSapMstArr.add(paramDis);
}
JSONObject param = new JSONObject();
param.put("HEAD", paramSapMstArr);
System.out.println(param.toString());
// 调用接口回传
new LmsToSapServiceImpl().returnOutDtl(param);
jo_mst.put("upload_sap", "1");
jo_mst.put("is_upload", "1");
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
jo_mst.put("upload_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
// 手工出库