| | |
| | | |
| | | import java.io.File; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | applyLogMapper.insert(log); |
| | | |
| | | |
| | | |
| | | //发送待办业务 |
| | | |
| | | //存储待办信息 |
| | | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.INSURANCE_APPLY; |
| | | //删除其他待办 |
| | |
| | | applyDetail.setSex(member.getSex()); |
| | | applyDetail.setFee(countCyclePriceVO.getCyclePrice()); |
| | | applyDetail.setCurrentFee(BigDecimal.ZERO); |
| | | //获取计算总天数 |
| | | Integer maxDays = DateUtil.calculateBetween(applyDetail.getStartTime(),applyDetail.getEndTime(),0); |
| | | if(Constants.equalsInteger(maxDays,0)||Objects.isNull(applyDetail.getFee())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"投保信息异常:总天数与总金额错误"); |
| | | } |
| | | applyDetail.setPrice( |
| | | applyDetail.getFee().divide(new BigDecimal(maxDays),2,RoundingMode.HALF_UP) |
| | | ); |
| | | //验证派遣单位信息是否存在 |
| | | if(duSolutionList.stream().filter(d->d.getDispatchUnitId().equals(applyDetail.getDuId())).collect(Collectors.toList()).size()<=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"【"+applyDetail.getMemberName()+"】员工派遣单位未查询到!"); |
| | |
| | | |
| | | |
| | | /** |
| | | * 企业保障中人数 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Integer guaranteeNum() { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业端用户无法进行该操作"); |
| | | } |
| | | MPJLambdaWrapper<ApplyDetail> lambdaWrapper = new MPJLambdaWrapper<ApplyDetail>(); |
| | | lambdaWrapper.selectAll(Member.class) |
| | | .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 "); |
| | | |
| | | Integer count = applyDetailJoinMapper.selectJoinCount(lambdaWrapper); |
| | | return count; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 更新保单实际金额 |
| | | */ |
| | | @Override |