k94314517
2025-01-18 32929606943fedfca286b052bcb280193a3e0222
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
@@ -221,7 +221,22 @@
    @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