婚检改约 调用his

main
yanzai 8 months ago
parent 0a779a1e6e
commit 9291731396

@ -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' => "完成"];
}

Loading…
Cancel
Save