|
|
@ -35,14 +35,18 @@ public class YZCallEmptyTask extends AbstractAcsTask { |
|
|
|
this.cancelTask(task, OperationType.AUTO); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public String createTask(JSONObject form) { |
|
|
|
JSONObject point = form.getJSONObject("point"); |
|
|
|
JSONObject work_order = form.getJSONObject("workorder"); |
|
|
|
String priority = "1"; |
|
|
|
int priority = 1; |
|
|
|
if (ObjectUtil.isNotEmpty(work_order)) { |
|
|
|
priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? "99" : "1"; |
|
|
|
priority = TrueOrFalse.trueOrFalse(work_order.getString("is_urgent")) ? 50 : 1; |
|
|
|
} |
|
|
|
JSONObject device = form.getJSONObject("device"); |
|
|
|
if (ObjectUtil.isNotEmpty(device) && "4".equals(device.getString("device_model"))) { |
|
|
|
++priority; |
|
|
|
} |
|
|
|
|
|
|
|
JSONObject task = TaskUtils.buildTask( |
|
|
@ -52,6 +56,7 @@ public class YZCallEmptyTask extends AbstractAcsTask { |
|
|
|
null, |
|
|
|
point.getString("point_code"), |
|
|
|
null, |
|
|
|
null, |
|
|
|
VehicleType.STEEL_TRAY.value(), |
|
|
|
null, |
|
|
|
priority, |
|
|
@ -120,7 +125,7 @@ public class YZCallEmptyTask extends AbstractAcsTask { |
|
|
|
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); |
|
|
@ -166,7 +171,7 @@ 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())) { |
|
|
|
task.put("task_status", TaskStatus.FINISHED.value()); |
|
|
|