From 67c5f30d9a0d96746a423fbaf4c843593801a28a Mon Sep 17 00:00:00 2001
From: guohongjin <guohongjin@test.com>
Date: 星期三, 17 四月 2024 16:24:02 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PsychologicalCounseling
---
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/CounsellingOrderServiceImpl.java | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 56 insertions(+), 1 deletions(-)
diff --git a/common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/CounsellingOrderServiceImpl.java b/common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/CounsellingOrderServiceImpl.java
index 1e08628..7346db6 100644
--- a/common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/CounsellingOrderServiceImpl.java
+++ b/common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/CounsellingOrderServiceImpl.java
@@ -16,6 +16,7 @@
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.*;
@@ -64,7 +65,8 @@
private ICounsellingUserService counsellingUserService;
@Resource
private IAreaService areaService;
-
+ @Resource
+ IMentalAppointmentService mentalAppointmentService;
@Override
public Page<CounsellingOrderResponseDTO> findCounsellingOrderPage(Page<CounsellingOrderRequest> page, CounsellingOrderRequest counsellingOrderRequest) {
@@ -154,6 +156,39 @@
counsellingOrder.setUserInfoJson(JSONUtil.toJsonStr(customerUpdateRequest));
}
+
+ // 发送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("预约成功"+",请注意预约时间:"+counsellingOrder.getEffectiveEndTime()+"~"+counsellingOrder.getEffectiveEndTime())
+// .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());
@@ -179,6 +214,26 @@
}
}
+// 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());
--
Gitblit v1.7.1