| | |
| | | |
| | | import java.io.File; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | // applyLogMapper.insert(log); |
| | | // |
| | | // startSendEmail(f, model.getCompanyName(),model.getSolutionsName(),model.getSolutionEmail()); |
| | | |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.IA_HBD_SIGNATURE_TBD; |
| | | ApplyLog log = new ApplyLog(model,applyLogType.getName(), null |
| | | ,model.getId(),applyLogType.getKey(),null, JSONObject.toJSONString(model)); |
| | | applyLogMapper.insert(log); |
| | | |
| | | return f; |
| | | } |
| | | |
| | |
| | | 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()+"】员工派遣单位未查询到!"); |
| | |
| | | .selectAs(Solutions::getTimeUnit,InsuranceApply::getTimeUnit) |
| | | .selectAs(Solutions::getType,InsuranceApply::getSolutionType) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Solutions::getName,InsuranceApply::getShopName) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .select(" ( select max(ac.APPLY_START_TIME) from apply_change ac where ac.apply_id = t.id and ac.status = 2 ) as lastChangeDate") |
| | | .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.apply_id = t.id ) as insureNum") |
| | | .select(" t3.name as shopName") |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .leftJoin(Company.class,Company::getId,Solutions::getShopId) |
| | |
| | | |
| | | |
| | | /** |
| | | * 企业保障中人数 |
| | | * @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 |