| | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public OrderConsultOne createOrderConsultOne(CreateOrderConsultOneRequest req) { |
| | | // 生成了订单但未支付 |
| | | OrderConsultOne oo = orderConsultOneService.getOne( |
| | | Wrappers.<OrderConsultOne>lambdaQuery() |
| | | .eq(OrderConsultOne::getUserId, req.getUserId()) |
| | | .eq(OrderConsultOne::getMentalTestRecordId, req.getMentalTestRecordId()) |
| | | .eq(OrderConsultOne::getStatusFlag, OrderStatusFlagEnum.WAIT_PAY.getCode()) |
| | | .eq(OrderConsultOne::getIsDelete, YesOrNotEnum.N.getCode()) |
| | | .last("LIMIT 1") |
| | | ); |
| | | if (oo != null) { |
| | | // 可以提示用户 |
| | | return oo; |
| | | } |
| | | |
| | | // 心理测试记录 |
| | | MentalTestRecord mentalTestRecord = mentalTestRecordService.getById(req.getMentalTestRecordId()); |
| | | Assert.notNull(mentalTestRecord, "心理测试记录不存在"); |
| | |
| | | } |
| | | |
| | | // 保存1v1性格分析预约,并推送消息给工作人员 |
| | | MentalAppointment mentalAppointment = saveMentalAppointmentPushMessage(o.getStatusFlag(), o); |
| | | MentalAppointment mentalAppointment = saveMentalAppointmentPushMessage(o.getStatusFlag(), o, req.getRealName(), req.getLinkPhone()); |
| | | if (mentalAppointment == null) { |
| | | throw new BusinessException(DefaultBusinessExceptionEnum.MENTAL_APPOINTMENT_NO_WORKER_ERROR); |
| | | } |
| | |
| | | * @param o |
| | | * @return |
| | | */ |
| | | public MentalAppointment saveMentalAppointmentPushMessage(Integer orderConsultOneStatusFlag, OrderConsultOne o) { |
| | | public MentalAppointment saveMentalAppointmentPushMessage(Integer orderConsultOneStatusFlag, OrderConsultOne o, String realName, String linkPhone) { |
| | | // 性格分析预约 |
| | | MentalAppointment mentalAppointment = MentalAppointment.builder() |
| | | .userId(o.getUserId()) |
| | |
| | | .build(); |
| | | |
| | | // 用户信息 |
| | | CustomerInfo customerInfo = customerService.getCustomerInfoById(o.getUserId()); |
| | | mentalAppointment.setUserName(customerInfo.getRealName()); |
| | | mentalAppointment.setPhone(customerInfo.getLinkPhone()); |
| | | //CustomerInfo customerInfo = customerService.getCustomerInfoById(o.getUserId()); |
| | | mentalAppointment.setUserName(realName); |
| | | mentalAppointment.setPhone(linkPhone); |
| | | |
| | | // 分配性格分析师 |
| | | Long consultWorkerId = mentalAppointmentService.assignMentalAppointmentWorkerId(o.getAppointmentDay(), o.getBeginTimePoint(), o.getEndTimePoint()); |