指令完成时判断是否取消

This commit is contained in:
psh
2024-06-20 17:49:29 +08:00
parent 053be97ee7
commit 17dad5b99d

View File

@@ -758,7 +758,10 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
@Transactional(rollbackFor = Exception.class)
public void finish(String id) {
InstructionDto entity = this.findById(id);
// if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
if (ObjectUtil.isEmpty(entity)||"3".equals(entity.getInstruction_status())) {
log.error("指令{}被删除或无权限,操作失败!",id);
return;
}
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
entity.setUpdate_time(now);