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
978d3441
Commit
978d3441
authored
Feb 22, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
枚举范围校验
parent
bdeeeda7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
15 deletions
+55
-15
enterprise.ts
src/biz/enterprise/enterprise.ts
+4
-1
base.ts
src/biz/fuHuqQi/base.ts
+51
-14
No files found.
src/biz/enterprise/enterprise.ts
View file @
978d3441
...
...
@@ -194,7 +194,10 @@ export async function enterpriseList(createType:number, fuHuaQiUscc:string, indu
selectParam
.
isCreate
=
createType
==
2
?
true
:
false
;
}
if
(
fuHuaQiUscc
)
selectParam
.
fuHuaQiUscc
=
fuHuaQiUscc
;
if
(
industry
.
length
>
0
)
selectParam
.
industry
=
industry
;
if
(
industry
.
length
>
0
)
{
verificationEnumTools
.
eccEnumValue
(
'管理后台获取在孵企业信息列表'
,
'industry'
,
configEnum
.
INDUSTRY
,
industry
);
//是否符合枚举范围
selectParam
.
industry
=
industry
;
}
if
(
isNaturalPersonHolding
==
2
||
isNaturalPersonHolding
==
3
)
{
selectParam
.
isNaturalPersonHolding
=
isNaturalPersonHolding
==
2
?
true
:
false
;
}
...
...
src/biz/fuHuqQi/base.ts
View file @
978d3441
...
...
@@ -13,7 +13,7 @@ import { checkChange, extractData } from "../../util/piecemeal";
import
{
BizError
}
from
"../../util/bizError"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
eccFormParam
}
from
"../../util/verificationParam"
;
import
{
changeEnumValue
}
from
"../../util/verificationEnum"
;
import
{
changeEnumValue
,
eccEnumValue
}
from
"../../util/verificationEnum"
;
/**
...
...
@@ -114,15 +114,21 @@ export async function updateFuHuaQiBaseData(uscc:string, param) {
export
async
function
updateOrganizationData
(
uscc
:
string
,
param
)
{
/**校验表单内容 */
eccFormParam
(
"更新孵化器机构信息数据"
,
eccFormParamConfig
.
OrganizationParamUpdateConfig
,
param
);
if
(
param
.
foundingTeam
&&
param
.
foundingTeam
.
length
)
{
if
(
param
.
foundingTeam
&&
param
.
foundingTeam
.
length
)
{
//创始团队参数校验
param
.
foundingTeam
.
forEach
((
subInfo
,
subIndex
)
=>
{
eccFormParam
(
`更新孵化器机构信息数据 创始团队
${
subIndex
}
`
,
eccFormParamConfig
.
OrganizationParamFoundingTeamUpdateConfig
,
subInfo
);
eccEnumValue
(
`更新孵化器机构信息数据 创始团队
${
subIndex
}
`
,
"团队类型"
,
configEnum
.
TEAM
,
subInfo
.
type
);
});
}
if
(
param
.
operationModel
&&
param
.
operationModel
.
length
)
{
if
(
!
param
.
operationModelDes
)
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
`缺失运营模式描述`
);
}
/**校验是否符合枚举范围 */
if
(
param
.
lv
)
eccEnumValue
(
"更新孵化器机构信息数据"
,
" 孵化器级别 "
,
configEnum
.
FUHUAQILV
,
param
.
fuHuaQiInvestmentStyle
);
if
(
param
.
industry
)
eccEnumValue
(
"更新孵化器机构信息数据"
,
" 领域 "
,
configEnum
.
FUHUAINDUSTRY
,
param
.
fuHuaQiInvestmentStyle
);
if
(
param
.
institutionalNature
)
eccEnumValue
(
"更新孵化器机构信息数据"
,
" 机构性质 "
,
configEnum
.
INSTITUTIONALNATURE
,
param
.
fuHuaQiInvestmentStyle
);
if
(
param
.
operationModel
&&
param
.
operationModel
.
length
)
eccEnumValue
(
"更新孵化器机构信息数据"
,
" 运营模式 "
,
configEnum
.
OPERATIONMODEL
,
param
.
fuHuaQiInvestmentStyle
);
let
baseDataInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
/**这里无法判断数组里面的内容是否有变化 所以 foundingTeam 直接赋值 */
...
...
@@ -158,13 +164,28 @@ export async function updateOrganizationData(uscc:string, param) {
* @returns
*/
export
async
function
fuHuaQiBaseList
(
lv
:
number
,
institutionalNature
:
number
,
industry
:
number
,
operationModel
:
number
,
foundingTeam
:
number
,
page
:
number
)
{
/**拼接查询条件 */
/**拼接查询条件
并且校验是否符合枚举范围 可优化 抽出一个方法统一校验
*/
let
selectParam
:
any
=
{};
if
(
lv
)
selectParam
.
lv
=
lv
;
if
(
institutionalNature
)
selectParam
.
institutionalNature
=
institutionalNature
;
if
(
industry
)
selectParam
.
industry
=
industry
;
if
(
operationModel
)
selectParam
.
operationModel
=
operationModel
;
if
(
foundingTeam
)
selectParam
.
foundingTeamType
=
foundingTeam
;
if
(
lv
)
{
eccEnumValue
(
"管理后台查询孵化器列表"
,
" 孵化器级别 "
,
configEnum
.
FUHUAQILV
,
lv
);
selectParam
.
lv
=
lv
;
}
if
(
institutionalNature
)
{
eccEnumValue
(
"管理后台查询孵化器列表"
,
" 机构性质 "
,
configEnum
.
INSTITUTIONALNATURE
,
institutionalNature
);
selectParam
.
institutionalNature
=
institutionalNature
;
}
if
(
industry
){
eccEnumValue
(
"管理后台查询孵化器列表"
,
" 领域 "
,
configEnum
.
FUHUAINDUSTRY
,
industry
);
selectParam
.
industry
=
industry
;
}
if
(
operationModel
)
{
eccEnumValue
(
"管理后台查询孵化器列表"
,
" 运营模式 "
,
configEnum
.
OPERATIONMODEL
,
operationModel
);
selectParam
.
operationModel
=
operationModel
;
}
if
(
foundingTeam
)
{
eccEnumValue
(
"管理后台查询孵化器列表"
,
" 创业团队 "
,
configEnum
.
TEAM
,
foundingTeam
);
selectParam
.
foundingTeamType
=
foundingTeam
;
}
let
enterpriseMap
=
await
groupFindEnterpriseCount
();
//计算孵化器拥有的企业总数
...
...
@@ -227,11 +248,27 @@ export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:numbe
let
selectParam
:
any
=
{};
if
(
type
==
configEnum
.
OUTPUTTYPE
.
当前数据
)
{
/**当选择了当前数据时 拼接查询条件 */
if
(
lv
)
selectParam
.
lv
=
lv
;
if
(
operationModel
)
selectParam
.
operationModel
=
operationModel
;
if
(
institutionalNature
)
selectParam
.
institutionalNature
=
institutionalNature
;
if
(
industry
)
selectParam
.
industry
=
industry
;
if
(
foundingTeam
)
selectParam
.
foundingTeamType
=
foundingTeam
;
let
selectParam
:
any
=
{};
if
(
lv
)
{
eccEnumValue
(
"管理后台查询孵化器列表"
,
" 孵化器级别 "
,
configEnum
.
FUHUAQILV
,
lv
);
selectParam
.
lv
=
lv
;
}
if
(
institutionalNature
)
{
eccEnumValue
(
"管理后台查询孵化器列表"
,
" 机构性质 "
,
configEnum
.
INSTITUTIONALNATURE
,
institutionalNature
);
selectParam
.
institutionalNature
=
institutionalNature
;
}
if
(
industry
){
eccEnumValue
(
"管理后台查询孵化器列表"
,
" 领域 "
,
configEnum
.
FUHUAINDUSTRY
,
industry
);
selectParam
.
industry
=
industry
;
}
if
(
operationModel
)
{
eccEnumValue
(
"管理后台查询孵化器列表"
,
" 运营模式 "
,
configEnum
.
OPERATIONMODEL
,
operationModel
);
selectParam
.
operationModel
=
operationModel
;
}
if
(
foundingTeam
)
{
eccEnumValue
(
"管理后台查询孵化器列表"
,
" 创业团队 "
,
configEnum
.
TEAM
,
foundingTeam
);
selectParam
.
foundingTeamType
=
foundingTeam
;
}
}
let
enterpriseMap
=
await
groupFindEnterpriseCount
();
//计算所有孵化器拥有的企业总数
...
...
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