|
|
|
|
@ -504,7 +504,15 @@ public class ErpContractInfoServiceImpl implements IErpContractInfoService {
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
|
if (isValid) {
|
|
|
|
|
// TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
|
List<ErpContractInfo> contracts = baseMapper.selectBatchIds(ids);
|
|
|
|
|
for (ErpContractInfo contract : contracts) {
|
|
|
|
|
if (contract == null) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
if (!OAStatusEnum.DRAFT.getStatus().equals(contract.getContractStatus())) {
|
|
|
|
|
throw new ServiceException("只能删除暂存状态的合同");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|
|
}
|
|
|
|
|
|