k94314517
2024-04-01 0c1ac49f859a0570a19f267d6def82100cb39860
server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
@@ -384,6 +384,8 @@
        UnionApply unionApply = new UnionApply();
        unionApply.setCreateDate(new Date());
        unionApply.setCreator(user.getId());
        unionApply.setEditor(user.getId());
        unionApply.setEditDate(new Date());
        unionApply.setCompanyId(user.getCompanyId());
        unionApply.setStartTime(saveUnionApplyDTO.getStartDate());
        unionApply.setEndTime(saveUnionApplyDTO.getEndDate());
@@ -440,7 +442,9 @@
        if(!user.getType().equals(Constants.TWO)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非商户用户,无法进行该操作!");
        }
        if(Objects.isNull(closeDTO)||Objects.isNull(closeDTO.getId())){
        if(Objects.isNull(closeDTO)
                ||Objects.isNull(closeDTO.getId())
                ||StringUtils.isBlank(closeDTO.getReason())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        UnionApply unionApply = unionApplyMapper.selectById(closeDTO.getId());
@@ -459,15 +463,24 @@
        //合并单状态处于待投保
        if(unionApply.getStatus().equals(Constants.UnionApplyStatus.UPLOAD_INSURANCE_POLICY.getKey())
        || unionApply.getStatus().equals(Constants.UnionApplyStatus.WAIT_SIGNATURE.getKey())){
            //TODO 删除企业投保单的 签署数据
            multifileMapper.delete(new QueryWrapper<Multifile>()
                    .lambda()
                    .apply(" multifile.id in ( select i.id  from insurance_apply i where i.UNION_APPLY_ID = "+unionApply.getId()+" ) ")
                    .eq(Multifile::getObjType,Constants.MultiFile.COMPANY_TBD_SIGNED.getKey()));
        }
        insuranceApplyJoinMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda()
                .set(InsuranceApply::getUnionApplyId,null)
                .set(InsuranceApply::getCheckDate,new Date())
                .set(unionApply.getStatus().equals(Constants.UnionApplyStatus.UPLOAD_INSURANCE_POLICY.getKey())
                        || unionApply.getStatus().equals(Constants.UnionApplyStatus.WAIT_SIGNATURE.getKey()),
                        InsuranceApply::getUnionApplyTbdStatus,Constants.ZERO)
                .set(unionApply.getStatus().equals(Constants.UnionApplyStatus.UPLOAD_INSURANCE_POLICY.getKey())
                        || unionApply.getStatus().equals(Constants.UnionApplyStatus.WAIT_SIGNATURE.getKey()),
                        InsuranceApply::getApplyTbdNo,null)
                .set(InsuranceApply::getCheckUserId,user.getId())
                .set(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_BUSINESS_CHECK_PASS.getKey())
                .eq(InsuranceApply::getUnionApplyId,unionApply.getId()));
                .eq(InsuranceApply::getUnionApplyId,unionApply.getId())
        );
        applyDetailJoinMapper.update(null,new UpdateWrapper<ApplyDetail>().lambda()
                .set(ApplyDetail::getUnionApplyId,null)
@@ -486,8 +499,6 @@
        info = info.replace("${param}", closeDTO.getReason());
        ApplyLog log = new ApplyLog(unionApply,applyLogType.getName(), info
                ,unionApply.getId(),applyLogType.getKey(),null, null);
        applyLogMapper.insert(log);
        applyLogMapper.insert(log);
    }
@@ -768,7 +779,7 @@
                .set(UnionApply::getCurrentFee,sumCurrFee)
                .eq(UnionApply::getId,unionApply.getId())
        );
        //合并单 总保单
        //合并单 文件
        if(StringUtils.isNotBlank(unionApplyBXDDTO.getFileUrl())){
            Multifile multifile = new Multifile();
            multifile.setIsdeleted(Constants.ZERO);