package cn.stylefeng.guns.modular.business.service.impl;
|
|
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.util.ObjUtil;
|
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.json.JSONUtil;
|
import cn.stylefeng.guns.modular.business.dto.CounsellingOrderResponseDTO;
|
import cn.stylefeng.guns.modular.business.dto.ImPushDataDTO;
|
import cn.stylefeng.guns.modular.business.dto.request.CounsellingOrderRequest;
|
import cn.stylefeng.guns.modular.business.dto.request.CreateCounsellingOrderRequest;
|
import cn.stylefeng.guns.modular.business.dto.request.CustomerUpdateRequest;
|
import cn.stylefeng.guns.modular.business.dto.request.OrderPayRequest;
|
import cn.stylefeng.guns.modular.business.entity.*;
|
import cn.stylefeng.guns.modular.business.mapper.CounsellingOrderMapper;
|
import cn.stylefeng.guns.modular.business.service.*;
|
import cn.stylefeng.guns.utils.GeneralUtil;
|
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
import cn.stylefeng.roses.kernel.customer.api.pojo.CustomerInfo;
|
import cn.stylefeng.roses.kernel.customer.modular.entity.Customer;
|
import cn.stylefeng.roses.kernel.customer.modular.service.CustomerService;
|
import cn.stylefeng.roses.kernel.rule.enums.*;
|
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.text.SimpleDateFormat;
|
import java.util.Date;
|
import java.util.List;
|
|
/**
|
* <p>
|
* 咨询订单信息 服务实现类
|
* </p>
|
*
|
* @author guohongjin
|
* @since 2024-01-02
|
*/
|
@Service
|
public class CounsellingOrderServiceImpl extends ServiceImpl<CounsellingOrderMapper, CounsellingOrder> implements ICounsellingOrderService {
|
|
@Autowired
|
private CustomerService customerService;
|
|
@Autowired
|
private ICounsellingInfoService counsellingInfoService;
|
|
@Autowired
|
private ICounsellingSetMealService counsellingSetMealService;
|
|
@Autowired
|
private ICounsellingOrderReservationService counsellingOrderReservationService;
|
|
@Autowired
|
private IImGroupService iImGroupService;
|
|
@Resource
|
private ImBizService imBizService;
|
|
@Resource
|
private ICounsellingUserService counsellingUserService;
|
@Resource
|
private IAreaService areaService;
|
@Resource
|
IMentalAppointmentService mentalAppointmentService;
|
|
@Override
|
public Page<CounsellingOrderResponseDTO> findCounsellingOrderPage(Page<CounsellingOrderRequest> page, CounsellingOrderRequest counsellingOrderRequest) {
|
return this.baseMapper.findCounsellingOrderPage(page, counsellingOrderRequest);
|
}
|
|
@Override
|
public Page<CounsellingOrderResponseDTO> findWorkCounsellingOrderPage(Page<CounsellingOrderRequest> page, CounsellingOrderRequest counsellingOrderRequest) {
|
return this.baseMapper.findWorkCounsellingOrderPage(page, counsellingOrderRequest);
|
}
|
|
@Override
|
public CounsellingOrder createCounsellingOrder(CreateCounsellingOrderRequest counsellingOrderRequest) {
|
|
if (counsellingOrderRequest.getUserId() == null){
|
counsellingOrderRequest.setUserId(LoginContext.me().getLoginUser().getUserId());
|
}
|
//判断是否有用户咨询师信息
|
CounsellingUser counsellingUserOld = this.counsellingUserService.getOne(new LambdaQueryWrapper<CounsellingUser>().eq(CounsellingUser::getCounsellingInfoId,counsellingOrderRequest.getCounsellingInfoId())
|
.eq(CounsellingUser::getUserId,counsellingOrderRequest.getUserId()));
|
if(counsellingOrderRequest.getOrderType().intValue() != 1){
|
if (counsellingUserOld == null){
|
throw new ServiceException("请先购买首次咨询!");
|
} else if (counsellingUserOld != null && counsellingUserOld.getIsFirstAppointment() != null && counsellingUserOld.getIsFirstAppointment().intValue() != 3) {
|
throw new ServiceException("请先完成首次咨询,再进行疗程购买!");
|
}
|
|
}
|
//查询客户信息
|
Customer customerOld = this.customerService.getById(counsellingOrderRequest.getUserId());
|
CounsellingInfo counsellingInfo = this.counsellingInfoService.getById(counsellingOrderRequest.getCounsellingInfoId());
|
CounsellingOrder counsellingOrder = BeanUtil.copyProperties(counsellingOrderRequest,CounsellingOrder.class);
|
if (counsellingOrderRequest.getCustomerUpdateRequest() != null){
|
counsellingOrder.setPhone(counsellingOrderRequest.getCustomerUpdateRequest().getLinkPhone());
|
}
|
counsellingOrder.setOrderNo(GeneralUtil.generateOrderNo(OrderTypeEnum.COUNSELLING_ORDER));
|
//订单类型 1-首次咨询,2-咨询疗程,3-课程续费
|
if (counsellingOrderRequest.getOrderType().intValue() ==1){
|
//是否后台创建
|
if (counsellingOrderRequest.getIsBack()){
|
Customer customerUser = this.customerService.getById(counsellingOrderRequest.getUserId());
|
if (customerUser != null){
|
CustomerUpdateRequest customerUpdateRequest = BeanUtil.copyProperties(customerUser, CustomerUpdateRequest.class);
|
counsellingOrder.setUserInfoJson(JSONUtil.toJsonStr(customerUpdateRequest));
|
}
|
|
counsellingOrder.setStatusFlag(1);
|
// if (counsellingUserOld != null && counsellingUserOld.getCompanionUserId() != null){
|
// //陪护教练id
|
// counsellingOrder.setCompanionUserId(counsellingUserOld.getCompanionUserId());
|
// }else {
|
//
|
// Customer customerCompanion = customerService.randomWorkerByLineStatusAndPost(ImStatusEnum.ON_LINE.getCode(), null, PostIdEnum.PO_23.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
// if (customerCompanion != null){
|
// //陪护教练id
|
// counsellingOrder.setCompanionUserId(customerCompanion.getCustomerId());
|
//// counsellingUserOld.setCompanionUserId(customerCompanion.getCustomerId());
|
// }else{
|
// Customer customerCompanion2 = customerService.randomWorkerByLineStatusAndPost(null, null, PostIdEnum.PO_23.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
// if (customerCompanion2 != null){
|
// //陪护教练id
|
// counsellingOrder.setCompanionUserId(customerCompanion2.getCustomerId());
|
//// counsellingUserOld.setCompanionUserId(customerCompanion2.getCustomerId());
|
// }else{
|
// throw new ServiceException("没有在线的陪护教练!");
|
// }
|
//
|
// }
|
// }
|
|
|
// counsellingOrder.setPhone(customerUser.getLinkPhone());
|
counsellingOrder.setOrderAmount(counsellingInfo.getFristPrice());
|
counsellingOrder.setPayAmount(counsellingInfo.getFristPrice());
|
counsellingOrder.setCreateUser(LoginContext.me().getLoginUser().getUserId());
|
|
|
}else{
|
counsellingOrder.setStatusFlag(0);
|
CustomerUpdateRequest customerUpdateRequest = counsellingOrderRequest.getCustomerUpdateRequest();
|
if (customerUpdateRequest != null){
|
customerUpdateRequest.setCustomerId(counsellingOrderRequest.getUserId());
|
Customer customer = BeanUtil.toBean(customerUpdateRequest, Customer.class);
|
customer.setCustomerId(counsellingOrderRequest.getUserId());
|
// 修改用户信息
|
Boolean update = customerService.updateCustomerRemoveCache(customer);
|
counsellingOrder.setUserInfoJson(JSONUtil.toJsonStr(customerUpdateRequest));
|
}
|
// Date firstAppointmentDate = counsellingOrderRequest.getFirstAppointmentDate();
|
//// 创建一个 SimpleDateFormat 实例,指定日期格式为 "yyyy-MM-dd"
|
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
//
|
//// 使用 formatter 将 Date 对象转换为字符串
|
// String formattedDate = formatter.format(firstAppointmentDate);
|
// // 发送IM消息
|
// ImPushDataDTO pushData1 = ImPushDataDTO.builder()
|
// .type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getCode())
|
// .title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getName())
|
// .content("预约成功"+",请注意预约时间:"+formattedDate+counsellingOrderRequest.getFirstAppointmentTimes())
|
//// .content("预约成功!")
|
// .objId(ObjUtil.toString(counsellingInfo.getId()))
|
// .data1(ObjUtil.toString(counsellingOrder.getUserId()))
|
// .data2(ObjUtil.toString(counsellingInfo.getUserId()))
|
// .build();
|
// imBizService.messageSendPrivate(
|
// ObjUtil.toString(counsellingOrder.getUserId()),
|
// new String[]{ObjUtil.toString(counsellingInfo.getUserId())},
|
// pushData1
|
//
|
//
|
// );
|
|
// //将此条消息加入到可聊天的表中t_mental_appointment
|
// MentalAppointment mentalAppointment = MentalAppointment.builder()
|
// .userId(counsellingOrder.getUserId())
|
// .appointmentDay(counsellingOrderRequest.getFirstAppointmentDate())
|
// .beginTimePoint(counsellingOrderRequest.getFirstAppointmentTimes().split("-")[0])
|
// .endTimePoint(counsellingOrderRequest.getFirstAppointmentTimes().split("-")[1])
|
// .workerId(counsellingInfo.getUserId())
|
// .build();
|
// // 用户信息
|
// CustomerInfo customerInfo = customerService.getCustomerInfoById(counsellingOrder.getUserId());
|
// mentalAppointment.setUserName(customerInfo.getRealName());
|
// mentalAppointment.setPhone(customerInfo.getLinkPhone());
|
// mentalAppointmentService.save(mentalAppointment);
|
|
}
|
if (counsellingUserOld != null && counsellingUserOld.getConsultantUserId() != null){
|
counsellingOrder.setConsultantUserId(counsellingUserOld.getConsultantUserId());
|
}else{
|
if (customerOld.getConsultWorkerId() != null){
|
counsellingOrder.setConsultantUserId(customerOld.getConsultWorkerId());
|
}else{
|
Customer customer2 = customerService.randomWorkerByLineStatusAndPost(ImStatusEnum.ON_LINE.getCode(), null, PostIdEnum.PO_21.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customer2 != null){
|
//咨询顾问id
|
counsellingOrder.setConsultantUserId(customer2.getCustomerId());
|
// counsellingUserOld.setConsultantUserId(customer2.getCustomerId());
|
}else {
|
Customer customer3 = customerService.randomWorkerByLineStatusAndPost(null, null, PostIdEnum.PO_21.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customer3 != null){
|
//咨询顾问id
|
counsellingOrder.setConsultantUserId(customer3.getCustomerId());
|
// counsellingUserOld.setConsultantUserId(customer3.getCustomerId());
|
}else{
|
throw new ServiceException("没有在线的咨询顾问!");
|
}
|
}
|
}
|
|
}
|
// iImGroupService.createGroup(2,null,null,counsellingInfo.getUserId(),null,null,counsellingOrder.getUserId(),counsellingOrder.getCounsellingInfoId());
|
|
|
|
|
|
|
// // 推送消息内容
|
// String pushContent = "你有新的预约,请注意查收。预约用户:"+customerOld.getNickName();
|
//// +"预约时间:"+counsellingOrder.getEffectiveEndTime()+"~"+counsellingOrder.getEffectiveEndTime();
|
// // IM推送数据json
|
// ImPushDataDTO pushData = ImPushDataDTO.builder()
|
// .type(ImPushTypeEnum.S_TO_W_TIP_CONSULT_PAY_GROUP_SUCCESS_ONLY.getCode())
|
// .objId(ObjUtil.toString(counsellingInfo.getUserId()))
|
// .title("通知")
|
// .content(pushContent)
|
//// .extra("去查看。")
|
// .build();
|
// // 发送预约提示
|
// imBizService.messageSendSystem(counsellingOrder.getUserId()+"", new String[]{counsellingInfo.getUserId()+""}, pushData, ImUserTypeEnum.WORKER, PostIdEnum.PO_22, true);
|
}else if (counsellingOrderRequest.getOrderType().intValue() ==2){
|
//获取下单人个人信息
|
Customer customerUser = this.customerService.getById(counsellingOrderRequest.getUserId());
|
if (customerUser != null){
|
CustomerUpdateRequest customerUpdateRequest = BeanUtil.copyProperties(customerUser, CustomerUpdateRequest.class);
|
if (StrUtil.isNotBlank(customerUser.getCityCode())) {
|
customerUpdateRequest.setCityCodeStr(areaService.getNameByCodeAddPrefix("/", customerUpdateRequest.getCityCode()));
|
}
|
counsellingOrder.setUserInfoJson(JSONUtil.toJsonStr(customerUpdateRequest));
|
}
|
//跟进套餐设置订单信息
|
CounsellingSetMeal counsellingSetMeal = this.counsellingSetMealService.getById(counsellingOrderRequest.getCounsellingSetMealId());
|
if (counsellingSetMeal != null){
|
counsellingOrder.setCounsellingSetMealId(counsellingSetMeal.getId());
|
counsellingOrder.setSetMealJson(JSONUtil.toJsonStr(counsellingSetMeal));
|
counsellingOrder.setPayAmount(counsellingSetMeal.getPrice());
|
counsellingOrder.setOrderAmount(counsellingSetMeal.getOriginalPrice());
|
counsellingOrder.setClassHours(counsellingSetMeal.getClassHours());
|
counsellingOrder.setResidueClassHours(counsellingSetMeal.getClassHours());
|
|
}else {
|
throw new ServiceException("咨询套餐不存在!");
|
}
|
counsellingOrder.setPhone(customerUser.getTelephone());
|
if (counsellingUserOld != null && counsellingUserOld.getConsultantUserId() != null){
|
counsellingOrder.setConsultantUserId(counsellingUserOld.getConsultantUserId());
|
}else{
|
if (counsellingUserOld != null && counsellingUserOld.getConsultantUserId() != null){
|
counsellingOrder.setConsultantUserId(counsellingUserOld.getConsultantUserId());
|
}else {
|
if (customerOld.getConsultWorkerId() != null) {
|
counsellingOrder.setConsultantUserId(customerOld.getConsultWorkerId());
|
} else {
|
Customer customer2 = customerService.randomWorkerByLineStatusAndPost(ImStatusEnum.ON_LINE.getCode(), null, PostIdEnum.PO_21.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customer2 != null) {
|
//咨询顾问id
|
counsellingOrder.setConsultantUserId(customer2.getCustomerId());
|
// counsellingUserOld.setConsultantUserId(customer2.getCustomerId());
|
} else {
|
Customer customer3 = customerService.randomWorkerByLineStatusAndPost(null, null, PostIdEnum.PO_21.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customer3 != null) {
|
//咨询顾问id
|
counsellingOrder.setConsultantUserId(customer3.getCustomerId());
|
// counsellingUserOld.setConsultantUserId(customer3.getCustomerId());
|
} else {
|
throw new ServiceException("没有在线的咨询顾问!");
|
}
|
}
|
}
|
}
|
}
|
//是否赠送陪护
|
if (counsellingSetMeal.getIsGive() != null && counsellingSetMeal.getIsGive().intValue() == 1){
|
if (counsellingUserOld != null && counsellingUserOld.getCompanionUserId() != null){
|
//陪护教练id
|
counsellingOrder.setCompanionUserId(counsellingUserOld.getCompanionUserId());
|
}else {
|
|
Customer customerCompanion = customerService.randomWorkerByLineStatusAndPost(ImStatusEnum.ON_LINE.getCode(), null, PostIdEnum.PO_23.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customerCompanion != null){
|
//陪护教练id
|
counsellingOrder.setCompanionUserId(customerCompanion.getCustomerId());
|
counsellingUserOld.setCompanionUserId(customerCompanion.getCustomerId());
|
}else{
|
Customer customerCompanion2 = customerService.randomWorkerByLineStatusAndPost(null, null, PostIdEnum.PO_23.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customerCompanion2 != null){
|
//陪护教练id
|
counsellingOrder.setCompanionUserId(customerCompanion2.getCustomerId());
|
counsellingUserOld.setCompanionUserId(customerCompanion2.getCustomerId());
|
}else{
|
throw new ServiceException("没有在线的陪护教练!");
|
}
|
|
}
|
}
|
|
}
|
//是否后台创建
|
if (counsellingOrderRequest.getIsBack()){
|
|
counsellingOrder.setStatusFlag(1);
|
counsellingOrder.setEffectiveBeginTime(new Date());
|
counsellingOrder.setEffectiveEndTime(DateUtil.endOfDay(DateUtil.offsetDay(counsellingOrder.getEffectiveBeginTime(),counsellingSetMeal.getPeriodValidityDay())));
|
counsellingOrder.setCreateUser(LoginContext.me().getLoginUser().getUserId());
|
//查询是否已经存在群聊
|
//查询是否已经存在群聊
|
// long imCount = this.iImGroupService.count(new LambdaQueryWrapper<ImGroup>().eq(ImGroup::getOrderId,counsellingOrder.getCounsellingInfoId())
|
// .eq(ImGroup::getGroupType,2).eq(ImGroup::getCreateUser,counsellingOrder.getUserId()).eq(ImGroup::getIsDelete,0));
|
// if ( imCount ==0l ){
|
if (counsellingSetMeal.getIsGive() != null && counsellingSetMeal.getIsGive().intValue() == 1){
|
//生成群聊
|
iImGroupService.createGroup(2,counsellingOrder.getConsultantUserId(),counsellingOrder.getCompanionUserId(),counsellingInfo.getUserId(),null,null,counsellingOrder.getUserId(),counsellingOrder.getCounsellingInfoId());
|
|
}else{
|
//生成群聊
|
iImGroupService.createGroup(2,null,null,counsellingInfo.getUserId(),null,null,counsellingOrder.getUserId(),counsellingOrder.getCounsellingInfoId());
|
|
}
|
|
// }
|
|
}else {
|
counsellingOrder.setStatusFlag(0);
|
|
}
|
} else if (counsellingOrderRequest.getOrderType().intValue() ==3) {
|
//获取下单人个人信息
|
Customer customerUser = this.customerService.getById(counsellingOrderRequest.getUserId());
|
if (customerUser != null){
|
CustomerUpdateRequest customerUpdateRequest = BeanUtil.copyProperties(customerUser, CustomerUpdateRequest.class);
|
if (StrUtil.isNotBlank(customerUser.getCityCode())) {
|
customerUpdateRequest.setCityCodeStr(areaService.getNameByCodeAddPrefix("/", customerUpdateRequest.getCityCode()));
|
}
|
counsellingOrder.setUserInfoJson(JSONUtil.toJsonStr(customerUpdateRequest));
|
}
|
//跟进套餐设置订单信息
|
CounsellingSetMeal counsellingSetMeal = this.counsellingSetMealService.getById(counsellingOrderRequest.getCounsellingSetMealId());
|
if (counsellingSetMeal != null){
|
counsellingOrder.setCounsellingSetMealId(counsellingSetMeal.getId());
|
counsellingOrder.setSetMealJson(JSONUtil.toJsonStr(counsellingSetMeal));
|
counsellingOrder.setPayAmount(counsellingSetMeal.getPrice());
|
counsellingOrder.setOrderAmount(counsellingSetMeal.getOriginalPrice());
|
|
counsellingOrder.setClassHours(counsellingSetMeal.getClassHours());
|
counsellingOrder.setResidueClassHours(counsellingSetMeal.getClassHours());
|
// counsellingOrder.setEffectiveBeginTime(new Date());
|
// counsellingOrder.setEffectiveEndTime(DateUtil.offsetDay(counsellingOrder.getEffectiveBeginTime(),counsellingSetMeal.getPeriodValidityDay()));
|
|
}else {
|
throw new ServiceException("咨询套餐不存在!");
|
}
|
counsellingOrder.setPhone(customerUser.getTelephone());
|
if (counsellingUserOld != null && counsellingUserOld.getConsultantUserId() != null){
|
counsellingOrder.setConsultantUserId(counsellingUserOld.getConsultantUserId());
|
}else{
|
if (counsellingUserOld != null && counsellingUserOld.getConsultantUserId() != null){
|
counsellingOrder.setConsultantUserId(counsellingUserOld.getConsultantUserId());
|
}else {
|
if (customerOld.getConsultWorkerId() != null) {
|
counsellingOrder.setConsultantUserId(customerOld.getConsultWorkerId());
|
} else {
|
Customer customer2 = customerService.randomWorkerByLineStatusAndPost(ImStatusEnum.ON_LINE.getCode(), null, PostIdEnum.PO_21.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customer2 != null) {
|
//咨询顾问id
|
counsellingOrder.setConsultantUserId(customer2.getCustomerId());
|
// counsellingUserOld.setConsultantUserId(customer2.getCustomerId());
|
} else {
|
Customer customer3 = customerService.randomWorkerByLineStatusAndPost(null, null, PostIdEnum.PO_21.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customer3 != null) {
|
//咨询顾问id
|
counsellingOrder.setConsultantUserId(customer3.getCustomerId());
|
// counsellingUserOld.setConsultantUserId(customer3.getCustomerId());
|
} else {
|
throw new ServiceException("没有在线的咨询顾问!");
|
}
|
}
|
}
|
}
|
}
|
//是否后台创建
|
if (counsellingOrderRequest.getIsBack()){
|
Date nowDate = new Date();
|
if (counsellingUserOld == null || (counsellingUserOld != null && (counsellingUserOld.getEffectiveEndTime() == null ||
|
(counsellingUserOld.getEffectiveEndTime() != null && counsellingUserOld.getEffectiveEndTime().getTime() < nowDate.getTime())))){
|
counsellingOrder.setEffectiveBeginTime(nowDate);
|
counsellingOrder.setEffectiveEndTime(DateUtil.endOfDay(DateUtil.offsetDay(counsellingOrder.getEffectiveBeginTime(),counsellingSetMeal.getPeriodValidityDay())));
|
}else{
|
counsellingOrder.setEffectiveBeginTime(counsellingUserOld.getEffectiveEndTime());
|
counsellingOrder.setEffectiveEndTime(DateUtil.endOfDay(DateUtil.offsetDay(counsellingOrder.getEffectiveBeginTime(),counsellingSetMeal.getPeriodValidityDay())));
|
|
}
|
counsellingOrder.setStatusFlag(1);
|
|
counsellingOrder.setCreateUser(LoginContext.me().getLoginUser().getUserId());
|
//查询是否已经存在群聊
|
// long imCount = this.iImGroupService.count(new LambdaQueryWrapper<ImGroup>().eq(ImGroup::getOrderId,counsellingOrder.getCounsellingInfoId())
|
// .eq(ImGroup::getGroupType,2).eq(ImGroup::getCreateUser,counsellingOrder.getUserId()).eq(ImGroup::getIsDelete,0));
|
// if ( imCount ==0l ){
|
//生成群聊
|
iImGroupService.createGroup(2,counsellingOrder.getConsultantUserId(),counsellingOrder.getCompanionUserId(),counsellingInfo.getUserId(),null,null,counsellingOrder.getUserId(),counsellingOrder.getCounsellingInfoId());
|
|
// }
|
|
}else {
|
counsellingOrder.setStatusFlag(0);
|
|
}
|
}
|
|
//是否后台创建
|
if (counsellingOrderRequest.getIsBack()){
|
|
if (counsellingUserOld == null ){
|
CounsellingUser counsellingUser = BeanUtil.copyProperties(counsellingOrder,CounsellingUser.class);
|
counsellingUser.setId(null);
|
counsellingUser.setIsFirstAppointment(1);
|
this.counsellingUserService.save(counsellingUser);
|
}else{
|
if (counsellingOrder.getOrderType().intValue() != 1){
|
if (counsellingUserOld.getEffectiveBeginTime() == null){
|
counsellingUserOld.setEffectiveBeginTime(counsellingOrder.getEffectiveBeginTime());
|
}
|
counsellingUserOld.setEffectiveEndTime(counsellingOrder.getEffectiveEndTime());
|
counsellingUserOld.setClassHours(counsellingUserOld.getClassHours() !=null ? counsellingUserOld.getClassHours().intValue() + counsellingOrder.getClassHours().intValue():counsellingOrder.getClassHours());
|
counsellingUserOld.setResidueClassHours(counsellingUserOld.getResidueClassHours() !=null ? counsellingUserOld.getResidueClassHours().intValue() + counsellingOrder.getResidueClassHours().intValue():counsellingOrder.getResidueClassHours());
|
counsellingUserOld.setStatusFlag(counsellingOrder.getStatusFlag());
|
}else {
|
counsellingUserOld.setUserInfoJson(counsellingOrder.getUserInfoJson());
|
counsellingUserOld.setIsFirstAppointment(1);
|
}
|
if (counsellingUserOld.getCompanionUserId() != null){
|
counsellingOrder.setCompanionUserId(counsellingUserOld.getCompanionUserId());
|
}else{
|
counsellingUserOld.setCompanionUserId(counsellingOrder.getCompanionUserId());
|
}
|
if (counsellingUserOld.getConsultantUserId() != null){
|
counsellingOrder.setConsultantUserId(counsellingUserOld.getConsultantUserId());
|
}else{
|
counsellingUserOld.setConsultantUserId(counsellingOrder.getConsultantUserId());
|
}
|
if (StrUtil.isBlank(counsellingUserOld.getPhone()) && StrUtil.isNotBlank(counsellingOrder.getPhone())){
|
counsellingUserOld.setPhone(counsellingOrder.getPhone());
|
}
|
if (StrUtil.isBlank(counsellingUserOld.getUserInfoJson()) && StrUtil.isNotBlank(counsellingOrder.getUserInfoJson())){
|
counsellingUserOld.setUserInfoJson(counsellingOrder.getUserInfoJson());
|
}
|
counsellingUserOld.setStatusFlag(counsellingOrder.getStatusFlag());
|
this.counsellingUserService.updateById(counsellingUserOld);
|
|
}
|
}
|
if (counsellingOrderRequest.getIsBack()){
|
counsellingOrder.setPayTime(new Date());
|
}
|
this.save(counsellingOrder);
|
//分配咨询顾问
|
if (customerOld.getConsultWorkerId() == null && counsellingOrder.getConsultantUserId() != null ){
|
customerOld.setConsultWorkerId(counsellingOrder.getConsultantUserId());
|
this.customerService.updateCustomerRemoveCache(customerOld);
|
|
}
|
|
return counsellingOrder;
|
}
|
|
@Override
|
public void payCounsellingOrder(OrderPayRequest orderPayRequest) {
|
CounsellingOrder counsellingOrder = this.getOne(new LambdaQueryWrapper<CounsellingOrder>().eq(CounsellingOrder::getOrderNo,orderPayRequest.getOrderNo()));
|
counsellingOrder.setTransactionNo(orderPayRequest.getTransactionNo());
|
counsellingOrder.setStatusFlag(1);
|
counsellingOrder.setPayTime(new Date());
|
counsellingOrder.setPayType(orderPayRequest.getPayType());
|
//查询客户信息
|
Customer customerold = this.customerService.getById(counsellingOrder.getUserId());
|
CounsellingInfo counsellingInfo = this.counsellingInfoService.getById(counsellingOrder.getCounsellingInfoId());
|
//判断是否有用户咨询师信息
|
CounsellingUser counsellingUserOld = this.counsellingUserService.getOne(new LambdaQueryWrapper<CounsellingUser>().eq(CounsellingUser::getCounsellingInfoId,counsellingOrder.getCounsellingInfoId())
|
.eq(CounsellingUser::getUserId,counsellingOrder.getUserId()));
|
//订单类型 1-首次咨询,2-咨询疗程,3-课程续费
|
if (counsellingOrder.getOrderType().intValue() == 1){
|
Customer customer = JSONUtil.toBean(counsellingOrder.getUserInfoJson(),Customer.class);
|
//生成预约记录
|
CounsellingOrderReservation counsellingOrderReservation = new CounsellingOrderReservation();
|
counsellingOrderReservation.setCounsellingOrderId(counsellingOrder.getId());
|
counsellingOrderReservation.setCounsellingInfoId(counsellingOrder.getCounsellingInfoId());
|
counsellingOrderReservation.setCompanionUserId(counsellingOrder.getCompanionUserId());
|
counsellingOrderReservation.setConsultantUserId(counsellingOrder.getConsultantUserId());
|
counsellingOrderReservation.setRemark(customer.getCurrentRemark());
|
counsellingOrderReservation.setUserId(counsellingOrder.getUserId());
|
//预约类型 1-首次面诊,2-咨询疗程
|
counsellingOrderReservation.setReservationType(1);
|
String reservDate = DateUtil.formatDate(counsellingOrder.getFirstAppointmentDate());
|
String[] times = counsellingOrder.getFirstAppointmentTimes().split("-");
|
counsellingOrderReservation.setReservationBeginTime(DateUtil.parse(reservDate+" "+times[0]+":00"));
|
counsellingOrderReservation.setReservationEndTime(DateUtil.parse(reservDate+" "+times[1]+":00"));
|
//预约状态 1-待审批,2-待服务,3-服务中,4-已完成,5-已取消,6-已拒绝 - 首次面诊直接待服务
|
counsellingOrderReservation.setStauts(2);
|
this.counsellingOrderReservationService.save(counsellingOrderReservation);
|
//新增
|
// iImGroupService.createGroup(2,null,null,counsellingInfo.getUserId(),null,null,counsellingOrder.getUserId(),counsellingOrder.getCounsellingInfoId());
|
|
|
//新增
|
|
|
//将此条消息加入到可聊天的表中t_mental_appointment
|
MentalAppointment mentalAppointment = MentalAppointment.builder()
|
.userId(counsellingOrder.getUserId())
|
.type("1")
|
.statusFlag(1)
|
.appointmentDay(counsellingOrder.getFirstAppointmentDate())
|
.beginTimePoint(counsellingOrder.getFirstAppointmentTimes().split("-")[0])
|
.endTimePoint(counsellingOrder.getFirstAppointmentTimes().split("-")[1])
|
.workerId(counsellingInfo.getUserId())
|
.build();
|
// 用户信息
|
CustomerInfo customerInfo = customerService.getCustomerInfoById(counsellingOrder.getUserId());
|
mentalAppointment.setUserName(customerInfo.getRealName());
|
mentalAppointment.setPhone(customerInfo.getLinkPhone());
|
mentalAppointmentService.save(mentalAppointment);
|
|
// 创建一个 SimpleDateFormat 实例,指定日期格式为 "yyyy-MM-dd"
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
|
|
// 使用 formatter 将 Date 对象转换为字符串
|
String formattedDate = formatter.format(counsellingOrder.getFirstAppointmentDate());
|
// 发送IM消息
|
ImPushDataDTO pushData1 = ImPushDataDTO.builder()
|
.type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT_FIRST.getCode())
|
.title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT_FIRST.getName())
|
.content("预约成功"+",请注意预约时间:"+formattedDate+counsellingOrder.getFirstAppointmentTimes())
|
// .content("预约成功!")
|
.objId(ObjUtil.toString(counsellingInfo.getId()))
|
.data1(ObjUtil.toString(counsellingOrder.getUserId()))
|
.data2(ObjUtil.toString(counsellingInfo.getUserId()))
|
.build();
|
imBizService.messageSendPrivate(
|
ObjUtil.toString(counsellingOrder.getUserId()),
|
new String[]{ObjUtil.toString(counsellingInfo.getUserId())},
|
pushData1);
|
|
// 推送消息内容
|
String pushContent = "你的预约("+DateUtil.formatDate(counsellingOrder.getFirstAppointmentDate())+" "+counsellingOrder.getFirstAppointmentTimes()+")已确认,请按时参加";
|
// IM推送数据json
|
ImPushDataDTO pushData = ImPushDataDTO.builder()
|
.type(ImPushTypeEnum.S_TO_W_TIP_CONSULT_PAY_SUCCESS.getCode())
|
.objId(ObjUtil.toString(counsellingOrderReservation.getId()))
|
.title("通知")
|
.data1(ObjUtil.toString(counsellingInfo.getUserId()))
|
.data2(ObjUtil.toString(counsellingOrder.getUserId()))
|
.content(pushContent)
|
// .extra("("+DateUtil.formatDate(counsellingOrder.getFirstAppointmentDate())+" "+counsellingOrder.getFirstAppointmentTimes()+")")
|
.build();
|
// 发送首次预约
|
imBizService.messageSendSystem(counsellingOrderReservation.getUserId()+"", new String[]{counsellingOrderReservation.getUserId()+""}, pushData, ImUserTypeEnum.USER, null, true);
|
|
|
//给咨询师发消息
|
Customer customerOld = this.customerService.getById(counsellingOrderReservation.getUserId());
|
|
String pushContent1 = "你有新的预约,请注意查收。预约用户:"+customerOld.getNickName()+",预约时间:"+DateUtil.formatDate(counsellingOrder.getFirstAppointmentDate())+" "+counsellingOrder.getFirstAppointmentTimes();
|
// +"预约时间:"+counsellingOrder.getEffectiveEndTime()+"~"+counsellingOrder.getEffectiveEndTime();
|
// IM推送数据json
|
ImPushDataDTO pushData2 = ImPushDataDTO.builder()
|
.type(ImPushTypeEnum.S_TO_W_TIP_CONSULT_PAY_GROUP_SUCCESS.getCode())
|
.objId(ObjUtil.toString(counsellingInfo.getUserId()))
|
.title("通知")
|
.content(pushContent1)
|
.data1(ObjUtil.toString(counsellingOrder.getUserId()))
|
.data2(ObjUtil.toString(counsellingInfo.getUserId()))
|
// .extra("去查看。")
|
.build();
|
// 发送预约提示
|
imBizService.messageSendSystem(counsellingOrder.getUserId()+"", new String[]{counsellingInfo.getUserId()+""}, pushData2, ImUserTypeEnum.WORKER, PostIdEnum.PO_22, true);
|
|
|
// 推送消息内容
|
// String pushContent = "我购买了心理咨询疗程,需要咨询";
|
// // IM推送数据json
|
// ImPushDataDTO pushData = ImPushDataDTO.builder()
|
// .type(ImPushTypeEnum.S_TO_W_TIP_CONSULT_PAY_SUCCESS.getCode())
|
// .objId(ObjUtil.toString(counsellingOrderReservation.getId()))
|
// .title("通知")
|
// .content(pushContent)
|
//// .extra("心理咨询疗程")
|
// .build();
|
// // 发送首次预约
|
// imBizService.messageSendGroup(counsellingOrderReservation.getUserId()+"", new String[]{counsellingOrderReservation.getUserId()+""}, pushData);
|
} else if (counsellingOrder.getOrderType().intValue() == 2){
|
|
if (counsellingUserOld != null && counsellingUserOld.getConsultantUserId() != null){
|
counsellingOrder.setConsultantUserId(counsellingUserOld.getConsultantUserId());
|
}else{
|
if (customerold.getConsultWorkerId() != null){
|
counsellingOrder.setConsultantUserId(customerold.getConsultWorkerId());
|
}else{
|
Customer customer2 = customerService.randomWorkerByLineStatusAndPost(ImStatusEnum.ON_LINE.getCode(), null, PostIdEnum.PO_21.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customer2 != null){
|
//咨询顾问id
|
counsellingOrder.setConsultantUserId(customer2.getCustomerId());
|
// counsellingUserOld.setConsultantUserId(customer2.getCustomerId());
|
}else {
|
Customer customer3 = customerService.randomWorkerByLineStatusAndPost(null, null, PostIdEnum.PO_21.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customer3 != null){
|
//咨询顾问id
|
counsellingOrder.setConsultantUserId(customer3.getCustomerId());
|
// counsellingUserOld.setConsultantUserId(customer3.getCustomerId());
|
}else{
|
throw new ServiceException("没有在线的咨询顾问!");
|
}
|
}
|
}
|
|
}
|
// Customer customer2 = customerService.randomWorkerByLineStatusAndPost(ImStatusEnum.ON_LINE.getCode(), null, PostIdEnum.PO_21.getCode());
|
// if (customer2 != null){
|
// //咨询顾问id
|
// counsellingOrder.setConsultantUserId(customer2.getCustomerId());
|
// }else {
|
// throw new ServiceException("没有在线的咨询顾问!");
|
// }
|
CounsellingSetMeal counsellingSetMeal = JSONUtil.toBean(counsellingOrder.getSetMealJson(),CounsellingSetMeal.class);
|
//是否赠送陪护
|
if (counsellingSetMeal.getIsGive() != null && counsellingSetMeal.getIsGive().intValue() == 1){
|
if (counsellingUserOld != null && counsellingUserOld.getCompanionUserId() != null){
|
//陪护教练id
|
counsellingOrder.setCompanionUserId(counsellingUserOld.getCompanionUserId());
|
}else if (counsellingUserOld != null && counsellingUserOld.getCompanionUserId() == null){
|
|
Customer customerCompanion = customerService.randomWorkerByLineStatusAndPost(ImStatusEnum.ON_LINE.getCode(), null, PostIdEnum.PO_23.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customerCompanion != null){
|
//陪护教练id
|
counsellingOrder.setCompanionUserId(customerCompanion.getCustomerId());
|
counsellingUserOld.setCompanionUserId(customerCompanion.getCustomerId());
|
}else{
|
Customer customerCompanion2 = customerService.randomWorkerByLineStatusAndPost(null, null, PostIdEnum.PO_23.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customerCompanion2 != null){
|
//陪护教练id
|
counsellingOrder.setCompanionUserId(customerCompanion2.getCustomerId());
|
counsellingUserOld.setCompanionUserId(customerCompanion2.getCustomerId());
|
}else{
|
throw new ServiceException("没有在线的陪护教练!");
|
}
|
}
|
}
|
// Customer customerCompanion = customerService.randomWorkerByLineStatusAndPost(ImStatusEnum.ON_LINE.getCode(), null, PostIdEnum.PO_23.getCode());
|
// if (customerCompanion != null){
|
// //陪护教练id
|
// counsellingOrder.setCompanionUserId(customerCompanion.getCustomerId());
|
// }else{
|
// throw new ServiceException("没有在线的陪护教练!");
|
// }
|
}
|
counsellingOrder.setEffectiveBeginTime(new Date());
|
counsellingOrder.setEffectiveEndTime(DateUtil.endOfDay(DateUtil.offsetDay(counsellingOrder.getEffectiveBeginTime(),counsellingSetMeal.getPeriodValidityDay())));
|
|
//生成群聊
|
// //查询是否已经存在群聊
|
// long imCount = this.iImGroupService.count(new LambdaQueryWrapper<ImGroup>().eq(ImGroup::getOrderId,counsellingOrder.getCounsellingInfoId())
|
// .eq(ImGroup::getGroupType,2).eq(ImGroup::getCreateUser,counsellingOrder.getUserId()).eq(ImGroup::getIsDelete,0));
|
// if ( imCount ==0l ){
|
//生成群聊
|
// iImGroupService.createGroup(2,counsellingOrder.getConsultantUserId(),counsellingOrder.getCompanionUserId(),counsellingInfo.getUserId(),null,null,counsellingOrder.getUserId(),counsellingOrder.getCounsellingInfoId());
|
if (counsellingSetMeal.getIsGive() != null && counsellingSetMeal.getIsGive().intValue() == 1){
|
//生成群聊
|
iImGroupService.createGroup(2,counsellingOrder.getConsultantUserId(),counsellingOrder.getCompanionUserId(),counsellingInfo.getUserId(),null,null,counsellingOrder.getUserId(),counsellingOrder.getCounsellingInfoId());
|
|
}else{
|
//生成群聊
|
iImGroupService.createGroup(2,null,null,counsellingInfo.getUserId(),null,null,counsellingOrder.getUserId(),counsellingOrder.getCounsellingInfoId());
|
|
}
|
// }
|
} else if (counsellingOrder.getOrderType().intValue() == 3) {
|
if (counsellingUserOld != null && counsellingUserOld.getConsultantUserId() != null){
|
counsellingOrder.setConsultantUserId(counsellingUserOld.getConsultantUserId());
|
}else{
|
if (customerold.getConsultWorkerId() != null){
|
counsellingOrder.setConsultantUserId(customerold.getConsultWorkerId());
|
}else{
|
Customer customer2 = customerService.randomWorkerByLineStatusAndPost(ImStatusEnum.ON_LINE.getCode(), null, PostIdEnum.PO_21.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customer2 != null){
|
//咨询顾问id
|
counsellingOrder.setConsultantUserId(customer2.getCustomerId());
|
// counsellingUserOld.setConsultantUserId(customer2.getCustomerId());
|
}else {
|
Customer customer3 = customerService.randomWorkerByLineStatusAndPost(null, null, PostIdEnum.PO_21.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode());
|
if (customer3 != null){
|
//咨询顾问id
|
counsellingOrder.setConsultantUserId(customer3.getCustomerId());
|
// counsellingUserOld.setConsultantUserId(customer3.getCustomerId());
|
}else{
|
throw new ServiceException("没有在线的咨询顾问!");
|
}
|
}
|
}
|
|
}
|
CounsellingSetMeal counsellingSetMeal = JSONUtil.toBean(counsellingOrder.getSetMealJson(),CounsellingSetMeal.class);
|
Date nowDate = new Date();
|
if (counsellingUserOld == null || counsellingUserOld.getEffectiveEndTime().getTime() < nowDate.getTime()){
|
counsellingOrder.setEffectiveBeginTime(nowDate);
|
counsellingOrder.setEffectiveEndTime(DateUtil.endOfDay(DateUtil.offsetDay(counsellingOrder.getEffectiveBeginTime(),counsellingSetMeal.getPeriodValidityDay())));
|
}else{
|
counsellingOrder.setEffectiveBeginTime(counsellingUserOld.getEffectiveEndTime());
|
counsellingOrder.setEffectiveEndTime(DateUtil.endOfDay(DateUtil.offsetDay(counsellingOrder.getEffectiveBeginTime(),counsellingSetMeal.getPeriodValidityDay())));
|
|
}
|
//查询是否已经存在群聊
|
// long imCount = this.iImGroupService.count(new LambdaQueryWrapper<ImGroup>().eq(ImGroup::getOrderId,counsellingOrder.getCounsellingInfoId())
|
// .eq(ImGroup::getGroupType,2).eq(ImGroup::getCreateUser,counsellingOrder.getUserId()).eq(ImGroup::getIsDelete,0));
|
// if ( imCount ==0l ){
|
//生成群聊
|
iImGroupService.createGroup(2,counsellingOrder.getConsultantUserId(),counsellingOrder.getCompanionUserId(),counsellingInfo.getUserId(),null,null,counsellingOrder.getUserId(),counsellingOrder.getCounsellingInfoId());
|
|
// }
|
//生成群聊
|
// iImGroupService.createGroup(2,counsellingOrder.getConsultantUserId(),counsellingOrder.getCompanionUserId(),counsellingInfo.getUserId(),null,null,counsellingOrder.getUserId(),counsellingOrder.getId());
|
}
|
|
//添加咨询用户信息
|
if (counsellingUserOld == null ){
|
CounsellingUser counsellingUser = BeanUtil.copyProperties(counsellingOrder,CounsellingUser.class);
|
counsellingUser.setId(null);
|
counsellingUser.setIsFirstAppointment(2);
|
this.counsellingUserService.save(counsellingUser);
|
}else{
|
if (counsellingOrder.getOrderType().intValue() != 1){
|
if (counsellingUserOld.getEffectiveBeginTime() == null){
|
counsellingUserOld.setEffectiveBeginTime(counsellingOrder.getEffectiveBeginTime());
|
}
|
counsellingUserOld.setEffectiveEndTime(counsellingOrder.getEffectiveEndTime());
|
counsellingUserOld.setClassHours(counsellingUserOld.getClassHours() !=null ? counsellingUserOld.getClassHours().intValue() + counsellingOrder.getClassHours().intValue():counsellingOrder.getClassHours());
|
counsellingUserOld.setResidueClassHours(counsellingUserOld.getResidueClassHours() !=null ? counsellingUserOld.getResidueClassHours().intValue() + counsellingOrder.getResidueClassHours().intValue():counsellingOrder.getResidueClassHours());
|
counsellingUserOld.setStatusFlag(counsellingOrder.getStatusFlag());
|
}else {
|
counsellingUserOld.setUserInfoJson(counsellingOrder.getUserInfoJson());
|
counsellingUserOld.setIsFirstAppointment(2);
|
}
|
if (StrUtil.isBlank(counsellingUserOld.getUserInfoJson()) && StrUtil.isNotBlank(counsellingOrder.getUserInfoJson())){
|
counsellingUserOld.setUserInfoJson(counsellingOrder.getUserInfoJson());
|
}
|
if (counsellingUserOld.getCompanionUserId() != null){
|
counsellingOrder.setCompanionUserId(counsellingUserOld.getCompanionUserId());
|
}else{
|
counsellingUserOld.setCompanionUserId(counsellingOrder.getCompanionUserId());
|
}
|
if (counsellingUserOld.getConsultantUserId() != null){
|
counsellingOrder.setConsultantUserId(counsellingUserOld.getConsultantUserId());
|
}else{
|
counsellingUserOld.setConsultantUserId(counsellingOrder.getConsultantUserId());
|
}
|
if (StrUtil.isBlank(counsellingUserOld.getPhone()) && StrUtil.isNotBlank(counsellingOrder.getPhone())){
|
counsellingUserOld.setPhone(counsellingOrder.getPhone());
|
}
|
counsellingUserOld.setStatusFlag(counsellingOrder.getStatusFlag());
|
this.counsellingUserService.updateById(counsellingUserOld);
|
|
}
|
this.updateById(counsellingOrder);
|
//分配咨询顾问
|
if (customerold.getConsultWorkerId() == null && counsellingOrder.getConsultantUserId() != null ){
|
|
// Customer customer = JSONUtil.toBean(counsellingOrder.getUserInfoJson(),Customer.class);
|
// if (customer != null){
|
// customer.setCustomerId(counsellingOrder.getUserId());
|
// customerold.setRealName(customer.getRealName());
|
// customerold.setSex(customer.getSex());
|
// customerold.setAvatar(customer.getAvatar());
|
// customerold.setAvatarObjectName(customer.getAvatarObjectName());
|
// customerold.setLinkPhone(customer.getLinkPhone());
|
// customerold.setBirthday(customer.getBirthday());
|
// customerold.setEmail(customer.getEmail());
|
// customerold.setEducationLevel(customer.getEducationLevel());
|
// customerold.setOccupation(customer.getOccupation());
|
// customerold.setMarital(customer.getMarital());
|
// customerold.setCityCode(customer.getCityCode());
|
// customerold.setIncome(customer.getIncome());
|
// customerold.setChildAge(customer.getChildAge());
|
// }
|
|
customerold.setConsultWorkerId(counsellingOrder.getConsultantUserId());
|
this.customerService.updateCustomerRemoveCache(customerold);
|
|
}
|
}
|
|
@Override
|
public CounsellingOrder getCounsellingOrderByNo(String orderNo) {
|
return this.getOne(
|
Wrappers.<CounsellingOrder>lambdaQuery()
|
.eq(CounsellingOrder::getOrderNo, orderNo)
|
.last("limit 1")
|
);
|
}
|
|
|
}
|