nidapeng
2024-03-14 7ad3d376d3ccb029bb8077725aa70747b0ebb2ad
server/service/src/main/java/com/doumee/service/business/impl/CompanyServiceImpl.java
@@ -88,6 +88,7 @@
        company.setStatus(Constants.ZERO);
        company.setType(Constants.ZERO);
        company.setSignStatus(Constants.ZERO);
        company.setType(Constants.ZERO);
        company.setSignIdStatus(Constants.ZERO);
        companyMapper.insert(company);
        company.setEditDate(company.getCreateDate());
@@ -98,6 +99,36 @@
        dealFileData(company);
        //处理关联方案
        dealSolutionsData(company);
        return company;
    }
    @Override
    @Transactional
    public Company createShop(Company company) {
        isValidCreateParam(company);
        if(companyMapper.selectCount(new QueryWrapper<Company>().lambda()
                .eq(Company::getCode,company.getCode())
               .or().eq(Company::getPhone,company.getPhone())
               .or().eq(Company::getEmail,company.getEmail())
               .or().eq(Company::getUsername,company.getUsername())
                .or().eq(Company::getName,company.getName()))>0){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,该企业【名称】【统一信用代码】【邮箱】或者【手机号】已存在,请确认后重新提交!");
        }
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        company.setCreator(user.getId());
        company.setCreateDate(new Date());
        company.setType(Constants.ONE);
        company.setIsdeleted(Constants.ZERO);
        company.setStatus(Constants.ZERO);
        company.setType(Constants.ZERO);
        company.setSignStatus(Constants.ZERO);
        company.setSignIdStatus(Constants.ZERO);
        companyMapper.insert(company);
        company.setEditDate(company.getCreateDate());
        company.setEditor(user.getId());
        //处理登陆账号信息
        dealSystemUserData(company);
        //处理附件信息
        dealFileData(company);
        return company;
    }
    @Override
@@ -153,7 +184,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 +258,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 +277,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);
@@ -336,7 +370,7 @@
        if(company.getSignImg()!=null && StringUtils.isNotBlank(company.getSignImg().getFileurl())){
            multifileList.add(initMultiFileByCompay(company,company.getSignImg(),Constants.MultiFile.COM_SING_IMG.getKey()));
        }else {
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请上传电子签章!");
         //   throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请上传电子签章!");
        }
        if(company.getIdcardImgList()!=null && company.getIdcardImgList()!=null&& company.getIdcardImgList().size()>0){
            for(Multifile f : company.getIdcardImgList()){