| | |
| | | |
| | | //用户操作时,对应个别时间为0 |
| | | if(dto.getOpType() == OperatorConstants.OP_TYPE_USER){ |
| | | mzTime = 0; |
| | | // mzTime = 0; |
| | | gtTime = 0; |
| | | sqTime = 0; |
| | | waitDuration = 0; |
| | |
| | | //为空,表示当天已经没有时间段可以预约 |
| | | if(aVo == null && upOrDown != 0) |
| | | { |
| | | if (aVoList.size() < 2 && handleNum == 1 && deductHandle) { |
| | | if (aVoList.size() < dto.getMateNum() && handleNum == 1 && deductHandle) { |
| | | //第二轮(治疗开始时间+10分钟) |
| | | handleNum = 2; |
| | | mateData = AppAutoMateHandleUtil.handleTime(commonService, shopWorkTimeVo, activityDay, projectIdsArr, doctorTimeList, shopTimeList |
| | | , doctorId, dto.getShopId(), handleNum, canAppList); |
| | | timeMap = mateData.getTimeMap(); |
| | | } else if (aVoList.size() < 2 && handleNum == 2 && deductHandle) { |
| | | } else if (aVoList.size() < dto.getMateNum() && handleNum == 2 && deductHandle) { |
| | | //第三轮(治疗结束时间-10分钟) |
| | | handleNum = 3; |
| | | mateData = AppAutoMateHandleUtil.handleTime(commonService, shopWorkTimeVo, activityDay, projectIdsArr, doctorTimeList, shopTimeList |
| | |
| | | timeMap = mateData.getTimeMap(); |
| | | } |
| | | //如果是处理到:向上处理+没满足2个+(第三轮后 或 非扣减处理),则跑向下处理(+等待时间) |
| | | else if(upOrDown == 2 && aVoList.size() < 2 && (handleNum == 3 || !deductHandle)) { |
| | | else if(upOrDown == 2 && aVoList.size() < dto.getMateNum() && (handleNum == 3 || !deductHandle)) { |
| | | //修改向上匹配时间 |
| | | upOrDown = 1; |
| | | handleNum = 1; |
| | |
| | | } |
| | | |
| | | //如果检查返回有不符合的条件 |
| | | if(upOrDown == 1 && aVoList.size() < 2){ |
| | | if(upOrDown == 1 && aVoList.size() < dto.getMateNum()){ |
| | | //向下 |
| | | //已面诊开始时间为开头加5分钟重新判断 |
| | | cs.setTime(aVo.getMzStartTime()); |
| | |
| | | } |
| | | // else if(upOrDown == 2 && aVoList.size() == 1){ |
| | | // break; |
| | | else if(upOrDown == 2 && aVoList.size() < 2){ |
| | | else if(upOrDown == 2 && aVoList.size() < dto.getMateNum()){ |
| | | //向上 |
| | | //已初始向上开始时间为开头减5分钟重新判断 |
| | | cs.setTime(aVo.getMzStartTime()); |
| | |
| | | }else{ |
| | | json.put("errMsg", deviceErr); |
| | | } |
| | | |
| | | logger.info("预约匹配返回结果:{}", json.toString()); |
| | | return Result.success(json); |
| | | } |
| | | |