jiangping
2025-06-09 5ecb8706b917aa86f43e44a412e86e3e50b636c0
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());
@@ -141,6 +142,7 @@
    private void dealWorkType(Solutions solutions, Solutions newModel, List<SolutionWorktype> worktypes) {
        int num =0;
        List<SolutionWorktype> typeList = new ArrayList<>();
        for(SolutionWorktype type : worktypes) {
            //基础版本
            SolutionWorktype w = new SolutionWorktype();
@@ -157,8 +159,12 @@
            //历史版本的工种信息
            SolutionWorktype newType = new SolutionWorktype();
            BeanUtils.copyProperties(w, newType);
            newType.setId(null);
            newType.setSolutionId(newModel.getId());
            solutionWorktypeJoinMapper.insert(newType);
            typeList.add(newType);
        }
        if(typeList.size()>0){
            solutionWorktypeJoinMapper.insert(typeList);
        }
    }
@@ -221,7 +227,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