opt:需求单删除增加状态校验:只有生成,分配的可以删除
This commit is contained in:
@@ -161,6 +161,12 @@ public class PmDemandServiceImpl extends ServiceImpl<PmDemandMapper, PmDemand> i
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return;
|
||||
}
|
||||
final List<PmDemand> pmDemands = this.listByIds(ids);
|
||||
for (PmDemand pmDemand : pmDemands) {
|
||||
if (!pmDemand.getStatus().equals(DemandStatus.CREATE.getValue()) && !pmDemand.getStatus().equals(DemandStatus.DIS.getValue())){
|
||||
throw new BadRequestException("删除失败,已经执行的需求单无法删除");
|
||||
}
|
||||
}
|
||||
this.update(new LambdaUpdateWrapper<PmDemand>().in(PmDemand::getId,ids)
|
||||
.set(PmDemand::getIs_deleted,1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user