新增物流回调,新增删除常用语
This commit is contained in:
parent
ac382e288c
commit
593b7956b3
@ -757,10 +757,27 @@ class CallBackController extends AbstractController
|
||||
return $this->platformLogisticsErrorReturn("缺少数据体");
|
||||
}
|
||||
|
||||
// 验证签名
|
||||
$sign_params = array();
|
||||
$sign_params['clientId'] = config('prescription_platform.client_id');
|
||||
$sign_params['paramJsonStr'] = $request_params['paramJsonStr'];
|
||||
$sign_params['timestamp'] = $request_params['timestamp'];
|
||||
$sign_params['nonce'] = $request_params['nonce'];
|
||||
$sign_params['clientSecret'] = config('prescription_platform.client_secret');
|
||||
$sign = md5(http_build_query($sign_params, '', '&'));
|
||||
if ($sign != $sign_params['sign']){
|
||||
Log::getInstance()->error("处方平台物流回调数据处理失败:签名错误");
|
||||
Log::getInstance()->error("系统签名:" . $sign);
|
||||
Log::getInstance()->error("处方平台签名:" . $sign);
|
||||
Log::getInstance()->error("处方平台签名:" . $sign_params['sign']);
|
||||
return $this->platformLogisticsErrorReturn("签名错误");
|
||||
}
|
||||
|
||||
$param_json_str = json_decode($request_params['paramJsonStr'],true);
|
||||
if (empty($param_json_str)){
|
||||
Log::getInstance()->error("处方平台物流回调数据处理失败:数据体解析失败");
|
||||
return $this->platformLogisticsErrorReturn("数据体解析失败");
|
||||
// 数据体为空,直接返回成功,不进行验证签名
|
||||
Log::getInstance()->info("处方平台物流回调数据处理成功:数据体解析为空");
|
||||
return $this->platformLogisticsSuccessReturn();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ class TestController extends AbstractController
|
||||
// $this->test_8();
|
||||
// $this->test_3();
|
||||
// $this->test_4();
|
||||
// $this->test_6();
|
||||
$this->test_6();
|
||||
// $this->test_9();
|
||||
|
||||
}
|
||||
@ -117,7 +117,7 @@ class TestController extends AbstractController
|
||||
// 下载阿里云图片
|
||||
$oss = new Oss();
|
||||
|
||||
$filename = "applet/doctor/cert/b09ebb06-be90-40cf-9329-fab5b15139ec.png";
|
||||
$filename = "applet/doctor/cert/f2abdb81-fac0-4264-bc11-aa2b6cf2761c.png";
|
||||
|
||||
$style = "image/resize,m_lfit,w_100,h_350";
|
||||
|
||||
@ -129,10 +129,10 @@ class TestController extends AbstractController
|
||||
|
||||
$sign_param = [
|
||||
[
|
||||
"llx"=> "700", // 左边底部X坐标
|
||||
"lly"=>"2985", // 左边底部Y坐标
|
||||
"urx"=>"1101", // 右边上部x坐标
|
||||
"ury"=>"2896", // 右边上部y坐标
|
||||
"llx"=> "500", // 左边底部X坐标
|
||||
"lly"=>"3015", // 左边底部Y坐标
|
||||
"urx"=>"850", // 右边上部x坐标
|
||||
"ury"=>"3115", // 右边上部y坐标
|
||||
"pageList"=>[1],
|
||||
"sealImg"=>$sign_image
|
||||
]
|
||||
@ -317,7 +317,7 @@ class TestController extends AbstractController
|
||||
|
||||
$oss = new Oss();
|
||||
|
||||
$filename = "applet/doctor/cert/b09ebb06-be90-40cf-9329-fab5b15139ec.png";
|
||||
$filename = "applet/doctor/cert/f2abdb81-fac0-4264-bc11-aa2b6cf2761c.png";
|
||||
|
||||
$style = "image/resize,m_lfit,w_100,h_350";
|
||||
|
||||
@ -328,14 +328,22 @@ class TestController extends AbstractController
|
||||
}
|
||||
|
||||
$sign_param = [
|
||||
[
|
||||
"llx"=> "700", // 左边底部X坐标
|
||||
"lly"=>"2985", // 左边底部Y坐标
|
||||
"urx"=>"1101", // 右边上部x坐标
|
||||
"ury"=>"2896", // 右边上部y坐标
|
||||
[ // 医生端
|
||||
"llx"=>"120", // 左边底部X坐标
|
||||
"lly"=>"190", // 左边底部Y坐标
|
||||
"urx"=>"190", // 右边上部x坐标
|
||||
"ury"=>"140", // 右边上部y坐标
|
||||
"pageList"=>[1],
|
||||
"sealImg"=>$sign_image
|
||||
]
|
||||
],
|
||||
// [ // 药师端
|
||||
// "llx"=>"350", // 左边底部X坐标
|
||||
// "lly"=>"190", // 左边底部Y坐标
|
||||
// "urx"=>"440", // 右边上部x坐标
|
||||
// "ury"=>"140", // 右边上部y坐标
|
||||
// "pageList"=>[1],
|
||||
// "sealImg"=>$sign_image
|
||||
// ]
|
||||
];
|
||||
$data = array();
|
||||
$data['sign_param'] = json_encode($sign_param);
|
||||
@ -343,8 +351,26 @@ class TestController extends AbstractController
|
||||
|
||||
$ca = new Ca();
|
||||
$result = $ca->addSignPdf("491925054435950592",$data);
|
||||
// fclose($data['pdf_file']);
|
||||
|
||||
$file_id = $result[0]['fileId'];
|
||||
|
||||
$result = $ca->getSignedFile("491925054435950592",$file_id);
|
||||
if (empty($result)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
// $file = fopen("./runtime/test.pdf", "w") or die("Unable to open file!");
|
||||
// fwrite($file, $result);
|
||||
// fclose($file);
|
||||
|
||||
// 上传阿里云oss
|
||||
|
||||
$oss = new Oss();
|
||||
|
||||
$filename = "applet/doctor/prescription/test.pdf";
|
||||
|
||||
$result = $oss->putObject($filename, $result);
|
||||
dump($result);
|
||||
}
|
||||
|
||||
// 延迟队列测试
|
||||
@ -390,13 +416,19 @@ class TestController extends AbstractController
|
||||
// 下载签章的pdf文件
|
||||
public function test_9(){
|
||||
$ca = new Ca();
|
||||
$result = $ca->getSignedFile("491925054435950592","1638477783898161153");
|
||||
$result = $ca->getSignedFile("491925054435950592","1638734851418783746");
|
||||
if (empty($result)){
|
||||
return fail();
|
||||
}
|
||||
|
||||
// 上传阿里云oss
|
||||
|
||||
$oss = new Oss();
|
||||
|
||||
$filename = "applet/doctor/prescription/491925054435950592.pdf";
|
||||
|
||||
$result = $oss->putObject($filename, $result);
|
||||
dump($result);
|
||||
}
|
||||
|
||||
}
|
||||
@ -198,6 +198,22 @@ class UserDoctorController extends AbstractController
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除常用语
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function deleteDoctorWords(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(UserDoctorRequest::class);
|
||||
$request->scene('deleteDoctorWords')->validateResolved();
|
||||
|
||||
$UserDoctorService = new UserDoctorService();
|
||||
$data = $UserDoctorService->deleteDoctorWords();
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生评价
|
||||
* @return ResponseInterface
|
||||
|
||||
@ -72,4 +72,14 @@ class DoctorWord extends Model
|
||||
{
|
||||
return self::create($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param array $params
|
||||
* @return int|mixed
|
||||
*/
|
||||
public static function deleteDoctorWord(array $params): mixed
|
||||
{
|
||||
return self::where($params)->delete();
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,6 +50,10 @@ class UserDoctorRequest extends FormRequest
|
||||
'words',
|
||||
'words_type'
|
||||
],
|
||||
'deleteDoctorWords' => [ // 删除常用语
|
||||
'words',
|
||||
'words_type'
|
||||
],
|
||||
'getDoctorEvaluationList' => [ // 获取医生评价
|
||||
'doctor_id',
|
||||
'evaluation_type',
|
||||
|
||||
@ -590,7 +590,7 @@ class UserDoctorService extends BaseService
|
||||
foreach ($basic_words as $item) {
|
||||
$data = array();
|
||||
$data['words'] = $item['basics_words'];
|
||||
|
||||
$data['is_system'] = 1;
|
||||
$result[] = $data;
|
||||
}
|
||||
}
|
||||
@ -605,7 +605,7 @@ class UserDoctorService extends BaseService
|
||||
foreach ($doctor_words as $item) {
|
||||
$data = array();
|
||||
$data['words'] = $item['words'];
|
||||
|
||||
$data['is_system'] = 0;
|
||||
$result[] = $data;
|
||||
}
|
||||
}
|
||||
@ -653,6 +653,33 @@ class UserDoctorService extends BaseService
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除常用语
|
||||
* @return array
|
||||
*/
|
||||
public function deleteDoctorWords(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$words = $this->request->input('words');
|
||||
$words_type = $this->request->input('words_type');
|
||||
|
||||
// 查询是否重复
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_info['client_user_id'];
|
||||
$params['words_type'] = $words_type;
|
||||
$params['words'] = $words;
|
||||
$doctor_words = DoctorWord::getOne($params);
|
||||
if (empty($doctor_words)) {
|
||||
return fail();
|
||||
}
|
||||
|
||||
$params = array();
|
||||
$params['doctor_words_id'] = $doctor_words['doctor_words_id'];
|
||||
DoctorWord::deleteDoctorWord($params);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生评价
|
||||
* @return array
|
||||
|
||||
@ -85,4 +85,9 @@ return [
|
||||
"secret" => env('CA_APP_SECRET', 'facded39929f4aef9893cb766cd52e25'),
|
||||
"api_url" => env('CA_APP_URL', 'http://testmicrosrv.scca.com.cn:9527'),
|
||||
],
|
||||
'prescription_platform' => [ // 处方平台
|
||||
"client_id" => env('PRE_PLAT_CLIENT_ID', 'ZD-004'),
|
||||
"client_secret" => env('PRE_PLAT_CLIENT_SECRET', '0baa5927164710b9f800bf33546b6da3'),
|
||||
"api_url" => env('PRE_PLAT_APP_URL', 'http://49.233.3.200:6304/api/thridapi/'),
|
||||
],
|
||||
];
|
||||
|
||||
@ -161,6 +161,9 @@ Router::addGroup('/doctor', function () {
|
||||
|
||||
// 新增常用语列表
|
||||
Router::post('', [UserDoctorController::class, 'addDoctorWords']);
|
||||
|
||||
// 删除常用语列表
|
||||
Router::delete('', [UserDoctorController::class, 'deleteDoctorWords']);
|
||||
});
|
||||
|
||||
// 医生数据
|
||||
|
||||
@ -32,9 +32,9 @@ class Prescription
|
||||
|
||||
public function __construct(){
|
||||
// 请求地址
|
||||
$this->api_url = "http://49.233.3.200:6304/api/thridapi/";
|
||||
$this->client_id = "ZD-004";
|
||||
$this->client_secret = "0baa5927164710b9f800bf33546b6da3";
|
||||
$this->api_url = config('prescription_platform.api_url');
|
||||
$this->client_id = config('prescription_platform.client_id');
|
||||
$this->client_secret = config('prescription_platform.client_secret');
|
||||
$this->container = ApplicationContext::getContainer();
|
||||
$this->client = $this->container->get(Client::class);
|
||||
}
|
||||
|
||||
@ -56,6 +56,11 @@ AMQP_VHOST=gdxz_2022rabbitmq
|
||||
# [CA]
|
||||
CA_APP_ID=SCCA1560150113940832258
|
||||
CA_APP_SECRET=facded39929f4aef9893cb766cd52e25
|
||||
|
||||
# [处方平台]
|
||||
PRE_PLAT_CLIENT_ID=ZD-004
|
||||
PRE_PLAT_CLIENT_SECRET=0baa5927164710b9f800bf33546b6da3
|
||||
PRE_PLAT_APP_URL=http://49.233.3.200:6304/api/thridapi/
|
||||
">.env
|
||||
|
||||
#nginx_upstrame="/Users/wucongxing/Desktop/test/hospital-upstream.conf"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user