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
eeb50188
Commit
eeb50188
authored
May 17, 2025
by
chenjinjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
a8ff5ccb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
fuhua.ts
src/biz/fuhua.ts
+12
-4
No files found.
src/biz/fuhua.ts
View file @
eeb50188
...
@@ -387,6 +387,7 @@ export async function getRiskData() {
...
@@ -387,6 +387,7 @@ export async function getRiskData() {
value
:
0
value
:
0
},
},
];
];
let
bgdzctTable
=
{
headerList
:[
""
,
""
,
""
]}
// 1. 获取所有迁出记录(state 为迁出)
// 1. 获取所有迁出记录(state 为迁出)
let
zaifuList
=
await
selectManyTableData
(
OPERATIONALDATATYPE
.
多表联查
,
TABLENAME
.
企业基础信息表
,{},[
"eId"
,
"enterpriseName"
],
let
zaifuList
=
await
selectManyTableData
(
OPERATIONALDATATYPE
.
多表联查
,
TABLENAME
.
企业基础信息表
,{},[
"eId"
,
"enterpriseName"
],
...
@@ -422,19 +423,24 @@ export async function getRiskData() {
...
@@ -422,19 +423,24 @@ export async function getRiskData() {
riskData
[
0
].
value
=
abnormalCount
;
riskData
[
0
].
value
=
abnormalCount
;
// 2. 办公地址冲突(楼号 + 室号 + 时间段冲突)
// 2. 办公地址冲突(楼号 + 室号 + 时间段冲突)
let
leaseList
=
await
selectData
(
OPERATIONALDATATYPE
.
查询多个
,
TABLENAME
.
租赁信息
,{},[
"eId"
,
"building"
,
"roomNumber"
,
"startTime"
,
"endTime"
]);
// 构建一个 map,key 是 building_roomNumber,值是租赁时间段列表
let
企业基础信息
includeConf
=
{};
let
addressMap
=
new
Map
<
string
,
Array
<
{
eId
:
number
;
start
:
Date
;
end
:
Date
}
>>
();
企业基础信息
includeConf
[
TABLENAME
.
企业基础信息表
]
=
{
cloum
:
[
"enterpriseName"
],
where
:
{}
}
let
leaseList
=
await
selectManyTableData
(
OPERATIONALDATATYPE
.
多表联查
,
TABLENAME
.
租赁信息
,
{},
[
"eId"
,
"building"
,
"roomNumber"
,
"startTime"
,
"endTime"
],
企业基础信息
includeConf
);
// let leaseList = await selectData(OPERATIONALDATATYPE.查询多个,TABLENAME.租赁信息,{},["eId", "building", "roomNumber", "startTime", "endTime"]);
// 构建一个 map,key 是 building_roomNumber:楼号_室号,值是租赁时间段列表
let
addressMap
=
new
Map
<
string
,
Array
<
{
eId
:
number
;
enterpriseName
:
string
;
start
:
Date
;
end
:
Date
}
>>
();
for
(
const
lease
of
leaseList
)
{
for
(
const
lease
of
leaseList
)
{
const
key
=
`
${
lease
.
building
}
_
${
lease
.
roomNumber
}
`
;
const
key
=
`
${
lease
.
building
}
_
${
lease
.
roomNumber
}
`
;
const
timeRange
=
{
const
timeRange
=
{
eId
:
lease
.
eId
,
eId
:
lease
.
eId
,
enterpriseName
:
lease
.
enterprise
.
enterpriseName
,
start
:
new
Date
(
lease
.
startTime
),
start
:
new
Date
(
lease
.
startTime
),
end
:
new
Date
(
lease
.
endTime
)
end
:
new
Date
(
lease
.
endTime
)
};
};
if
(
!
addressMap
.
has
(
key
))
{
if
(
!
addressMap
.
has
(
key
))
{
addressMap
.
set
(
key
,
[]);
addressMap
.
set
(
key
,
[]);
}
}
...
@@ -442,6 +448,7 @@ export async function getRiskData() {
...
@@ -442,6 +448,7 @@ export async function getRiskData() {
}
}
let
conflictCount
=
0
;
let
conflictCount
=
0
;
let
conflictList
=
[];
// 遍历每个地址组合,检查时间段是否有重叠
// 遍历每个地址组合,检查时间段是否有重叠
for
(
const
[
key
,
ranges
]
of
addressMap
.
entries
())
{
for
(
const
[
key
,
ranges
]
of
addressMap
.
entries
())
{
...
@@ -453,6 +460,7 @@ export async function getRiskData() {
...
@@ -453,6 +460,7 @@ export async function getRiskData() {
// 判断时间段是否重叠
// 判断时间段是否重叠
if
(
a
.
start
<
b
.
end
&&
b
.
start
<
a
.
end
)
{
if
(
a
.
start
<
b
.
end
&&
b
.
start
<
a
.
end
)
{
conflictCount
++
;
conflictCount
++
;
conflictList
.
push
([
a
.
enterpriseName
,
b
.
enterpriseName
,
"同时间段内,地址相同"
])
break
;
// 当前地址组合已冲突,跳出循环
break
;
// 当前地址组合已冲突,跳出循环
}
}
}
}
...
...
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