增加测试公卫功能

main
yanzai 2 years ago
parent 7169314b54
commit 8831df995a

@ -2,21 +2,31 @@
namespace App\Http\Controllers;
use App\Services\Admin\YeWu\AppointmentService;
use Illuminate\Http\Request;
class TestController extends Controller
{
public function DBtest(){
//echo DB::table('users')->count();
$SendData='<com:queryCheckUp>
<!--Optional:-->
<![CDATA[<xm>王新书</xm>
<!--Optional:-->
<sfz>142423194705202719</sfz>]]>
</com:queryCheckUp>';
$url = config('app.globals.GongWeiBaseUrl');
return \Yz::XmlHttp($SendData,$url);
// $SendData='<com:queryCheckUp>
// <!--Optional:-->
// <![CDATA[<xm>王新书</xm>
// <!--Optional:-->
// <sfz>142423194705202719</sfz>]]>
// </com:queryCheckUp>';
//
// $url = config('app.globals.GongWeiBaseUrl');
// return \Yz::XmlHttp($SendData,$url);
$name =request('name');
$sfz =request('sfz');
$info=AppointmentService::CheckGongWei($name,$sfz);
return $info;
}

@ -99,12 +99,12 @@ class AppointmentService
$lastDay = date('Y-12-31', strtotime($currentYear));
$SendData='<com:queryCheckUp>
<!--Optional:-->
<![CDATA[ <xm>'.$name.'</xm>
<xm>'.$name.'</xm>
<!--Optional:-->
<sfz>'.$id_card_num.'</sfz>]]>
<sfz>'.$id_card_num.'</sfz>
</com:queryCheckUp>';
$url = config('app.globals.GongWeiBaseUrl').'/jkdacp/webservice/DPService?wsdl';
$url = config('app.globals.GongWeiBaseUrl');
$res=\Yz::XmlHttp($SendData,$url);
//如果没有返回queryCheckUp节点返回异常
if(!isset($res['queryCheckUp'])) {
@ -115,12 +115,20 @@ class AppointmentService
}
$result=[];
if(isset($res['queryCheckUp']['tjrq']) and ($res['queryCheckUp']['tjrq']>=$firstDay and $res['queryCheckUp']['tjrq']<=$lastDay)){
$result['status']=false;
$result['msg']='公卫有记录';
$result['GongWeiinfo']=$res['queryCheckUp'];
//判断老年人体检字段
if(isset($res['queryCheckUp']['sflnrtj']) and $res['queryCheckUp']['sflnrtj']==1){
$result['status']=false;
$result['msg']='公卫有记录';
$result['GongWeiinfo']=$res['queryCheckUp'];
}else{
$result['status']=true;
$result['msg']='公卫有记录,但是没有老年人体检';
$result['GongWeiinfo']=$res['queryCheckUp'];
}
}else{
$result['status']=true;
$result['msg']='公卫有无记录';
$result['msg']='公卫无记录';
$result['GongWeiinfo']=$res['queryCheckUp'];
}
return $result;

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
<body>
<form method="POST" action="/test">
@csrf
<input type="text" name="name" placeholder="姓名">
<input name="sfz" placeholder="身份证">
<button type="submit">查询</button>
</form>
</body>
</head>
</html>

@ -25,4 +25,7 @@ Route::get('/wxLogin/{env}', function ($env) {
});
//微信登录授权获取openid
Route::get('/wxGetCode','App\Http\Controllers\API\mH5\LoginController@wxGetCode' );
Route::get('/test','App\Http\Controllers\TestController@DBtest' );
Route::any('/test','App\Http\Controllers\TestController@DBtest' );
Route::any('/gongweitest', function () {
return view('gongweitest');
});

@ -1,4 +1,4 @@
ENV = 'production'
VITE_APP_API = 'http://223.71.106.251:33581/common/la/public/api/'
VITE_APP_FILE = 'http://223.71.106.251:33581/common/la/public'
VITE_APP_API = 'http://192.168.50.123:33583/common/la/public/api/'
VITE_APP_FILE = 'http://192.168.50.123:33583/common/la/public'

Loading…
Cancel
Save