代码更新
This commit is contained in:
@@ -2,6 +2,7 @@ package org.nl.wms.ext.acs.service.impl;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
@@ -256,10 +257,37 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
String row_num = empty_row.getString("row_num");
|
String row_num = empty_row.getString("row_num");
|
||||||
String placement_type = empty_row.getString("placement_type");
|
String placement_type = empty_row.getString("placement_type");
|
||||||
|
|
||||||
if (placement_type.equals("01") || placement_type.equals("03")) {
|
if (placement_type.equals("03")) {
|
||||||
|
// 右通
|
||||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' 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);
|
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' 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);
|
||||||
} else {
|
} else if (placement_type.equals("02")) {
|
||||||
|
// 左通
|
||||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
|
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
|
||||||
|
} else {
|
||||||
|
// 双通
|
||||||
|
|
||||||
|
// 先倒序找到第一个木箱、判断上一个是否有货位
|
||||||
|
JSONObject jsonDescBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' 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);
|
||||||
|
String out_order_seq = jsonDescBox.getString("out_order_seq");
|
||||||
|
// 上一个货位顺序号
|
||||||
|
String out_order_seq_desc = String.valueOf(NumberUtil.add(out_order_seq, "1"));
|
||||||
|
JSONObject jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '" + out_order_seq_desc + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
||||||
|
struct_jo = jsonDescStruct;
|
||||||
|
} else {
|
||||||
|
// 没有就正序找到第一个物料、判断上一个是否有货位
|
||||||
|
JSONObject jsonAscBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
|
||||||
|
String out_order_seq2 = jsonAscBox.getString("out_order_seq");
|
||||||
|
// 上一个货位顺序号
|
||||||
|
String out_order_seq_asc = String.valueOf(NumberUtil.sub(out_order_seq2, "1"));
|
||||||
|
JSONObject jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '"+out_order_seq_asc+"'").uniqueResult(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonAscStruct)) {
|
||||||
|
struct_jo = jsonAscStruct;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ObjectUtil.isEmpty(struct_jo)) {
|
if (ObjectUtil.isEmpty(struct_jo)) {
|
||||||
|
|||||||
@@ -856,6 +856,16 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
|||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
||||||
struct_jo = jsonDescStruct;
|
struct_jo = jsonDescStruct;
|
||||||
|
} else {
|
||||||
|
// 没有就正序找到第一个物料、判断上一个是否有货位
|
||||||
|
JSONObject jsonAscBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
|
||||||
|
String out_order_seq2 = jsonAscBox.getString("out_order_seq");
|
||||||
|
// 上一个货位顺序号
|
||||||
|
String out_order_seq_asc = String.valueOf(NumberUtil.sub(out_order_seq2, "1"));
|
||||||
|
JSONObject jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '"+out_order_seq_asc+"'").uniqueResult(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonAscStruct)) {
|
||||||
|
struct_jo = jsonAscStruct;
|
||||||
} else {
|
} else {
|
||||||
// 说明这排有任务在执行,新开一排
|
// 说明这排有任务在执行,新开一排
|
||||||
//根据分切计划查询该订单物料大概还有多少未入
|
//根据分切计划查询该订单物料大概还有多少未入
|
||||||
@@ -905,7 +915,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user