t
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrquestionnaireanswer extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '科室问卷答案';
|
||||
|
||||
/**
|
||||
* desc:获取科室问卷答案
|
||||
*
|
||||
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*
|
||||
* 参数:
|
||||
* answer 问卷答案
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrquestionnaireanswerList(){
|
||||
Tools::log_to_write_txt(['获取科室问卷答案 入参:'=>input()]);
|
||||
$api_desc = '获取科室问卷答案';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
$hdrquestionnairequestion_id = input('hdrquestionnairequestion_id');
|
||||
$answer = input('answer');
|
||||
$create_time = input('create_time');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrquestionnaireanswer);
|
||||
|
||||
if(input('answer')){
|
||||
$model_obj->whereLike('answer','%'.input('answer').'%');
|
||||
}
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('hdrquestionnairequestion_id')){
|
||||
$model_obj->where('hdrquestionnairequestion_id',input('hdrquestionnairequestion_id'));
|
||||
}
|
||||
if(input('create_time')){
|
||||
$model_obj->where('create_time',input('create_time'));
|
||||
}
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取科室问卷答案.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrquestionnairequestion extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '科室问卷问题(一个问题对应多个答案)';
|
||||
|
||||
/**
|
||||
* desc:获取科室问卷问题(一个问题对应多个答案)
|
||||
*
|
||||
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*
|
||||
* 参数:
|
||||
* question 问卷问题
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrquestionnairequestionList(){
|
||||
Tools::log_to_write_txt(['获取科室问卷问题(一个问题对应多个答案) 入参:'=>input()]);
|
||||
$api_desc = '获取科室问卷问题(一个问题对应多个答案)';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
$hdrdepartment_id = input('hdrdepartment_id');
|
||||
$question = input('question');
|
||||
$fit_sex = input('fit_sex');
|
||||
$create_time = input('create_time');
|
||||
$update_time = input('update_time');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrquestionnairequestion);
|
||||
|
||||
if(input('question')){
|
||||
$model_obj->whereLike('question','%'.input('question').'%');
|
||||
}
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('hdrdepartment_id')){
|
||||
$model_obj->where('hdrdepartment_id',input('hdrdepartment_id'));
|
||||
}
|
||||
if(input('fit_sex')){
|
||||
$model_obj->where('fit_sex',input('fit_sex'));
|
||||
}
|
||||
if(input('create_time')){
|
||||
$model_obj->where('create_time',input('create_time'));
|
||||
}
|
||||
if(input('update_time')){
|
||||
$model_obj->where('update_time',input('update_time'));
|
||||
}
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取科室问卷问题(一个问题对应多个答案).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
194
digital_doctor/application/api/controller/Hdrregister.php
Normal file
194
digital_doctor/application/api/controller/Hdrregister.php
Normal file
@@ -0,0 +1,194 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrregister extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '患者挂号列表(可重复挂号)';
|
||||
|
||||
|
||||
/**
|
||||
* 新增患者挂号列表(可重复挂号)
|
||||
*
|
||||
* 参数:
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* ticket 对话凭据(便于查询)
|
||||
* api/Hdrregister/addHdrregister
|
||||
*/
|
||||
function addHdrregister(){
|
||||
Tools::log_to_write_txt(['新增患者挂号列表(可重复挂号)'=>input()]);
|
||||
$api_desc = '新增患者挂号列表(可重复挂号)';
|
||||
Db::startTrans();
|
||||
try {
|
||||
|
||||
$date = input('date');
|
||||
if(empty($date)){
|
||||
return json(Tools::set_fail('参数错误.0'));
|
||||
}
|
||||
|
||||
$name = input('name');
|
||||
if(empty($name)){
|
||||
return json(Tools::set_fail('参数错误.1'));
|
||||
}
|
||||
|
||||
$doctor_name = input('doctor_name');
|
||||
if(empty($doctor_name)){
|
||||
return json(Tools::set_fail('参数错误.2'));
|
||||
}
|
||||
|
||||
$age = input('age');
|
||||
if(empty($age)){
|
||||
return json(Tools::set_fail('参数错误.3'));
|
||||
}
|
||||
|
||||
$gender = input('gender');
|
||||
if(empty($gender)){
|
||||
return json(Tools::set_fail('参数错误.4'));
|
||||
}
|
||||
|
||||
$phone = input('phone');
|
||||
if(empty($phone)){
|
||||
return json(Tools::set_fail('参数错误.5'));
|
||||
}
|
||||
|
||||
$qa_type = input('qa_type');
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return json(Tools::set_fail('参数错误.7'));
|
||||
}
|
||||
|
||||
|
||||
$data = [
|
||||
'date'=>$date?:'',
|
||||
'name'=>$name?:'',
|
||||
'doctor_name'=>$doctor_name?:'',
|
||||
'age'=>$age?:'',
|
||||
'gender'=>$gender?:'',
|
||||
'phone'=>$phone?:'',
|
||||
'qa_type'=>$qa_type?:'',
|
||||
'ticket'=>$ticket?:'',
|
||||
];
|
||||
|
||||
|
||||
$dataid = Db::table(TabConf::$fa_hdrregister)->insertGetId($data);
|
||||
|
||||
$this->operateLog('新增患者挂号列表(可重复挂号)',api_user_info('id'));
|
||||
Db::commit();
|
||||
return json(Tools::set_ok('ok',$dataid));
|
||||
}catch (\Exception $e){
|
||||
Db::rollback();
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'新增患者挂号列表(可重复挂号).异常.'.$e->getMessage(),
|
||||
'input'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_fail());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* desc:获取患者挂号列表(可重复挂号)
|
||||
*
|
||||
* api/Hdrregister/getHdrregisterList
|
||||
*
|
||||
* 参数:
|
||||
* name 患者姓名(可重复挂号)
|
||||
* phone 手机号
|
||||
* id ID
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* status 状态:0=挂号中,1=结束诊断
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* create_time 创建时间
|
||||
* status 状态:0=挂号中,1=结束诊断
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* ticket 对话凭据(便于查询)
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrregisterList(){
|
||||
Tools::log_to_write_txt(['获取患者挂号列表(可重复挂号) 入参:'=>input()]);
|
||||
$api_desc = '获取患者挂号列表(可重复挂号)';
|
||||
try {
|
||||
|
||||
$id = input('id');
|
||||
$date = input('date');
|
||||
$name = input('name');
|
||||
$gender = input('gender');
|
||||
$phone = input('phone');
|
||||
$status = input('status');
|
||||
$qa_type = input('qa_type');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrregister);
|
||||
|
||||
if(input('name')){
|
||||
$model_obj->whereLike('name','%'.input('name').'%');
|
||||
}
|
||||
|
||||
if(input('phone')){
|
||||
$model_obj->whereLike('phone','%'.input('phone').'%');
|
||||
}
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('date')){
|
||||
$model_obj->where('date',input('date'));
|
||||
}
|
||||
if(input('name')){
|
||||
$model_obj->where('name',input('name'));
|
||||
}
|
||||
if(input('gender')){
|
||||
$model_obj->where('gender',input('gender'));
|
||||
}
|
||||
if(input('status')){
|
||||
$model_obj->where('status',input('status'));
|
||||
}
|
||||
if(input('qa_type')){
|
||||
$model_obj->where('qa_type',input('qa_type'));
|
||||
}
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取患者挂号列表(可重复挂号).异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\common\model\TabConf;
|
||||
use think\Db;
|
||||
use wanghua\general_utility_tools_php\gpt\chat\ChatGPT;
|
||||
use wanghua\general_utility_tools_php\Mmodel;
|
||||
@@ -23,7 +24,7 @@ class Reporttt
|
||||
{
|
||||
|
||||
/**
|
||||
* desc:疼痛科-数字人-生成听诊报告
|
||||
* desc:疼痛科-数字人-生成听诊报告(同时提交固定问答聊天记录)
|
||||
*
|
||||
* api/Reporttt/createReport
|
||||
*
|
||||
@@ -46,10 +47,10 @@ class Reporttt
|
||||
|
||||
$answer_json_arr = [];
|
||||
|
||||
//$ticket = input('ticket');
|
||||
//if(empty($ticket)){
|
||||
// return json(Tools::set_fail('ticket必须'));
|
||||
//}
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return json(Tools::set_fail('对话票据ticket必须(用于隔离用户聊天历史记录),登陆时返回票据,每次诊断结束重新生成票据!'));
|
||||
}
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return json(Tools::set_fail('username不存在'));
|
||||
@@ -79,6 +80,8 @@ class Reporttt
|
||||
'address'=>input('address',''),//地址
|
||||
'phone'=>input('phone',''),//联系方式
|
||||
'wechat_no'=>input('wechat_no',''),//微信号
|
||||
'form'=>'num_per',
|
||||
'ticket'=>$ticket,//对话票据'
|
||||
];
|
||||
|
||||
$contentstr = input('content');
|
||||
@@ -113,7 +116,11 @@ class Reporttt
|
||||
//$content = [
|
||||
// //["role" => "user", "content" => '']
|
||||
//];
|
||||
//设置聊天记录
|
||||
|
||||
//保存疼痛科聊天记录
|
||||
$this->setTtChatHistory($sub_content,$username,$ticket);
|
||||
|
||||
//chatGpt设置前置聊天上下文
|
||||
$chatobj->setBefore($sub_content);
|
||||
|
||||
//回答
|
||||
@@ -151,6 +158,8 @@ class Reporttt
|
||||
$DATAID = Db::table('fa_tt_userbaseinfo')->insert($basedata);
|
||||
$item['userbaseid'] = $DATAID;
|
||||
Db::table('fa_tt_medical_report')->insert($item);
|
||||
//统一存档
|
||||
Db::table(TabConf::$fa_hdrmedical_report)->insert($item);
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
@@ -162,6 +171,28 @@ class Reporttt
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:保存疼痛科聊天记录
|
||||
* author:wh
|
||||
* @param $sub_content
|
||||
*/
|
||||
private function setTtChatHistory($sub_content,$username,$ticket){
|
||||
//$content = [
|
||||
// //["role" => "user", "content" => '']
|
||||
//];
|
||||
$data = [];
|
||||
foreach ($sub_content as $item){
|
||||
$content = explode(':',$item['content']);
|
||||
$d = [
|
||||
'username'=>$username,
|
||||
'type'=>empty($content[0])?'':$content[0],
|
||||
'chat_msg'=>$item['content'],
|
||||
'ticket'=>$ticket,
|
||||
];
|
||||
$data[] = $d;
|
||||
}
|
||||
Db::table(TabConf::$fa_tt_chathistory)->insertAll($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:查询报告详情
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
namespace app\api\controller;
|
||||
|
||||
|
||||
use app\common\model\TabConf;
|
||||
use GatewayWorker\Lib\Gateway;
|
||||
use think\Db;
|
||||
use wanghua\general_utility_tools_php\gpt\chat\ChatGPT;
|
||||
@@ -47,23 +48,23 @@ class Reportty
|
||||
|
||||
$answer_json_arr = [];
|
||||
|
||||
//$ticket = input('ticket');
|
||||
//if(empty($ticket)){
|
||||
// return json(Tools::set_fail('ticket必须'));
|
||||
//}
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return json(Tools::set_fail('ticket必须'));
|
||||
}
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return json(Tools::set_fail('username必须'));
|
||||
}
|
||||
$user = Db::table('fa_ty_users')->where('username',$username)->find();
|
||||
if(empty($user)){
|
||||
return json(Tools::set_fail('用户不存在'));
|
||||
return json(Tools::set_fail('医生不存在'));
|
||||
}
|
||||
|
||||
//查询历史聊天记录
|
||||
//$day3 = date('Y-m-d 00:00:00',strtotime('-3 day'));
|
||||
$his_record = Db::table('fa_ty_chathistory')
|
||||
->where('username',$user['username'])
|
||||
->where('ticket',$ticket)
|
||||
->order('id asc')
|
||||
//->where('createtime','>',$day3)//3天之内
|
||||
->select();
|
||||
@@ -73,24 +74,21 @@ class Reportty
|
||||
$content = [
|
||||
//["role" => "user", "content" => '']
|
||||
];
|
||||
$baseuser = [];
|
||||
//Db::table('fa_ty_userbaseinfo')
|
||||
//->where('phone',$user['username'])
|
||||
//->where('name',$user['name'])
|
||||
//->find();
|
||||
//病历
|
||||
$medicalrecord = [];
|
||||
|
||||
$name = isset($baseuser['name'])?$baseuser['name']:'未知';
|
||||
$gender = isset($baseuser['gender'])?$baseuser['gender']:'未知';
|
||||
$age = isset($baseuser['age'])?$baseuser['age']:'未知';
|
||||
$main_complaint = isset($baseuser['main_complaint'])?$baseuser['main_complaint']:'未知';
|
||||
$medical_history = isset($baseuser['medical_history'])?$baseuser['medical_history']:'未知';
|
||||
$past_history = isset($baseuser['past_history'])?$baseuser['past_history']:'未知';
|
||||
$allergy_history = isset($baseuser['allergy_history'])?$baseuser['allergy_history']:'未知';
|
||||
$family_history = isset($baseuser['family_history'])?$baseuser['family_history']:'未知';
|
||||
$personal_history = isset($baseuser['personal_history'])?$baseuser['personal_history']:'未知';
|
||||
$menstrual_marital_history = isset($baseuser['menstrual_marital_history'])?$baseuser['menstrual_marital_history']:'未知';
|
||||
$diagnosis = isset($baseuser['diagnosis'])?$baseuser['diagnosis']:'未知';
|
||||
$treatment = isset($baseuser['treatment'])?$baseuser['treatment']:'未知';
|
||||
$name = isset($medicalrecord['name'])?$medicalrecord['name']:'未知';
|
||||
$gender = isset($medicalrecord['gender'])?$medicalrecord['gender']:'未知';
|
||||
$age = isset($medicalrecord['age'])?$medicalrecord['age']:'未知';
|
||||
$main_complaint = isset($medicalrecord['main_complaint'])?$medicalrecord['main_complaint']:'未知';
|
||||
$medical_history = isset($medicalrecord['medical_history'])?$medicalrecord['medical_history']:'未知';
|
||||
$past_history = isset($medicalrecord['past_history'])?$medicalrecord['past_history']:'未知';
|
||||
$allergy_history = isset($medicalrecord['allergy_history'])?$medicalrecord['allergy_history']:'未知';
|
||||
$family_history = isset($medicalrecord['family_history'])?$medicalrecord['family_history']:'未知';
|
||||
$personal_history = isset($medicalrecord['personal_history'])?$medicalrecord['personal_history']:'未知';
|
||||
$menstrual_marital_history = isset($medicalrecord['menstrual_marital_history'])?$medicalrecord['menstrual_marital_history']:'未知';
|
||||
$diagnosis = isset($medicalrecord['diagnosis'])?$medicalrecord['diagnosis']:'未知';
|
||||
$treatment = isset($medicalrecord['treatment'])?$medicalrecord['treatment']:'未知';
|
||||
//构建基本信息
|
||||
$content[] = ["role" => "user", "content" => '【姓名】:'.$name];
|
||||
$content[] = ["role" => "user", "content" => '【性别】:'.$gender];
|
||||
@@ -125,16 +123,21 @@ class Reportty
|
||||
//病人
|
||||
//'username'=>Db::table('fa_ty_users')->where('doctor',$user['username'])->value('username'),
|
||||
'report_content'=>$choice['message']['content'],
|
||||
'ticket'=>$ticket,
|
||||
'form'=>'ty',
|
||||
];
|
||||
$report_id = Db::table('fa_ty_medical_report')->insertGetId($data);
|
||||
|
||||
//统一存档
|
||||
Db::table(TabConf::$fa_hdrmedical_report)->insert($data);
|
||||
|
||||
$res_content[] = ['report_id'=>$report_id,'report_content'=>$choice['message']['content']];
|
||||
}
|
||||
}
|
||||
//点击生成报告删除历史聊天记录
|
||||
Db::table('fa_ty_chathistory')
|
||||
->where('username',$user['username'])
|
||||
->delete();
|
||||
//Db::table('fa_ty_chathistory')
|
||||
// ->where('username',$user['username'])
|
||||
// ->delete();
|
||||
|
||||
$client_id = input('client_id');
|
||||
if(empty($client_id)){
|
||||
@@ -143,12 +146,11 @@ class Reportty
|
||||
|
||||
//查询广播客户端id
|
||||
$arr = Db::table('fa_device')
|
||||
->where('username',$username)
|
||||
->where('clientid','neq',$client_id)
|
||||
->where('ticket',$ticket)
|
||||
->select();
|
||||
$clientid_arr = array_column($arr,'clientid');
|
||||
$json = Tools::wss_json_ok('Reportty/createReport','ok',['flow_code'=>'create_report_end']);
|
||||
Gateway::sendToAll($json,$clientid_arr);
|
||||
Gateway::sendToAll($json,$clientid_arr,[$client_id]);
|
||||
return json(Tools::set_ok($res_content));
|
||||
}
|
||||
|
||||
@@ -205,14 +207,24 @@ class Reportty
|
||||
*/
|
||||
function editReport(){
|
||||
return Mmodel::catchJson(function (){
|
||||
//$ticket = input('ticket');
|
||||
//if(empty($ticket)){
|
||||
// return Tools::set_fail('ticket必须');
|
||||
//}
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return Tools::set_fail('ticket必须');
|
||||
}
|
||||
//$user = Db::table('fa_ty_users')->where('ticket',$ticket)->find();
|
||||
//修改基本信息
|
||||
|
||||
if(empty(input('username'))){
|
||||
return Tools::set_fail('医生登录账号必须');
|
||||
}
|
||||
if(empty(input('name',''))){
|
||||
return Tools::set_fail('病人姓名必须');
|
||||
}
|
||||
if(empty(input('phone',''))){
|
||||
return Tools::set_fail('病人手机号必须');
|
||||
}
|
||||
//听译问诊-患者病历信息
|
||||
$data = [
|
||||
//'username'=>$user['username'],//医生
|
||||
'username'=>input('username'),//医生
|
||||
'name'=>input('name',''),//病人姓名
|
||||
'gender'=>input('gender',''),//病人性别: M=男性, F=女性
|
||||
'age'=>input('age',''),//病人年龄
|
||||
@@ -225,19 +237,43 @@ class Reportty
|
||||
'menstrual_marital_history'=>input('menstrual_marital_history',''),//月经婚育史
|
||||
'diagnosis'=>input('diagnosis',''),//诊断
|
||||
'treatment'=>input('treatment',''),//医嘱
|
||||
'ticket'=>$ticket
|
||||
];
|
||||
//查询基本信息
|
||||
$baseuser = Db::table('fa_ty_userbaseinfo')
|
||||
//听译问诊-患者病历信息
|
||||
$medicalrecord = Db::table('fa_ty_usermedicalrecord')
|
||||
->where('name',input('name',''))
|
||||
->find();
|
||||
if(empty($baseuser)){
|
||||
//新增基本信息
|
||||
$userbaseid = Db::table('fa_ty_userbaseinfo')->insertGetId($data);
|
||||
if(empty($medicalrecord)){
|
||||
$data['ticket'] = $ticket;
|
||||
//新增听译病历信息
|
||||
$userbaseid = Db::table('fa_ty_usermedicalrecord')->insertGetId($data);
|
||||
|
||||
}else{
|
||||
$userbaseid = $baseuser['id'];
|
||||
Db::table('fa_ty_userbaseinfo')
|
||||
->where('id',$userbaseid)
|
||||
$userbaseid = $medicalrecord['id'];
|
||||
Db::table('fa_ty_usermedicalrecord')
|
||||
->where('ticket',$ticket)
|
||||
->update($data);
|
||||
}
|
||||
//新增统一基本信息
|
||||
$base_data = [
|
||||
'doctor'=>input('username'),
|
||||
'form'=>'ty',
|
||||
'name'=>input('name',''),
|
||||
'gender'=>input('gender',''),//病人性别: M=男性, F=女性
|
||||
'age'=>input('age',''),//病人年龄
|
||||
'phone'=>input('phone',''),
|
||||
];
|
||||
$baseinfo = Db::table('fa_hdruserbaseinfo')
|
||||
->where('ticket',$ticket)
|
||||
->find();
|
||||
if(empty($baseinfo)){
|
||||
$baseinfo['ticket'] = $ticket;
|
||||
//新增统一基本信息
|
||||
Db::table('fa_hdruserbaseinfo')
|
||||
->insertGetId($base_data);
|
||||
}else{
|
||||
Db::table('fa_hdruserbaseinfo')
|
||||
->where('ticket',$ticket)
|
||||
->update($data);
|
||||
}
|
||||
|
||||
@@ -265,6 +301,18 @@ EOF;
|
||||
}
|
||||
|
||||
Db::table('fa_ty_medical_report')
|
||||
->where('id',$dataid)
|
||||
->data([
|
||||
'userbaseid'=>$userbaseid,//创建报告的时候这个字段是空,修改报告再补填这个字段
|
||||
'report_content'=>$str,
|
||||
'name'=>$data['name'],
|
||||
'gender'=>$data['gender'],
|
||||
])
|
||||
->update();
|
||||
|
||||
|
||||
//更新统一存档
|
||||
Db::table(TabConf::$fa_hdrmedical_report)
|
||||
->where('id',$dataid)
|
||||
->data([
|
||||
'userbaseid'=>$userbaseid,//创建报告的时候这个字段是空,修改报告再补填这个字段
|
||||
|
||||
62
digital_doctor/application/api/controller/Ttchathistory.php
Normal file
62
digital_doctor/application/api/controller/Ttchathistory.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Ttchathistory extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '疼痛科聊天历史';
|
||||
|
||||
/**
|
||||
* desc:获取数智人固定问答聊天历史
|
||||
*
|
||||
* api/Ttchathistory/getTtchathistoryList
|
||||
*
|
||||
* 参数:
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* username 聊天用户
|
||||
* relation 医生患者关系
|
||||
* chat_msg 问诊内容
|
||||
* create_time 创建时间
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getTtchathistoryList(){
|
||||
Tools::log_to_write_txt(['获取数智人固定问答聊天历史 入参:'=>input()]);
|
||||
$api_desc = '获取数智人固定问答聊天历史';
|
||||
try {
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_tt_chathistory);
|
||||
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取数智人固定问答聊天历史.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -29,6 +29,21 @@ use wanghua\general_utility_tools_php\wechat\UserAuth;
|
||||
*/
|
||||
class Userstt extends BaseHttpApi
|
||||
{
|
||||
/**
|
||||
* desc:获取对话票据,隔离用户历史记录,每次诊断完,重新生成新的对话票据
|
||||
* (首次对话票据在登录时返回)
|
||||
* 参数:无
|
||||
*
|
||||
* api/Userstt/getSayTicket
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
function getSayTicket(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$ticket = md5(time());
|
||||
return Tools::set_ok('ok',['ticket'=>$ticket]);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* desc:疼痛科-根据id查询用户
|
||||
* api/Userstt/getUserById
|
||||
@@ -91,7 +106,7 @@ class Userstt extends BaseHttpApi
|
||||
|
||||
unset($user['password']);
|
||||
|
||||
$expires = 7*86400+time();
|
||||
$expires = 7*86400+time();//报告完成之后重新获取票据
|
||||
|
||||
|
||||
//返回票据
|
||||
@@ -189,4 +204,64 @@ class Userstt extends BaseHttpApi
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:提交自由问答记录(后台需要单独列出来,对话时前端缓存在本地,对话结束提交)
|
||||
*
|
||||
* 参数:
|
||||
* ticket 对话票据(结束问诊时重新生成)
|
||||
* username 用户名
|
||||
* content 对话内容,格式:
|
||||
* content = [
|
||||
["role" => "user", "content" => '1'],
|
||||
["role" => "user", "content" => '2'],
|
||||
["role" => "user", "content" => '3'],
|
||||
];
|
||||
*
|
||||
* api/Userstt/subFreeQuestionAnswerRecord
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
function subFreeQuestionAnswerRecord(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return Tools::set_fail('ticket必须');
|
||||
}
|
||||
$content = input('content');
|
||||
if(empty($content)){
|
||||
return Tools::set_fail('content对话内容必须');
|
||||
}
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return Tools::set_fail('username必须');
|
||||
}
|
||||
|
||||
$this->setTtFreeChatHistory($content,$username,$ticket);
|
||||
|
||||
return Tools::set_ok();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:保存疼痛科自由对话聊天记录
|
||||
* author:wh
|
||||
* @param $sub_content
|
||||
*/
|
||||
private function setTtFreeChatHistory($sub_content,$username,$ticket){
|
||||
//$content = [
|
||||
// //["role" => "user", "content" => '']
|
||||
//];
|
||||
$data = [];
|
||||
foreach ($sub_content as $item){
|
||||
$content = explode(':',$item['content']);
|
||||
$d = [
|
||||
'username'=>$username,
|
||||
'type'=>empty($content[0])?'':$content[0],
|
||||
'chat_msg'=>$item['content'],
|
||||
'ticket'=>$ticket,
|
||||
];
|
||||
$data[] = $d;
|
||||
}
|
||||
Db::table(TabConf::$fa_tt_free_chathistory)->insertAll($data);
|
||||
}
|
||||
}
|
||||
@@ -101,20 +101,20 @@ class Usersty extends BaseHttpApi
|
||||
* clientid
|
||||
* type 用户类型:user=用户,doc=医生
|
||||
*/
|
||||
function bindDevice(){
|
||||
return Mmodel::catchJson(function (){
|
||||
//绑定设备
|
||||
$devidata = [
|
||||
'username'=>input('username'),
|
||||
'clientid'=>input('clientid'),
|
||||
'type'=>input('type'),
|
||||
'login_time'=>Tools::get_now_date(),
|
||||
];
|
||||
Mmodel::existsUpdateInsert('fa_device',[
|
||||
'username'=>input('username'),
|
||||
'clientid'=>input('clientid'),
|
||||
],$devidata);
|
||||
return Tools::set_ok('绑定成功');
|
||||
});
|
||||
}
|
||||
//function bindDevice(){
|
||||
// return Mmodel::catchJson(function (){
|
||||
// //绑定设备
|
||||
// $devidata = [
|
||||
// 'username'=>input('username'),
|
||||
// 'clientid'=>input('clientid'),
|
||||
// 'type'=>input('type'),
|
||||
// 'login_time'=>Tools::get_now_date(),
|
||||
// ];
|
||||
// Mmodel::existsUpdateInsert('fa_device',[
|
||||
// 'username'=>input('username'),
|
||||
// 'clientid'=>input('clientid'),
|
||||
// ],$devidata);
|
||||
// return Tools::set_ok('绑定成功');
|
||||
// });
|
||||
//}
|
||||
}
|
||||
@@ -27,9 +27,9 @@ class Wsspush extends BaseWssApi
|
||||
{
|
||||
|
||||
/**
|
||||
* desc:
|
||||
* desc:向指定客户端发送信息
|
||||
*
|
||||
* index/wsspush/index/socketTaskId/xxxx
|
||||
* api/wsspush/index/socketTaskId/xxxx
|
||||
*
|
||||
* author:wh
|
||||
*/
|
||||
@@ -49,8 +49,8 @@ class Wsspush extends BaseWssApi
|
||||
* @throws \Exception
|
||||
*/
|
||||
function pushToAll(){
|
||||
$json = Tools::wss_json_ok('Reportty/createReport','ok',['flow_code'=>'create_report_end']);
|
||||
Gateway::sendToAll($json);
|
||||
//$json = Tools::wss_json_ok('Reportty/createReport','ok',['flow_code'=>'create_report_end']);
|
||||
//Gateway::sendToAll($json);
|
||||
}
|
||||
public function hello($name = 'ThinkPHP5')
|
||||
{
|
||||
|
||||
@@ -61,7 +61,7 @@ class TychatLogic extends BaseLogic
|
||||
//广播消息
|
||||
//查询广播客户端id
|
||||
$arr = Db::table(TabConf::$fa_device)
|
||||
->where('say_ticket',$ticket)
|
||||
->where('ticket',$ticket)
|
||||
->where('clientid','neq',$client_id)//不给自己发
|
||||
->select();
|
||||
if(empty($arr)){
|
||||
@@ -72,7 +72,7 @@ class TychatLogic extends BaseLogic
|
||||
$clientid_arr = array_column($arr,'clientid');
|
||||
|
||||
//保存记录
|
||||
$this->saveHistory($username,$chat_msg,$type);
|
||||
$this->saveHistory($username,$chat_msg,$type,$ticket);
|
||||
|
||||
//向客户端发送消息
|
||||
$json = Tools::wss_json_ok($action, $chat_msg);
|
||||
@@ -86,16 +86,15 @@ class TychatLogic extends BaseLogic
|
||||
* desc:保存听译聊天记录
|
||||
*
|
||||
*/
|
||||
private function saveHistory($username,$chat_content,$type){
|
||||
private function saveHistory($username,$chat_content,$type,$ticket){
|
||||
$data = [
|
||||
'chat_msg'=>$chat_content,
|
||||
'username'=>$username,
|
||||
'type'=>$type//聊天角色
|
||||
'type'=>$type,//聊天角色
|
||||
'ticket'=>$ticket,//对话凭据
|
||||
];
|
||||
Db::table('fa_ty_chathistory')->insert($data);
|
||||
|
||||
//这里做健康小洞察
|
||||
//$this->getHealthInsight();
|
||||
|
||||
return Tools::set_ok();
|
||||
}
|
||||
@@ -105,12 +104,12 @@ class TychatLogic extends BaseLogic
|
||||
*/
|
||||
function getChatHistory(){
|
||||
return Mmodel::catchJson(function (){
|
||||
$username = input('username');
|
||||
if(empty($username)){
|
||||
return Tools::set_fail('参数错误');
|
||||
$ticket = input('ticket');
|
||||
if(empty($ticket)){
|
||||
return Tools::set_fail('ticket参数错误');
|
||||
}
|
||||
$list = Db::table('fa_ty_chathistory')
|
||||
->where('username',$username)
|
||||
->where('ticket',$ticket)
|
||||
->order('id desc')
|
||||
->select();
|
||||
return Tools::set_ok('查询成功',$list);
|
||||
@@ -129,7 +128,7 @@ class TychatLogic extends BaseLogic
|
||||
* ]
|
||||
* author:wh
|
||||
*/
|
||||
function getHealthInsight2($clientid_arr,$chat_msg){
|
||||
private function getHealthInsight2($clientid_arr,$chat_msg){
|
||||
Tools::log_to_write_txt(['健康洞察,入参'=>['域名'=>request()->controller().'/'.request()->action()]]);
|
||||
$action = 'Tychat/getHealthInsight2';
|
||||
|
||||
@@ -161,4 +160,70 @@ class TychatLogic extends BaseLogic
|
||||
$json = Tools::wss_json_ok($action, 'ok',$answer_json_arr);
|
||||
Gateway::sendToAll($json,$clientid_arr);
|
||||
}
|
||||
|
||||
/**
|
||||
* desc:医生打开诊断窗口记录,打开诊断窗口时调用该接口,发送对话数据给客户端,客户端拿本地登录的票据与该票据参数做相等匹配,
|
||||
* 相等表示同一个医生,否则提示切换医生登录账号
|
||||
*
|
||||
* 请求类型:wss
|
||||
* action: Tychat/openChatRoomWriteRecord
|
||||
* items:[
|
||||
* doctor_name //医生姓名
|
||||
doctor_phone //医生电话
|
||||
name //患者姓名
|
||||
phone //患者电话
|
||||
ticket //对话票据
|
||||
* ]
|
||||
* author:wh
|
||||
*/
|
||||
function openChatRoomWriteRecord($client_id,$data){
|
||||
return Mmodel::catchJson(function () use ($client_id,$data){
|
||||
Tools::log_to_write_txt(['打开诊断窗口记录,入参'=>$data]);
|
||||
$action = 'Tychat/openChatRoomWriteRecord';
|
||||
if(empty($data['items'])){
|
||||
$json = Tools::wss_json_fail($action, 'items参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['doctor_name'])){
|
||||
$json = Tools::wss_json_fail($action, 'doctor_name参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['doctor_phone'])){
|
||||
$json = Tools::wss_json_fail($action, 'doctor_phone参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['name'])){
|
||||
$json = Tools::wss_json_fail($action, 'name 参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['phone'])){
|
||||
$json = Tools::wss_json_fail($action, 'phone 参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
if(empty($data['items']['ticket'])){
|
||||
$json = Tools::wss_json_fail($action, 'ticket 参数错误');
|
||||
return Gateway::sendToClient($client_id, $json);
|
||||
}
|
||||
$data = [
|
||||
'doctor_name'=>$data['items']['doctor_name'],
|
||||
'doctor_phone'=>$data['items']['doctor_phone'],
|
||||
'name'=>$data['items']['name'],
|
||||
'phone'=>$data['items']['phone'],
|
||||
'ticket'=>$data['items']['ticket'],
|
||||
];
|
||||
Db::table(TabConf::$fa_hdropen_chat_room_record)
|
||||
->insert($data);
|
||||
|
||||
//查询绑定的设备
|
||||
$device = Db::table(TabConf::$fa_device)
|
||||
->where('ticket',$data['items']['ticket'])
|
||||
->find();
|
||||
|
||||
$client_id_arr = array_column($device,'clientid');
|
||||
|
||||
//向客户端发消息
|
||||
$json = Tools::wss_json($action,'诊断医生已打开诊断窗口');
|
||||
Gateway::sendToAll($json, $client_id_arr, [$client_id]);//不向自己发送
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ class TyuserLogic extends BaseLogic
|
||||
'action'=>'Tyuser/bindRelation',
|
||||
'items'=>[
|
||||
'username'=>'13333322323',
|
||||
'say_ticket'=>'sadddddddddddddddddddddddddddd',
|
||||
'ticket'=>'sadddddddddddddddddddddddddddd',
|
||||
]
|
||||
]
|
||||
* author:wh
|
||||
@@ -87,7 +87,7 @@ class TyuserLogic extends BaseLogic
|
||||
->insert([
|
||||
'username'=>$items['username'],
|
||||
'clientid'=>$clientid,
|
||||
'say_ticket'=>$items['ticket'],//对话票据,根据票据分发消息
|
||||
'ticket'=>$items['ticket'],//对话票据,根据票据分发消息
|
||||
]);
|
||||
|
||||
return null;
|
||||
|
||||
@@ -5,12 +5,36 @@ namespace app\common\model;
|
||||
class TabConf
|
||||
{
|
||||
|
||||
/**
|
||||
* 登录设备(一个医生有多个病历,一个医生同时只有一个客户端)
|
||||
*/
|
||||
static $__fa_hdrdevice = '__fa_hdrdevice';
|
||||
|
||||
|
||||
/**
|
||||
* 医生账号信息
|
||||
*/
|
||||
static $__fa_hdrdoctor = '__fa_hdrdoctor';
|
||||
|
||||
|
||||
/**
|
||||
* 患者账号信息
|
||||
*/
|
||||
static $__fa_hdrusers = '__fa_hdrusers';
|
||||
|
||||
|
||||
/**
|
||||
* 智语医助-设备关联表
|
||||
*/
|
||||
static $__fa_healdevicerelation = '__fa_healdevicerelation';
|
||||
|
||||
|
||||
/**
|
||||
* 医生新消息
|
||||
*/
|
||||
static $__fa_message = '__fa_message';
|
||||
|
||||
|
||||
/**
|
||||
* 管理员表
|
||||
*/
|
||||
@@ -96,15 +120,15 @@ class TabConf
|
||||
|
||||
|
||||
/**
|
||||
* 登录设备(一个医生有多个病历,一个医生同时只有一个客户端)
|
||||
* 问诊报告存档(疼痛科、听译、h5问诊统一存放)(一个基本信息对应一个报告)
|
||||
*/
|
||||
static $fa_hdrdevice = 'fa_hdrdevice';
|
||||
static $fa_hdrmedical_report = 'fa_hdrmedical_report';
|
||||
|
||||
|
||||
/**
|
||||
* 医生账号信息
|
||||
* 打开对话窗口记录(同时向患者端发送当前对话患者信息)
|
||||
*/
|
||||
static $fa_hdrdoctor = 'fa_hdrdoctor';
|
||||
static $fa_hdropen_chat_room_record = 'fa_hdropen_chat_room_record';
|
||||
|
||||
|
||||
/**
|
||||
@@ -138,23 +162,11 @@ class TabConf
|
||||
|
||||
|
||||
/**
|
||||
* 听译-用户基本信息
|
||||
* 统一问诊用户基本信息
|
||||
*/
|
||||
static $fa_hdruserbaseinfo = 'fa_hdruserbaseinfo';
|
||||
|
||||
|
||||
/**
|
||||
* 患者账号信息
|
||||
*/
|
||||
static $fa_hdrusers = 'fa_hdrusers';
|
||||
|
||||
|
||||
/**
|
||||
* 医生新消息
|
||||
*/
|
||||
static $fa_message = 'fa_message';
|
||||
|
||||
|
||||
/**
|
||||
* 短信验证码表
|
||||
*/
|
||||
@@ -185,6 +197,12 @@ class TabConf
|
||||
static $fa_tt_followup = 'fa_tt_followup';
|
||||
|
||||
|
||||
/**
|
||||
* 疼痛科自由对话聊天历史
|
||||
*/
|
||||
static $fa_tt_free_chathistory = 'fa_tt_free_chathistory';
|
||||
|
||||
|
||||
/**
|
||||
* 疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)
|
||||
*/
|
||||
@@ -222,9 +240,9 @@ class TabConf
|
||||
|
||||
|
||||
/**
|
||||
* 听译-用户基本信息
|
||||
* 听译问诊-患者病历信息
|
||||
*/
|
||||
static $fa_ty_userbaseinfo = 'fa_ty_userbaseinfo';
|
||||
static $fa_ty_usermedicalrecord = 'fa_ty_usermedicalrecord';
|
||||
|
||||
|
||||
/**
|
||||
|
||||
2872
digital_doctor/application/data/sql/digital_doctor-数智人医生1.0封版.sql
Normal file
2872
digital_doctor/application/data/sql/digital_doctor-数智人医生1.0封版.sql
Normal file
File diff suppressed because one or more lines are too long
@@ -6,7 +6,243 @@
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div id="api_userstt_getUserById">
|
||||
<div id="api_h5userbaseinfo_addH5userbaseinfo">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* 新增h5问诊用户基本信息
|
||||
*
|
||||
* 参数:
|
||||
* doctor 所属医生
|
||||
* name 病人姓名
|
||||
* gender 病人性别
|
||||
* age 病人年龄
|
||||
* edu 教育程度
|
||||
* career_year 职业及年限
|
||||
* power 体力要求
|
||||
* satisfaction 经济满意度
|
||||
* old_career_year 过往职业及年限
|
||||
* support 社会支持度
|
||||
* marriage 婚姻状况
|
||||
* live 居住情况
|
||||
* home 家庭关系
|
||||
* address 地址
|
||||
* phone 联系方式
|
||||
* wechat_no 微信号
|
||||
* api/H5userbaseinfo/addH5userbaseinfo
|
||||
* api/h5userbaseinfo/addH5userbaseinfo
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_h5userbaseinfo_addH5userbaseinfo_textarea" cols="100" rows="3">/api/h5userbaseinfo/addH5userbaseinfo</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_h5userbaseinfo_addH5userbaseinfo()">测试</a>
|
||||
</div>
|
||||
<div class="api_h5userbaseinfo_addH5userbaseinfo_response_result"></div>
|
||||
|
||||
</div><div id="api_hdrquestionnaireanswer_getHdrquestionnaireanswerList">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取科室问卷答案
|
||||
*
|
||||
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*
|
||||
* 参数:
|
||||
* answer 问卷答案
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
* api/hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_textarea" cols="100" rows="3">/api/hdrquestionnaireanswer/getHdrquestionnaireanswerList</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_hdrquestionnaireanswer_getHdrquestionnaireanswerList()">测试</a>
|
||||
</div>
|
||||
<div class="api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_response_result"></div>
|
||||
|
||||
</div><div id="api_hdrquestionnairequestion_getHdrquestionnairequestionList">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取科室问卷问题(一个问题对应多个答案)
|
||||
*
|
||||
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*
|
||||
* 参数:
|
||||
* question 问卷问题
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
* api/hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_hdrquestionnairequestion_getHdrquestionnairequestionList_textarea" cols="100" rows="3">/api/hdrquestionnairequestion/getHdrquestionnairequestionList</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_hdrquestionnairequestion_getHdrquestionnairequestionList()">测试</a>
|
||||
</div>
|
||||
<div class="api_hdrquestionnairequestion_getHdrquestionnairequestionList_response_result"></div>
|
||||
|
||||
</div><div id="api_hdrregister_addHdrregister">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* 新增患者挂号列表(可重复挂号)
|
||||
*
|
||||
* 参数:
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* ticket 对话凭据(便于查询)
|
||||
* api/Hdrregister/addHdrregister
|
||||
* api/hdrregister/addHdrregister
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_hdrregister_addHdrregister_textarea" cols="100" rows="3">/api/hdrregister/addHdrregister</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_hdrregister_addHdrregister()">测试</a>
|
||||
</div>
|
||||
<div class="api_hdrregister_addHdrregister_response_result"></div>
|
||||
|
||||
</div><div id="api_hdrregister_getHdrregisterList">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取患者挂号列表(可重复挂号)
|
||||
*
|
||||
* api/Hdrregister/getHdrregisterList
|
||||
*
|
||||
* 参数:
|
||||
* name 患者姓名(可重复挂号)
|
||||
* phone 手机号
|
||||
* id ID
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* status 状态:0=挂号中,1=结束诊断
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* create_time 创建时间
|
||||
* status 状态:0=挂号中,1=结束诊断
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* ticket 对话凭据(便于查询)
|
||||
|
||||
* author:wh
|
||||
* api/hdrregister/getHdrregisterList
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_hdrregister_getHdrregisterList_textarea" cols="100" rows="3">/api/hdrregister/getHdrregisterList</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_hdrregister_getHdrregisterList()">测试</a>
|
||||
</div>
|
||||
<div class="api_hdrregister_getHdrregisterList_response_result"></div>
|
||||
|
||||
</div><div id="api_ttchathistory_getTtchathistoryList">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取数智人固定问答聊天历史
|
||||
*
|
||||
* api/Ttchathistory/getTtchathistoryList
|
||||
*
|
||||
* 参数:
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* username 聊天用户
|
||||
* relation 医生患者关系
|
||||
* chat_msg 问诊内容
|
||||
* create_time 创建时间
|
||||
|
||||
* author:wh
|
||||
* api/ttchathistory/getTtchathistoryList
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_ttchathistory_getTtchathistoryList_textarea" cols="100" rows="3">/api/ttchathistory/getTtchathistoryList</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_ttchathistory_getTtchathistoryList()">测试</a>
|
||||
</div>
|
||||
<div class="api_ttchathistory_getTtchathistoryList_response_result"></div>
|
||||
|
||||
</div><div id="api_userstt_getSayTicket">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取对话票据,隔离用户历史记录,每次诊断完,重新生成新的对话票据
|
||||
* (首次对话票据在登录时返回)
|
||||
* 参数:无
|
||||
*
|
||||
* api/Userstt/getSayTicket
|
||||
*
|
||||
* author:wh
|
||||
* api/userstt/getSayTicket
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_userstt_getSayTicket_textarea" cols="100" rows="3">/api/userstt/getSayTicket</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_userstt_getSayTicket()">测试</a>
|
||||
</div>
|
||||
<div class="api_userstt_getSayTicket_response_result"></div>
|
||||
|
||||
</div><div id="api_userstt_getUserById">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
@@ -108,6 +344,37 @@
|
||||
</div>
|
||||
<div class="api_userstt_editBaseinfo_response_result"></div>
|
||||
|
||||
</div><div id="api_userstt_subFreeQuestionAnswerRecord">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:提交自由问答记录(后台需要单独列出来,对话时前端缓存在本地,对话结束提交)
|
||||
*
|
||||
* 参数:
|
||||
* ticket 对话票据(结束问诊时重新生成)
|
||||
* username 用户名
|
||||
* content 对话内容,格式:
|
||||
* content = [
|
||||
["role" => "user", "content" => '1'],
|
||||
["role" => "user", "content" => '2'],
|
||||
["role" => "user", "content" => '3'],
|
||||
];
|
||||
*
|
||||
* api/Userstt/subFreeQuestionAnswerRecord
|
||||
*
|
||||
* author:wh
|
||||
* api/userstt/subFreeQuestionAnswerRecord
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_userstt_subFreeQuestionAnswerRecord_textarea" cols="100" rows="3">/api/userstt/subFreeQuestionAnswerRecord</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_userstt_subFreeQuestionAnswerRecord()">测试</a>
|
||||
</div>
|
||||
<div class="api_userstt_subFreeQuestionAnswerRecord_response_result"></div>
|
||||
|
||||
</div><div id="api_usersty_login">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
@@ -133,29 +400,6 @@
|
||||
</div>
|
||||
<div class="api_usersty_login_response_result"></div>
|
||||
|
||||
</div><div id="api_usersty_bindDevice">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc: 绑定设备(选择角色时调用)
|
||||
*
|
||||
* api/Usersty/bindDevice
|
||||
*
|
||||
* 参数:username
|
||||
* clientid
|
||||
* type 用户类型:user=用户,doc=医生
|
||||
* api/usersty/bindDevice
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_usersty_bindDevice_textarea" cols="100" rows="3">/api/usersty/bindDevice</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_usersty_bindDevice()">测试</a>
|
||||
</div>
|
||||
<div class="api_usersty_bindDevice_response_result"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
@@ -174,7 +418,49 @@
|
||||
$(ele).html(marked.parse($(ele).html()));
|
||||
});
|
||||
},
|
||||
api_userstt_getUserById(){
|
||||
api_h5userbaseinfo_addH5userbaseinfo(){
|
||||
let url = $('#api_h5userbaseinfo_addH5userbaseinfo_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_h5userbaseinfo_addH5userbaseinfo_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_h5userbaseinfo_addH5userbaseinfo_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_hdrquestionnaireanswer_getHdrquestionnaireanswerList(){
|
||||
let url = $('#api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_hdrquestionnairequestion_getHdrquestionnairequestionList(){
|
||||
let url = $('#api_hdrquestionnairequestion_getHdrquestionnairequestionList_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_hdrquestionnairequestion_getHdrquestionnairequestionList_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_hdrquestionnairequestion_getHdrquestionnairequestionList_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_hdrregister_addHdrregister(){
|
||||
let url = $('#api_hdrregister_addHdrregister_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_hdrregister_addHdrregister_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_hdrregister_addHdrregister_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_hdrregister_getHdrregisterList(){
|
||||
let url = $('#api_hdrregister_getHdrregisterList_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_hdrregister_getHdrregisterList_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_hdrregister_getHdrregisterList_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_ttchathistory_getTtchathistoryList(){
|
||||
let url = $('#api_ttchathistory_getTtchathistoryList_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_ttchathistory_getTtchathistoryList_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_ttchathistory_getTtchathistoryList_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_userstt_getSayTicket(){
|
||||
let url = $('#api_userstt_getSayTicket_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_userstt_getSayTicket_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_userstt_getSayTicket_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_userstt_getUserById(){
|
||||
let url = $('#api_userstt_getUserById_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_userstt_getUserById_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
@@ -198,18 +484,18 @@
|
||||
$('.api_userstt_editBaseinfo_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_userstt_editBaseinfo_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_userstt_subFreeQuestionAnswerRecord(){
|
||||
let url = $('#api_userstt_subFreeQuestionAnswerRecord_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_userstt_subFreeQuestionAnswerRecord_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_userstt_subFreeQuestionAnswerRecord_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_usersty_login(){
|
||||
let url = $('#api_usersty_login_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_usersty_login_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_usersty_login_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_usersty_bindDevice(){
|
||||
let url = $('#api_usersty_bindDevice_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_usersty_bindDevice_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_usersty_bindDevice_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,179 @@
|
||||
##### 请求域名:http://127.0.0.1:8080/
|
||||
##### 请求方式:POST(默认)
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* 新增h5问诊用户基本信息
|
||||
*
|
||||
* 参数:
|
||||
* doctor 所属医生
|
||||
* name 病人姓名
|
||||
* gender 病人性别
|
||||
* age 病人年龄
|
||||
* edu 教育程度
|
||||
* career_year 职业及年限
|
||||
* power 体力要求
|
||||
* satisfaction 经济满意度
|
||||
* old_career_year 过往职业及年限
|
||||
* support 社会支持度
|
||||
* marriage 婚姻状况
|
||||
* live 居住情况
|
||||
* home 家庭关系
|
||||
* address 地址
|
||||
* phone 联系方式
|
||||
* wechat_no 微信号
|
||||
* api/H5userbaseinfo/addH5userbaseinfo
|
||||
* api/h5userbaseinfo/addH5userbaseinfo
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取科室问卷答案
|
||||
*
|
||||
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*
|
||||
* 参数:
|
||||
* answer 问卷答案
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
* api/hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取科室问卷问题(一个问题对应多个答案)
|
||||
*
|
||||
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*
|
||||
* 参数:
|
||||
* question 问卷问题
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
* author:wh
|
||||
* api/hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* 新增患者挂号列表(可重复挂号)
|
||||
*
|
||||
* 参数:
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* ticket 对话凭据(便于查询)
|
||||
* api/Hdrregister/addHdrregister
|
||||
* api/hdrregister/addHdrregister
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取患者挂号列表(可重复挂号)
|
||||
*
|
||||
* api/Hdrregister/getHdrregisterList
|
||||
*
|
||||
* 参数:
|
||||
* name 患者姓名(可重复挂号)
|
||||
* phone 手机号
|
||||
* id ID
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* status 状态:0=挂号中,1=结束诊断
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* date 挂号日期
|
||||
* name 患者姓名(可重复挂号)
|
||||
* doctor_name 医生名称
|
||||
* age 病人年龄
|
||||
* gender 病人性别
|
||||
* phone 手机号
|
||||
* create_time 创建时间
|
||||
* status 状态:0=挂号中,1=结束诊断
|
||||
* qa_type 问答类型(患者定):1=自由问答,2=固定问答,3=健康问答
|
||||
* ticket 对话凭据(便于查询)
|
||||
|
||||
* author:wh
|
||||
* api/hdrregister/getHdrregisterList
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取数智人固定问答聊天历史
|
||||
*
|
||||
* api/Ttchathistory/getTtchathistoryList
|
||||
*
|
||||
* 参数:
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* username 聊天用户
|
||||
* relation 医生患者关系
|
||||
* chat_msg 问诊内容
|
||||
* create_time 创建时间
|
||||
|
||||
* author:wh
|
||||
* api/ttchathistory/getTtchathistoryList
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取对话票据,隔离用户历史记录,每次诊断完,重新生成新的对话票据
|
||||
* (首次对话票据在登录时返回)
|
||||
* 参数:无
|
||||
*
|
||||
* api/Userstt/getSayTicket
|
||||
*
|
||||
* author:wh
|
||||
* api/userstt/getSayTicket
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
@@ -70,6 +243,28 @@
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:提交自由问答记录(后台需要单独列出来,对话时前端缓存在本地,对话结束提交)
|
||||
*
|
||||
* 参数:
|
||||
* ticket 对话票据(结束问诊时重新生成)
|
||||
* username 用户名
|
||||
* content 对话内容,格式:
|
||||
* content = [
|
||||
["role" => "user", "content" => '1'],
|
||||
["role" => "user", "content" => '2'],
|
||||
["role" => "user", "content" => '3'],
|
||||
];
|
||||
*
|
||||
* api/Userstt/subFreeQuestionAnswerRecord
|
||||
*
|
||||
* author:wh
|
||||
* api/userstt/subFreeQuestionAnswerRecord
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
@@ -85,17 +280,3 @@
|
||||
* api/usersty/login
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc: 绑定设备(选择角色时调用)
|
||||
*
|
||||
* api/Usersty/bindDevice
|
||||
*
|
||||
* 参数:username
|
||||
* clientid
|
||||
* type 用户类型:user=用户,doc=医生
|
||||
* api/usersty/bindDevice
|
||||
*/
|
||||
```
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 科室问卷答案
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Hdrquestionnaireanswer extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* Hdrquestionnaireanswer模型对象
|
||||
* @var \app\admin\model\Hdrquestionnaireanswer
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\Hdrquestionnaireanswer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
|
||||
/**
|
||||
* 科室问卷问题(一个问题对应多个答案)
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class Hdrquestionnairequestion extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* Hdrquestionnairequestion模型对象
|
||||
* @var \app\admin\model\Hdrquestionnairequestion
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\Hdrquestionnairequestion;
|
||||
$this->view->assign("fitSexList", $this->model->getFitSexList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
@@ -93,7 +93,7 @@ class Followup extends Backend
|
||||
$report_dataid = input('report_dataid');
|
||||
$report = Db::table('fa_ty_medical_report')->where('id',$report_dataid)->find();
|
||||
|
||||
$userbaseinfo = Db::table('fa_ty_userbaseinfo')->where('id',$report['id'])->find();
|
||||
$userbaseinfo = Db::table('fa_ty_usermedicalrecord')->where('id',$report['id'])->find();
|
||||
$this->assign('user',$userbaseinfo);
|
||||
$html = view('add')->getContent();
|
||||
return json(Tools::set_ok('ok',$html));
|
||||
@@ -110,7 +110,7 @@ class Followup extends Backend
|
||||
}
|
||||
$report = Db::table('fa_ty_medical_report')->where('id',$report_dataid)->find();
|
||||
|
||||
$userbase = Db::table('fa_ty_userbaseinfo')
|
||||
$userbase = Db::table('fa_ty_usermedicalrecord')
|
||||
->where('id',$report['userbaseid'])
|
||||
->find();
|
||||
if(empty($userbase)){
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Hdrquestionnairequestion_id' => '问卷问题ID',
|
||||
'Answer' => '问卷答案',
|
||||
'Create_time' => '创建时间',
|
||||
'Update_time' => '更新时间'
|
||||
];
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'Id' => 'ID',
|
||||
'Hdrdepartment_id' => '所属科室',
|
||||
'Question' => '问卷问题',
|
||||
'Fit_sex' => '适合对象',
|
||||
'Fit_sex all' => '全部',
|
||||
'Fit_sex gg' => '男',
|
||||
'Fit_sex mm' => '女',
|
||||
'Create_time' => '创建时间',
|
||||
'Update_time' => '更新时间'
|
||||
];
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Hdrquestionnaireanswer extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'hdrquestionnaireanswer';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Hdrquestionnairequestion extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'hdrquestionnairequestion';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = false;
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = false;
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'fit_sex_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getFitSexList()
|
||||
{
|
||||
return ['all' => __('Fit_sex all'), 'gg' => __('Fit_sex gg'), 'mm' => __('Fit_sex mm')];
|
||||
}
|
||||
|
||||
|
||||
public function getFitSexTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['fit_sex']) ? $data['fit_sex'] : '');
|
||||
$list = $this->getFitSexList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Hdrquestionnaireanswer extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class Hdrquestionnairequestion extends Validate
|
||||
{
|
||||
/**
|
||||
* 验证规则
|
||||
*/
|
||||
protected $rule = [
|
||||
];
|
||||
/**
|
||||
* 提示消息
|
||||
*/
|
||||
protected $message = [
|
||||
];
|
||||
/**
|
||||
* 验证场景
|
||||
*/
|
||||
protected $scene = [
|
||||
'add' => [],
|
||||
'edit' => [],
|
||||
];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Hdrquestionnairequestion_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-hdrquestionnairequestion_id" data-rule="required" min="0" data-source="hdrquestionnairequestion/index" class="form-control selectpage" name="row[hdrquestionnairequestion_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Answer')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-answer" data-rule="required" class="form-control" name="row[answer]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,33 @@
|
||||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Hdrquestionnairequestion_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-hdrquestionnairequestion_id" data-rule="required" min="0" data-source="hdrquestionnairequestion/index" class="form-control selectpage" name="row[hdrquestionnairequestion_id]" type="text" value="{$row.hdrquestionnairequestion_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Answer')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-answer" data-rule="required" class="form-control" name="row[answer]" type="text" value="{$row.answer|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,29 @@
|
||||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading()}
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('hdrquestionnaireanswer/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('hdrquestionnaireanswer/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('hdrquestionnaireanswer/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('hdrquestionnaireanswer/edit')}"
|
||||
data-operate-del="{:$auth->check('hdrquestionnaireanswer/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,45 @@
|
||||
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Hdrdepartment_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-hdrdepartment_id" data-rule="required" min="0" data-source="hdrdepartment/index" class="form-control selectpage" name="row[hdrdepartment_id]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Question')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-question" data-rule="required" class="form-control" name="row[question]" type="text" value="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Fit_sex')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-fit_sex" data-rule="required" class="form-control selectpicker" name="row[fit_sex]">
|
||||
{foreach name="fitSexList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="all"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,45 @@
|
||||
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Hdrdepartment_id')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-hdrdepartment_id" data-rule="required" min="0" data-source="hdrdepartment/index" class="form-control selectpage" name="row[hdrdepartment_id]" type="text" value="{$row.hdrdepartment_id|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Question')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-question" data-rule="required" class="form-control" name="row[question]" type="text" value="{$row.question|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Fit_sex')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
|
||||
<select id="c-fit_sex" data-rule="required" class="form-control selectpicker" name="row[fit_sex]">
|
||||
{foreach name="fitSexList" item="vo"}
|
||||
<option value="{$key}" {in name="key" value="$row.fit_sex"}selected{/in}>{$vo}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-create_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[create_time]" type="text" value="{:$row.create_time?datetime($row.create_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Update_time')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-update_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[update_time]" type="text" value="{:$row.update_time?datetime($row.update_time):''}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group layer-footer">
|
||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,29 @@
|
||||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading()}
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('hdrquestionnairequestion/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('hdrquestionnairequestion/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('hdrquestionnairequestion/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
data-operate-edit="{:$auth->check('hdrquestionnairequestion/edit')}"
|
||||
data-operate-del="{:$auth->check('hdrquestionnairequestion/del')}"
|
||||
width="100%">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,54 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'hdrquestionnaireanswer/index' + location.search,
|
||||
add_url: 'hdrquestionnaireanswer/add',
|
||||
edit_url: 'hdrquestionnaireanswer/edit',
|
||||
del_url: 'hdrquestionnaireanswer/del',
|
||||
multi_url: 'hdrquestionnaireanswer/multi',
|
||||
import_url: 'hdrquestionnaireanswer/import',
|
||||
table: 'hdrquestionnaireanswer',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'hdrquestionnairequestion_id', title: __('Hdrquestionnairequestion_id')},
|
||||
{field: 'answer', title: __('Answer'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
@@ -0,0 +1,55 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'hdrquestionnairequestion/index' + location.search,
|
||||
add_url: 'hdrquestionnairequestion/add',
|
||||
edit_url: 'hdrquestionnairequestion/edit',
|
||||
del_url: 'hdrquestionnairequestion/del',
|
||||
multi_url: 'hdrquestionnairequestion/multi',
|
||||
import_url: 'hdrquestionnairequestion/import',
|
||||
table: 'hdrquestionnairequestion',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'hdrdepartment_id', title: __('Hdrdepartment_id')},
|
||||
{field: 'question', title: __('Question'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'fit_sex', title: __('Fit_sex'), searchList: {"all":__('Fit_sex all'),"gg":__('Fit_sex gg'),"mm":__('Fit_sex mm')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
Reference in New Issue
Block a user