add 去包装线任务
This commit is contained in:
@@ -0,0 +1,38 @@
|
|||||||
|
package org.nl.wms.basedata.eum;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 静置状态
|
||||||
|
*
|
||||||
|
* @author zhangjiangwei
|
||||||
|
* @date 2023/05/04 09:26
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum StandStatus {
|
||||||
|
|
||||||
|
WITHOUT("无需静置", "1"),
|
||||||
|
STANDING("静置中", "2"),
|
||||||
|
COMPLETED("静置完成", "3"),
|
||||||
|
FORCE_COMPLETION("强制静置完成", "4"),
|
||||||
|
TIMEOUT("静置超时", "5");
|
||||||
|
|
||||||
|
|
||||||
|
private final String label;
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
public String label() {
|
||||||
|
return this.label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StandStatus get(String value) {
|
||||||
|
return Arrays.stream(StandStatus.values()).filter(vt -> vt.value.equals(value)).collect(Collectors.toList()).get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,6 @@ import org.nl.modules.wql.WQL;
|
|||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.nl.wms.basedata.eum.TrueOrFalse;
|
import org.nl.wms.basedata.eum.TrueOrFalse;
|
||||||
import org.nl.wms.basedata.eum.VehicleStatus;
|
|
||||||
import org.nl.wms.basedata.eum.VehicleType;
|
import org.nl.wms.basedata.eum.VehicleType;
|
||||||
import org.nl.wms.basedata.service.dto.VehicleDto;
|
import org.nl.wms.basedata.service.dto.VehicleDto;
|
||||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||||
@@ -30,16 +29,15 @@ import org.nl.wms.sch.task.send.material.FJSendMaterialTask;
|
|||||||
import org.nl.wms.sch.task.send.material.HLSendMaterialTask;
|
import org.nl.wms.sch.task.send.material.HLSendMaterialTask;
|
||||||
import org.nl.wms.sch.task.send.material.SZSendMaterialTask;
|
import org.nl.wms.sch.task.send.material.SZSendMaterialTask;
|
||||||
import org.nl.wms.sch.task.send.material.YZSendMaterialTask;
|
import org.nl.wms.sch.task.send.material.YZSendMaterialTask;
|
||||||
|
import org.nl.wms.sch.task.to.pack.BTHCToPackageTask;
|
||||||
|
import org.nl.wms.sch.task.to.pack.FJToPackageTask;
|
||||||
import org.nl.wms.sch.task.util.TaskUtils;
|
import org.nl.wms.sch.task.util.TaskUtils;
|
||||||
import org.redisson.api.RLock;
|
|
||||||
import org.redisson.api.RedissonClient;
|
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -66,6 +64,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
|
|
||||||
private final FJCallEmptyTask fjCallEmptyTask;
|
private final FJCallEmptyTask fjCallEmptyTask;
|
||||||
|
|
||||||
|
private final FJToPackageTask fjToPackageTask;
|
||||||
|
|
||||||
|
private final BTHCToPackageTask bthcToPackageTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task_id:任务标识
|
* task_id:任务标识
|
||||||
* task_code:任务编码
|
* task_code:任务编码
|
||||||
@@ -334,6 +336,29 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
throw new BadRequestException("[" + region.label() + "] 不能发起叫空任务!");
|
throw new BadRequestException("[" + region.label() + "] 不能发起叫空任务!");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "5":
|
||||||
|
// 去包装
|
||||||
|
switch (region) {
|
||||||
|
case FJ:
|
||||||
|
method_param.put("workorder", param.getJSONObject("workorder"));
|
||||||
|
method_param.put("vd", param.getJSONObject("vd"));
|
||||||
|
task_code = yzSendMaterialTask.createTask(method_param);
|
||||||
|
break;
|
||||||
|
case BTHC:
|
||||||
|
TaskUtils.isNotEmptyPoint(point);
|
||||||
|
JSONObject vd = WQLObject
|
||||||
|
.getWQLObject("st_ivt_vehicle_detail").query("is_delete = '0' vehicle_type = '" + point.getString("vehicle_type") + "' AND vehicle_code = '" + point.getString("vehicle_code") + "'")
|
||||||
|
.uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(vd)) {
|
||||||
|
throw new BadRequestException("未找到 [" + point_code + "] 上的组盘信息!");
|
||||||
|
}
|
||||||
|
method_param.put("vd", vd);
|
||||||
|
task_code = bthcToPackageTask.createTask(method_param);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new BadRequestException("[" + region.label() + "] 不能发起去包装任务!");
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new BadRequestException("未知任务类型!");
|
throw new BadRequestException("未知任务类型!");
|
||||||
}
|
}
|
||||||
@@ -464,13 +489,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
if (Region.FJ.value().equals(region_code)) {
|
if (Region.FJ.value().equals(region_code)) {
|
||||||
vd.put("is_in_kiln", TrueOrFalse.FALSE.value());
|
vd.put("is_in_kiln", TrueOrFalse.FALSE.value());
|
||||||
}
|
}
|
||||||
|
if (Region.FJ.value().equals(region_code)) {
|
||||||
|
vd.put("is_package", jsonObject.getString("is_package"));
|
||||||
|
}
|
||||||
|
|
||||||
vd_table.insert(vd);
|
vd_table.insert(vd);
|
||||||
|
|
||||||
JSONObject vehicle_update = new JSONObject();
|
|
||||||
vehicle_update.put("vehicle_status", VehicleStatus.NOT_EMPTY.value());
|
|
||||||
WQLObject.getWQLObject("md_pb_vehicle").update(vehicle_update, "vehicle_type = '" + vehicle_type + "' AND vehicle_code = '" + vehicle_code + "'");
|
|
||||||
|
|
||||||
// 入库
|
// 入库
|
||||||
JSONObject param = new JSONObject();
|
JSONObject param = new JSONObject();
|
||||||
param.put("device_code", point.getString("point_code"));
|
param.put("device_code", point.getString("point_code"));
|
||||||
@@ -478,7 +502,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
param.put("workorder", workorder);
|
param.put("workorder", workorder);
|
||||||
param.put("vd", vd);
|
param.put("vd", vd);
|
||||||
param.put("vehicle_code", vehicle_code);
|
param.put("vehicle_code", vehicle_code);
|
||||||
param.put("type", "1");
|
param.put("type", jsonObject.getString("type"));
|
||||||
param.put("request_param", jsonObject.toJSONString());
|
param.put("request_param", jsonObject.toJSONString());
|
||||||
return this.apply(param);
|
return this.apply(param);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ public enum TaskType {
|
|||||||
SEND_MATERIAL("送料", "1"),
|
SEND_MATERIAL("送料", "1"),
|
||||||
CALL_MATERIAL("叫料", "2"),
|
CALL_MATERIAL("叫料", "2"),
|
||||||
SEND_EMPTY("送空", "3"),
|
SEND_EMPTY("送空", "3"),
|
||||||
CALL_EMPTY("叫空", "4");
|
CALL_EMPTY("叫空", "4"),
|
||||||
|
TO_PACKAGE("去包装", "5");
|
||||||
|
|
||||||
private final String label;
|
private final String label;
|
||||||
private final String value;
|
private final String value;
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ public class TaskServiceImpl implements TaskService {
|
|||||||
wo.update(param);
|
wo.update(param);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
log.error("任务操作失败!", e);
|
||||||
throw new BadRequestException(e.getMessage());
|
throw new BadRequestException(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.sch.task.call.empty;
|
package org.nl.wms.sch.task.call.empty;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -143,34 +144,47 @@ public class FJCallEmptyTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isNotEmpty(point1)
|
String point_code1 = task.getString("point_code1");
|
||||||
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
if (ObjectUtil.isNotEmpty(point1)
|
||||||
point1.put("task_code", "");
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
if (operation_type == OperationType.AUTO) {
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("task_code", "");
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("task_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
@@ -180,34 +194,41 @@ public class FJCallEmptyTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
String point_code1 = task.getString("point_code1");
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("task_code", "");
|
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
point1.put("vehicle_type", "");
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
point1.put("vehicle_code", "");
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point1.put("point_status", PointStatus.EMPTY.value());
|
point1.put("task_code", "");
|
||||||
if (operation_type == OperationType.AUTO) {
|
point1.put("vehicle_type", "");
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("vehicle_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("point_status", PointStatus.EMPTY.value());
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
point2.put("vehicle_type", task.getString("vehicle_type"));
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point2.put("vehicle_code", task.getString("vehicle_code"));
|
point2.put("task_code", "");
|
||||||
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
point2.put("vehicle_type", task.getString("vehicle_type"));
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("vehicle_code", task.getString("vehicle_code"));
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.sch.task.call.empty;
|
package org.nl.wms.sch.task.call.empty;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -120,22 +121,31 @@ public class GTKCallEmptyTask extends AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
String point_code2 = task.getString("point_code2");
|
||||||
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
JSONObject point2 = new JSONObject();
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point2.put("task_code", "");
|
point2.put("task_code", "");
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
@@ -144,16 +154,20 @@ public class GTKCallEmptyTask extends AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
String point_code2 = task.getString("point_code2");
|
||||||
JSONObject point2 = new JSONObject();
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
point2.put("task_code", "");
|
|
||||||
if (operation_type == OperationType.AUTO) {
|
JSONObject point2 = new JSONObject();
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point2.put("task_code", "");
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import org.nl.wms.basedata.eum.VehicleType;
|
|||||||
import org.nl.wms.sch.manage.*;
|
import org.nl.wms.sch.manage.*;
|
||||||
import org.nl.wms.sch.task.util.TaskUtils;
|
import org.nl.wms.sch.task.util.TaskUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 辽宁晟华混料 叫空 任务类
|
* 辽宁晟华混料 叫空 任务类
|
||||||
@@ -42,7 +41,7 @@ public class HLCallEmptyTask extends AbstractAcsTask {
|
|||||||
public String createTask(JSONObject form) {
|
public String createTask(JSONObject form) {
|
||||||
JSONObject point = form.getJSONObject("point");
|
JSONObject point = form.getJSONObject("point");
|
||||||
|
|
||||||
TaskUtils.isEmpty(point);
|
TaskUtils.isEmptyPoint(point);
|
||||||
TaskUtils.isLocked(point);
|
TaskUtils.isLocked(point);
|
||||||
JSONObject work_order = TaskUtils.hasWorkOrder(point);
|
JSONObject work_order = TaskUtils.hasWorkOrder(point);
|
||||||
|
|
||||||
@@ -162,8 +161,14 @@ public class HLCallEmptyTask extends AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.sch.task.call.empty;
|
package org.nl.wms.sch.task.call.empty;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -145,34 +146,47 @@ public class YZCallEmptyTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isNotEmpty(point1)
|
String point_code1 = task.getString("point_code1");
|
||||||
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
if (ObjectUtil.isNotEmpty(point1)
|
||||||
point1.put("task_code", "");
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
if (operation_type == OperationType.AUTO) {
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("task_code", "");
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("task_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
@@ -182,34 +196,43 @@ public class YZCallEmptyTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
String point_code1 = task.getString("point_code1");
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("task_code", "");
|
if (ObjectUtil.isNotEmpty(point1)) {
|
||||||
point1.put("vehicle_type", "");
|
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
point1.put("vehicle_code", "");
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
point1.put("point_status", PointStatus.EMPTY.value());
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
point1.put("task_code", "");
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("vehicle_type", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("vehicle_code", "");
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
point1.put("point_status", PointStatus.EMPTY.value());
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
point2.put("vehicle_type", task.getString("vehicle_type"));
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point2.put("vehicle_code", task.getString("vehicle_code"));
|
point2.put("task_code", "");
|
||||||
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
point2.put("vehicle_type", task.getString("vehicle_type"));
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("vehicle_code", task.getString("vehicle_code"));
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[交易说明]
|
[交易说明]
|
||||||
交易名: 叫空托盘
|
交易名: 叫空
|
||||||
所属模块:
|
所属模块:
|
||||||
功能简述:
|
功能简述:
|
||||||
版权所有:
|
版权所有:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.sch.task.call.material;
|
package org.nl.wms.sch.task.call.material;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -19,7 +20,7 @@ import org.springframework.stereotype.Component;
|
|||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Component
|
@Component
|
||||||
public class FJCallMaterialTask extends AbstractAcsTask {
|
public class FJCallMaterialTask extends AbstractAcsTask {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -138,35 +139,48 @@ public class FJCallMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isNotEmpty(point1)
|
String point_code1 = task.getString("point_code1");
|
||||||
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
if (ObjectUtil.isNotEmpty(point1)
|
||||||
point1.put("task_code", "");
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
if (operation_type == OperationType.AUTO) {
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("task_code", "");
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("task_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
@@ -176,34 +190,41 @@ public class FJCallMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
String point_code1 = task.getString("point_code1");
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("task_code", "");
|
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
point1.put("vehicle_type", "");
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
point1.put("vehicle_code", "");
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point1.put("point_status", PointStatus.EMPTY.value());
|
point1.put("task_code", "");
|
||||||
if (operation_type == OperationType.AUTO) {
|
point1.put("vehicle_type", "");
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("vehicle_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("point_status", PointStatus.EMPTY.value());
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
point2.put("vehicle_type", task.getString("vehicle_type"));
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point2.put("vehicle_code", task.getString("vehicle_code"));
|
point2.put("task_code", "");
|
||||||
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
point2.put("vehicle_type", task.getString("vehicle_type"));
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("vehicle_code", task.getString("vehicle_code"));
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.sch.task.call.material;
|
package org.nl.wms.sch.task.call.material;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -154,35 +155,48 @@ public class SZCallMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isNotEmpty(point1)
|
String point_code1 = task.getString("point_code1");
|
||||||
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
if (ObjectUtil.isNotEmpty(point1)
|
||||||
point1.put("task_code", "");
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
if (operation_type == OperationType.AUTO) {
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("task_code", "");
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("task_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[交易说明]
|
[交易说明]
|
||||||
交易名: 叫空托盘
|
交易名: 叫料
|
||||||
所属模块:
|
所属模块:
|
||||||
功能简述:
|
功能简述:
|
||||||
版权所有:
|
版权所有:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.sch.task.send.empty;
|
package org.nl.wms.sch.task.send.empty;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -18,7 +19,7 @@ import org.springframework.stereotype.Component;
|
|||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Component
|
@Component
|
||||||
public class FJSendEmptyTask extends AbstractAcsTask {
|
public class FJSendEmptyTask extends AbstractAcsTask {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -133,34 +134,47 @@ public class FJSendEmptyTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
String point_code1 = task.getString("point_code1");
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("task_code", "");
|
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
if (operation_type == OperationType.AUTO) {
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("task_code", "");
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("task_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
@@ -170,32 +184,39 @@ public class FJSendEmptyTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isNotEmpty(point1)
|
String point_code1 = task.getString("point_code1");
|
||||||
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
if (ObjectUtil.isNotEmpty(point1)
|
||||||
point1.put("task_code", "");
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
point1.put("vehicle_type", "");
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
point1.put("vehicle_code", "");
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point1.put("point_status", PointStatus.EMPTY.value());
|
point1.put("task_code", "");
|
||||||
if (operation_type == OperationType.AUTO) {
|
point1.put("vehicle_type", "");
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("vehicle_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("point_status", PointStatus.EMPTY.value());
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("task_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[交易说明]
|
[交易说明]
|
||||||
交易名: 叫空托盘
|
交易名: 送空
|
||||||
所属模块:
|
所属模块:
|
||||||
功能简述:
|
功能简述:
|
||||||
版权所有:
|
版权所有:
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.sch.task.send.material;
|
package org.nl.wms.sch.task.send.material;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -45,16 +46,13 @@ public class FJSendMaterialTask extends AbstractAcsTask {
|
|||||||
int priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1;
|
int priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1;
|
||||||
JSONObject vd = form.getJSONObject("vd");
|
JSONObject vd = form.getJSONObject("vd");
|
||||||
|
|
||||||
JSONObject pn = TaskUtils.buildPN(PickType.CP, vd.getLongValue("qty"), vd.getLongValue("workorder_id"));
|
|
||||||
WQLObject.getWQLObject("das_produce_number").insert(pn);
|
|
||||||
|
|
||||||
JSONObject material_task = TaskUtils.buildTask(
|
JSONObject material_task = TaskUtils.buildTask(
|
||||||
"分拣区送料",
|
"分拣区送料",
|
||||||
TaskType.SEND_MATERIAL.value(),
|
TaskType.SEND_MATERIAL.value(),
|
||||||
TaskStatus.SURE_START.value(),
|
TaskStatus.SURE_START.value(),
|
||||||
point.getString("point_code"),
|
point.getString("point_code"),
|
||||||
null,
|
null,
|
||||||
pn.getLongValue("data_id"),
|
null,
|
||||||
vd.getString("material_id"),
|
vd.getString("material_id"),
|
||||||
vd.getString("vehicle_type"),
|
vd.getString("vehicle_type"),
|
||||||
vd.getString("vehicle_code"),
|
vd.getString("vehicle_code"),
|
||||||
@@ -65,9 +63,12 @@ public class FJSendMaterialTask extends AbstractAcsTask {
|
|||||||
form.getString("create_id"),
|
form.getString("create_id"),
|
||||||
form.getString("create_name")
|
form.getString("create_name")
|
||||||
);
|
);
|
||||||
WQLObject.getWQLObject("sch_base_task").insert(material_task);
|
|
||||||
|
|
||||||
if (TrueOrFalse.trueOrFalse(vd.getString("is_full"))) {
|
if (TrueOrFalse.trueOrFalse(vd.getString("is_full"))) {
|
||||||
|
JSONObject pn = TaskUtils.buildPN(PickType.CP, vd.getLongValue("qty"), vd.getLongValue("workorder_id"));
|
||||||
|
WQLObject.getWQLObject("das_produce_number").insert(pn);
|
||||||
|
material_task.put("group_id", pn.getLong("data_id"));
|
||||||
|
|
||||||
JSONObject empty_task = TaskUtils.buildTask(
|
JSONObject empty_task = TaskUtils.buildTask(
|
||||||
"分拣区叫空",
|
"分拣区叫空",
|
||||||
TaskType.CALL_EMPTY.value(),
|
TaskType.CALL_EMPTY.value(),
|
||||||
@@ -89,6 +90,8 @@ public class FJSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").insert(empty_task);
|
WQLObject.getWQLObject("sch_base_task").insert(empty_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WQLObject.getWQLObject("sch_base_task").insert(material_task);
|
||||||
|
|
||||||
point.put("lock_type", LockType.TASK_LOCKED.value());
|
point.put("lock_type", LockType.TASK_LOCKED.value());
|
||||||
point.put("task_code", material_task.getString("task_code"));
|
point.put("task_code", material_task.getString("task_code"));
|
||||||
TaskUtils.addFormUpdateColum(point, form);
|
TaskUtils.addFormUpdateColum(point, form);
|
||||||
@@ -210,38 +213,53 @@ public class FJSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
String point_code1 = task.getString("point_code1");
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("task_code", "");
|
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
if (operation_type == OperationType.AUTO) {
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("task_code", "");
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("task_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
|
|
||||||
if (TaskType.SEND_MATERIAL.value().equals(task.getString("task_type"))) {
|
String data_id = task.getString("group_id");
|
||||||
WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("group_id"));
|
if (TaskType.SEND_MATERIAL.value().equals(task.getString("task_type"))
|
||||||
|
&& StrUtil.isNotBlank(data_id)) {
|
||||||
|
WQLObject.getWQLObject("das_produce_number").delete("data_id = " + data_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
@@ -251,37 +269,46 @@ public class FJSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isNotEmpty(point1)
|
String point_code1 = task.getString("point_code1");
|
||||||
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
if (ObjectUtil.isNotEmpty(point1)
|
||||||
point1.put("task_code", "");
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
point1.put("vehicle_type", "");
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
point1.put("vehicle_code", "");
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point1.put("point_status", PointStatus.EMPTY.value());
|
point1.put("task_code", "");
|
||||||
if (operation_type == OperationType.AUTO) {
|
point1.put("vehicle_type", "");
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("vehicle_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("point_status", PointStatus.EMPTY.value());
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
if (TaskType.CALL_EMPTY.value().equals(task.getString("task_type"))) {
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point2.put("vehicle_type", task.getString("vehicle_type"));
|
point2.put("task_code", "");
|
||||||
point2.put("vehicle_code", task.getString("vehicle_code"));
|
if (TaskType.CALL_EMPTY.value().equals(task.getString("task_type"))) {
|
||||||
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
point2.put("vehicle_type", task.getString("vehicle_type"));
|
||||||
|
point2.put("vehicle_code", task.getString("vehicle_code"));
|
||||||
|
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
||||||
|
}
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
||||||
}
|
}
|
||||||
if (operation_type == OperationType.AUTO) {
|
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
// todo 如果是送料任务需要发送唛头信息到包装机
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
|
||||||
}
|
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,8 +163,14 @@ public class HLSendMaterialTask extends AbstractAcsTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.sch.task.send.material;
|
package org.nl.wms.sch.task.send.material;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -133,34 +134,47 @@ public class SZSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
String point_code1 = task.getString("point_code1");
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("task_code", "");
|
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
if (operation_type == OperationType.AUTO) {
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("task_code", "");
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("task_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
@@ -170,35 +184,42 @@ public class SZSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isNotEmpty(point1)
|
String point_code1 = task.getString("point_code1");
|
||||||
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
if (ObjectUtil.isNotEmpty(point1)
|
||||||
point1.put("task_code", "");
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
point1.put("vehicle_type", "");
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
point1.put("vehicle_code", "");
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point1.put("point_status", PointStatus.EMPTY.value());
|
point1.put("task_code", "");
|
||||||
if (operation_type == OperationType.AUTO) {
|
point1.put("vehicle_type", "");
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("vehicle_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("point_status", PointStatus.EMPTY.value());
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
point2.put("vehicle_type", task.getString("vehicle_type"));
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point2.put("vehicle_code", task.getString("vehicle_code"));
|
point2.put("task_code", "");
|
||||||
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
point2.put("vehicle_type", task.getString("vehicle_type"));
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("vehicle_code", task.getString("vehicle_code"));
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 +"'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.wms.sch.task.send.material;
|
package org.nl.wms.sch.task.send.material;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -141,36 +142,49 @@ public class YZSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
String point_code1 = task.getString("point_code1");
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("task_code", "");
|
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
if (operation_type == OperationType.AUTO) {
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("task_code", "");
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("task_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
|
|
||||||
WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("group_id"));
|
WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("group_id"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
task.put("task_status", TaskStatus.FINISHED.value());
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
if (operation_type == OperationType.AUTO) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addACSUpdateColum(task);
|
TaskUtils.addACSUpdateColum(task);
|
||||||
@@ -180,35 +194,42 @@ public class YZSendMaterialTask extends AbstractAcsTask {
|
|||||||
WQLObject.getWQLObject("sch_base_task").update(task);
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0);
|
|
||||||
if (ObjectUtil.isNotEmpty(point1)
|
String point_code1 = task.getString("point_code1");
|
||||||
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
if (ObjectUtil.isNotEmpty(point1)
|
||||||
point1.put("task_code", "");
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
point1.put("vehicle_type", "");
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
point1.put("vehicle_code", "");
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point1.put("point_status", PointStatus.EMPTY.value());
|
point1.put("task_code", "");
|
||||||
if (operation_type == OperationType.AUTO) {
|
point1.put("vehicle_type", "");
|
||||||
TaskUtils.addACSUpdateColum(point1);
|
point1.put("vehicle_code", "");
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
point1.put("point_status", PointStatus.EMPTY.value());
|
||||||
TaskUtils.addCurrentUpdateColum(point1);
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
}
|
}
|
||||||
point_table.update(point1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject point2 = new JSONObject();
|
String point_code2 = task.getString("point_code2");
|
||||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
point2.put("task_code", "");
|
JSONObject point2 = new JSONObject();
|
||||||
point2.put("vehicle_type", task.getString("vehicle_type"));
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
point2.put("vehicle_code", task.getString("vehicle_code"));
|
point2.put("task_code", "");
|
||||||
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
point2.put("vehicle_type", task.getString("vehicle_type"));
|
||||||
if (operation_type == OperationType.AUTO) {
|
point2.put("vehicle_code", task.getString("vehicle_code"));
|
||||||
TaskUtils.addACSUpdateColum(point2);
|
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
||||||
} else if (operation_type == OperationType.MANUAL) {
|
if (operation_type == OperationType.AUTO) {
|
||||||
TaskUtils.addCurrentUpdateColum(point2);
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
}
|
}
|
||||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[交易说明]
|
[交易说明]
|
||||||
交易名: 送料入库
|
交易名: 送料
|
||||||
所属模块:
|
所属模块:
|
||||||
功能简述:
|
功能简述:
|
||||||
版权所有:
|
版权所有:
|
||||||
|
|||||||
@@ -0,0 +1,228 @@
|
|||||||
|
package org.nl.wms.sch.task.to.pack;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.wql.WQL;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.wms.basedata.eum.TrueOrFalse;
|
||||||
|
import org.nl.wms.common.PickType;
|
||||||
|
import org.nl.wms.sch.manage.*;
|
||||||
|
import org.nl.wms.sch.task.util.TaskUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangjiangwei
|
||||||
|
* @date 2023/05/04 10:05
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Component
|
||||||
|
public class BTHCToPackageTask extends AbstractAcsTask {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTaskStatus(JSONObject task, String status) {
|
||||||
|
if (TaskStatus.EXECUTING.value().equals(status)) {
|
||||||
|
task.put("task_status", TaskStatus.EXECUTING.value());
|
||||||
|
TaskUtils.addACSUpdateColum(task);
|
||||||
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
} else if (TaskStatus.FINISHED.value().equals(status)) {
|
||||||
|
this.finishTask(task, OperationType.AUTO);
|
||||||
|
} else if (TaskStatus.CANCELLED.value().equals(status)) {
|
||||||
|
this.cancelTask(task, OperationType.AUTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String createTask(JSONObject form) {
|
||||||
|
JSONObject point = form.getJSONObject("point");
|
||||||
|
JSONObject vd = form.getJSONObject("vd");
|
||||||
|
|
||||||
|
JSONObject pn = TaskUtils.buildPN(PickType.CP, vd.getLongValue("qty"), vd.getLongValue("workorder_id"));
|
||||||
|
WQLObject.getWQLObject("das_produce_number").insert(pn);
|
||||||
|
|
||||||
|
JSONObject task = TaskUtils.buildTask(
|
||||||
|
"半托缓存区去包装",
|
||||||
|
TaskType.TO_PACKAGE.value(),
|
||||||
|
TaskStatus.SURE_START.value(),
|
||||||
|
point.getString("point_code"),
|
||||||
|
null,
|
||||||
|
pn.getLongValue("data_id"),
|
||||||
|
vd.getString("material_id"),
|
||||||
|
vd.getString("vehicle_type"),
|
||||||
|
vd.getString("vehicle_code"),
|
||||||
|
1,
|
||||||
|
BTHCToPackageTask.class.getName(),
|
||||||
|
form.getString("create_mode"),
|
||||||
|
form.getString("request_param"),
|
||||||
|
form.getString("create_id"),
|
||||||
|
form.getString("create_name")
|
||||||
|
);
|
||||||
|
WQLObject.getWQLObject("sch_base_task").insert(task);
|
||||||
|
|
||||||
|
point.put("lock_type", LockType.TASK_LOCKED.value());
|
||||||
|
point.put("task_code", task.getString("task_code"));
|
||||||
|
TaskUtils.addFormUpdateColum(point, form);
|
||||||
|
WQLObject.getWQLObject("sch_base_point").update(point);
|
||||||
|
|
||||||
|
return task.getString("task_code");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void findNextPoint() {
|
||||||
|
WQLObject task_table = WQLObject.getWQLObject("sch_base_task");
|
||||||
|
JSONArray tasks = task_table
|
||||||
|
.query("is_delete = '0' AND task_status = '" + TaskStatus.SURE_START.value() + "' AND handle_class = '" + BTHCToPackageTask.class.getName() + "'", "priority DESC, create_time ASC")
|
||||||
|
.getResultJSONArray(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(tasks)) {
|
||||||
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
|
|
||||||
|
for (int i = 0; i < tasks.size(); i++) {
|
||||||
|
JSONObject task = tasks.getJSONObject(i);
|
||||||
|
|
||||||
|
JSONObject point = WQL
|
||||||
|
.getWO("TO_PACKAGE_TASK")
|
||||||
|
.addParam("flag", "1")
|
||||||
|
.process()
|
||||||
|
.uniqueResult(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(point)) {
|
||||||
|
task.put("task_status", TaskStatus.START_AND_END.value());
|
||||||
|
task.put("point_code2", point.getString("point_code"));
|
||||||
|
task.put("remark", "");
|
||||||
|
TaskUtils.addAutoUpdateColum(task);
|
||||||
|
task_table.update(task);
|
||||||
|
|
||||||
|
point.put("lock_type", LockType.TASK_LOCKED.value());
|
||||||
|
point.put("task_code", task.getString("task_code"));
|
||||||
|
TaskUtils.addAutoUpdateColum(point);
|
||||||
|
point_table.update(point);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void forceFinish(String task_id) {
|
||||||
|
JSONObject task = WQLObject.getWQLObject("sch_base_task").query("task_id = " + task_id).uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(task)) {
|
||||||
|
throw new BadRequestException("未找到任务!");
|
||||||
|
}
|
||||||
|
this.finishTask(task, OperationType.MANUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancel(String task_id) {
|
||||||
|
JSONObject task = WQLObject.getWQLObject("sch_base_task").query("task_id = " + task_id).uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(task)) {
|
||||||
|
throw new BadRequestException("未找到任务!");
|
||||||
|
}
|
||||||
|
this.cancelTask(task, OperationType.MANUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void cancelTask(JSONObject task, OperationType operation_type) {
|
||||||
|
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
task.put("task_status", TaskStatus.CANCELLED.value());
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(task);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(task);
|
||||||
|
}
|
||||||
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
|
|
||||||
|
String point_code1 = task.getString("point_code1");
|
||||||
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
|
point1.put("task_code", "");
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String point_code2 = task.getString("point_code2");
|
||||||
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
|
JSONObject point2 = new JSONObject();
|
||||||
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
|
point2.put("task_code", "");
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("group_id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(task);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(task);
|
||||||
|
}
|
||||||
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
|
|
||||||
|
String point_code1 = task.getString("point_code1");
|
||||||
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(point1)
|
||||||
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
|
point1.put("task_code", "");
|
||||||
|
point1.put("vehicle_type", "");
|
||||||
|
point1.put("vehicle_code", "");
|
||||||
|
point1.put("point_status", PointStatus.EMPTY.value());
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String point_code2 = task.getString("point_code2");
|
||||||
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
|
JSONObject point2 = new JSONObject();
|
||||||
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
|
point2.put("task_code", "");
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,230 @@
|
|||||||
|
package org.nl.wms.sch.task.to.pack;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.wql.WQL;
|
||||||
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.wms.basedata.eum.TrueOrFalse;
|
||||||
|
import org.nl.wms.common.PickType;
|
||||||
|
import org.nl.wms.sch.manage.*;
|
||||||
|
import org.nl.wms.sch.task.util.TaskUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author zhangjiangwei
|
||||||
|
* @date 2023/05/04 09:40
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Component
|
||||||
|
public class FJToPackageTask extends AbstractAcsTask {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTaskStatus(JSONObject task, String status) {
|
||||||
|
if (TaskStatus.EXECUTING.value().equals(status)) {
|
||||||
|
task.put("task_status", TaskStatus.EXECUTING.value());
|
||||||
|
TaskUtils.addACSUpdateColum(task);
|
||||||
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
} else if (TaskStatus.FINISHED.value().equals(status)) {
|
||||||
|
this.finishTask(task, OperationType.AUTO);
|
||||||
|
} else if (TaskStatus.CANCELLED.value().equals(status)) {
|
||||||
|
this.cancelTask(task, OperationType.AUTO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String createTask(JSONObject form) {
|
||||||
|
JSONObject point = form.getJSONObject("point");
|
||||||
|
JSONObject work_order = form.getJSONObject("workorder");
|
||||||
|
int priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1;
|
||||||
|
JSONObject vd = form.getJSONObject("vd");
|
||||||
|
|
||||||
|
JSONObject pn = TaskUtils.buildPN(PickType.CP, vd.getLongValue("qty"), vd.getLongValue("workorder_id"));
|
||||||
|
WQLObject.getWQLObject("das_produce_number").insert(pn);
|
||||||
|
|
||||||
|
JSONObject task = TaskUtils.buildTask(
|
||||||
|
"分拣区去包装",
|
||||||
|
TaskType.TO_PACKAGE.value(),
|
||||||
|
TaskStatus.SURE_START.value(),
|
||||||
|
point.getString("point_code"),
|
||||||
|
null,
|
||||||
|
pn.getLongValue("data_id"),
|
||||||
|
vd.getString("material_id"),
|
||||||
|
vd.getString("vehicle_type"),
|
||||||
|
vd.getString("vehicle_code"),
|
||||||
|
priority,
|
||||||
|
FJToPackageTask.class.getName(),
|
||||||
|
form.getString("create_mode"),
|
||||||
|
form.getString("request_param"),
|
||||||
|
form.getString("create_id"),
|
||||||
|
form.getString("create_name")
|
||||||
|
);
|
||||||
|
WQLObject.getWQLObject("sch_base_task").insert(task);
|
||||||
|
|
||||||
|
point.put("lock_type", LockType.TASK_LOCKED.value());
|
||||||
|
point.put("task_code", task.getString("task_code"));
|
||||||
|
TaskUtils.addFormUpdateColum(point, form);
|
||||||
|
WQLObject.getWQLObject("sch_base_point").update(point);
|
||||||
|
|
||||||
|
return task.getString("task_code");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void findNextPoint() {
|
||||||
|
WQLObject task_table = WQLObject.getWQLObject("sch_base_task");
|
||||||
|
JSONArray tasks = task_table
|
||||||
|
.query("is_delete = '0' AND task_status = '" + TaskStatus.SURE_START.value() + "' AND handle_class = '" + FJToPackageTask.class.getName() + "'", "priority DESC, create_time ASC")
|
||||||
|
.getResultJSONArray(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(tasks)) {
|
||||||
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
|
|
||||||
|
for (int i = 0; i < tasks.size(); i++) {
|
||||||
|
JSONObject task = tasks.getJSONObject(i);
|
||||||
|
|
||||||
|
JSONObject point = WQL
|
||||||
|
.getWO("TO_PACKAGE_TASK")
|
||||||
|
.addParam("flag", "1")
|
||||||
|
.process()
|
||||||
|
.uniqueResult(0);
|
||||||
|
|
||||||
|
if (ObjectUtil.isNotEmpty(point)) {
|
||||||
|
task.put("task_status", TaskStatus.START_AND_END.value());
|
||||||
|
task.put("point_code2", point.getString("point_code"));
|
||||||
|
task.put("remark", "");
|
||||||
|
TaskUtils.addAutoUpdateColum(task);
|
||||||
|
task_table.update(task);
|
||||||
|
|
||||||
|
point.put("lock_type", LockType.TASK_LOCKED.value());
|
||||||
|
point.put("task_code", task.getString("task_code"));
|
||||||
|
TaskUtils.addAutoUpdateColum(point);
|
||||||
|
point_table.update(point);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void forceFinish(String task_id) {
|
||||||
|
JSONObject task = WQLObject.getWQLObject("sch_base_task").query("task_id = " + task_id).uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(task)) {
|
||||||
|
throw new BadRequestException("未找到任务!");
|
||||||
|
}
|
||||||
|
this.finishTask(task, OperationType.MANUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cancel(String task_id) {
|
||||||
|
JSONObject task = WQLObject.getWQLObject("sch_base_task").query("task_id = " + task_id).uniqueResult(0);
|
||||||
|
if (ObjectUtil.isEmpty(task)) {
|
||||||
|
throw new BadRequestException("未找到任务!");
|
||||||
|
}
|
||||||
|
this.cancelTask(task, OperationType.MANUAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void cancelTask(JSONObject task, OperationType operation_type) {
|
||||||
|
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
task.put("task_status", TaskStatus.CANCELLED.value());
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(task);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(task);
|
||||||
|
}
|
||||||
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
|
|
||||||
|
String point_code1 = task.getString("point_code1");
|
||||||
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
if (LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
|
point1.put("task_code", "");
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String point_code2 = task.getString("point_code2");
|
||||||
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
|
JSONObject point2 = new JSONObject();
|
||||||
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
|
point2.put("task_code", "");
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
|
}
|
||||||
|
|
||||||
|
WQLObject.getWQLObject("das_produce_number").delete("data_id = " + task.getLongValue("group_id"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||||
|
int current_task_status = task.getIntValue("task_status");
|
||||||
|
if (current_task_status < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||||
|
if (operation_type == OperationType.MANUAL
|
||||||
|
&& current_task_status < Integer.parseInt(TaskStatus.START_AND_END.value())) {
|
||||||
|
throw new BadRequestException("只能手动完成 [确认起点和终点] 之后的任务!");
|
||||||
|
}
|
||||||
|
|
||||||
|
task.put("task_status", TaskStatus.FINISHED.value());
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(task);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(task);
|
||||||
|
}
|
||||||
|
WQLObject.getWQLObject("sch_base_task").update(task);
|
||||||
|
|
||||||
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point");
|
||||||
|
|
||||||
|
String point_code1 = task.getString("point_code1");
|
||||||
|
if (StrUtil.isNotBlank(point_code1)) {
|
||||||
|
JSONObject point1 = point_table.query("point_code = '" + point_code1 + "'").uniqueResult(0);
|
||||||
|
if (ObjectUtil.isNotEmpty(point1)
|
||||||
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type"))
|
||||||
|
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||||
|
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||||
|
point1.put("task_code", "");
|
||||||
|
point1.put("vehicle_type", "");
|
||||||
|
point1.put("vehicle_code", "");
|
||||||
|
point1.put("point_status", PointStatus.EMPTY.value());
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point1);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point1);
|
||||||
|
}
|
||||||
|
point_table.update(point1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String point_code2 = task.getString("point_code2");
|
||||||
|
if (StrUtil.isNotBlank(point_code2)) {
|
||||||
|
JSONObject point2 = new JSONObject();
|
||||||
|
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||||
|
point2.put("task_code", "");
|
||||||
|
if (operation_type == OperationType.AUTO) {
|
||||||
|
TaskUtils.addACSUpdateColum(point2);
|
||||||
|
} else if (operation_type == OperationType.MANUAL) {
|
||||||
|
TaskUtils.addCurrentUpdateColum(point2);
|
||||||
|
}
|
||||||
|
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
[交易说明]
|
||||||
|
交易名: 去包装
|
||||||
|
所属模块:
|
||||||
|
功能简述:
|
||||||
|
版权所有:
|
||||||
|
表引用:
|
||||||
|
版本经历:
|
||||||
|
|
||||||
|
[数据库]
|
||||||
|
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||||
|
|
||||||
|
[IO定义]
|
||||||
|
#################################################
|
||||||
|
## 表字段对应输入参数
|
||||||
|
#################################################
|
||||||
|
输入.flag TYPEAS s_string
|
||||||
|
|
||||||
|
[临时表]
|
||||||
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
|
|
||||||
|
[临时变量]
|
||||||
|
--所有中间过程变量均可在此处定义
|
||||||
|
|
||||||
|
[业务过程]
|
||||||
|
|
||||||
|
IF 输入.flag = "1"
|
||||||
|
QUERY
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
sch_base_point
|
||||||
|
WHERE
|
||||||
|
is_used = '1'
|
||||||
|
AND lock_type = '1'
|
||||||
|
AND point_status = '0'
|
||||||
|
AND region_code = 'FJ'
|
||||||
|
AND point_type = '5'
|
||||||
|
ENDSELECT
|
||||||
|
ENDQUERY
|
||||||
|
ENDIF
|
||||||
@@ -23,12 +23,18 @@ import org.nl.wms.sch.manage.PointStatus;
|
|||||||
*/
|
*/
|
||||||
public class TaskUtils {
|
public class TaskUtils {
|
||||||
|
|
||||||
public static void isEmpty(JSONObject point) {
|
public static void isEmptyPoint(JSONObject point) {
|
||||||
if (PointStatus.NOT_EMPTY.value().equals(point.getString("point_status"))) {
|
if (PointStatus.NOT_EMPTY.value().equals(point.getString("point_status"))) {
|
||||||
throw new BadRequestException("[" + point.getString("point_code") + "] 上有货!");
|
throw new BadRequestException("[" + point.getString("point_code") + "] 上有货!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void isNotEmptyPoint(JSONObject point) {
|
||||||
|
if (PointStatus.EMPTY.value().equals(point.getString("point_status"))) {
|
||||||
|
throw new BadRequestException("[" + point.getString("point_code") + "] 上无货!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void isLocked(JSONObject point) {
|
public static void isLocked(JSONObject point) {
|
||||||
String lock_type = point.getString("lock_type");
|
String lock_type = point.getString("lock_type");
|
||||||
if (!LockType.UNLOCKED.value().equals(lock_type)) {
|
if (!LockType.UNLOCKED.value().equals(lock_type)) {
|
||||||
|
|||||||
Binary file not shown.
@@ -39,6 +39,7 @@
|
|||||||
<el-select
|
<el-select
|
||||||
v-model="query.point_type"
|
v-model="query.point_type"
|
||||||
clearable
|
clearable
|
||||||
|
filterable
|
||||||
placeholder="点位类型"
|
placeholder="点位类型"
|
||||||
@change="hand"
|
@change="hand"
|
||||||
>
|
>
|
||||||
@@ -123,30 +124,6 @@
|
|||||||
>
|
>
|
||||||
禁用
|
禁用
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
|
||||||
v-if="crud.query.lock_type == 1"
|
|
||||||
slot="right"
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-circle-check"
|
|
||||||
:disabled="crud.selections.length === 0"
|
|
||||||
@click="changeLock(crud.selections, 2)"
|
|
||||||
>
|
|
||||||
锁定
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="crud.query.lock_type == 2"
|
|
||||||
slot="right"
|
|
||||||
class="filter-item"
|
|
||||||
size="mini"
|
|
||||||
type="danger"
|
|
||||||
icon="el-icon-circle-close"
|
|
||||||
:disabled="crud.selections.length === 0"
|
|
||||||
@click="changeLock(crud.selections, 1)"
|
|
||||||
>
|
|
||||||
解锁
|
|
||||||
</el-button>
|
|
||||||
</crudOperation>
|
</crudOperation>
|
||||||
<!--表单组件-->
|
<!--表单组件-->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="query.task_code"
|
v-model="query.task_code"
|
||||||
clearable
|
clearable
|
||||||
style="width: 180px"
|
|
||||||
placeholder="任务编码"
|
placeholder="任务编码"
|
||||||
@keyup.enter.native="crud.toQuery"
|
@keyup.enter.native="crud.toQuery"
|
||||||
/>
|
/>
|
||||||
@@ -23,7 +22,6 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="query.vehicle_code"
|
v-model="query.vehicle_code"
|
||||||
clearable
|
clearable
|
||||||
style="width: 180px"
|
|
||||||
placeholder="载具编码"
|
placeholder="载具编码"
|
||||||
@keyup.enter.native="crud.toQuery"
|
@keyup.enter.native="crud.toQuery"
|
||||||
/>
|
/>
|
||||||
@@ -32,7 +30,6 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="query.point_code"
|
v-model="query.point_code"
|
||||||
clearable
|
clearable
|
||||||
style="width: 180px"
|
|
||||||
placeholder="起点/终点"
|
placeholder="起点/终点"
|
||||||
@keyup.enter.native="crud.toQuery"
|
@keyup.enter.native="crud.toQuery"
|
||||||
/>
|
/>
|
||||||
@@ -53,7 +50,7 @@
|
|||||||
<el-select
|
<el-select
|
||||||
v-model="query.task_status"
|
v-model="query.task_status"
|
||||||
multiple
|
multiple
|
||||||
style="width: 400px"
|
filterable
|
||||||
placeholder="任务状态"
|
placeholder="任务状态"
|
||||||
clearable
|
clearable
|
||||||
@change="handTaskStatus"
|
@change="handTaskStatus"
|
||||||
|
|||||||
Reference in New Issue
Block a user