This commit is contained in:
wucongxing 2023-03-27 16:06:23 +08:00
parent 4a0a162297
commit ef0d80038d
6 changed files with 52 additions and 39 deletions

View File

@ -38,31 +38,32 @@ class SendStationMessageConsumer extends ConsumerMessage
} }
try { try {
// 发送消息
$ImService = new ImService();
// 自定义消息
$cloud_custom_data = array();
$cloud_custom_data['order_inquiry_id'] = "";
$cloud_custom_data['is_system'] = 1;
$cloud_custom_data['inquiry_type'] = "";
$cloud_custom_data['message_rounds'] = "";
// 消息内容
$message_content_data = array();
$message_content_data['message_type'] = 1;
$message_content_data['content'] = "--等待医生接诊--";
$message_content_data['desc'] = "温馨提示:您可继续补充问诊内容,便于更快确认病情,医生均在临床一线工作,还请耐心等待,医生接诊会第一时间短信通知您。";
$message_content = [
'Data' => json_encode($message_content_data,JSON_UNESCAPED_UNICODE),
];
} catch (\Exception $e) { } catch (\Exception $e) {
Log::getInstance()->error("站内消息推送执行失败:" . $e->getMessage()); Log::getInstance()->error("站内消息推送执行失败:" . $e->getMessage());
} }
// 处理推送参数
$ImService = new ImService();
// 发送消息
// 自定义消息
$cloud_custom_data = array();
$cloud_custom_data['order_inquiry_id'] = "494837308861095936";
$cloud_custom_data['is_system'] = 1;
$cloud_custom_data['inquiry_type'] = 1;
// 消息内容
$message_content_data = array();
$message_content_data['message_type'] = 1;
$message_content_data['content'] = "--测试--";
$message_content_data['desc'] = "温馨提示:您可继续补充问诊内容,便于更快确认病情,医生均在临床一线工作,还请耐心等待,医生接诊会第一时间短信通知您。";
$message_content = [
'Data' => json_encode($message_content_data,JSON_UNESCAPED_UNICODE),
];
$ImService->sendMessage("491925054435950592", "492404831991414785", $message_content, "TIMCustomElem", $cloud_custom_data);
Log::getInstance()->info("站内消息推送成功"); Log::getInstance()->info("站内消息推送成功");
return Result::ACK; return Result::ACK;

View File

@ -4,6 +4,8 @@ namespace App\Controller;
use App\Amqp\Producer\PrescriptionDistributePhProducer; use App\Amqp\Producer\PrescriptionDistributePhProducer;
use App\Constants\HttpEnumCode; use App\Constants\HttpEnumCode;
use App\Model\OrderPrescriptionIcd;
use App\Model\OrderPrescriptionProduct;
use App\Request\DoctorAuthRequest; use App\Request\DoctorAuthRequest;
use App\Request\UserDoctorRequest; use App\Request\UserDoctorRequest;
use App\Services\DoctorAuthService; use App\Services\DoctorAuthService;
@ -13,6 +15,7 @@ use App\Services\UserDoctorService;
use Extend\TencentIm\Account; use Extend\TencentIm\Account;
use Hyperf\Amqp\Producer; use Hyperf\Amqp\Producer;
use Hyperf\DbConnection\Db; use Hyperf\DbConnection\Db;
use Hyperf\Snowflake\IdGeneratorInterface;
use Hyperf\Utils\ApplicationContext; use Hyperf\Utils\ApplicationContext;
use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface; use Psr\Container\NotFoundExceptionInterface;
@ -289,6 +292,25 @@ class UserDoctorController extends AbstractController
*/ */
public function addPrescription(): ResponseInterface public function addPrescription(): ResponseInterface
{ {
// $data = array();
// $data['order_prescription_id'] = "498883041773666305";
// $data['icd_id'] = 111;
// $order_prescription_icd = OrderPrescriptionIcd::addOrderPrescriptionIcd($data);
// if (empty($order_prescription_icd)) {
// dump(111);
// }
// die;
// $data = array();
// $data['order_prescription_id'] = "498883041773666305";
// $data['product_id'] = 2;
// $data['prescription_product_num'] = 1;
// $order_prescription_product = OrderPrescriptionProduct::addOrderPrescriptionProduct($data);
// if (empty($order_prescription_product)) {
// dump(111);
// }
// dump(222);die;
$request = $this->container->get(UserDoctorRequest::class); $request = $this->container->get(UserDoctorRequest::class);
$request->scene('addPrescription')->validateResolved(); $request->scene('addPrescription')->validateResolved();

View File

@ -9,7 +9,6 @@ namespace App\Model;
use Hyperf\Database\Model\Collection; use Hyperf\Database\Model\Collection;
use Hyperf\Database\Model\Model; use Hyperf\Database\Model\Model;
use Hyperf\Database\Model\Relations\HasOne; use Hyperf\Database\Model\Relations\HasOne;
use Hyperf\Snowflake\Concern\Snowflake;
/** /**
* @property int $prescription_product_id 主键id * @property int $prescription_product_id 主键id
@ -28,12 +27,9 @@ use Hyperf\Snowflake\Concern\Snowflake;
* @property int $available_days 可用天数(3) * @property int $available_days 可用天数(3)
* @property \Carbon\Carbon $created_at 创建时间 * @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间 * @property \Carbon\Carbon $updated_at 修改时间
* @property-read Product $Product
*/ */
class OrderPrescriptionProduct extends Model class OrderPrescriptionProduct extends Model
{ {
use Snowflake;
/** /**
* The table associated with the model. * The table associated with the model.
*/ */

View File

@ -98,7 +98,7 @@ class UserDoctorRequest extends FormRequest
'province_id' => 'required|required_with:city_id,county_id', 'province_id' => 'required|required_with:city_id,county_id',
'city_id' => 'required|required_with:county_id', 'city_id' => 'required|required_with:county_id',
'county_id' => 'required', 'county_id' => 'required',
'pharmacist_audit_status' => 'required|integer|min:0|max:2', 'pharmacist_audit_status' => 'required|integer|min:0|max:3',
'words_type' => 'required|integer|min:1|max:3', 'words_type' => 'required|integer|min:1|max:3',
'words' => 'required', 'words' => 'required',
'doctor_id' => 'required', 'doctor_id' => 'required',

View File

@ -278,7 +278,7 @@ class ImService extends BaseService
} }
// 发送自定义消息 // 发送自定义消息
public function sendCustomMessage(string $from_user_id,string $to_user_id,string $content,string $order_inquiry_id,int $inquiry_type): void public function sendCustomMessage(string $from_user_id,string $to_user_id,string $content,string $order_inquiry_id,int $inquiry_type, array $cloud_custom_data): void
{ {
if (!empty($from_user_id)){ if (!empty($from_user_id)){
// 检测并创建发送者资料 // 检测并创建发送者资料
@ -295,7 +295,7 @@ class ImService extends BaseService
$arg['From_Account'] = $from_user_id; // 发送方user_id 如系统发送,无需填写 $arg['From_Account'] = $from_user_id; // 发送方user_id 如系统发送,无需填写
} }
$arg['To_Account'] = $to_user_id; // 接收方user_id $arg['To_Account'] = $to_user_id; // 接收方user_id
$arg['ForbidCallbackControl'] = ['ForbidBeforeSendMsgCallback']; $arg['ForbidCallbackControl'] = ['ForbidBeforeSendMsgCallback','ForbidAfterSendMsgCallback'];
$arg['SendMsgControl'] = ['NoUnread']; $arg['SendMsgControl'] = ['NoUnread'];
$arg['MsgBody'] = [ $arg['MsgBody'] = [
@ -308,12 +308,10 @@ class ImService extends BaseService
]; ];
// 自定义消息 // 自定义消息
$cloud_custom_data = array(); $arg['CloudCustomData'] = "";
$cloud_custom_data['order_inquiry_id'] = $order_inquiry_id; if (!empty($cloud_custom_data)){
$cloud_custom_data['is_system'] = 1; $arg['CloudCustomData'] = json_encode($cloud_custom_data,JSON_UNESCAPED_UNICODE);
$cloud_custom_data['inquiry_type'] = $inquiry_type; }
$arg['CloudCustomData'] = json_encode($cloud_custom_data,JSON_UNESCAPED_UNICODE);
$message->sendMessage($arg); $message->sendMessage($arg);
} }

View File

@ -468,6 +468,8 @@ class UserDoctorService extends BaseService
foreach ($order_prescriptions['data'] as $order_prescription) { foreach ($order_prescriptions['data'] as $order_prescription) {
$data = array(); $data = array();
$data['order_prescription_id'] = $order_prescription['order_prescription_id'];
$data['order_inquiry_id'] = $order_prescription['order_inquiry_id'];
$data['patient_name'] = $order_prescription['patient_name']; $data['patient_name'] = $order_prescription['patient_name'];
$data['patient_sex'] = $order_prescription['patient_sex']; $data['patient_sex'] = $order_prescription['patient_sex'];
$data['patient_age'] = $order_prescription['patient_age']; $data['patient_age'] = $order_prescription['patient_age'];
@ -979,13 +981,7 @@ class UserDoctorService extends BaseService
$params = array(); $params = array();
$params['doctor_id'] = $user_info['client_user_id']; $params['doctor_id'] = $user_info['client_user_id'];
$fields = [ $user_doctor = UserDoctor::getOne($params);
'doctor_id',
'iden_auth_status',
'idcard_status',
'multi_point_status',
];
$user_doctor = UserDoctor::getOne($params, $fields);
if (empty($user_doctor)) { if (empty($user_doctor)) {
return fail(HttpEnumCode::HTTP_ERROR, "非法医生"); return fail(HttpEnumCode::HTTP_ERROR, "非法医生");
} }
@ -1181,7 +1177,7 @@ class UserDoctorService extends BaseService
// 检测处方是否重复开具 // 检测处方是否重复开具
$params = array(); $params = array();
$params['order_prescription_id'] = $order_inquiry['order_inquiry_id']; $params['order_inquiry_id'] = $order_inquiry['order_inquiry_id'];
$params['doctor_id'] = $user_info['client_user_id']; $params['doctor_id'] = $user_info['client_user_id'];
$order_prescription = OrderPrescription::getOne($params); $order_prescription = OrderPrescription::getOne($params);
if (!empty($order_prescription)) { if (!empty($order_prescription)) {