rev:出库口自动分配

This commit is contained in:
2024-05-31 09:00:14 +08:00
parent ed4632efd7
commit ac608ed2ca
3 changed files with 36 additions and 8 deletions

View File

@@ -94,6 +94,9 @@ public enum IOSEnum {
// 区域
PRODUCT_AREA(MapOf.of("BLK", "BLK")),
// 出库口点位
OUT_POINT(MapOf.of("出库口1", "CK2026","出库口2", "CK2027")),
//acs申请任务
ACSTOLMS_TYPE(MapOf.of("成品入库任务", "1","空盘入库","2","空盘出库","3","异常处理位","4","木箱入库","5","退货入库","6","贴标","1","捆扎","2")),
;

View File

@@ -1223,8 +1223,29 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
String start_device_code = "";
// 是否自动下发
String is_auto_issue = IOSEnum.IS_SEND.code("");
// 终点
String end_device_code = "";
// 是否自动分配终点
boolean is_auto_div_point = false;
// 取绝对值
int abs = Math.abs(taskMangeList.size() / 2);
if (ObjectUtil.isNotEmpty(point_code)) {
end_device_code = point_code;
} else {
is_auto_div_point = true;
}
for (int i = 0; i < taskMangeList.size(); i++) {
// 确定终点
if (is_auto_div_point) {
if (abs > i) {
end_device_code = IOSEnum.OUT_POINT.code("出库口1");
} else {
end_device_code = IOSEnum.OUT_POINT.code("出库口2");
}
}
JSONObject json = taskMangeList.get(i);
start_device_code = json.getString("struct_code");
@@ -1271,7 +1292,7 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
JSONObject jsonTaskParam = new JSONObject();
jsonTaskParam.put("task_type", "010711");
jsonTaskParam.put("point_code1", start_device_code);
jsonTaskParam.put("point_code2", point_code);
jsonTaskParam.put("point_code2", end_device_code);
jsonTaskParam.put("vehicle_code", json.getString("storagevehicle_code"));
if (ObjectUtil.isNotEmpty(jsonExt)) {
jsonTaskParam.put("vehicle_code2", jsonExt.getString("storagevehicle_code"));
@@ -1299,7 +1320,7 @@ public class StIvtIostorinvOutServiceImpl extends ServiceImpl<StIvtIostorinvOutM
String task_id = twoOutTask.createTask(jsonTaskParam);
// 更新分配明细
JSONObject jsonPoint = schBasePointService.query("point_code = '" + point_code + "'").uniqueResult(0);
JSONObject jsonPoint = schBasePointService.query("point_code = '" + end_device_code + "'").uniqueResult(0);
disDaoList.forEach(row -> {
row.setWork_status(IOSEnum.WORK_STATUS.code("生成"));

View File

@@ -636,9 +636,11 @@ export default {
}
},
allSetPoint() {
if (this.form2.point_code === '') {
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
return
if (this.mstrow.stor_id !== '1582991156504039455') {
if (this.form2.point_code === '') {
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
}
if (this.currentRow === '') {
this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
@@ -656,9 +658,11 @@ export default {
})
},
allSetPointAllDtl() {
if (this.form2.point_code === '') {
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
return
if (this.mstrow.stor_id !== '1582991156504039455') {
if (this.form2.point_code === '') {
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
return
}
}
this.loadingSetAllPoint = true
const data = {