fix: 是否允许删除任务
This commit is contained in:
@@ -6,9 +6,11 @@ import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.task.instruction.domain.Instruction;
|
||||
import org.nl.acs.task.instruction.domain.InstructionMybatis;
|
||||
import org.nl.acs.task.instruction.service.InstructionService;
|
||||
import org.nl.acs.task.task.domain.Task;
|
||||
import org.nl.acs.task.task.enums.TaskStatusEnum;
|
||||
import org.nl.acs.task.task.service.TaskService;
|
||||
import org.nl.extInterface.manager.WmsTaskCreateManager;
|
||||
import org.nl.extInterface.wms.data.req.OperateCheckReqVO;
|
||||
@@ -87,16 +89,19 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
return response;
|
||||
}
|
||||
|
||||
long instructionCount = instructionService.count(new LambdaQueryWrapper<InstructionMybatis>()
|
||||
.eq(InstructionMybatis::getTask_id, acsTask.getTask_id()));
|
||||
if (instructionCount > 0) {
|
||||
Instruction instruction = instructionService.findByCodeFromCache(acsTask.getTask_code());
|
||||
if (ObjectUtil.isNotEmpty(instruction)) {
|
||||
response.setEnableOperate(false);
|
||||
response.setMessage("ACS存在对应任务指令,不允许完成或取消");
|
||||
return response;
|
||||
}
|
||||
|
||||
response.setEnableOperate(false);
|
||||
response.setMessage("ACS存在对应任务,不允许完成或取消");
|
||||
if (acsTask.getTask_status().equals(TaskStatusEnum.BUSY.getCode())
|
||||
|| acsTask.getTask_status().equals(TaskStatusEnum.READY.getCode())) {
|
||||
response.setEnableOperate(false);
|
||||
response.setMessage("ACS存在对应任务,不允许完成或取消");
|
||||
}
|
||||
response.setEnableOperate(true);
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user