|
|
|
|
@ -29,6 +29,7 @@ class PEISApiController extends Controller
|
|
|
|
|
$api['团检预约取消'] = "{$url}/PEISCommon/CancelUnitAppointment/{$code}";
|
|
|
|
|
$api['体检报告查询'] = "{$url}/PEISCommon/QueryExamReport/{$code}";
|
|
|
|
|
$api['预约时段修改'] = "{$url}/PEISCommon/ModifyAppointmentDTRange/{$code}";
|
|
|
|
|
$api['修改用户预约时间'] = "http://10.0.20.227:8888/ExtAPI/SetAppointmentMoment?key=YmMxOGI2MDUxZmFh&{$code}";
|
|
|
|
|
|
|
|
|
|
return $api["{$url_code}"] ?? $url_code;
|
|
|
|
|
}
|
|
|
|
|
@ -62,6 +63,52 @@ class PEISApiController extends Controller
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!json_decode($res_string, true)) {
|
|
|
|
|
return \Yz::Return(false, '获取失败', [
|
|
|
|
|
'url' => $url,
|
|
|
|
|
'data' => $data,
|
|
|
|
|
'res' => $res_string
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
$res = json_decode($res_string, true);
|
|
|
|
|
if ($res['ResultCode'] != 0){
|
|
|
|
|
throw new HttpResponseException( \Yz::echoError1("体检系统提示:". $res['ResultContent']));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
'code' => $res['ResultCode'],
|
|
|
|
|
'message' => $res['ResultContent'],
|
|
|
|
|
'data' => $res['Records']
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
public static function Post2($url_code,$url, $hospital_id, $data)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
$hospital = DB::table('hospitals')->where(['id' => $hospital_id, 'status' => 1, 'is_del' => 0])->first();
|
|
|
|
|
if (!$hospital) return \Yz::echoError1('医院不存在或不可用');
|
|
|
|
|
$code = $hospital->code;
|
|
|
|
|
self::RequestLog($url, $data, $code, $url_code);
|
|
|
|
|
$data_string = json_encode($data, JSON_UNESCAPED_UNICODE);
|
|
|
|
|
$ch = curl_init();
|
|
|
|
|
curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
|
|
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
|
|
|
|
'Content-Type: application/json; charset=utf-8',
|
|
|
|
|
'Content-Length: ' . strlen($data_string)
|
|
|
|
|
]);
|
|
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
|
|
|
|
|
$res_string = curl_exec($ch);
|
|
|
|
|
curl_close($ch);
|
|
|
|
|
$str_len = mb_strlen($res_string, 'utf-8');
|
|
|
|
|
$str_size = $str_len / 1024;
|
|
|
|
|
$save_res = $res_string;
|
|
|
|
|
if ($str_size > 10) $save_res = '{"data":"Row size too large"}';
|
|
|
|
|
self::$request->response_data = $save_res;
|
|
|
|
|
self::$request->save();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!json_decode($res_string, true)) {
|
|
|
|
|
return \Yz::Return(false, '获取失败', [
|
|
|
|
|
'url' => $url,
|
|
|
|
|
|