|
|
@ -121,74 +121,78 @@ public class YZSendMaterialTask extends AbstractAcsTask { |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void cancelTask(JSONObject task, OperationType operation_type) { |
|
|
|
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"); |
|
|
|
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 (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { |
|
|
|
task.put("task_status", TaskStatus.CANCELLED.value()); |
|
|
|
if (operation_type == OperationType.AUTO) { |
|
|
|
TaskUtils.addACSUpdateColum(point1); |
|
|
|
TaskUtils.addACSUpdateColum(task); |
|
|
|
} 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(); |
|
|
|
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); |
|
|
|
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) { |
|
|
|
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) |
|
|
|
public void finishTask(JSONObject task, OperationType operation_type) { |
|
|
|
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); |
|
|
|
if (task.getIntValue("task_status") < Integer.parseInt(TaskStatus.FINISHED.value())) { |
|
|
|
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"); |
|
|
|
JSONObject point1 = point_table.query("point_code = '" + task.getString("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()); |
|
|
|
TaskUtils.addCurrentUpdateColum(point1); |
|
|
|
point_table.update(point1); |
|
|
|
} |
|
|
|
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) |
|
|
|
&& 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()); |
|
|
|
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); |
|
|
|
} else if (operation_type == OperationType.MANUAL) { |
|
|
|
TaskUtils.addCurrentUpdateColum(point2); |
|
|
|
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); |
|
|
|
} 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") + "'"); |
|
|
|
} |
|
|
|
} |
|
|
|