This commit is contained in:
2023-02-17 18:12:41 +08:00
6 changed files with 183 additions and 49 deletions

View File

@@ -578,6 +578,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
data.put("box_width", box_width);
data.put("box_high", box_high);
data.put("bundle_times", 2);
/* Double box_length_value = Double.valueOf(box_length);
if (box_length_value >= 772) {
data.put("bundle_times", 3);
} else {
data.put("bundle_times", 2);
}*/
result.put("data", data);
} else if (type.equals("3")) {
//烘箱出箱任务

View File

@@ -13,10 +13,12 @@ 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.system.service.ParamService;
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.param.impl.SysParamServiceImpl;
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;
@@ -152,9 +154,21 @@ public class ProductInstorServiceImpl implements ProductInstorService {
Double box_length = sub_jo.getDoubleValue("box_length");
Double box_width = sub_jo.getDoubleValue("box_width");
Double box_high = sub_jo.getDoubleValue("box_high");
// 木箱长、宽、高不能为0
if (box_length <= 0 || box_width <= 0 || box_high <= 0) {
throw new BadRequestException("该木箱没有长宽高信息,无法入库,请到子卷包装关系中维护!");
}
// 木箱尺寸长度低于950的不入立体库长度大于1385的立体库无法入库
String length_up = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("box_length_up").getValue();
String length_down = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("box_length_down").getValue();
Double box_length_up = Double.valueOf(length_up);
Double box_length_down = Double.valueOf(length_down);
if (!(box_length_down <= box_length && box_length <= box_length_up)) {
throw new BadRequestException("无法入立体,木箱长度为:"+box_length);
}
JSONObject point_jo = WQLObject.getWQLObject("sch_base_point").query("point_code = '" + point_code + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(point_jo)) {
throw new BadRequestException("未查询到对应的点位!");
@@ -291,9 +305,16 @@ public class ProductInstorServiceImpl implements ProductInstorService {
String to_length = sub_jo.getString("box_length"); // 长
String to_weight = sub_jo.getString("box_width"); // 宽
String to_height = sub_jo.getString("box_high"); // 高
String to_strap_times = "2"; // 捆扎次数
String to_strap_times = ""; // 捆扎次数
String to_command = "4"; // 指令
Double box_length_value = Double.valueOf(to_length);
if (box_length_value >= 772) {
to_strap_times = "3";
} else {
to_strap_times = "2";
}
JSONArray array = new JSONArray();
JSONObject jsonLength = new JSONObject();

View File

@@ -928,22 +928,62 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
}
} else {
//如果查询不到空的一排,则查询有空位双通的一排
JSONObject have_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().uniqueResult(0);
JSONArray haveArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().getResultJSONArray(0);
for (int j = 0; j < haveArr.size(); j++) {
JSONObject have_row = haveArr.getJSONObject(j);
if (ObjectUtil.isNotEmpty(have_row)) {
String block_num3 = have_row.getString("block_num");
String row_num3 = have_row.getString("row_num");
//判断该排是左边为空,还是右边为空
JSONObject right_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq").uniqueResult(0);
JSONObject left_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq desc").uniqueResult(0);
if (StrUtil.isNotEmpty(right_str.getString("storagevehicle_code")) || !right_str.getString("lock_type").equals("1")) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
break;
}
if (StrUtil.isNotEmpty(left_str.getString("storagevehicle_code")) || !left_str.getString("lock_type").equals("1")) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0);
break;
JSONArray isLock2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type not in ('1','2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(isLock2)) {
// 先倒序找到第一个木箱、判断上一个是否有货位
JSONObject jsonDescBox2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq DESC").uniqueResult(0);
JSONObject jsonDescStruct2 = new JSONObject();
if (ObjectUtil.isNotEmpty(jsonDescBox2)) {
String out_order_seq = jsonDescBox2.getString("out_order_seq");
jsonDescStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
} else {
// 先倒序找到第一个入库锁或者移库锁、判断上一个是否有货位
JSONObject jsonDescEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonDescEmpStruct)) {
String out_order_seq = jsonDescEmpStruct.getString("out_order_seq");
jsonDescStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
}
}
if (ObjectUtil.isNotEmpty(jsonDescStruct2)) {
struct_jo = jsonDescStruct2;
break;
} else {
// 没有就正序找到第一个物料、判断上一个是否有货位
JSONObject jsonAscBox2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
JSONObject jsonAscStruct2 = new JSONObject();
if (ObjectUtil.isNotEmpty(jsonAscBox2)) {
String out_order_seq2 = jsonAscBox2.getString("out_order_seq");
// 上一个货位顺序号
jsonAscStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
} else {
JSONObject jsonAscEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonAscEmpStruct)) {
String out_order_seq2 = jsonAscEmpStruct.getString("out_order_seq");
jsonAscStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
}
}
if (ObjectUtil.isNotEmpty(jsonAscStruct2)) {
struct_jo = jsonAscStruct2;
break;
}
}
} else {
continue;
}
}
}
@@ -987,20 +1027,61 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
} else {
//如果查询不到空的一排,则查询有空位双通的一排
JSONObject have_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().uniqueResult(0);
JSONArray haveArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().getResultJSONArray(0);
for (int j = 0; j < haveArr.size(); j++) {
JSONObject have_row = haveArr.getJSONObject(j);
if (ObjectUtil.isNotEmpty(have_row)) {
String block_num = have_row.getString("block_num");
String row_num = have_row.getString("row_num");
String block_num3 = have_row.getString("block_num");
String row_num3 = have_row.getString("row_num");
//判断该排是左边为空,还是右边为空
JSONObject right_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq").uniqueResult(0);
JSONObject left_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq desc").uniqueResult(0);
if (StrUtil.isNotEmpty(right_str.getString("storagevehicle_code")) || !right_str.getString("lock_type").equals("1")) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
}
if (StrUtil.isNotEmpty(left_str.getString("storagevehicle_code")) || !left_str.getString("lock_type").equals("1")) {
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0);
JSONArray isLock2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type not in ('1','2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(isLock2)) {
// 先倒序找到第一个木箱、判断上一个是否有货位
JSONObject jsonDescBox2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq DESC").uniqueResult(0);
JSONObject jsonDescStruct2 = new JSONObject();
if (ObjectUtil.isNotEmpty(jsonDescBox2)) {
String out_order_seq = jsonDescBox2.getString("out_order_seq");
jsonDescStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
} else {
// 先倒序找到第一个入库锁或者移库锁、判断上一个是否有货位
JSONObject jsonDescEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonDescEmpStruct)) {
String out_order_seq = jsonDescEmpStruct.getString("out_order_seq");
jsonDescStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
}
}
if (ObjectUtil.isNotEmpty(jsonDescStruct2)) {
struct_jo = jsonDescStruct2;
break;
} else {
// 没有就正序找到第一个物料、判断上一个是否有货位
JSONObject jsonAscBox2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
JSONObject jsonAscStruct2 = new JSONObject();
if (ObjectUtil.isNotEmpty(jsonAscBox2)) {
String out_order_seq2 = jsonAscBox2.getString("out_order_seq");
// 上一个货位顺序号
jsonAscStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
} else {
JSONObject jsonAscEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonAscEmpStruct)) {
String out_order_seq2 = jsonAscEmpStruct.getString("out_order_seq");
jsonAscStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
}
}
if (ObjectUtil.isNotEmpty(jsonAscStruct2)) {
struct_jo = jsonAscStruct2;
break;
}
}
} else {
continue;
}
}
}

View File

@@ -450,7 +450,7 @@
OPTION 输入.material_code <> ""
mb.material_code = 输入.material_code
ENDOPTION
OPTION 输入.material_code <> ""
OPTION 输入.sale_order_name <> ""
sub.sale_order_name = 输入.sale_order_name
ENDOPTION
GROUP BY
@@ -572,6 +572,8 @@
st_ivt_structattr sa2
WHERE
sa2.lock_type = '1'
AND sa2.is_used = '1'
AND sa2.is_delete = '0'
AND IFNULL( sa2.storagevehicle_code, '' ) = ''
GROUP BY
sa2.block_num,

View File

@@ -635,8 +635,8 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
if (StrUtil.isNotEmpty(map.get("pcsn"))) {
map.put("pcsn", "%" + map.get("pcsn") + "%");
}
if (StrUtil.isNotEmpty(map.get("sap_pscn"))) {
map.put("sap_pscn", "%" + map.get("sap_pscn") + "%");
if (StrUtil.isNotEmpty(map.get("sap_pcsn"))) {
map.put("sap_pcsn", "%" + map.get("sap_pcsn") + "%");
}
if (StrUtil.isNotEmpty(map.get("package_box_sn"))) {
map.put("package_box_sn", "%" + map.get("package_box_sn") + "%");