k94314517
2024-04-01 7cc2ab5c65f7ab4e0f4ccbda1fe8cb713e8cb877
git ch
已修改7个文件
210 ■■■■ 文件已修改
server/service/src/main/java/com/doumee/core/utils/Constants.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/dao/business/model/ApplyLog.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/UnionChangeService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java 107 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java 40 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/shop/src/main/java/com/doumee/api/business/UnionChangeController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -158,11 +158,16 @@
        int birthYear = Integer.parseInt(idCard.substring(6, 10));
        int birthMonth = Integer.parseInt(idCard.substring(10, 12));
        int birthDay = Integer.parseInt(idCard.substring(12, 14));
        try{
            LocalDate birthDate = LocalDate.of(birthYear, birthMonth, birthDay);
            LocalDate currentDate = LocalDate.now();
            long age = ChronoUnit.YEARS.between(birthDate, currentDate);
            return age;
        }catch (Exception e){
            throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"身份证号码错误:"+idCard);
        }
        LocalDate birthDate = LocalDate.of(birthYear, birthMonth, birthDay);
        LocalDate currentDate = LocalDate.now();
        long age = ChronoUnit.YEARS.between(birthDate, currentDate);
        return age;
    }
@@ -450,6 +455,7 @@
        COMPANY_TBD_SIGNED_PDF(22, "合并单-投保单-商户提交(企业签署)PDF", "合并单-投保单-商户提交(企业签署)PDF"),
        WTB_CA_DONE_PDF(23, "委托加减保/换厂业务 - 合并单最终保单", "委托加减保/换厂业务 - 合并单最终保单"),
        WTB_CONFIRMATION_LATTER(24, "委托保 - 投保方案确认书", "委托保 - 投保方案确认书"),
        WTB_CA_TBD_PDF(25, "委托加减保/换厂业务 -投保单(企业签署后PDF)", "委托加减保/换厂业务 -投保单(企业签署后PDF)"),
        ;
        // 成员变量
        private String name;
@@ -793,16 +799,24 @@
        /**
         * 委托保合并单
         * 委托保 投保单合并单日志
         */
        IA_HBD_UPLOAD(32, "提交申请","",3),
        IA_HBD_UPLOAD_TBD(33, "上传投保单","",3),
        IA_HBD_SIGNATURE_TBD(34, "签署投保单","",3),
        IA_HBD_UPLOAD_INSURANCE(35, "上传保险单","保险生效起期:${param1}变更为${param2}",3),
        IA_HBD_SIGNATURE_TBD(34, "商户签章","",3),
        IA_HBD_UPLOAD_INSURANCE(35, "投保完成","保险生效起期:${param1}变更为${param2}",3),
        IA_HBD_CLOSE(36, "退回申请","原因:${param}",3),
        /**
         * 委托保 加减保/换厂 合并单
         */
        CA_HBD_UPLOAD(37, "提交申请","",4),
        CA_HBD_SIGNATURE_TBD(38, "商户签章","",4),
        CA_HBD_UPLOAD_INSURANCE(39, "投保完成","",4),
        CA_HBD_CLOSE(40, "退回申请","原因:${param}",4),
server/service/src/main/java/com/doumee/dao/business/model/ApplyLog.java
@@ -63,6 +63,19 @@
        this.afterContent=after;
    }
    public ApplyLog(UnionChange apply,String title,String content,Integer objId,Integer objType, String before,String after){
        this.title =title;
        this.content=content;
        this.applyId = apply.getId();
        this.createDate =apply.getEditDate();
        this.creator =apply.getEditor();
        this.status = apply.getStatus();
        this.objId=objId;
        this.objType = objType;
        this.beforeContent=before;
        this.afterContent=after;
    }
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键", example = "1")
server/service/src/main/java/com/doumee/service/business/UnionChangeService.java
@@ -2,6 +2,7 @@
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.dto.CloseDTO;
import com.doumee.dao.business.dto.SaveUnionChangeDTO;
import com.doumee.dao.business.dto.SmsCheckDTO;
import com.doumee.dao.business.dto.UnionChangeBXDDTO;
@@ -107,9 +108,9 @@
    /**
     * 关闭 合并单(加减保/换厂单)
     * @param id
     * @param closeDTO
     */
    void cancelMerge(Integer id);
    void cancelMerge(CloseDTO closeDTO);
    /**
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -103,6 +103,8 @@
    private NoticesMapper noticesMapper;
    @Autowired
    private UnionApplyJoinMapper unionApplyJoinMapper;
    @Autowired
    private UnionChangeJoinMapper unionChangeJoinMapper;
    @Override
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
@@ -751,15 +753,6 @@
        update.setId(model.getId());
        unionApplyJoinMapper.updateById(update);
        //存储待办信息
//        Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.INSURANCE_APPLY;
//        //删除其他待办
//        noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey())
//                .ne(Notices::getType,Constants.NoticeType.SIX.getStatus())
//                .eq(Notices::getObjId,model.getId()));
//        Notices notices = new Notices(noticeObjectType,Constants.ZERO,model.getId(),model.getSolutionsName(),model.getCompanyId(),Constants.NoticeType.TWO);
//        noticesMapper.insert(notices);
        Multifile f = new Multifile();
        f.setIsdeleted(Constants.ZERO);
        f.setCreator(model.getCreator());
@@ -772,14 +765,45 @@
        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);
//
//        startSendEmail(f, model.getCompanyName(),model.getSolutionsName(),model.getSolutionEmail());
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.IA_HBD_SIGNATURE_TBD;
        ApplyLog log = new ApplyLog(model,applyLogType.getName(), null
                ,model.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(model));
        applyLogMapper.insert(log);
        return  f;
    }
    /**
     * 商户合并单(加减保/换厂) 商户签署投保申请单
     * @param model
     * @param fileurl
     * @param fullUrl
     * @return
     */
    public Multifile   uploadUnionChangeSignedFileDo(UnionChange model,String fileurl,String fullUrl) {
        UnionChange update = new UnionChange();
        update.setEditDate(new Date());
        update.setEditor(model.getCreator());
        update.setStatus(Constants.UnionChangeStatus.UPLOAD_INSURANCE_POLICY.getKey());
        update.setId(model.getId());
        unionChangeJoinMapper.updateById(update);
        Multifile f = new Multifile();
        f.setIsdeleted(Constants.ZERO);
        f.setCreator(model.getCreator());
        f.setObjId(update.getId());
        f.setCreateDate(update.getEditDate());
        f.setObjType(Constants.MultiFile.WTB_CA_TBD_PDF.getKey());
        f.setType(Constants.TWO);
        f.setFileurl(fileurl);
        f.setFileurlFull(fullUrl);
        f.setInfo("委托加减保/换厂业务 -投保单");
        f.setName("委托加减保/换厂业务 -投保单.pdf");
        multifileMapper.insert(f);
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_SIGNATURE_TBD;
        ApplyLog log = new ApplyLog(model,applyLogType.getName(), null
                ,model.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(model));
        applyLogMapper.insert(log);
@@ -1012,11 +1036,32 @@
                    continue;
                }
                uploadUnionApplySignedFileDo(model,fileUrl,path+fileUrl);
//                return;
            }
        }
        /**
         *合并加减保换厂 签署业务
         */
        List<UnionChange> unionChangeList = unionChangeJoinMapper.selectJoinList(UnionChange.class,
                new MPJLambdaWrapper<UnionChange>()
                        .selectAll(UnionChange.class)
                        .eq(UnionChange::getStatus,Constants.UnionChangeStatus.MERGE.getKey())
                        .isNotNull(UnionChange::getSignApplyNo));
        if(unionChangeList !=null && unionChangeList.size()>0 ){
            for(UnionChange model : unionChangeList){
                String status = signService.linkFileStatus(model.getSignApplyNo());
                if(!StringUtils.equals(status,"3")){
                    continue;
                }
                String link = signService.linkFile(model.getSignApplyNo());
                String fileUrl = uploadSignFile(link);
                if(StringUtils.isBlank(fileUrl)){
                    //如果下载失败,清除合同,下次签章重新生成新合同
                    continue;
                }
                uploadUnionChangeSignedFileDo(model,fileUrl,path+fileUrl);
            }
        }
@@ -1187,6 +1232,27 @@
                }
                uploadUnionApplySignedFileDo(unionApply,fileUrl,path+fileUrl);
            }
            /**
             *合并加减保换厂 签署业务
             */
            UnionChange unionChange = unionChangeJoinMapper.selectOne(
                    new MPJLambdaWrapper<UnionChange>()
                            .selectAll(UnionChange.class)
                            .eq(UnionChange::getSignApplyNo,data.getApplyNo())
                            .last(" limit 1 "));
            if(unionChange != null &&Constants.equalsInteger(unionChange.getStatus(),Constants.UnionChangeStatus.MERGE.getKey())){
                String link = signService.linkFile(model.getSignApplyNo());
                String fileUrl = uploadSignFile(link);
                if(StringUtils.isBlank(fileUrl)){
                    //如果下载失败,清除合同,下次签章重新生成新合同
                    return;
                }
                uploadUnionChangeSignedFileDo(unionChange,fileUrl,path+fileUrl);
            }
        }else if(Constants.equalsInteger(data.getSignStatus(), Constants.TWO )){
            //如果已拒签,清除合同,下次签章重新生成新合同
            insuranceApplyMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda()
@@ -1207,6 +1273,9 @@
            applyChangeMapper.update(null,new UpdateWrapper<ApplyChange>().lambda()
                    .set(ApplyChange::getSignMemberListNo,null)
                    .eq(ApplyChange::getSignMemberListNo,data.getApplyNo()));
            unionChangeJoinMapper.update(null,new UpdateWrapper<UnionChange>().lambda()
                    .set(UnionChange::getSignApplyNo,null)
                    .eq(UnionChange::getSignApplyNo,data.getApplyNo()));
        }
    }
@@ -2185,11 +2254,11 @@
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业端用户无法进行该操作");
        }
        MPJLambdaWrapper<ApplyDetail> lambdaWrapper = new MPJLambdaWrapper<ApplyDetail>();
        lambdaWrapper.selectAll(Member.class)
        lambdaWrapper.select(ApplyDetail::getId)
                .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId)
                .and(i->i.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()).or().eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.WTB_DONE.getKey()))
                .eq(InsuranceApply::getCompanyId,loginUserInfo.getCompanyId())
                .apply(" now() betwwen t.START_TIME and t.END_TIME ");
                .apply(" now() between t.START_TIME and t.END_TIME ");
         Integer count = applyDetailJoinMapper.selectJoinCount(lambdaWrapper);
        return count;
server/service/src/main/java/com/doumee/service/business/impl/UnionApplyServiceImpl.java
@@ -354,6 +354,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());
@@ -410,7 +412,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());
@@ -456,8 +460,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);
    }
@@ -738,7 +740,7 @@
                .set(UnionApply::getCurrentFee,sumCurrFee)
                .eq(UnionApply::getId,unionApply.getId())
        );
        //合并单 总保单
        //合并单 文件
        if(StringUtils.isNotBlank(unionApplyBXDDTO.getFileUrl())){
            Multifile multifile = new Multifile();
            multifile.setIsdeleted(Constants.ZERO);
server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
@@ -1,5 +1,6 @@
package com.doumee.service.business.impl;
import com.alibaba.fastjson.JSONObject;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.annotation.excel.ExcelExporter;
import com.doumee.core.constants.ResponseStatus;
@@ -11,10 +12,7 @@
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.*;
import com.doumee.dao.business.dto.SaveUnionApplyDTO;
import com.doumee.dao.business.dto.SaveUnionChangeDTO;
import com.doumee.dao.business.dto.SmsCheckDTO;
import com.doumee.dao.business.dto.UnionChangeBXDDTO;
import com.doumee.dao.business.dto.*;
import com.doumee.dao.business.join.*;
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.vo.CountCyclePriceVO;
@@ -92,6 +90,8 @@
    @Autowired
    private MultifileMapper multifileMapper;
    @Autowired
    private ApplyLogMapper applyLogMapper;
    @Override
    public Integer create(UnionChange unionChange) {
        unionChangeMapper.insert(unionChange);
@@ -320,6 +320,13 @@
        applyChagneDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda()
                .set(ApplyChagneDetail::getUnionChangeId,unionChange.getId())
                .in(ApplyChagneDetail::getApplyId,saveUnionChangeDTO.getApplyIds()));
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_UPLOAD;
        ApplyLog log = new ApplyLog(unionChange,applyLogType.getName(), null
                ,unionChange.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(unionChange));
        applyLogMapper.insert(log);
        return unionChange.getId();
    }
@@ -330,16 +337,21 @@
    /**
     * 取消保单合并
     * @param id
     * @param closeDTO
     */
    @Override
    @Transactional(rollbackFor = {Exception.class,BusinessException.class})
    public void cancelMerge(Integer id){
    public void cancelMerge(CloseDTO closeDTO){
        if(Objects.isNull(closeDTO)
                ||Objects.isNull(closeDTO.getId())
                ||StringUtils.isBlank(closeDTO.getReason())){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        if(user.getType().equals(Constants.TWO)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非商户用户,无法进行该操作!");
        }
        UnionChange unionChange = unionChangeMapper.selectById(id);
        UnionChange unionChange = unionChangeMapper.selectById(closeDTO.getId());
        if(Objects.isNull(unionChange)||!Constants.equalsInteger(unionChange.getIsdeleted(),Constants.ZERO)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
@@ -368,6 +380,14 @@
                .set(UnionChange::getStatus,Constants.UnionApplyStatus.CLOSE.getKey())
                .eq(UnionChange::getId,unionChange.getId())
        );
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_UPLOAD;
        String info =applyLogType.getInfo();
        info = info.replace("${param}", closeDTO.getReason());
        ApplyLog log = new ApplyLog(unionChange,applyLogType.getName(), info
                ,unionChange.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(unionChange));
        applyLogMapper.insert(log);
    }
@@ -589,6 +609,12 @@
                .set(UnionChange::getEditor,user.getId())
                .eq(UnionChange::getId,unionChangeBXDDTO.getId())
        );
        Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_UPLOAD_INSURANCE;
        ApplyLog log = new ApplyLog(unionChange,applyLogType.getName(), null
                ,unionChange.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(unionChange));
        applyLogMapper.insert(log);
    }
server/shop/src/main/java/com/doumee/api/business/UnionChangeController.java
@@ -6,6 +6,7 @@
import com.doumee.core.model.ApiResponse;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.dao.business.dto.CloseDTO;
import com.doumee.dao.business.dto.SaveUnionChangeDTO;
import com.doumee.dao.business.dto.SmsCheckDTO;
import com.doumee.dao.business.dto.UnionChangeBXDDTO;
@@ -101,10 +102,10 @@
    @ApiOperation("关闭合并单")
    @GetMapping("/close")
    @PostMapping("/close")
    @RequiresPermissions("business:unionchange:close")
    public ApiResponse close(@RequestParam Integer id) {
        unionChangeService.cancelMerge(id);
    public ApiResponse close(@RequestBody CloseDTO closeDTO) {
        unionChangeService.cancelMerge(closeDTO);
        return ApiResponse.success(null);
    }