自动选择就近日期,签到弹出详情,对接发短信测试

main
yanzai 1 year ago
parent eb313f86c0
commit 24d2f1ce25

@ -323,13 +323,42 @@ class PlanListController extends Controller
return $service->GetEnablePlan($regnum,$entrustid,$episodeid,$appointment_type,$appointment_date); return $service->GetEnablePlan($regnum,$entrustid,$episodeid,$appointment_type,$appointment_date);
} }
//获取最近可用的,计划 日期 //获取最近可用的,计划 日期
public function EnablePlanDate() public function NearestEnablePlanDate()
{ {
$dateRange=7;
$regnum = request('regnum'); $regnum = request('regnum');
$entrustid = request('entrustid'); $entrustids = request('entrustid');
$episodeid = request('episodeid'); $episodeid = request('episodeid');
$appointment_type = request('appointment_type'); //预约类型 $appointment_type = request('appointment_type'); //预约类型
$appointment_date = request('date'); //预约日期 $appointment_date = request('date'); //预约日期
$service = new PlanListService();
$date_arr=[];
$startDate = new DateTime();
// 设定结束日期为当前日期加7天
$endDate = new DateTime();
$endDate->modify('+'.$dateRange.' day');
// 循环遍历每一天
$currentDate = $startDate;
while ($currentDate <= $endDate) {
$nowdate= $currentDate->format('Y-m-d');
$s=$service->GetEnablePlan($regnum,$entrustids,$episodeid,$appointment_type,$nowdate);
if($s['status']){
$list= $s['data']['plan_list'];
if(count($list)>0){
$date_arr[]= $s['data']['appointment_date'];
}
}
if(count($date_arr)>=2){
break;
}
// 每次循环增加一天
$currentDate->modify('+1 day');
}
return \Yz::Return(true,'查询完成',['list'=>$date_arr]);
} }

@ -94,7 +94,7 @@ class SignInController extends Controller
'check_num'=>$yg_signin['data'][0]['checkNo'] 'check_num'=>$yg_signin['data'][0]['checkNo']
]); ]);
if($u){ if($u){
$success_item[]=$mainInfo->entrust; $success_item[]=['entrust'=>$mainInfo->entrust,'signInData'=>$yg_signin['data']];
//记录日志 //记录日志
$data = [ $data = [
'list_id' => $mainInfo->id, 'list_id' => $mainInfo->id,
@ -176,7 +176,7 @@ class SignInController extends Controller
$data = [ $data = [
'list_id' => $mainInfo->id, 'list_id' => $mainInfo->id,
'reg_num' => $mainInfo->reg_num, 'reg_num' => $mainInfo->reg_num,
'new_status' => 2, 'new_status' => 1,
'create_user' => $userid, 'create_user' => $userid,
'note' => '取消登记', 'note' => '取消登记',
'data' => null,//原始数据 'data' => null,//原始数据

@ -123,7 +123,7 @@ class WorkMainController extends Controller
$count = $list; $count = $list;
$count = $count->count(); $count = $count->count();
$list=$list->orderBy('id', 'desc')->limit($pageSize)->skip(($page - 1) * $pageSize) // 跳过前9999条记录 $list=$list->where(['s_list.is_del'=>0,'s_list.is_nullify'=>0])->orderBy('id', 'desc')->limit($pageSize)->skip(($page - 1) * $pageSize) // 跳过前9999条记录
->take($pageSize)->get(); ->take($pageSize)->get();
//匹配设备(服务组) //匹配设备(服务组)

@ -0,0 +1,19 @@
<?php
namespace App\Http\Controllers;
use App\Services\SendMessgeService;
use Illuminate\Http\Request;
class TestSendMsgController extends Controller
{
public function SendMsg( )
{
$s=new SendMessgeService();
$response = $s->sendMessage('19933509886','测试短信');
return response()->json($response);
}
}

@ -138,6 +138,10 @@ class Tools
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); \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 {
$xml = simplexml_load_string($r, 'SimpleXMLElement', LIBXML_NOCDATA); $xml = simplexml_load_string($r, 'SimpleXMLElement', LIBXML_NOCDATA);

@ -0,0 +1,57 @@
<?php
namespace App\Services;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Crypt;
class SendMessgeService
{
private $secretKey;
private $userid;
private $url;
private $timestamp;
public function __construct()
{
$this->secretKey = "4siCISCjV9BKdM38";
$this->userid = "FSKDX";
$this->url = "http://10.50.120.91:8081/umc/message/send2";
$this->timestamp=now()->format('YmdHis') . '00';
}
private function encrypt($data)
{
// $iv = substr($this->secretKey, 0,16);
$iv = $this->timestamp;
$key = substr($this->secretKey, 0, 16);
$cipher = "AES-128-CBC";
$encrypted = openssl_encrypt($data, $cipher, $key, OPENSSL_RAW_DATA, $iv);
return base64_encode($encrypted);
}
public function sendMessage($mobiles, $content, $type = 2)
{
// $timestamp = now()->format('YmdHis') . '00';
$body = json_encode([
'mobiles' => $mobiles,
'content' => $content,
'userid' => $this->userid,
'type' => $type
]);
$encryptedBody = $this->encrypt($body);
$response = Http::withHeaders([
'Content-Type' => 'application/json; charset=utf-8'
])->post($this->url, [
'timestamp' => $this->timestamp,
'userid' => $this->userid,
'cntx' => $encryptedBody,
'custid' => $this->timestamp // For example purposes, use timestamp as custid
]);
return $response->json();
}
}

@ -82,7 +82,7 @@ return [
| |
*/ */
'timezone' => 'UTC', 'timezone' => 'PRC',
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

@ -15,7 +15,8 @@
</head> </head>
<body> <body>
<script> <script>
let BaseUrl='http://yijiyuyue' let BaseUrl='http://10.50.120.166/YiJiYuYue/Laravel/public'
// let BaseUrl='http://yijiyuyue'
let entrust_ids=[]; //选中的entrust_id let entrust_ids=[]; //选中的entrust_id
let today_date='' let today_date=''
let tomorrowDate='' let tomorrowDate=''
@ -409,7 +410,7 @@
}) })
function insertInto_appointmenText(){ //向检查项目输入框 填写内容 async function insertInto_appointmenText(){ //向检查项目输入框 填写内容
MainInfo_ids=[] MainInfo_ids=[]
entrust_ids=[] entrust_ids=[]
let input_itemname="" let input_itemname=""
@ -422,6 +423,7 @@
$('#input_appointment_item').val(input_itemname); $('#input_appointment_item').val(input_itemname);
console.log(entrust_ids); console.log(entrust_ids);
if($(".lanse_bg").length>0){ if($(".lanse_bg").length>0){
await NearestEnablePlanDate();
//日历设置日期,支持查询计划 //日历设置日期,支持查询计划
$('#datetimepicker1 input').val(today_date) $('#datetimepicker1 input').val(today_date)
$('#datetimepicker2 input').val(tomorrowDate) $('#datetimepicker2 input').val(tomorrowDate)
@ -563,7 +565,35 @@
}) })
} }
//获取最近可用日期
async function NearestEnablePlanDate(){
$('#loadingModal').modal('show');
await $.post(BaseUrl+'/api/admin/NearestEnablePlanDate', {
regnum: getParameterByName('regnum'),
entrustid: entrust_ids,
episodeid: getParameterByName('episodeid'),
appointment_type:getParameterByName('appointment_type')
}, function(data) {
$('#loadingModal').modal('hide');
if (data.status) {
if(data.data.list.length>0){
//today_date
// tomorrowDate
today_date=data.data.list[0];
if(data.data.list[1]!=undefined){
tomorrowDate=data.data.list[1]
}else{
var currentDate = new Date(today_date)
currentDate.setDate(currentDate.getDate() + 1)
tomorrowDate = currentDate.toISOString().split('T')[0]
}
}
}
})
}
</script> </script>
<!-- 加载状态 --> <!-- 加载状态 -->

@ -111,6 +111,10 @@ Route::group(['middleware'=>['log']],function () {
Route::post('admin/GetPlanUsedList','App\Http\Controllers\API\Admin\YeWu\PlanListController@GetUsedList');//计划占用详情列表 Route::post('admin/GetPlanUsedList','App\Http\Controllers\API\Admin\YeWu\PlanListController@GetUsedList');//计划占用详情列表
Route::get('admin/NoPayCancel','App\Http\Controllers\API\Admin\YeWu\WorkMainController@NoPayCancel');//检查是否有超时未支付的门诊预约记录,如果有则给其取消,并恢复名额 Route::get('admin/NoPayCancel','App\Http\Controllers\API\Admin\YeWu\WorkMainController@NoPayCancel');//检查是否有超时未支付的门诊预约记录,如果有则给其取消,并恢复名额
Route::post('admin/DoctorCancelYuYue','App\Http\Controllers\API\Admin\YeWu\WorkMainController@DoctorCancelYuYue');//医生取消预约 Route::post('admin/DoctorCancelYuYue','App\Http\Controllers\API\Admin\YeWu\WorkMainController@DoctorCancelYuYue');//医生取消预约
Route::post('admin/NearestEnablePlanDate','App\Http\Controllers\API\Admin\YeWu\PlanListController@NearestEnablePlanDate');//获取最近可用日期
Route::post('testSendMsg','App\Http\Controllers\TestSendMsgController@SendMsg');//测试发送短信
}); });
//H5端接口 //H5端接口

@ -1,6 +1,5 @@
<template> <template>
<div v-loading="loading"> <div v-loading="loading">
<el-dialog title="预约列表" class="iframeDialog" v-model="iframe_show" @opened="dialogopened" @closed="closeIfram()"> <el-dialog title="预约列表" class="iframeDialog" v-model="iframe_show" @opened="dialogopened" @closed="closeIfram()">
<iframe id="bdIframe" :src="selectedUrl" class="iframe" :key="iframeKey" scrolling="auto"></iframe> <iframe id="bdIframe" :src="selectedUrl" class="iframe" :key="iframeKey" scrolling="auto"></iframe>
</el-dialog> </el-dialog>
@ -204,8 +203,14 @@
</div> </div>
</div> </div>
<el-dialog v-model="TiShiShow" title="提示" width="40%" > <el-dialog v-model="TiShiShow" title="提示" width="40%" >
<div v-for="(item,index) in successItem" :key="index"> <div v-for="(item,index) in successItem" :key="index" style="font-size:16px;">
{{item}}
<table style="margin-top: -30px;">
<tr><td colspan="2" style="font-weight: 700; font-size: 18px;color:#4b6493">{{item.entrust}}<el-tag type="success" size="large">预约成功</el-tag></td></tr>
<tr><td style="font-weight: 700;">体检号</td><td>{{item.signInData[0].checkNo}}</td></tr>
<tr><td style="font-weight: 700;">排队号</td><td>{{item.signInData[0].queueNo}}</td></tr>
<tr><td style="font-weight: 700;">等待人数</td><td>{{item.signInData[0].currentNum}}</td></tr>
</table>
</div> </div>
<div v-for="(item,index) in failItem" :key="index+200" style="color: crimson;"> <div v-for="(item,index) in failItem" :key="index+200" style="color: crimson;">
{{item}} {{item}}
@ -598,6 +603,9 @@
message: "签到成功", message: "签到成功",
type: 'success', type: 'success',
}) })
TiShiShow.value=true
successItem.value=res.data.success
failItem.value=res.data.fail
}else{ }else{
TiShiShow.value=true TiShiShow.value=true
successItem.value=res.data.success successItem.value=res.data.success

Loading…
Cancel
Save