| | |
| | | WTBDCD(23, "待出单"), |
| | | WTBYTH(24, "已退回"), |
| | | WTBYGB(25, "已关闭"), |
| | | WTBTBZ(26, "投保中"), |
| | | //2024年4月25日15:17:13 修改 投保中 = 》 批改申请中 |
| | | WTBTBZ(26, "批改申请中"), |
| | | WTBBZZ(27, "保障中"), |
| | | ; |
| | | // 成员变量 |
| | |
| | | import java.text.DateFormatSymbols; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.Period; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.Enumeration; |
| | |
| | | // ) |
| | | |
| | | // ); |
| | | |
| | | LocalDate startDate= LocalDate.of(2021,2,28); |
| | | LocalDate endDate =LocalDate.of(2022,4,5); |
| | | Period period = Period.between(startDate,endDate); |
| | | int months = period.getYears()* 12 + period.getMonths(); |
| | | System.out.println("Months between the two dates: " + months); |
| | | |
| | | |
| | | /* Calendar calo = Calendar.getInstance(); |
| | | Calendar caln = Calendar.getInstance(); // ,"yyyy-MM-dd HH:mm:ss" |
| | | caln.setTime(DateUtil.StringToDate("2024-03-06 23:59:59")); |
| | | calo.setTime(DateUtil.StringToDate("2024-02-05 00:00:00")); |
| | | System.out.println( DateUtil.calculateMonthsBetweenDates(calo,caln));*/ |
| | | |
| | | // System.out.println( |
| | | // DateUtil.DateToStr( |
| | | // DateUtil.getNextMonthFirst(new Date()) |
| | | // ,"yyyy-MM-dd HH:mm:ss") |
| | | // |
| | | // Calendar calo = Calendar.getInstance(); |
| | | // Calendar caln = Calendar.getInstance(); // ,"yyyy-MM-dd HH:mm:ss" |
| | | // caln.setTime(DateUtil.StringToDate("2024-02-29 23:59:59")); |
| | | // calo.setTime(DateUtil.StringToDate("2024-02-01 00:00:00")); |
| | | // System.out.println( DateUtil.calculateDaysBetweenDates(calo,caln)); |
| | | |
| | | System.out.println( |
| | | DateUtil.DateToStr( |
| | | DateUtil.getNextMonthFirst(new Date()) |
| | | ,"yyyy-MM-dd HH:mm:ss") |
| | | |
| | | ); |
| | | System.out.println( |
| | | DateUtil.DateToStr( |
| | | DateUtil.getNextMonthFirst( |
| | | DateUtil.StringToDate("2024-12-29 21:59:59") |
| | | ) |
| | | ,"yyyy-MM-dd HH:mm:ss") |
| | | |
| | | ); |
| | | // ); |
| | | // System.out.println( |
| | | // DateUtil.DateToStr( |
| | | // DateUtil.getNextMonthFirst( |
| | | // DateUtil.StringToDate("2024-12-29 21:59:59") |
| | | // ) |
| | | // ,"yyyy-MM-dd HH:mm:ss") |
| | | // |
| | | // ); |
| | | |
| | | |
| | | |
| | |
| | | @ApiModelProperty(value = "加减保/换厂单据主键 多个以,分割") |
| | | private List<Integer> applyIds; |
| | | |
| | | @ApiModelProperty(value = "批单日期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date applyDate; |
| | | // @ApiModelProperty(value = "批单日期") |
| | | // @JsonFormat(pattern = "yyyy-MM-dd") |
| | | // private Date applyDate; |
| | | |
| | | @ApiModelProperty(value = "业务类型:0=加减保;1=换厂") |
| | | private Integer businessType; |
| | | |
| | | |
| | | @ApiModelProperty(value = "加保生效日期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date addValidDate; |
| | | |
| | | @ApiModelProperty(value = "减保生效日期") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date delValidDate; |
| | | |
| | | } |
| | |
| | | applyChange.setEditor(loginUserInfo.getId()); |
| | | applyChange.setEditDate(new Date()); |
| | | applyChange.setIsdeleted(Constants.ZERO); |
| | | //根据申请日期 处理加减保的 实际生效日期 |
| | | if(Objects.nonNull(solutions.getAddValidDays())){ |
| | | applyChange.setApplyStartTime( |
| | | DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getAddValidDays()) |
| | | ); |
| | | }else{ |
| | | applyChange.setApplyStartTime(applyChange.getValidTime()); |
| | | } |
| | | if(Objects.nonNull(solutions.getDelValidDays())){ |
| | | applyChange.setDelValidTime( |
| | | DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getDelValidDays()) |
| | | ); |
| | | }else{ |
| | | applyChange.setDelValidTime(applyChange.getValidTime()); |
| | | } |
| | | applyChange.setStatus(Constants.ZERO); |
| | | applyChangeMapper.insert(applyChange); |
| | | |
| | |
| | | applyChangeCyclePriceDTO.setApplyId(insuranceApply.getId()); |
| | | //加保数据 |
| | | List<ApplyChagneDetail> addDetailList = applyChange.getAddDetailList(); |
| | | Integer addDetailSize = 0 ; |
| | | if (CollectionUtils.isNotEmpty(addDetailList)) { |
| | | if(companySolution.getCanAdd().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该企业分配保险方案无法进行加保"); |
| | | addDetailSize = addDetailList.size(); |
| | | if(Objects.isNull(solutions.getCanAdd()) || solutions.getCanAdd().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该保险方案无法进行加保"); |
| | | } |
| | | // if(companySolution.getCanAdd().equals(Constants.ZERO)){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该企业分配保险方案无法进行加保"); |
| | | // } |
| | | //验证是否存在重复数据 |
| | | List<String> idcarNo = addDetailList.stream().map(m->m.getIdcardNo()).collect(Collectors.toList()); |
| | | Set<String> set = new HashSet<>(idcarNo); |
| | |
| | | |
| | | //减保数据 |
| | | List<ApplyChagneDetail> delDetailList = applyChange.getDelDetailList(); |
| | | Integer delDetailSize = 0 ; |
| | | if (CollectionUtils.isNotEmpty(delDetailList)) { |
| | | delDetailSize = delDetailList.size() ; |
| | | //验证是否存在重复数据 |
| | | List<String> idcarNo = delDetailList.stream().map(m->m.getIdcardNo()).collect(Collectors.toList()); |
| | | Set<String> set = new HashSet<>(idcarNo); |
| | | if(idcarNo.size() != set.size()){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,人员录入数据存在相同数据!"); |
| | | } |
| | | |
| | | if(companySolution.getCanReduce().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该企业分配保险方案无法进行减保"); |
| | | if(Objects.isNull(solutions.getCanReduce()) || solutions.getCanReduce().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该保险方案无法进行减保"); |
| | | } |
| | | // if(companySolution.getCanReduce().equals(Constants.ZERO)){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该企业分配保险方案无法进行减保"); |
| | | // } |
| | | //减保明细数据 计算金额 根据批单时间 前一天 计算 |
| | | applyChangeCyclePriceDTO.setValidTime(DateUtil.getMontageDate(applyChange.getValidTime(),3)); |
| | | |
| | |
| | | fee = fee.add(delDetailList.stream().map(ApplyChagneDetail::getFee).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | } |
| | | |
| | | if(Objects.nonNull(solutions.getDelOnlyReplace())&& solutions.getDelOnlyReplace().equals(Constants.ONE)){ |
| | | if(delDetailSize > addDetailSize){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该保险方案仅支持替换"); |
| | | } |
| | | } |
| | | |
| | | //换厂业务 |
| | | List<ApplyChagneDetail> changeDetailList = applyChange.getChangeDetailList(); |
| | | if (CollectionUtils.isNotEmpty(changeDetailList)) { |
| | | if(Objects.isNull(solutions.getCanChangeUnit()) || solutions.getCanChangeUnit().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "该保险方案无法进行换厂操作"); |
| | | } |
| | | //验证是否存在重复数据 |
| | | List<String> idcarNo = changeDetailList.stream().map(m->m.getIdcardNo()).collect(Collectors.toList()); |
| | | Set<String> set = new HashSet<>(idcarNo); |
| | |
| | | }else if(loginUserInfo.getType().equals(Constants.TWO)){ |
| | | //如果是商户查看 |
| | | if(pageWrap.getModel().getSolutionType()!=null && pageWrap.getModel().getSolutionType() ==0){ |
| | | queryWrapper.exists("select cs.id from company_solution cs where cs.isdeleted=0 and cs.company_id=t1.company_id and cs.shop_id="+loginUserInfo.getCompanyId()); |
| | | queryWrapper.exists("select cs.id from company_solution cs where cs.isdeleted=0 AND cs.SOLUTION_ID = t1.SOLUTION_ID and cs.shop_id="+loginUserInfo.getCompanyId()); |
| | | }else if(pageWrap.getModel().getSolutionType()!=null && pageWrap.getModel().getSolutionType() ==1){ |
| | | queryWrapper.eq(Solutions::getShopId,loginUserInfo.getCompanyId()); |
| | | }else{ |
| | | queryWrapper.apply("((t1.type=0 and exists(select cs.id from company_solution cs where cs.isdeleted=0 and cs.company_id=t1.company_id and cs.shop_id="+loginUserInfo.getCompanyId()+")) or (" + |
| | | queryWrapper.apply("((t1.type=0 and exists(select cs.id from company_solution cs where cs.isdeleted=0 AND cs.SOLUTION_ID = t1.SOLUTION_ID and cs.shop_id="+loginUserInfo.getCompanyId()+")) or (" + |
| | | "t2.type=1 and t2.shop_id="+loginUserInfo.getCompanyId()+"))") ; |
| | | } |
| | | }else{ |
| | |
| | | public String getChangeMemberListOnlineSignLink(SmsCheckDTO smsCheckDTO) { |
| | | if(Objects.isNull(smsCheckDTO) |
| | | || Objects.isNull(smsCheckDTO.getBusinessId()) |
| | | || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | // || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //验证 验证码 |
| | | if(!debugModel){ |
| | | smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | } |
| | | // if(!debugModel){ |
| | | // smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | // } |
| | | ApplyChange model = this.queryApplyChangeData(smsCheckDTO.getBusinessId()); |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询加减保/换厂信息"); |
| | |
| | | }else { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请上传营业执照!"); |
| | | } |
| | | if(company.getSignImg()!=null && StringUtils.isNotBlank(company.getSignImg().getFileurl())){ |
| | | multifileList.add(initMultiFileByCompay(company,company.getSignImg(),Constants.MultiFile.COM_SING_IMG.getKey())); |
| | | }else { |
| | | // 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(),"请上传电子签章!"); |
| | | } |
| | | // } |
| | | if(company.getIdcardImgList()!=null && company.getIdcardImgList()!=null&& company.getIdcardImgList().size()>0){ |
| | | for(Multifile f : company.getIdcardImgList()){ |
| | | multifileList.add(initMultiFileByCompay(company,f,Constants.MultiFile.COM_IDCARD_IMG.getKey())); |
| | |
| | | multifileMapper.insert(insuranceApply.getBaoxiandanFile()); |
| | | update.setBaoxiandanFile(insuranceApply.getBaoxiandanFile()); |
| | | |
| | | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,Constants.NoticeObjectType.INSURANCE_APPLY.getKey()) |
| | | .ne(Notices::getType,Constants.NoticeType.SIX.getStatus()) |
| | | .eq(Notices::getObjId,insuranceApply.getId())); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.UPLOAD_INSURANCE; |
| | | String info = ""; |
| | | if(model.getApplyStartTime()!=null && model.getApplyStartTime().getTime()/1000!= insuranceApply.getStartTime().getTime()/1000){ |
| | |
| | | List<InsuranceApply> insuranceApplyList = insuranceApplyJoinMapper.selectJoinList(InsuranceApply.class,new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .eq(InsuranceApply::getIsdeleted,Constants.ZERO) |
| | | .in(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey(),Constants.InsuranceApplyStatus.WTB_TOUBAOING.getKey()) |
| | | .in(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey(),Constants.InsuranceApplyStatus.WTB_DONE.getKey()) |
| | | .eq(!Objects.isNull(id),InsuranceApply::getId,id) |
| | | .le(InsuranceApply::getStartTime,DateUtil.getDate(new Date(),"yyyy-MM-dd") + " 00:00:00") |
| | | .ge(InsuranceApply::getEndTime,DateUtil.getDate(new Date(),"yyyy-MM-dd") + " 23:59:59") |
| | |
| | | public String getSignTBQRSLink(SmsCheckDTO smsCheckDTO) { |
| | | if(Objects.isNull(smsCheckDTO) |
| | | || Objects.isNull(smsCheckDTO.getBusinessId()) |
| | | || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | // || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(!debugModel){ |
| | | smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | } |
| | | // if(!debugModel){ |
| | | // smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | // } |
| | | MPJLambdaWrapper wrapper= new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getSignKeyword,InsuranceApply::getSignKeyword) |
| | |
| | | public String getMemberListOnlineSignLink(SmsCheckDTO smsCheckDTO) { |
| | | if(Objects.isNull(smsCheckDTO) |
| | | || Objects.isNull(smsCheckDTO.getBusinessId()) |
| | | || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | // || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //验证 验证码 |
| | | if(!debugModel){ |
| | | smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | } |
| | | // if(!debugModel){ |
| | | // smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | // } |
| | | InsuranceApply model = this.queryApplyDetail(smsCheckDTO.getBusinessId()); |
| | | if(Objects.isNull(model)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询保单信息"); |
| | |
| | | public String getSignWTBTBDLink(SmsCheckDTO smsCheckDTO) { |
| | | if(Objects.isNull(smsCheckDTO) |
| | | || Objects.isNull(smsCheckDTO.getBusinessId()) |
| | | || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | // || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //验证 验证码 |
| | | if(!debugModel){ |
| | | smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | } |
| | | // if(!debugModel){ |
| | | // smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | // } |
| | | MPJLambdaWrapper wrapper= new MPJLambdaWrapper<InsuranceApply>() |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getSignKeyword,InsuranceApply::getSignKeyword) |
| | |
| | | queryWrapper.selectAll(Notices.class); |
| | | queryWrapper.selectAs(Company::getName,Notices::getCompanyName); |
| | | queryWrapper.leftJoin(Company.class,Company::getId,Notices::getCompanyId); |
| | | queryWrapper.eq(Notices::getType, Constants.NoticeType.SIX.getStatus()); |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.eq(Notices::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | |
| | | return; |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | if(!(loginUserInfo.getType().equals(Constants.ONE)||loginUserInfo.getType().equals(Constants.TWO))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户类别错误"); |
| | | }; |
| | | Company company = loginUserInfo.getCompany(); |
| | |
| | | Taxes queryModel = pageWrap.getModel(); |
| | | if(!user.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业用户无法进行该业务查询"); |
| | | }else{ |
| | | queryWrapper.eq(Taxes::getCompanyId,user.getCompanyId()); |
| | | } |
| | | if(!Objects.isNull(queryModel)){ |
| | | queryWrapper.ge(pageWrap.getModel().getStartDate() != null,Taxes::getCreateDate, (pageWrap.getModel().getStartDate())); |
| | |
| | | public String getSignLink(SmsCheckDTO smsCheckDTO) { |
| | | if(Objects.isNull(smsCheckDTO) |
| | | || Objects.isNull(smsCheckDTO.getBusinessId()) |
| | | || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | // || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //验证 验证码 |
| | | if(!debugModel){ |
| | | smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | } |
| | | // if(!debugModel){ |
| | | // smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | // } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!user.getType().equals(Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非商户用户,无法进行该操作!"); |
| | |
| | | if(unionApplyBXDDDetailTO.isPresent()){ |
| | | UnionApplyBXDDetailDTO unionApplyBXDDetailDTO = unionApplyBXDDDetailTO.get(); |
| | | serverCost = unionApplyBXDDetailDTO.getServerMoney(); |
| | | BigDecimal dayServerMoney = unionApplyBXDDetailDTO.getServerMoney().divide(new BigDecimal(maxDays),2, RoundingMode.HALF_UP); |
| | | BigDecimal dayServerMoney = unionApplyBXDDetailDTO.getServerMoney().divide(new BigDecimal(maxDays),6, RoundingMode.HALF_UP); |
| | | |
| | | price = Constants.formatBigdecimal(price).add(Constants.formatBigdecimal(dayServerMoney)); |
| | | //上传保单信息 |
| | |
| | | } |
| | | if(Objects.isNull(saveUnionChangeDTO) |
| | | || Objects.isNull(saveUnionChangeDTO.getApplyIds()) |
| | | || Objects.isNull(saveUnionChangeDTO.getApplyDate()) |
| | | || Objects.isNull(saveUnionChangeDTO.getAddValidDate()) |
| | | || Objects.isNull(saveUnionChangeDTO.getDelValidDate()) |
| | | || Objects.isNull(saveUnionChangeDTO.getUnionApplyId()) |
| | | || Objects.isNull(saveUnionChangeDTO.getBusinessType()) |
| | | ){ |
| | |
| | | } |
| | | //判断批单日期 合并单的批单生效期在为 保单起期的次日 到保单止期 |
| | | //获取开始日期次日 |
| | | if(saveUnionChangeDTO.getApplyDate().getTime()<DateUtil.afterDateByType(unionApply.getStartTime(),0,1).getTime() |
| | | || saveUnionChangeDTO.getApplyDate().getTime()> unionApply.getEndTime().getTime()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单生效期错误"); |
| | | if(saveUnionChangeDTO.getAddValidDate().getTime()<DateUtil.afterDateByType(unionApply.getStartTime(),0,1).getTime() |
| | | || saveUnionChangeDTO.getAddValidDate().getTime()> unionApply.getEndTime().getTime()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单加保生效期错误"); |
| | | } |
| | | if(saveUnionChangeDTO.getDelValidDate().getTime()<DateUtil.afterDateByType(unionApply.getStartTime(),0,1).getTime() |
| | | || saveUnionChangeDTO.getDelValidDate().getTime()> unionApply.getEndTime().getTime()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单加保生效期错误"); |
| | | } |
| | | |
| | | List<ApplyChange> applyChangeList = applyChangeJoinMapper.selectJoinList(ApplyChange.class, |
| | |
| | | unionChange.setShopId(user.getCompanyId()); |
| | | unionChange.setIsdeleted(Constants.ZERO); |
| | | unionChange.setUnionApplyId(saveUnionChangeDTO.getUnionApplyId()); |
| | | unionChange.setApplyStartTime(DateUtil.getMontageDate(saveUnionChangeDTO.getApplyDate(),1)); |
| | | unionChange.setApplyStartTime(DateUtil.getMontageDate(saveUnionChangeDTO.getAddValidDate(),1)); |
| | | unionChange.setDelValidTime(DateUtil.getMontageDate(saveUnionChangeDTO.getDelValidDate(),1)); |
| | | unionChange.setType(saveUnionChangeDTO.getBusinessType()); |
| | | unionChange.setStatus(Constants.UnionChangeStatus.MERGE.getKey()); |
| | | unionChangeMapper.insert(unionChange); |
| | |
| | | applyChagneDetailJoinMapper.update(null,new UpdateWrapper<ApplyChagneDetail>().lambda() |
| | | .set(ApplyChagneDetail::getUnionChangeId,unionChange.getId()) |
| | | .in(ApplyChagneDetail::getApplyChangeId,saveUnionChangeDTO.getApplyIds())); |
| | | |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_HBD_UPLOAD; |
| | | ApplyLog log = new ApplyLog(unionChange,applyLogType.getName(), null |
| | |
| | | public String getSignLink(SmsCheckDTO smsCheckDTO) { |
| | | if(Objects.isNull(smsCheckDTO) |
| | | || Objects.isNull(smsCheckDTO.getBusinessId()) |
| | | || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | // || StringUtils.isBlank(smsCheckDTO.getCode()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | //验证 验证码 |
| | | if(!debugModel){ |
| | | smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | } |
| | | // if(!debugModel){ |
| | | // smsEmailService.validateCode(smsCheckDTO.getCode()); |
| | | // } |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | UnionChange unionChange = this.unionChangeDetail(smsCheckDTO.getBusinessId()); |
| | | unionChange.setStatus(Constants.formatIntegerNum(unionChange.getStatus())); |
| | |
| | | //获取开始日期次日 |
| | | if(unionChangeBXDDTO.getApplyDate().getTime()<DateUtil.afterDateByType(unionApply.getStartTime(),0,1).getTime() |
| | | || unionChangeBXDDTO.getApplyDate().getTime()> unionApply.getEndTime().getTime()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单生效期错误"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单加保生效期错误"); |
| | | } |
| | | if(unionChangeBXDDTO.getDelValidTime().getTime()<DateUtil.afterDateByType(unionApply.getStartTime(),0,1).getTime() |
| | | || unionChangeBXDDTO.getDelValidTime().getTime()> unionApply.getEndTime().getTime()){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"合并单的批单减保生效期错误"); |
| | | } |
| | | |
| | | |
| | | List<ApplyChange> applyChangeList = applyChangeJoinMapper.selectJoinList(ApplyChange.class, |
| | | new MPJLambdaWrapper<ApplyChange>() |
| | |
| | | for (ApplyChange applyChange:applyChangeList) { |
| | | ApplyChange oldModel = applyChange; |
| | | applyChange.setApplyStartTime(unionChangeBXDDTO.getApplyDate()); |
| | | applyChange.setValidTime(unionChangeBXDDTO.getApplyDate()); |
| | | applyChange.setDelValidTime(unionChangeBXDDTO.getDelValidTime()); |
| | | // applyChange.setValidTime(unionChangeBXDDTO.getApplyDate()); |
| | | applyChange.setEditDate(new Date()); |
| | | applyChange.setEditor(user.getId()); |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.APPROVE.getKey()); |
| | |
| | | ApplyDetail add = new ApplyDetail(); |
| | | if(new Date().compareTo(DateUtil.getMontageDate(applyChange.getApplyStartTime(), 2))>=0){ |
| | | Integer days = DateUtil.calculateBetween(applyChange.getApplyStartTime(),DateUtil.getMontageDate(new Date(), 2),0); |
| | | |
| | | |
| | | |
| | | //如果已已产生费用,计算已已产生费用 |
| | | add.setCurrentFee(new BigDecimal(days).multiply(detail.getPrice())); |
| | | }else{ |
| | |
| | | return json.getString("data"); |
| | | } |
| | | }catch (Exception e){ |
| | | |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<SystemRole> findList(SystemRole systemRole) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(Objects.nonNull(user)&&(user.getType().equals(Constants.ONE)||user.getType().equals(Constants.TWO))){ |
| | | systemRole.setCompanyId(user.getCompanyId()); |
| | | } |
| | | Wrapper<SystemRole> wrapper = new QueryWrapper<>(systemRole); |
| | | return systemRoleMapper.selectList(wrapper); |
| | | } |