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
b15f8d54
Commit
b15f8d54
authored
Feb 21, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
参数类型和完整性校验优化
parent
98323d9d
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
267 additions
and
194 deletions
+267
-194
enterprise.ts
src/biz/enterprise/enterprise.ts
+8
-7
financing.ts
src/biz/enterprise/financing.ts
+3
-3
base.ts
src/biz/fuHuqQi/base.ts
+4
-10
user.ts
src/biz/fuHuqQi/user.ts
+2
-2
checkParamConfig.ts
src/config/checkParamConfig.ts
+0
-138
eccFormParamConfig.ts
src/config/eccFormParamConfig.ts
+180
-0
splitResultConfig.ts
src/config/splitResultConfig.ts
+23
-1
verificationParam.ts
src/util/verificationParam.ts
+47
-33
No files found.
src/biz/enterprise/enterprise.ts
View file @
b15f8d54
...
...
@@ -4,7 +4,7 @@
* 包括新注册企业,迁入企业
*
*/
import
*
as
paramConfig
from
"../../config/check
ParamConfig"
;
import
*
as
eccFormParamConfig
from
"../../config/eccForm
ParamConfig"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
*
as
sysTools
from
"../../tools/system"
;
...
...
@@ -27,7 +27,7 @@ import { checkChange, extractData } from "../../util/piecemeal";
export
async
function
registerEnterprise
(
uscc
:
string
,
param
)
{
const
TaskId
=
sysTools
.
getTaskId
(
uscc
);
eccFormParam
(
"新注册企业"
,
p
aramConfig
.
RegisterEnterpriseParamConfig
,
param
);
//校验表单参数
eccFormParam
(
"新注册企业"
,
eccFormP
aramConfig
.
RegisterEnterpriseParamConfig
,
param
);
//校验表单参数
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
...
...
@@ -51,7 +51,7 @@ export async function registerEnterprise(uscc:string, param) {
*/
export
async
function
updateRegisterEnterprise
(
uscc
:
string
,
param
)
{
eccFormParam
(
"新注册企业表单修改"
,
paramConfig
.
EnterpriseParamFormConfig
,
param
,[
"oldLogonAdd"
,
"timeOfImmigration"
]);
//校验表单参数
eccFormParam
(
"新注册企业表单修改"
,
eccFormParamConfig
.
EnterpriseParamFormConfig
,
param
);
let
usccSelectDataBaseList
=
await
enterpriseData
.
findEnterpriseList
({
uscc
:
param
.
uscc
});
...
...
@@ -85,7 +85,7 @@ export async function updateRegisterEnterprise(uscc:string, param) {
export
async
function
moveInEnterprise
(
uscc
:
string
,
param
)
{
const
TaskId
=
sysTools
.
getTaskId
(
uscc
);
eccFormParam
(
"迁入企业登记"
,
paramConfig
.
MoveInEnterpriseParamConfig
,
param
,
[
"oldLogonAdd"
,
"timeOfImmigration"
]);
//校验表单参数
eccFormParam
(
"迁入企业登记"
,
eccFormParamConfig
.
MoveInEnterpriseParamConfig
,
param
);
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
...
...
@@ -106,7 +106,7 @@ export async function moveInEnterprise(uscc:string, param) {
*/
export
async
function
updateMoveInEnterprise
(
uscc
:
string
,
param
)
{
eccFormParam
(
"修改迁入企业登记信息"
,
paramConfig
.
Enterprise
ParamFormConfig
,
param
);
//校验表单参数
eccFormParam
(
"修改迁入企业登记信息"
,
eccFormParamConfig
.
EnterpriseInPut
ParamFormConfig
,
param
);
//校验表单参数
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByDraftId
(
param
.
draftId
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
param
.
uscc
}
这个企业`
);
...
...
@@ -133,8 +133,9 @@ export async function getEnterpriseByDraftId(draftId:string) {
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByDraftId
(
draftId
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在draftId=
${
draftId
}
这个企业`
);
let
data
:
any
=
extractData
(
splitResultConfig
.
EnterpriseInfoConfig
,
dataBaseInfo
,
false
);
data
.
draftId
=
dataBaseInfo
.
draftId
;
let
data
:
any
=
{};
if
(
dataBaseInfo
.
isCreate
)
extractData
(
splitResultConfig
.
EnterpriseInfoConfig
,
dataBaseInfo
,
false
);
else
data
=
extractData
(
splitResultConfig
.
EnterpriseMoveInInfoConfig
,
dataBaseInfo
,
false
);
return
{
data
};
}
...
...
src/biz/enterprise/financing.ts
View file @
b15f8d54
...
...
@@ -4,7 +4,7 @@
* 包括新融资信息的增删改查
*
*/
import
{
FinancingParamConfig
,
FinancingParamUpdateConfig
}
from
"../../config/check
ParamConfig"
;
import
*
as
eccFormParamConfig
from
"../../config/eccForm
ParamConfig"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
*
as
financingData
from
"../../data/enterprise/financing"
;
import
*
as
splitResultConfig
from
"../../config/splitResultConfig"
;
...
...
@@ -27,7 +27,7 @@ import { checkChange, extractData } from "../../util/piecemeal";
* @returns {isSuccess:true/false}
*/
export
async
function
createFinancingInfo
(
uscc
:
string
,
param
)
{
eccFormParam
(
"录入企业融资信息"
,
FinancingParamConfig
,
param
,
[
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentAmount"
,
"fuHuaQiInvestmentStyle"
]
);
eccFormParam
(
"录入企业融资信息"
,
eccFormParamConfig
.
FinancingParamConfig
,
param
);
if
(
param
.
fuHuaQiInvestment
)
{
let
subCheckName
=
"录入企业融资信息_孵化器是否参与"
;
...
...
@@ -67,7 +67,7 @@ export async function createFinancingInfo(uscc:string, param) {
* @returns {isSuccess:true/false}
*/
export
async
function
updateFinancingInfo
(
uscc
:
string
,
param
)
{
eccFormParam
(
"更新融资企业信息"
,
FinancingParamUpdateConfig
,
param
,
[
"fuHuaQiInvestmentAmount"
,
"fuHuaQiInvestmentStyle"
]
);
eccFormParam
(
"更新融资企业信息"
,
eccFormParamConfig
.
FinancingParamUpdateConfig
,
param
);
if
(
param
.
fuHuaQiInvestment
)
{
let
subCheckName
=
"录入企业融资信息_孵化器是否参与"
;
...
...
src/biz/fuHuqQi/base.ts
View file @
b15f8d54
...
...
@@ -4,7 +4,7 @@
* 孵化器相关逻辑 包括孵化器的增删改查
*
*/
import
{
BaseParamUpdateConfig
,
OrganizationParamUpdateConfig
}
from
"../../config/check
ParamConfig"
;
import
*
as
eccFormParamConfig
from
"../../config/eccForm
ParamConfig"
;
import
{
findEnterpriseCountByFuHuaQiUscc
,
groupFindEnterpriseCount
}
from
"../../data/enterprise/enterprise"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
;
import
*
as
splitResultConfig
from
"../../config/splitResultConfig"
;
...
...
@@ -78,10 +78,8 @@ export async function selectOrganizationInfo(uscc:string) {
* @returns {isSuccess:true/false};
*/
export
async
function
updateFuHuaQiBaseData
(
uscc
:
string
,
param
)
{
let
skipKeyList
=
[
"virtualEnterpriseNum"
,
"incubatedAcreage"
,
"acreageTotal"
,
"acreagePersonalUse"
,
"hatchingGround"
];
eccFormParam
(
"更新孵化器基础数据"
,
BaseParamUpdateConfig
,
param
,
skipKeyList
);
eccFormParam
(
"更新孵化器基础数据"
,
eccFormParamConfig
.
BaseParamUpdateConfig
,
param
);
let
baseDataInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
for
(
let
key
in
param
)
{
...
...
@@ -117,11 +115,7 @@ export async function updateFuHuaQiBaseData(uscc:string, param) {
* @returns {isSuccess:true/false};
*/
export
async
function
updateOrganizationData
(
uscc
:
string
,
param
)
{
let
skipKeyList
=
[
"name"
,
"virtualEnterpriseNum"
,
"hatchingGround"
,
"operationModelDes"
//todo 写到这里了 这里和甘明讨论好哪些是必填的
,
"logonTime"
,
"lv"
,
"identificationTime"
,
"industry"
,
"institutionalNature"
,
"foundingTeam"
,
"liaison"
,
"liaisonPhone"
,
"personInCharge"
,
"personInChargePhone"
,
];
eccFormParam
(
"更新孵化器基础数据"
,
OrganizationParamUpdateConfig
,
param
,
skipKeyList
);
eccFormParam
(
"更新孵化器基础数据"
,
eccFormParamConfig
.
OrganizationParamUpdateConfig
,
param
);
let
baseDataInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
...
...
src/biz/fuHuqQi/user.ts
View file @
b15f8d54
...
...
@@ -6,7 +6,7 @@
* 密码规则:6-18位 只允许有数字和字符,可以只有数字也可以只有字母 不允许有特殊字符 2023年02月21日确定需求
*/
import
{
FuHuaQiUserConfig
}
from
"../../config/check
ParamConfig"
;
import
*
as
eccFormParamConfig
from
"../../config/eccForm
ParamConfig"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
*
as
splitResultConfig
from
"../../config/splitResultConfig"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
...
...
@@ -166,7 +166,7 @@ export async function updateState(uscc:string, userState:boolean) {
* @returns
*/
export
async
function
addUser
(
param
)
{
eccFormParam
(
"新增孵化器账号信息"
,
FuHuaQiUserConfig
,
param
);
//校验表单参数
eccFormParam
(
"新增孵化器账号信息"
,
eccFormParamConfig
.
FuHuaQiUserConfig
,
param
);
//校验表单参数
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
param
.
uscc
);
...
...
src/config/checkParamConfig.ts
deleted
100644 → 0
View file @
98323d9d
/**
* 校验参数所用的配置
*
*/
/**
* 更新孵化器基础数据的表单配置
*/
export
const
BaseParamUpdateConfig
=
{
virtualEnterpriseNum
:
"Number"
,
//虚拟企业数量
incubatedAcreage
:
"Number"
,
//在孵面积(㎡)
acreageTotal
:
"Number"
,
//孵化器总面积(㎡)
acreagePersonalUse
:
"Number"
,
//孵化器自用面积(㎡)
hatchingGround
:
"[Object]"
,
//经备案孵化场地
};
/**
* 更新孵化器机构信息数据的表单配置
*/
export
const
OrganizationParamUpdateConfig
=
{
name
:
"String"
,
// {key:"名称"},
operationName
:
"String"
,
// {key:"运营机构名称"},
uscc
:
"String"
,
// {key:"统一信用代码"},
logonTime
:
"Number"
,
// {key:"注册时间", changeDate:true},
lv
:
"Number"
,
// {key:"孵化器级别"},
identificationTime
:
"Number"
,
// {key:"认定时间", changeDate:true},
industry
:
"[Number]"
,
// {key:"孵化领域"},
institutionalNature
:
"Number"
,
// {key:"机构性质"},
operationModel
:
"[Number]"
,
// {key:"运营模式"},//新加
foundingTeam
:
"[Object]"
,
// {key:"创始团队"},//新加
liaison
:
"String"
,
// {key:"联系人"},
liaisonPhone
:
"String"
,
// {key:"联系电话"},
personInCharge
:
"String"
,
// {key:"负责人"},
personInChargePhone
:
"String"
,
// {key:"负责人联系电话"},
operationModelDes
:
"String"
,
//运营模式描述
};
/**
* 企业表单配置
*/
export
const
EnterpriseParamFormConfig
=
{
name
:
"String"
,
//企业名称
uscc
:
"String"
,
//统一信用代码
industry
:
"[Number]"
,
//领域
logonTime
:
"Number"
,
//注册时间
firstIncubationTime
:
"Number"
,
//首次入孵时间
isNaturalPersonHolding
:
"Boolean"
,
//是否自然人控股企业
logonAdd
:
"String"
,
//注册地址
operatingAdd
:
"String"
,
//经营地址
leasedArea
:
"Number"
,
//租赁面积(平方米)
oldLogonAdd
:
"String"
,
//迁入前注册地址
timeOfImmigration
:
"Number"
,
//迁入时间
draftId
:
"String"
,
mainBusiness
:
"String"
//主营业务
}
/**
* 新注册企业的表单配置
*/
export
const
RegisterEnterpriseParamConfig
=
{
name
:
"String"
,
//企业名称
uscc
:
"String"
,
//统一信用代码
industry
:
"[Number]"
,
//领域
logonTime
:
"Number"
,
//注册时间
firstIncubationTime
:
"Number"
,
//首次入孵时间
isNaturalPersonHolding
:
"Boolean"
,
//是否自然人控股企业
logonAdd
:
"String"
,
//注册地址
operatingAdd
:
"String"
,
//经营地址
leasedArea
:
"Number"
,
//租赁面积(平方米)
mainBusiness
:
"String"
,
//主营业务
};
/**
* 迁入企业登记表单配置
*/
export
const
MoveInEnterpriseParamConfig
=
{
name
:
"String"
,
//企业名称
uscc
:
"String"
,
//统一信用代码
industry
:
"[Number]"
,
//领域
logonTime
:
"Number"
,
//注册时间
firstIncubationTime
:
"Number"
,
//首次入孵时间
timeOfImmigration
:
"Number"
,
//迁入时间
isNaturalPersonHolding
:
"Boolean"
,
//是否自然人控股企业
oldLogonAdd
:
"String"
,
//迁入前注册地址
logonAdd
:
"String"
,
//注册地址
operatingAdd
:
"String"
,
//经营地址
leasedArea
:
"Number"
,
//租赁面积(平方米)
mainBusiness
:
"String"
,
//主营业务
};
/**
* 更新 融资企业登记表单配置
*/
export
const
FinancingParamUpdateConfig
=
{
uscc
:
"String"
,
//统一信用代码
name
:
"String"
,
//企业名称
logonAdd
:
"String"
,
//注册地址
operatingAdd
:
"String"
,
//经营地址
financingAmount
:
"Number"
,
//融资金额(万元)
investmentInstitutionsName
:
"String"
,
//投资机构名称
timeToObtainInvestment
:
"Number"
,
//获得投资时间
fuHuaQiInvestment
:
"Boolean"
,
//孵化器是否投资
fuHuaQiInvestmentAmount
:
"Number"
,
//孵化器投资金额(万元)
fuHuaQiInvestmentStyle
:
"Number"
,
//孵化器投资方式
financingRounds
:
"Number"
,
//融资轮次
};
/**
* 创建 融资企业登记表单配置
*/
export
const
FinancingParamConfig
=
{
name
:
"String"
,
//企业名称
logonAdd
:
"String"
,
//注册地址
operatingAdd
:
"String"
,
//经营地址
financingAmount
:
"Number"
,
//融资金额(万元)
investmentInstitutionsName
:
"String"
,
//投资机构名称
timeToObtainInvestment
:
"Number"
,
//获得投资时间
fuHuaQiInvestment
:
"Boolean"
,
//孵化器是否投资
fuHuaQiInvestmentAmount
:
"Number"
,
//孵化器投资金额(万元)
fuHuaQiInvestmentStyle
:
"Number"
,
//孵化器投资方式
financingRounds
:
"Number"
,
//融资轮次
};
/**
* 新增孵化器账号配置
*/
export
const
FuHuaQiUserConfig
=
{
operationName
:
"String"
,
//运营机构名称
uscc
:
"String"
,
//营业执照
personInChargePhone
:
"String"
,
//负责人手机号
personInCharge
:
"String"
//负责人
}
\ No newline at end of file
src/config/eccFormParamConfig.ts
0 → 100644
View file @
b15f8d54
/**
* 校验表单参数配置
* 使用场景: 验证客户端请求参数
* 限制: 1.使用端不同不能共用一份配置
* 2.需要搭配 util/verificationParam -> eccFormParam() 方法使用
* 说明: notMustHave = true 时说明该字段是非必填的;不配该字段说明是必填的
*/
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 更新孵化器基础数据表单
* 备注:
*/
export
const
BaseParamUpdateConfig
=
{
virtualEnterpriseNum
:{
type
:
"Number"
,
notMustHave
:
true
},
//虚拟企业数量
incubatedAcreage
:{
type
:
"Number"
,
notMustHave
:
true
},
//在孵面积(㎡)
acreageTotal
:{
type
:
"Number"
,
notMustHave
:
true
},
//孵化器总面积(㎡)
acreagePersonalUse
:{
type
:
"Number"
,
notMustHave
:
true
},
//孵化器自用面积(㎡)
hatchingGround
:{
type
:
"[Object]"
,
notMustHave
:
true
},
//经备案孵化场地
};
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 更新孵化器机构信息数据表单
* 备注:
*/
export
const
OrganizationParamUpdateConfig
=
{
name
:{
type
:
"String"
,
notMustHave
:
true
},
// {key:"名称"},
operationName
:{
type
:
"String"
},
// {key:"运营机构名称"},
uscc
:{
type
:
"String"
},
// {key:"统一信用代码"},
logonTime
:{
type
:
"Number"
,
notMustHave
:
true
},
// {key:"注册时间", changeDate:true},
lv
:{
type
:
"Number"
,
notMustHave
:
true
},
// {key:"孵化器级别"},
identificationTime
:{
type
:
"Number"
,
notMustHave
:
true
},
// {key:"认定时间", changeDate:true},
industry
:{
type
:
"[Number]"
,
notMustHave
:
true
},
// {key:"孵化领域"},
institutionalNature
:{
type
:
"Number"
,
notMustHave
:
true
},
// {key:"机构性质"},
operationModel
:{
type
:
"[Number]"
,
notMustHave
:
true
},
// {key:"运营模式"},//新加
foundingTeam
:{
type
:
"[Object]"
,
notMustHave
:
true
},
// {key:"创始团队"},//新加
liaison
:{
type
:
"String"
,
notMustHave
:
true
},
// {key:"联系人"},
liaisonPhone
:{
type
:
"String"
,
notMustHave
:
true
},
// {key:"联系电话"},
personInCharge
:{
type
:
"String"
,
notMustHave
:
true
},
// {key:"负责人"},
personInChargePhone
:{
type
:
"String"
,
notMustHave
:
true
},
// {key:"负责人联系电话"},
operationModelDes
:{
type
:
"String"
,
notMustHave
:
true
},
//{key:"运营模式描述"},
};
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 修改新注册企业的表单
* 备注: 全必填
*/
export
const
EnterpriseParamFormConfig
=
{
name
:
"String"
,
//企业名称
uscc
:
"String"
,
//统一信用代码
industry
:
"[Number]"
,
//领域
logonTime
:
"Number"
,
//注册时间
firstIncubationTime
:
"Number"
,
//首次入孵时间
isNaturalPersonHolding
:
"Boolean"
,
//是否自然人控股企业
logonAdd
:
"String"
,
//注册地址
operatingAdd
:
"String"
,
//经营地址
leasedArea
:
"Number"
,
//租赁面积(平方米)
mainBusiness
:
"String"
,
//主营业务
draftId
:
"String"
,
//草稿id
}
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 修改新迁入企业的表单
* 备注: 全必填
*/
export
const
EnterpriseInPutParamFormConfig
=
{
name
:
"String"
,
//企业名称
uscc
:
"String"
,
//统一信用代码
industry
:
"[Number]"
,
//领域
logonTime
:
"Number"
,
//注册时间
firstIncubationTime
:
"Number"
,
//首次入孵时间
isNaturalPersonHolding
:
"Boolean"
,
//是否自然人控股企业
logonAdd
:
"String"
,
//注册地址
operatingAdd
:
"String"
,
//经营地址
leasedArea
:
"Number"
,
//租赁面积(平方米)
oldLogonAdd
:
"String"
,
//迁入前注册地址
timeOfImmigration
:
"Number"
,
//迁入时间
mainBusiness
:
"String"
,
//主营业务
draftId
:
"String"
,
//草稿id
}
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 新注册企业的表单
* 备注: 全必填
*/
export
const
RegisterEnterpriseParamConfig
=
{
name
:{
type
:
"String"
},
//企业名称
uscc
:{
type
:
"String"
},
//统一信用代码
industry
:{
type
:
"[Number]"
},
//领域
logonTime
:{
type
:
"Number"
},
//注册时间
firstIncubationTime
:{
type
:
"Number"
},
//首次入孵时间
isNaturalPersonHolding
:{
type
:
"Boolean"
},
//是否自然人控股企业
logonAdd
:{
type
:
"String"
},
//注册地址
operatingAdd
:{
type
:
"String"
},
//经营地址
leasedArea
:{
type
:
"Number"
},
//租赁面积(平方米)
mainBusiness
:{
type
:
"String"
},
//主营业务
};
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 迁入企业登记表单
* 备注: 全必填
*/
export
const
MoveInEnterpriseParamConfig
=
{
name
:
"String"
,
//企业名称
uscc
:
"String"
,
//统一信用代码
industry
:
"[Number]"
,
//领域
logonTime
:
"Number"
,
//注册时间
firstIncubationTime
:
"Number"
,
//首次入孵时间
timeOfImmigration
:
"Number"
,
//迁入时间
isNaturalPersonHolding
:
"Boolean"
,
//是否自然人控股企业
oldLogonAdd
:
"String"
,
//迁入前注册地址
logonAdd
:
"String"
,
//注册地址
operatingAdd
:
"String"
,
//经营地址
leasedArea
:
"Number"
,
//租赁面积(平方米)
mainBusiness
:
"String"
,
//主营业务
};
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 更新融资企业登记表单
* 备注:
*/
export
const
FinancingParamUpdateConfig
=
{
uscc
:{
type
:
"String"
},
//统一信用代码
name
:{
type
:
"String"
},
//企业名称
logonAdd
:{
type
:
"String"
},
//注册地址
operatingAdd
:{
type
:
"String"
},
//经营地址
financingAmount
:{
type
:
"Number"
},
//融资金额(万元)
investmentInstitutionsName
:{
type
:
"String"
},
//投资机构名称
timeToObtainInvestment
:{
type
:
"Number"
},
//获得投资时间
fuHuaQiInvestment
:{
type
:
"Boolean"
},
//孵化器是否投资
fuHuaQiInvestmentAmount
:{
type
:
"Number"
,
notMustHave
:
true
},
//孵化器投资金额(万元)
fuHuaQiInvestmentStyle
:{
type
:
"Number"
,
notMustHave
:
true
},
//孵化器投资方式
financingRounds
:{
type
:
"Number"
},
//融资轮次
};
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 创建融资企业登记
* 备注:
*/
export
const
FinancingParamConfig
=
{
name
:{
type
:
"String"
},
//企业名称
logonAdd
:{
type
:
"String"
},
//注册地址
operatingAdd
:{
type
:
"String"
},
//经营地址
financingAmount
:{
type
:
"Number"
},
//融资金额(万元)
investmentInstitutionsName
:{
type
:
"String"
},
//投资机构名称
timeToObtainInvestment
:{
type
:
"Number"
},
//获得投资时间
fuHuaQiInvestment
:{
type
:
"Boolean"
},
//孵化器是否投资
fuHuaQiInvestmentAmount
:{
type
:
"Number"
,
notMustHave
:
true
},
//孵化器投资金额(万元)
fuHuaQiInvestmentStyle
:{
type
:
"Number"
,
notMustHave
:
true
},
//孵化器投资方式
financingRounds
:{
type
:
"Number"
},
//融资轮次
};
/**
* 使用端: 管理后台
* 场景: 新增孵化器账号
* 备注: 所有参数为必填
*/
export
const
FuHuaQiUserConfig
=
{
operationName
:{
type
:
"String"
},
//运营机构名称
uscc
:{
type
:
"String"
},
//营业执照
personInChargePhone
:{
type
:
"String"
},
//负责人手机号
personInCharge
:{
type
:
"String"
}
//负责人
}
\ No newline at end of file
src/config/splitResultConfig.ts
View file @
b15f8d54
...
...
@@ -36,10 +36,31 @@ export const FuHuaQiBaseListConfig = {
/**
* 使用端: 小程序端【孵化器入口】
* 场景:
新增或迁入
企业信息
* 场景:
添加新注册
企业信息
* 备注: 回显
*/
export
const
EnterpriseInfoConfig
=
{
draftId
:{
key
:
"草稿箱id"
},
name
:{
key
:
"企业名称"
},
//
uscc
:{
key
:
"统一信用代码"
},
//
industry
:{
key
:
"领域"
},
//
logonTime
:{
key
:
"注册时间"
,
changeDate
:
true
},
//
firstIncubationTime
:{
key
:
"首次入孵时间"
,
changeDate
:
true
},
//
isNaturalPersonHolding
:{
key
:
"是否自然人控股企业"
},
//
logonAdd
:{
key
:
"注册地址"
},
//
operatingAdd
:{
key
:
"经营地址"
},
//
leasedArea
:{
key
:
"租赁面积(平方米)"
},
mainBusiness
:{
key
:
"主营业务"
},
//主营业务
};
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 添加迁入企业信息
* 备注: 回显
*/
export
const
EnterpriseMoveInInfoConfig
=
{
draftId
:{
key
:
"草稿箱id"
},
name
:{
key
:
"企业名称"
},
//
uscc
:{
key
:
"统一信用代码"
},
//
industry
:{
key
:
"领域"
},
//
...
...
@@ -55,6 +76,7 @@ export const EnterpriseInfoConfig = {
};
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 企业融资信息
...
...
src/util/verificationParam.ts
View file @
b15f8d54
...
...
@@ -15,46 +15,60 @@ import { BizError } from "./bizError";
* @param name 被调用的方法名
* @param config 校验配置
* @param param 需要校验的参数
* @param skipKeys 跳过验证的字段
* @returns true 无需关注返回
*/
export
function
eccFormParam
(
name
:
string
,
keyTypeConf
:
object
,
param
:
object
,
skipKeys
?
)
{
export
function
eccFormParam
(
name
:
string
,
keyTypeConf
:
object
,
param
:
object
)
{
for
(
let
key
in
keyTypeConf
)
{
if
(
skipKeys
&&
skipKeys
.
indexOf
(
key
)
>
-
1
&&
!
param
[
key
])
{
continue
;
}
if
(
typeof
param
[
key
]
!=
'boolean'
&&
!
param
[
key
]
)
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
`缺失
${
key
}
字段`
);
let
type
=
typeof
param
[
key
];
switch
(
keyTypeConf
[
key
])
{
case
'Number'
:
if
(
type
!=
'number'
)
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
`
${
key
}
应是number型 而不是
${
type
}
`
);
break
;
case
'String'
:
if
(
type
!=
'string'
)
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
`
${
key
}
应是string型 而不是
${
type
}
`
);
break
;
case
'Boolean'
:
if
(
type
!=
'boolean'
)
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
`
${
key
}
应是boolean型 而不是
${
type
}
`
);
break
;
case
'[Number]'
:
if
(
!
Array
.
isArray
(
param
[
key
])
)
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
`
${
key
}
应是数组型 而不是
${
type
}
`
);
for
(
let
i
=
0
;
i
<
param
[
key
].
length
;
i
++
)
{
let
item
=
param
[
key
][
i
];
if
(
typeof
item
!=
'number'
)
{
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
`
${
key
}
应是number型数组其中下标
${
i
}
是
${
typeof
item
}
`
);
let
{
type
,
notMustHave
}
=
keyTypeConf
[
key
];
let
isError
=
false
;
//校验是否异常
let
errorStr
=
""
;
//异常说明
if
(
(
typeof
param
[
key
]
!=
'boolean'
&&
!
param
[
key
]
)
)
{
if
(
!
notMustHave
)
{
isError
=
true
;
errorStr
=
`缺失
${
key
}
字段`
;
}
}
else
if
(
param
[
key
])
{
let
paramType
=
typeof
param
[
key
];
switch
(
keyTypeConf
[
key
])
{
case
'Number'
:
if
(
paramType
!=
'number'
)
isError
=
true
;
break
;
case
'String'
:
if
(
paramType
!=
'string'
)
isError
=
true
;
break
;
case
'Boolean'
:
if
(
paramType
!=
'boolean'
)
isError
=
true
;
break
;
case
'[Number]'
:
if
(
!
Array
.
isArray
(
param
[
key
])
)
isError
=
true
;
for
(
let
i
=
0
;
i
<
param
[
key
].
length
;
i
++
)
{
let
item
=
param
[
key
][
i
];
if
(
typeof
item
!=
'number'
)
{
isError
=
true
;
errorStr
=
`
${
key
}
应是number型数组其中下标
${
i
}
是
${
typeof
item
}
`
;
}
}
}
break
;
case
'[Object]'
:
if
(
!
Array
.
isArray
(
param
[
key
])
)
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
`
${
key
}
应是数组型 而不是
${
type
}
`
);
for
(
let
i
=
0
;
i
<
param
[
key
].
length
;
i
++
)
{
let
item
=
param
[
key
][
i
];
if
(
typeof
item
!=
'object'
)
{
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
`
${
key
}
应是object型数组其中下标
${
i
}
是
${
typeof
item
}
`
);
break
;
case
'[Object]'
:
if
(
!
Array
.
isArray
(
param
[
key
])
)
isError
=
true
;
for
(
let
i
=
0
;
i
<
param
[
key
].
length
;
i
++
)
{
let
item
=
param
[
key
][
i
];
if
(
typeof
item
!=
'object'
)
{
isError
=
true
;
errorStr
=
`
${
key
}
应是object型数组其中下标
${
i
}
是
${
typeof
item
}
`
;
}
}
}
break
;
break
;
}
errorStr
=
isError
&&
errorStr
==
""
?
`
${
key
}
应该是
${
type
}
型 而不是
${
paramType
}
`
:
errorStr
;
}
if
(
isError
)
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
errorStr
);
}
/**判断多余的参数 */
for
(
let
key
in
param
)
{
if
(
!
keyTypeConf
[
key
])
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
name
,
`多余
${
key
}
字段`
);
}
...
...
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