二线增加胃肠镜预约(未测通)

main
yanzai 6 months ago
parent 15dcb4efbc
commit 24edc0c1a9

@ -44,8 +44,8 @@ class AspNetZhuanController extends Controller
//二线预约 //二线预约
public static function ErXian($data,$nonce) public static function ErXian($data,$nonce)
{ {
// $res= self::Post(self::$BaseUrl . '/erxianzhongzhuan.aspx?str='.$nonce,$data,'二线号源'); $res= self::Post(self::$BaseUrl . '/test.aspx?str='.$nonce,$data,'二线号源');
$res= self::Post(self::$BaseUrl . '/erxian.aspx?str='.$nonce,$data,'二线号源'); // $res= self::Post(self::$BaseUrl . '/erxian.aspx?str='.$nonce,$data,'二线号源');
if($data['action']==2) return $res['gid']??false; if($data['action']==2) return $res['gid']??false;
return $res['data']??true; return $res['data']??true;
} }

@ -367,7 +367,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
if($r_v['zu_name'] == $n1v['组名称']){ if($r_v['zu_name'] == $n1v['组名称']){
foreach ($n1v['包含项目'] as $k2 => $v2){ foreach ($n1v['包含项目'] as $k2 => $v2){
if($v2['Id'] == $r_v['item_id']){ if($v2['Id'] == $r_v['item_id']){
if($v2['科室名称']=='影像科'){ if($v2['科室名称']=='影像科' or $v2['科室名称']=='胃肠镜室'){
$nmr_list[]=[ $nmr_list[]=[
'item_id' => $v2['Id'], 'item_id' => $v2['Id'],
'name' => $v2['名称'], 'name' => $v2['名称'],
@ -454,7 +454,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
} }
$combo_info['tags'][0]['text']=$comboItemCount. '个项目'; $combo_info['tags'][0]['text']=$comboItemCount. '个项目';
//如果有影像科则存储在nmr_list //如果有影像科则存储在nmr_list
$comboItem=DB::table('combo_items')->where(['combo_id' => $combo_id, 'status' => 1,'keshi_name'=>'影像科'])->get(); $comboItem=DB::table('combo_items')->where(['combo_id' => $combo_id, 'status' => 1])->whereIn('keshi_name',['影像科','胃肠镜室'])->get();
if(count($comboItem)>0){ if(count($comboItem)>0){
foreach ($comboItem as $item){ foreach ($comboItem as $item){
$nmr_list[]=[ $nmr_list[]=[
@ -493,7 +493,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
$groupedData[$keshiName][] = ['desc' => $item->jianjie, 'name' => $item->name,'price'=>number_format( $item->price * config('app.globals.ZiXuan_ZheKou'), 2, '.', ''),'original_price'=>$item->original_price,'id'=>$item->item_id]; $groupedData[$keshiName][] = ['desc' => $item->jianjie, 'name' => $item->name,'price'=>number_format( $item->price * config('app.globals.ZiXuan_ZheKou'), 2, '.', ''),'original_price'=>$item->original_price,'id'=>$item->item_id];
//如果有影像科则存储在nmr_list字段 //如果有影像科则存储在nmr_list字段
if($item->keshi_name=='影像科'){ if($item->keshi_name=='影像科' or $item->keshi_name=='胃肠镜室'){
$nmr_list[]=[ $nmr_list[]=[
'item_id' => $item->item_id, 'item_id' => $item->item_id,
'name' => $item->name, 'name' => $item->name,
@ -583,7 +583,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
if ($it->item_id == $item['id']) { if ($it->item_id == $item['id']) {
$item['keshi_name'] = $it->keshi_name; $item['keshi_name'] = $it->keshi_name;
$item['desc'] = $it->jianjie; $item['desc'] = $it->jianjie;
if($it->keshi_name=='影像科'){ if($it->keshi_name=='影像科' or $it->keshi_name=='胃肠镜室'){
$nmr_list[]=[ $nmr_list[]=[
'item_id' => $it->item_id, 'item_id' => $it->item_id,
'name' => $it->name, 'name' => $it->name,
@ -620,17 +620,19 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
} }
$temp_nmr=[]; $temp_nmr=[];
$keywords = ['磁']; $keywords = ['磁','食管镜','肠镜检'];
foreach ($nmr_list as $key=>$item){ foreach ($nmr_list as $key=>$item){
foreach ($keywords as $index => $keyword) { foreach ($keywords as $index => $keyword) {
if (strpos($item['name'], $keyword) !== false) { if (strpos($item['name'], $keyword) !== false) {
// 如果找到关键字,且结果数组中还没有该关键字的记录,则初始化 // 如果找到关键字,且结果数组中还没有该关键字的记录,则初始化
$leixing=$index+1;
if (!isset($temp_nmr[$index])) { if (!isset($temp_nmr[$index])) {
$temp_nmr[$index] = [ $temp_nmr[$index] = [
'item_id' => $item['item_id'], 'item_id' => $item['item_id'],
'name' => $item['name'], 'name' => $item['name'],
'price' => $item['price'], 'price' => $item['price'],
'leixing' => $leixing,
]; ];
} else { } else {
// 如果已经存在记录,只拼接名称 // 如果已经存在记录,只拼接名称
@ -645,7 +647,8 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
$finalResult[] = [ $finalResult[] = [
'item_id' => $data['item_id'], 'item_id' => $data['item_id'],
'name' => $data['name'], 'name' => $data['name'],
'price' => $data['price'] 'price' => $data['price'],
'leixing' => $data['leixing'],
]; ];
} }

@ -444,9 +444,8 @@ class OrderController extends Controller
$plan_nmr_info=[]; $plan_nmr_info=[];
if (isset($erxian_info) and !empty($erxian_info)) { if (isset($erxian_info) and !empty($erxian_info)) {
foreach ($erxian_info as $erxian_item) { foreach ($erxian_info as $erxian_item) {
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$plan->date],'action'=>"1"],uniqid()); if($erxian_item['leixing']==1){
// if($plan->time<="12:00") $end_time="12:00"; $nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$plan->date],'action'=>"1",'leixing'=>$erxian_item['leixing']],uniqid());
// if($plan->time>"12:00") $end_time="23:59";
$end_time="23:59"; $end_time="23:59";
if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选择日期"); if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选择日期");
$temp_date=[]; $temp_date=[];
@ -460,6 +459,7 @@ class OrderController extends Controller
"name"=>$erxian_item['name'], "name"=>$erxian_item['name'],
"price"=>$erxian_item['price'], "price"=>$erxian_item['price'],
"time"=>$plan->date." ".$nmp_p['Time'], "time"=>$plan->date." ".$nmp_p['Time'],
"leixing"=>$erxian_item['leixing']
]; ];
$plan_nmr_info[]=$temp_date; $plan_nmr_info[]=$temp_date;
break; break;
@ -472,6 +472,41 @@ class OrderController extends Controller
} }
} }
if($erxian_item['leixing']==2 or $erxian_item['leixing']==3){
$find=false;
$startDate = $plan->date;
$date = new DateTime($startDate);
$date->modify('+1 day'); // 先跳过当天
for ($i = 0; $i < 15; $i++) {
$newdate=$date->format('Y-m-d');
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$newdate],'action'=>"1",'leixing'=>$erxian_item['leixing']],uniqid());
if(!isset($nmrPlans[$newdate]) or empty($nmrPlans[$newdate])){
$date->modify('+1 day');
continue;
}
foreach ($nmrPlans[$newdate] as $nmp_p){
if($nmp_p['keyong']==="0"){
$temp_date=[
"item_id"=>$erxian_item['item_id'],
"name"=>$erxian_item['name'],
"price"=>$erxian_item['price'],
"time"=>$newdate." ".$nmp_p['Time'],
"leixing"=>$erxian_item['leixing']
];
$plan_nmr_info[]=$temp_date;
$find=true;
break;
}
}
if($find) break;
// 增加一天
$date->modify('+1 day');
}
}
}
} }
@ -489,9 +524,10 @@ class OrderController extends Controller
'date' => $dt[0], 'date' => $dt[0],
'time' => $dt[1], 'time' => $dt[1],
'price' => $plan_nmr['price'], 'price' => $plan_nmr['price'],
'leixing' => $plan_nmr['leixing']
]; ];
//调用接口校验号源是否可用 //调用接口校验号源是否可用
$erxian_status = $AspNet::ErXian(['YYRQ' => $p_nmr_data['date'], 'YYSJ' => $p_nmr_data['time'], 'yyid' => $yyid, 'action' => 4], uniqid()); $erxian_status = $AspNet::ErXian(['YYRQ' => $p_nmr_data['date'], 'YYSJ' => $p_nmr_data['time'], 'yyid' => $yyid, 'action' => 4,'leixing'=>$p_nmr_data['leixing']], uniqid());
if ($erxian_status !== true) { if ($erxian_status !== true) {
if(isset($yuyue_fangshi) and $yuyue_fangshi<>'GeJianPlanFront') { //个检先选号源此处不提示 不拦截 if(isset($yuyue_fangshi) and $yuyue_fangshi<>'GeJianPlanFront') { //个检先选号源此处不提示 不拦截
return \Yz::echoError1($p_nmr_data['name'] . '号源不可用,请重新选择'); return \Yz::echoError1($p_nmr_data['name'] . '号源不可用,请重新选择');
@ -596,6 +632,7 @@ class OrderController extends Controller
'ZCRQ'=>$nowDateTime, 'ZCRQ'=>$nowDateTime,
'yyid'=>$yyid, 'yyid'=>$yyid,
'action'=>2, 'action'=>2,
'leixing'=>$plan_nmr['leixing']
]; ];
//调用接口预约二线 //调用接口预约二线
$erxian_yuyue= $AspNet::ErXian($p_nmr_data, uniqid()); $erxian_yuyue= $AspNet::ErXian($p_nmr_data, uniqid());

@ -319,6 +319,7 @@ class OrderNewController extends Controller
"item_id" => $erxian_item['item_id'], "item_id" => $erxian_item['item_id'],
"name" => $erxian_item['name'], "name" => $erxian_item['name'],
"price" => $erxian_item['price'], "price" => $erxian_item['price'],
"leixing"=>$erxian_item['leixing'],
]; ];
$plan_nmr_info[] = $temp_date; $plan_nmr_info[] = $temp_date;
} }
@ -486,8 +487,10 @@ class OrderNewController extends Controller
$erxian_info=json_decode($order->erxian_appointment_info,true); $erxian_info=json_decode($order->erxian_appointment_info,true);
$AspNet = new AspNetZhuanController(); $AspNet = new AspNetZhuanController();
if (isset($erxian_info) and !empty($erxian_info)) { if (isset($erxian_info) and !empty($erxian_info)) {
foreach ($erxian_info as $erxian_item) { foreach ($erxian_info as $key=> $erxian_item) {
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$plan->date],'action'=>"1"],uniqid());
if($erxian_item['leixing']==1){
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$plan->date],'action'=>"1",'leixing'=>$erxian_item['leixing']],uniqid());
$end_time="23:59"; $end_time="23:59";
if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选择日期"); if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选择日期");
$temp_date=[]; $temp_date=[];
@ -501,6 +504,7 @@ class OrderNewController extends Controller
"name"=>$erxian_item['name'], "name"=>$erxian_item['name'],
"price"=>$erxian_item['price'], "price"=>$erxian_item['price'],
"time"=>$plan->date." ".$nmp_p['Time'], "time"=>$plan->date." ".$nmp_p['Time'],
"leixing"=>$erxian_item['leixing']
]; ];
$plan_nmr_info[]=$temp_date; $plan_nmr_info[]=$temp_date;
break; break;
@ -508,8 +512,43 @@ class OrderNewController extends Controller
} }
if(empty($temp_date)) return \Yz::echoError1("二线号源不可用,请重新选择日期"); if(empty($temp_date)) return \Yz::echoError1("二线号源不可用,请重新选择日期");
} }
if($erxian_item['leixing']==2 or $erxian_item['leixing']==3){
$find=false;
$startDate = $plan->date;
$date = new DateTime($startDate);
$date->modify('+1 day'); // 先跳过当天
for ($i = 0; $i < 15; $i++) {
$newdate=$date->format('Y-m-d');
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$newdate],'action'=>"1",'leixing'=>$erxian_item['leixing']],uniqid());
if(!isset($nmrPlans[$newdate]) or empty($nmrPlans[$newdate])){
$date->modify('+1 day');
continue;
}
foreach ($nmrPlans[$newdate] as $nmp_p){
if($nmp_p['keyong']==="0"){
$temp_date=[
"item_id"=>$erxian_item['item_id'],
"name"=>$erxian_item['name'],
"price"=>$erxian_item['price'],
"time"=>$newdate." ".$nmp_p['Time'],
"leixing"=>$erxian_item['leixing']
];
$plan_nmr_info[]=$temp_date;
$find=true;
break;
}
}
if($find) break;
// 增加一天
$date->modify('+1 day');
}
} }
//校验二线号源
}
}
//校验二线号源
if (isset($plan_nmr_info) and !empty($plan_nmr_info)) { if (isset($plan_nmr_info) and !empty($plan_nmr_info)) {
$plan_nmr_temp = []; $plan_nmr_temp = [];
foreach ($plan_nmr_info as $key => $plan_nmr) { foreach ($plan_nmr_info as $key => $plan_nmr) {
@ -521,9 +560,10 @@ class OrderNewController extends Controller
'date' => $dt[0], 'date' => $dt[0],
'time' => $dt[1], 'time' => $dt[1],
'price' => $plan_nmr['price'], 'price' => $plan_nmr['price'],
'leixing' => $plan_nmr['leixing']
]; ];
//调用接口校验号源是否可用 //调用接口校验号源是否可用
$erxian_status = $AspNet::ErXian(['YYRQ' => $p_nmr_data['date'], 'YYSJ' => $p_nmr_data['time'], 'yyid' => $yyid, 'action' => 4], uniqid()); $erxian_status = $AspNet::ErXian(['YYRQ' => $p_nmr_data['date'], 'YYSJ' => $p_nmr_data['time'], 'yyid' => $yyid, 'action' => 4,'leixing'=>$p_nmr_data['leixing']], uniqid());
if ($erxian_status !== true) return \Yz::echoError1($p_nmr_data['name'] . '号源不可用,请重新选择'); if ($erxian_status !== true) return \Yz::echoError1($p_nmr_data['name'] . '号源不可用,请重新选择');
$plan_nmr_temp[] = $p_nmr_data; $plan_nmr_temp[] = $p_nmr_data;
} }
@ -559,6 +599,7 @@ class OrderNewController extends Controller
'ZCRQ'=>$nowDateTime, 'ZCRQ'=>$nowDateTime,
'yyid'=>$yyid, 'yyid'=>$yyid,
'action'=>2, 'action'=>2,
'leixing'=>$plan_nmr['leixing']
]; ];
//调用接口预约二线 //调用接口预约二线
$erxian_yuyue= $AspNet::ErXian($p_nmr_data, uniqid()); $erxian_yuyue= $AspNet::ErXian($p_nmr_data, uniqid());
@ -579,9 +620,11 @@ class OrderNewController extends Controller
'plan_id' => $plan->id, 'plan_id' => $plan->id,
'plan_number' => $plan->plan_number, 'plan_number' => $plan->plan_number,
'doctor' => $doctor, 'doctor' => $doctor,
'erxian_appointment_info'=>json_encode($plan_nmr_appointment_info, JSON_UNESCAPED_UNICODE),
'updated_at' => date('Y-m-d H:i:s') 'updated_at' => date('Y-m-d H:i:s')
]; ];
if(!empty($plan_nmr_appointment_info)){
$data['erxian_appointment_info']=json_encode($plan_nmr_appointment_info, JSON_UNESCAPED_UNICODE);
}
$u = DB::table('orders')->where(['id' => $orderid])->update($data); $u = DB::table('orders')->where(['id' => $orderid])->update($data);
$up_plan = DB::table('plans')->where(['id' => $plan->id, 'status' => 1])->update([ $up_plan = DB::table('plans')->where(['id' => $plan->id, 'status' => 1])->update([
'status' => 2 'status' => 2

@ -270,9 +270,9 @@ class OrderService
$erxian_info=json_decode($orderInfo->erxian_appointment_info, true); $erxian_info=json_decode($orderInfo->erxian_appointment_info, true);
if (isset($erxian_info) and !empty($erxian_info)) { if (isset($erxian_info) and !empty($erxian_info)) {
foreach ($erxian_info as $key => $plan_nmr) { foreach ($erxian_info as $key => $plan_nmr) {
if(isset($plan_nmr['gid'])){ if(isset($plan_nmr['gid']) and !empty($plan_nmr['gid'])){
//调用接口取消二线 //调用接口取消二线
$erxian_status = $AspNet::ErXian(['id' =>$plan_nmr['gid'], 'yyid' => $yyid, 'action' => 3], uniqid()); $erxian_status = $AspNet::ErXian(['id' =>$plan_nmr['gid'], 'yyid' => $yyid, 'action' => 3,'leixing'=>$plan_nmr['leixing']], uniqid());
$erxian_info[$key]['gid']=''; $erxian_info[$key]['gid']='';
$ex_u= DB::table('orders')->where(['id' => $orderInfo->id])->update([ $ex_u= DB::table('orders')->where(['id' => $orderInfo->id])->update([
'erxian_appointment_info'=>json_encode($erxian_info, JSON_UNESCAPED_UNICODE), 'erxian_appointment_info'=>json_encode($erxian_info, JSON_UNESCAPED_UNICODE),

@ -1,7 +1,7 @@
const app_type = 'gzh' const app_type = 'gzh'
//const base_url = "https://api.hainan2024.sa0.online" //开发环境 //const base_url = "https://api.hainan2024.sa0.online" //开发环境
const base_url="https://tj-h5.hnxdfe.com" //正式环境 //const base_url="https://tj-h5.hnxdfe.com" //正式环境
//const base_url="http://124.225.137.54:39081" //测试环境 const base_url="http://124.225.137.54:39081" //测试环境
const config = { const config = {
api_map_url: base_url + '/api/ApiMap/h5', api_map_url: base_url + '/api/ApiMap/h5',
base_assets_url: base_url, base_assets_url: base_url,

Loading…
Cancel
Save