rev:1.立库监控新增空托盘监控 2.调拨同步接口支持多条明细
This commit is contained in:
@@ -458,6 +458,8 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
String lgort_out = jo.getString("LGORT1"); // 调出仓库
|
||||
String lgort_in = jo.getString("LGORT2"); // 调入仓库
|
||||
|
||||
if (ObjectUtil.isEmpty(jo.getString("ZDBSQD"))) throw new BadRequestException("交货单不能为空!");
|
||||
|
||||
JSONObject jsonStorOut = storTab.query("stor_code = '" + lgort_out + "' and is_used = '1' and is_delete = '0'").uniqueResult(0);
|
||||
JSONObject jsonStorIn = storTab.query("stor_code = '" + lgort_in + "' and is_used = '1' and is_delete = '0'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonStorOut) || ObjectUtil.isEmpty(jsonStorIn)) {
|
||||
@@ -488,21 +490,29 @@ public class SapToLmsServiceImpl implements SapToLmsService {
|
||||
jsonMst.put("user", "sap");
|
||||
|
||||
// 明细
|
||||
JSONArray tableData = new JSONArray();
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
JSONObject jsonMater = materTab.query("material_code = '" + jo.getString("MATNR") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("此物料不存在" + jo.getString("MATNR"));
|
||||
JSONObject jsonUnit = unitTab.query("measure_unit_id = '" + jsonMater.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
JSONArray item = jo.getJSONArray("ITEM");
|
||||
|
||||
jsonDtl.put("material_id", jsonMater.getString("material_id"));
|
||||
jsonDtl.put("qty_unit_id", jsonMater.getLongValue("base_unit_id"));
|
||||
jsonDtl.put("qty_unit_name", jsonUnit.getString("unit_name"));
|
||||
jsonDtl.put("plan_qty", jo.getDoubleValue("KALAB"));
|
||||
jsonDtl.put("source_bill_code", jo.getString("ZVBELN"));
|
||||
jsonDtl.put("vbeln", jo.getString("ZDBSQD")); // 来源交货单
|
||||
// jsonDtl.put("posnr", json.getString("POSNR")); // 来源交货单行
|
||||
jsonDtl.put("width", jo.getString("ZHL02")); // 幅宽
|
||||
tableData.add(jsonDtl);
|
||||
JSONArray tableData = new JSONArray();
|
||||
for (int i = 0; i < item.size(); i++) {
|
||||
JSONObject jsonObject = item.getJSONObject(i);
|
||||
JSONObject jsonDtl = new JSONObject();
|
||||
|
||||
JSONObject jsonMater = materTab.query("material_code = '" + jsonObject.getString("MATNR") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("此物料不存在" + jsonObject.getString("MATNR"));
|
||||
JSONObject jsonUnit = unitTab.query("measure_unit_id = '" + jsonMater.getString("base_unit_id") + "'").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonObject.getString("KALAB"))) throw new BadRequestException("调拨数量不能为空!");
|
||||
if (ObjectUtil.isEmpty(jsonObject.getString("ZVBELN"))) throw new BadRequestException("订单不能为空!");
|
||||
|
||||
jsonDtl.put("material_id", jsonMater.getString("material_id"));
|
||||
jsonDtl.put("qty_unit_id", jsonMater.getLongValue("base_unit_id"));
|
||||
jsonDtl.put("qty_unit_name", jsonUnit.getString("unit_name"));
|
||||
jsonDtl.put("plan_qty", jsonObject.getDoubleValue("KALAB"));
|
||||
jsonDtl.put("source_bill_code", jsonObject.getString("ZVBELN"));
|
||||
jsonDtl.put("vbeln", jo.getString("ZDBSQD")); // 来源交货单
|
||||
jsonDtl.put("width", jsonObject.getString("ZHL02")); // 幅宽
|
||||
tableData.add(jsonDtl);
|
||||
}
|
||||
jsonMst.put("tableData", tableData);
|
||||
|
||||
// 调用出库新增
|
||||
|
||||
@@ -596,7 +596,9 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
||||
for (int j = 0; j < disArr.size(); j++) {
|
||||
JSONObject jsonDis = disArr.getJSONObject(j);
|
||||
JSONObject paramDis = new JSONObject();
|
||||
paramDis.put("ZVBELN", jsonDtl.getString("source_bill_code"));
|
||||
JSONObject jsonDtl2 = wo_dtl.query("iostorinvdtl_id = '" + jsonDis.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
|
||||
paramDis.put("ZVBELN", jsonDtl2.getString("source_bill_code"));
|
||||
|
||||
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
|
||||
paramDis.put("MATNR", jsonMater.getString("material_code"));
|
||||
|
||||
Reference in New Issue
Block a user