| | |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import io.swagger.models.auth.In; |
| | | import jdk.internal.jline.internal.Log; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | } |
| | | applyDetail.setIdcardNo(member.getIdcardNo()); |
| | | applyDetail.setSex(member.getSex()); |
| | | applyDetail.setFee(this.countDetailFee(solutions,insuranceApply.getApplyEndTime(),insuranceApply.getApplyStartTime())); |
| | | applyDetail.setFee(Constants.countDetailFee(solutions,insuranceApply.getApplyEndTime(),insuranceApply.getApplyStartTime())); |
| | | //验证派遣单位信息是否存在 |
| | | 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()+"】员工派遣单位未查询到!"); |
| | |
| | | |
| | | |
| | | |
| | | public BigDecimal countDetailFee(Solutions solutions ,Date startDate,Date endDate){ |
| | | //查询保险实际周期 |
| | | Integer cycle = DateUtil.calculateBetween(endDate,startDate,solutions.getDataType()); |
| | | if(cycle==-1){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"日期信息错误!"); |
| | | } |
| | | return solutions.getPrice().multiply(new BigDecimal(cycle)); |
| | | } |
| | | // public BigDecimal countDetailFee(Solutions solutions ,Date startDate,Date endDate){ |
| | | // //查询保险实际周期 |
| | | // Integer cycle = DateUtil.calculateBetween(endDate,startDate,solutions.getDataType()); |
| | | // if(cycle==-1){ |
| | | // throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"日期信息错误!"); |
| | | // } |
| | | // return solutions.getPrice().multiply(new BigDecimal(cycle)); |
| | | // } |
| | | |
| | | // public static void main(String[] args) { |
| | | // Date date1 = DateUtil.StringToDate("2023-03-01 00:00:00"); |
| | |
| | | insuranceApply.setInsureNum(applyDetailMapper.selectCount(new QueryWrapper<ApplyDetail>().lambda().eq(ApplyDetail::getApplyId,insuranceApply.getId()) |
| | | .eq(ApplyDetail::getIsdeleted,Constants.ZERO))); |
| | | |
| | | //设置在保时长(天数) |
| | | if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){ |
| | | //如果当前时间大于结束日期 则使用结束日期对比开始日期 |
| | | if(DateUtil.compareDate(new Date(),insuranceApply.getEndTime())>=Constants.ZERO){ |
| | | insuranceApply.setServiceDays(DateUtil.daysBetweenDates(insuranceApply.getEndTime(),insuranceApply.getStartTime())); |
| | | }else if(DateUtil.compareDate(insuranceApply.getStartTime(),new Date())>=Constants.ZERO){ |
| | | //未开始 |
| | | insuranceApply.setServiceDays(Constants.ZERO); |
| | | }else{ |
| | | insuranceApply.setServiceDays(DateUtil.daysBetweenDates(new Date(),insuranceApply.getStartTime())); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | //查询操作记录 |
| | | List<ApplyLog> applyLogList = applyLogJoinMapper.selectJoinList(ApplyLog.class, |
| | | new MPJLambdaWrapper<ApplyLog>() |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void applyReturn(InsuranceApplyOptDTO insuranceApplyOptDTO){ |
| | | public void applyOpt(InsuranceApplyOptDTO insuranceApplyOptDTO){ |
| | | if(Objects.isNull(insuranceApplyOptDTO) |
| | | ||Objects.isNull(insuranceApplyOptDTO.getApplyId()) |
| | | ||StringUtils.isBlank(insuranceApplyOptDTO.getOptIllustration())){ |
| | |
| | | if(insuranceApply.getIsdeleted().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"数据已删除,无法进行该操作"); |
| | | } |
| | | if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"退回申请中,请勿重复操作"); |
| | | Constants.InsuranceApplyStatus insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN; |
| | | if(insuranceApplyOptDTO.getOptType().equals(Constants.ONE)){ |
| | | if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"退回申请中,请勿重复操作"); |
| | | } |
| | | if(!(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态非可申请退回!"); |
| | | } |
| | | }else if(insuranceApplyOptDTO.getOptType().equals(Constants.TWO)){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.CLOSE; |
| | | if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.CLOSE.getKey())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"已关闭,请勿重复操作"); |
| | | } |
| | | if(!(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.PLATFORM_AGREE.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.PLATFORM_RETURN.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态非可申请退回!"); |
| | | } |
| | | } |
| | | if(!(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态非可申请退回!"); |
| | | } |
| | | Constants.InsuranceApplyStatus insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_APPLY_RETURN; |
| | | insuranceApply.setStatus(insuranceApplyStatus.getKey()); |
| | | insuranceApply.setCheckDate(new Date()); |
| | | insuranceApply.setCheckInfo(insuranceApplyOptDTO.getOptIllustration()); |
| | |
| | | insuranceApplyMapper.updateById(insuranceApply); |
| | | //存储日志数据 |
| | | this.saveApplyLog(insuranceApply,insuranceApplyStatus,null); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |