nidapeng
2024-03-29 ff95e73d12418ee4b1e400eaceac3d4d623f85b6
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -515,7 +515,7 @@
        InsuranceApply update = new InsuranceApply();
        update.setEditDate(new Date());
        update.setEditor(model.getCreator());
        update.setStatus(Constants.InsuranceApplyStatus.WTB_UPLOAD.getKey());
        update.setStatus(Constants.InsuranceApplyStatus.WTB_COMPANY_APPLY_SIGNATURE.getKey());
        update.setCheckDate(update.getEditDate());
        update.setCheckInfo("企业完成签署方案确认书");
        update.setCheckUserId(model.getCreator());
@@ -534,6 +534,11 @@
        f.setInfo("企业完成签署方案确认书");
        f.setName("方案确认书.pdf");
        multifileMapper.insert(f);
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.WTB_FINISH_FAQRS;
        ApplyLog log = new ApplyLog(update,applyLogType.getName(), null
                ,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
        applyLogMapper.insert(log);
        return  f;
    }
@@ -567,6 +572,11 @@
        f.setInfo("委托保企业完成签署投保申请书");
        f.setName("投保申请书.pdf");
        multifileMapper.insert(f);
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.SIGNATURE;
        ApplyLog log = new ApplyLog(update,applyLogType.getName(), null
                ,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
        applyLogMapper.insert(log);
        return  f;
    }
@@ -600,6 +610,12 @@
        f.setInfo("企业完成签署人员名单");
        f.setName("人员名单.pdf");
        multifileMapper.insert(f);
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.WTB_FINISH_MEMBER_LIST;
        ApplyLog log = new ApplyLog(update,applyLogType.getName(), null
                ,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
        applyLogMapper.insert(log);
        return  f;
    }
    
@@ -642,6 +658,7 @@
        f.setInfo("企业申请表签署文件");
        f.setName("签章申请表.pdf");
        multifileMapper.insert(f);
        Constants.ApplyLogType applyLogType =Constants.equalsInteger(Constants.ZERO,model.getType())? Constants.ApplyLogType.CA_JIAJIAN_APPLY_SIGN: Constants.ApplyLogType.CA_CHANGUNIT_APPLY_SIGN;
        ApplyLog log = new ApplyLog(update,applyLogType.getName(), null,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
        applyLogMapper.insert(log);
@@ -674,6 +691,10 @@
        f.setInfo("企业完成签署人员名单");
        f.setName("签章人员名单.pdf");
        multifileMapper.insert(f);
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_WTB_FINISH_MEMBER_LIST;
        ApplyLog log = new ApplyLog(update,applyLogType.getName(), null,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
        applyLogMapper.insert(log);
        return f;
    }
@@ -771,10 +792,10 @@
                String fileUrl = uploadSignFile(link);
                if(StringUtils.isBlank(fileUrl)){
                    //如果下载失败,清除合同,下次签章重新生成新合同
                    return;
                    continue;
                }
                uploadSignedFileDo(model,fileUrl,path+fileUrl);
                return;
//                return;
            }
        }
        //委托保 企业签署投保确认书
@@ -799,10 +820,10 @@
                String fileUrl = uploadSignFile(link);
                if(StringUtils.isBlank(fileUrl)){
                    //如果下载失败,清除合同,下次签章重新生成新合同
                    return;
                    continue;
                }
                uploadFAQRSSignedFileDo(model,fileUrl,path+fileUrl);
                return;
//                return;
            }
        }
@@ -828,10 +849,10 @@
                String fileUrl = uploadSignFile(link);
                if(StringUtils.isBlank(fileUrl)){
                    //如果下载失败,清除合同,下次签章重新生成新合同
                    return;
                    continue;
                }
                uploadApplyMemberListSignedFileDo(model,fileUrl,path+fileUrl);
                return;
//                return;
            }
        }
        
@@ -858,10 +879,10 @@
                String fileUrl = uploadSignFile(link);
                if(StringUtils.isBlank(fileUrl)){
                    //如果下载失败,清除合同,下次签章重新生成新合同
                    return;
                    continue;
                }
                uploadTBSQSSignedFileDo(model,fileUrl,path+fileUrl);
                return;
//                return;
            }
        }
        
@@ -890,10 +911,10 @@
                String fileUrl = uploadSignFile(link);
                if(StringUtils.isBlank(fileUrl)){
                    //如果下载失败,清除合同,下次签章重新生成新合同
                    return;
                    continue;
                }
                uploadChangeSignedFileDo(model,fileUrl,path+fileUrl);
                return;
//                return;
            }
        }
@@ -920,10 +941,10 @@
                String fileUrl = uploadSignFile(link);
                if(StringUtils.isBlank(fileUrl)){
                    //如果下载失败,清除合同,下次签章重新生成新合同
                    return;
                    continue;
                }
                uploadChangeMemberListSignedFileDo(model,fileUrl,path+fileUrl);
                return;
//                return;
            }
        }
@@ -947,12 +968,16 @@
                String fileUrl = uploadSignFile(link);
                if(StringUtils.isBlank(fileUrl)){
                    //如果下载失败,清除合同,下次签章重新生成新合同
                    return;
                    continue;
                }
                uploadUnionApplySignedFileDo(model,fileUrl,path+fileUrl);
                return;
//                return;
            }
        }
    }
    @Override
@@ -1929,11 +1954,14 @@
    private void initImgData(InsuranceApply model) {
        List<Multifile> multifiles = multifileMapper.selectList(new QueryWrapper<Multifile>().lambda()
                .eq(Multifile::getObjId,Constants.equalsInteger(model.getSolutionType(),Constants.ZERO)? model.getId():model.getUnionApplyId())
                .eq(Multifile::getObjId, model.getId())
                .in(Multifile::getObjType,Arrays.asList(new Integer[]{Constants.MultiFile.BD_APPLY_PDF.getKey()
                        ,Constants.MultiFile.BD_SIGNED_PDF.getKey()
                        ,Constants.MultiFile.WTB_CONFIRMATION_LATTER.getKey()
                        ,Constants.MultiFile.MEMBER_LIST_LATTER.getKey()
                        ,Constants.MultiFile.BD_DONE_PDF.getKey()}))
                .eq(Multifile::getIsdeleted,Constants.ZERO));
                .eq(Multifile::getIsdeleted,Constants.ZERO)
                .orderByAsc(Multifile::getId));
        if(multifiles!=null){
            String path = systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()
                    +systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode();
@@ -1951,6 +1979,12 @@
                }else if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.BD_DONE_PDF.getKey())){
                    //最終保险单
                    model.setBaoxiandanFile(f);
                }else if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.MEMBER_LIST_LATTER.getKey())){
                    //申请单
                    model.setShenqingdanFile(f);
                }else if(Constants.equalsInteger(f.getObjType(),Constants.MultiFile.WTB_CONFIRMATION_LATTER.getKey())){
                    //签署后确认书
                    model.setFanganFile(f);
                }
//                if(model.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){
@@ -2194,9 +2228,8 @@
                .selectAll(InsuranceApply.class)
                .selectAs(Solutions::getSignKeyword,InsuranceApply::getSignKeyword)
                .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId)
                .eq(InsuranceApply::getId,smsCheckDTO.getCode())
                .eq(InsuranceApply::getId,smsCheckDTO.getBusinessId())
                .last("limit 1");
        InsuranceApply model = insuranceApplyJoinMapper.selectJoinOne(InsuranceApply.class,wrapper);
        if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
            throw  new BusinessException(ResponseStatus.DATA_EMPTY);
@@ -2205,7 +2238,7 @@
        if(Objects.isNull(solutions)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询方案信息");
        }
        if(solutions.getType().equals(Constants.ZERO)){
        if(Constants.equalsInteger(solutions.getType(),(Constants.ZERO))){
            throw  new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,非委托保方案保单!");
        }
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();