| | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.dao.business.dto.ApplyPowerDTO; |
| | | import com.doumee.dao.business.dto.CountCyclePriceDTO; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.ApplyPowerVO; |
| | | import com.doumee.dao.business.vo.ChangeDealTypeVO; |
| | | import com.doumee.dao.business.vo.CountCyclePriceVO; |
| | | import io.swagger.models.auth.In; |
| | |
| | | ACCEPTANCE(9, "已受理",3),//待理算 |
| | | WAIT_AUDIT_COMPENSATION(10, "待核赔",4), |
| | | COMPENSATION(11, "已核赔",5), |
| | | CONFIRM_FEE(12, "已确认金额",5), |
| | | CONFIRM_FEE(12, "待结案",5), |
| | | CLOSE_CASE(13, "已结案",6), |
| | | RETURN(14, "已撤案",7), |
| | | ; |
| | |
| | | SUPPLEMENT(5, "补充说明","提交意见:${param}"), |
| | | PLATFORM_LP_DEAL(6, "平台理赔处理","已在平台完成理赔"), |
| | | PLATFORM_REMARK(7, "备注标签","${param}"), |
| | | PLATFORM_ADDCODE(8, "平台添加报案号","备案号:${param}"), |
| | | PLATFORM_ADDCODE(8, "平台修改报案号","备案号:${param}"), |
| | | PLATFORM_UN_AGREE_BACK(9, "企业下载资料",""), |
| | | PLATFORM_DOWNLOAD(10, "平台下载资料",""), |
| | | PLATFORM_CHECK_PASS(11, "平台上传资料",""), |
| | |
| | | |
| | | } |
| | | |
| | | public static void initApplyStatus(InsuranceApply apply){ |
| | | apply.setStatusCollect(Constants.InsuranceApplyStatus.getCollectStatus(apply.getStatus())); |
| | | if(Constants.equalsInteger(apply.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) |
| | | || Constants.equalsInteger(apply.getStatus(),Constants.InsuranceApplyStatus.WTB_DONE.getKey())){ |
| | | //如果已完成 |
| | | if(apply.getEndTime()==null || System.currentTimeMillis()>apply.getEndTime().getTime()){ |
| | | apply.setStatusCollect(Constants.THREE);//已过期 |
| | | } |
| | | } |
| | | Constants.setServiceDays(apply); |
| | | apply.setStatusInfo(Constants.ApplyCollectStatus.getName(apply.getStatusCollect())); |
| | | if(Constants.equalsInteger(apply.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) |
| | | || Constants.equalsInteger(apply.getStatus(),Constants.InsuranceApplyStatus.WTB_DONE.getKey()) ){ |
| | | if(apply.getStartTime().getTime()>System.currentTimeMillis()){ |
| | | apply.setStatusInfo("待生效"); |
| | | }else if(apply.getEndTime().getTime()<System.currentTimeMillis()){ |
| | | apply.setStatusInfo("已过期"); |
| | | }else{ |
| | | apply.setStatusInfo("保障中"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static void setServiceDays(InsuranceApply insuranceApply) { |
| | | //设置在保时长(天数) |
| | | insuranceApply.setServiceDays(Constants.ZERO); |
| | | if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) |
| | | || insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WTB_DONE.getKey())){ |
| | | //如果当前时间大于结束日期 则使用结束日期对比开始日期 |
| | | if(DateUtil.compareDate(new Date(),insuranceApply.getEndTime())>=Constants.ZERO){ |
| | | insuranceApply.setServiceDays( |
| | | DateUtil.daysBetweenDates(insuranceApply.getEndTime(),insuranceApply.getStartTime())+1 |
| | | ); |
| | | }else if(DateUtil.compareDate(insuranceApply.getStartTime(),new Date())>=Constants.ZERO){ |
| | | //未开始 |
| | | insuranceApply.setServiceDays(Constants.ZERO); |
| | | }else{ |
| | | insuranceApply.setServiceDays(DateUtil.daysBetweenDates(new Date(),insuranceApply.getStartTime())+1); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static ApplyPowerVO getApplyPowerStatic(ApplyPowerDTO applyPowerDTO, InsuranceApply insuranceApply, Solutions solutions){ |
| | | if(Objects.isNull(applyPowerDTO) |
| | | || Objects.isNull(applyPowerDTO.getApplyId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"参数错误"); |
| | | } |
| | | if(Objects.isNull(applyPowerDTO.getBeginDate())){ |
| | | applyPowerDTO.setBeginDate(new Date()); |
| | | } |
| | | ApplyPowerVO applyPowerVO = new ApplyPowerVO(); |
| | | //获取方案 结束时间 |
| | | Date endTime = insuranceApply.getEndTime(); |
| | | //查询当前去加保的开始日期 yyyy-MM-dd HH:mm:ss 2024-10-29 00:00:00 |
| | | Date addStartDate = DateUtil.getMontageDate( |
| | | DateUtil.afterDateByType(applyPowerDTO.getBeginDate(),Constants.ZERO,solutions.getAddValidDays()), |
| | | 1 |
| | | ); |
| | | applyPowerVO.setAddStartDate(addStartDate); |
| | | //加保生效日期大于 保单结束日期 则不可以进行加保 |
| | | if(addStartDate.getTime()>=endTime.getTime()){ |
| | | applyPowerVO.setAddTrue(Constants.ONE); |
| | | }else{ |
| | | applyPowerVO.setAddTrue(Constants.ZERO); |
| | | } |
| | | //查询当前去减保的开始日期 yyyy-MM-dd HH:mm:ss 2024-10-29 00:00:00 |
| | | Date delStartDate = DateUtil.getMontageDate( |
| | | DateUtil.afterDateByType(applyPowerDTO.getBeginDate(),Constants.ZERO,solutions.getAddValidDays()), |
| | | 1 |
| | | ); |
| | | applyPowerVO.setDelStartDate(delStartDate); |
| | | //加保生效日期大于 保单结束日期 则不可以进行减保 |
| | | if(delStartDate.getTime()>=endTime.getTime()){ |
| | | applyPowerVO.setDelTrue(Constants.ONE); |
| | | }else{ |
| | | applyPowerVO.setDelTrue(Constants.ZERO); |
| | | } |
| | | return applyPowerVO; |
| | | } |
| | | |
| | | |
| | | } |