添加任务取消接口
This commit is contained in:
@@ -686,9 +686,25 @@ public class HFHandServiceImpl implements HFHandService {
|
|||||||
Device nextDevice = deviceAppService.findDeviceByCode(acsTask.getNext_device_code());
|
Device nextDevice = deviceAppService.findDeviceByCode(acsTask.getNext_device_code());
|
||||||
startDevice.setIslock("false");
|
startDevice.setIslock("false");
|
||||||
nextDevice.setIslock("false");
|
nextDevice.setIslock("false");
|
||||||
|
} else if (type.equals("3")) {
|
||||||
|
//任务取消
|
||||||
|
TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class);
|
||||||
|
TaskDto acsTask = taskjo.toJavaObject(TaskDto.class);
|
||||||
|
InstructionService instructionservice = SpringContextHolder.getBean(InstructionServiceImpl.class);
|
||||||
|
InstructionDto instdto = instructionservice.findByTaskid(acsTask.getTask_id(), "instruction_status <2 ");
|
||||||
|
if (instdto != null) {
|
||||||
|
jo.put("code", "0");
|
||||||
|
jo.put("desc", "有指令未完成!");
|
||||||
|
jo.put("result", new JSONObject());
|
||||||
|
return jo;
|
||||||
|
}
|
||||||
|
taskService.cancel(acsTask.getTask_id());
|
||||||
|
Device startDevice = deviceAppService.findDeviceByCode(acsTask.getStart_device_code());
|
||||||
|
Device nextDevice = deviceAppService.findDeviceByCode(acsTask.getNext_device_code());
|
||||||
|
startDevice.setIslock("false");
|
||||||
|
nextDevice.setIslock("false");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
jo.put("code", "1");
|
jo.put("code", "1");
|
||||||
jo.put("desc", "操作成功");
|
jo.put("desc", "操作成功");
|
||||||
jo.put("result", new JSONObject());
|
jo.put("result", new JSONObject());
|
||||||
|
|||||||
Reference in New Issue
Block a user