rev:新增返检出库和改切出库回传

This commit is contained in:
2023-08-14 16:13:15 +08:00
parent 44dc4aab81
commit 5ca7b987c3
2 changed files with 102 additions and 18 deletions

View File

@@ -4324,7 +4324,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
}
}
if (out_jo.getString("bill_type").equals("1003")) {
/*if (out_jo.getString("bill_type").equals("1003")) {
//更新改切子卷为该子卷的分切计划
JSONObject source_dtl = WQLObject.getWQLObject("st_ivt_iostorinvdtl").query("iostorinv_id = '" + iostorinv_id + "' AND IFNULL(source_billdtl_id,'') <> ''").uniqueResult(0);
@@ -4337,8 +4337,17 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
WQLObject.getWQLObject("PDM_BI_SlittingProductionPlan").update(map, "package_box_sn = '" + source_dtl.getString("box_no") + "'");
}
}*/
if (out_jo.getString("bill_type").equals("1003") || out_jo.getString("bill_type").equals("1006")) {
//如果为返检出库或者改切出库删除对应的包装关系
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
for (int i = 0; i < dis_rows.size(); i++) {
JSONObject dis_row = dis_rows.getJSONObject(i);
String pcsn = dis_row.getString("pcsn");
WQLObject.getWQLObject("pdm_bi_subpackagerelation").delete("container_name = '"+pcsn+"'");
}
}
/*

View File

@@ -9,29 +9,23 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.common.utils.FileUtil;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.system.service.user.ISysUserService;
import org.nl.system.service.user.dao.SysUser;
import org.nl.system.service.user.dto.CurrentUser;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.system.service.user.dto.UserDto;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.system.service.user.ISysUserService;
import org.nl.system.service.user.dao.SysUser;
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
import org.nl.wms.ext.sap.service.impl.LmsToSapServiceImpl;
import org.nl.wms.st.returns.service.InAndOutReturnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
import org.springframework.transaction.support.TransactionTemplate;
import javax.servlet.http.HttpServletResponse;
@@ -185,6 +179,33 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
// 返检出库回传mes
if (StrUtil.equals(bill_type, "1006")) {
JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag","2").addParam("iostorinv_id",jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
for (int j = 0; j < disArr.size(); j++) {
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
JSONObject json = disArr.getJSONObject(j);
param.put("PackageBoxSN", json.getString("box_no"));
param.put("Attribute1", "ReCheck");
JSONArray container_jo = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "' AND box_no = '"+json.getString("box_no")+"'").getResultJSONArray(0);
for (int k = 0; k < container_jo.size(); k++) {
JSONObject dis_jo = container_jo.getJSONObject(k);
JSONObject jsonParamDtl = new JSONObject();
jsonParamDtl.put("ContainerName", dis_jo.getString("pcsn"));
details.add(jsonParamDtl);
}
param.put("Details", details);
new LmsToMesServiceImpl().lmsUnPackage(param);
}
jo_mst.put("upload_mes", "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);
}
// 销售出库
if (StrUtil.equals(bill_type, "1001") && is_productstore.equals("1")) {
// 2.回传mes
@@ -261,7 +282,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
// 改切出库
/*// 改切出库
if (StrUtil.equals(bill_type, "1003")) {
JSONArray disArr = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0);
@@ -283,7 +304,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jo_mst.put("upload_time", DateUtil.now());
}
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
}*/
}
}
}
@@ -571,7 +592,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
// 改切出库
/*// 改切出库
if (StrUtil.equals(bill_type, "1003")) {
JSONObject paramMst = new JSONObject();
JSONArray paramArr = new JSONArray();
@@ -632,7 +653,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jo_mst.put("upload_time", DateUtil.now());
}
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
}*/
//手工出库
if (StrUtil.equals(bill_type, "1009")) {
@@ -1150,7 +1171,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
// 改切出库
/*// 改切出库
if (StrUtil.equals(bill_type, "1003")) {
JSONObject paramMst = new JSONObject();
JSONArray paramArr = new JSONArray();
@@ -1202,7 +1223,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
jo_mst.put("upload_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
}*/
// 调拨出库
if (StrUtil.equals(bill_type, "1004")) {
@@ -1241,6 +1262,60 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
// 改切出库回传mes
if (StrUtil.equals(bill_type, "1003")) {
JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag","2").addParam("iostorinv_id",jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
for (int j = 0; j < disArr.size(); j++) {
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
JSONObject json = disArr.getJSONObject(j);
param.put("PackageBoxSN", json.getString("box_no"));
param.put("Attribute1", "ReCut");
JSONArray container_jo = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "' AND box_no = '"+json.getString("box_no")+"'").getResultJSONArray(0);
for (int k = 0; k < container_jo.size(); k++) {
JSONObject dis_jo = container_jo.getJSONObject(k);
JSONObject jsonParamDtl = new JSONObject();
jsonParamDtl.put("ContainerName", dis_jo.getString("pcsn"));
details.add(jsonParamDtl);
}
param.put("Details", details);
new LmsToMesServiceImpl().lmsUnPackage(param);
}
jo_mst.put("upload_mes", "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, "1006")) {
JSONArray disArr = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("flag","2").addParam("iostorinv_id",jo_mst.getString("iostorinv_id")).process().getResultJSONArray(0);
for (int j = 0; j < disArr.size(); j++) {
JSONObject param = new JSONObject();
JSONArray details = new JSONArray();
JSONObject json = disArr.getJSONObject(j);
param.put("PackageBoxSN", json.getString("box_no"));
param.put("Attribute1", "ReCheck");
JSONArray container_jo = wo_dis.query("iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "' AND box_no = '"+json.getString("box_no")+"'").getResultJSONArray(0);
for (int k = 0; k < container_jo.size(); k++) {
JSONObject dis_jo = container_jo.getJSONObject(k);
JSONObject jsonParamDtl = new JSONObject();
jsonParamDtl.put("ContainerName", dis_jo.getString("pcsn"));
details.add(jsonParamDtl);
}
param.put("Details", details);
new LmsToMesServiceImpl().lmsUnPackage(param);
}
jo_mst.put("upload_mes", "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);
}
// 手工出库
if (StrUtil.equals(bill_type, "1009")) {
// 1.回传sap