| | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | solutionsMapper.deleteById(id); |
| | | //查询是否已存在使用中的保单 |
| | | if(insuranceApplyMapper.selectCount(new QueryWrapper<InsuranceApply>().lambda() |
| | | .apply(" solution_id in ( select id from solutions where BASE_ID = "+id+" or id = "+id+" )" ) |
| | | .notIn(InsuranceApply::getStatus |
| | | ,Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey() |
| | | ,Constants.InsuranceApplyStatus.CLOSE.getKey() |
| | | ,Constants.InsuranceApplyStatus.WTB_CLOSED.getKey() |
| | | ) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"存在已投保的保单数据,无法进行删除"); |
| | | }; |
| | | solutionsMapper.update(null,new UpdateWrapper<Solutions>() |
| | | .lambda() |
| | | .set(Solutions::getIsdeleted,Constants.ONE) |
| | | .and(i->i.eq(Solutions::getId,id).or().eq(Solutions::getBaseId,id)) |
| | | ); |
| | | } |
| | | |
| | | @Override |