MrShi
2024-04-02 22271e641e4505ba906c3770905b7e84e3ad8d85
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -153,7 +153,7 @@
            response.setContentType("application/octet-stream");
            response.setHeader("eva-opera-type", "download");
            response.setHeader("eva-download-filename", encodeFileName);
            Constants. packFilesToZip(fileList,response.getOutputStream());
            Constants.packFilesToZip(fileList,response.getOutputStream());
        } catch (IOException e) {
            throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR, e);
        }
@@ -227,15 +227,18 @@
        List<CompanySolution> list = new ArrayList<>();
        int num =0;
        for(CompanySolution s :company.getSolutionList()){
            if(s.getSolutionBaseId() == null){
            if(Objects.isNull(s.getSolution())){
                continue;
            }
            Solutions newVersion = solutionsMapper.selectOne(new QueryWrapper<Solutions>().lambda().eq(Solutions::getBaseId,s.getSolutionBaseId())
            if(s.getSolution().getBaseId() == null){
                continue;
            }
            Solutions newVersion = solutionsMapper.selectOne(new QueryWrapper<Solutions>().lambda().eq(Solutions::getBaseId,s.getSolution().getBaseId())
                    .eq(Solutions::getDataType,Constants.TWO).last("limit 1"));
            if(Objects.isNull(newVersion)){
                throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请添加有效的保险方案信息!");
            }
            sIds.add(s.getSolutionBaseId());
            sIds.add(s.getSolution().getBaseId());
            s.setCompanyId(company.getId());
            s.setIsdeleted(Constants.ZERO);
            s.setCanAdd(Constants.formatIntegerNum(s.getCanAdd()));
@@ -243,7 +246,7 @@
            s.setCreateDate(company.getCreateDate());
            s.setCreator(company.getCreator());
            s.setSortnum(num++);
            s.setSolutionBaseId( s.getSolutionBaseId() );
            s.setSolutionBaseId( s.getSolution().getBaseId() );
            s.setSolutionId( newVersion.getId() );
            s.setStatus(Constants.ZERO);
            list.add(s);