Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵增煜
/
tzt-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3482042e
authored
Apr 23, 2025
by
赵增煜
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'local-0409' into develop
parents
c0062902
15ad825e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
13 deletions
+48
-13
app/Admin/Controllers/MedicalController.php
+3
-1
app/Console/Commands/CmPrescription.php
+10
-4
app/Console/Commands/Medical.php
+21
-4
app/Console/Commands/WmPrescription.php
+13
-4
database/migrations/2025_04_09_172924_create_medical_table.php
+1
-0
No files found.
app/Admin/Controllers/MedicalController.php
View file @
3482042e
...
...
@@ -106,7 +106,8 @@ protected function grid()
$grid
->
column
(
'doctCaSign'
);
$grid
->
column
(
'originalData'
);
$grid
->
column
(
'certificate'
);
$grid
->
column
(
'reviewUrl'
)
->
width
(
3
);
# $grid->column('reviewUrl')->width(3);
$grid
->
column
(
'textRecords'
)
->
width
(
3
);
$grid
->
column
(
'firstVisitRecord'
)
->
width
(
3
);
$grid
->
column
(
'created_at'
);
$grid
->
column
(
'updated_at'
)
->
sortable
();
...
...
@@ -142,6 +143,7 @@ protected function grid()
'visitTimeStart'
=>
'就诊开始时间'
,
'visitTimeEnd'
=>
'诊断结束时间'
,
'reviewUrl'
=>
'诊疗过程调阅地址'
,
'textRecords'
=>
'诊疗过程数据'
,
'firstVisitRecord'
=>
'线下初诊记录'
,
];
$grid
->
export
(
$titles
)
->
filename
(
"问诊信息"
)
->
rows
(
function
(
$rows
){
...
...
app/Console/Commands/CmPrescription.php
View file @
3482042e
...
...
@@ -32,11 +32,17 @@ public function handle()
{
$this
->
info
(
'处方信息(中药)同步开始...'
);
$timestamp_str
=
$this
->
argument
(
'timestamp_str'
)
??
''
;
// 如果 timestamp_str 为空,则
获取当月的起始时间戳(精确到毫秒)
// 如果 timestamp_str 为空,则
判断是否是当月第一天,决定取哪个月的第一天
if
(
empty
(
$timestamp_str
))
{
// 获取当前月份的第一天
$startOfMonth
=
Carbon
::
now
()
->
startOfMonth
();
// 转换为时间戳(秒级),然后乘以 1000 转换为毫秒
$now
=
Carbon
::
now
();
if
(
$now
->
isSameDay
(
$now
->
copy
()
->
startOfMonth
()))
{
// 当前是当月第一天,获取上一个月的第一天
$startOfMonth
=
$now
->
subMonth
()
->
startOfMonth
();
}
else
{
// 当前不是当月第一天,获取当前月的第一天
$startOfMonth
=
$now
->
startOfMonth
();
}
// 转换为毫秒时间戳
$timestamp_str
=
$startOfMonth
->
timestamp
*
1000
;
}
// 计算结束时间:基于 timestamp_str 加上 30 天
...
...
app/Console/Commands/Medical.php
View file @
3482042e
...
...
@@ -32,11 +32,17 @@ public function handle()
{
$this
->
info
(
'问诊同步开始...'
);
$timestamp_str
=
$this
->
argument
(
'timestamp_str'
)
??
''
;
// 如果 timestamp_str 为空,则
获取当月的起始时间戳(精确到毫秒)
// 如果 timestamp_str 为空,则
判断是否是当月第一天,决定取哪个月的第一天
if
(
empty
(
$timestamp_str
))
{
// 获取当前月份的第一天
$startOfMonth
=
Carbon
::
now
()
->
startOfMonth
();
// 转换为时间戳(秒级),然后乘以 1000 转换为毫秒
$now
=
Carbon
::
now
();
if
(
$now
->
isSameDay
(
$now
->
copy
()
->
startOfMonth
()))
{
// 当前是当月第一天,获取上一个月的第一天
$startOfMonth
=
$now
->
subMonth
()
->
startOfMonth
();
}
else
{
// 当前不是当月第一天,获取当前月的第一天
$startOfMonth
=
$now
->
startOfMonth
();
}
// 转换为毫秒时间戳
$timestamp_str
=
$startOfMonth
->
timestamp
*
1000
;
}
// 计算结束时间:基于 timestamp_str 加上 30 天
...
...
@@ -75,6 +81,8 @@ public function handle()
}
# 处理数据存入到数据库,如果存在就更新否则就新增
foreach
(
$response_data
as
$item
)
{
// $this->info('问诊====>:'. json_encode($item));
// break;
$medical
=
MedicalModel
::
where
(
'visitNo'
,
$item
[
'visitNo'
])
->
first
();
if
(
$medical
){
$this
->
info
(
'更新问诊:'
.
$item
[
'visitNo'
]);
...
...
@@ -148,6 +156,11 @@ public function handle()
if
(
isset
(
$item
[
'firstVisitRecord'
]))
{
$medical
->
firstVisitRecord
=
json_encode
(
$item
[
'firstVisitRecord'
],
JSON_UNESCAPED_UNICODE
);
// 线上复诊的线下初诊记录信息
}
if
(
isset
(
$item
[
'textRecords'
]))
{
$medical
->
textRecords
=
json_encode
(
$item
[
'textRecords'
],
JSON_UNESCAPED_UNICODE
);
}
$medical
->
updated_at
=
Carbon
::
now
();
// 保存数据
$medical
->
save
();
...
...
@@ -225,6 +238,10 @@ public function handle()
if
(
isset
(
$item
[
'firstVisitRecord'
]))
{
$medical
->
firstVisitRecord
=
json_encode
(
$item
[
'firstVisitRecord'
],
JSON_UNESCAPED_UNICODE
);
// 线上复诊的线下初诊记录信息
}
if
(
isset
(
$item
[
'textRecords'
]))
{
$medical
->
textRecords
=
json_encode
(
$item
[
'textRecords'
],
JSON_UNESCAPED_UNICODE
);
}
// 保存数据
$medical
->
save
();
...
...
app/Console/Commands/WmPrescription.php
View file @
3482042e
...
...
@@ -31,11 +31,17 @@ public function handle()
{
$this
->
info
(
'处方信息(西药)同步开始...'
);
$timestamp_str
=
$this
->
argument
(
'timestamp_str'
)
??
''
;
// 如果 timestamp_str 为空,则
获取当月的起始时间戳(精确到毫秒)
// 如果 timestamp_str 为空,则
判断是否是当月第一天,决定取哪个月的第一天
if
(
empty
(
$timestamp_str
))
{
// 获取当前月份的第一天
$startOfMonth
=
Carbon
::
now
()
->
startOfMonth
();
// 转换为时间戳(秒级),然后乘以 1000 转换为毫秒
$now
=
Carbon
::
now
();
if
(
$now
->
isSameDay
(
$now
->
copy
()
->
startOfMonth
()))
{
// 当前是当月第一天,获取上一个月的第一天
$startOfMonth
=
$now
->
subMonth
()
->
startOfMonth
();
}
else
{
// 当前不是当月第一天,获取当前月的第一天
$startOfMonth
=
$now
->
startOfMonth
();
}
// 转换为毫秒时间戳
$timestamp_str
=
$startOfMonth
->
timestamp
*
1000
;
}
// 计算结束时间:基于 timestamp_str 加上 30 天
...
...
@@ -75,6 +81,9 @@ public function handle()
}
# 处理数据存入到数据库,如果存在就更新否则就新增
foreach
(
$response_data
as
$item
)
{
if
(
$item
[
'hosRxCode'
]
==
'P17453092169362RG'
){
}
$prescription
=
ExternalWmPrescriptionModel
::
where
(
'hosRxCode'
,
$item
[
'hosRxCode'
])
->
first
();
if
(
$prescription
){
$this
->
info
(
'更新处方(西药):'
.
$item
[
'hosRxCode'
]);
...
...
database/migrations/2025_04_09_172924_create_medical_table.php
View file @
3482042e
...
...
@@ -55,6 +55,7 @@ public function up()
$table
->
longText
(
'originalData'
)
->
comment
(
'数据原文'
);
$table
->
longText
(
'certificate'
)
->
comment
(
'数字证书'
);
$table
->
text
(
'reviewUrl'
)
->
comment
(
'诊疗过程调阅地址'
);
$table
->
longText
(
'textRecords'
)
->
comment
(
'诊疗过程数据'
);
$table
->
longText
(
'firstVisitRecord'
)
->
comment
(
'线下初诊记录'
);
$table
->
timestamps
();
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment