Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yuyiAdminServer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
node_server
yuyiAdminServer
Commits
3fd93875
Commit
3fd93875
authored
May 28, 2025
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
70b7d73d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
25 deletions
+4
-25
qccInit.ts
src/biz/qccInit.ts
+0
-0
dataInterfaceWithCache.ts
src/data/dataInterfaceWithCache.ts
+3
-24
main.ts
src/main.ts
+1
-1
No files found.
src/biz/qccInit.ts
View file @
3fd93875
This diff is collapsed.
Click to expand it.
src/data/dataInterfaceWithCache.ts
View file @
3fd93875
import
{
awaitData
}
from
"../biz/dataInit"
;
import
{
OPERATIONALDATATYPE
,
TABLENAME
}
from
"../config/enum/dbEnum"
;
import
{
selectData
}
from
"./operationalData"
;
import
{
updateQCCDataTask
}
from
"../biz/qccInit"
;
// 初始化数据文件结构
async
function
initDataFile
()
{
let
enterpriseList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
企业基础信息表
,
{},
[
"eId"
,
"uscc"
,
"enterpriseName"
]);
let
currentData
=
{};
let
usccData
=
await
awaitData
(
"91310115MADM8EA654"
);
currentData
[
"91310115MADM8EA654"
]
=
usccData
;
for
(
let
i
=
0
;
i
<
enterpriseList
.
length
;
i
++
)
{
let
info
=
enterpriseList
[
i
];
console
.
log
(
"开始同步企查查数据"
);
let
usccData
=
await
awaitData
(
info
.
uscc
);
currentData
[
info
.
uscc
]
=
usccData
;
console
.
log
(
`
${
info
.
enterpriseName
}
同步成功, eId:
${
info
.
eId
}
,下标
${
i
}
`
);
}
console
.
log
(
"刷新缓存数据结束"
)
}
/**
/**
...
@@ -28,9 +7,9 @@ async function initDataFile() {
...
@@ -28,9 +7,9 @@ async function initDataFile() {
* 设置定时器,每天刷新一次数据
* 设置定时器,每天刷新一次数据
*/
*/
export
async
function
initApiDataStorage
()
{
export
async
function
initApiDataStorage
()
{
await
initDataFile
();
await
updateQCCDataTask
();
setInterval
(
async
function
()
{
setInterval
(
async
function
()
{
await
initDataFile
();
await
updateQCCDataTask
();
},
3600
*
1000
*
24
);
},
3600
*
1000
*
24
);
}
}
...
...
src/main.ts
View file @
3fd93875
...
@@ -9,7 +9,7 @@ async function lanuch() {
...
@@ -9,7 +9,7 @@ async function lanuch() {
httpServer
.
createServer
(
systemConfig
.
port
);
httpServer
.
createServer
(
systemConfig
.
port
);
console
.
log
(
'This indicates that the server is started successfully.'
);
console
.
log
(
'This indicates that the server is started successfully.'
);
//
await initApiDataStorage();
await
initApiDataStorage
();
}
}
...
...
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