新增ca认证对接、新增银行卡、身份证验证、修正消息通知
This commit is contained in:
@@ -109,16 +109,14 @@ class DoctorAuthService extends BaseService
|
||||
|
||||
// 网易易盾认证
|
||||
// 实人认证-生产环境开启
|
||||
if (env("APP_ENV") == "prod") {
|
||||
$IdCard = new IdCard();
|
||||
$IdCard = new IdCard();
|
||||
|
||||
$params = array();
|
||||
$params['name'] = $card_name;
|
||||
$params['cardNo'] = $card_num;
|
||||
$res = $IdCard->checkIdCard($params);
|
||||
if (!empty($res)) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, $res);
|
||||
}
|
||||
$params = array();
|
||||
$params['name'] = $card_name;
|
||||
$params['cardNo'] = $card_num;
|
||||
$res = $IdCard->checkIdCard($params);
|
||||
if (!empty($res)) {
|
||||
return fail(HttpEnumCode::HTTP_ERROR, $res);
|
||||
}
|
||||
|
||||
Db::beginTransaction();
|
||||
|
||||
@@ -225,7 +225,60 @@ class ImService extends BaseService
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function sendTextMessage(string $from_user_id,string $to_user_id,string $content,string $order_inquiry_id,int $inquiry_type): void
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
* @param string $from_user_id 发送者id
|
||||
* @param string $to_user_id 接受者id
|
||||
* @param array $message_content 内容 对应 MsgBody.MsgContent
|
||||
* @param string $message_type 消息类型 具体查看(https://cloud.tencent.com/document/product/269/2720)
|
||||
* @param array $cloud_custom_data 自定义字段
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function sendMessage(string $from_user_id, string $to_user_id, array $message_content, string $message_type, array $cloud_custom_data): void
|
||||
{
|
||||
if (!empty($from_user_id)){
|
||||
// 检测并创建发送者资料
|
||||
$this->setUserProfile($from_user_id);
|
||||
}
|
||||
|
||||
// 检测并创建接收者资料
|
||||
$this->setUserProfile($to_user_id);
|
||||
|
||||
$message = new Message();
|
||||
|
||||
$arg = array();
|
||||
if (!empty($from_user_id)){
|
||||
$arg['From_Account'] = $from_user_id; // 发送方user_id 如系统发送,无需填写
|
||||
}
|
||||
$arg['To_Account'] = $to_user_id; // 接收方user_id
|
||||
$arg['ForbidCallbackControl'] = ['ForbidBeforeSendMsgCallback',];
|
||||
$arg['SendMsgControl'] = ['NoUnread'];
|
||||
|
||||
$arg['MsgBody'] = [
|
||||
[
|
||||
"MsgType" => $message_type,
|
||||
"MsgContent" => $message_content,
|
||||
]
|
||||
];
|
||||
|
||||
// 自定义消息
|
||||
// $cloud_custom_data = array();
|
||||
// $cloud_custom_data['order_inquiry_id'] = $order_inquiry_id;
|
||||
// $cloud_custom_data['is_system'] = 1;
|
||||
// $cloud_custom_data['inquiry_type'] = $inquiry_type;
|
||||
|
||||
$arg['CloudCustomData'] = "";
|
||||
if (!empty($cloud_custom_data)){
|
||||
$arg['CloudCustomData'] = json_encode($cloud_custom_data,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
$message->sendMessage($arg);
|
||||
}
|
||||
|
||||
// 发送自定义消息
|
||||
public function sendCustomMessage(string $from_user_id,string $to_user_id,string $content,string $order_inquiry_id,int $inquiry_type): void
|
||||
{
|
||||
if (!empty($from_user_id)){
|
||||
// 检测并创建发送者资料
|
||||
@@ -235,7 +288,6 @@ class ImService extends BaseService
|
||||
// 检测并创建接收者资料
|
||||
$this->setUserProfile($to_user_id);
|
||||
|
||||
// 医生给患者发送消息
|
||||
$message = new Message();
|
||||
|
||||
$arg = array();
|
||||
@@ -248,9 +300,9 @@ class ImService extends BaseService
|
||||
|
||||
$arg['MsgBody'] = [
|
||||
[
|
||||
"MsgType" => "TIMTextElem",
|
||||
"MsgType" => "TIMCustomElem",
|
||||
"MsgContent" => [
|
||||
"Text" => $content,
|
||||
"Data" => $content,
|
||||
],
|
||||
]
|
||||
];
|
||||
|
||||
@@ -44,6 +44,7 @@ class IndexService extends BaseService
|
||||
"praise_rate",
|
||||
"avg_response_time",
|
||||
"number_of_fans",
|
||||
"avatar",
|
||||
"is_online",
|
||||
"is_img_expert_reception",
|
||||
"is_img_welfare_reception",
|
||||
|
||||
@@ -139,16 +139,14 @@ class PatientFamilyService extends BaseService
|
||||
}
|
||||
|
||||
// 实人认证-生产环境开启
|
||||
if (env("APP_ENV") == "prod"){
|
||||
$IdCard = new IdCard();
|
||||
$IdCard = new IdCard();
|
||||
|
||||
$params =array();
|
||||
$params['name'] = $request_params['card_name'];
|
||||
$params['cardNo'] = $request_params['id_number'];
|
||||
$res = $IdCard->checkIdCard($params);
|
||||
if (!empty($res)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,$res);
|
||||
}
|
||||
$params =array();
|
||||
$params['name'] = $request_params['card_name'];
|
||||
$params['cardNo'] = $request_params['id_number'];
|
||||
$res = $IdCard->checkIdCard($params);
|
||||
if (!empty($res)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,$res);
|
||||
}
|
||||
|
||||
Db::beginTransaction();
|
||||
@@ -377,16 +375,14 @@ class PatientFamilyService extends BaseService
|
||||
$sex = getIdCardSex($this->request->input('id_number'));
|
||||
|
||||
// 实人认证-生产环境开启
|
||||
if (env("APP_ENV") == "prod"){
|
||||
$IdCard = new IdCard();
|
||||
$IdCard = new IdCard();
|
||||
|
||||
$params =array();
|
||||
$params['name'] = $request_params['card_name'];
|
||||
$params['cardNo'] = $request_params['id_number'];
|
||||
$res = $IdCard->checkIdCard($params);
|
||||
if (!empty($res)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,$res);
|
||||
}
|
||||
$params =array();
|
||||
$params['name'] = $request_params['card_name'];
|
||||
$params['cardNo'] = $request_params['id_number'];
|
||||
$res = $IdCard->checkIdCard($params);
|
||||
if (!empty($res)){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,$res);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,9 @@ use App\Model\ProductPlatformAmount;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Model\UserShipAddress;
|
||||
use App\Utils\Log;
|
||||
use Extend\Prescription\Prescription;
|
||||
use Extend\Wechat\WechatPay;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hyperf\Amqp\Producer;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Snowflake\IdGeneratorInterface;
|
||||
@@ -705,14 +707,12 @@ class PatientOrderService extends BaseService
|
||||
return success($result);
|
||||
}
|
||||
|
||||
// 模拟支付成功-金额为0时使用
|
||||
|
||||
/**
|
||||
*
|
||||
*模拟支付成功-金额为0时使用
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @throws \GuzzleHttp\Exception\GuzzleException
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function addPatientOrderPay(): array
|
||||
{
|
||||
@@ -788,7 +788,7 @@ class PatientOrderService extends BaseService
|
||||
}
|
||||
|
||||
// 发送消息
|
||||
$ImService->sendTextMessage($user_doctor['user_id'],$order_inquiry['user_id'],"等待医生接诊",$order_inquiry['order_inquiry_id'],$order_inquiry['inquiry_type']);
|
||||
$ImService->sendMessage($user_doctor['user_id'],$order_inquiry['user_id'],"等待医生接诊",$order_inquiry['order_inquiry_id'],$order_inquiry['inquiry_type']);
|
||||
}
|
||||
|
||||
|
||||
@@ -884,7 +884,14 @@ class PatientOrderService extends BaseService
|
||||
}
|
||||
|
||||
// 获取运费金额
|
||||
$logistics_fee = 0;
|
||||
$Prescription = new Prescription();
|
||||
|
||||
$result = $Prescription->getLogisticsFee();
|
||||
if ($amount_total >= $result['drugCost']){
|
||||
$logistics_fee = 0;
|
||||
}else{
|
||||
$logistics_fee = $result['freight'];
|
||||
}
|
||||
|
||||
// 实际支付金额
|
||||
$payment_amount_total = $amount_total + $logistics_fee;
|
||||
@@ -1134,7 +1141,6 @@ class PatientOrderService extends BaseService
|
||||
|
||||
$amount_total = 0;
|
||||
$coupon_amount_total = 0;
|
||||
$logistics_fee = 0; // 运费金额
|
||||
foreach ($order_prescription_product as &$item) {
|
||||
$params = array();
|
||||
$params['product_id'] = $item['product_id'];
|
||||
@@ -1158,6 +1164,14 @@ class PatientOrderService extends BaseService
|
||||
}
|
||||
|
||||
// 获取运费金额
|
||||
$Prescription = new Prescription();
|
||||
|
||||
$result = $Prescription->getLogisticsFee();
|
||||
if ($amount_total >= $result['drugCost']){
|
||||
$logistics_fee = 0;
|
||||
}else{
|
||||
$logistics_fee = $result['freight'];
|
||||
}
|
||||
|
||||
// 实际支付金额
|
||||
$payment_amount_total = $amount_total + $logistics_fee;
|
||||
|
||||
@@ -33,7 +33,9 @@ use App\Model\UserDoctor;
|
||||
use App\Model\UserDoctorInfo;
|
||||
use App\Utils\Mask;
|
||||
use Extend\Alibaba\Oss;
|
||||
use Extend\VerifyDun\BankCard;
|
||||
use Extend\Wechat\Wechat;
|
||||
use GuzzleHttp\Exception\GuzzleException;
|
||||
use Hyperf\Amqp\Producer;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Redis\Redis;
|
||||
@@ -201,6 +203,7 @@ class UserDoctorService extends BaseService
|
||||
/**
|
||||
* 新增绑定医生银行卡
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function addDoctorBankCard(): array
|
||||
{
|
||||
@@ -252,10 +255,28 @@ class UserDoctorService extends BaseService
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "已绑定银行卡");
|
||||
}
|
||||
|
||||
// 获取医生详情数据
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_doctor['doctor_id'];
|
||||
$user_doctor_info = UserDoctorInfo::getOne($params);
|
||||
if (empty($user_doctor_info)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 处理银行卡掩码
|
||||
$bank_card_code_mask = Mask::maskBankCard($bank_card_code);
|
||||
|
||||
// 验证银行卡
|
||||
$BankCard = new BankCard();
|
||||
|
||||
$params = array();
|
||||
$params['bankCardNo'] = $bank_card_code;
|
||||
$params['name'] = $user_doctor_info['card_name'];
|
||||
$params['idCardNo'] = $user_doctor_info['card_num'];
|
||||
$res = $BankCard->checkBankCard($params);
|
||||
if (!$res){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,$res);
|
||||
}
|
||||
|
||||
Db::beginTransaction();
|
||||
|
||||
@@ -298,6 +319,7 @@ class UserDoctorService extends BaseService
|
||||
/**
|
||||
* 更换医生银行卡
|
||||
* @return array
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function putDoctorBankCard(): array
|
||||
{
|
||||
@@ -312,6 +334,7 @@ class UserDoctorService extends BaseService
|
||||
|
||||
// 获取医生银行卡
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['bank_card_id'] = $bank_card_id;
|
||||
$doctor_bank_card = DoctorBankCard::getOne($params);
|
||||
if (empty($doctor_bank_card)) {
|
||||
@@ -346,7 +369,25 @@ class UserDoctorService extends BaseService
|
||||
// 处理银行卡掩码
|
||||
$bank_card_code_mask = Mask::maskBankCard($bank_card_code);;
|
||||
|
||||
// 获取医生详情数据
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_doctor['doctor_id'];
|
||||
$user_doctor_info = UserDoctorInfo::getOne($params);
|
||||
if (empty($user_doctor_info)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 验证银行卡
|
||||
$BankCard = new BankCard();
|
||||
|
||||
$params = array();
|
||||
$params['bankCardNo'] = $bank_card_code;
|
||||
$params['name'] = $user_doctor_info['card_name'];
|
||||
$params['idCardNo'] = $user_doctor_info['card_num'];
|
||||
$res = $BankCard->checkBankCard($params);
|
||||
if (!$res){
|
||||
return fail(HttpEnumCode::HTTP_ERROR,$res);
|
||||
}
|
||||
|
||||
// 修改银行卡
|
||||
$params = array();
|
||||
|
||||
Reference in New Issue
Block a user