diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php index ecd8cb8..ef32112 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php @@ -323,13 +323,42 @@ class PlanListController extends Controller return $service->GetEnablePlan($regnum,$entrustid,$episodeid,$appointment_type,$appointment_date); } //获取最近可用的,计划 日期 - public function EnablePlanDate() + public function NearestEnablePlanDate() { + $dateRange=7; $regnum = request('regnum'); - $entrustid = request('entrustid'); + $entrustids = request('entrustid'); $episodeid = request('episodeid'); $appointment_type = request('appointment_type'); //预约类型 $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]); + } diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/SignInController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/SignInController.php index 698e6b0..cbf9aa2 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/SignInController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/SignInController.php @@ -94,7 +94,7 @@ class SignInController extends Controller 'check_num'=>$yg_signin['data'][0]['checkNo'] ]); if($u){ - $success_item[]=$mainInfo->entrust; + $success_item[]=['entrust'=>$mainInfo->entrust,'signInData'=>$yg_signin['data']]; //记录日志 $data = [ 'list_id' => $mainInfo->id, @@ -176,7 +176,7 @@ class SignInController extends Controller $data = [ 'list_id' => $mainInfo->id, 'reg_num' => $mainInfo->reg_num, - 'new_status' => 2, + 'new_status' => 1, 'create_user' => $userid, 'note' => '取消登记', 'data' => null,//原始数据 diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php index 39df7f1..8a9b9b1 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php @@ -123,7 +123,7 @@ class WorkMainController extends Controller $count = $list; $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(); //匹配设备(服务组) diff --git a/Laravel/app/Http/Controllers/TestSendMsgController.php b/Laravel/app/Http/Controllers/TestSendMsgController.php new file mode 100644 index 0000000..c99bdd1 --- /dev/null +++ b/Laravel/app/Http/Controllers/TestSendMsgController.php @@ -0,0 +1,19 @@ +sendMessage('19933509886','测试短信'); + + return response()->json($response); + } +} diff --git a/Laravel/app/Lib/Tools.php b/Laravel/app/Lib/Tools.php index ea9d1c0..1c565ea 100644 --- a/Laravel/app/Lib/Tools.php +++ b/Laravel/app/Lib/Tools.php @@ -138,6 +138,10 @@ class Tools curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data); $r = curl_exec($ch); \Illuminate\Support\Facades\Log::info($r); + $r = ' + + +'; try { $xml = simplexml_load_string($r, 'SimpleXMLElement', LIBXML_NOCDATA); diff --git a/Laravel/app/Services/SendMessgeService.php b/Laravel/app/Services/SendMessgeService.php new file mode 100644 index 0000000..8e6cbb3 --- /dev/null +++ b/Laravel/app/Services/SendMessgeService.php @@ -0,0 +1,57 @@ +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(); + } +} diff --git a/Laravel/config/app.php b/Laravel/config/app.php index 3055ffe..28e681e 100644 --- a/Laravel/config/app.php +++ b/Laravel/config/app.php @@ -82,7 +82,7 @@ return [ | */ - 'timezone' => 'UTC', + 'timezone' => 'PRC', /* |-------------------------------------------------------------------------- diff --git a/Laravel/public/jq_page/appointment.html b/Laravel/public/jq_page/appointment.html index c43f80b..032e765 100644 --- a/Laravel/public/jq_page/appointment.html +++ b/Laravel/public/jq_page/appointment.html @@ -15,7 +15,8 @@ diff --git a/Laravel/routes/api.php b/Laravel/routes/api.php index 03d4c94..d14a85f 100644 --- a/Laravel/routes/api.php +++ b/Laravel/routes/api.php @@ -111,6 +111,10 @@ Route::group(['middleware'=>['log']],function () { 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::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端接口 diff --git a/YiJi-admin/src/views/YeWu/MainList.vue b/YiJi-admin/src/views/YeWu/MainList.vue index ce92793..d03f740 100644 --- a/YiJi-admin/src/views/YeWu/MainList.vue +++ b/YiJi-admin/src/views/YeWu/MainList.vue @@ -1,6 +1,5 @@