From 9291731396eacb2b24604add000a0a485115810b Mon Sep 17 00:00:00 2001 From: yanzai Date: Tue, 1 Apr 2025 17:18:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A9=9A=E6=A3=80=E6=94=B9=E7=BA=A6=20?= =?UTF-8?q?=E8=B0=83=E7=94=A8his?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/API/H5/OrderController.php | 117 +++++++++++------- 1 file changed, 70 insertions(+), 47 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/H5/OrderController.php b/Laravel/app/Http/Controllers/API/H5/OrderController.php index 5919b49..c5168cd 100644 --- a/Laravel/app/Http/Controllers/API/H5/OrderController.php +++ b/Laravel/app/Http/Controllers/API/H5/OrderController.php @@ -832,6 +832,26 @@ class OrderController extends Controller $asp = new AspNetZhuanController(); $asp::SendMsg($orderInfo->hospital_id, $orderInfo->phone, $orderInfo->name, $planInfo->date . ' ' . substr($planInfo->time, 0, 5),$orderInfo->sex); } + if($orderInfo->checkup_type_id==4){ //如果是婚检调用his取消 + $his_info=json_decode($orderInfo->his_info,true); + if(!!$his_info and isset($his_info['hunjian_yuyue_gid']) and !empty($his_info['hunjian_yuyue_gid'])){ + $his_data=[ + "action" => "2", + "yyid" => $yyid, + "ghzid" => $person->ghzid, + "ID"=>$his_info['hunjian_yuyue_gid'] + ]; + $res=$AspNet::HunjianHis($his_data); + if ($res['code'] == "200") { + $his_info['hunjian_yuyue_gid']=null; + $u = DB::table('orders')->where(['id' => $orderInfo->id])->update([ + 'his_info'=>json_encode($his_info, JSON_UNESCAPED_UNICODE) + ]); + } + } + $orderInfo = DB::table('orders')->where(['id' => $orderid, 'status' => 2])->first(); + $this->HisInsertHunjian($orderInfo,$yyid,$person); + } } return \Yz::Return(true, "操作完成", []); } @@ -1066,56 +1086,59 @@ class OrderController extends Controller } //如果是婚检发送给his if($order_info->checkup_type_id==4 and isset($create_appointment['data'][0][0]) and $order_info->status==2){ - $sex=''; - if($order_info->sex=='1') $sex='男'; - if($order_info->sex=='2') $sex='女'; - $loginfo=DB::table('questions_log')->where(['personid' => $order_info->person_id])->orderBy('id','desc')->first(); - if(!$loginfo) return ['status' => false,'msg' => "未找到婚检问题记录"]; - $loginfo=json_decode($loginfo->content,true); - $data_array = [ - "action" => "1", - "ghzid" => $person->ghzid, - "yyid" => $yyid, - "YYDH" => $order_info->phone, - "YYXM" => $order_info->name, - "YYXB" => $sex, - "YYSR" => $order_info->birthday, - "YYNL" => Tools::GetAge($order_info->birthday), - "YYZJ" =>$order_info->id_number, - "YYRQ" => $order_info->appointment_date, - "YYSJ" => substr($order_info->appointment_time, 0, 5), - "YYSJ_B" => $order_info->appointment_time, - "YYSJ_E" => $order_info->appointment_time, - "YYSJ_BE" =>substr($order_info->appointment_time, 0, 5).'-'.substr($order_info->appointment_time, 0, 5), - "zy"=>$loginfo['职业'], - "whcd"=>$loginfo['文化程度'], - "gj"=>$loginfo['国籍'], - "mz"=>$loginfo['民族'], - "csd"=>$loginfo['出生地'], - "sBjSfz"=>$order_info->id_number, - "s_province"=>$loginfo['户籍地址省市区'][0]['text'], - "s_city"=>$loginfo['户籍地址省市区'][1]['text'], - "s_county"=>$loginfo['户籍地址省市区'][2]['text'], - "xxdz"=>$loginfo['现地址'], - "yzbm"=>"", - "dw"=>$loginfo['工作单位'], - "poxm"=>$loginfo['配偶姓名'], - "xb"=>$loginfo['血缘关系'], - "hjdz"=>$loginfo['户籍地址'], + $this->HisInsertHunjian($order_info,$yyid,$person); + } + return ['status' => true, 'msg' => "完成"]; + } + public function HisInsertHunjian($order_info,$yyid,$person){ + $loginfo=DB::table('questions_log')->where(['personid' => $order_info->person_id])->orderBy('id','desc')->first(); + if(!$loginfo) return ['status' => false,'msg' => "未找到婚检问题记录"]; + $loginfo=json_decode($loginfo->content,true); + $sex=''; + if($order_info->sex=='1') $sex='男'; + if($order_info->sex=='2') $sex='女'; + $data_array = [ + "action" => "1", + "ghzid" => $person->ghzid, + "yyid" => $yyid, + "YYDH" => $order_info->phone, + "YYXM" => $order_info->name, + "YYXB" => $sex, + "YYSR" => $order_info->birthday, + "YYNL" => Tools::GetAge($order_info->birthday), + "YYZJ" =>$order_info->id_number, + "YYRQ" => $order_info->appointment_date, + "YYSJ" => substr($order_info->appointment_time, 0, 5), + "YYSJ_B" => $order_info->appointment_time, + "YYSJ_E" => $order_info->appointment_time, + "YYSJ_BE" =>substr($order_info->appointment_time, 0, 5).'-'.substr($order_info->appointment_time, 0, 5), + "zy"=>$loginfo['职业'], + "whcd"=>$loginfo['文化程度'], + "gj"=>$loginfo['国籍'], + "mz"=>$loginfo['民族'], + "csd"=>$loginfo['出生地'], + "sBjSfz"=>$order_info->id_number, + "s_province"=>$loginfo['户籍地址省市区'][0]['text'], + "s_city"=>$loginfo['户籍地址省市区'][1]['text'], + "s_county"=>$loginfo['户籍地址省市区'][2]['text'], + "xxdz"=>$loginfo['现地址'], + "yzbm"=>"", + "dw"=>$loginfo['工作单位'], + "poxm"=>$loginfo['配偶姓名'], + "xb"=>$loginfo['血缘关系'], + "hjdz"=>$loginfo['户籍地址'], + ]; + $aspnet=new AspNetZhuanController(); + $res = $aspnet->HunjianHis($data_array); + if ($res['code'] == "200") { + $his_info=[ + "hunjian_yuyue_gid"=>$res['gid'], ]; - $aspnet=new AspNetZhuanController(); - $res = $aspnet->HunjianHis($data_array); - if ($res['code'] == "200") { - $his_info=[ - "hunjian_yuyue_gid"=>$res['gid'], - ]; - $u = DB::table('orders')->where(['id' => $order_info->id])->update([ - 'his_info'=>json_encode($his_info, JSON_UNESCAPED_UNICODE) - ]); - } + $u = DB::table('orders')->where(['id' => $order_info->id])->update([ + 'his_info'=>json_encode($his_info, JSON_UNESCAPED_UNICODE) + ]); } - return ['status' => true, 'msg' => "完成"]; }