|
@ -121,74 +121,78 @@ public class YZSendMaterialTask extends AbstractAcsTask { |
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void cancelTask(JSONObject task, OperationType operation_type) { |
|
|
public void cancelTask(JSONObject task, OperationType operation_type) { |
|
|
task.put("task_status", TaskStatus.CANCELLED.value()); |
|
|
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { |
|
|
if (operation_type == OperationType.AUTO) { |
|
|
task.put("task_status", TaskStatus.CANCELLED.value()); |
|
|
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"); |
|
|
|
|
|
JSONObject point1 = point_table.query("point_code = '" + task.getString("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) { |
|
|
if (operation_type == OperationType.AUTO) { |
|
|
TaskUtils.addACSUpdateColum(point1); |
|
|
TaskUtils.addACSUpdateColum(task); |
|
|
} else if (operation_type == OperationType.MANUAL) { |
|
|
} else if (operation_type == OperationType.MANUAL) { |
|
|
TaskUtils.addCurrentUpdateColum(point1); |
|
|
TaskUtils.addCurrentUpdateColum(task); |
|
|
} |
|
|
} |
|
|
point_table.update(point1); |
|
|
WQLObject.getWQLObject("sch_base_task").update(task); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
JSONObject point2 = new JSONObject(); |
|
|
WQLObject point_table = WQLObject.getWQLObject("sch_base_point"); |
|
|
point2.put("lock_type", LockType.UNLOCKED.value()); |
|
|
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); |
|
|
point2.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(point2); |
|
|
point1.put("lock_type", LockType.UNLOCKED.value()); |
|
|
} else if (operation_type == OperationType.MANUAL) { |
|
|
point1.put("task_code", ""); |
|
|
TaskUtils.addCurrentUpdateColum(point2); |
|
|
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", ""); |
|
|
|
|
|
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") + "'"); |
|
|
} |
|
|
} |
|
|
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void finishTask(JSONObject task, OperationType operation_type) { |
|
|
public void finishTask(JSONObject task, OperationType operation_type) { |
|
|
task.put("task_status", TaskStatus.FINISHED.value()); |
|
|
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { |
|
|
if (operation_type == OperationType.AUTO) { |
|
|
task.put("task_status", TaskStatus.FINISHED.value()); |
|
|
TaskUtils.addACSUpdateColum(task); |
|
|
if (operation_type == OperationType.AUTO) { |
|
|
} else if (operation_type == OperationType.MANUAL) { |
|
|
TaskUtils.addACSUpdateColum(task); |
|
|
TaskUtils.addCurrentUpdateColum(task); |
|
|
} else if (operation_type == OperationType.MANUAL) { |
|
|
} |
|
|
TaskUtils.addCurrentUpdateColum(task); |
|
|
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); |
|
|
JSONObject point1 = point_table.query("point_code = '" + task.getString("point_code1") + "'").uniqueResult(0); |
|
|
if (ObjectUtil.isNotEmpty(point1) |
|
|
if (ObjectUtil.isNotEmpty(point1) |
|
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) |
|
|
&& LockType.TASK_LOCKED.value().equals(point1.getString("lock_type")) |
|
|
&& task.getString("task_code").equals(point1.getString("task_code"))) { |
|
|
&& task.getString("task_code").equals(point1.getString("task_code"))) { |
|
|
point1.put("lock_type", LockType.UNLOCKED.value()); |
|
|
point1.put("lock_type", LockType.UNLOCKED.value()); |
|
|
point1.put("task_code", ""); |
|
|
point1.put("task_code", ""); |
|
|
point1.put("vehicle_type", ""); |
|
|
point1.put("vehicle_type", ""); |
|
|
point1.put("vehicle_code", ""); |
|
|
point1.put("vehicle_code", ""); |
|
|
point1.put("point_status", PointStatus.EMPTY.value()); |
|
|
point1.put("point_status", PointStatus.EMPTY.value()); |
|
|
TaskUtils.addCurrentUpdateColum(point1); |
|
|
TaskUtils.addCurrentUpdateColum(point1); |
|
|
point_table.update(point1); |
|
|
point_table.update(point1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
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", ""); |
|
|
point2.put("vehicle_type", task.getString("vehicle_type")); |
|
|
point2.put("vehicle_type", task.getString("vehicle_type")); |
|
|
point2.put("vehicle_code", task.getString("vehicle_code")); |
|
|
point2.put("vehicle_code", task.getString("vehicle_code")); |
|
|
point2.put("point_status", PointStatus.NOT_EMPTY.value()); |
|
|
point2.put("point_status", PointStatus.NOT_EMPTY.value()); |
|
|
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 = '" + task.getString("point_code2") + "'"); |
|
|
} |
|
|
} |
|
|
point_table.update(point2, "point_code = '" + task.getString("point_code2") + "'"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|