| | |
| | | if(model == null ||!Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(model.getType(),Constants.ONE)&& |
| | | param.getDelValidTime() == null ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.ApplyChangeStatus.SIGNATURE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | |
| | | update.setId(model.getId()); |
| | | update.setValidCode(param.getValidCode()); |
| | | update.setApplyStartTime(param.getApplyStartTime()); |
| | | update.setDelValidTime(param.getDelValidTime()); |
| | | update.setCode(model.getCode()); |
| | | |
| | | param.getPidanFile().setIsdeleted(Constants.ZERO); |
| | |
| | | applyChange.setEditor(loginUserInfo.getId()); |
| | | applyChange.setEditDate(new Date()); |
| | | applyChange.setIsdeleted(Constants.ZERO); |
| | | applyChange.setApplyStartTime(applyChange.getValidTime()); |
| | | //根据申请日期 处理加减保的 实际生效日期 |
| | | 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(),"未查询加减保/换厂信息"); |