k94314517
2025-04-11 c1b5d8b81d63555f6f0095aa823f07d99f80fe21
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
@@ -98,6 +98,7 @@
        solutions.setDataType(Constants.ZERO);
        solutions.setStatus(Constants.ZERO);
        solutions.setCorrectWarnTime(solutionsBase.getCorrectWarnTime());
        solutions.setDelOnlyReplace(solutionsBase.getDelOnlyReplace());
        //2024年6月17日15:56:18 仅支持替换模式下,批增日期 等于 批减日期
        if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){
            solutions.setAddValidDays(solutions.getDelValidDays());
@@ -132,6 +133,7 @@
        file.setObjType(Constants.MultiFile.SOLUTIONS_CONFIRMATION_LATTER.getKey());
        file.setType(Constants.formatIntegerNum(file.getType()));
        multifileMapper.insert(file);
        file.setId(null);
        file.setObjId(newModel.getId());
        multifileMapper.insert(file);
        return solutions.getId();
@@ -220,7 +222,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