Merge remote-tracking branch 'origin/1.0.1' into 1.0.1
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Descrption:取得当前日期,格式为:yyyy-MM-dd HH:mm:ss |
| | | * |
| | |
| | | return DateToString(date, "yyyyMMddHHmmss"); |
| | | } |
| | | |
| | | public static String getLongDateTime(Date date) { |
| | | return DateToString(date, "yyyy-MM-dd HH:mm:ss"); |
| | | } |
| | | |
| | | public static String DateToString(Date date, String dateStyle) { |
| | | String dateString = null; |
| | | if (dateStyle != null) { |
| | |
| | | |
| | | |
| | | public static void main(String[] args) throws Exception{ |
| | | System.out.println(DateUtil.getPlusTime(new Date()));; |
| | | System.out.println(DateUtil.getLongDateTime(new Date()));; |
| | | } |
| | | |
| | | /** |
| | |
| | | @TableField(exist = false) |
| | | private Multifile pidanFile; |
| | | |
| | | @ApiModelProperty(value = "批减是否仅支持替换 0否 1是", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer delOnlyReplace; |
| | | |
| | | @ApiModelProperty(value = "加保明细数据") |
| | | @TableField(exist = false) |
| | |
| | | @TableField(exist = false) |
| | | private String solutionName; |
| | | |
| | | @ApiModelProperty(value = "批减是否仅支持替换 0否 1是", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer delOnlyReplace; |
| | | |
| | | @ApiModelProperty(value = "查询开始日期", example = "1") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @TableField(exist = false) |
| | |
| | | @TableField(exist = false) |
| | | private Date endTime; |
| | | |
| | | @ApiModelProperty(value = "批减是否仅支持替换 0否 1是", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer delOnlyReplace; |
| | | |
| | | @ApiModelProperty(value = "实际保险生效起期") |
| | | @TableField(exist = false) |
| | | private Date startTime; |
| | |
| | | */ |
| | | Integer create(InsuranceApply insuranceApply); |
| | | Integer updateData(InsuranceApply insuranceApply); |
| | | void checkMemberSolution(Integer solutionId,String idCode,String memberName,Date startTime,Date endTime); |
| | | void checkMemberSolution(Integer solutionId,String idCode,String memberName,Date startTime,Date endTime,Integer applyId); |
| | | |
| | | /** |
| | | * 主键删除 |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "未查询到员工数据"); |
| | | } |
| | | //查询人员信息是否存在相同的方案下是否存在 冲突数据 |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getId(), |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getBaseId(), |
| | | member.getIdcardNo(),member.getName(),detail.getStartTime(),detail.getEndTime(), |
| | | applyDetailJoinMapper); |
| | | |
| | |
| | | .lambda() |
| | | .eq(ApplyDetail::getApplyId,update.getApplyId()) |
| | | .eq(ApplyDetail::getIdcardNo,detail.getIdcardNo()) |
| | | // .apply(" ( " + |
| | | // " '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(update.getApplyStartTime(),1))+"' <= t.start_time AND t.start_time < '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(detail.getEndTime(),2))+"' " + |
| | | // " or " + |
| | | // " ( '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(update.getApplyStartTime(),1))+"' < t.end_time AND t.end_time < '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(detail.getEndTime(),2))+"' ) " + |
| | | // " or " + |
| | | // " ( '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(update.getApplyStartTime(),1))+"' > t.start_time AND '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(detail.getEndTime(),2))+"' < t.end_time )" + |
| | | // " ) " ) |
| | | .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(update.getApplyStartTime(),1)) |
| | | .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(detail.getEndTime(),2)) |
| | | )>Constants.ZERO){ |
| | |
| | | add.setFee(Constants.addFee(solutions,solutions.getPrice(),insuranceApply.getStartTime(),insuranceApply.getFinalEndTime(),update.getApplyStartTime(),insuranceApply.getEndTime())); |
| | | add.setChangeStatus(Constants.ZERO); |
| | | if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE) |
| | | && Constants.equalsInteger(solutions.getTimeUnit(),solutions.getInsureCycleUnit())){ |
| | | && Constants.equalsInteger(solutions.getTimeUnit(),solutions.getInsureCycleUnit()) && i < reduceList.size()){ |
| | | add.setReduceId(reduceList.get(i).getId()); |
| | | } |
| | | if(new Date().compareTo(DateUtil.getMontageDate(detail.getStartTime(), 2))>=0){ |
| | |
| | | if (DateUtil.compareDate(insuranceApply.getEndTime(),new Date()) >= Constants.ZERO ) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "保单已过保,无法进行该操作"); |
| | | } |
| | | if (DateUtil.compareDate(applyChange.getValidTime(),insuranceApply.getStartTime()) >= Constants.ZERO) { |
| | | //如果保单尚未生效,设置期望生效日期为保单生效开始时间 |
| | | applyChange.setValidTime(insuranceApply.getStartTime()); |
| | | } |
| | | // if (DateUtil.compareDate(applyChange.getValidTime(),insuranceApply.getStartTime()) >= Constants.ZERO) { |
| | | // //如果保单尚未生效,设置期望生效日期为保单生效开始时间 |
| | | // applyChange.setValidTime(insuranceApply.getStartTime()); |
| | | // } |
| | | Solutions solutions = solutionsMapper.selectById(insuranceApply.getSolutionId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到保险方案"); |
| | |
| | | ) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "保单已过保,无法进行该操作"); |
| | | } |
| | | if (DateUtil.compareDate(applyChange.getValidTime(),insuranceApply.getStartTime()) > Constants.ZERO) { |
| | | applyChange.setValidTime(insuranceApply.getStartTime()); |
| | | } |
| | | // if (DateUtil.compareDate(applyChange.getValidTime(),insuranceApply.getStartTime()) > Constants.ZERO) { |
| | | // applyChange.setValidTime(insuranceApply.getStartTime()); |
| | | // } |
| | | Solutions solutions = solutionsMapper.selectById(insuranceApply.getSolutionId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到保险方案"); |
| | |
| | | ); |
| | | }else{ |
| | | //如果保单未生或者没有配置生效天数,设置期望生效日期为保单生效开始时间 |
| | | applyChange.setApplyStartTime(applyChange.getValidTime()); |
| | | applyChange.setApplyStartTime(applyChange.getValidTime().getTime()>=insuranceApply.getStartTime().getTime()?applyChange.getValidTime():insuranceApply.getStartTime()); |
| | | } |
| | | if(applyChange.getValidTime().getTime()>=insuranceApply.getStartTime().getTime() |
| | | &&Objects.nonNull(solutions.getDelValidDays())){ |
| | |
| | | DateUtil.afterDateByType(applyChange.getValidTime(),0,solutions.getDelValidDays()) |
| | | ); |
| | | }else{ |
| | | applyChange.setDelValidTime(applyChange.getValidTime()); |
| | | applyChange.setDelValidTime(applyChange.getValidTime().getTime()>=insuranceApply.getStartTime().getTime()?applyChange.getValidTime():insuranceApply.getStartTime()); |
| | | } |
| | | //仅支持替换 保证加减保日期为同一天 |
| | | if(Constants.equalsInteger(solutions.getDelOnlyReplace(),Constants.ONE)){ |
| | |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "加保人员【" + applyChagneDetail.getMemberName() + "】必填项缺失"); |
| | | } |
| | | //查询人员信息是否存在相同的方案下是否存在 冲突数据 |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getId(), |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getBaseId(), |
| | | applyChagneDetail.getMemberIdcardNo(),applyChagneDetail.getMemberName(),insuranceApply.getStartTime(),insuranceApply.getEndTime(), |
| | | applyDetailJoinMapper); |
| | | |
| | |
| | | .lambda() |
| | | .eq(ApplyDetail::getApplyId,applyChange.getApplyId()) |
| | | .eq(ApplyDetail::getIdcardNo,applyChagneDetail.getIdcardNo()) |
| | | // .apply(" ( " + |
| | | // " '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(applyChange.getApplyStartTime(),1))+"' <= t.start_time AND t.start_time < '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(insuranceApply.getEndTime(),2))+"' " + |
| | | // " or " + |
| | | // " ( '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(applyChange.getApplyStartTime(),1))+"' < t.end_time AND t.end_time < '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(insuranceApply.getEndTime(),2))+"' ) " + |
| | | // " or " + |
| | | // " ( '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(applyChange.getApplyStartTime(),1))+"' > t.start_time AND '"+DateUtil.getLongDateTime(DateUtil.getMontageDate(insuranceApply.getEndTime(),2))+"' < t.end_time )" + |
| | | // " ) " ) |
| | | .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),1)) |
| | | .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(insuranceApply.getEndTime(),2)) |
| | | //.ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(applyChange.getApplyStartTime(),3)) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "当前保单下,加保人员【" + applyChagneDetail.getMemberName() + "】存在日期冲突的数据"); |
| | | } |
| | |
| | | .selectAs(Solutions::getName,ApplyChange::getSolutionsName) |
| | | .selectAs(Solutions::getType,ApplyChange::getSolutionType) |
| | | .selectAs(Solutions::getId,ApplyChange::getSolutionsId) |
| | | .selectAs(Solutions::getDelOnlyReplace,ApplyChange::getDelOnlyReplace) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 0 )",ApplyChange::getAddNum) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 1 )",ApplyChange::getDelNum) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.APPLY_CHANGE_ID and ad.TYPE = 2 )",ApplyChange::getChangeNum) |
| | |
| | | }else{ |
| | | d.setApplyStatus(Constants.ZERO); |
| | | } |
| | | |
| | | if(Objects.nonNull(d.getReduceMoney())){ |
| | | d.setFee(d.getFee().add(d.getReduceMoney())); |
| | | } |
| | | } |
| | | } |
| | | return pageData; |
| | |
| | | if(model.getApplyEndTime()== null || model.getStartTime().getTime()>model.getApplyEndTime().getTime() ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请生效周期时间不符合要求,请确认后修改重试~"); |
| | | } |
| | | Solutions solutions = solutionsMapper.selectById(model.getSolutionId()); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询方案信息"); |
| | | } |
| | | //计算实际截止时间 |
| | | Date actEndTime = new Date(model.getApplyEndTime().getTime() + (insuranceApply.getStartTime().getTime() - model.getApplyStartTime().getTime())); |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | for (ApplyDetail applyDetail:applyDetailList) { |
| | | |
| | | //查询人员信息是否存在相同的方案下是否存在 冲突数据 |
| | | this.checkMemberSolution(applyDetail.getSolutionId(),applyDetail.getIdcardNo(),applyDetail.getMemberName(),update.getStartTime(),update.getEndTime()); |
| | | this.checkMemberSolution(solutions.getBaseId(),applyDetail.getIdcardNo(),applyDetail.getMemberName(),update.getStartTime() |
| | | ,update.getEndTime(),insuranceApply.getId()); |
| | | |
| | | MemberInsurance memberInsurance = new MemberInsurance(applyDetail,user.getId()); |
| | | memberInsurance.setRelationType(Constants.ZERO); |
| | |
| | | insuranceApply.setEndTime(countCyclePriceVO.getEndDate()); |
| | | insuranceApply.setFinalEndTime(countCyclePriceVO.getEndDate()); |
| | | insuranceApplyMapper.insert(insuranceApply); |
| | | |
| | | |
| | | //处理下级数据 |
| | | this.dealApplyDetailData(insuranceApply,solutions,applyDetailList,loginUserInfo,countCyclePriceVO,true); |
| | | InsuranceApply updBean = new InsuranceApply(); |
| | |
| | | addMemberList.add(member); |
| | | } |
| | | //查询人员信息是否存在相同的方案下是否存在 冲突数据 |
| | | this.checkMemberSolution(solutions.getId(),member.getIdcardNo(),member.getName(),insuranceApply.getStartTime(),insuranceApply.getEndTime()); |
| | | this.checkMemberSolution(solutions.getBaseId(),member.getIdcardNo(),member.getName(),insuranceApply.getStartTime(),insuranceApply.getEndTime(),insuranceApply.getId()); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(addMemberList)){ |
| | | memberJoinMapper.insertBatchSomeColumn(addMemberList); |
| | |
| | | * @param endTime |
| | | */ |
| | | @Override |
| | | public void checkMemberSolution(Integer solutionId,String idCode,String memberName,Date startTime,Date endTime){ |
| | | public void checkMemberSolution(Integer solutionId,String idCode,String memberName,Date startTime,Date endTime,Integer applyId){ |
| | | List<ApplyDetail> applyDetailList = new ArrayList<ApplyDetail>(); |
| | | try { |
| | | List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectJoinList(ApplyDetail.class, |
| | | applyDetailList = applyDetailJoinMapper.selectJoinList(ApplyDetail.class, |
| | | new MPJLambdaWrapper<ApplyDetail>() |
| | | .selectAll(ApplyDetail.class) |
| | | .selectAs(InsuranceApply::getCode,ApplyDetail::getApplyCode) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .eq(ApplyDetail::getIdcardNo,idCode) |
| | | .eq(InsuranceApply::getSolutionId,solutionId) |
| | | .notIn(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD |
| | | ,Constants.InsuranceApplyStatus.PLATFORM_RETURN |
| | | ,Constants.InsuranceApplyStatus.FAIL_RETURN |
| | | ,Constants.InsuranceApplyStatus.CLOSE |
| | | ,Constants.InsuranceApplyStatus.WTB_RETURN |
| | | ,Constants.InsuranceApplyStatus.WTB_CLOSED ) |
| | | .eq(Solutions::getBaseId,solutionId) |
| | | .ne(Objects.nonNull(applyId),InsuranceApply::getId,applyId) |
| | | .notIn(InsuranceApply::getStatus |
| | | ,Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey() |
| | | ,Constants.InsuranceApplyStatus.FAIL_RETURN.getKey() |
| | | ,Constants.InsuranceApplyStatus.CLOSE.getKey() |
| | | ,Constants.InsuranceApplyStatus.WTB_RETURN.getKey() |
| | | ,Constants.InsuranceApplyStatus.WTB_CLOSED.getKey() ) |
| | | .apply(" ( " + |
| | | " '"+DateUtil.getPlusTime(startTime)+"' <= t.start_time AND t.start_time < '"+DateUtil.getPlusTime(endTime)+"' " + |
| | | " or " + |
| | |
| | | " or " + |
| | | " ( '"+DateUtil.getPlusTime(startTime)+"' > t.start_time AND '"+DateUtil.getPlusTime(endTime)+"' < t.end_time )" + |
| | | " ) " )); |
| | | if(applyDetailList.size() >Constants.ZERO){ |
| | | ApplyDetail applyDetail = applyDetailList.get(Constants.ZERO); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"该用户【"+memberName+" "+idCode+"】在保单【"+applyDetail.getApplyCode()+"】下已存在与本次提报冲突的日期"); |
| | | }; |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | if(applyDetailList.size() >Constants.ZERO){ |
| | | ApplyDetail applyDetail = applyDetailList.get(Constants.ZERO); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"该员工【"+memberName+" "+idCode+"】在该保险方案下已存在投保记录,无法进行该操作"); |
| | | }; |
| | | } |
| | | |
| | | public static void checkStaticMemberSolution(Integer solutionId,String idCode,String memberName,Date startTime,Date endTime,ApplyDetailJoinMapper applyDetailJoinMapper){ |
| | | public static void checkStaticMemberSolution(Integer solutionId,String idCode,String memberName,Date startTime, |
| | | Date endTime,ApplyDetailJoinMapper applyDetailJoinMapper){ |
| | | List<ApplyDetail> applyDetailList = new ArrayList<ApplyDetail>(); |
| | | try { |
| | | List<ApplyDetail> applyDetailList = applyDetailJoinMapper.selectJoinList(ApplyDetail.class, |
| | | applyDetailList = applyDetailJoinMapper.selectJoinList(ApplyDetail.class, |
| | | new MPJLambdaWrapper<ApplyDetail>() |
| | | .selectAll(ApplyDetail.class) |
| | | .selectAs(InsuranceApply::getCode,ApplyDetail::getApplyCode) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyDetail::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .eq(ApplyDetail::getIdcardNo,idCode) |
| | | .eq(InsuranceApply::getSolutionId,solutionId) |
| | | .notIn(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD |
| | | ,Constants.InsuranceApplyStatus.PLATFORM_RETURN |
| | | ,Constants.InsuranceApplyStatus.FAIL_RETURN |
| | | ,Constants.InsuranceApplyStatus.CLOSE |
| | | ,Constants.InsuranceApplyStatus.WTB_RETURN |
| | | ,Constants.InsuranceApplyStatus.WTB_CLOSED ) |
| | | .eq(Solutions::getBaseId,solutionId) |
| | | .notIn(InsuranceApply::getStatus |
| | | ,Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey() |
| | | ,Constants.InsuranceApplyStatus.FAIL_RETURN.getKey() |
| | | ,Constants.InsuranceApplyStatus.CLOSE.getKey() |
| | | ,Constants.InsuranceApplyStatus.WTB_RETURN.getKey() |
| | | ,Constants.InsuranceApplyStatus.WTB_CLOSED.getKey() ) |
| | | .apply(" ( " + |
| | | " '"+DateUtil.getPlusTime(startTime)+"' <= t.start_time AND t.start_time < '"+DateUtil.getPlusTime(endTime)+"' " + |
| | | " or " + |
| | |
| | | " or " + |
| | | " ( '"+DateUtil.getPlusTime(startTime)+"' > t.start_time AND '"+DateUtil.getPlusTime(endTime)+"' < t.end_time )" + |
| | | " ) " )); |
| | | if(applyDetailList.size() >Constants.ZERO){ |
| | | ApplyDetail applyDetail = applyDetailList.get(Constants.ZERO); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"该用户【"+memberName+" "+idCode+"】在保单【"+applyDetail.getApplyCode()+"】下已存在与本次提报冲突的日期"); |
| | | }; |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | if(applyDetailList.size() >Constants.ZERO){ |
| | | ApplyDetail applyDetail = applyDetailList.get(Constants.ZERO); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"该员工【"+memberName+" "+idCode+"】在该保险方案下已存在投保记录,无法进行该操作"); |
| | | }; |
| | | } |
| | | |
| | | @Override |
| | |
| | | BigDecimal sumAmount = BigDecimal.ZERO; |
| | | List<ApplyDetail> applyDetailList = applyDetailMapper |
| | | .selectList(new QueryWrapper<ApplyDetail>().lambda() |
| | | .eq(ApplyDetail::getChangeStatus,Constants.ZERO) |
| | | .ne(ApplyDetail::getChangeStatus,Constants.TWO) |
| | | .eq(ApplyDetail::getApplyId,insuranceApply.getId())); |
| | | if(CollectionUtils.isNotEmpty(applyDetailList)){ |
| | | for (ApplyDetail applyDetail: applyDetailList) { |
| | |
| | | applyDetail.setCurrentFee(applyDetail.getFee()); |
| | | applyDetailMapper.updateById(applyDetail); |
| | | } |
| | | sumAmount = sumAmount.add(applyDetail.getCurrentFee()); |
| | | if(Constants.equalsInteger(applyDetail.getChangeStatus(),Constants.ZERO) || applyDetail.getEndTime().getTime()>System.currentTimeMillis()){ |
| | | sumAmount = sumAmount.add(applyDetail.getCurrentFee()); |
| | | } |
| | | } |
| | | } |
| | | insuranceApply.setCurrentFee(sumAmount); |
| | | insuranceApplyMapper.updateById(insuranceApply); |
| | | } |
| | | } |
| | | // if(1==1){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | " and ad.END_TIME >= '"+DateUtil.DateToStr(memberQueryDTO.getValidTime(),"yyyy-MM-dd HH:mm:ss.SSS")+"' and ad.START_TIME <= '"+DateUtil.DateToStr(memberQueryDTO.getValidTime(),"yyyy-MM-dd HH:mm:ss.SSS")+"' and ad.isdeleted = 0 " + |
| | | " and ad.member_id = t.id ") ; |
| | | if(!Objects.isNull(memberQueryDTO.getInsuranceApplyId())){ |
| | | if(Objects.isNull(memberQueryDTO.getValidTime())){ |
| | | memberQueryDTO.setValidTime(new Date()); |
| | | } |
| | | lambdaWrapper = new MPJLambdaWrapper<Member>() |
| | | .select(Member::getId,Member::getName,Member::getIdcardNo) |
| | | .selectAs(Worktype::getId,Member::getWorktypeId) |
| | |
| | | .in(CollectionUtils.isNotEmpty(memberQueryDTO.getSubtractMemberIds()),Member::getId,memberQueryDTO.getSubtractMemberIds()) |
| | | .exists(!Objects.isNull(memberQueryDTO.getInsuranceApplyId())&&!Objects.isNull(memberQueryDTO.getValidTime()), |
| | | " select 1 from apply_detail ad where ad.apply_id = "+memberQueryDTO.getInsuranceApplyId()+"" + |
| | | " and ad.END_TIME >= '"+DateUtil.DateToStr(memberQueryDTO.getValidTime(),"yyyy-MM-dd HH:mm:ss.SSS")+"' and ad.START_TIME <= '"+DateUtil.DateToStr(memberQueryDTO.getValidTime(),"yyyy-MM-dd HH:mm:ss.SSS")+"' and ad.isdeleted = 0 " + |
| | | " and ad.END_TIME >= '"+DateUtil.DateToStr(memberQueryDTO.getValidTime(),"yyyy-MM-dd HH:mm:ss.SSS")+"'" + |
| | | // " and ad.START_TIME <= '"+DateUtil.DateToStr(memberQueryDTO.getValidTime(),"yyyy-MM-dd HH:mm:ss.SSS")+"'" + |
| | | " and ad.isdeleted = 0 " + |
| | | " and ad.member_id = t.id "); |
| | | } |
| | | List<Member> memberList = memberJoinMapper.selectJoinList(Member.class,lambdaWrapper); |
| | |
| | | List<DispatchUnit> dispatchUnitList = dispatchUnitJoinMapper.selectJoinList(DispatchUnit.class, |
| | | new MPJLambdaWrapper<DispatchUnit>() |
| | | .selectAll(DispatchUnit.class) |
| | | .select("(select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.solution_id="+solutionId+" limit 1) as du_solution_id" ) |
| | | // .select("(select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.solution_id="+solutionId+" limit 1) as du_solution_id" ) |
| | | .select("(select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.solution_id="+solutionId+" order by b.CHECK_DATE desc limit 1) as du_solution_id" ) |
| | | .eq(DispatchUnit::getIsdeleted,Constants.ZERO) |
| | | .eq(DispatchUnit::getStatus,Constants.ZERO) |
| | | .eq(DispatchUnit::getDataType,Constants.TWO) |
| | |
| | | DispatchUnit dispatchUnit = dispatchUnitOptional.get(); |
| | | model.setDuId(dispatchUnit.getId()); |
| | | if(StringUtils.isNotBlank(model.getWorkTypeName())&&CollectionUtils.isNotEmpty(dispatchUnit.getWorktypeList())){ |
| | | Optional<Worktype> worktypeOptional= dispatchUnit.getWorktypeList().stream().filter(m->m.getName().equals(model.getWorkTypeName())).findFirst(); |
| | | Optional<Worktype> worktypeOptional= dispatchUnit.getWorktypeList().stream().filter(m->m.getName().replaceAll(" ","").equals(model.getWorkTypeName().replaceAll(" ",""))).findFirst(); |
| | | if(worktypeOptional.isPresent()){ |
| | | Worktype worktype = worktypeOptional.get(); |
| | | model.setWorktypeId(worktype.getId()); |
| | |
| | | new MPJLambdaWrapper<UnionApply>() |
| | | .selectAll(UnionApply.class) |
| | | .selectAs(Solutions::getName,UnionApply::getSolutionName) |
| | | .selectAs(Solutions::getDelOnlyReplace,UnionApply::getDelOnlyReplace) |
| | | .selectAs(Company::getName,UnionApply::getCompanyName) |
| | | .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.UNION_APPLY_ID = t.id ) as insureNum") |
| | | .select(" ( select count(DISTINCT(b.MEMBER_ID)) from apply_detail b inner join insurance_apply a on b.apply_id = a.id and a.status in ( 5 , 27 ) where b.union_apply_id=t.id and b.END_TIME > now() ) as guaranteeNum") |
| | |
| | | BigDecimal fee = BigDecimal.ZERO; |
| | | for (ApplyDetail applyDetail:applyDetailList) { |
| | | //查询人员信息是否存在相同的方案下是否存在 冲突数据 |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getId(), |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getBaseId(), |
| | | applyDetail.getIdcardNo(),applyDetail.getMemberName(),unionApply.getStartTime(),unionApply.getEndTime(), |
| | | applyDetailJoinMapper); |
| | | |
| | |
| | | .filter(m->Constants.equalsInteger(m.getApplyId(),(insuranceApply.getId()))).collect(Collectors.toList())) { |
| | | |
| | | //查询人员信息是否存在相同的方案下是否存在 冲突数据 |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getId(), |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getBaseId(), |
| | | applyDetail.getIdcardNo(),applyDetail.getMemberName(),unionApply.getStartTime(),unionApply.getEndTime(), |
| | | applyDetailJoinMapper); |
| | | |
| | |
| | | applyDetail.setFee(price.multiply(new BigDecimal(maxDays)).add(serverCost)); |
| | | applyDetail.setStartTime(unionApplyBXDDTO.getStartTime()); |
| | | applyDetail.setEndTime(unionApplyBXDDTO.getEndTime()); |
| | | |
| | | |
| | | |
| | | |
| | | MemberInsurance memberInsurance = new MemberInsurance(applyDetail,user.getId()); |
| | | memberInsurance.setBdCode(unionApplyBXDDTO.getCode()); |
| | | memberInsurance.setRelationType(Constants.ZERO); |
| | |
| | | .selectAs(UnionApply::getCode,UnionChange::getApplyCode) |
| | | .selectAs(Solutions::getName,UnionChange::getSolutionsName) |
| | | .selectAs(UnionApply::getStartTime,UnionChange::getStartTime) |
| | | .selectAs(UnionApply::getEndTime,UnionChange::getEndTime) |
| | | .selectAs(UnionApply::getEndTime,UnionChange::getEndTime) |
| | | .selectAs(Solutions::getDelOnlyReplace,UnionChange::getDelOnlyReplace) |
| | | .selectAs(Company::getName,UnionChange::getShopName) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.UNION_CHANGE_ID and ad.TYPE = 0 )",UnionChange::getAddNum) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.UNION_CHANGE_ID and ad.TYPE = 1 )",UnionChange::getDelNum) |
| | |
| | | ,unionChange.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(unionChange)); |
| | | applyLogMapper.insert(log); |
| | | |
| | | if(true){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | public void addChangeDetailData(ApplyChange applyChange, ApplyChagneDetail detail,InsuranceApply insuranceApply,Solutions solutions |
| | | , BigDecimalVO bigDecimalVO,List<ApplyChagneDetail> reduceList,Integer i){ |
| | | //查询人员信息是否存在相同的方案下是否存在 冲突数据 |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getId(), |
| | | InsuranceApplyServiceImpl.checkStaticMemberSolution(solutions.getBaseId(), |
| | | detail.getIdcardNo(),detail.getMemberName(),DateUtil.getMontageDate(applyChange.getApplyStartTime(),1),DateUtil.getMontageDate(detail.getEndTime(),2), |
| | | applyDetailJoinMapper); |
| | | |