diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/ComboController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/ComboController.php
index 8a252bb..e769660 100644
--- a/Laravel/app/Http/Controllers/API/Admin/YeWu/ComboController.php
+++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/ComboController.php
@@ -208,6 +208,31 @@ class ComboController extends Controller
public function Save()
{
$Info = request('Info');
+ $combo = DB::table('combos')->where(['id' => $Info['id']])->first();
+
+ if (!$combo) {
+ return \Yz::echoError1("套餐不存在");
+ }
+
+ $oldOrder = $combo->order;
+ $newOrder = $Info['order'];
+
+ // 如果排序发生了变化
+ if ($oldOrder != $newOrder) {
+ if ($newOrder > $oldOrder) {
+ // 向后移动:将 [oldOrder+1 到 newOrder] 的记录 order -1
+ DB::table('combos')
+ ->where('order', '>', $oldOrder)
+ ->where('order', '<=', $newOrder)
+ ->decrement('order');
+ } else {
+ // 向前移动:将 [newOrder 到 oldOrder-1] 的记录 order +1
+ DB::table('combos')
+ ->where('order', '>=', $newOrder)
+ ->where('order', '<', $oldOrder)
+ ->increment('order');
+ }
+ }
$u = DB::table('combos')->where(['id' => $Info['id']])->update([
'checkup_type_id' => $Info['checkup_type_id'],
'type_id' => $Info['type_id'],
@@ -218,7 +243,7 @@ class ComboController extends Controller
'intro' => $Info['intro'],
'sub_intro' => $Info['sub_intro'],
'desc' => $Info['desc'],
- 'order' => $Info['order'],
+ 'order' =>$newOrder,
'sale_count' => $Info['sale_count'],
'is_hot' => isset($Info['is_hot'])?$Info['is_hot']:0,
]);
diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanController.php
index 06bcdad..e033b6f 100644
--- a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanController.php
+++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanController.php
@@ -4,9 +4,15 @@ namespace App\Http\Controllers\API\Admin\YeWu;
use App\Http\Controllers\Controller;
use App\Services\TimeService;
+use DateInterval;
+use DatePeriod;
use DateTime;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Storage;
+use Illuminate\Support\Str;
+use PhpOffice\PhpSpreadsheet\IOFactory;
+use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
class PlanController extends Controller
{
@@ -38,7 +44,27 @@ class PlanController extends Controller
// $planType = DB::table('plan_type as a')->where(['a.id' => $model->plan_type, 'a.is_del' => 0, 'a.status' => 1])->first();
// if (!$planType) return \Yz::echoError1('号源类型不可用');
//查询此时间段内是否有已经生成的号源
- $cha = DB::table('plans')->whereBetween('date', $Info['dateRange'])->where(['is_del'=>0])->whereIn('status',[0,1])->get();
+
+ $startDate11 = new DateTime($Info['dateRange'][0]);
+ $endDate11 = new DateTime($Info['dateRange'][1]);
+
+// 包括结束日期
+ $endDate11->modify('+1 day');
+ $period = new DatePeriod($startDate11, new DateInterval('P1D'), $endDate11);
+
+ $matchedDates = [];
+
+ foreach ($period as $date) {
+ $currentDate = $date;
+ $dayOfWeek = $currentDate->format('N'); // 1=周一 ... 7=周日
+
+ if (in_array($dayOfWeek, $params['week'])) {
+ $matchedDates[] = $currentDate->format('Y-m-d');
+ }
+ }
+
+
+ $cha = DB::table('plans')->whereIn('date',$matchedDates)->where(['is_del'=>0])->whereIn('status',[0,1])->get();
if (count($cha) > 0) {
return \Yz::return(false, '号源重复', ['list' => $cha]);
}
@@ -131,30 +157,52 @@ class PlanController extends Controller
$pageSize = request('pageSize');
$searchInfo = request('searchInfo');
$list = DB::table('plans as a')
- ->select('a.*','b.name as username','b.phone')
- ->leftJoin('orders as b', 'a.id', '=', 'b.plan_id')
- ->where(['a.is_del' => 0]);
+ ->select('a.*','b.name as username','b.phone')
+ ->leftJoin('orders as b', function($join) {
+ $join->on('a.id', '=', 'b.plan_id')
+ ->whereIn('b.status', [2,4]);
+ })
+ ->where('a.is_del', 0);
+
if (!isset($searchInfo['date'])) {
$searchInfo['date'] = date('Y-m-d');
}
$list = $list->where(['a.date' => $searchInfo['date']]);
- $count = $list->count();
$list = $list->orderBy('a.time', 'asc')->get();
$plan_model=DB::table('plan_model_time')
->select('plan_model_time.*', 'plan_type.name as plan_type_name')
->leftJoin('plan_type', 'plan_type.id', '=', 'plan_model_time.plan_type_id')
->get();
+ $list_l=[];
foreach ($list as $k => $v) {
$list[$k]->plan_type_name = '';
foreach ($plan_model as $k1 => $v1) {
if ($v1->model_id == $v->model_id and $v1->time == $v->time) {
$list[$k]->plan_type_name = $v1->plan_type_name;
+ $list[$k]->plan_type_id = $v1->plan_type_id;
+ if (isset($searchInfo['plan_type']) and !empty($searchInfo['plan_type']) and $v1->plan_type_id==$searchInfo['plan_type']) {
+ $list_l[]=$list[$k];
+ }
break;
}
}
}
- return \Yz::Return(true, '查询完成', ['list' => $list, 'count' => $count, 'date' => $searchInfo['date']]);
+ if (isset($searchInfo['plan_type']) and !empty($searchInfo['plan_type'])) {
+ $list=$list_l;
+ }
+ $count=count($list);
+ $unused_count=0;
+ $used_count=0;
+ foreach ($list as $k => $v) {
+ if($v->status==2){
+ $used_count++;
+ }else{
+ $unused_count++;
+ }
+ }
+
+ return \Yz::Return(true, '查询完成', ['list' => $list, 'count' => $count,'unused_count'=>$unused_count, 'used_count'=>$used_count,'date' => $searchInfo['date']]);
}
public function GetDetail()
@@ -259,4 +307,87 @@ class PlanController extends Controller
}
}
+ //号源类型使用统计
+ public function GetPlanTypeTJ(){
+ $date = request('date');
+ $list=$this->GetPlanTypeTJFunc($date);
+ return \Yz::Return(true, '查询完成', ['list' => $list]);
+ }
+ public function ExportPlanTypeTJ()
+ {
+ $date = request('date');
+ $table_list=$this->GetPlanTypeTJFunc($date);
+ $template_path = Storage::path('public/excel/plantypetj.xlsx');
+ $spreadsheet = IOFactory::load($template_path);
+ $worksheet = $spreadsheet->getActiveSheet();
+ $styleArray = [
+ 'borders' => [
+ 'allBorders' => [
+ 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN,
+ 'color' => ['argb' => 'FF000000'],
+ ],
+ ],
+ ];
+ $row = 3;
+ $col = [
+ 'A' => 'name',
+ 'B' => 'count',
+ 'C' => 'used_count',
+ 'D' => 'unused_count',
+ ];
+ foreach ($table_list as $table_item) {
+ if(empty($table_item['name'])){
+ $table_item['name']='预留';
+ }
+ foreach ($col as $index => $key) {
+ $worksheet->setCellValueExplicit($index . $row, $table_item[$key], \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ }
+ $row++;
+ }
+ $file_name = Str::orderedUuid();
+ $dir_path = "public/excel/" . date('Ym') . '/' . $file_name;
+ Storage::makeDirectory($dir_path);
+ $name_date = date('n.j', strtotime($date));
+ $excel_path = $dir_path . "/号源统计$name_date.xlsx";
+ $writer = new Xlsx($spreadsheet);
+ $writer->save(Storage::path($excel_path));
+ $url = Storage::url($excel_path);
+ return ['status'=>true,'msg'=>'查询完成','url'=> env('APP_URL').$url];
+ }
+ function GetPlanTypeTJFunc($date)
+ {
+ $list=DB::table('plans')->where(['date'=>$date,'is_del'=>0])->get();
+
+ $plan_model=DB::table('plan_model_time')
+ ->select('plan_model_time.*', 'plan_type.name as plan_type_name')
+ ->leftJoin('plan_type', 'plan_type.id', '=', 'plan_model_time.plan_type_id')
+ ->get();
+ $plan_type=[];
+
+ foreach ($list as $k => $v) {
+ $list[$k]->plan_type_name = '';
+
+ foreach ($plan_model as $k1 => $v1) {
+ if ($v1->model_id == $v->model_id and $v1->time == $v->time) {
+ $list[$k]->plan_type_name = $v1->plan_type_name;
+ $list[$k]->plan_type_id = $v1->plan_type_id;
+ break;
+ }
+ }
+ if(!isset($plan_type[$v->plan_type_id])){
+ $plan_type[$v->plan_type_id]=['name'=>$v->plan_type_name,'count'=>0,'used_count'=>0,'unused_count'=>0];
+ }
+ $plan_type[$v->plan_type_id]['count']++;
+ if($v->status==2){
+ $plan_type[$v->plan_type_id]['used_count']++;
+ }else{
+ $plan_type[$v->plan_type_id]['unused_count']++;
+ }
+ }
+ $list2=[];
+ foreach ($plan_type as $k => $v) {
+ $list2[]=$v;
+ }
+ return $list2;
+ }
}
diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanTypeController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanTypeController.php
index cb4ba57..0571259 100644
--- a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanTypeController.php
+++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanTypeController.php
@@ -46,6 +46,12 @@ class PlanTypeController extends Controller
}
}
+ public function GetEnableList()
+ {
+ $list=DB::table('plan_type')->where(['is_del'=>0]);
+ $list=$list ->get();
+ return \Yz::Return(true,'查询完成',['list'=>$list]);
+ }
public function GetList()
{
$page =request('page');
diff --git a/Laravel/app/Http/Controllers/API/ApiMapController.php b/Laravel/app/Http/Controllers/API/ApiMapController.php
index 15dbcfe..4c91e1b 100644
--- a/Laravel/app/Http/Controllers/API/ApiMapController.php
+++ b/Laravel/app/Http/Controllers/API/ApiMapController.php
@@ -51,6 +51,7 @@ class ApiMapController extends Controller
'GetReportJieLunJianYi' => $base_url . '/api/H5/GetReportJieLunJianYi', //获取报告结论建议页面数据
'GetReportDetaiList' => $base_url . '/api/H5/GetReportDetaiList', //完整报告中的列表
'GetReportDetai' => $base_url . '/api/H5/GetReportDetai', //完整报告中的详情
+ 'GetReportDetai2' => $base_url . '/api/H5/GetReportDetai2', //完整报告中的详情
'StartPay' => $base_url . '/api/H5/StartPay', //开始支付
'CheckPay' => $base_url . '/api/H5/CheckPay', //支付查询
'Refund' => $base_url . '/api/H5/Refund', //退款
@@ -99,6 +100,8 @@ class ApiMapController extends Controller
'GetHomeNotice' => $base_url . '/api/H5/GetHomeNotice', // 首页消息通知
'GetPersonOrderList' => $base_url . '/api/H5/GetPersonOrderList', // 获取个人订单列表
'ZhongKangGetHexiaoCode' => $base_url . '/api/H5/ZhongKangGetHexiaoCode', // 中康查询核销码
+ 'GetPendingOrders' => $base_url . '/api/H5/GetPendingOrders', // 获取用户待预约订单
+ 'LockPlan' => $base_url . '/api/H5/LockPlan', // 锁定号源
];
}
diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php
index 46b0272..59270f9 100644
--- a/Laravel/app/Http/Controllers/API/H5/ComboController.php
+++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php
@@ -104,7 +104,7 @@ class ComboController extends Controller
$sql = $sql . " and a.type_id=? ";
$canshu[] = $combo_type;
}else{
- $sql = $sql. " and a.type_id<>19 ";
+ $sql = $sql. " and a.type_id<>19 or a.type_id is null ";
}
if (isset($combo_crowd)) {
$sql = $sql . " and a.crowd_id=? ";
@@ -346,6 +346,8 @@ FROM combos;");
$true_price = 0;
$nmr_list=[];
+ $keshi_fenlei=DB::table('keshi')->get(); //科室分类
+
if (isset($combo_id) and $combo_id != 0) {
// $combo=DB::table('combos')->where(['hospital_id'=>$hospital_id,'combo_id'=>$combo_id,'status'=>1])->first();
$combo = DB::select("select a.*,b.*,c.name as crowd_name from combos as a LEFT JOIN (
@@ -416,7 +418,15 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
$groupedData = [];
$comboItemCount=0;
foreach ($combo_items as $item) {
+ foreach ($keshi_fenlei as $k=>$v){
+ if($v->keshi_name===$item['keshi_name']){
+ $item['keshi_name']=$v->type_name;
+ }
+ }
$keshiName = $item['keshi_name'];
+
+
+
if($keshiName<>'材料费'){
$comboItemCount++;
}
@@ -427,12 +437,13 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
}
foreach ($groupedData as $keshiName => $children) {
+
$combo_info['items'][] = [
'keshi_name' => $keshiName,
'children' => $children
];
}
- $combo_info['items']= $this->KeShiPaiXu($combo_info['items']);
+ $combo_info['items']= $this->KeShiPaiXu($combo_info['items'],1);
$pay_item_count += $combo->item_count;
$true_price += $combo_info['price'];
//如果使用了第三方券
@@ -498,12 +509,13 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
$items_info['price'] =$item_price;
$items_info['original_price'] = $items_original_price;
foreach ($groupedData as $keshiName => $children) {
+
$items_info['items'][] = [
'keshi_name' => $keshiName,
'children' => $children
];
}
- $items_info['items']= $this->KeShiPaiXu($items_info['items']);
+ $items_info['items']= $this->KeShiPaiXu($items_info['items'],1);
$items_info['items_count'] = count($item_ids);
$pay_item_count += count($items);
$true_price += $items_info['price'];
@@ -585,6 +597,11 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
}
$groupedData = [];
foreach ($item_new as $item) {
+ foreach ($keshi_fenlei as $k=>$v){
+ if($v->keshi_name===$item['keshi_name']){
+ $item['keshi_name']=$v->type_name;
+ }
+ }
$keshiName = $item['keshi_name'];
if (!isset($groupedData[$keshiName])) {
$groupedData[$keshiName] = [];
@@ -599,6 +616,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
'children' => $children
];
}
+ $group_info[0]['items']= $this->KeShiPaiXu($group_info[0]['items'],1);
}
$temp_nmr=[];
@@ -679,7 +697,8 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
}
foreach ($combos as $key => $combo) {
-
+ $itemCount=DB::table('combo_items')->where(['combo_id' => $combo->combo_id,'status'=>1])->where('keshi_name','<>','材料费')->count();
+ $combo->item_count=$itemCount;
$tags = json_decode($combo->tags, true);
$combo->tags2 = json_decode($combo->tags2, true);
foreach ($tags as $k => $tag) {
@@ -695,7 +714,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4)
'color' => '#E9F8F3',
];
}
- return \Yz::Return(true, "查询完成", ['list' => $combos]);
+ return \Yz::Return(true, "查询完成", ['list' => $combos,'keshi_paixu'=> config('app.globals.KeShiPaiXu')]);
}
//推荐套餐
@@ -836,10 +855,13 @@ select combo_id as c_id,count(*) as count from orders where status in(2,4) group
return $true_price;
}
}
- public function KeShiPaiXu($data)
+ public function KeShiPaiXu($data,$order_type=0)
{
// 给定的科室顺序
$sortedOrder = config('app.globals.KeShiPaiXu');
+ if($order_type==1){
+ $sortedOrder = config('app.globals.KeShiTypePaiXu');
+ }
// 创建一个科室到其在期望顺序中位置的映射
$sortedOrderMap = array_flip($sortedOrder);
diff --git a/Laravel/app/Http/Controllers/API/H5/FenzhenController.php b/Laravel/app/Http/Controllers/API/H5/FenzhenController.php
index 0e3edf8..82ea15a 100644
--- a/Laravel/app/Http/Controllers/API/H5/FenzhenController.php
+++ b/Laravel/app/Http/Controllers/API/H5/FenzhenController.php
@@ -70,8 +70,21 @@ class FenzhenController extends Controller
$list = DB::table('orders')->where(['id_number' => $id_number])->whereIn('status', [2, 4])->orderBy('id', 'desc')->get();
}
} else {
- $l = [$list[0]];
- $list = $l;
+ //如果有多个订单,则优先显示到检的,如果到检的订单超过了当天,则显示最近的一个订单。2025年5月30日,与佳豪语音沟通商定。
+ $l = [];
+ foreach ($list as $key => $item) {
+ if ( (!empty($item->check_time)) and substr($item->check_time,0,10) == date('Y-m-d')) {
+ $l = [$item];
+ $list = $l;
+ break;
+ }
+ }
+ if (count($l) == 0) {
+ $l = [$list[0]];
+ $list = $l;
+ }
+
+
}
return \Yz::Return(true, "弃检成功", [
'list' => $list,
@@ -133,6 +146,11 @@ class FenzhenController extends Controller
$clinic_map[] = $item['his_number'];
}
}
+ foreach ($end_queue as $key => $item) {
+ if (isset($item['his_number'])) {
+ $clinic_map[] = $item['his_number'];
+ }
+ }
$last_time = strtotime('2024-10-10 ' . $time_line[count($time_line) - 1]['time'] . ':00');
if (!$res['data']['queue']) {
$push_end = false;
diff --git a/Laravel/app/Http/Controllers/API/H5/HomeController.php b/Laravel/app/Http/Controllers/API/H5/HomeController.php
index 85e8dfb..ce9ec0c 100644
--- a/Laravel/app/Http/Controllers/API/H5/HomeController.php
+++ b/Laravel/app/Http/Controllers/API/H5/HomeController.php
@@ -51,7 +51,7 @@ class HomeController extends Controller
->select("id", "name", "latitude", "longitude", "logo","address")
->where(['status' => 1, 'is_del' => 0])->get();
if (count($hospitals) < 1) return \Yz::echoError1('暂无可用医院信息');
- $db_config = DB::table('configs')->whereIn('label', ['首页欢迎词', '首页banner'])->get();
+ $db_config = DB::table('configs')->whereIn('label', ['首页欢迎词', '首页banner','首页轮播图'])->get();
$config = [
'hospital' => $hospitals,
// [[
@@ -62,6 +62,7 @@ class HomeController extends Controller
// ]]
'tip' => $this->getValueByLabel($db_config, '首页欢迎词'),
'logo' => $hospitals[0]->logo,
+ 'lunbo'=>json_decode( $this->getValueByLabel($db_config, '首页轮播图'),true),
'banner' => [
'image' => $this->getValueByLabel($db_config, '首页banner'),
'jump' => 'https://www.hnxd.org/list-jkglzx.html',
@@ -69,7 +70,8 @@ class HomeController extends Controller
'order' => [[
'message' => '',
'name' => '个人体检预约',
- 'jump' => '/pages/buy/choose/choose?url=api://CheckUpTypeGetList',
+ //'jump' => '/pages/buy/choose/choose?url=api://CheckUpTypeGetList',
+ 'jump' => '/pages/main/yytjsj/yytjsj_front',
'icon' => '/assets/h5/gejianyuyue.png'
], [
'message' => '',
@@ -79,61 +81,77 @@ class HomeController extends Controller
]],
'button' => [[[
'message' => '',
- 'name' => '健康问卷',
- 'jump' => '/pages/main/question/choose/choose',
- 'icon' => '/assets/h5/a_jiankangwenjuan.png'
+ 'name' => '报告解读预约',
+ 'jump' => 'XCX/pages/other/entry/index?path=/pages/outpatient/doctor-appointment/index&scene=1002&hospitalAreaId=6&departmentCode=A0030077&subDepartmentCode=4773794195699464904',
+ 'icon' => '/assets/h5/a_jiedubaogao.png'
+ ],[
+ 'message' => '',
+ 'name' => '购买套餐',
+ 'jump' => '/pages/main/combo/combo',
+ 'icon' => '/assets/h5/a_manyidudiaocha.png'
],
-// [
-// 'message' => '暂未开放',
-// 'name' => '预检咨询',
-// 'jump' => '/pages/main/cjwt/cjwt',
-// 'icon' => '/assets/h5/changjianwenti.png'
-// ],
[
+ 'message' => '',
+ 'name' => '预检咨询',
+ 'jump' => '/pages/main/tj/zhuanjiaxq?comboid=2814',
+ 'icon' => '/assets/h5/yujianzx.png'
+ ],[
+ 'message' => '',
+ 'name' => '婚检预约',
+ 'jump' => '/pages/premarital/readme/readme',
+ 'icon' => '/assets/h5/hunjianyy.png'
+ ]], [[
+ 'message' => '',
+ 'name' => '转赠码核销',
+ 'jump' => '/pages/buy/choose/sanfang',
+ 'icon' => '/assets/h5/a_jiankangzhidao.png'
+ ], [
'message' => '',
'name' => '体检注意事项',
'jump' => '/pages/posts/posts/posts?type=2',
'icon' => '/assets/h5/a_tijianzhuyishixiang.png'
- ], [
+ ], [
'message' => '',
'name' => '体检引导',
'jump' => '/pages/user/pick/pick',
'icon' => '/assets/h5/a_tijianyindao.png'
- ]], [[
+ ],[
'message' => '',
- 'name' => '报告解读预约',
- 'jump' => 'XCX/pages/other/entry/index?path=/pages/outpatient/doctor-appointment/index&scene=1035&hospitalAreaId=6&departmentCode=A0030077&subDepartmentCode=4773794195699464904',
- 'icon' => '/assets/h5/a_jiedubaogao.png'
- ], [
+ 'name' => '健康问卷',
+ 'jump' => '/pages/main/question/choose/choose',
+ 'icon' => '/assets/h5/a_jiankangwenjuan.png'
+ ],], [[
'message' => '',
'name' => '健康指导',
'jump' => '/pages/posts/posts/posts?type=1',
'icon' => '/assets/h5/a_jiankangzhidao.png'
- ], [
- 'message' => '',
- 'name' => '满意度调查',
- 'jump' => '/pages/main/questionnaire/index',
- // 'jump' => 'https://www.wjx.cn/vm/Q9A0NRI.aspx',
- 'icon' => '/assets/h5/a_manyidudiaocha.png'
- ]], [[
- 'message' => '',
- 'name' => '报告查询',
- 'jump' => '/pages/main/bgcx/bgcx',
- 'icon' => '/assets/h5/a_baogaochaxun.png'
],
+// [
+// 'message' => '',
+// 'name' => '报告查询',
+// 'jump' => '/pages/main/bgcx/bgcx',
+// 'icon' => '/assets/h5/a_baogaochaxun.png'
+// ],
[
'message' => '',
'name' => '健康宣教',
'jump' => '/pages/posts/posts/posts?type=4',
'icon' => '/assets/h5/xuanjiao.png'
],
-
[
'message' => '',
- 'name' => '我的订单',
- 'jump' => '/pages/main/order/order',
- 'icon' => '/assets/h5/a_wodedingdan.png'
+ 'name' => '满意度调查',
+ 'jump' => '/pages/main/questionnaire/index',
+ 'icon' => '/assets/h5/a_manyidudiaocha.png'
]
+// ,
+//
+// [
+// 'message' => '',
+// 'name' => '我的订单',
+// 'jump' => '/pages/main/order/order',
+// 'icon' => '/assets/h5/a_wodedingdan.png'
+// ]
]
],
diff --git a/Laravel/app/Http/Controllers/API/H5/HospitalExtraController.php b/Laravel/app/Http/Controllers/API/H5/HospitalExtraController.php
index 4fcc4d5..1966187 100644
--- a/Laravel/app/Http/Controllers/API/H5/HospitalExtraController.php
+++ b/Laravel/app/Http/Controllers/API/H5/HospitalExtraController.php
@@ -8,17 +8,59 @@ use Illuminate\Support\Facades\DB;
class HospitalExtraController extends Controller
{
- //获取注意事项
- public function GetReadme()
- {
- $type= request('type');
- $readme_config="1、检前受检者保证充足睡眠时间,保持良好身心状态。体检当日须空腹,体检前一日避免油腻、辛辣刺激性食物,勿饮酒,彩超男士适量憋尿,女士须憋足量尿。
\n2、体检时着宽松衣物,不要佩戴金属物品,以防丢失或影响检查结果。
\n3、做妇科检查的女士,请避开生理期,48小时内避免性生活。\n1)未婚有性生活史,选择检查妇科的,需签署妇科知情同意书,方可进行检查。
\n4、孕期、哺乳期及半年内有备孕计划的男士、女士不建议做胸片、CT、钼靶、碳13、碳14检查。
\n5、体检时服用特殊药品,或身体有其它不适症状,请及时向检查医师说明;
\n6、涉及幽门螺杆菌检查项目的(碳13或14),近期吃过胃药及消炎药的请提醒护士,以免影响数值;
\n7、做过心脏支架、搭桥手术、四肢有钢钉钢板、腿部有严重静脉曲张者,请您不要选做动脉硬化检测。
\n8、体检结束后将指引单交回前台,如未体检完成请勿将指引单带走。
\n备注:当日因各种原因未体检完成的,请尽快补检完成。";
- //type=2 婚检注意事项
- if(isset($type) and $type==2){
- $info=DB::table("articles")->where("id",75)->first();
- $readme_config=$info->content;
- }
- return \Yz::Return(true,"查询完成",['content'=>$readme_config]);
+ //获取注意事项
+ public function GetReadme()
+ {
+ $type= request('type');
+ $sex= request('sex');
+ $readme_config="1、检前受检者保证充足睡眠时间,保持良好身心状态。体检当日须空腹,体检前一日避免油腻、辛辣刺激性食物,勿饮酒,彩超男士适量憋尿,女士须憋足量尿。
\n2、体检时着宽松衣物,不要佩戴金属物品,以防丢失或影响检查结果。
\n3、做妇科检查的女士,请避开生理期,48小时内避免性生活。未婚有性生活史,选择检查妇科的,需签署妇科知情同意书,方可进行检查。
\n4、孕期、哺乳期及半年内有备孕计划的男士、女士不建议做胸片、CT、钼靶、碳13、碳14检查。
\n5、体检时服用特殊药品,或身体有其它不适症状,请及时向检查医师说明。
\n6、涉及幽门螺杆菌检查项目的(碳13或14),近期吃过胃药及消炎药的请提醒护士,以免影响数值。
\n7、做过心脏支架、搭桥手术、四肢有钢钉钢板、腿部有严重静脉曲张者,请您不要选做动脉硬化检测。
\n8、体检结束后将指引单交回前台,如未体检完成请勿将指引单带走。
\n备注:当日因各种原因未体检完成的,请尽快补检完成。";
+ if(isset($sex) and $sex==1){
+ $readme_config= "
+ 1、饮食要求:体检前三天保持正常饮食,避免暴饮暴食;体检当天早晨需空腹,禁食、禁水(慢性病患者服药请遵医嘱)。
+
+
+ 2、生活习惯:体检前三天避免剧烈运动,保证充足睡眠;体检前一天避免饮酒,避免服用对肝肾功能有影响的药物。
+
+
+ 3、着装要求:穿着宽松舒适衣物,不佩戴金属物品,以防丢失或影响检查结果。
+
+
+ 4、精液检查:如需进行精液检查,请提前禁欲 3-5 天。
+
+
+ 5、注意事项:涉及幽门螺杆菌检查(碳 13 或碳 14),两周内吃过胃药或一个月内吃过消炎药,请告知医生择期检查,以免影响数值。
+
+
+ 6、特殊说明:使用抗凝药、抗血小板聚集药、高血压药等,请与客服联系。(特殊情况应主动告知医生)
+
";
}
+ if(isset($sex) and $sex==2){
+ $readme_config= "
+ 1、饮食要求:体检前三天保持正常饮食,避免暴饮暴食;体检当天早晨需空腹,禁食、禁水(慢性病患者服药请遵医嘱)。
+
+
+ 2、生活习惯:体检前三天避免剧烈运动,保证充足睡眠;体检前一天避免饮酒,避免服用对肝肾功能有影响的药物。
+
+
+ 3、着装要求:穿着宽松舒适衣物,不佩戴金属物品,以防丢失或影响检查结果。
+
+
+ 4、月经期间不宜进行妇科检查,建议月经干净后 3-7 天进行检查,检查前 24 小时内避免性生活、阴道冲洗和上药。
+
+
+ 5、注意事项:涉及幽门螺杆菌检查(碳 13 或碳 14),两周内吃过胃药或一个月内吃过消炎药,请告知医生择期检查,以免影响数值。
+
+
+ 6、特殊说明:使用抗凝药、抗血小板聚集药、高血压药等,请与客服联系。(特殊情况应主动告知医生)
+
+
";
+ }
+ //type=2 婚检注意事项
+ if(isset($type) and $type==2){
+ $info=DB::table("articles")->where("id",75)->first();
+ $readme_config=$info->content;
+ }
+ return \Yz::Return(true,"查询完成",['content'=>$readme_config]);
+ }
}
diff --git a/Laravel/app/Http/Controllers/API/H5/OrderController.php b/Laravel/app/Http/Controllers/API/H5/OrderController.php
index c5168cd..5c24617 100644
--- a/Laravel/app/Http/Controllers/API/H5/OrderController.php
+++ b/Laravel/app/Http/Controllers/API/H5/OrderController.php
@@ -146,6 +146,7 @@ class OrderController extends Controller
$yucunkuan = request('yucunkuan', 0);//使用的预存款数量
$erxian_info= request('erxian_info');//使用的预存款数量
$sanfang_code=request('sanfang_code'); //第三方code
+ $yuyue_fangshi=request('yuyue_fangshi'); //预约方式 个检、团检、个检先选号源等,非必填
$wj_flag = request('wj'); //问卷标记
@@ -166,7 +167,7 @@ class OrderController extends Controller
if ($type != 1 && $type != 2) {
return \Yz::echoError1('type参数,体检类型错误');
}
- if (!isset($plan_id)) return \Yz::echoError1('号源id不能为空');
+ if (!isset($plan_id)) return \Yz::echoError1('请选择预约时间');
if ($type == 2 and !isset($group_id)) return \Yz::echoError1('团检,group_id不能为空');
if ($type == 1 and isset($group_id)) return \Yz::echoError1('体检类型:个检 与group_id冲突');
@@ -203,6 +204,9 @@ class OrderController extends Controller
$combo_info = DB::table('combos')->where(['combo_id' => $combo_id, 'status' => 1])->first();
if (!$combo_info) return \Yz::echoError1("套餐不存在");
if (!isset($combo_info->checkup_type_id)) return \Yz::echoError1("套餐未关联体检类型");
+ if($combo_info->sex<>0 and $combo_info->sex<>$person->sex) {
+ return \Yz::echoError1("套餐性别与体检人性别不匹配");
+ }
$checkup_type_id = $combo_info->checkup_type_id;
//构建多选一数据
@@ -349,7 +353,7 @@ class OrderController extends Controller
'have_Nx1'=> !empty($Nx1_arrInfo)
];
$TJ_Leixing_id = $group_info['checkup_type_id'];
- $title = "单位团检" . $group_info['combo_name'];
+ $title = "单位团检" . $group_info['danwei_name'];
$price = $price + $group_info['sixi_zong_ji_jin_e'];
$need_pay = ($price - $group_info['tongshou_xiane']) > 0 ? $price - $group_info['tongshou_xiane'] : 0;
//团检订单金额为减去统收后的金的
@@ -406,7 +410,7 @@ class OrderController extends Controller
//检查号源是否可用
$plan = new PlanController();
- $plan_check = $plan->CheckPlan($plan_id, $hospital_id, $type, $person->sex, $price, $checkup_type_id);
+ $plan_check = $plan->CheckPlan($plan_id, $hospital_id, $type, $person->sex, $price, $checkup_type_id,$user->id);
if ($plan_check['status'] === false) return \Yz::echoError1($plan_check['msg']);
$plan = $plan_check['plan'];
@@ -441,9 +445,10 @@ class OrderController extends Controller
if (isset($erxian_info) and !empty($erxian_info)) {
foreach ($erxian_info as $erxian_item) {
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$plan->date],'action'=>"1"],uniqid());
- if($plan->time<="12:00") $end_time="12:00";
- if($plan->time>"12:00") $end_time="23:59";
- if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选则日期");
+ // if($plan->time<="12:00") $end_time="12:00";
+ // if($plan->time>"12:00") $end_time="23:59";
+ $end_time="23:59";
+ if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选择日期");
$temp_date=[];
$planTime = new DateTime($plan->time);
$planTime->modify('+1 hour');
@@ -460,13 +465,20 @@ class OrderController extends Controller
break;
}
}
- if(empty($temp_date)) return \Yz::echoError1("二线号源不可用,请重新选则日期");
+
+ if(empty($temp_date)) {
+ if(isset($yuyue_fangshi) and $yuyue_fangshi<>'GeJianPlanFront') { //个检先选号源此处不提示 不拦截
+ return \Yz::echoError1("二线号源不可用,请重新选择日期");
+ }
+ }
+
+
}
}
//校验二线号源
- if (isset($plan_nmr_info) and !empty($plan_nmr_info)) {
+ if (isset($plan_nmr_info) and !empty($plan_nmr_info) ) {
$plan_nmr_temp = [];
foreach ($plan_nmr_info as $key => $plan_nmr) {
if ($plan_nmr['item_id'] <> -1) {
@@ -480,7 +492,13 @@ class OrderController extends Controller
];
//调用接口校验号源是否可用
$erxian_status = $AspNet::ErXian(['YYRQ' => $p_nmr_data['date'], 'YYSJ' => $p_nmr_data['time'], 'yyid' => $yyid, 'action' => 4], uniqid());
- if ($erxian_status !== true) return \Yz::echoError1($p_nmr_data['name'] . '号源不可用,请重新选择');
+ if ($erxian_status !== true) {
+ if(isset($yuyue_fangshi) and $yuyue_fangshi<>'GeJianPlanFront') { //个检先选号源此处不提示 不拦截
+ return \Yz::echoError1($p_nmr_data['name'] . '号源不可用,请重新选择');
+ }
+
+ }
+
$plan_nmr_temp[] = $p_nmr_data;
}
}
@@ -695,14 +713,31 @@ class OrderController extends Controller
return \Yz::Return(true,"操作完成",[]);
}
//如果有二线号源,根据体检时间查询二线可用号源,区分上下午,二线需预约体检时间1小时后
+ $buyInfo=json_decode($orderInfo->buy_info,true);
$db_nmr_info=json_decode($orderInfo->erxian_appointment_info,true);
+ if(isset($buyInfo['nmr_list']) and !empty($buyInfo['nmr_list']) and isset($db_nmr_info) and empty($db_nmr_info)){
+ $temp_erxian=[];
+ foreach ($buyInfo['nmr_list'] as $k=>$v){
+ $cha_item=DB::table('items')->where(['item_id'=>$v['item_id'],'status'=>1])->first();
+ if(!!$cha_item){
+ $temp_erxian[]=[
+ 'item_id'=>$v['item_id'],
+ 'name'=>$cha_item->name,
+ 'price'=>$cha_item->price,
+ 'time'=>'',
+ 'date'=>'',
+ 'gid'=>'',
+ ];
+ }
+ }
+ $db_nmr_info=$temp_erxian;
+ }
$nmr_info=[];
if (isset($db_nmr_info) and !empty($db_nmr_info)) {
foreach ($db_nmr_info as $erxian_item) {
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$planInfo->date],'action'=>"1"],uniqid());
- if($planInfo->time<="12:00") $end_time="12:00";
- if($planInfo->time>"12:00") $end_time="23:59";
- if(!isset($nmrPlans[$planInfo->date]) or empty($nmrPlans[$planInfo->date])) return \Yz::echoError1("二线号源不可用,请重新选则日期");
+ $end_time="23:59";
+ if(!isset($nmrPlans[$planInfo->date]) or empty($nmrPlans[$planInfo->date])) return \Yz::echoError1("二线号源不可用,请重新选择日期");
$temp_date=[];
$planTime = new DateTime($planInfo->time);
$planTime->modify('+1 hour');
@@ -720,7 +755,7 @@ class OrderController extends Controller
break;
}
}
- if(empty($temp_date)) return \Yz::echoError1("二线号源不可用,请重新选则日期");
+ if(empty($temp_date)) return \Yz::echoError1("二线号源不可用,请重新选择日期");
}
}
@@ -940,6 +975,9 @@ class OrderController extends Controller
'可选项目信息' => $item_arr,
]);
if (count($item_check['data']) != 1) {
+ if(strpos( $item_check['message'], '与套餐允许性别') !== false){
+ $item_check['message']= '套餐性别与体检人性别不匹配';
+ }
return ['status' => false, 'msg' => "体检系统提示:" . $item_check['message']];
}
}
@@ -1325,7 +1363,7 @@ class OrderController extends Controller
];
$dnet = new AspNetZhuanController();
$res = $dnet->WeiXinSend($data);
-
+ return \Yz::Return(true, "推送完成", ['res' => $res]);
}
//判断今天是否是给定日期的前一天
diff --git a/Laravel/app/Http/Controllers/API/H5/OrderNewController.php b/Laravel/app/Http/Controllers/API/H5/OrderNewController.php
index 93248ac..d4e2121 100644
--- a/Laravel/app/Http/Controllers/API/H5/OrderNewController.php
+++ b/Laravel/app/Http/Controllers/API/H5/OrderNewController.php
@@ -99,7 +99,10 @@ class OrderNewController extends Controller
$combo_info = DB::table('combos')->where(['combo_id' => $combo_id, 'status' => 1])->first();
if (!$combo_info) return \Yz::echoError1("套餐不存在");
if (!isset($combo_info->checkup_type_id)) return \Yz::echoError1("套餐未关联体检类型");
-// if($combo_info->sex<>0 and $combo_info->sex<>$person->sex) { //医院要求购买套餐时,不限制性别,预约和转赠时再限制,所以这段注释掉了
+ //医院要求购买套餐时,不限制性别,预约和转赠时再限制,所以这段注释掉了
+ //2025-04-30 18:45又要求限制性别,所以又取消注释了
+ //2025-05-7 16:28 购买不限制性别,所以又注释掉了
+// if($combo_info->sex<>0 and $combo_info->sex<>$person->sex) {
// return \Yz::echoError1("套餐性别与体检人性别不匹配");
// }
$checkup_type_id = $combo_info->checkup_type_id;
@@ -268,27 +271,28 @@ class OrderNewController extends Controller
}
- //调用思信接口判断各个项目是否可用
- $check_items = [];
- foreach ($item_ids as $item_id) {
- $check_items[] = ['Id' => $item_id];
- }
- if ((isset($combo_id) and $combo_id <> 0) || count($check_items) != 0) {
- $item_check = self::item_check($hospital_id, [
- '人员信息列表' => [[
- "序号" => 0,
- "性别" => $person->sex == 1 ? '男' : '女',
- "年龄" => floor((time() - strtotime($person->birthday)) / 86400 / 360),
- "婚姻状态" => $person->married == 1 ? '已婚' : '未婚',
- ]],
- '套餐Id' => $combo_id == 0 ? null : $combo_id,
- '可选项目信息' => $check_items,
- ]);
- if (count($item_check['data']) != 1) {
- return \Yz::echoError1("体检系统提示:" . $item_check['message']);
- }
- }
-
+ //调用思信接口判断各个项目是否可用,单纯购买,不预约,不调用思信接口,所以注释掉了------------------------⬇⬇⬇⬇⬇⬇
+
+// $check_items = [];
+// foreach ($item_ids as $item_id) {
+// $check_items[] = ['Id' => $item_id];
+// }
+// if ((isset($combo_id) and $combo_id <> 0) || count($check_items) != 0) {
+// $item_check = self::item_check($hospital_id, [
+// '人员信息列表' => [[
+// "序号" => 0,
+// "性别" => $person->sex == 1 ? '男' : '女',
+// "年龄" => floor((time() - strtotime($person->birthday)) / 86400 / 360),
+// "婚姻状态" => $person->married == 1 ? '已婚' : '未婚',
+// ]],
+// '套餐Id' => $combo_id == 0 ? null : $combo_id,
+// '可选项目信息' => $check_items,
+// ]);
+// if (count($item_check['data']) != 1) {
+// return \Yz::echoError1("体检系统提示:" . $item_check['message']);
+// }
+// }
+//------------------------------------------------------------------------------⬆⬆⬆⬆
$plan_nmr_appointment_info = [];
//校验积分和预存款
@@ -433,12 +437,34 @@ class OrderNewController extends Controller
$plan_id = request('plan_id');
$orderid = request('orderid');
$doctor = request('doctor');
+ $person_id = request('person_id');
$order = DB::table('orders')->where(['id' => $orderid])->first();
if(!$order) return \Yz::echoError1("订单不存在");
if($order->status!== 2) return \Yz::echoError1("订单不是已支付状态不能预约");
- if (!isset($plan_id)) return \Yz::echoError1('号源id不能为空');
+ if (!isset($plan_id)) return \Yz::echoError1('请选择预约时间');
+ if(isset($person_id)){ //如果默认体检人与订单不符 则更换为默认体检人
+ $person_new=DB::table('web_user_person')->where(['id' => $person_id,'is_del' => 0])->first();
+ if(!!$person_new){
+ DB::table('orders')->where(['id' => $orderid])->update([
+ 'person_id' => $person_id,
+ 'name' => $person_new->name,
+ 'phone' => $person_new->phone,
+ 'id_number' => $person_new->id_number,
+ 'birthday' => $person_new->birthday,
+ 'sex'=>$person_new->sex
+ ]);
+ $order->person_id=$person_id;
+ }
+ }
$person = DB::table('web_user_person')->where(['id' => $order->person_id, 'is_del' => 0])->first();
if (!$person) return \Yz::echoError1('体检人不存在');
+ if(empty($person->id_number)) return \Yz::echoError1("用户证件号不能为空");
+ $combo_info = DB::table('combos')->where(['combo_id' => $order->combo_id, 'status' => 1])->first();
+ if (!$combo_info) return \Yz::echoError1("套餐不存在");
+ if($combo_info->sex<>0 and $combo_info->sex<>$person->sex) {
+ return \Yz::echoError1("套餐性别与体检人性别不匹配");
+ }
+
if ($order->hospital_id == 1) {
$yyid = 6;
}
@@ -447,7 +473,7 @@ class OrderNewController extends Controller
}
//检查号源是否可用
$plan = new PlanController();
- $plan_check = $plan->CheckPlan($plan_id, $order->hospital_id, $order->type, $order->sex, $order->price, $order->checkup_type_id);
+ $plan_check = $plan->CheckPlan($plan_id, $order->hospital_id, $order->type, $order->sex, $order->price, $order->checkup_type_id,$order->web_user_id);
if ($plan_check['status'] === false) return \Yz::echoError1($plan_check['msg']);
$plan = $plan_check['plan'];
//校验号源日期是否超过订单有效期
@@ -462,9 +488,8 @@ class OrderNewController extends Controller
if (isset($erxian_info) and !empty($erxian_info)) {
foreach ($erxian_info as $erxian_item) {
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$plan->date],'action'=>"1"],uniqid());
- if($plan->time<="12:00") $end_time="12:00";
- if($plan->time>"12:00") $end_time="23:59";
- if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选则日期");
+ $end_time="23:59";
+ if(!isset($nmrPlans[$plan->date]) or empty($nmrPlans[$plan->date])) return \Yz::echoError1("二线号源不可用,请重新选择日期");
$temp_date=[];
$planTime = new DateTime($plan->time);
$planTime->modify('+1 hour');
@@ -481,7 +506,7 @@ class OrderNewController extends Controller
break;
}
}
- if(empty($temp_date)) return \Yz::echoError1("二线号源不可用,请重新选则日期");
+ if(empty($temp_date)) return \Yz::echoError1("二线号源不可用,请重新选择日期");
}
}
//校验二线号源
@@ -668,7 +693,21 @@ class OrderNewController extends Controller
$status=$s->CancelZhuanZeng($order_id);
return \Yz::Return($status['status'],$status['msg'],['new_orderid'=>$order_id]);
}
-
+ //获取用户待预约订单
+ public function GetPendingOrders()
+ {
+ $openid = request('openid');
+ $person_id = request('person_id');
+ $user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first();
+ if (!$user) return \Yz::echoError1('用户不存在');
+ $list=DB::table('orders')->where(['web_user_id'=>$user->id,'status'=>2,'type'=>1])
+ ->whereNotNull('combo_id')
+ ->where(function($query) {
+ $query->where('appointment_number', '=', '')
+ ->orWhereNull('appointment_number');
+ })->get();
+ return \Yz::Return(true,'查询完成',['list'=>$list]);
+ }
public function item_check($hospital, $data)
{
$peis = new PEISApiController();
diff --git a/Laravel/app/Http/Controllers/API/H5/PayController.php b/Laravel/app/Http/Controllers/API/H5/PayController.php
index a906b72..c0c30f7 100644
--- a/Laravel/app/Http/Controllers/API/H5/PayController.php
+++ b/Laravel/app/Http/Controllers/API/H5/PayController.php
@@ -110,6 +110,9 @@ class PayController extends Controller
}
}
+ if(!!$order->plan_id){
+ $is_yuyue=true;
+ }
return \Yz::Return(true, "支付成功", ['id' => $order->id,'is_yuyue'=>$is_yuyue]);
} else {
diff --git a/Laravel/app/Http/Controllers/API/H5/PersonController.php b/Laravel/app/Http/Controllers/API/H5/PersonController.php
index e37216d..5b92399 100644
--- a/Laravel/app/Http/Controllers/API/H5/PersonController.php
+++ b/Laravel/app/Http/Controllers/API/H5/PersonController.php
@@ -98,7 +98,7 @@ class PersonController extends Controller
'start_time' => $group_info['预约开始日期'],
'end_time' => $group_info['预约结束日期'],
'danwei_name' => $group_info['单位名称'],
- 'group_name' => $group_info['单位名称'] . ($group_info['部门名称']),
+ 'group_name' => $group_info['单位名称'] ,
'bumen_name' => $group_info['部门名称'],
'group_id' => $group_info['预约Id'],
'tongshou_xiane'=>$group_info['统收限额']==0?0.00:$group_info['统收限额'],
@@ -125,7 +125,7 @@ class PersonController extends Controller
if (!isset($id_number)) return \Yz::echoError1('身份证不能为空');
if (!isset($hospital_id)) return \Yz::echoError1('医院id不能为空');
$data = [
- '电话号码' => $phone,
+ '电话号码' => null,
'证件号码' => $id_number
];
$res = self::group_info($hospital_id, $data);
diff --git a/Laravel/app/Http/Controllers/API/H5/PlanController.php b/Laravel/app/Http/Controllers/API/H5/PlanController.php
index ffe7463..0589e5d 100644
--- a/Laravel/app/Http/Controllers/API/H5/PlanController.php
+++ b/Laravel/app/Http/Controllers/API/H5/PlanController.php
@@ -15,6 +15,7 @@ class PlanController extends Controller
$hospital_id = request('hospital');
$openid = request('openid');
$person_id = request('person_id');
+ $combo_id = request('combo_id');
$month = request('month');
$use_type = request('use_type');//使用类型 1个检 2团检
$checkup_type_id = request('checkup_type_id');//体检类型表对应id
@@ -33,10 +34,16 @@ class PlanController extends Controller
->whereBetween('date', [$first_day, $last_day])->whereIn('status', [1])
->whereRaw('CONCAT(date, " ", time) >?', [$currentDateTime])
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [json_encode($checkup_type_id)])
- ->where(['hospital_id' => $hospital_id, 'type' => 1, 'is_del' => 0])
+ ->where(['hospital_id' => $hospital_id, 'type' => 1, 'is_del' => 0,'is_lock' => 0])
->where('is_vip', '<>', 1)
->whereIn('use_type', [0, $use_type]);
+ if (!!$combo_id) {
+ $comboInfo = DB::table('combos')->where(['combo_id' => $combo_id])->first();
+ if (!empty($comboInfo->keyue_start_time) and !empty($comboInfo->keyue_end_time)) {
+ $list = $list->whereBetween('time', [$comboInfo->keyue_start_time, $comboInfo->keyue_end_time]);
+ }
+ }
if (!empty($danwei_id)) {
$cha_bind_danwei = DB::table('plan_type')->WhereRaw('JSON_CONTAINS(bind_units, ?)', [json_encode($danwei_id)])->where(['is_del' => 0])->get();
if (count($cha_bind_danwei) > 0) {
@@ -126,6 +133,8 @@ class PlanController extends Controller
$use_type = request('use_type');//使用类型 1个检 2团检
$checkup_type_id = (string)request('checkup_type_id');//体检类型表对应id
$amount = request('amount');//总金额
+ $big_date = request('big_date');//从月历选择的日期,然后返回这个日期7天内的所有日期
+ if(!isset($big_date)) $big_date=date('Y-m-d');
if (!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空");
$danwei_id = request('danwei_id');//单位名称
@@ -137,7 +146,7 @@ class PlanController extends Controller
$currentDateTime = now();
$list = DB::table('plans')
->where('date', $date)->whereIn('status', [1, 2])
- ->whereRaw('CONCAT(date, " ", time) >?', [$currentDateTime])
+ // ->whereRaw('CONCAT(date, " ", time) >?', [$currentDateTime])
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
->where(['hospital_id' => $hospital_id, 'type' => 1, 'is_del' => 0])
->where('is_vip', '<>', 1)
@@ -191,7 +200,7 @@ class PlanController extends Controller
//如果有核磁项目,11点往后的号源不可用
foreach ($list as $key => $item) {
if ($item->time > '11:00:00' and $item->time <= '12:00:00') {
- $list[$key]->status = 2;
+ // $list[$key]->status = 2; //要求放开全天核磁
}
}
}
@@ -206,10 +215,25 @@ class PlanController extends Controller
}
+ if(isset($openid))
+ {
+ $user = DB::table('web_users')->where(['openid' => $openid, 'is_del' => 0])->first();
+ if (!$user) return \Yz::echoError1("openid对应用户不存在");
+ foreach ($list as $key=> $l) {
+ //判断锁定
+ if($l->is_lock==1 and $l->lock_user_id==$user->id){
+ $list[$key]->is_lock=0;
+ }
+ //判断是否超时,超时设置为已经被占用,不可用
+ if($l->date . ' '.$l->time< date('Y-m-d H:i:s') ){
+ $list[$key]->status=2;
+ }
+ }
+ }
// 获取前后各三天的日期
- $dateTime = new DateTime($date);
+ $dateTime = new DateTime($big_date);
$days7 = [];
- for ($i = -3; $i <= 3; $i++) {
+ for ($i = 0; $i < 7; $i++) {
$dateTimeClone = clone $dateTime; // 克隆对象以避免修改原对象
$dateTimeClone->modify("$i days"); // 修改日期
$days7[] = $dateTimeClone->format('Y-m-d'); // 按照需要的格式添加到结果数组
@@ -222,6 +246,17 @@ class PlanController extends Controller
->where(['hospital_id' => $hospital_id, 'type' => 1, 'is_del' => 0])
->where('is_vip', '<>', 1)
->whereIn('use_type', [0, $use_type]);
+ if(isset($user)){
+ $weeklist = $weeklist
+ ->where(function ($query) use ($user) {
+ $query->where('is_lock', '=', 0)
+ ->orWhere(function ($query) use ($user) {
+ $query->where('is_lock', 1) // 已锁定但属于当前用户
+ ->where('lock_user_id', $user->id);
+ });
+
+ });
+ }
if (!empty($danwei_id)) {
$cha_bind_danwei = DB::table('plan_type')->WhereRaw('JSON_CONTAINS(bind_units, ?)', [json_encode($danwei_id)])->where(['is_del' => 0])->get();
if (count($cha_bind_danwei) > 0) {
@@ -239,7 +274,7 @@ class PlanController extends Controller
if (count($comboItemsNmr) > 0 or count($ItemsNmr) > 0 or !empty($er_xian_info)) {
//如果有核磁项目,11点往后的号源不可用
- $weeklist = $weeklist->where('time', '<=', '11:00');
+ //$weeklist = $weeklist->where('time', '<=', '11:00'); //要求放开全天核磁
}
if (!!$combo_id) {
$comboInfo = DB::table('combos')->where(['combo_id' => $combo_id])->first();
@@ -247,7 +282,7 @@ class PlanController extends Controller
$weeklist = $weeklist->whereBetween('time', [$comboInfo->keyue_start_time, $comboInfo->keyue_end_time]);
}
if (count($comboItemsNmr) > 0) {
- $weeklist = $weeklist->whereNotBetween('time', ['11:00:00', '12:00:00']);
+ // $weeklist = $weeklist->whereNotBetween('time', ['11:00:00', '12:00:00']); //要求放开全天核磁
}
}
if (!!$personInfo) {
@@ -306,11 +341,13 @@ class PlanController extends Controller
}
//检查号源是否可用
- public function CheckPlan($plan_id, $hospital_id, $type, $sex, $price, $checkup_type_id)
+ public function CheckPlan($plan_id, $hospital_id, $type, $sex, $price, $checkup_type_id,$user_id=0)
{
-
$plan = DB::table('plans')->where(['id' => $plan_id, 'hospital_id' => $hospital_id, 'status' => 1, 'is_del' => 0])->first();
if (!$plan) return ['status' => false, 'msg' => "号源不可用"];
+ if($plan->is_lock==1 and $plan->lock_user_id<>$user_id){ //判断锁定
+ return ['status' => false, 'msg' => "号源不可用"];
+ }
//判断个检/团检类型
if ($plan->use_type <> 0 and $plan->use_type <> $type) {
$type_temp = '';
@@ -344,4 +381,35 @@ class PlanController extends Controller
return ['status' => true, 'msg' => "", 'plan' => $plan];
}
+ //锁定号源,标记锁定状态,锁定时间,超过锁定时间自动释放
+ public function LockPlan()
+ {
+ $openid = request('openid');
+ $plan_id = request('plan_id');
+ $user = DB::table('web_users')->where(['openid' => $openid, 'is_del' => 0])->first();
+ if (!$user) return \Yz::echoError1("openid对应用户不存在");
+ $planInfo=DB::table('plans')->where(['id' => $plan_id,'status'=>1,'is_del'=>0])->first();
+ if(!$planInfo) return \Yz::echoError1("此号源不可用");
+ if($planInfo->is_lock<>0 and $planInfo->lock_user_id<>$user->id) return \Yz::echoError1("此号源不可用");
+
+
+ $lock_endtime = strtotime('+'.config('app.globals.plan_lock_time').' minutes');
+ $lock_endtime = date('Y-m-d H:i:s', $lock_endtime);
+ $u=DB::table('plans')->where(['id' => $plan_id])->update(['is_lock'=>1,'lock_endtime'=>$lock_endtime,'lock_user_id'=>$user->id]);
+ if($u){
+ return \Yz::Return(true, "锁定成功", ['plan_id' => $plan_id,'lock_endtime' => $lock_endtime]);
+ }else{
+ return \Yz::echoError1("锁定失败");
+ }
+ }
+ //释放锁定
+ public function UnLockPlan(){
+ $plan_id = request('plan_id');
+ $u=DB::table('plans')->where(['id' => $plan_id])->update(['is_lock'=>0,'lock_endtime'=>null,'lock_user_id'=>null]);
+ if($u){
+ return \Yz::Return(true, "释放成功", ['plan_id' => $plan_id]);
+ }else{
+ return \Yz::echoError1("释放失败");
+ }
+ }
}
diff --git a/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php b/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php
index be41a29..c2a80d1 100644
--- a/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php
+++ b/Laravel/app/Http/Controllers/API/H5/QuestionnairesLogsController.php
@@ -232,6 +232,18 @@ class QuestionnairesLogsController extends Controller
}
}
}
+ //先根据人员信息进行性别和婚姻赋值,如果传参有这两个 再覆盖
+ if($person_info->sex==1){
+ $content_sex="男";
+ }
+ if($person_info->sex==2){
+ $content_sex="女";
+ $content_hunyin="未婚";
+ if($person_info->married==1){
+ $content_hunyin="已婚";
+ }
+ }
+
foreach ($content as $key => $value) {
$question_ids[] = $value['id'];
$question_map["q{$value['id']}"] = $value;
@@ -267,21 +279,21 @@ class QuestionnairesLogsController extends Controller
//获取套餐的项目
$jichu_items_ids = [];
- if ($jichu_combo_new) {
+ if (isset($jichu_combo_new)) {
$jichu_combo_items = DB::table('combo_items')->where('combo_id', $jichu_combo_new)->get();
foreach ($jichu_combo_items as $key => $value) {
$jichu_items_ids[]=$value->item_id;
}
}
$tuijian_items_ids = [];
- if ($tuijian_combo_new) {
+ if (isset($tuijian_combo_new)) {
$tuijian_combo_items = DB::table('combo_items')->where('combo_id', $tuijian_combo_new)->get();
foreach ($tuijian_combo_items as $key => $value) {
$tuijian_items_ids[]=$value->item_id;
}
}
$gaoduan_items_ids = [];
- if ($gaoduan_combo_new) {
+ if (isset($gaoduan_combo_new)) {
$gaoduan_combo_items = DB::table('combo_items')->where('combo_id', $gaoduan_combo_new)->get();
foreach ($gaoduan_combo_items as $key => $value) {
$gaoduan_items_ids[]=$value->item_id;
diff --git a/Laravel/app/Http/Controllers/API/H5/ReportController.php b/Laravel/app/Http/Controllers/API/H5/ReportController.php
index 47a1374..0f067b2 100644
--- a/Laravel/app/Http/Controllers/API/H5/ReportController.php
+++ b/Laravel/app/Http/Controllers/API/H5/ReportController.php
@@ -20,14 +20,14 @@ class ReportController extends Controller
$user = DB::table('web_users')->where(['openid' => $openid, 'status' => 1, 'is_del' => 0])->first();
if (!$user) return \Yz::echoError1('用户不存在');
- $persons = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->pluck('id_number')->toArray();
+ $persons = DB::table('web_user_person')->where(['user_id' => $user->id, 'is_del' => 0])->whereNotIn('id_number',['-','*','--','---','----','无','未上户','未上户口','未落户'])->get();
$report_list=[];
$peis = new PEISApiController();
- foreach ($persons as $key => $id_number) {
- if(strlen($id_number)==0) continue;
+ foreach ($persons as $key => $person) {
+ if(strlen($person->id_number)==0) continue;
$data = [
- '电话号码' => "",
- '证件号码' => $id_number,
+ '电话号码' => $person->phone,
+ '证件号码' => $person->id_number,
'体检号' => ""
];
$reports = $peis::Post('体检报告查询', $hospital_id, $data);
@@ -91,10 +91,12 @@ class ReportController extends Controller
'code' => "SG",'item_id' => ['5853094','5852882','5853229']],
['name' => "体重(kg)",
'code' => "TZ",'item_id' => ['5853095','5852883','5853228']],
+ ['name' => "体重指数",
+ 'code' => "TZZS",'item_id' => ['5852884','5853096']],
['name' => "收缩压",
- 'code' => "XY(SSY)",'item_id' => ['5853097']],
- ['name' => "血红蛋白",
- 'code' => "BXBSM",'item_id' => ['5852944']],
+ 'code' => "XY(SSY)",'item_id' => ['5852927','5853097','5853225']],
+ ['name' => "舒张压",
+ 'code' => "XY(SZY)",'item_id' => ['5852926','5853098','5853226']],
];
$tijian_num = request('tijian_num');
$hospital_id=request('hospital_id');
@@ -131,16 +133,22 @@ class ReportController extends Controller
$v_error_items = [];
$error_items = [];
$base_items = [];
- foreach ($items as $item) {
- foreach ($YiBanJianChaList as $ybitem) {
- if ($item->基础项目代码 == $ybitem['code'] or in_array($item->基础项目代码, $ybitem['item_id'])) {
+ // 遍历 YiBanJianChaList,确保顺序一致
+ foreach ($YiBanJianChaList as $ybitem) {
+ foreach ($items as $item) {
+ if ($item->基础项目代码 == $ybitem['code'] || in_array($item->基础项目代码, $ybitem['item_id'])) {
$base_items[] = [
'name' => $ybitem['name'],
'value' => $item->结果值,
];
+ break; // 匹配到后跳出内层循环,避免重复匹配
}
}
- if ($item->异常标识 != null and $item->异常标识 != '') {
+ }
+
+ // 收集异常项
+ foreach ($items as $item) {
+ if (!empty($item->异常标识)) {
$error_items[] = $item;
}
}
@@ -184,6 +192,8 @@ class ReportController extends Controller
return \Yz::Return(true, "查询完成", ['list' => $list]);
}
+
+ //完整报告中的详情,返回单项 范围格式,范围格式不统一,容易出现bug
public function GetReportDetai()
{
$id = request('id');
@@ -207,6 +217,7 @@ class ReportController extends Controller
$error_items = [];
foreach ($items as $item) {
+ $item->表格类型='范围表';
if ($item->异常标识 != null and $item->异常标识 != '') {
$m = '';
if ($item->异常标识 == '↓') {
@@ -218,21 +229,28 @@ class ReportController extends Controller
$error_items[] = $item->基础项目名称 . $m;
}
if($item->结果类型=='数值' and $item->结果值!='' and $item->结果值!=null and $item->结果值范围!='' and $item->结果值范围 !=null){
-
- $range = $this->convertToArray($item->结果值范围);
-
- $item->结果值范围=$range;
- $item->最大范围=[];
- if(count($range)>1){
- $kuadu=$range[1]-$range[0];
- if($item->结果值=='未见') $item->结果值=0;
- if(($item->结果值-$range[1])/$kuadu<=1){
- $max=$range[1]+$kuadu;
- }else{
- $max=$item->结果值;
+ try{
+ $range = $this->convertToArray($item->结果值范围);
+// if(!is_array($range)){
+// $item->表格类型='表格';
+// continue;
+// }
+ $item->结果值范围=$range;
+ $item->最大范围=[];
+ if(count($range)>1){
+ $kuadu=$range[1]-$range[0];
+ if($item->结果值=='未见') $item->结果值=0;
+ if(($item->结果值-$range[1])/$kuadu<=1){
+ $max=$range[1]+$kuadu;
+ }else{
+ $max=$item->结果值;
+ }
+ $item->最大范围=[0,$max];
}
- $item->最大范围=[0,$max];
+ }catch (\Exception $e){
+
}
+
}
}
if (count($items) > 0) {
@@ -243,6 +261,56 @@ class ReportController extends Controller
}
+ }
+ //完整报告中的详情,返回单项 范围格式,为应对范围格式不统一,改为返回表格数据
+ public function GetReportDetai2()
+ {
+ $id = request('id');
+ $l2 = DB::table('report_l2_items')->where(['id' => $id])->first();
+ $items = DB::table('report_l3_base_items')->where(['report_l2_id' => $id])->orderBy('基础项目顺序')->get();
+ if ($l2->科室类型 == 'PACS') {
+ $suojian = [];
+ $zhenduan = [];
+ foreach ($items as $item) {
+ $suojian[] = empty($item->所见)?$item->结果值:$item->所见;
+ $jielun[] = $item->结果值;
+ }
+
+ if (count($items) > 0) {
+ return \Yz::Return(true, "查询完成", ['is_pacs'=>true,'suojian' => $suojian,'jielun' => $jielun]);
+ } else {
+ return \Yz::echoError1('此项暂无内容');
+ }
+
+ } else {
+
+ $error_items = [];
+ $is_fanwei="无范围";
+ foreach ($items as $item) {
+ if($item->结果类型=='数值'){
+ $is_fanwei="有范围";
+ }
+ $item->表格类型='范围表';
+ if ($item->异常标识 != null and $item->异常标识 != '') {
+ $m = '';
+ if ($item->异常标识 == '↓') {
+ $m = '低';
+ }
+ if ($item->异常标识 == '↑') {
+ $m = '高';
+ }
+ $error_items[] = $item->基础项目名称 . $m;
+ }
+
+ }
+ if (count($items) > 0) {
+ return \Yz::Return(true, "查询完成", ['is_pacs'=>false,'is_fanwei'=>$is_fanwei,'list' => $items, 'error_items' => $error_items]);
+ } else {
+ return \Yz::echoError1('此项暂无内容');
+ }
+ }
+
+
}
function convertToArray($input) {
// 检查是否是范围表示法
diff --git a/Laravel/app/Http/Controllers/API/Internal/FenZhenController.php b/Laravel/app/Http/Controllers/API/Internal/FenZhenController.php
index 7fc5d95..3ad6a6d 100644
--- a/Laravel/app/Http/Controllers/API/Internal/FenZhenController.php
+++ b/Laravel/app/Http/Controllers/API/Internal/FenZhenController.php
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\API\Internal;
use App\Http\Controllers\API\PEISApiController;
use App\Http\Controllers\Controller;
+use App\Services\FenZhenService;
use DateInterval;
use DatePeriod;
use DateTime;
@@ -18,7 +19,25 @@ use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
class FenZhenController extends Controller
{
+
public function GetFenZhenInfo(){
+ $dates=request('dates');
+ $key=request('key');
+ if($key <>"ddXPpBrM3C93PHFdWDXbMX2vQ2AJQFFy"){
+ return \Yz::echoErrorJson('无权访问');
+ }
+ if(!$dates){
+ return \Yz::echoErrorJson('请选择日期');
+ }
+ $dates=$this->generateDateArray($dates[0],$dates[1]);
+ if(count($dates)>31){
+ return \Yz::echoErrorJson('最多只能选择31天');
+ }
+ $service=new FenZhenService();
+ $res=$service->export($dates);
+ return \Yz::Return($res['status'],$res['msg'],['url'=>$res['url']]);
+ }
+ public function GetFenZhenInfo_feiqi(){//废弃
ini_set('memory_limit', '256M');
$dates=request('dates');
$key=request('key');
diff --git a/Laravel/app/Http/Controllers/API/Internal/PersonController.php b/Laravel/app/Http/Controllers/API/Internal/PersonController.php
new file mode 100644
index 0000000..16af13a
--- /dev/null
+++ b/Laravel/app/Http/Controllers/API/Internal/PersonController.php
@@ -0,0 +1,36 @@
+"ddXPpBrM3C93PHFdWDXbMX2vQ2AJQFFy"){
+ return \Yz::echoError1('无权访问');
+ }
+ $person=DB::table('web_user_person')->where(['id_number'=>$id_number,'is_del'=>0])->first();
+ if($person){
+ $data = [
+ "ghzid" => $person->ghzid,
+ "yyid" => "6",
+ ];
+ $hzid="";
+ $dnet = new AspNetZhuanController();
+ $res = $dnet->GetHzid($data);
+ if(isset($res['hzid'])){
+ $hzid=$res['hzid'];
+ }
+ return \Yz::Return(true,"查询完成",['hzid'=>$hzid,'ghzid'=>$person->ghzid]);
+ }else{
+ return \Yz::echoError1('该身份证号不存在');
+ }
+ }
+}
diff --git a/Laravel/app/Http/Controllers/API/Internal/PlanController.php b/Laravel/app/Http/Controllers/API/Internal/PlanController.php
index b5df148..795fb7e 100644
--- a/Laravel/app/Http/Controllers/API/Internal/PlanController.php
+++ b/Laravel/app/Http/Controllers/API/Internal/PlanController.php
@@ -15,15 +15,17 @@ class PlanController extends Controller
$hospital_id =request('hospital');
$date=request('date');
$is_vip=request('is_vip');
- $checkup_type_id=(string)request('checkup_type_id');//体检类型表对应id
+ $checkup_type_id= request('checkup_type_id');//体检类型表对应id
if(!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空");
$currentDateTime = now();
$list=DB::table('plans')
->where('date',$date)->whereIn('status',[1])
->whereRaw('CONCAT(date, " ", time) >?', [$currentDateTime])
+ ->whereNull('bind_work_unit_id')
->where(function($query) use ($checkup_type_id) {
- $query->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
- ->orWhereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', ["8"]);
+ foreach ($checkup_type_id as $id) {
+ $query->orWhereRaw('JSON_CONTAINS(checkup_type_id, CAST(? AS JSON), "$")', [$id]);
+ }
})
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
->where('is_vip','=',$is_vip);
@@ -54,6 +56,15 @@ class PlanController extends Controller
$plan=DB::table('plans')->where('id',$id)->first();
if(!$plan) return \Yz::echoError1("该号源不存在");
if($plan->status<>2) return \Yz::echoError1("该号源未被占用,无需撤销");
+ $order=DB::table('orders')->where(['plan_id'=>$id,'status'=>2])->whereNull('source')->first();
+ if($order){
+ if($order->type ==1){
+ return \Yz::echoError1("该预约来自小程序,请顾客在小程序操作,或到号源后台取消订单");
+ }
+ if($order->type ==2){
+ return \Yz::echoError1("该预约来自小程序,请到号源后台取消订单");
+ }
+ }
$u=DB::table('plans')->where(['id'=>$id])->update(['status'=>1]);
if($u){
return \Yz::Return(true,'撤销占用成功',['id'=>$id]);
diff --git a/Laravel/app/Http/Controllers/API/Internal/TransferCodeController.php b/Laravel/app/Http/Controllers/API/Internal/TransferCodeController.php
index 3b1d0ca..7e4fb7f 100644
--- a/Laravel/app/Http/Controllers/API/Internal/TransferCodeController.php
+++ b/Laravel/app/Http/Controllers/API/Internal/TransferCodeController.php
@@ -33,7 +33,7 @@ class TransferCodeController extends Controller
//查询本地库是否有记录,进行相应的更新
$db_zk_code = DB::table('transfer_code')->where(['sanfang_qudao' => $qudao, 'code' => $code_num, 'is_del' => 0])->first();
if (!!$db_zk_code && $db_zk_code->status <> $res['data']['status']) {
- return \Yz::echoError1("此转赠码状态不正确,暂不可用(中康)code:".$code_num);
+ return \Yz::echoErrorJson("此转赠码状态不正确,暂不可用(中康)code:".$code_num);
}
if (!$db_zk_code) {
$data = [
@@ -47,13 +47,13 @@ class TransferCodeController extends Controller
}
}else{
- return \Yz::echoError1("此转赠码不可用。码号为:".$code_num."请核对后再试");
+ return \Yz::echoErrorJson("此转赠码不可用。码号为:".$code_num."请核对后再试");
}
}
$code=$code->where('sanfang_qudao',$qudao);
}
$code=$code->where(['code'=>$code_num,'status'=>1,'is_del'=>0])->first();
- if(!$code) return \Yz::echoError1("此转赠码不可用。码号为:".$code_num."请核对后再试");
+ if(!$code) return \Yz::echoErrorJson("此转赠码不可用。码号为:".$code_num."请核对后再试");
$u=DB::table('transfer_code')->where(['code'=>$code_num])->update([
'user_name'=>$user_name,
'user_id_number'=>$user_id_number,
@@ -81,7 +81,7 @@ class TransferCodeController extends Controller
$qudao = $validatedData['qudao'];
$tj_num = request('tj_num');
$code_info=DB::table('transfer_code')->where(['code'=>$code_num,'is_del'=>0,'sanfang_qudao'=>$qudao])->first();
- if(!$code_info) return \Yz::echoError1("此转赠码不存在");
+ if(!$code_info) return \Yz::echoErrorJson("此转赠码不存在");
$data=[];
$u=false;
$where=['code'=>$code_num,'is_del'=>0,'sanfang_qudao'=>$qudao];
@@ -104,7 +104,7 @@ class TransferCodeController extends Controller
$service=new ZhongKangService();
$res=$service->HandleTransferCode($type,$code_num,$code_info->user_name,$code_info->user_id_number);
if (!$res['status']) {
- return \Yz::echoError1( $res['msg']);
+ return \Yz::echoErrorJson( $res['msg']);
}
}
$u=DB::table('transfer_code')->where($where)->update($data);
@@ -112,7 +112,7 @@ class TransferCodeController extends Controller
if($u){
return \Yz::Return(true,"操作成功",['code_num'=>$code_num,'status'=>$cha->status]);
}else{
- return \Yz::echoError1("操作失败");
+ return \Yz::echoErrorJson("操作失败");
}
}
}
diff --git a/Laravel/app/Http/Controllers/API/Web/OrderController.php b/Laravel/app/Http/Controllers/API/Web/OrderController.php
index a804a48..3740b20 100644
--- a/Laravel/app/Http/Controllers/API/Web/OrderController.php
+++ b/Laravel/app/Http/Controllers/API/Web/OrderController.php
@@ -7,8 +7,15 @@ use App\Http\Controllers\API\H5\PersonController;
use App\Http\Controllers\API\H5\PlanController;
use App\Http\Controllers\API\PEISApiController;
use App\Http\Controllers\Controller;
+use DateInterval;
+use DatePeriod;
+use DateTime;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Storage;
+use Illuminate\Support\Str;
+use PhpOffice\PhpSpreadsheet\IOFactory;
+use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
class OrderController extends Controller
{
@@ -492,6 +499,71 @@ class OrderController extends Controller
return \Yz::echoError1('操作失败');
}
}
+
+ public function export()
+ {
+ $dates=request('dates');
+ $key=request('key');
+ if($key <>"ddXPpBrM3C93PHFdWDXbMX2vQ2AJQFFy"){
+ return \Yz::echoErrorJson('无权访问');
+ }
+ if(!$dates){
+ return \Yz::echoErrorJson('请选择日期');
+ }
+ $table_list=DB::table('orders')->where(['source'=>'web'])->whereBetween('created_at',[$dates[0].' 00:00:00',$dates[1].' 23:59:59'])
+ ->select(DB::raw("*, CASE WHEN sex = 1 THEN '男' WHEN sex = 2 THEN '女' ELSE '未知' END as sex"))
+ ->get();
+ $status_array=[
+ 1=>'未支付',
+ 2=>'已支付',
+ 3=>'已取消',
+ 4=>'到检',
+ 5=>'已退款',
+ ];
+ foreach ($table_list as $list_item) {
+ $list_item->status=$status_array[$list_item->status];
+ }
+ $template_path = Storage::path('public/excel/hiszhuanzhen.xlsx');
+ $spreadsheet = IOFactory::load($template_path);
+ $worksheet = $spreadsheet->getActiveSheet();
+ $styleArray = [
+ 'borders' => [
+ 'allBorders' => [
+ 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN,
+ 'color' => ['argb' => 'FF000000'],
+ ],
+ ],
+ ];
+ $row = 3;
+ $col = [
+ 'A' => 'title',
+ 'B' => 'name',
+ 'C' => 'id_number',
+ 'D' => 'price',
+ 'E' => 'appdoctor',
+ 'F' => 'phone',
+ 'G' => 'sex',
+ 'H' => 'appointment_date',
+ 'I' => 'appointment_time',
+ 'J' => 'status',
+ ];
+ foreach ($table_list as $table_item) {
+ foreach ($col as $index => $key) {
+ $worksheet->setCellValueExplicit($index . $row, $table_item->$key, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ }
+ $row++;
+ }
+ $file_name = Str::orderedUuid();
+ $dir_path = "public/excel/" . date('Ym') . '/' . $file_name;
+ Storage::makeDirectory($dir_path);
+ $name_date = date('n.j', strtotime($dates[1] . ' 00:00:00'));
+ $excel_path = $dir_path . "/His转诊$name_date.xlsx";
+ $writer = new Xlsx($spreadsheet);
+ $writer->save(Storage::path($excel_path));
+ $url = Storage::url($excel_path);
+ return ['status'=>true,'msg'=>'查询完成','url'=> env('APP_URL').$url];
+ }
+
public function item_check($hospital, $data)
{
$peis = new PEISApiController();
@@ -511,4 +583,5 @@ class OrderController extends Controller
return $orderNumber;
}
+
}
diff --git a/Laravel/app/Http/Controllers/H5/FenzhenController.php b/Laravel/app/Http/Controllers/H5/FenzhenController.php
index 90b485d..de35706 100644
--- a/Laravel/app/Http/Controllers/H5/FenzhenController.php
+++ b/Laravel/app/Http/Controllers/H5/FenzhenController.php
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\H5;
use App\Http\Controllers\API\PEISApiController;
use App\Http\Controllers\Controller;
+use App\Services\FenZhenService;
use DateInterval;
use DatePeriod;
use DateTime;
@@ -320,260 +321,8 @@ class FenzhenController extends Controller
if(count($dates)>31){
return \Yz::echoError1('最多只能选择31天');
}
- $table_list=[];
- $clinic_list=[];
- $table_list3=[];
- $client = new Client();
- $url = env('FENZHEN_URL');
- $header=[
- 'Authorization' => 'Bearer BD30333C-CBD4-4BA3-A27C-76727FF4D8B1',
- 'Content-Type' => 'application/json; charset=utf-8',
- ];
- $promises=[];
- foreach ($dates as $date) {
- $promises[]=$client->postAsync($url.'/api/Open/TiJian/export',['headers' => $header, 'json' => ['date'=>$date]]);
- }
-
-
- // 等待所有请求完成
- $results = Promise\Utils::settle($promises)->wait();
- foreach ($results as $key => $result) {
- if ($result['state'] === 'fulfilled') {
- $response = $result['value'];
- $res=json_decode($response->getBody(),true);
- // echo "Response from $key: " . $response->getBody() . "\n";
- $table_list = array_merge($table_list, $res['data']['table1'] ?? []);
- $clinic_list = array_merge($clinic_list, $res['data']['table2'] ?? []);
- $table_list3 = array_merge($table_list3, $res['data']['table3'] ?? []);
- }
- }
-
-// foreach ($dates as $date) {
-// $res = $fzc->fz('export', [
-// 'date' => $date
-// ]);
-//
-// // 使用 array_merge 逐个追加每日期的数据到总列表中
-// $table_list = array_merge($table_list, $res['data']['table1'] ?? []);
-// $clinic_list = array_merge($clinic_list, $res['data']['table2'] ?? []);
-// $table_list3 = array_merge($table_list3, $res['data']['table3'] ?? []);
-// }
-
-
- $template_path = Storage::path('public/excel/check_time.xlsx');
- $spreadsheet = IOFactory::load($template_path);
- $worksheet = $spreadsheet->getActiveSheet();
- $styleArray = [
- 'borders' => [
- 'allBorders' => [
- 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN,
- 'color' => ['argb' => 'FF000000'],
- ],
- ],
- ];
- $row = 3;
- $col = [
- 'A' => 'date',
- 'B' => 'name',
- 'C' => 'number',
- 'D' => 'phone',
- 'E' => 'group_name',
- 'F' => 'clinic',
- 'G' => 'doctor',
- 'H' => 'queue',
- 'I' => 'calling',
- 'J' => 'done',
- 'K' => 'clinic_check_time',
- 'L' => 'true_check_time',
- 'M' => 'timeout_check_time',
- 'N' => 'clinic_wait_time',
- 'O' => 'true_wait_time',
- 'P' => 'timeout_wait_time',
- 'Q' => 'clinic_all_time',
- 'R' => 'true_all_time',
- 'S' => 'timeout_all_time',
- ];
- foreach ($table_list as $table_item) {
- foreach ($col as $index => $key) {
- $worksheet->setCellValueExplicit($index . $row, $table_item[$key], \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- }
- $row++;
- }
- $worksheet->getStyle('A3:S' . ($row - 1))->applyFromArray($styleArray);
- $row = 3;
- $col = [
- 'U' => 'group_name',
- 'V' => 'clinic',
- 'W' => 'doctor',
- 'X' => 'check',
- 'Y' => 'check_out',
- 'Z' => 'wait',
- 'AA' => 'wait_out',
- ];
- foreach ($clinic_list as $clinic_item) {
- foreach ($col as $index => $key) {
- $worksheet->setCellValueExplicit($index . $row, $clinic_item[$key], \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- }
- $row++;
- }
- $worksheet->getStyle('U3:AA' . ($row - 1))->applyFromArray($styleArray);
-
-
- $row = 3;
- $col = [
- 'AC' => 'date',
- 'AD' => 'name',
- 'AE' => 'number',
- 'AF' => 'phone',
- 'AG' => 'combo',
- 'AH' => 'clinic_time',
- 'AI' => 'used_time',
- 'AJ' => 'timeout',
- ];
- //汇总信息
- $usercount=count($table_list3);
- $biaozhun_timecount=0;
- $shiji_timecount=0;
- $chaoshi_timecount=0;
- $weichaoshi_count=0;
- $tj_numbers=[];
- $peis = new PEISApiController();
- foreach ($table_list3 as $table_list3_i) {
- $tj_numbers[]=$table_list3_i['uuid'];
- $biaozhun_timecount+=$table_list3_i['clinic_time'];
- $shiji_timecount+=$table_list3_i['used_time'];
- $chaoshi_timecount+=$table_list3_i['timeout'];
- if($table_list3_i['timeout']<=0){
- $weichaoshi_count++;
- }
-
- $data = [
- '电话号码' => "",
- '证件号码' => "",
- '体检号' => $table_list3_i['uuid'],
- '包含内部信息' => true
- ];
- $reports = $peis::Post('体检报告查询', 1, $data);
- if(isset($reports['data'][0]['套餐名称'])){
- $table_list3_i['combo']=$reports['data'][0]['套餐名称'];
- }else{
- $table_list3_i['combo']='';
- }
-
- foreach ($col as $index => $key) {
- $worksheet->setCellValueExplicit($index . $row, $table_list3_i[$key], \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- }
- $row++;
- }
- $zhushilv=0;
- if($usercount>0){
- $zhushilv=$weichaoshi_count/$usercount;
- }
- $worksheet->setCellValueExplicit('AC' . $row, '汇总', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AD' . $row, '客户总数', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AE' . $row, $usercount, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AG' . $row, '总用时:', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AH' . $row, $biaozhun_timecount, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AI' . $row, $shiji_timecount, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AJ' . $row, $chaoshi_timecount, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AD' . ($row+1), '未超时总数', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AE' . ($row+1), $weichaoshi_count, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AD' . ($row+2), "体检准时率", \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AE' . ($row+2),$zhushilv , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
-
- $worksheet->getStyle('AC3:AJ' . ($row +2))->applyFromArray($styleArray);
-
- //准时到检率
- $jianhou_sign_count=0;
- $zhunshi_count=0;
-
- $tj_numbers_group= array_chunk($tj_numbers, 100);
-
- $waitGroup=[];
- foreach ($tj_numbers_group as $index => $tj_number) {
- $tj_number=implode(",", $tj_number);
- $wait=$peis::Get($peis::Api('报告时间计算',$tj_number),'460107000001',"报告时间计算");
- if(isset($wait['Data'])){
- $jianhou_sign_count=$jianhou_sign_count+count($wait['Data']);
- $waitGroup=array_merge($waitGroup,$wait['Data']);
- }
- }
-
-
-
-
- //dd($wait);
-
- foreach ($table_list3 as $key=> $fz_value) {
- foreach ($waitGroup as $index => $sx_value) {
- if($fz_value['uuid']==$sx_value['体检号']){
- if($fz_value['date'].' '.$fz_value['end_time']>$sx_value['检后签到时间']){
- $zhunshi_count++;
- }
- }
- }
- }
- $daojianlv=0;
- if($jianhou_sign_count>0){
- $daojianlv=$zhunshi_count/$jianhou_sign_count;
- }
- $datesRange=$dates[0].'~'.$dates[count($dates) - 1];
- $worksheet->setCellValueExplicit('AL' . 3,$datesRange, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AM' . 3,$zhunshi_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AN' . 3,$jianhou_sign_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AO' . 3,round($daojianlv, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->getStyle('AL3:AO' . 3)->applyFromArray($styleArray);
-
- //预约率
- $yyl_yuyue_count=0;//预约人数
- $yyl_tj_count=0;//体检总人数
- $yuyuelv=0;
- $yuyueList=DB::table('orders')->whereIn('appointment_date',$dates)->whereIn('status',[2,4])->whereNotNull(['appointment_number'])->get();
-
- $yyl_yuyue_count=count($yuyueList);
- $yyl_tj_count=$usercount;
- if($yyl_tj_count>0){
- $yuyuelv=$yyl_yuyue_count/$yyl_tj_count;
- }
- $worksheet->setCellValueExplicit('AL' . 7,$datesRange , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AM' . 7,$yyl_yuyue_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AN' . 7,$yyl_tj_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AO' . 7,round($yuyuelv, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->getStyle('AL7:AO' . 7)->applyFromArray($styleArray);
-
- //预约准时率
- $yyzsl_ren_count=0;//预约准时到达人数
- $yyzsl_zong_count=0;//预约总人数
- $yyzsl_zong_count=$yyl_yuyue_count;
- foreach ($yuyueList as $key=> $yy_value) {
- if($yy_value->appointment_date.' '.$yy_value->appointment_time > $yy_value->check_time){
- $yyzsl_ren_count++;
- }
- }
- $zhunshilv=0;
- if($yyzsl_zong_count>0){
- $zhunshilv=$yyzsl_ren_count/$yyzsl_zong_count;
- }
- $worksheet->setCellValueExplicit('AL' . 11,$datesRange , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AM' . 11,$yyzsl_ren_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AN' . 11,$yyzsl_zong_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->setCellValueExplicit('AO' . 11,round($zhunshilv, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
- $worksheet->getStyle('AL11:AO' . 11)->applyFromArray($styleArray);
-
-//新建Sheet2
-// $worksheet2 = new \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet($spreadsheet, 'Sheet2');
-// $spreadsheet->addSheet($worksheet2);
-// $worksheet2->setCellValue('A1', 'Foo');
-// $worksheet2->setCellValue('B1', 'Bar');
-
- $file_name = Str::orderedUuid();
- $dir_path = "public/excel/" . date('Ym') . '/' . $file_name;
- Storage::makeDirectory($dir_path);
- $name_date = date('n.j', strtotime($date . ' 00:00:00'));
- $excel_path = $dir_path . "/体检报表-时间监控$name_date.xlsx";
- $writer = new Xlsx($spreadsheet);
- $writer->save(Storage::path($excel_path));
- $url = Storage::url($excel_path);
- return \Yz::Return(true,"获取成功",['url' => env('APP_URL').$url]);
+ $service=new FenZhenService();
+ $res=$service->export($dates);
+ return \Yz::Return($res['status'],$res['msg'],['url'=>$res['url']]);
}
}
diff --git a/Laravel/app/Http/Controllers/TestController.php b/Laravel/app/Http/Controllers/TestController.php
index 955d0f2..fed6128 100644
--- a/Laravel/app/Http/Controllers/TestController.php
+++ b/Laravel/app/Http/Controllers/TestController.php
@@ -16,14 +16,14 @@ class TestController extends Controller
{
public function DBtest(){
- //微信推送
- $data = [
- "ghzid" => "b3346cd4d63b49a58dbd9a41d69efde2",
- "yyid" => "6",
- ];
- $dnet = new AspNetZhuanController();
- $res = $dnet->GetHzid($data);
- dd($res);
+ $peis = new PEISApiController();
+ $data = [
+ '电话号码' => "",
+ '证件号码' => "130321199502212117"
+ ];
+ $reports = $peis::Post('团检登记查询', 1, $data);
+ dd($reports);
+
// echo DB::table('users')->count();
// $dnet = new AspNetZhuanController();
diff --git a/Laravel/app/Lib/Yz.php b/Laravel/app/Lib/Yz.php
index 18a5692..b8a3517 100644
--- a/Laravel/app/Lib/Yz.php
+++ b/Laravel/app/Lib/Yz.php
@@ -20,6 +20,14 @@ class Yz{
$result['data']=$data;
return response()->json($result)->setEncodingOptions(JSON_UNESCAPED_UNICODE);
}
+ public static function echoErrorJson($msg,$data=null){
+ $result=array();
+ $result['status']=false;
+ $result['msg']=$msg;
+ $result['data']= null;
+ return response()->json($result)->setEncodingOptions(JSON_UNESCAPED_UNICODE);
+ }
+
public static function Return($status,$msg,$data=[]){
$result=array();
diff --git a/Laravel/app/Services/ComboItemGroupService.php b/Laravel/app/Services/ComboItemGroupService.php
index 0078481..fd80ed4 100644
--- a/Laravel/app/Services/ComboItemGroupService.php
+++ b/Laravel/app/Services/ComboItemGroupService.php
@@ -31,7 +31,7 @@ class ComboItemGroupService
if($combo['可选']===false){//如果可选为false,则删除
DB::table('combos')->where(['combo_id' => $combo['Id']])->delete();
DB::table('combo_items')->where(['combo_id' => $combo['Id']])->delete();
- return \Yz::echoError1('删除成功');
+ continue;
}
$item = [];
foreach ($combo['包含项目'] as $key => $v) {
@@ -85,6 +85,11 @@ class ComboItemGroupService
}
$db_combo = DB::table('combos')->where(['combo_id' => $combo['Id']])->first();
+ $crowd_name='';
+ if(json_decode($combo['备注'], JSON_UNESCAPED_UNICODE)){
+ $beizhu=json_decode($combo['备注'], JSON_UNESCAPED_UNICODE);
+ $crowd_name=isset($beizhu['适用人群'])?$beizhu['适用人群']:'';
+ }
$comboData = [
'combo_id' => $combo['Id'],
'sex' => $sex,
@@ -94,6 +99,8 @@ class ComboItemGroupService
'price' => $combo['价格'],
'items' => $item,
'item_count' => $combo['项目数量'],
+ 'type_name' => $combo['标签名称'],
+ 'crowd_name' =>$crowd_name,
'duo_xuan_yi'=>json_encode($combo['包含多选一组'], JSON_UNESCAPED_UNICODE),
'keyue_start_time' => $combo['可约开始时间'],
'keyue_end_time' => $combo['可约截止时间'],
diff --git a/Laravel/app/Services/FenZhenService.php b/Laravel/app/Services/FenZhenService.php
new file mode 100644
index 0000000..5949712
--- /dev/null
+++ b/Laravel/app/Services/FenZhenService.php
@@ -0,0 +1,340 @@
+ 'Bearer BD30333C-CBD4-4BA3-A27C-76727FF4D8B1',
+ 'Content-Type' => 'application/json; charset=utf-8',
+ ];
+ $api_dates=[];
+ $promises=[];
+ foreach ($dates as $date) {
+ //遍历缓存,如果没有则请求接口,否则直接读取缓存文件
+ $fileFound = $this->findFilesByDate($date);
+ if ($fileFound !== null) {
+ $fileContent = Storage::get($fileFound);
+ $dataArray = json_decode($fileContent, true);
+ $table_list = array_merge($table_list, $dataArray['data']['table1'] ?? []);
+ $clinic_list = array_merge($clinic_list, $dataArray['data']['table2'] ?? []);
+ $table_list3 = array_merge($table_list3, $dataArray['data']['table3'] ?? []);
+
+ }else{
+ $api_dates[]=$date;
+ $promises[]=$client->postAsync($url.'/api/Open/TiJian/export',['headers' => $header, 'json' => ['date'=>$date]]);
+ }
+ }
+
+ $all_request_status=true;//所有接口请求状态
+ // 等待所有请求完成
+ $results = Promise\Utils::settle($promises)->wait();
+ foreach ($results as $key => $result) {
+ if ($result['state'] === 'fulfilled') {
+ Log::info('请求接口'.$api_dates[$key]);
+ $response = $result['value'];
+ $responseBody=(string) $response->getBody();
+ //把接口请求成功的缓存到本地txt
+ $txtName=$api_dates[$key].'created_at'.date('Y-m-d H:m:s');
+ $TxtfilePath = 'fenzhen_tongji_temp/'.$txtName.'.txt';
+ Storage::put($TxtfilePath, $responseBody);
+ $res=json_decode($responseBody,true);
+ // echo "Response from $key: " . $response->getBody() . "\n";
+ $table_list = array_merge($table_list, $res['data']['table1'] ?? []);
+ $clinic_list = array_merge($clinic_list, $res['data']['table2'] ?? []);
+ $table_list3 = array_merge($table_list3, $res['data']['table3'] ?? []);
+ }else{
+ $all_request_status=false;
+ Log::info("Request failed with key: $key, reason: " . $result['reason']->getMessage());
+ }
+ }
+ if($all_request_status===false){
+ return ['status'=>false,'msg'=>'部分请求失败,请重新尝试','url'=>''];
+ }
+ foreach ($table_list as $key=> $table_item) { //匹配$table_list3获取体检号
+ foreach ($table_list3 as $table_item3) {
+ if($table_item['name']==$table_item3['name'] and $table_item['phone']==$table_item3['phone']){
+ $table_list[$key]['tj_number']=$table_item3['uuid'];
+ break;
+ }else{
+ $table_list[$key]['tj_number']="";
+ }
+ }
+
+ }
+
+// foreach ($dates as $date) {
+// $res = $fzc->fz('export', [
+// 'date' => $date
+// ]);
+//
+// // 使用 array_merge 逐个追加每日期的数据到总列表中
+// $table_list = array_merge($table_list, $res['data']['table1'] ?? []);
+// $clinic_list = array_merge($clinic_list, $res['data']['table2'] ?? []);
+// $table_list3 = array_merge($table_list3, $res['data']['table3'] ?? []);
+// }
+
+
+ $template_path = Storage::path('public/excel/check_time.xlsx');
+ $spreadsheet = IOFactory::load($template_path);
+ $worksheet = $spreadsheet->getActiveSheet();
+ $styleArray = [
+ 'borders' => [
+ 'allBorders' => [
+ 'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN,
+ 'color' => ['argb' => 'FF000000'],
+ ],
+ ],
+ ];
+ $row = 3;
+ $col = [
+ 'A' => 'date',
+ 'B' => 'name',
+ 'C' => 'number',
+ 'D' => 'tj_number', // 新增列
+ 'E' => 'phone', // 原 phone 列往后移动
+ 'F' => 'group_name',
+ 'G' => 'clinic',
+ 'H' => 'doctor',
+ 'I' => 'queue',
+ 'J' => 'calling',
+ 'K' => 'done',
+ 'L' => 'clinic_check_time',
+ 'M' => 'true_check_time',
+ 'N' => 'timeout_check_time',
+ 'O' => 'clinic_wait_time',
+ 'P' => 'true_wait_time',
+ 'Q' => 'timeout_wait_time',
+ 'R' => 'clinic_all_time',
+ 'S' => 'true_all_time',
+ 'T' => 'timeout_all_time',
+ ];
+ foreach ($table_list as $table_item) {
+ foreach ($col as $index => $key) {
+ $worksheet->setCellValueExplicit($index . $row, $table_item[$key], \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ }
+ $row++;
+ }
+ $worksheet->getStyle('A3:T' . ($row - 1))->applyFromArray($styleArray);
+ $row = 3;
+ $col = [
+ 'V' => 'group_name',
+ 'W' => 'clinic',
+ 'X' => 'doctor',
+ 'Y' => 'check',
+ 'Z' => 'check_out',
+ 'AA' => 'wait',
+ 'AB' => 'wait_out',
+ ];
+ foreach ($clinic_list as $clinic_item) {
+ foreach ($col as $index => $key) {
+ $worksheet->setCellValueExplicit($index . $row, $clinic_item[$key], \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ }
+ $row++;
+ }
+ $worksheet->getStyle('V3:AB' . ($row - 1))->applyFromArray($styleArray);
+
+
+ $row = 3;
+ $col = [
+ 'AD' => 'date',
+ 'AE' => 'name',
+ 'AF' => 'number',
+ 'AG' => 'uuid',
+ 'AH' => 'phone',
+ 'AI' => 'combo',
+ 'AJ' => 'clinic_time',
+ 'AK' => 'used_time',
+ 'AL' => 'timeout',
+ ];
+ //汇总信息
+ $usercount=count($table_list3);
+ $biaozhun_timecount=0;
+ $shiji_timecount=0;
+ $chaoshi_timecount=0;
+ $weichaoshi_count=0;
+ $tj_numbers=[];
+ $peis = new PEISApiController();
+ foreach ($table_list3 as $table_list3_i) {
+ $tj_numbers[]=$table_list3_i['uuid'];
+ $biaozhun_timecount+=$table_list3_i['clinic_time'];
+ $shiji_timecount+=$table_list3_i['used_time'];
+ $chaoshi_timecount+=$table_list3_i['timeout'];
+ if($table_list3_i['timeout']<=0){
+ $weichaoshi_count++;
+ }
+
+ $data = [
+ '电话号码' => "",
+ '证件号码' => "",
+ '体检号' => $table_list3_i['uuid'],
+ '包含内部信息' => true
+ ];
+ $reports = $peis::Post('体检报告查询', 1, $data);
+ if(isset($reports['data'][0]['套餐名称'])){
+ $table_list3_i['combo']=$reports['data'][0]['套餐名称'];
+ }else{
+ $table_list3_i['combo']='';
+ }
+
+ foreach ($col as $index => $key) {
+ $worksheet->setCellValueExplicit($index . $row, $table_list3_i[$key], \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ }
+ $row++;
+ }
+ $zhushilv=0;
+ if($usercount>0){
+ $zhushilv=$weichaoshi_count/$usercount;
+ }
+ $worksheet->setCellValueExplicit('AD' . $row, '汇总', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AE' . $row, '客户总数', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AF' . $row, $usercount, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AH' . $row, '总用时:', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AJ' . $row, $biaozhun_timecount, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AK' . $row, $shiji_timecount, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AL' . $row, $chaoshi_timecount, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AE' . ($row+1), '未超时总数', \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AF' . ($row+1), $weichaoshi_count, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AE' . ($row+2), "体检准时率", \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AF' . ($row+2),$zhushilv , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+
+ $worksheet->getStyle('AD3:AL' . ($row +2))->applyFromArray($styleArray);
+
+ //准时到检率
+ $jianhou_sign_count=0;
+ $zhunshi_count=0;
+
+ $tj_numbers_group= array_chunk($tj_numbers, 100);
+
+ $waitGroup=[];
+ foreach ($tj_numbers_group as $index => $tj_number) {
+ $tj_number=implode(",", $tj_number);
+ $wait=$peis::Get($peis::Api('报告时间计算',$tj_number),'460107000001',"报告时间计算");
+ if(isset($wait['Data'])){
+ $jianhou_sign_count=$jianhou_sign_count+count($wait['Data']);
+ $waitGroup=array_merge($waitGroup,$wait['Data']);
+ }
+ }
+
+
+
+
+ //dd($wait);
+
+ foreach ($table_list3 as $key=> $fz_value) {
+ foreach ($waitGroup as $index => $sx_value) {
+ if($fz_value['uuid']==$sx_value['体检号']){
+ if($fz_value['date'].' '.$fz_value['end_time']>$sx_value['检后签到时间']){
+ $zhunshi_count++;
+ }
+ }
+ }
+ }
+ $daojianlv=0;
+ if($jianhou_sign_count>0){
+ $daojianlv=$zhunshi_count/$jianhou_sign_count;
+ }
+ $datesRange=$dates[0].'~'.$dates[count($dates) - 1];
+ $worksheet->setCellValueExplicit('AN' . 3,$datesRange, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AO' . 3,$zhunshi_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AP' . 3,$jianhou_sign_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AQ' . 3,round($daojianlv, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->getStyle('AN3:AQ' . 3)->applyFromArray($styleArray);
+
+ //预约率
+ $yyl_yuyue_count=0;//预约人数
+ $yyl_tj_count=0;//体检总人数
+ $yuyuelv=0;
+ $yuyueList=DB::table('orders')->whereIn('appointment_date',$dates)->whereIn('status',[2,4])->whereNotNull(['appointment_number'])->get();
+
+ $yyl_yuyue_count=count($yuyueList);
+ $yyl_tj_count=$usercount;
+ if($yyl_tj_count>0){
+ $yuyuelv=$yyl_yuyue_count/$yyl_tj_count;
+ }
+ $worksheet->setCellValueExplicit('AN' . 7,$datesRange , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AO' . 7,$yyl_yuyue_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AP' . 7,$yyl_tj_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AQ' . 7,round($yuyuelv, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->getStyle('AN7:AQ' . 7)->applyFromArray($styleArray);
+
+ //预约准时率
+ $yyzsl_ren_count=0;//预约准时到达人数
+ $yyzsl_zong_count=0;//预约总人数
+ $yyzsl_zong_count=$yyl_yuyue_count;
+ foreach ($yuyueList as $key=> $yy_value) {
+ if($yy_value->appointment_date.' '.$yy_value->appointment_time > $yy_value->check_time){
+ $yyzsl_ren_count++;
+ }
+ }
+ $zhunshilv=0;
+ if($yyzsl_zong_count>0){
+ $zhunshilv=$yyzsl_ren_count/$yyzsl_zong_count;
+ }
+ $worksheet->setCellValueExplicit('AN' . 11,$datesRange , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AO' . 11,$yyzsl_ren_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AP' . 11,$yyzsl_zong_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->setCellValueExplicit('AQ' . 11,round($zhunshilv, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
+ $worksheet->getStyle('AN11:AQ' . 11)->applyFromArray($styleArray);
+
+//新建Sheet2
+// $worksheet2 = new \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet($spreadsheet, 'Sheet2');
+// $spreadsheet->addSheet($worksheet2);
+// $worksheet2->setCellValue('A1', 'Foo');
+// $worksheet2->setCellValue('B1', 'Bar');
+
+ $file_name = Str::orderedUuid();
+ $dir_path = "public/excel/" . date('Ym') . '/' . $file_name;
+ Storage::makeDirectory($dir_path);
+ $name_date = date('n.j', strtotime($date . ' 00:00:00'));
+ $excel_path = $dir_path . "/体检报表-时间监控$name_date.xlsx";
+ $writer = new Xlsx($spreadsheet);
+ $writer->save(Storage::path($excel_path));
+ $url = Storage::url($excel_path);
+ return ['status'=>true,'msg'=>'查询完成','url'=> env('APP_URL').$url];
+ }
+
+ function findFilesByDate($datePart, $basePath = 'fenzhen_tongji_temp')
+ {
+ // 获取今天的日期格式与文件中的一致
+ $todayFormatted = Carbon::today()->format('Y-m-d');
+
+ // 遍历指定路径下的所有文件
+ $files = Storage::files($basePath);
+
+ foreach ($files as $file) {
+ // 使用 basename 获取文件名
+ $fileName = basename($file);
+
+ // 检查文件名是否匹配给定的模式
+ if (preg_match('/^(.+?)created_at(\d{4}-\d{2}-\d{2}).+\.txt$/', $fileName, $matches)) {
+ list(, $namePart, $createdAtDate) = $matches;
+
+ // 如果日期部分和创建日期符合条件,则返回该文件
+ if ($namePart === $datePart && $createdAtDate === $todayFormatted) {
+ return $file; // 返回找到的文件路径
+ }
+ }
+ }
+
+ // 如果没有找到任何符合条件的文件,返回 null 或其他信息
+ return null;
+ }
+}
diff --git a/Laravel/app/Services/NmrService.php b/Laravel/app/Services/NmrService.php
index 2573d02..9144e5d 100644
--- a/Laravel/app/Services/NmrService.php
+++ b/Laravel/app/Services/NmrService.php
@@ -10,8 +10,7 @@ class NmrService
// 根据时间查询二线可用号源,区分上下午,二线需预约体检时间1小时后
$AspNet = new AspNetZhuanController();
$nmrPlans=$AspNet::ErXian(['yyid'=>6,'data'=>[$date],'action'=>"1"],uniqid());
- if($time<="12:00") $end_time="12:00";
- if($time>"12:00") $end_time="23:59";
+ $end_time="23:59";
if(!isset($nmrPlans[$date]) or empty($nmrPlans[$date])) return ['status'=>false,'datetime'=>''];
$planTime = new DateTime($time);
$planTime->modify('+1 hour');
diff --git a/Laravel/app/Services/OrderService.php b/Laravel/app/Services/OrderService.php
index 018c28d..c82af59 100644
--- a/Laravel/app/Services/OrderService.php
+++ b/Laravel/app/Services/OrderService.php
@@ -6,6 +6,7 @@ use App\Http\Controllers\API\H5\OrderController;
use App\Http\Controllers\API\PEISApiController;
use App\Http\Controllers\API\XCXApiController;
use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Log;
class OrderService
{
@@ -60,6 +61,20 @@ class OrderService
$combo_items=DB::table('combo_items')->where(['combo_id'=>$buy_info['combo']['id'],'status'=>1])->get();
foreach($combo_items as $item){
if(!in_array((string)$item->keshi_id,$drop_ids)){
+ if($item->keshi_id==711){
+ if($order->sex==1){
+ $item->keshi_id=526;
+ $item->keshi_name='外科';
+ }
+ if($order->sex==2){
+ $item->keshi_id=570;
+ $item->keshi_name='内科';
+ }
+ }
+ if($item->keshi_id==695 or $item->keshi_id==559){
+ $item->keshi_id=532;
+ $item->keshi_name='妇科';
+ }
$list[]=[
'item_id'=>$item->item_id,
'keshi_name'=>$item->keshi_name,
@@ -75,6 +90,20 @@ class OrderService
}
$itemsInfo=DB::table('items')->whereIn('item_id',$item_ids)->get();
foreach($itemsInfo as $item){
+ if($item->keshi_id==711){
+ if($order->sex==1){
+ $item->keshi_id=526;
+ $item->keshi_name='外科';
+ }
+ if($order->sex==2){
+ $item->keshi_id=570;
+ $item->keshi_name='内科';
+ }
+ }
+ if($item->keshi_id==695 or $item->keshi_id==559){
+ $item->keshi_id=532;
+ $item->keshi_name='妇科';
+ }
$list[]=[
'item_id'=>$item->item_id,
'keshi_name'=>$item->keshi_name,
@@ -89,11 +118,28 @@ class OrderService
}
$itemsInfo=DB::table('items')->whereIn('item_id',$item_ids)->get();
foreach($itemsInfo as $item){
- $list[]=[
- 'item_id'=>$item->item_id,
- 'keshi_name'=>$item->keshi_name,
- 'keshi_id'=>$item->keshi_id,
- ];
+ if(!in_array((string)$item->keshi_id,$drop_ids)){
+ if($item->keshi_id==711){
+ if($order->sex==1){
+ $item->keshi_id=526;
+ $item->keshi_name='外科';
+ }
+ if($order->sex==2){
+ $item->keshi_id=570;
+ $item->keshi_name='内科';
+ }
+ }
+ if($item->keshi_id==695 or $item->keshi_id==559){
+ $item->keshi_id=532;
+ $item->keshi_name='妇科';
+ }
+ $list[]=[
+ 'item_id'=>$item->item_id,
+ 'keshi_name'=>$item->keshi_name,
+ 'keshi_id'=>$item->keshi_id,
+ ];
+ }
+
}
}
$groupedData = [];
@@ -116,6 +162,7 @@ class OrderService
return ['department_list'=>$de_list,'wait_day'=>$wait_day,'is_checked_sign_in'=>$is_checked_sign_in];
}
+
public function Cancel($orderInfo)
{
$person=DB::table('web_user_person')->where(['id' => $orderInfo->person_id])->first();
diff --git a/Laravel/config/app.php b/Laravel/config/app.php
index 557364d..a439dd4 100644
--- a/Laravel/config/app.php
+++ b/Laravel/config/app.php
@@ -13,7 +13,9 @@ return [
'Wj_ZheKou'=>1,//问卷带出项目,折扣率
'ZiXuan_ZheKou'=>0.8,//自选项目折扣
'erxian_kuadu'=>3,//二线时间跨度,单位天
- 'KeShiPaiXu'=>["预检咨询","体格检查","人体成分","呼气试验","采血室(化验)","内科","妇科","妇科(化验)","妇科(病理)","婚前医学检查","外科","眼科","耳鼻喉科","肺功能室","口腔科","骨密度室","CT室","影像科","住院体检","胃肠镜室"]
+ 'plan_lock_time'=>10,//先选号源,号源锁定时长,超过时长未预约 进行释放,单位分钟
+ 'KeShiPaiXu'=>["预检咨询","体格检查","人体成分","呼气试验","采血室(化验)","内科","妇科","妇科(化验)","妇科(病理)","婚前医学检查","外科","外科(化验)","眼科","耳鼻喉科","肺功能室","口腔科","超声科","骨密度室","CT室","影像科","住院体检","胃肠镜室"],
+ 'KeShiTypePaiXu'=>["预检","检查","检验","病理","超声","影像"]
],
/*
diff --git a/Laravel/public/tool/register.html b/Laravel/public/tool/register.html
index f4ffdb1..93ae6da 100644
--- a/Laravel/public/tool/register.html
+++ b/Laravel/public/tool/register.html
@@ -816,6 +816,7 @@
for (let i in select_data_default) {
select_data.value[i] = query[i] || select_data_default[i];
}
+
};
const item_table_ref = ref(false);
const select_table_computed = computed(() => {
@@ -1020,6 +1021,7 @@
hospital: input_data.value.hospital,
openid: "",
person_id: "",
+ combo_id:select_data.value.combo,
person_sex:input_data.value.gender,
date: plan_data.value.date,
use_type: 1,
@@ -1118,6 +1120,8 @@
}
onMounted(() => {
getQueryData();
+ if(input_data.value.hospital == '6') input_data.value.hospital = '1'
+ if(input_data.value.hospital == '2') input_data.value.hospital = '4'
getItemGetList();
// getPlanList();
});
diff --git a/Laravel/routes/api.php b/Laravel/routes/api.php
index 32d2d31..7653062 100644
--- a/Laravel/routes/api.php
+++ b/Laravel/routes/api.php
@@ -77,6 +77,7 @@ Route::group(['middleware' => ['checktoken', 'log'], 'prefix' => 'v1'], function
Route::post('admin/CalendarListDel', 'App\Http\Controllers\API\Admin\YeWu\healthCalendarController@Del'); //admin后台删除日历
Route::post('admin/CalendarChangeInfo', 'App\Http\Controllers\API\Admin\YeWu\healthCalendarController@ChangeInfo'); //admin后台更新日历
Route::post('admin/PlanTypeGetList', 'App\Http\Controllers\API\Admin\YeWu\PlanTypeController@GetList');//号源类型列表
+ Route::post('admin/PlanTypeGetEnableList', 'App\Http\Controllers\API\Admin\YeWu\PlanTypeController@GetEnableList');//号源类型可用列表
Route::post('admin/PlanTypeSave', 'App\Http\Controllers\API\Admin\YeWu\PlanTypeController@Save');//号源类型保存
Route::post('admin/PlanTypeGetDetail', 'App\Http\Controllers\API\Admin\YeWu\PlanTypeController@GetDetail');//号源类型详情
Route::post('admin/PlanTypeDel', 'App\Http\Controllers\API\Admin\YeWu\PlanTypeController@Del');//号源类型删除
@@ -92,6 +93,8 @@ Route::group(['middleware' => ['checktoken', 'log'], 'prefix' => 'v1'], function
Route::post('admin/PlanSave', 'App\Http\Controllers\API\Admin\YeWu\PlanController@Save');//保存号源详情
Route::post('admin/PlanDel', 'App\Http\Controllers\API\Admin\YeWu\PlanController@Del');//
Route::post('admin/PlanBatchUpdatePlanType', 'App\Http\Controllers\API\Admin\YeWu\PlanController@BatchUpdatePlanType');//保存号源详情
+ Route::post('admin/GetPlanTypeTJ', 'App\Http\Controllers\API\Admin\YeWu\PlanController@GetPlanTypeTJ');//号源类型使用统计
+ Route::post('admin/ExportPlanTypeTJ', 'App\Http\Controllers\API\Admin\YeWu\PlanController@ExportPlanTypeTJ');//导出号源类型使用统计
Route::post('admin/PlanListGetList', 'App\Http\Controllers\API\Admin\YeWu\PlanListController@GetList');//号源列表的列表
Route::post('admin/ComboGetList', 'App\Http\Controllers\API\Admin\YeWu\ComboController@GetList');//获取套餐列表
diff --git a/Laravel/routes/web.php b/Laravel/routes/web.php
index c31606b..85938f6 100644
--- a/Laravel/routes/web.php
+++ b/Laravel/routes/web.php
@@ -63,6 +63,7 @@ Route::group(['middleware' => ['log'],'prefix' => 'api/H5'], function () {
Route::post('/GetReportJieLunJianYi', 'App\Http\Controllers\API\H5\ReportController@GetReportJieLunJianYi');//获取报告结论建议页面数据
Route::post('/GetReportDetaiList', 'App\Http\Controllers\API\H5\ReportController@GetReportDetaiList');//完整报告中的列表
Route::post('/GetReportDetai', 'App\Http\Controllers\API\H5\ReportController@GetReportDetai');//完整报告某项详情
+ Route::post('/GetReportDetai2', 'App\Http\Controllers\API\H5\ReportController@GetReportDetai2');//完整报告某项详情
Route::post('/StartPay', 'App\Http\Controllers\API\H5\PayController@StartPay');//开始支付接口
Route::post('/CheckPay', 'App\Http\Controllers\API\H5\PayController@CheckPay');//支付结果查询接口
Route::post('/Refund', 'App\Http\Controllers\API\H5\PayController@Refund');//退款
@@ -121,15 +122,18 @@ Route::any('/GetH5Order', 'App\Http\Controllers\API\Internal\OrderController@Get
Route::any('/PlanList', 'App\Http\Controllers\API\Internal\PlanController@PlanList')->middleware('log');//获取可用号源列表
Route::any('/UsePlan', 'App\Http\Controllers\API\Internal\PlanController@UsePlan')->middleware('log');//占用号源
Route::any('/CancelUsePlan', 'App\Http\Controllers\API\Internal\PlanController@CancelUsePlan')->middleware('log');//取消占用号源
-Route::any('/GetFenZhenInfo', 'App\Http\Controllers\API\Internal\FenZhenController@GetFenZhenInfo');//获取分诊统计数据
+Route::any('/GetFenZhenInfo', 'App\Http\Controllers\API\Internal\FenZhenController@GetFenZhenInfo')->middleware('log');//获取分诊统计数据
+Route::any('/GetHzidAndGhzid', 'App\Http\Controllers\API\Internal\PersonController@GetHzidAndGhzid');//获取用户hzid和GHzid
+Route::any('GetZhuanZhenInfo', 'App\Http\Controllers\API\Web\OrderController@export')->middleware('log');//导出医生预约订单
Route::post('/RoundPayCheck', 'App\Http\Controllers\API\H5\OrderController@RoundPayCheck');//轮询支付检查
-Route::post('/Day1WXSend', 'App\Http\Controllers\API\H5\OrderController@Day1WXSend');//提前1天微信通知
+Route::post('/Day1WXSend', 'App\Http\Controllers\API\H5\OrderController@Day1WXSend')->middleware('log');//提前1天微信通知
Route::post('/AutoRefund', 'App\Http\Controllers\API\H5\PayController@AutoRefund')->middleware('log');//对外退款接口
Route::any('api/FenzhenInfoExport', 'App\Http\Controllers\H5\FenzhenController@export')->middleware('log');//导出报表
Route::any('api/FenzhenInfoExport2', 'App\Http\Controllers\H5\FenzhenController@export2')->middleware('log');//导出报表
+
Route::any('/GetTransferCode', 'App\Http\Controllers\API\Internal\TransferCodeController@GetTransferCode')->middleware('log');//查询转赠码
Route::any('/HandleTransferCode', 'App\Http\Controllers\API\Internal\TransferCodeController@HandleTransferCode')->middleware('log');//查询转赠码
diff --git a/admin/src/api/api.js b/admin/src/api/api.js
index 31fb729..d07918a 100644
--- a/admin/src/api/api.js
+++ b/admin/src/api/api.js
@@ -116,6 +116,9 @@ export const GetLogTableName = (data = {}) => {
export const PlanTypeGetList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanTypeGetList', data: data })
}
+export const PlanTypeGetEnableList = (data = {}) => {
+ return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanTypeGetEnableList', data: data })
+}
//可用体检类型列表
export const CheckUpTypeGetEnableList = (data = {}) => {
return axios({
@@ -179,6 +182,14 @@ export const PlanDel = (data = {}) => {
export const PlanBatchUpdatePlanType = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanBatchUpdatePlanType', data: data })
}
+//号源类型使用统计
+export const GetPlanTypeTJ = (data = {}) => {
+ return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetPlanTypeTJ', data: data })
+}
+//号源类型使用统计导出
+export const ExportPlanTypeTJ = (data = {}) => {
+ return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/ExportPlanTypeTJ', data: data })
+}
//获取套餐列表
export const ComboGetList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/ComboGetList', data: data })
diff --git a/admin/src/views/PlanMngr/Plan.vue b/admin/src/views/PlanMngr/Plan.vue
index 5c88a96..b3b8e18 100644
--- a/admin/src/views/PlanMngr/Plan.vue
+++ b/admin/src/views/PlanMngr/Plan.vue
@@ -19,8 +19,14 @@
-
+
空余
预留
已占用
停用
+
+
+
+
已经使用:{{used_count}} 剩余:{{unused_count}}
+
统计全部
@@ -98,7 +104,27 @@
-
+
+
+
+
+ 导出
+
+
+
+
+
+ {{scope.row.name}}
+ 预留
+
+
+
+
+
+
+
+
+
@@ -117,7 +143,10 @@
CheckUpTypeGetEnableList,
PlanSave,
PlanBatchUpdatePlanType,
- PlanDel
+ PlanDel,
+ PlanTypeGetEnableList,
+ GetPlanTypeTJ,
+ ExportPlanTypeTJ
} from '@/api/api.js'
import {
useRoute,
@@ -128,6 +157,8 @@
let loading = ref(false)
let searchInfo = ref({})
let list = ref([]);
+ let unused_count=ref(0);
+ let used_count=ref(0);
const GetList = () => {
loading.value = true
PlanGetList({
@@ -136,6 +167,8 @@
loading.value = false
if (res.status) {
list.value = res.data.list
+ unused_count.value=res.data.unused_count
+ used_count.value=res.data.used_count
searchInfo.value.date=res.data.date
} else {
ElMessage.error(res.msg)
@@ -286,8 +319,53 @@
}
})
}
+ let PlanTypeList=ref([]);
+ const GetPlanTypeList = () => {
+ loading.value = true
+ PlanTypeGetEnableList().then(res => {
+ loading.value = false
+ if (res.status) {
+ PlanTypeList.value=res.data.list
+ } else {
+ ElMessage.error(res.msg)
+ }
+ })
+ }
+ const PlanTypeChange=()=>{
+ GetList()
+ }
+ let TongJiDialogVisible=ref(false);
+ let PlanTypeTJList=ref([])
+ const TongjiClick=()=>{
+ TongJiDialogVisible.value=true
+ loading.value = true
+ GetPlanTypeTJ({date:searchInfo.value.date}).then(res => {
+ loading.value = false
+ if (res.status) {
+ PlanTypeTJList.value=res.data.list
+ } else {
+ ElMessage.error(res.msg)
+ }
+ })
+ }
+ const ExportPlanTypeTJFunc=()=>{
+ loading.value = true
+ ExportPlanTypeTJ({date:searchInfo.value.date}).then(res => {
+ loading.value = false
+ if (res.status) {
+ const a = document.createElement('a');
+ a.style.display = 'none';
+ a.href = res.url;
+ document.body.appendChild(a);
+ a.click();
+ } else {
+ ElMessage.error(res.msg)
+ }
+ })
+ }
onMounted(() => {
- searchInfo.value.date=route.query.date
+ searchInfo.value.date=route.query.date
+ GetPlanTypeList()
GetList()
})
diff --git a/admin/src/views/PlanMngr/PlanModel.vue b/admin/src/views/PlanMngr/PlanModel.vue
index eeaed5e..c0dd9e0 100644
--- a/admin/src/views/PlanMngr/PlanModel.vue
+++ b/admin/src/views/PlanMngr/PlanModel.vue
@@ -386,6 +386,8 @@
CreatPlanDialogVisible.value = true
CPlan.value.name=row.name
CPlan.value.model_id=row.id
+ CPlan.value.workday_create=1
+ CPlan.value.holiday_create=1
success_daterange.value=[];
}
const CPanCheckAll=()=>{//生成计划时全选星期
diff --git a/admin/src/views/SystemMngr/User/List.vue b/admin/src/views/SystemMngr/User/List.vue
index 85eef22..3b63795 100644
--- a/admin/src/views/SystemMngr/User/List.vue
+++ b/admin/src/views/SystemMngr/User/List.vue
@@ -42,7 +42,7 @@
-
+
getRow("select * from orders where checkup_type_id = 4
+ $hunjian_check= $db->getRow("select * from orders where checkup_type_id = 4 and (title='男性免费婚检' or title='女性免费婚检')
and status = 2
and appointment_number is not null
and hunjian_status=0
diff --git a/bot/bot/bot_planUnlock.php b/bot/bot/bot_planUnlock.php
new file mode 100644
index 0000000..f94250a
--- /dev/null
+++ b/bot/bot/bot_planUnlock.php
@@ -0,0 +1,38 @@
+count = 1;
+$bot_loop->name = 'PlanUnlock';
+function PlanUnlock($plan_id)
+{
+ Tool::log('开始执行号源解锁任务', 2);
+ $url = Tool::ini('PLAN_UNLOCK');
+ $res = Tool::post($url, [
+ 'plan_id' => $plan_id
+ ]);
+ Tool::log(json_encode($res, JSON_UNESCAPED_UNICODE), 2);
+}
+
+function PlanUnlockFunc()
+{
+ $db = Db::get();
+ $plan = $db->getRow("select * from plans where status = 1 and is_lock=1 and lock_endtime < ?", [
+ date('Y-m-d H:i:s')
+ ]);
+ if (!!$plan) {
+ PlanUnlock($plan['id']);
+ } else {
+ Tool::log('号源解锁未检测到任务');
+ }
+}
+
+$bot_loop->onWorkerStart = function () {
+ PlanUnlockFunc();
+ Timer::add(10, function () {
+ PlanUnlockFunc();
+ });
+};
diff --git a/bot/bot/bot_wxSend.php b/bot/bot/bot_wxSend.php
index 52a7042..0895bec 100644
--- a/bot/bot/bot_wxSend.php
+++ b/bot/bot/bot_wxSend.php
@@ -23,10 +23,11 @@ function WxSendFunc()
$pay_check = $db->getRow("select * from orders where wx_day1_sendmsg_status = 0
and status = ?
and appointment_number is not null
+ and appointment_date = ?
and wx_day1_sendmsg_time is not null
and wx_day1_sendmsg_time <= ? and wx_day1_sendmsg_time > ?
order by wx_day1_sendmsg_time asc", [
- 2, date('Y-m-d H:i:s'),date('Y-m-d')." 00:00:01"
+ 2,date('Y-m-d', strtotime('+1 day')), date('Y-m-d H:i:s'),date('Y-m-d')." 00:00:01"
]);
if (!!$pay_check) {
Db2::u($db, 'orders', [
diff --git a/h5/App.vue b/h5/App.vue
index 3d0f7e4..3878125 100644
--- a/h5/App.vue
+++ b/h5/App.vue
@@ -14,7 +14,7 @@
import {
onShow,
onHide,
- onLoad
+ onLoad,onError
} from '@dcloudio/uni-app'
import {
@@ -67,22 +67,47 @@
}
}
uni.setStorageSync('CONFIG_VERSION', response.data.version)
- if (!!get_config) {
+ //if (!!get_config) {
+ if (true) {
getConfigConfig()
} else {
setConfigStore()
}
})
}
-
- onShow(() => {
+ const handleFontSize=()=> {
+ // 设置网页字体为默认大小
+ WeixinJSBridge.invoke('setFontSizeCallback', {
+ 'fontSize': 0
+ });
+ // 重写设置网页字体大小的事件
+ WeixinJSBridge.on('menu:setfont', function() {
+ WeixinJSBridge.invoke('setFontSizeCallback', {
+ 'fontSize': 0
+ });
+ });
+ }
+ onShow(() => {
+ if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
+
+ handleFontSize();
+ } else {
+ if (document.addEventListener) {
+ document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
+ } else if (document.attachEvent) {
+ document.attachEvent("WeixinJSBridgeReady", handleFontSize);
+ document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
+ }
+ }
console.log(`\n %c 鹿和 %c https://sa0.online/ \n\n`, 'color: #ffffff; background: #fd6b60; padding:5px 0;',
'color: #fd6b60;background: #ffffff; padding:5px 0;')
getConfigVersion()
})
onLoad(()=>{
-
+
+
})
+
\ No newline at end of file
+/* #ifdef H5 */
+body { /* IOS禁止微信调整字体大小 */
+ -webkit-text-size-adjust: 100% !important;
+ text-size-adjust: 100% !important;
+ -moz-text-size-adjust: 100% !important;
+}
+/* #endif */
+
+
\ No newline at end of file
diff --git a/h5/common/CallKeFu.vue b/h5/common/CallKeFu.vue
new file mode 100644
index 0000000..4b82bac
--- /dev/null
+++ b/h5/common/CallKeFu.vue
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+ 0898-6659 5555
+
+
+
+ 呼叫
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/h5/common/TabBar.vue b/h5/common/TabBar.vue
new file mode 100644
index 0000000..e36cbe6
--- /dev/null
+++ b/h5/common/TabBar.vue
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+ 首页
+
+
+
+
+
+
+ 报告查询
+
+
+
+
+
+
+ 我的订单
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/h5/common/WeeklyCalendar.vue b/h5/common/WeeklyCalendar.vue
index 6779666..c0c8fb0 100644
--- a/h5/common/WeeklyCalendar.vue
+++ b/h5/common/WeeklyCalendar.vue
@@ -1,12 +1,13 @@
-
+
-
+
{{item.date.split('-').slice(1).join('/')}}
{{ item.xingqi.replace('星期', '周')}}
- 余{{item.count}}
+ 余{{item.count}}
+ 满号
@@ -19,13 +20,16 @@
- {{item.time.substring(0, 5)}}
+ {{item.time.substring(0, 5)}}
-
+
-
+
基本信息
+
+ 套餐名称
+
+
+ {{ combo_info[k].name }}
+
+
+
+
+
+ 添加套餐
+
+
+
+
+ 价格
+
+
+ {{ combo_info[k].price }}
+
+
+ -
+
+
+
{{ i.title }}
{{ ii }}
+
+
+
+
+ 购买
+
+
+ -
+
+
+
项目信息
@@ -277,6 +311,15 @@
+
\ No newline at end of file
diff --git a/h5/pages/main/bgcx/ckbg/ckbg(旧).vue b/h5/pages/main/bgcx/ckbg/ckbg(旧).vue
new file mode 100644
index 0000000..350de4b
--- /dev/null
+++ b/h5/pages/main/bgcx/ckbg/ckbg(旧).vue
@@ -0,0 +1,547 @@
+
+
+
+
+
+
+
+
+
+
+ 结论建议
+
+ 完整报告
+
+
+
+
+
+ {{ bgjl_obj.name }}
+
+
+
+
+
+
+
+ 基本健康数据
+
+
+ {{ item.name }}
+ {{ item.value }}
+
+
+
+
+
+
+
+
+ {{ bgjl_obj ? bgjl_obj.items.all_count : 0 }}项
+
+ 总指标
+
+
+
+
+ {{ bgjl_obj ? bgjl_obj.items.ipt_error_count : 0 }}项
+
+ 重要异常结果
+
+
+
+ {{ bgjl_obj ? bgjl_obj.items.error_count : 0 }}项
+
+ 异常结果
+
+
+
+
+
+ 总检建议
+
+
+ {{
+ bgjl_obj.content
+ }}
+
+
+
+
+
+
+
+
+ 全部检查
+
+
+
+
+
+
+
+ {{ item.error_count }}
+ 项异常
+
+
+
+
+
+ 初步意见
+
+
+
+
+ {{ text }}
+
+
+
+
+
+ 未见明显异常
+
+
+ {{ text }}
+
+
+
+
+
+
+
+ {{ obj["基础项目名称"] }}
+ ({{obj["结果值"]}} {{ obj["结果值单位"] }})
+
+
+
+
+
+
+ {{ obj["结果值范围"][0] }}
+ 正常
+ {{ obj["结果值范围"][1] }}
+
+
+
+
+ {{ obj["结果值"] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/h5/pages/main/bgcx/ckbg/ckbg.vue b/h5/pages/main/bgcx/ckbg/ckbg.vue
index 4c0f46e..dc6c151 100644
--- a/h5/pages/main/bgcx/ckbg/ckbg.vue
+++ b/h5/pages/main/bgcx/ckbg/ckbg.vue
@@ -1,294 +1,264 @@
-
-
-
-
-
-
- 结论建议
-
- 完整报告
-
-
-
-
-
- {{ bgjl_obj.name }}
-
-
-
-
+
+
+
+
+
+ 结论建议
+
+
+ 完整报告
+
+
+
+
+
+ {{ bgjl_obj.name }}
+
+
+
+
-
-
-
- 基本健康数据
-
-
- {{ item.name }}
- {{ item.value }}
-
-
-
-
-
+
+
+
+ 健康数据
+
+
+ {{ item.name }}
+ {{ item.value }}
+
+
+
+
+
-
-
-
- {{ bgjl_obj ? bgjl_obj.items.all_count : 0 }}项
-
- 总指标
-
-
-
-
+
+
+
+ {{ bgjl_obj ? bgjl_obj.items.all_count : 0 }}项
+
+ 总指标
+
+
+
+
- {{ bgjl_obj ? bgjl_obj.items.ipt_error_count : 0 }}项
-
- 重要异常结果
-
-
-
-
+ {{ bgjl_obj ? bgjl_obj.items.ipt_error_count : 0 }}项
+
+ 重要异常结果
+
+
+
+ {{ bgjl_obj ? bgjl_obj.items.error_count : 0 }}项
-
- 异常结果
-
-
+ ">{{ bgjl_obj ? bgjl_obj.items.error_count : 0 }}项
+
+ 异常结果
+
+
-
-
- 总检建议
-
-
- {{
+
+
+ 总检建议
+
+
+ {{
bgjl_obj.content
}}
-
-
-
-
-
-
-
- 全部检查
-
-
-
-
-
-
-
- {{ item.error_count }}
- 项异常
-
-
-
-
-
- 初步意见
-
-
-
-
- {{ text }}
-
-
-
-
-
- 未见明显异常
-
-
- {{ text }}
-
-
-
-
-
-
-
- {{ obj["基础项目名称"] }}
- ({{obj["结果值"]}} {{ obj["结果值单位"] }})
-
-
-
-
-
-
- {{ obj["结果值范围"][0] }}
- 正常
- {{ obj["结果值范围"][1] }}
-
-
-
-
- {{ obj["结果值"] }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ 全部检查
+
+
+
+
+
+
+ {{ item.error_count }} 项异常
+
+
+
+
+
+
+
+
+
+
+
+ | 项目名称 |
+ 结果 |
+ 范围值 |
+
+
+
+
+
+
+ | {{obj.基础项目名称}} |
+ {{obj.结果值}} {{obj.异常标识}} |
+ {{obj.结果值范围}} |
+
+
+
+
+
+
+
+
+
+
+ 未见明显异常
+
+
+
+
+ | 检查所见 |
+ 结论 |
+
+
+
+
+
+ |
+
+ {{ text }}
+ |
+
+
+ {{ text }}
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ .greenClor {
+ background-color: #e8f6f5;
+ border: 2px solid #dce9e8;
+ }
+ table {
+ border-collapse: collapse;
+ width: 50%;
+
+ }
+ th, td {
+ border: 1px solid #e5e5e5;
+ padding: 8px;
+
+ }
+ th {
+ background-color: #f2f2f2;
+ }
+
\ No newline at end of file
diff --git a/h5/pages/main/combo/combo(旧2).vue b/h5/pages/main/combo/combo(旧2).vue
new file mode 100644
index 0000000..e32a0b5
--- /dev/null
+++ b/h5/pages/main/combo/combo(旧2).vue
@@ -0,0 +1,1265 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择套餐
+ 专家定制
+ 项目自选
+
+
+
+
+
+ {{ value[sortIndex]?.name || "综合排序" }}
+
+
+ {{ value[sort_salecount_index]?.name || "按销量" }}
+
+
+ {{ value[sort_price_index]?.name || "按价格" }}
+
+
+
+
+
+
+
+ 筛选
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ i.name }}
+
+
+
+
+
+
+
+ 该套餐仅预约专家咨询,现场个性化定制套餐
+
+
+
+
+ ?
+
+
+
+
+
+
+
+ {{ ii.text }}
+
+
+
+ {{ i.tags2?.join(" | ") }}
+
+
+
+
+ ¥
+ {{ i.price }}
+
+ ¥{{ i.original_price }}
+
+
+
+
+
+
+
+
+ {{comboIds.includes(i.combo_id) ? "已加入" : "对比"}}
+
+ 选择
+
+
+
+
+
+
+
+
+ 请选择
+
+
+
+
+ {{ item.item_name }}
+
+ ¥
+ {{ item.price }}
+
+
+
+
+ 当前套餐包含一个可自由{{
+ multipleList[multipleIndex]["item_list"].length
+ }}选1的体检项目,请
根据您的实际情况自行选择。
+ {{
+ multipleIndex == multipleList.length - 1 ? "确定" : "下一项"
+ }}
+
+
+
+
+
+
+
+
+
+ {{ val.name }}
+
+
+ {{ val.name }}
+
+
+
+
+
+
+
+
+
+
+ 性别
+
+
+ 不限
+
+
+ 男
+
+
+ 女
+
+
+
+
+ 套餐类型
+
+
+ {{item.name}}
+
+
+
+ 价格区间
+
+
+ 适用人群
+
+
+ {{item.name}}
+
+
+
+
+ 体检项目
+
+
+ {{item.name}}
+
+
+
+
+ 重置
+ 确定
+
+
+
+
+
+
+
+
+
+ 套餐须知
+ 专家定制套餐
+ 此套餐收费{{SelectedComboInfo.price}}元为预存款,可根据现场定制套餐后实际价格多退少补。
+ 我已知晓
+
+
+
+
+
\ No newline at end of file
diff --git a/h5/pages/main/combo/combo.vue b/h5/pages/main/combo/combo.vue
index e32a0b5..7720b07 100644
--- a/h5/pages/main/combo/combo.vue
+++ b/h5/pages/main/combo/combo.vue
@@ -1,7 +1,9 @@
-
-
-
+
+
+
-
+
+
+
+ 不限
+
+
+ 男
+
+
+ 女
+
@@ -551,13 +601,13 @@
{{ value[sortIndex]?.name || "综合排序" }}
-
+
+
@@ -578,7 +628,7 @@
- {{ i.name }}
+ {{ i.name }}
@@ -620,10 +670,17 @@
-
- {{comboIds.includes(i.combo_id) ? "已加入" : "对比"}}
+
+
+
+
+
+
+
+
+ {{comboIds.includes(i.combo_id) ? "对比" : "对比"}}
- 选择
+ 购买
@@ -659,7 +716,7 @@
-
+
-
+
-
+
-
+
+ -->
套餐类型
@@ -764,7 +815,9 @@
+
\ No newline at end of file
diff --git a/h5/pages/main/combo/tcdb.vue b/h5/pages/main/combo/tcdb.vue
index dd41eb8..5561c07 100644
--- a/h5/pages/main/combo/tcdb.vue
+++ b/h5/pages/main/combo/tcdb.vue
@@ -1,5 +1,6 @@
-
+
diff --git a/h5/pages/main/ctime/ctime.vue b/h5/pages/main/ctime/ctime.vue
index 3cbc0b5..9745134 100644
--- a/h5/pages/main/ctime/ctime.vue
+++ b/h5/pages/main/ctime/ctime.vue
@@ -1,6 +1,7 @@
+
-
+
@@ -24,7 +25,7 @@
:class="itemSelected.type=='tj'?'itemSelected':''">体检日期 {{tj_date}}
{{tj_time}}
- 体检医生 - 体检医生 - {{doctor_name}}
重新选择
@@ -40,10 +41,11 @@
-
+
+
\ No newline at end of file
diff --git a/h5/pages/main/index/index.vue b/h5/pages/main/index/index.vue
index ddd3e36..136e28e 100644
--- a/h5/pages/main/index/index.vue
+++ b/h5/pages/main/index/index.vue
@@ -4,6 +4,7 @@
* user:sa0ChunLuyu
* date:2024年8月7日 20:05:05
*/
+ import TabBar from "@/common/TabBar.vue";
import {
ref
} from 'vue'
@@ -211,18 +212,24 @@
url: '/pages/other/entry/index?path=/pages/physical-examination/location/index'+p
})
};
- const gotoo=()=>{
- uni.navigateTo({
- url: "/pages/test/test"
- })
+ const gotoUrl=(url)=>{
+ if (url.includes('https://')) {
+ window.location.href = $store.config.banner.jump
+ } else if (url.includes('/pages/')) {
+ uni.navigateTo({
+ url: url
+ })
+ }
+
}
//获取首页通知
let NoticeInfo=ref([])
const GetNoticeFunc = async () => {
+
uni.showLoading();
const response = await $api("GetHomeNotice",{person_id:$store.getUser().person_id,id_number:$store.getUser().id_number});
uni.hideLoading();
- $response(response, async () => {
+ $response(response, () => {
NoticeInfo.value=response.data
if (!!$props.path && $props.path=='order') {
uni.navigateTo({
@@ -236,7 +243,7 @@
return item ? item.value : '';
}
onShow(() => {
-
+
uni.getLocation({
type: 'wgs84',
success: (res) => {
@@ -262,33 +269,39 @@
getUserInfo()
let buyinfo=$store.getBuyInfo()
buyinfo.combo_id=''
+ buyinfo.item_ids=[]
buyinfo.combo_sex=''
+ buyinfo.group_id=''
+ buyinfo.person_id=''
buyinfo.sanfang_code={}
$store.setBuyInfo(buyinfo)
$store.setCheckupTypeId({});
$store.setDuoXuanYi({});
$store.setPeiOuUser({});
- })
- onLoad(()=>{
-
+ $store.setTempPlan({})
+ $store.setYytjInfo({})
+ $store.setYuYueFangShi('')
+ $store.setGroupInfo({})
+ $store.setComboContrast([]);
})
+
-
+
-
+
@@ -325,9 +338,17 @@
{{ ii.name }}
+
+
+
+
+
+
+
- 04042207
+ 05122226
+
\ No newline at end of file
diff --git a/h5/pages/main/question/done/done.vue b/h5/pages/main/question/done/done.vue
index 9782910..91d580b 100644
--- a/h5/pages/main/question/done/done.vue
+++ b/h5/pages/main/question/done/done.vue
@@ -73,7 +73,11 @@
})
})
}
-
+ const gotoUrl=(url)=>{
+ uni.redirectTo({
+ url:url
+ })
+ }
onShow(() => {
if (!!config_ref.value) {
mountedAction()
@@ -92,6 +96,7 @@
问卷已提交,感谢您的参与!
+ 返回首页
@@ -323,4 +328,16 @@
display: block;
object-fit: contain;
}
+ .done_tip_button{
+ border: 1px solid #239EA3;
+ width: 400rpx;
+ margin: auto;
+ text-align: center;
+ border-radius: 20rpx;
+ background-color: #239EA3;
+ color: #fff;
+ margin-top: 100rpx;
+ height: 80rpx;
+ line-height: 80rpx;
+ }
\ No newline at end of file
diff --git a/h5/pages/main/question/question/question.vue b/h5/pages/main/question/question/question.vue
index 942ab00..c3f538d 100644
--- a/h5/pages/main/question/question/question.vue
+++ b/h5/pages/main/question/question/question.vue
@@ -21,6 +21,7 @@
import QuestionComponent from '../src/question.vue'
import Question2Component from '../src2/question.vue'
import DraggableButton from "@/pages/components/goHome.vue";
+ import TabBar from "@/common/TabBar.vue";
const $store = useStore()
const $props = defineProps({
id: {
@@ -312,8 +313,8 @@
}
-
-
+
+
diff --git a/h5/pages/main/questionnaire/index.vue b/h5/pages/main/questionnaire/index.vue
index 327f06c..140ef3f 100644
--- a/h5/pages/main/questionnaire/index.vue
+++ b/h5/pages/main/questionnaire/index.vue
@@ -1,5 +1,6 @@
-
-
+
+
-
+
diff --git a/h5/pages/main/tj/tjxq.vue b/h5/pages/main/tj/tjxq.vue
index 2b4fda4..cbb37eb 100644
--- a/h5/pages/main/tj/tjxq.vue
+++ b/h5/pages/main/tj/tjxq.vue
@@ -1,5 +1,6 @@
+
+
+
+
+ 是否继续支付?
+
+
+
+
+
+
+
+
+
+ {{
+ selectStatus == 1 ? "积分" : "预存款"
+ }}
+
+ (剩余{{
+ selectStatus == 1 ? keyong_jifen : save_money
+ }})
+
+
+
+
+
+ 暂不使用{{ selectStatus == 1 ? "积分" : "预存款" }}
+
+
+
+ 抵扣¥{{
+ jifen
+ ? jifen
+ : keyong_jifen > netReceiptsPrice
+ ? netReceiptsPrice
+ : keyong_jifen
+ }}使用{{
+ Math.ceil(
+ jifen
+ ? jifen
+ : keyong_jifen > netReceiptsPrice
+ ? netReceiptsPrice
+ : keyong_jifen
+ )
+ }}积分
+ 使用剩余预存款中的¥{{
+ yucunkuan
+ ? yucunkuan
+ : save_money > netReceiptsPrice
+ ? netReceiptsPrice
+ : save_money
+ }}
+
+
+
+
+ 确定
+
+
+
-
-
+
+ 温馨提示:若要增加项目可以到现场预检咨询
-
-
-
- 项目自选
- {{ comboInfo.combo_name }}
-
-
+
+
+
+
+
+
+
+
+ {{
+ userInfo.name
+ }}
+
+ {{ userInfo.sex == 1 ? "男性" : "女性" }}
+
+ {{ userInfo.phone }}
+
+
+
+
+
+
+
+
+
+
+
+
+ 积分
+ ({{ integral }})
+
+
+ -¥{{ Math.ceil(jifen) }}
+ 去选择
+
+
+
+
+
+
+ 优惠券
+ (共{{ couponList.length }}个)
+
+
+ {{ yytjInfo.couponName }}
+ 去选择
+
+
+
+
+
+
+ 预存款
+ (剩余{{ save_money }})
+
+
+ -¥{{ yucunkuan }}
+ 去选择
+
+
+
+
+
+
+
+
+
+
-
+
@@ -365,42 +918,52 @@
-
+
+
-
+
- 体检流程
- 检查项目
+
+
+
+ 项目自选
+ {{ comboInfo.combo_name }}
+
+
+
+ {{ groupInfo.group_name }}
+
-
- {{index+1}}.{{ val.keshi_name }}
+
+ {{ val.keshi_name }}
{{ val.children.length }}个项目
- 查看详情>>
+
+
+
-
- {{ v.name }}
+ {{i+1}}.{{ v.name }}
- ?
+
- {{ v.desc || "-" }}
+ {{ v.desc || "-" }}
@@ -419,10 +982,10 @@
体检须知
-
+
@@ -455,34 +1018,43 @@
体检注意事项
-
+
我已知晓
-
+
- ¥ {{ total_original_price }}
+ ¥ {{ total_original_price }}
- ¥{{
- totalPrice
- }}
+
+
+ ¥{{ netReceiptsPrice }}
+
+
-
+
\ No newline at end of file
diff --git a/h5/pages/main/tj/zhuanjiaxq.vue b/h5/pages/main/tj/zhuanjiaxq.vue
new file mode 100644
index 0000000..17eb85b
--- /dev/null
+++ b/h5/pages/main/tj/zhuanjiaxq.vue
@@ -0,0 +1,227 @@
+
+
+
+
+ 温馨提示:若要增加项目可以到现场预检咨询
+
+
+ {{content.combo_info.combo_name}}
+
+
+
+
+
+ 该套餐仅预约专家咨询,现场个性化定制套餐
+
+
+
+
+ ?
+
+
+
+
+ {{ ii.text }}
+
+
+
+
+
+ ¥
+ {{ content.combo_info.price }}
+
+
+
+
+
+ 说明:
+
+ 由健康管理中心专家为您推荐适合套餐或制定个性化套餐,咨询定制费30元,套餐加项享8折优惠。
+
+
+
+ 注意事项:
+
+ 体检前三天保持清淡饮食,避免饮酒;体检当天早晨需空腹,禁食、禁水(慢性病患者服药请遵医嘱);穿着宽松舒适衣物,不佩戴金属物品。
+
+
+
+ 预约
+
+
+
+
+
+
+
+
+
+
diff --git a/h5/pages/main/tjyy/tjyy.vue b/h5/pages/main/tjyy/tjyy.vue
index 6c27ae0..c417279 100644
--- a/h5/pages/main/tjyy/tjyy.vue
+++ b/h5/pages/main/tjyy/tjyy.vue
@@ -1,5 +1,6 @@
-
+
{
-
-
+
+
@@ -642,7 +653,7 @@ const toRouter = (url, status, index) => {
-
+
{
}
.button{
position: fixed;
- bottom: 80rpx;
+ bottom: 160rpx;
right: 40rpx;
}
.tags{
diff --git a/h5/pages/main/yytjsj/yytjsj.vue b/h5/pages/main/yytjsj/yytjsj.vue
index e9a0d01..2560d22 100644
--- a/h5/pages/main/yytjsj/yytjsj.vue
+++ b/h5/pages/main/yytjsj/yytjsj.vue
@@ -854,7 +854,7 @@
}
.uni-calendar-item__weeks-box-text {
- font-size: 26rpx;
+ font-size: 28rpx;
color:#ccc;
}
.uni-calendar-item__weeks-box-text:has(+ .uni-calendar-item--extra) {
diff --git a/h5/pages/main/yytjsj/yytjsj_front.vue b/h5/pages/main/yytjsj/yytjsj_front.vue
new file mode 100644
index 0000000..011e8ed
--- /dev/null
+++ b/h5/pages/main/yytjsj/yytjsj_front.vue
@@ -0,0 +1,886 @@
+
+
+
+
+
+
+ 请选择
+
+
+
+
+ {{ item.text }}
+
+
+
+
+
+ 有未预约套餐,请选择
+ 确定
+
+
+
+
+
+ 提示
+
+ |
+ 当前日期已有预约记录,是否继续预约?
+
+
+
+ 关闭
+ 继续
+
+
+
+
+
+ {{person_name}}
+ {{combo_name}}
+
+
+
+
+ {{doctor_name?doctor_name:"体检医生"}}
+
+
+
+
+
+
+
+
+
+
+
+ 请选择已购套餐
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{orderInfo.name}}
+
+
+
+
+ {{item_nmr.name}} {{item_nmr.date}}
+ {{item_nmr.time}}
+
+
+
+
+ 体检日期 {{tj_date}}
+ {{tj_time}}
+
+
+
+
+
+
+
+ 立即预约
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/h5/pages/main/yytjsj/yytjsj_new.vue b/h5/pages/main/yytjsj/yytjsj_new.vue
index b200f31..b4a6b53 100644
--- a/h5/pages/main/yytjsj/yytjsj_new.vue
+++ b/h5/pages/main/yytjsj/yytjsj_new.vue
@@ -1,6 +1,32 @@
-
+
+
+
+
+ 是否继续支付?
+
+
+ 取消
+
+
+ 继续
+
+
+
+
提示
@@ -15,69 +41,87 @@
-
-
- {{person_name}}
- {{combo_name}}
-
-
- {{doctor_name?doctor_name:"体检医生"}}
-
-
- 请选择
+
+
+
+ {{person_name}}
+
+ 婚检日:每周二、五、六
+
+
+
+
+
+ {{doctor_name?doctor_name:"体检医生"}}
+
-
-
+
+
+
+
+
+ 请选择已购套餐
+
+
+
+
+
+
+ 您未购买套餐可以点击右侧购买套餐
+
+ 购买套餐
+
+
+
+
+
+
+
+
+
+
+
-
+
{{orderInfo.name}}
-
+
-
-
- {{item_nmr.name}} {{item_nmr.date}}
- {{item_nmr.time}}
-
+
+ {{item_nmr.name}} {{item_nmr.date}} {{item_nmr.time}}
-
-
- 体检日期 {{tj_date}}
- {{tj_time}}
-
-
-
+
+
+ 体检日期 {{tj_date}} {{tj_time}}
+
+
-
+
- 立即预约
+ 立即预约
-
+
\ No newline at end of file
diff --git a/h5/pages/posts/posts/posts.vue b/h5/pages/posts/posts/posts.vue
index 3007666..00c30eb 100644
--- a/h5/pages/posts/posts/posts.vue
+++ b/h5/pages/posts/posts/posts.vue
@@ -1,5 +1,6 @@
-
-
+
+
diff --git a/h5/pages/posts/posts/src/list1.vue b/h5/pages/posts/posts/src/list1.vue
index 4b104bc..113aaa5 100644
--- a/h5/pages/posts/posts/src/list1.vue
+++ b/h5/pages/posts/posts/src/list1.vue
@@ -8,7 +8,8 @@
watch,
computed,
onMounted,
- ref
+ ref,
+ nextTick
} from 'vue'
import {
$api,
@@ -26,6 +27,9 @@
title: '注意事项',
desc: 'Physical Examination Notices'
}, {
+ title: '',
+ desc: ''
+ },{
title: '健康宣教',
desc: 'Health Education'
}])
@@ -63,13 +67,26 @@
id: item.id
})
$response(response, () => {
+
posts_list.value[key].content = htmlToText(response.data.info.content)
+ posts_list_show.value[key].content = htmlToText(response.data.info.content)
})
}
const contentShow = (info, key) => {
+ console.log(info)
+ console.log(key)
posts_list.value[key].open = !posts_list.value[key].open
- if (posts_list.value[key].open && !posts_list.value[key].content) {
+
+ const showIndex = posts_list_show.value.findIndex(item => item.id === info.id);
+ if (showIndex !== -1) {
+ posts_list_show.value[showIndex].open = posts_list.value[key].open;
+ posts_list_show.value[showIndex].content = posts_list.value[key].content;
+ }
+
+ console.log(posts_list.value[key].open)
+
+ if (posts_list.value[key].open ) {
getDetail(info, key)
}
}
@@ -110,7 +127,7 @@
-
+
@@ -122,9 +139,18 @@
{{ i.title }}
{{ !i.open ? '展开' : '收起' }}
-
-
+
+
+
diff --git a/h5/pages/premarital/readme/readme.vue b/h5/pages/premarital/readme/readme.vue
index 3788ca3..6f02f05 100644
--- a/h5/pages/premarital/readme/readme.vue
+++ b/h5/pages/premarital/readme/readme.vue
@@ -35,6 +35,7 @@
const mountedAction = () => {
getTipContent()
+ $store.setCheckupTypeId({id:4})
}
const config_ref = ref(null)
diff --git a/h5/pages/user/fenzhen/fenzhen.vue b/h5/pages/user/fenzhen/fenzhen.vue
index e8df4cf..7c5975d 100644
--- a/h5/pages/user/fenzhen/fenzhen.vue
+++ b/h5/pages/user/fenzhen/fenzhen.vue
@@ -31,6 +31,7 @@
default: "0",
},
});
+ let tips_popup=ref(null)
let erweima_popup = ref(null)
const fenzhen_list = ref(false);
const check_tip_show = ref(false);
@@ -70,6 +71,7 @@
fenzhen_list.value = response.data;
if (!check_tip_show.value) {
checkTipShow(response.data.check_tip, response.data.info.tj_number)
+ return false;
}
if (fenzhen_active.value !== -1) {
getFenzhenInfo(fenzhen_active.value)
@@ -82,7 +84,7 @@
}
} else {
if (Number($props.test) === 1) {
- if (erweimaText.value == '') {
+ if (erweimaText.value == '' ) {
getFenzhenList(false)
}
}
@@ -110,7 +112,7 @@
};
const tip_show = ref(false);
- const tip_content = ref("");
+ const tip_content = ref('');
const getTipContent = async () => {
uni.showLoading();
const response = await $api("GetReadme");
@@ -118,19 +120,18 @@
$response(response, () => {
tip_content.value = response.data.content;
tip_show.value = true;
+ tips_popup.value.open()
});
};
const tipShowClick = () => {
- if (!!tip_content.value) {
- tip_show.value = true;
- } else {
+
getTipContent();
- }
+
};
const toReport = () => {
wx.miniProgram.navigateTo({
- url: '/pages/other/entry/index?path=/pages/outpatient/doctor-appointment/index&scene=1035&hospitalAreaId=6&departmentCode=A0030077&subDepartmentCode=4773794195699464904'
+ url: '/pages/other/entry/index?path=/pages/outpatient/doctor-appointment/index&scene=1002&hospitalAreaId=6&departmentCode=A0030077&subDepartmentCode=4773794195699464904'
})
}
@@ -183,7 +184,18 @@
erweimaText.value = ''
console.log(erweimaText.value)
}
-
+ const tipsClose=()=>{
+ tips_popup.value.close();
+ tip_show.value = false;
+ }
+ const processString=(str, substring)=> {
+ const index = str.indexOf(substring);
+ if(index !== -1) {
+ // 返回指定子串之后的所有内容
+ return str.substring(index + substring.length).trim();
+ }
+ return ""; // 如果未找到指定子串,则返回空字符串或其他提示信息
+ }
onShow(() => {
if (!!config_ref.value) {
mountedAction();
@@ -195,10 +207,10 @@
- 扫码预约取号
+
@@ -206,14 +218,17 @@
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
-
+
体检套餐:
- {{
- fenzhen_list.info.combo_name
- }}
+ {{ fenzhen_list.info.combo_name }}
+
+
+ 体检单位:
+ {{ processString(fenzhen_list.info.combo_name, "单位团检") }}
体检日期:
@@ -296,7 +313,7 @@
-
+
{{
i.time
}}
@@ -306,9 +323,9 @@
-
-
-
+
+
+
{{ k + 1 }}.{{ i.name }}
{{ i.desc }}
@@ -384,7 +401,7 @@
justify-content: end;
}
- .report_button_wrapper {
+ .report_button_wrapper {
width: 200rpx;
height: 60rpx;
background: #239ea3;
@@ -436,11 +453,14 @@
border-radius: 15rpx;
padding-left: 50rpx;
padding-right: 50rpx;
- padding-bottom: 90rpx;
- padding-top: 130rpx;
+ padding-bottom: 60rpx;
+ padding-top: 80rpx;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
+ font-size: 28rpx;
+ line-height: 56rpx;
+ color: #666;
}
.time_line_item_more_wrapper {
@@ -474,6 +494,7 @@
.time_line_item_box_wrapper {
width: 400rpx;
+ overflow: hidden;
margin-left: 20rpx;
height: 40rpx;
background: #5a75ca30;
@@ -487,7 +508,7 @@
}
.time_line_item_title_wrapper {
- /* width: 140rpx; */
+ width: 170rpx;
font-weight: bold;
font-size: 28rpx;
color: #0d0d0d;
@@ -537,7 +558,7 @@
left: 50%;
top: 50%;
transform: translate(-50%, calc(-50% + 26rpx));
- z-index: 999;
+ z-index: 998;
}
.time_line_item_time_dot_in_wrapper {
diff --git a/h5/store/index.js b/h5/store/index.js
index 478fd96..2c15efe 100644
--- a/h5/store/index.js
+++ b/h5/store/index.js
@@ -22,6 +22,8 @@ export const useStore = defineStore('counter', {
count: 0,
loading: 0,
buyInfo: {}, // 购买信息接口配置 预约页面使用 别的地方最好不要用
+ tempPlan:{},//临时占用号源
+ yuyue_fangshi:"",//个检、团检、个检先号源、专家定制 等等
}),
actions: {
setComboContrast(comboContrast) {
@@ -86,6 +88,25 @@ export const useStore = defineStore('counter', {
getPeiOuUser() {
return JSON.parse(uni.getStorageSync('PEIOU') || '{}') || this.user;
},
+
+ //临时占用号源
+ setTempPlan(plan) {
+ this.tempPlan = plan;
+ uni.setStorageSync('TEMP_PLAN', JSON.stringify(plan));
+ },
+ //临时占用号源
+ getTempPlan() {
+ return JSON.parse(uni.getStorageSync('TEMP_PLAN') || '{}') || this.tempPlan;
+ },
+ //预约方式
+ setYuYueFangShi(type) {
+ this.yuyue_fangshi = type;
+ uni.setStorageSync('YUYUE_FANGSHI', JSON.stringify(type));
+ },
+ //预约方式
+ getYuYueFangShi() {
+ return JSON.parse(uni.getStorageSync('YUYUE_FANGSHI') || {}) || this.yuyue_fangshi;
+ },
setGroupInfo(info) {
this.groupInfo = info;
uni.setStorageSync('GROUP_INFO', JSON.stringify(info));
diff --git a/h5/uni_modules/uni-icons/changelog.md b/h5/uni_modules/uni-icons/changelog.md
index 6449885..0261131 100644
--- a/h5/uni_modules/uni-icons/changelog.md
+++ b/h5/uni_modules/uni-icons/changelog.md
@@ -1,3 +1,23 @@
+## 2.0.10(2024-06-07)
+- 优化 uni-app x 中,size 属性的类型
+## 2.0.9(2024-01-12)
+fix: 修复图标大小默认值错误的问题
+## 2.0.8(2023-12-14)
+- 修复 项目未使用 ts 情况下,打包报错的bug
+## 2.0.7(2023-12-14)
+- 修复 size 属性为 string 时,不加单位导致尺寸异常的bug
+## 2.0.6(2023-12-11)
+- 优化 兼容老版本icon类型,如 top ,bottom 等
+## 2.0.5(2023-12-11)
+- 优化 兼容老版本icon类型,如 top ,bottom 等
+## 2.0.4(2023-12-06)
+- 优化 uni-app x 下示例项目图标排序
+## 2.0.3(2023-12-06)
+- 修复 nvue下引入组件报错的bug
+## 2.0.2(2023-12-05)
+-优化 size 属性支持单位
+## 2.0.1(2023-12-05)
+- 新增 uni-app x 支持定义图标
## 1.3.5(2022-01-24)
- 优化 size 属性可以传入不带单位的字符串数值
## 1.3.4(2022-01-24)
diff --git a/h5/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue b/h5/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue
new file mode 100644
index 0000000..8740559
--- /dev/null
+++ b/h5/uni_modules/uni-icons/components/uni-icons/uni-icons.uvue
@@ -0,0 +1,91 @@
+
+
+ {{unicode}}
+
+
+
+
+
+
diff --git a/h5/uni_modules/uni-icons/components/uni-icons/uni-icons.vue b/h5/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
index 86e7444..7da5356 100644
--- a/h5/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
+++ b/h5/uni_modules/uni-icons/components/uni-icons/uni-icons.vue
@@ -1,24 +1,28 @@
- {{unicode}}
+ {{unicode}}
-
+
+
+