代码合并
This commit is contained in:
@@ -265,47 +265,57 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
3、任务下发,判断巷道的任务类型,只能为空盘入库或者无任务类型;
|
3、任务下发,判断巷道的任务类型,只能为空盘入库或者无任务类型;
|
||||||
* */
|
* */
|
||||||
vehicle_code = CodeUtil.getNewCode("VEHICCLE_CODE_KTP");
|
vehicle_code = CodeUtil.getNewCode("VEHICCLE_CODE_KTP");
|
||||||
JSONObject empty_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "21").process().uniqueResult(0);
|
JSONArray emptyArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "21").process().getResultJSONArray(0);
|
||||||
|
|
||||||
JSONObject struct_jo = new JSONObject();
|
JSONObject struct_jo = new JSONObject();
|
||||||
if (ObjectUtil.isNotEmpty(empty_row)) {
|
for (int i = 0; i < emptyArr.size(); i++) {
|
||||||
|
JSONObject empty_row = emptyArr.getJSONObject(i);
|
||||||
|
|
||||||
String block_num = empty_row.getString("block_num");
|
String block_num = empty_row.getString("block_num");
|
||||||
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("03")) {
|
JSONArray isLock = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type not in ('4','5') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(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 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);
|
|
||||||
} else {
|
|
||||||
// 双通
|
|
||||||
|
|
||||||
// 先倒序找到第一个托盘、判断上一个是否有货位
|
if (ObjectUtil.isEmpty(isLock)) {
|
||||||
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);
|
if (placement_type.equals("03")) {
|
||||||
String out_order_seq = jsonDescBox.getString("out_order_seq");
|
// 右通
|
||||||
// 上一个货位顺序号
|
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);
|
||||||
String out_order_seq_desc = String.valueOf(NumberUtil.add(out_order_seq, "1"));
|
break;
|
||||||
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);
|
} else if (placement_type.equals("02")) {
|
||||||
|
// 左通
|
||||||
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
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 = jsonDescStruct;
|
break;
|
||||||
} else {
|
} 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;
|
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");
|
||||||
|
// 上一个货位顺序号
|
||||||
|
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);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
||||||
|
struct_jo = jsonDescStruct;
|
||||||
|
break;
|
||||||
|
} 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");
|
||||||
|
// 上一个货位顺序号
|
||||||
|
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);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(jsonAscStruct)) {
|
||||||
|
struct_jo = jsonAscStruct;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(struct_jo)) {
|
if (ObjectUtil.isEmpty(struct_jo)) {
|
||||||
throw new BadRequestException("未查询到可用的空载具存放点位!");
|
throw new BadRequestException("未查询到可用的空载具存放点位!");
|
||||||
}
|
}
|
||||||
@@ -333,20 +343,31 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
b、没有,则优先找空的巷道;按空位置顺序分配;
|
b、没有,则优先找空的巷道;按空位置顺序分配;
|
||||||
3、任务下发,判断巷道的任务类型,只能为空盘入库或者无任务类型;
|
3、任务下发,判断巷道的任务类型,只能为空盘入库或者无任务类型;
|
||||||
* */
|
* */
|
||||||
JSONObject empty_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "22").process().uniqueResult(0);
|
JSONArray empArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("flag", "22").process().getResultJSONArray(0);
|
||||||
|
|
||||||
JSONObject struct_jo = new JSONObject();
|
JSONObject struct_jo = new JSONObject();
|
||||||
if (ObjectUtil.isNotEmpty(empty_row)) {
|
for (int i = 0; i < empArr.size(); i++) {
|
||||||
|
JSONObject empty_row = empArr.getJSONObject(i);
|
||||||
|
|
||||||
String block_num = empty_row.getString("block_num");
|
String block_num = empty_row.getString("block_num");
|
||||||
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")) {
|
JSONArray isLock = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type not in ('4','5') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(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);
|
|
||||||
|
if (ObjectUtil.isEmpty(isLock)) {
|
||||||
|
if (placement_type.equals("01") || 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").uniqueResult(0);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
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);
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
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);
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(struct_jo)) {
|
if (ObjectUtil.isEmpty(struct_jo)) {
|
||||||
throw new BadRequestException("未查询到可用的空载具!");
|
throw new BadRequestException("未查询到可用的空载具!");
|
||||||
}
|
}
|
||||||
@@ -364,6 +385,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
map.put("lock_type", "4");
|
map.put("lock_type", "4");
|
||||||
point_table.update(map, "point_code = '" + struct_jo.getString("struct_code") + "'");
|
point_table.update(map, "point_code = '" + struct_jo.getString("struct_code") + "'");
|
||||||
struct_table.update(map, "struct_code = '" + struct_jo.getString("struct_code") + "'");
|
struct_table.update(map, "struct_code = '" + struct_jo.getString("struct_code") + "'");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if (type.equals("4")) {
|
if (type.equals("4")) {
|
||||||
//查询该木箱对应的包装关系
|
//查询该木箱对应的包装关系
|
||||||
|
|||||||
@@ -795,7 +795,7 @@
|
|||||||
sa.row_num,
|
sa.row_num,
|
||||||
sa.placement_type
|
sa.placement_type
|
||||||
ORDER BY
|
ORDER BY
|
||||||
sa.placement_type DESC
|
sa.block_num DESC
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
@@ -818,7 +818,7 @@
|
|||||||
sa.row_num,
|
sa.row_num,
|
||||||
sa.placement_type
|
sa.placement_type
|
||||||
ORDER BY
|
ORDER BY
|
||||||
sa.placement_type DESC
|
sa.block_num DESC
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDQUERY
|
ENDQUERY
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|||||||
Reference in New Issue
Block a user