This commit is contained in:
2023-10-16 17:29:43 +08:00
5 changed files with 89 additions and 20 deletions

View File

@@ -983,6 +983,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
String box_width = param.getString("Attribute3"); // 木箱料号
String box_high = param.getString("Attribute4"); // 木箱料号
String sub_type = param.getString("Attribute5"); // 包装关系类型
String ext_code = param.getString("Attribute6"); // 储存地点
JSONArray details = param.getJSONArray("details");
if (ObjectUtil.isEmpty(details)) throw new BadRequestException("明细为空");
for (int i = 0; i < details.size(); i++) {
@@ -1033,6 +1034,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
jo.put("standard_limit", standard_limit);
jo.put("actual_value", actual_value);
jo.put("quanlity_in_box", QuanlityInBox);
jo.put("ext_code", ext_code);
if (StrUtil.equals(BoxWeight, "0")) {
BoxWeight2 = NumberUtil.add(BoxWeight2, NetWeight).toString();
}

View File

@@ -20,6 +20,7 @@ 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.param.impl.SysParamServiceImpl;
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
import org.nl.wms.ext.acs.service.impl.AcsToWmsServiceImpl;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wms.pda.st.service.CoolInService;
@@ -68,6 +69,11 @@ public class ProductInstorServiceImpl implements ProductInstorService {
JSONArray rows = new JSONArray();
HashMap<String, String> map = new HashMap<>();
map.put("box_no", box_no);
//获取人员对应的仓库
UserStorServiceImpl userStorService = new UserStorServiceImpl();
String in_stor_id = userStorService.getInStor();
if (option.equals("1")) {
map.put("flag", "1");
//如果是报废入库要查询对应的报废出库
@@ -75,6 +81,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
}
if (option.equals("2")) {
map.put("flag", "2");
map.put("in_stor_id", in_stor_id);
//查询状态为生成的子卷包装关系对应表
rows = WQL.getWO("PDA_ST_01").addParamMap(map).process().getResultJSONArray(0);
}
@@ -160,8 +167,18 @@ public class ProductInstorServiceImpl implements ProductInstorService {
}
}
}
//查询成品库仓库
JSONObject stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1'").uniqueResult(0);
// 判断此木箱是否是二期木箱
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_SN = '" + box_no + "'").uniqueResult(0);
//查询仓库
JSONObject stor = new JSONObject();
if(sub_jo.getString("ext_code").equals("BC01")) {
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '0' AND stor_code = 'BC01'").uniqueResult(0);
} else {
stor = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("is_delete = '0' AND is_used = '1' AND is_productstore = '1'").uniqueResult(0);
}
mst_jo.put("stor_id", stor.getString("stor_id"));
mst_jo.put("stor_code", stor.getString("stor_code"));
mst_jo.put("stor_name", stor.getString("stor_name"));
@@ -180,8 +197,9 @@ public class ProductInstorServiceImpl implements ProductInstorService {
//判断是否虚拟
if (!is_virtual.equals("1")) {
if (sub_jo.getString("ext_code").equals("BC01")) throw new BadRequestException("二期仓库木箱,请进行虚拟入库!");
//判断是该包装计划是否存在长宽高
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_SN = '" + box_no + "'").uniqueResult(0);
Double box_length = sub_jo.getDoubleValue("box_length");
Double box_width = sub_jo.getDoubleValue("box_width");
Double box_high = sub_jo.getDoubleValue("box_high");
@@ -242,7 +260,12 @@ public class ProductInstorServiceImpl implements ProductInstorService {
String task_id = IdUtil.getSnowflake(1, 1).nextId() + "";
//直接分配虚拟区货位,并确认
JSONObject struct = WQL.getWO("PDA_ST_01").addParam("flag", "3").addParam("stor_id", stor.getString("stor_id")).addParam("sect_id", whereJson.getString("sect_id")).process().uniqueResult(0);
JSONObject struct = WQL.getWO("PDA_ST_01")
.addParam("flag", "3")
.addParam("stor_id", stor.getString("stor_id"))
.addParam("sect_id", sub_jo.getString("ext_code").equals("BC01") ? "" : whereJson.getString("sect_id"))
.process().uniqueResult(0);
if (ObjectUtil.isEmpty(struct)){
throw new BadRequestException("当前没有可用的空仓位进行入库!");
}

View File

@@ -18,6 +18,8 @@
输入.point_code TYPEAS s_string
输入.stor_id TYPEAS s_string
输入.sect_id TYPEAS s_string
输入.in_stor_id TYPEAS f_string
[临时表]
@@ -75,10 +77,12 @@
sub_type
FROM
pdm_bi_subpackagerelation sub
LEFT JOIN st_ivt_bsrealstorattr attr ON sub.ext_code = attr.ext_id
WHERE
sub.status = '0'
AND
sub.package_box_SN = 输入.box_no
AND attr.stor_id in 输入.in_stor_id
UNION
@@ -103,6 +107,7 @@
AND dis.work_status < '99'
AND task.task_id IS NULL
AND sub.package_box_SN = 输入.box_no
AND mst.stor_id in 输入.in_stor_id
ENDSELECT
ENDQUERY
ENDIF
@@ -117,10 +122,17 @@
WHERE
se.sect_type_attr = '09'
AND sa.lock_type = '1'
AND sa.stor_id = 输入.stor_id
AND sa.sect_id = 输入.sect_id
AND sa.is_delete = '0'
AND IFNULL( storagevehicle_code, '' ) = ''
OPTION 输入.stor_id <> ""
sa.stor_id = 输入.stor_id
ENDOPTION
OPTION 输入.sect_id <> ""
sa.sect_id = 输入.sect_id
ENDOPTION
ORDER BY
struct_code
LIMIT 1