|
|
|
|
@@ -25,8 +25,6 @@ import org.nl.wms.ext.sap.service.impl.LmsToSapServiceImpl;
|
|
|
|
|
import org.nl.wms.st.returns.service.InAndOutReturnService;
|
|
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.transaction.support.TransactionTemplate;
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
@@ -39,8 +37,6 @@ import java.util.*;
|
|
|
|
|
@RequiredArgsConstructor
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
private final TransactionTemplate transactionTemplate;
|
|
|
|
|
|
|
|
|
|
private final ISysUserService iSysUserService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -235,9 +231,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
paramMesMst.put("iOutboundUser", jo_mst.getString("confirm_optname"));
|
|
|
|
|
paramMesMst.put("iOutboundTime", DateUtil.now());
|
|
|
|
|
|
|
|
|
|
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
|
|
|
|
|
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
|
|
|
|
|
.process().getResultJSONArray(0);
|
|
|
|
|
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2").addParam("iostorinv_id", jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
|
|
|
|
|
|
|
|
|
|
JSONArray paramArr = new JSONArray();
|
|
|
|
|
for (int j = 0; j < boxArr.size(); j++) {
|
|
|
|
|
@@ -275,9 +269,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
paramMesMst.put("iOutboundUser", jo_mst.getString("confirm_optname"));
|
|
|
|
|
paramMesMst.put("iOutboundTime", DateUtil.now());
|
|
|
|
|
|
|
|
|
|
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
|
|
|
|
|
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
|
|
|
|
|
.process().getResultJSONArray(0);
|
|
|
|
|
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2").addParam("iostorinv_id", jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
|
|
|
|
|
|
|
|
|
|
JSONArray paramArr = new JSONArray();
|
|
|
|
|
for (int j = 0; j < boxArr.size(); j++) {
|
|
|
|
|
@@ -421,7 +413,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
jsonDtl.put("LGORT", lgort); // 明細储存地点
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonSub)) {
|
|
|
|
|
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
|
|
|
|
|
}
|
|
|
|
|
@@ -441,7 +433,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
param.put("HEAD", paramSapMstArr);
|
|
|
|
|
// System.out.println(param.toString());
|
|
|
|
|
|
|
|
|
|
// 调用接口回传
|
|
|
|
|
new LmsToSapServiceImpl().returnDelivery(param);
|
|
|
|
|
@@ -494,7 +485,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonSub)) {
|
|
|
|
|
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
|
|
|
|
|
}
|
|
|
|
|
@@ -564,11 +555,10 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSect = sectTab.query("sect_id = '" + json2.getString("sect_id") + "'").uniqueResult(0);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonSect)) {
|
|
|
|
|
//jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
|
|
|
|
|
jsonDtl.put("LGORT", lgort); // 明細储存地点
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonSub)) {
|
|
|
|
|
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
|
|
|
|
|
}
|
|
|
|
|
@@ -588,7 +578,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
param.put("HEAD", paramSapMstArr);
|
|
|
|
|
System.out.println(param.toString());
|
|
|
|
|
|
|
|
|
|
// 调用接口回传
|
|
|
|
|
new LmsToSapServiceImpl().returnDelivery(param);
|
|
|
|
|
@@ -626,7 +615,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
|
|
|
|
|
paramDis.put("MATNR", jsonMater.getString("material_code"));
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "' AND bill_id = '"+jsonDis.getString("iostorinv_id")+"'").uniqueResult(0);
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "' AND bill_id = '" + jsonDis.getString("iostorinv_id") + "'").uniqueResult(0);
|
|
|
|
|
paramDis.put("ZHL02", jsonSub.getString("width"));
|
|
|
|
|
paramDis.put("ZZWLHD", jsonSub.getString("thickness"));
|
|
|
|
|
paramDis.put("CHARG", jsonSub.getString("sap_pcsn"));
|
|
|
|
|
@@ -636,7 +625,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
}
|
|
|
|
|
param.put("ITEM", paramSapMstArr);
|
|
|
|
|
//查询该调拨入库单对应的出库单
|
|
|
|
|
JSONObject out_mst = wo_mst.query("source_id = '"+jo_mst.getString("source_id")+"' AND io_type = '1' AND is_delete = '0'").uniqueResult(0);
|
|
|
|
|
JSONObject out_mst = wo_mst.query("source_id = '" + jo_mst.getString("source_id") + "' AND io_type = '1' AND is_delete = '0'").uniqueResult(0);
|
|
|
|
|
param.put("ZACTION", "P");
|
|
|
|
|
param.put("BUDAT", out_mst.getString("biz_date"));
|
|
|
|
|
param.put("ZZYGYF", out_mst.getString("estimated_freight"));
|
|
|
|
|
@@ -708,7 +697,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
paramMst.put("T_ITEM", paramArr);
|
|
|
|
|
|
|
|
|
|
// 调用接口回传
|
|
|
|
|
System.out.println(paramMst.toString());
|
|
|
|
|
new LmsToSapServiceImpl().returnMoveDtl(paramMst);
|
|
|
|
|
|
|
|
|
|
jo_mst.put("upload_sap", "1");
|
|
|
|
|
@@ -760,7 +748,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonSub)) {
|
|
|
|
|
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
|
|
|
|
|
}
|
|
|
|
|
@@ -829,12 +817,12 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
map.put("幅宽", json.getString("width_standard"));
|
|
|
|
|
map.put("仓位", json.getString("struct_code"));
|
|
|
|
|
if (ObjectUtil.isEmpty(json.getString("sale_order_name"))) {
|
|
|
|
|
throw new BadRequestException("子卷"+json.getString("pcsn")+"销售订单为空!");
|
|
|
|
|
throw new BadRequestException("子卷" + json.getString("pcsn") + "销售订单为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
map.put("销售订单", json.getString("sale_order_name").substring(0, json.getString("sale_order_name").indexOf("-")));
|
|
|
|
|
map.put("行号", json.getString("sale_order_name").substring(json.getString("sale_order_name").indexOf("-")+1,json.getString("sale_order_name").length()));
|
|
|
|
|
map.put("行号", json.getString("sale_order_name").substring(json.getString("sale_order_name").indexOf("-") + 1, json.getString("sale_order_name").length()));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
map.put("销售订单", json.getString("sale_order_name"));
|
|
|
|
|
map.put("行号", "");
|
|
|
|
|
@@ -940,7 +928,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
jsonDtl.put("LGORT", jo_mst.getString("remark")); // 明細储存地点
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonSect)) {
|
|
|
|
|
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
|
|
|
|
|
}
|
|
|
|
|
@@ -960,8 +948,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
param.put("HEAD", paramSapMstArr);
|
|
|
|
|
// System.out.println(param.toString());
|
|
|
|
|
|
|
|
|
|
// 调用接口回传
|
|
|
|
|
new LmsToSapServiceImpl().returnDelivery(param);
|
|
|
|
|
|
|
|
|
|
@@ -994,7 +980,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
|
|
|
|
|
paramDis.put("MATNR", jsonMater.getString("material_code"));
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "' AND bill_id = '"+jsonDis.getString("iostorinv_id")+"'").uniqueResult(0);
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "' AND bill_id = '" + jsonDis.getString("iostorinv_id") + "'").uniqueResult(0);
|
|
|
|
|
paramDis.put("ZHL02", jsonSub.getString("width"));
|
|
|
|
|
paramDis.put("ZZWLHD", jsonSub.getString("thickness"));
|
|
|
|
|
paramDis.put("CHARG", jsonSub.getString("sap_pcsn"));
|
|
|
|
|
@@ -1003,10 +989,9 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
paramSapMstArr.add(paramDis);
|
|
|
|
|
}
|
|
|
|
|
param.put("ITEM", paramSapMstArr);
|
|
|
|
|
System.out.println(param.toString());
|
|
|
|
|
|
|
|
|
|
//查询该调拨入库单对应的出库单
|
|
|
|
|
JSONObject out_mst = wo_mst.query("source_id = '"+jo_mst.getString("source_id")+"' AND io_type = '1' AND is_delete = '0'").uniqueResult(0);
|
|
|
|
|
JSONObject out_mst = wo_mst.query("source_id = '" + jo_mst.getString("source_id") + "' AND io_type = '1' AND is_delete = '0'").uniqueResult(0);
|
|
|
|
|
param.put("ZACTION", "P");
|
|
|
|
|
param.put("BUDAT", out_mst.getString("biz_date"));
|
|
|
|
|
param.put("ZZYGYF", out_mst.getString("estimated_freight"));
|
|
|
|
|
@@ -1093,7 +1078,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonSub)) {
|
|
|
|
|
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
|
|
|
|
|
}
|
|
|
|
|
@@ -1189,11 +1174,10 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSect = sectTab.query("sect_id = '" + json2.getString("sect_id") + "'").uniqueResult(0);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonSect)) {
|
|
|
|
|
//jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
|
|
|
|
|
jsonDtl.put("LGORT", lgort); // 明細储存地点
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonSect)) {
|
|
|
|
|
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
|
|
|
|
|
}
|
|
|
|
|
@@ -1213,7 +1197,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
|
|
|
|
|
JSONObject param = new JSONObject();
|
|
|
|
|
param.put("HEAD", paramSapMstArr);
|
|
|
|
|
System.out.println(param.toString());
|
|
|
|
|
|
|
|
|
|
// 调用接口回传
|
|
|
|
|
new LmsToSapServiceImpl().returnDelivery(param);
|
|
|
|
|
@@ -1234,9 +1217,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
paramMesMst.put("iOutboundUser", jo_mst.getString("confirm_optname"));
|
|
|
|
|
paramMesMst.put("iOutboundTime", DateUtil.now());
|
|
|
|
|
|
|
|
|
|
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
|
|
|
|
|
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
|
|
|
|
|
.process().getResultJSONArray(0);
|
|
|
|
|
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2").addParam("iostorinv_id", jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
|
|
|
|
|
|
|
|
|
|
JSONArray paramArr = new JSONArray();
|
|
|
|
|
for (int j = 0; j < boxArr.size(); j++) {
|
|
|
|
|
@@ -1326,9 +1307,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
paramMesMst.put("iOutboundUser", jo_mst.getString("confirm_optname"));
|
|
|
|
|
paramMesMst.put("iOutboundTime", DateUtil.now());
|
|
|
|
|
|
|
|
|
|
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2")
|
|
|
|
|
.addParam("iostorinv_id", jo_mst.getString("iostorinv_id"))
|
|
|
|
|
.process().getResultJSONArray(0);
|
|
|
|
|
JSONArray boxArr = WQL.getWO("ST_OUTIVT02").addParam("flag", "2").addParam("iostorinv_id", jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
|
|
|
|
|
|
|
|
|
|
JSONArray paramArr = new JSONArray();
|
|
|
|
|
for (int j = 0; j < boxArr.size(); j++) {
|
|
|
|
|
@@ -1460,7 +1439,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
|
|
|
|
|
jsonDtl.put("LGORT", jsonSect.getString("ext_id")); // 明細储存地点
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '"+json2.getString("iostorinv_id")+"'").uniqueResult(0);
|
|
|
|
|
JSONObject jsonSub = subTab.query("container_name = '" + json2.getString("pcsn") + "' AND package_box_sn = '" + json2.getString("box_no") + "' AND bill_id = '" + json2.getString("iostorinv_id") + "'").uniqueResult(0);
|
|
|
|
|
if (ObjectUtil.isNotEmpty(jsonSub)) {
|
|
|
|
|
jsonDis.put("CHARG", jsonSub.getString("sap_pcsn")); // sap批次
|
|
|
|
|
}
|
|
|
|
|
|