k94314517
2025-07-04 50fb58286ed3b718c39a97e0987ee7561a295651
server/service/src/main/java/com/doumee/service/business/impl/InsuranceServiceImpl.java
@@ -136,7 +136,7 @@
        }
        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(saveList)){
            worktypeJoinMapper.insertBatchSomeColumn(saveList);
            worktypeJoinMapper.insert(saveList);
        }
        
@@ -427,16 +427,11 @@
    }
    @Override
    public Insurance findById(Integer id) {
    public Insurance findByIdAndType(Integer id,Integer type) {
        Insurance model = insuranceMapper.selectById(id);
        if(model == null  || !Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY );
        }
        List<Worktype> worktypeList = worktypeMapper.selectList(new QueryWrapper<Worktype>().lambda()
                .eq(Worktype::getInsuranceId,id)
                .eq(Worktype::getIsdeleted,Constants.ZERO)
                .orderByAsc(Worktype::getSortnum));
        model.setWorktypeList(worktypeList);
        String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+
                systemDictDataBiz.queryByCode(Constants.OSS,Constants.INSURANCE).getCode();
        //附件信息
@@ -450,14 +445,52 @@
        Multifile lpFile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda().eq(Multifile::getIsdeleted,Constants.ZERO)
                .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.LP_FILE.getKey()).last("limit 1"));
        if(Objects.nonNull(lpFile)){
            lpStampTempFile.setFileurlFull(path + lpFile.getFileurl());
            lpFile.setFileurlFull(path + lpFile.getFileurl());
            model.setLpFile(lpFile);
        }
        if(Objects.nonNull(type)&&Constants.equalsInteger(type,Constants.ONE)){
            return  model;
        }
        List<Worktype> worktypeList = worktypeMapper.selectList(new QueryWrapper<Worktype>().lambda()
                .eq(Worktype::getInsuranceId,id)
                .eq(Worktype::getIsdeleted,Constants.ZERO)
                .orderByAsc(Worktype::getSortnum));
        model.setWorktypeList(worktypeList);
        return model;
    }
    @Override
    public Insurance findById(Integer id) {
        return this.findByIdAndType(id,null);
//        Insurance model = insuranceMapper.selectById(id);
//        if(model == null  || !Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
//            throw  new BusinessException(ResponseStatus.DATA_EMPTY );
//        }
//        List<Worktype> worktypeList = worktypeMapper.selectList(new QueryWrapper<Worktype>().lambda()
//                .eq(Worktype::getInsuranceId,id)
//                .eq(Worktype::getIsdeleted,Constants.ZERO)
//                .orderByAsc(Worktype::getSortnum));
//        model.setWorktypeList(worktypeList);
//        String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+
//                systemDictDataBiz.queryByCode(Constants.OSS,Constants.INSURANCE).getCode();
//        //附件信息
//        Multifile lpStampTempFile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda().eq(Multifile::getIsdeleted,Constants.ZERO)
//                .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.LP_STAMP_FILE.getKey()).last("limit 1"));
//        if(Objects.nonNull(lpStampTempFile)){
//            lpStampTempFile.setFileurlFull(path + lpStampTempFile.getFileurl());
//            model.setLpStampTempFile(lpStampTempFile);
//        }
//
//        Multifile lpFile = multifileMapper.selectOne(new QueryWrapper<Multifile>().lambda().eq(Multifile::getIsdeleted,Constants.ZERO)
//                .eq(Multifile::getObjId,id).eq(Multifile::getObjType,Constants.MultiFile.LP_FILE.getKey()).last("limit 1"));
//        if(Objects.nonNull(lpFile)){
//            lpFile.setFileurlFull(path + lpFile.getFileurl());
//            model.setLpFile(lpFile);
//        }
    }
    @Override
    public Insurance findOne(Insurance insurance) {
        QueryWrapper<Insurance> wrapper = new QueryWrapper<>(insurance);
        return insuranceMapper.selectOne(wrapper);