This commit is contained in:
2024-08-08 11:15:12 +08:00
parent bb66733294
commit 2e50374c64
4 changed files with 273 additions and 70 deletions

View File

@@ -1,72 +1,179 @@
<?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 Ttmedicalreport extends BaseHttpApi
{
protected $controller_comments = '疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)';
/**
* desc获取疼痛科病历报告一个基本信息对应一个报告
*
* api/Ttmedicalreport/getTtmedicalreportDetail
*
<?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 Ttmedicalreport extends BaseHttpApi
{
protected $controller_comments = '疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)';
/**
* desc获取疼痛科病历报告一个基本信息对应一个报告
*
* api/Ttmedicalreport/getTtmedicalreportDetail
*
* 参数:
* hdruserbaseinfo_id 统一基本信息 统一基本信息 必须
*
* hdruserbaseinfo_id 统一基本信息 统一基本信息 必须
*
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID
* userbaseid 基本信息ID
* doctor 所属医生
* username 病人
* report_content 报告内容
* name 病人姓名
* phone 病人电话
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
* create_time 生成时间
* ticket 对话票据(数据隔离)
* hdruserbaseinfo_id 统一基本信息
* authorwh
*/
function getTtmedicalreportDetail(){
Tools::log_to_write_txt(['获取疼痛科病历报告(一个基本信息对应一个报告) 入参:'=>input()]);
$api_desc = '获取疼痛科病历报告(一个基本信息对应一个报告)';
try {
$hdruserbaseinfo_id = input('hdruserbaseinfo_id');
if(empty($hdruserbaseinfo_id)){
return json(Tools::set_fail('hdruserbaseinfo_id参数错误'));
}
$model_obj = Db::table(TabConf::$fa_tt_medical_report);
if(input('hdruserbaseinfo_id')){
$model_obj->where('hdruserbaseinfo_id',input('hdruserbaseinfo_id'));
}
$item = $model_obj->find();
$data = $item;
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,'操作异常',[]));
}
}
* id ID
* userbaseid 基本信息ID
* doctor 所属医生
* username 病人
* report_content 报告内容
* name 病人姓名
* phone 病人电话
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
* create_time 生成时间
* ticket 对话票据(数据隔离)
* hdruserbaseinfo_id 统一基本信息
* authorwh
*/
function getTtmedicalreportDetail(){
Tools::log_to_write_txt(['获取疼痛科病历报告(一个基本信息对应一个报告) 入参:'=>input()]);
$api_desc = '获取疼痛科病历报告(一个基本信息对应一个报告)';
try {
$hdruserbaseinfo_id = input('hdruserbaseinfo_id');
if(empty($hdruserbaseinfo_id)){
return json(Tools::set_fail('hdruserbaseinfo_id参数错误'));
}
$model_obj = Db::table(TabConf::$fa_tt_medical_report);
if(input('hdruserbaseinfo_id')){
$model_obj->where('hdruserbaseinfo_id',input('hdruserbaseinfo_id'));
}
$item = $model_obj->find();
$data = $item;
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,'操作异常',[]));
}
}
/**
* desc获取疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)
*
* api/Ttmedicalreport/getTtmedicalreportList
*
* 参数:
* 带分页
* current_page 当前页码
* list_rows 每页显示条数 默认15
* userbaseid 基本信息ID
* doctor 所属医生
* username 病人
* report_content 报告内容
* name 病人姓名
* phone 病人电话
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
* hdruserbaseinfo_id 统一基本信息
* hdrdepartment_id 科室
*
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID
* userbaseid 基本信息ID
* doctor 所属医生
* username 病人
* report_content 报告内容
* name 病人姓名
* phone 病人电话
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
* create_time 生成时间
* ticket 对话票据(数据隔离)
* hdruserbaseinfo_id 统一基本信息
* hdrdepartment_id 科室
* authorwh
*/
function getTtmedicalreportList(){
Tools::log_to_write_txt(['获取疼痛科病历报告(听译问诊)(一个基本信息对应一个报告) 入参:'=>input()]);
$api_desc = '获取疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)';
try {
$userbaseid = input('userbaseid');
$doctor = input('doctor');
$username = input('username');
$report_content = input('report_content');
$name = input('name');
$phone = input('phone');
$from = input('from');
$hdruserbaseinfo_id = input('hdruserbaseinfo_id');
$hdrdepartment_id = input('hdrdepartment_id');
$model_obj = Db::table(TabConf::$fa_tt_medical_report);
if(input('userbaseid')){
$model_obj->where('userbaseid',input('userbaseid'));
}
if(input('doctor')){
$model_obj->where('doctor',input('doctor'));
}
if(input('username')){
$model_obj->where('username',input('username'));
}
if(input('report_content')){
$model_obj->where('report_content',input('report_content'));
}
if(input('name')){
$model_obj->where('name',input('name'));
}
if(input('phone')){
$model_obj->where('phone',input('phone'));
}
if(input('from')){
$model_obj->where('from',input('from'));
}
if(input('hdruserbaseinfo_id')){
$model_obj->where('hdruserbaseinfo_id',input('hdruserbaseinfo_id'));
}
if(input('hdrdepartment_id')){
$model_obj->where('hdrdepartment_id',input('hdrdepartment_id'));
}
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
->each(function($item, $key){
return $item;
});
// ['total'] => int(30)
// ['per_page'] => int(15)
// ['current_page'] => int(1)
// ['last_page''] => int(2)
$data = $data->toArray();//包含 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,'操作异常',[]));
}
}

View File

@@ -959,6 +959,55 @@
</div>
<div class="api_ttmedicalreport_getTtmedicalreportDetail_response_result"></div>
</div><div id="api_ttmedicalreport_getTtmedicalreportList" style="background-color: #f0ffff;">
<div class="markdown_content">
***
```
/**
* desc获取疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)
*
* api/Ttmedicalreport/getTtmedicalreportList
*
* 参数:
* 带分页
* current_page 当前页码
* list_rows 每页显示条数 默认15
* userbaseid 基本信息ID
* doctor 所属医生
* username 病人
* report_content 报告内容
* name 病人姓名
* phone 病人电话
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
* hdruserbaseinfo_id 统一基本信息
* hdrdepartment_id 科室
*
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID
* userbaseid 基本信息ID
* doctor 所属医生
* username 病人
* report_content 报告内容
* name 病人姓名
* phone 病人电话
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
* create_time 生成时间
* ticket 对话票据(数据隔离)
* hdruserbaseinfo_id 统一基本信息
* hdrdepartment_id 科室
* authorwh
* api/ttmedicalreport/getTtmedicalreportList
*/
```
</div>
<div>
按需填写其它接口参数:
<textarea name="" id="api_ttmedicalreport_getTtmedicalreportList_textarea" cols="100" rows="3">/api/ttmedicalreport/getTtmedicalreportList</textarea>
<a href='JavaScript:;' onclick="DocObject.api_ttmedicalreport_getTtmedicalreportList()">测试</a>
</div>
<div class="api_ttmedicalreport_getTtmedicalreportList_response_result"></div>
</div><div id="api_ttuserbaseinfo_getTtuserbaseinfoDetail" style="background-color: #ffe4e1;margin-top: 50px;">
<div class="markdown_content">
***
@@ -1500,6 +1549,12 @@
$('.api_ttmedicalreport_getTtmedicalreportDetail_response_result').html(JSON.stringify(res, null, "\t"));
$('.api_ttmedicalreport_getTtmedicalreportDetail_response_result').attr('style','color:green');
},'json');
}, api_ttmedicalreport_getTtmedicalreportList(){
let url = $('#api_ttmedicalreport_getTtmedicalreportList_textarea').val();
$.post(url,{},function(res) {
$('.api_ttmedicalreport_getTtmedicalreportList_response_result').html(JSON.stringify(res, null, "\t"));
$('.api_ttmedicalreport_getTtmedicalreportList_response_result').attr('style','color:green');
},'json');
}, api_ttuserbaseinfo_getTtuserbaseinfoDetail(){
let url = $('#api_ttuserbaseinfo_getTtuserbaseinfoDetail_textarea').val();
$.post(url,{},function(res) {

View File

@@ -678,6 +678,46 @@
*/
```
***
```
/**
* desc获取疼痛科病历报告(听译问诊)(一个基本信息对应一个报告)
*
* api/Ttmedicalreport/getTtmedicalreportList
*
* 参数:
* 带分页
* current_page 当前页码
* list_rows 每页显示条数 默认15
* userbaseid 基本信息ID
* doctor 所属医生
* username 病人
* report_content 报告内容
* name 病人姓名
* phone 病人电话
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
* hdruserbaseinfo_id 统一基本信息
* hdrdepartment_id 科室
*
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>
* id ID
* userbaseid 基本信息ID
* doctor 所属医生
* username 病人
* report_content 报告内容
* name 病人姓名
* phone 病人电话
* from 来源:num_per=数智人,ty=听译助手,h5=h5网页问诊
* create_time 生成时间
* ticket 对话票据(数据隔离)
* hdruserbaseinfo_id 统一基本信息
* hdrdepartment_id 科室
* authorwh
* api/ttmedicalreport/getTtmedicalreportList
*/
```
***
```
/**

View File

@@ -204,7 +204,8 @@ EOF;
$htm_str = "";
$script_str = "";
foreach ($api_doc_cache_arr as $class_name_key=>$func_arr){
$color_code = $color_code_arr[strlen($class_name_key)-1];
//随机取一个颜色
$color_code = $color_code_arr[array_rand($color_code_arr,1)];
//是否显示上边距
$is_show_margin_top = 'margin-top: 50px;';
foreach ($func_arr as $k => $item){