完善对接 盈谷接口,修改 判断医嘱时间

main
yanzai 1 year ago
parent 3b621bc1cb
commit bd41eec8c4

@ -129,10 +129,7 @@ class SignInController extends Controller
if (!json_decode($r, true)) { if (!json_decode($r, true)) {
return ['status'=>false,'msg'=>"解析'删除签到接口'数据出错:".$r]; return ['status'=>false,'msg'=>"解析'删除签到接口'数据出错:".$r];
} }
$r = $r['SendResult'];
$res = json_decode($r, true); $res = json_decode($r, true);
if($res['isSuccess']==true){ if($res['isSuccess']==true){
return ['status'=>true,'msg'=>$res['resultMsg'],'data'=>$res['resultDatas']]; return ['status'=>true,'msg'=>$res['resultMsg'],'data'=>$res['resultDatas']];
}else{ }else{
@ -204,7 +201,6 @@ class SignInController extends Controller
if (!json_decode($r, true)) { if (!json_decode($r, true)) {
return ['status'=>false,'msg'=>"解析'删除签到接口'数据出错:".$r]; return ['status'=>false,'msg'=>"解析'删除签到接口'数据出错:".$r];
} }
$r = $r['SendResult'];
$res = json_decode($r, true); $res = json_decode($r, true);
if($res['isSuccess']==true){ if($res['isSuccess']==true){
return ['status'=>true,'']; return ['status'=>true,''];

@ -137,23 +137,38 @@ class Tools
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
$r = curl_exec($ch); $r = curl_exec($ch);
\Illuminate\Support\Facades\Log::info($r);
$r = '<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV=\'http://schemas.xmlsoap.org/soap/envelope/\' xmlns:xsi=\'http://www.w3.org/2001/XMLSchema-instance\' xmlns:s=\'http://www.w3.org/2001/XMLSchema\'>
<SOAP-ENV:Body><SendResponse xmlns="http://bjgoodwillcis.com"><SendResult><![CDATA[{"resultCode": 0, "resultMsg": "登记成功", "resultDatas": [{"videoRoom": "", "extNo": "41656268!2", "extParam": "", "checkNo": "USFF1604109", "imageNo": "0000000053", "patientUrl": "https://nanshan-jk.yizhen.cn/yizhen-patient/login?p=ODQwMDA2&amp;itemFkBase=MTg5OTA5MDE", "currentNum": 0, "isStudyGroupRegistration": "Y", "queueNo": "A516"}], "isSuccess": true}]]></SendResult></SendResponse></SOAP-ENV:Body>
</SOAP-ENV:Envelope>';
try { try {
$res = explode('<SOAP-ENV:Body>', $r)[1]; $xml = simplexml_load_string($r, 'SimpleXMLElement', LIBXML_NOCDATA);
$res = explode('</SOAP-ENV:Body>', $res)[0]; $namespaces = $xml->getNamespaces(true);
$xmlData = simplexml_load_string($res); $xml->registerXPathNamespace('soapenv', $namespaces['SOAP-ENV']);
$jsonData = json_encode($xmlData, JSON_UNESCAPED_UNICODE); $xml->registerXPathNamespace('ns', 'http://bjgoodwillcis.com');
// 提取 CDATA 内容
$sendResult = $xml->xpath('//ns:SendResult')[0];
$jsonData = (string)$sendResult;
// $res = explode('<SOAP-ENV:Body>', $r)[1];
// $res = explode('</SOAP-ENV:Body>', $res)[0];
// $xmlData = simplexml_load_string($res);
// $jsonData = json_encode($xmlData, JSON_UNESCAPED_UNICODE);
}catch (Exception $e) { }catch (Exception $e) {
$jsonData = $e->getMessage(); $jsonData = $e->getMessage();
} }
// dd($res);
// $result = json_decode($jsonData, true);
$result = json_decode($jsonData, true);
// dd($result);
curl_close($ch); curl_close($ch);
$data=[ $data=[
'response_data'=>$r 'response_data'=>$r
]; ];
self::RequestLog($data,$log_id); self::RequestLog($data,$log_id);
return $result; return $jsonData;
} }
public static function RequestLog($arr,$id,$mark='') public static function RequestLog($arr,$id,$mark='')
{ //记录请求日志 { //记录请求日志

@ -209,7 +209,7 @@ WHERE
$date = new DateTime($entrust_time); $date = new DateTime($entrust_time);
$date->modify("+" . $item->check_begin_time . " minutes"); $date->modify("+" . $item->check_begin_time . " minutes");
$enableCheckTime = $date;//到此时间后可进行预约 $enableCheckTime = $date;//到此时间后可进行预约
$plan_dateTime = $planInfo->date . ' ' . $planInfo->begin_time; $plan_dateTime = $planInfo->date . ' ' . $planInfo->end_time;
$plan_dateTime = new DateTime($plan_dateTime); $plan_dateTime = new DateTime($plan_dateTime);
if ($plan_dateTime < $enableCheckTime) return \Yz::echoError1($item->item_name . " 已设置只能预约医嘱开具后" . $item->check_begin_time . "分钟后的时间,请预约" . $enableCheckTime->format("Y-m-d H:i:s") . "之后的时间"); if ($plan_dateTime < $enableCheckTime) return \Yz::echoError1($item->item_name . " 已设置只能预约医嘱开具后" . $item->check_begin_time . "分钟后的时间,请预约" . $enableCheckTime->format("Y-m-d H:i:s") . "之后的时间");

Loading…
Cancel
Save