fix;新增载具类型

This commit is contained in:
zhouz
2024-05-14 16:03:07 +08:00
parent 48ba755ad9
commit 324d05fd5e
2 changed files with 26 additions and 15 deletions

View File

@@ -47,6 +47,7 @@ public class TwoOutBoxTask extends AbstractAcsTask {
.start_device_code(json.getString("point_code1"))
.next_device_code(json.getString("point_code2"))
.vehicle_code(json.getString("vehicle_code"))
.interaction_json(json.getJSONObject("request_param"))
.priority(json.getString("priority"))
.class_type(json.getString("task_type"))
.dtl_type(String.valueOf(dtl_type))
@@ -155,6 +156,7 @@ public class TwoOutBoxTask extends AbstractAcsTask {
json.put("task_group_id", form.getLongValue("task_group_id"));
json.put("point_code1", form.getString("start_device_code"));
json.put("point_code2", form.getString("next_device_code"));
json.put("request_param", form.getString("request_param"));
json.put("handle_class", this.getClass().getName());
json.put("create_id", SecurityUtils.getCurrentUserId());
json.put("create_name", SecurityUtils.getCurrentUsername());

View File

@@ -100,6 +100,9 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
jsonTaskParam.put("next_device_code", whereJson.getString("device_code"));
jsonTaskParam.put("vehicle_code", jsonAttr.getString("storagevehicle_code"));
jsonTaskParam.put("task_group_id", jsonAttr.getString("task_group_id"));
JSONObject request_param = new JSONObject();
request_param.put("containerType", jsonAttr.getString("storagevehicle_type"));
jsonTaskParam.put("request_param", request_param.toString());
TwoOutBoxTask taskBean = new TwoOutBoxTask();
taskBean.createTask(jsonTaskParam);
@@ -178,7 +181,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
// 找出对应的浅货位
JSONObject jsonAttrOrder = attrTab.query("struct_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
JSONObject jsonAttrNow = attrTab.query("row_num = '" + jsonAttrOrder.getString("row_num") + "' AND layer_num = '" + jsonAttrOrder.getString("layer_num") + "' AND col_num = '" + jsonAttrOrder.getString("col_num") + "' and zdepth = '" + IOSEnum.ZDEPTH_STRUCT.code("") + "' and stor_id = '"+jsonAttrOrder.getString("stor_id")+"'")
JSONObject jsonAttrNow = attrTab.query("row_num = '" + jsonAttrOrder.getString("row_num") + "' AND layer_num = '" + jsonAttrOrder.getString("layer_num") + "' AND col_num = '" + jsonAttrOrder.getString("col_num") + "' and zdepth = '" + IOSEnum.ZDEPTH_STRUCT.code("") + "' and stor_id = '" + jsonAttrOrder.getString("stor_id") + "'")
.uniqueResult(0);
// 查询移入货位
@@ -212,6 +215,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
/**
* 找一个空木箱
*
* @param whereJson {
* device_code终点
* box_length
@@ -220,7 +224,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
* num: 子卷数
* stor_id: 仓库
* sect_id: 库区
* }
* }
* @return JSONObject: 仓位对象
*/
private JSONObject getStruct(JSONObject whereJson) {
@@ -270,7 +274,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
json.put("num", whereJson.getString("num"));
String row_num_2 = getMaxRow(json);
json.put("row_num",row_num_2);
json.put("row_num", row_num_2);
JSONObject jsonAttr_2 = getBox(json);
if (ObjectUtil.isNotEmpty(jsonAttr_2)) {
@@ -286,12 +290,13 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
/**
* 找相同规格木箱的最多的巷道
*
* @param whereJson {
* box_length
* box_width
* box_high
* num: 子卷数
* }
* }
* @return block_num: 巷道
*/
private String getMaxBlock(JSONObject whereJson) {
@@ -313,7 +318,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
.collect(Collectors.joining("','"));
whereJson.put("flag", "2");
whereJson.put("block_num_in", "('"+block_num_in+"')");
whereJson.put("block_num_in", "('" + block_num_in + "')");
List<JSONObject> likeAttrList = WQL.getWO("BST_OUTBOX").addParamMap(whereJson)
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
@@ -342,18 +347,19 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
block_num = boxNumList.get(boxNumList.size() - 1).getString("block_num");
}
return block_num ;
return block_num;
}
/**
* 找到某一巷道相同规格木箱的最多的排
*
* @param whereJson {
* box_length
* box_width
* box_high
* num: 子卷数
* block_num 巷道
* }
* }
* @return String
*/
private String getMaxRow(JSONObject whereJson) {
@@ -373,7 +379,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
.collect(Collectors.joining("','"));
whereJson.put("flag", "2");
whereJson.put("row_num_in", "('"+row_num_in+"')");
whereJson.put("row_num_in", "('" + row_num_in + "')");
List<JSONObject> likeAttrList = WQL.getWO("BST_OUTBOX").addParamMap(whereJson)
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
@@ -407,6 +413,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
/**
* 找一个空木箱
*
* @param whereJson {
* box_length
* box_width
@@ -414,7 +421,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
* num: 子卷数
* block_num 巷道
* row_num
* }
* }
* @return JSONObject 需要出库的空木箱
*/
private JSONObject getBox(JSONObject whereJson) {
@@ -430,7 +437,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
// 新的一排
String row_num_new = this.getMaxRow(whereJson);
whereJson.put("row_num",row_num_new);
whereJson.put("row_num", row_num_new);
jsonAttr = this.getBoxOne(whereJson);
}
@@ -440,6 +447,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
/**
* 确定巷道、确定排,找一个空木箱
*
* @param whereJson {
* box_length
* box_width
@@ -447,7 +455,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
* num: 子卷数
* block_num 巷道
* row_num
* }
* }
* @return JSONObject 空木箱
*/
private JSONObject getBoxOne(JSONObject whereJson) {
@@ -465,7 +473,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
JSONObject jsonAttr = new JSONObject();
for (int i = 0; i < allAttrList.size(); i++){
for (int i = 0; i < allAttrList.size(); i++) {
JSONObject json = allAttrList.get(i);
if (json.getString("zdepth").equals(IOSEnum.ZDEPTH_STRUCT.code(""))) {
@@ -503,7 +511,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
// 创建木箱移库单
String task_group_id = createBoxMove(lowAttr.get(0));
json.put("task_group_id",task_group_id);
json.put("task_group_id", task_group_id);
jsonAttr = json;
break;
} else {
@@ -523,7 +531,8 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
}
/**
* 创建木箱移库任务
* 创建木箱移库任务
*
* @param jsonObject 需要移库的仓位对象
* @return String 任务组标识
*/
@@ -547,7 +556,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
attrTab.update(jsonObject);
// 锁定终点
jsonAttr.put("lock_type",IOSEnum.LOCK_TYPE.code("移入锁"));
jsonAttr.put("lock_type", IOSEnum.LOCK_TYPE.code("移入锁"));
attrTab.update(jsonAttr);
// 生成任务