Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zjxcxServer
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
zjxcxServer
Commits
d0d2e37a
Commit
d0d2e37a
authored
May 04, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取首页基础信(首页顶端数据) 加入基础数据校验
parent
4cc09c72
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
7 deletions
+29
-7
enterprise.ts
src/biz/mobileEnterprise/enterprise.ts
+7
-7
piecemeal.ts
src/util/piecemeal.ts
+22
-0
No files found.
src/biz/mobileEnterprise/enterprise.ts
View file @
d0d2e37a
...
@@ -11,7 +11,7 @@ import * as enterpriseData from "../../data/enterprise/enterprise";
...
@@ -11,7 +11,7 @@ import * as enterpriseData from "../../data/enterprise/enterprise";
import
{
selectFinancingInfo
}
from
"../../data/enterprise/financingInfo"
;
import
{
selectFinancingInfo
}
from
"../../data/enterprise/financingInfo"
;
import
{
findEnterpriseNewTeamData
}
from
"../../data/enterprise/team"
;
import
{
findEnterpriseNewTeamData
}
from
"../../data/enterprise/team"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
checkChange
,
extractData
}
from
"../../util/piecemeal"
;
import
{
checkChange
,
checkDataHaveNull
,
extractData
}
from
"../../util/piecemeal"
;
import
{
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
eccFormParam
}
from
"../../util/verificationParam"
;
import
{
eccFormParam
}
from
"../../util/verificationParam"
;
...
@@ -45,20 +45,20 @@ export async function getHomePageHeaderData(uscc:string) {
...
@@ -45,20 +45,20 @@ export async function getHomePageHeaderData(uscc:string) {
let
name
=
enterpriseInfo
.
name
;
let
name
=
enterpriseInfo
.
name
;
let
newTeamInfo
=
await
findEnterpriseNewTeamData
(
uscc
);
let
newTeamInfo
=
await
findEnterpriseNewTeamData
(
uscc
);
let
teamInfo
=
!
paramIsNull
(
newTeamInfo
)
?
newTeamInfo
:
{
doctor
:
0
,
master
:
0
,
undergraduate
:
0
,
juniorCollege
:
0
,
other
:
0
};
let
teamInfo
=
Object
.
keys
(
newTeamInfo
).
length
>
0
?
newTeamInfo
:
{
doctor
:
0
,
master
:
0
,
undergraduate
:
0
,
juniorCollege
:
0
,
other
:
0
};
//团队总数
//团队总数
let
memberCount
=
teamInfo
.
doctor
+
teamInfo
.
master
+
teamInfo
.
undergraduate
+
teamInfo
.
juniorCollege
+
teamInfo
.
other
;
let
memberCount
=
teamInfo
.
doctor
+
teamInfo
.
master
+
teamInfo
.
undergraduate
+
teamInfo
.
juniorCollege
+
teamInfo
.
other
;
let
initialTeam
=
enterpriseInfo
.
initialTeam
.
length
==
0
;
//创始团队缺失 true=缺失
let
initialTeam
=
enterpriseInfo
.
initialTeam
.
length
==
0
;
//创始团队缺失 true=缺失
let
qualification
=
paramIsNull
(
enterpriseInfo
.
qualification
);
//企业资质缺失 true=缺失 需要标红
let
qualification
=
checkDataHaveNull
(
enterpriseInfo
.
qualification
,
false
);
//企业资质缺失 true=缺失 需要标红
let
intellectualProperty
=
paramIsNull
(
enterpriseInfo
.
intellectualProperty
);
//知识产权缺失 true=缺失 需要标红
let
intellectualProperty
=
checkDataHaveNull
(
enterpriseInfo
.
intellectualProperty
,
false
);
//知识产权缺失 true=缺失 需要标红
let
financingInfo
=
await
selectFinancingInfo
(
uscc
);
//融资情况缺失 true=缺失 需要标红
let
financingInfo
=
await
selectFinancingInfo
(
uscc
);
//融资情况缺失 true=缺失 需要标红
let
financing
=
paramIsNull
(
financingInfo
);
let
financing
=
checkDataHaveNull
(
financingInfo
,
false
);
//todo
let
checkEnterpriseInfo
=
extractData
(
EnterpriseBaseConfig
,
enterpriseInfo
,
false
);
let
baseInfo
=
paramIsNull
({});
//基本信息缺失 true=缺失 需要标红
let
baseInfo
=
checkDataHaveNull
(
checkEnterpriseInfo
,
true
)
return
{
return
{
name
,
name
,
...
...
src/util/piecemeal.ts
View file @
d0d2e37a
...
@@ -40,3 +40,24 @@ export function extractData(conf, data, isAdmin) {
...
@@ -40,3 +40,24 @@ export function extractData(conf, data, isAdmin) {
}
}
return
result
;
return
result
;
}
}
/**
* 校验数据对象是否有空
* @param data
* @param sensitive 敏感校验 true时 0 和 ""会校验失败 false时 校验成功
* @returns true/false true = 有空值 false=无空值
*/
export
function
checkDataHaveNull
(
data
:
object
,
sensitive
:
boolean
)
{
if
(
Array
.
isArray
(
data
))
return
data
.
length
==
0
;
if
(
Object
.
keys
(
data
).
length
==
0
)
return
true
;
let
success
=
false
;
for
(
let
key
in
data
)
{
if
(
data
[
key
]
==
null
||
data
[
key
]
==
undefined
)
success
=
true
;
if
(
sensitive
)
{
if
(
data
[
key
]
==
0
||
data
[
key
]
==
""
)
success
=
true
;
}
}
return
success
;
}
\ No newline at end of file
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