更新
This commit is contained in:
@@ -142,4 +142,12 @@ public class AcsToWmsController {
|
||||
public ResponseEntity<Object> getVehicleInfo(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(acsToWmsService.getVehicleInfo(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/updateFoldPoint")
|
||||
@Log("更新叠盘位点位状态")
|
||||
@ApiOperation("更新叠盘位点位状态")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> updateFoldPoint(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(acsToWmsService.updateFoldPoint(whereJson), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,4 +106,6 @@ public interface AcsToWmsService {
|
||||
JSONObject feedbackVehicleType(JSONObject param);
|
||||
|
||||
JSONObject getVehicleInfo(JSONObject whereJson);
|
||||
|
||||
JSONObject updateFoldPoint(JSONObject param);
|
||||
}
|
||||
|
||||
@@ -231,6 +231,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
switch (region) {
|
||||
case HL:
|
||||
JSONObject workorder = TaskUtils.hasWorkOrder(point);
|
||||
method_param.put("workorder", workorder);
|
||||
task_code = hlSendMaterialTask.createTask(method_param);
|
||||
break;
|
||||
case YZ:
|
||||
@@ -259,6 +261,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
break;
|
||||
case "2":
|
||||
// 叫料
|
||||
JSONObject workorder = TaskUtils.hasWorkOrder(point);
|
||||
method_param.put("workorder", workorder);
|
||||
|
||||
switch (region) {
|
||||
case FJ:
|
||||
task_code = fjCallMaterialTask.createTask(method_param);
|
||||
@@ -279,6 +284,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
break;
|
||||
case "4":
|
||||
// 叫空
|
||||
String device_code = point.getString("device_code");
|
||||
JSONObject work_order = WQLObject
|
||||
.getWQLObject("pdm_bd_workorder")
|
||||
.query("is_delete = '0' AND device_code = '" + device_code + "' AND order_status = '3'")
|
||||
.uniqueResult(0);
|
||||
method_param.put("workorder", work_order);
|
||||
|
||||
switch (region) {
|
||||
case HL:
|
||||
task_code = hlCallEmptyTask.createTask(method_param);
|
||||
@@ -773,4 +785,25 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
result.put("data", data);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject updateFoldPoint(JSONObject param) {
|
||||
String point_code = param.getString("device_code");
|
||||
if (StrUtil.isBlank(point_code)) {
|
||||
throw new BadRequestException("点位不能为空!");
|
||||
}
|
||||
String point_status = param.getString("point_status");
|
||||
if (StrUtil.isBlank(point_status)) {
|
||||
throw new BadRequestException("点位状态不能为空!");
|
||||
}
|
||||
|
||||
JSONObject point_update = new JSONObject();
|
||||
point_update.put("point_status", point_status);
|
||||
WQLObject.getWQLObject("sch_base_point").update(point_update, "point_code = '" + point_code + "'");
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "更新点位状态成功!");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,11 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.sch.AcsUtil;
|
||||
import org.nl.wms.sch.task.AcsTaskDTO;
|
||||
import org.nl.wms.sch.task.util.TaskUtils;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -51,7 +53,7 @@ public abstract class AbstractAcsTask {
|
||||
.query("is_delete = '0' AND task_status = " + TaskStatus.START_AND_END.value() + " AND handle_class = '" + this.getClass().getName() + "'")
|
||||
.getResultJSONArray(0);
|
||||
|
||||
ArrayList<AcsTaskDTO> acsTasks = new ArrayList<>();
|
||||
ArrayList<AcsTaskDTO> acs_tasks = new ArrayList<>();
|
||||
for (Object o : tasks) {
|
||||
JSONObject task = (JSONObject) o;
|
||||
|
||||
@@ -68,11 +70,13 @@ public abstract class AbstractAcsTask {
|
||||
.remark(task.getString("remark"))
|
||||
.build();
|
||||
|
||||
acsTasks.add(acsTask);
|
||||
acs_tasks.add(acsTask);
|
||||
}
|
||||
|
||||
return acsTasks;
|
||||
};
|
||||
return acs_tasks;
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
/**
|
||||
* @param taskObj 代表一条任务对象
|
||||
@@ -145,16 +149,32 @@ public abstract class AbstractAcsTask {
|
||||
*/
|
||||
public JSONObject immediateNotifyAcs(String taskId) {
|
||||
WQLObject taskTable = WQLObject.getWQLObject("sch_base_task");
|
||||
JSONArray tasks = taskTable
|
||||
JSONObject task = taskTable
|
||||
.query("task_id = " + taskId)
|
||||
.getResultJSONArray(0);
|
||||
.uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(tasks)) {
|
||||
String taskStatus = ((JSONObject) tasks.get(0)).getString("task_status");
|
||||
if (!StrUtil.equals(taskStatus, TaskStatus.START_AND_END.value())) {
|
||||
throw new BadRequestException("只能下发已确认起点和终点的任务");
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
String task_status = task.getString("task_status");
|
||||
if (!StrUtil.equals(task_status, TaskStatus.START_AND_END.value())) {
|
||||
throw new BadRequestException("只能下发 [确认起点和终点] 的任务!");
|
||||
}
|
||||
|
||||
AcsTaskDTO acs_task = AcsTaskDTO
|
||||
.builder()
|
||||
.task_id(task.getString("task_id"))
|
||||
.task_code(task.getString("task_code"))
|
||||
.task_type(task.getString("acs_task_type"))
|
||||
.start_device_code(task.getString("point_code1"))
|
||||
.next_device_code(task.getString("point_code2"))
|
||||
.vehicle_code(task.getString("vehicle_code"))
|
||||
.vehicle_type(task.getString("vehicle_type"))
|
||||
.priority(task.getString("priority"))
|
||||
.remark(task.getString("remark"))
|
||||
.build();
|
||||
|
||||
JSONArray tasks = new JSONArray() {{
|
||||
add(acs_task);
|
||||
}};
|
||||
JSONObject result = AcsUtil.notifyAcs("api/wms/task", tasks);
|
||||
|
||||
String status = result.getString("status");
|
||||
@@ -169,8 +189,8 @@ public abstract class AbstractAcsTask {
|
||||
JSONObject taskObj = new JSONObject();
|
||||
taskObj.put("task_id", ((JSONObject) item).getString("task_id"));
|
||||
taskObj.put("task_status", TaskStatus.ISSUE.value());
|
||||
taskObj.put("remark", "下发成功");
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskObj.put("remark", "下发成功!");
|
||||
TaskUtils.addCurrentUpdateColum(taskObj);
|
||||
taskTable.update(taskObj);
|
||||
});
|
||||
} else {//下发失败
|
||||
@@ -178,8 +198,8 @@ public abstract class AbstractAcsTask {
|
||||
JSONObject taskObj = new JSONObject();
|
||||
taskObj.put("task_id", ((JSONObject) item).getString("task_id"));
|
||||
// taskObj.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
taskObj.put("remark", "下发失败:" + message);
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskObj.put("remark", "下发失败:" + message);
|
||||
TaskUtils.addCurrentUpdateColum(taskObj);
|
||||
taskTable.update(taskObj);
|
||||
});
|
||||
}
|
||||
@@ -188,8 +208,8 @@ public abstract class AbstractAcsTask {
|
||||
//处理下发失败的任务
|
||||
for (int i = 0; i < errArr.size(); i++) {
|
||||
JSONObject taskObj = errArr.getJSONObject(i);
|
||||
taskObj.put("remark", "下发失败:"+taskObj.getString("message"));
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskObj.put("remark", "下发失败:" + taskObj.getString("message"));
|
||||
TaskUtils.addCurrentUpdateColum(taskObj);
|
||||
taskTable.update(taskObj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.sch.AcsUtil;
|
||||
@@ -84,6 +85,8 @@ public class AutoCreateTask {
|
||||
taskObj.put("task_id", item.getTask_id());
|
||||
taskObj.put("task_status", TaskStatus.ISSUE.value());
|
||||
taskObj.put("remark", "下发成功");
|
||||
taskObj.put("update_optid", AutoCreate.id);
|
||||
taskObj.put("update_optname", AutoCreate.nick_name);
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
});
|
||||
@@ -92,7 +95,9 @@ public class AutoCreateTask {
|
||||
JSONObject taskObj = new JSONObject();
|
||||
taskObj.put("task_id", item.getTask_id());
|
||||
// taskObj.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
taskObj.put("remark", "下发失败:" + message);
|
||||
taskObj.put("remark", "下发失败:" + message);
|
||||
taskObj.put("update_optid", AutoCreate.id);
|
||||
taskObj.put("update_optname", AutoCreate.nick_name);
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
});
|
||||
@@ -103,6 +108,8 @@ public class AutoCreateTask {
|
||||
for (int i = 0; i < errArr.size(); i++) {
|
||||
JSONObject taskObj = errArr.getJSONObject(i);
|
||||
taskObj.put("remark", "下发失败:" + taskObj.getString("message"));
|
||||
taskObj.put("update_optid", AutoCreate.id);
|
||||
taskObj.put("update_optname", AutoCreate.nick_name);
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.nl.wms.basedata.eum.VehicleType;
|
||||
import org.nl.wms.sch.manage.*;
|
||||
import org.nl.wms.sch.task.util.TaskUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 辽宁晟华压制 叫空 任务类
|
||||
@@ -24,7 +23,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Component
|
||||
public class YZCallEmptyTask extends AbstractAcsTask {
|
||||
|
||||
|
||||
@Override
|
||||
public void updateTaskStatus(JSONObject task, String status) {
|
||||
if (TaskStatus.EXECUTING.value().equals(status)) {
|
||||
@@ -37,7 +35,6 @@ public class YZCallEmptyTask extends AbstractAcsTask {
|
||||
this.cancelTask(task, OperationType.AUTO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
@@ -68,12 +65,12 @@ public class YZCallEmptyTask extends AbstractAcsTask {
|
||||
|
||||
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 findStartPoint() {
|
||||
WQLObject task_table = WQLObject.getWQLObject("sch_base_task");
|
||||
@@ -103,16 +100,17 @@ public class YZCallEmptyTask extends AbstractAcsTask {
|
||||
task.put("point_code1", point.getString("point_code"));
|
||||
task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_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);
|
||||
@@ -132,7 +130,6 @@ public class YZCallEmptyTask extends AbstractAcsTask {
|
||||
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());
|
||||
@@ -169,7 +166,6 @@ public class YZCallEmptyTask extends AbstractAcsTask {
|
||||
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void finishTask(JSONObject task, OperationType operation_type) {
|
||||
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) {
|
||||
@@ -190,13 +186,19 @@ public class YZCallEmptyTask extends AbstractAcsTask {
|
||||
point1.put("vehicle_type", "");
|
||||
point1.put("vehicle_code", "");
|
||||
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);
|
||||
}
|
||||
|
||||
JSONObject point2 = new JSONObject();
|
||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||
point2.put("task_code", "");
|
||||
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);
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.nl.wms.basedata.eum.VehicleType;
|
||||
import org.nl.wms.sch.manage.*;
|
||||
import org.nl.wms.sch.task.util.TaskUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author zhangjiangwei
|
||||
@@ -40,7 +39,7 @@ public class FJCallMaterialTask extends AbstractAcsTask {
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
JSONObject point = form.getJSONObject("point");
|
||||
JSONObject workorder = TaskUtils.hasWorkOrder(point);
|
||||
JSONObject workorder = form.getJSONObject("workorder");
|
||||
|
||||
JSONObject task = TaskUtils.buildTask(
|
||||
"分拣区叫料",
|
||||
@@ -62,6 +61,7 @@ public class FJCallMaterialTask extends AbstractAcsTask {
|
||||
|
||||
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");
|
||||
@@ -82,6 +82,7 @@ public class FJCallMaterialTask extends AbstractAcsTask {
|
||||
JSONObject point = WQL
|
||||
.getWO("CALL_MATERIAL_TASK")
|
||||
.addParam("flag", "3")
|
||||
.addParam("material_id", task.getString("material_id"))
|
||||
.process()
|
||||
.uniqueResult(0);
|
||||
|
||||
@@ -90,11 +91,13 @@ public class FJCallMaterialTask extends AbstractAcsTask {
|
||||
task.put("point_code1", point.getString("point_code"));
|
||||
task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code")));
|
||||
task.put("remark", "");
|
||||
TaskUtils.addAutoUpdateColum(task);
|
||||
task_table.update(task);
|
||||
|
||||
JSONObject point_update = new JSONObject();
|
||||
point_update.put("lock_type", LockType.TASK_LOCKED.value());
|
||||
point_update.put("task_code", task.getString("task_code"));
|
||||
TaskUtils.addAutoUpdateColum(point_update);
|
||||
point_table.update(point_update, "point_id = " + point.getLongValue("point_id"));
|
||||
}
|
||||
}
|
||||
@@ -178,7 +181,11 @@ public class FJCallMaterialTask extends AbstractAcsTask {
|
||||
point1.put("vehicle_type", "");
|
||||
point1.put("vehicle_code", "");
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.sch.task.call.material;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -11,7 +12,6 @@ import org.nl.wms.basedata.eum.VehicleType;
|
||||
import org.nl.wms.sch.manage.*;
|
||||
import org.nl.wms.sch.task.util.TaskUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author zhangjiangwei
|
||||
@@ -78,6 +78,7 @@ public class SZCallMaterialTask extends AbstractAcsTask {
|
||||
|
||||
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");
|
||||
@@ -107,11 +108,13 @@ public class SZCallMaterialTask extends AbstractAcsTask {
|
||||
task.put("material_id", point.getString("material_id"));
|
||||
task.put("vehicle_code", TaskUtils.formatVehicleCode(point.getString("vehicle_code")));
|
||||
task.put("remark", "");
|
||||
TaskUtils.addAutoUpdateColum(task);
|
||||
task_table.update(task);
|
||||
|
||||
JSONObject point_update = new JSONObject();
|
||||
point_update.put("lock_type", LockType.TASK_LOCKED.value());
|
||||
point_update.put("task_code", task.getString("task_code"));
|
||||
TaskUtils.addAutoUpdateColum(point_update);
|
||||
point_table.update(point_update, "point_id = " + point.getLongValue("point_id"));
|
||||
}
|
||||
}
|
||||
@@ -195,7 +198,11 @@ public class SZCallMaterialTask extends AbstractAcsTask {
|
||||
point1.put("vehicle_type", "");
|
||||
point1.put("vehicle_code", "");
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.material_id TYPEAS f_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
@@ -95,6 +96,7 @@
|
||||
AND point.point_status = '1'
|
||||
AND point.vehicle_type = '2'
|
||||
AND vd.is_fire = '1'
|
||||
AND vd.material_id = 输入.material_id
|
||||
ORDER BY
|
||||
workorder.is_urgent DESC, vd.create_time ASC
|
||||
ENDSELECT
|
||||
|
||||
@@ -39,7 +39,7 @@ public class FJSendEmptyTask extends AbstractAcsTask {
|
||||
@Override
|
||||
public String createTask(JSONObject form) {
|
||||
JSONObject point = form.getJSONObject("point");
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
String vehicle_code = point.getString("vehicle_code");
|
||||
|
||||
JSONObject task = TaskUtils.buildTask(
|
||||
"分拣区送空",
|
||||
@@ -61,6 +61,7 @@ public class FJSendEmptyTask extends AbstractAcsTask {
|
||||
|
||||
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");
|
||||
@@ -88,10 +89,12 @@ public class FJSendEmptyTask extends AbstractAcsTask {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -175,14 +178,17 @@ public class FJSendEmptyTask extends AbstractAcsTask {
|
||||
point1.put("vehicle_type", "");
|
||||
point1.put("vehicle_code", "");
|
||||
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);
|
||||
}
|
||||
|
||||
JSONObject point2 = new JSONObject();
|
||||
point2.put("lock_type", LockType.UNLOCKED.value());
|
||||
point2.put("task_code", "");
|
||||
point2.put("point_status", PointStatus.NOT_EMPTY.value());
|
||||
if (operation_type == OperationType.AUTO) {
|
||||
TaskUtils.addACSUpdateColum(point2);
|
||||
} else if (operation_type == OperationType.MANUAL) {
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
AND lock_type = '1'
|
||||
AND region_code = 'GTK'
|
||||
AND point_type = '1'
|
||||
AND point_status = '0'
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -59,6 +59,7 @@ public class SZSendMaterialTask extends AbstractAcsTask {
|
||||
|
||||
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");
|
||||
@@ -86,10 +87,12 @@ public class SZSendMaterialTask extends AbstractAcsTask {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -170,7 +173,14 @@ public class SZSendMaterialTask extends AbstractAcsTask {
|
||||
&& task.getString("task_code").equals(point1.getString("task_code"))) {
|
||||
point1.put("lock_type", LockType.UNLOCKED.value());
|
||||
point1.put("task_code", "");
|
||||
TaskUtils.addCurrentUpdateColum(point1);
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,9 @@ 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.basedata.eum.VehicleType;
|
||||
import org.nl.wms.sch.manage.*;
|
||||
import org.nl.wms.sch.task.util.TaskUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* @author zhangjiangwei
|
||||
@@ -63,6 +61,7 @@ public class YZSendMaterialTask extends AbstractAcsTask {
|
||||
|
||||
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");
|
||||
@@ -92,10 +91,12 @@ public class YZSendMaterialTask extends AbstractAcsTask {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -180,7 +181,11 @@ public class YZSendMaterialTask extends AbstractAcsTask {
|
||||
point1.put("vehicle_type", "");
|
||||
point1.put("vehicle_code", "");
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import org.nl.modules.common.utils.SecurityUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.sch.manage.ACSSystem;
|
||||
import org.nl.wms.sch.manage.AutoCreate;
|
||||
import org.nl.wms.sch.manage.LockType;
|
||||
import org.nl.wms.sch.manage.PointStatus;
|
||||
|
||||
@@ -111,4 +112,16 @@ public class TaskUtils {
|
||||
row.put("update_optname", SecurityUtils.getCurrentNickName());
|
||||
row.put("update_time", DateUtil.now());
|
||||
}
|
||||
|
||||
public static void addAutoUpdateColum(JSONObject row) {
|
||||
row.put("update_optid", AutoCreate.id);
|
||||
row.put("update_optname", AutoCreate.nick_name);
|
||||
row.put("update_time", DateUtil.now());
|
||||
}
|
||||
|
||||
public static void addFormUpdateColum(JSONObject row, JSONObject form) {
|
||||
row.put("update_optid", form.getString("create_id"));
|
||||
row.put("update_optname", form.getString("create_name"));
|
||||
row.put("update_time", DateUtil.now());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user