添加任务取消接口

This commit is contained in:
psh
2024-01-03 16:49:42 +08:00
parent e64f2f354b
commit 7fe30fd48f

View File

@@ -686,9 +686,25 @@ public class HFHandServiceImpl implements HFHandService {
Device nextDevice = deviceAppService.findDeviceByCode(acsTask.getNext_device_code());
startDevice.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("desc", "操作成功");
jo.put("result", new JSONObject());