代码更新
This commit is contained in:
@@ -291,20 +291,31 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
// 双通
|
// 双通
|
||||||
|
|
||||||
// 先倒序找到第一个托盘、判断上一个是否有货位
|
// 先倒序找到第一个托盘、判断上一个是否有货位
|
||||||
|
JSONObject jsonDescStruct = new JSONObject();
|
||||||
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);
|
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");
|
if (ObjectUtil.isNotEmpty(jsonDescBox)) {
|
||||||
// 上一个货位顺序号
|
String out_order_seq = jsonDescBox.getString("out_order_seq");
|
||||||
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 + "' order by out_order_seq ASC").uniqueResult(0);
|
// 上一个货位顺序号
|
||||||
|
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 + "' order by out_order_seq ASC").uniqueResult(0);
|
||||||
|
} else {
|
||||||
|
// 倒序找到第一个空位
|
||||||
|
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,'') = '' order by out_order_seq DESC").uniqueResult(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
||||||
struct_jo = jsonDescStruct;
|
struct_jo = jsonDescStruct;
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
// 没有就正序找到第一个托盘、判断上一个是否有货位
|
// 没有就正序找到第一个托盘、判断上一个是否有货位
|
||||||
|
JSONObject jsonAscStruct = new JSONObject();
|
||||||
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);
|
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");
|
if (ObjectUtil.isNotEmpty(jsonAscBox)) {
|
||||||
// 上一个货位顺序号
|
String out_order_seq2 = jsonAscBox.getString("out_order_seq");
|
||||||
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_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
|
// 上一个货位顺序号
|
||||||
|
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_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
|
||||||
|
} else {
|
||||||
|
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,'') = '' order by out_order_seq ASC").uniqueResult(0);
|
||||||
|
}
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(jsonAscStruct)) {
|
if (ObjectUtil.isNotEmpty(jsonAscStruct)) {
|
||||||
struct_jo = jsonAscStruct;
|
struct_jo = jsonAscStruct;
|
||||||
|
|||||||
Reference in New Issue
Block a user