合规性手续删除接口
This commit is contained in:
@ -265,9 +265,22 @@ public class BusFormalitiesAreConsolidatedServiceImpl extends ServiceImpl<BusFor
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
for (Long id : ids) {
|
||||||
|
BusFormalitiesAreConsolidated selected = baseMapper.selectById(id);
|
||||||
|
if (selected == null || !FormalitiesStatusEnum.TOSTART.getText().equals(selected.getProcessingStatus())) {
|
||||||
|
throw new ServiceException("只能删除待开始数据");
|
||||||
|
}
|
||||||
|
Long count = busFormalitiesAnnexService.getBaseMapper().selectCount(new LambdaQueryWrapper<BusFormalitiesAnnex>()
|
||||||
|
.eq(BusFormalitiesAnnex::getFormalitiesId, id));
|
||||||
|
if (count > 0L) {
|
||||||
|
busFormalitiesAnnexService.getBaseMapper().delete(new LambdaQueryWrapper<BusFormalitiesAnnex>()
|
||||||
|
.eq(BusFormalitiesAnnex::getFormalitiesId, id));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user