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
549887c0
Commit
549887c0
authored
May 18, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化biz和router结构
parent
35ecb360
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
693 additions
and
634 deletions
+693
-634
enterprise.ts
src/biz/mobileEnterprise/base/enterprise.ts
+102
-0
initialTeams.ts
src/biz/mobileEnterprise/base/initialTeams.ts
+112
-0
intellectualProperty.ts
src/biz/mobileEnterprise/base/intellectualProperty.ts
+65
-0
qualification.ts
src/biz/mobileEnterprise/base/qualification.ts
+65
-0
enterprise.ts
src/biz/mobileEnterprise/enterprise.ts
+0
-307
businessData.ts
src/biz/mobileEnterprise/quarterTask/businessData.ts
+4
-4
dataDeclaration.ts
src/biz/mobileEnterprise/quarterTask/dataDeclaration.ts
+12
-12
enterprise.ts
src/biz/mobileFuHuaQi/enterprise/enterprise.ts
+0
-291
myEnterprise.ts
src/biz/mobileFuHuaQi/enterprise/myEnterprise.ts
+309
-0
systemTask.ts
src/biz/systemTask.ts
+1
-1
base.ts
src/routers/enterpriseMobileClient/base.ts
+11
-8
businessdata.ts
src/routers/enterpriseMobileClient/businessdata.ts
+1
-1
datadeclaration.ts
src/routers/enterpriseMobileClient/datadeclaration.ts
+1
-1
enterprise.ts
src/routers/mobileClient/enterprise.ts
+10
-9
No files found.
src/biz/mobileEnterprise/base/enterprise.ts
0 → 100644
View file @
549887c0
/**
* 小程序端 企业用户的 企业基础信息
* 作者:lxm
*/
import
{
EnterpriseQualificationUpdateConfig
,
EnterpriseUpdateBaseDataConfig
,
InitialTeamUpdateConfig
}
from
"../../../config/eccFormParamConfig"
;
import
{
ENTERPRISETEAM
,
INDUSTRY
,
LISTINGSITUATION
,
STATEENUM
}
from
"../../../config/enum"
;
import
{
ERRORENUM
}
from
"../../../config/errorEnum"
;
import
{
EnterpriseBaseConfig
,
EnterpriseInitialTeamConfig
}
from
"../../../config/splitResultConfig"
;
import
*
as
enterpriseData
from
"../../../data/enterprise/enterprise"
;
import
{
addMoneyEnterpriseInitialTeam
,
deleteMoneyEnterpriseInitialTeam
,
findEnterpriseInitialTeam
,
updateMoneyEnterpriseInitialTeam
}
from
"../../../data/enterprise/initialTeam"
;
import
{
findEnterpriseNewTeamData
}
from
"../../../data/enterprise/quarterTask/team"
;
import
{
getInitialTeamMemberId
}
from
"../../../tools/system"
;
import
{
BizError
}
from
"../../../util/bizError"
;
import
{
checkChange
,
checkDataHaveNull
,
extractData
}
from
"../../../util/piecemeal"
;
import
{
eccEnumValue
}
from
"../../../util/verificationEnum"
;
import
{
eccFormParam
}
from
"../../../util/verificationParam"
;
/**
* 获取首页基础信(首页顶端数据)
* 知识产权,融资情况,企业资质 第一次进来会红,点开之后红点提示 会永久消失 2023-05-08
* @param uscc 企业统一信用代码
* @returns
*/
export
async
function
getHomePageHeaderData
(
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
selectOneEnterpriseByParam
({
uscc
});
//企业名称
let
name
=
enterpriseInfo
.
name
;
let
newTeamInfo
=
await
findEnterpriseNewTeamData
(
uscc
);
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
initialTeam
=
enterpriseInfo
.
haveFirstClassTalent
==
STATEENUM
.
未选
||
!
enterpriseInfo
.
haveFirstClassTalent
;
//创始团队缺失 true=缺失
let
qualification
=
!
enterpriseInfo
.
tipsQualification
;
//企业资质缺失 true=缺失 需要标红
let
intellectualProperty
=
!
enterpriseInfo
.
tipsIntellectualProperty
;
//知识产权缺失 true=缺失 需要标红
let
financing
=
!
enterpriseInfo
.
tipsFinancingInfo
;
//融资情况缺失 true=缺失 需要标红
let
checkEnterpriseInfo
=
extractData
(
EnterpriseBaseConfig
,
enterpriseInfo
,
false
);
let
baseInfo
=
checkDataHaveNull
(
checkEnterpriseInfo
,
true
)
return
{
name
,
memberCount
,
hiatus
:{
initialTeam
,
qualification
,
financing
,
intellectualProperty
,
baseInfo
}
}
}
/**
* 获取企业基本信息
* 回显
* @param uscc
*/
export
async
function
enterpriseBaseInfo
(
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
let
updateInfo
=
extractData
(
EnterpriseBaseConfig
,
enterpriseInfo
,
false
);
return
updateInfo
;
}
/**
* 修改我的企业信息
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
updateEnterpriseBaseInfo
(
uscc
:
string
,
param
)
{
eccFormParam
(
"企业修改我的信息"
,
EnterpriseUpdateBaseDataConfig
,
param
);
eccEnumValue
(
'企业修改我的信息'
,
'industry'
,
INDUSTRY
,
param
.
industry
);
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
/**修改字段 */
let
changeList
=
checkChange
(
param
,
enterpriseInfo
);
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
changeList
.
forEach
(
key
=>
{
if
(
key
!=
"uscc"
&&
key
!=
"name"
)
{
enterpriseInfo
[
key
]
=
param
[
key
];
}
});
await
enterpriseInfo
.
save
();
return
{
isSuccess
:
true
};
}
src/biz/mobileEnterprise/base/initialTeams.ts
0 → 100644
View file @
549887c0
/**
* 创始团队主要逻辑
* 作者:lxm
*/
import
{
EnterpriseQualificationUpdateConfig
,
EnterpriseUpdateBaseDataConfig
,
InitialTeamUpdateConfig
}
from
"../../../config/eccFormParamConfig"
;
import
{
ENTERPRISETEAM
,
INDUSTRY
,
LISTINGSITUATION
,
STATEENUM
}
from
"../../../config/enum"
;
import
{
ERRORENUM
}
from
"../../../config/errorEnum"
;
import
{
EnterpriseBaseConfig
,
EnterpriseInitialTeamConfig
}
from
"../../../config/splitResultConfig"
;
import
*
as
enterpriseData
from
"../../../data/enterprise/enterprise"
;
import
{
addMoneyEnterpriseInitialTeam
,
deleteMoneyEnterpriseInitialTeam
,
findEnterpriseInitialTeam
,
updateMoneyEnterpriseInitialTeam
}
from
"../../../data/enterprise/initialTeam"
;
import
{
findEnterpriseNewTeamData
}
from
"../../../data/enterprise/quarterTask/team"
;
import
{
getInitialTeamMemberId
}
from
"../../../tools/system"
;
import
{
BizError
}
from
"../../../util/bizError"
;
import
{
checkChange
,
checkDataHaveNull
,
extractData
}
from
"../../../util/piecemeal"
;
import
{
eccEnumValue
}
from
"../../../util/verificationEnum"
;
import
{
eccFormParam
}
from
"../../../util/verificationParam"
;
/**
* 修改创始团队信息
* 修改 删除 添加 为一个接口 根据数据情况与老数据情况做匹配
* @param uscc 企业统一信用代码
* @param firstClassTalent 是否拥有国际一流人才
* @param teams 创始团队信息
* @returns isSuccess
*/
export
async
function
updateInitialTeamInfo
(
uscc
:
string
,
firstClassTalent
:
number
,
teams
)
{
eccEnumValue
(
"修改创始团队信息"
,
"firstClassTalent"
,
STATEENUM
,
firstClassTalent
);
if
(
firstClassTalent
==
STATEENUM
.
未选
)
throw
new
BizError
(
ERRORENUM
.
请先选择是否拥有
,
'修改创始团队信息 没有选是和否'
);
/**校验参数 */
if
(
(
firstClassTalent
==
STATEENUM
.
是
&&
!
Array
.
isArray
(
teams
))
||
(
firstClassTalent
==
STATEENUM
.
是
&&
!
teams
.
length
)
)
{
throw
new
BizError
(
ERRORENUM
.
参数错误
,
"修改创始团队信息"
,
"缺少参数 teams"
);
}
if
(
!
firstClassTalent
)
teams
=
[];
teams
.
forEach
((
info
,
index
)
=>
{
eccFormParam
(
`修改创始团队信息 下标:
${
index
}
`
,
InitialTeamUpdateConfig
,
info
);
eccEnumValue
(
'修改创始团队信息'
,
'type'
,
ENTERPRISETEAM
,
info
.
type
);
if
(
info
.
des
.
length
>
200
)
throw
new
BizError
(
ERRORENUM
.
字数超过
200
限制
,
`修改创始团队信息 下标:
${
index
}
`
);
});
//是否拥有国际人才这个字段在 企业表中 需要单独做更改
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
enterpriseInfo
.
haveFirstClassTalent
=
firstClassTalent
;
await
enterpriseInfo
.
save
();
let
enterpriseInitialTeamList
=
await
findEnterpriseInitialTeam
(
uscc
);
/**匹配数据操作逻辑 */
let
newTeamIdList
=
[];
//用于匹配新数据,老数据不在新数据中 判定为被删除
teams
.
forEach
(
info
=>
{
if
(
info
.
id
&&
info
.
id
!=
"newdata"
)
newTeamIdList
.
push
(
info
.
id
);
//todo
});
let
deleteList
=
[];
//老数据将出现在这个map里 用于与新数据id匹配,匹配id不在老数据中判定为添加操作
let
dataBaseTeamMap
=
{};
enterpriseInitialTeamList
.
forEach
(
info
=>
{
dataBaseTeamMap
[
info
.
id
]
=
info
;
if
(
newTeamIdList
.
indexOf
(
info
.
id
)
==
-
1
)
{
deleteList
.
push
(
info
);
}
});
let
addList
=
[];
let
updateList
=
[];
teams
.
forEach
(
info
=>
{
let
{
id
}
=
info
;
let
dataBaseInfo
=
dataBaseTeamMap
[
id
];
if
(
!
dataBaseInfo
)
{
//不存在老的id 判定为添加操作
info
.
id
=
getInitialTeamMemberId
(
uscc
,
info
.
name
);
info
.
uscc
=
uscc
;
info
.
name
=
enterpriseInfo
.
name
;
addList
.
push
(
info
);
}
else
{
//比对新老数据判断数据需不需要修改
let
changeList
=
checkChange
(
info
,
Object
.
assign
({
name
:
enterpriseInfo
.
name
,
uscc
},
dataBaseInfo
));
if
(
changeList
.
length
)
updateList
.
push
(
info
);
}
});
/**修改数据 */
if
(
addList
.
length
)
await
addMoneyEnterpriseInitialTeam
(
addList
);
if
(
updateList
.
length
)
await
updateMoneyEnterpriseInitialTeam
(
updateList
);
if
(
deleteList
.
length
)
await
deleteMoneyEnterpriseInitialTeam
(
deleteList
);
return
{
isSuccess
:
true
};
}
/**
* 获取创始团队信息
* 回显
* @param uscc 企业统一信用代码
* @returns initialTeam 团队列表 firstClassTalent 是否拥有国际一流人才
*/
export
async
function
selectInitialTeamInfo
(
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
let
firstClassTalent
=
enterpriseInfo
.
haveFirstClassTalent
||
STATEENUM
.
未选
;
let
initialTeamList
=
await
findEnterpriseInitialTeam
(
uscc
);
let
initialTeam
=
[];
initialTeamList
.
forEach
(
info
=>
{
let
changeData
=
extractData
(
EnterpriseInitialTeamConfig
,
info
,
false
);
initialTeam
.
push
(
changeData
);
});
return
{
initialTeam
,
firstClassTalent
};
}
\ No newline at end of file
src/biz/mobileEnterprise/base/intellectualProperty.ts
0 → 100644
View file @
549887c0
/**
* 知识产权主要逻辑
* 作者:lxm
*/
import
*
as
enterpriseData
from
"../../../data/enterprise/enterprise"
;
/**
* 校验参数是否为空
* @param param 参数
* @returns true就是空
*/
function
paramIsNull
(
param
)
{
if
(
!
param
)
return
true
;
let
isNull
=
false
;
if
(
typeof
param
==
"object"
)
{
if
(
Array
.
isArray
(
param
)
)
isNull
=
param
.
length
==
0
;
else
isNull
=
Object
.
keys
(
param
).
length
==
0
;
}
else
isNull
=
!
param
;
return
isNull
;
}
/**
* 修改企业知识产权信息
* @param uscc 企业统一信用代码
* @param alienPatent 海外专利个数
* @param classIPatent 一类专利个数
* @param secondClassPatent 二类专利个数
* @returns isSuccess
*/
export
async
function
updateIntellectualProperty
(
uscc
:
string
,
alienPatent
:
number
,
classIPatent
:
number
,
secondClassPatent
:
number
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
enterpriseInfo
.
intellectualProperty
=
{
alienPatent
,
classIPatent
,
secondClassPatent
};
if
(
!
enterpriseInfo
.
tipsIntellectualProperty
)
{
enterpriseInfo
.
tipsIntellectualProperty
=
true
;
}
await
enterpriseInfo
.
save
();
return
{
isSuccess
:
true
}
}
/**
* 查询企业专利信息
* 回显
* @param uscc 企业统一信用代码
* @returns
*/
export
async
function
selectIntellectualProperty
(
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
let
intellectualProperty
=
{
alienPatent
:
0
,
classIPatent
:
0
,
secondClassPatent
:
0
};
if
(
!
paramIsNull
(
enterpriseInfo
.
intellectualProperty
))
{
intellectualProperty
=
enterpriseInfo
.
intellectualProperty
;
}
return
intellectualProperty
;
}
src/biz/mobileEnterprise/base/qualification.ts
0 → 100644
View file @
549887c0
/**
* 企业资质 相关逻辑
* 作者:lxm
*/
import
{
EnterpriseQualificationUpdateConfig
}
from
"../../../config/eccFormParamConfig"
;
import
{
LISTINGSITUATION
}
from
"../../../config/enum"
;
import
{
ERRORENUM
}
from
"../../../config/errorEnum"
;
import
{
BizError
}
from
"../../../util/bizError"
;
import
{
eccEnumValue
}
from
"../../../util/verificationEnum"
;
import
{
eccFormParam
}
from
"../../../util/verificationParam"
;
import
*
as
enterpriseData
from
"../../../data/enterprise/enterprise"
;
/**
* 获取企业资质信息
* @param uscc 企业统一信用代码
* @returns
*/
export
async
function
selectQualification
(
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
let
defaultQualification
=
{
isHighTech
:
false
,
//是否是高新技术企业
highTechMs
:
0
,
//高新技术认证时间戳
isZjtx
:
false
,
//是否专精特新企业
zjtxMs
:
0
,
//专精特新认证时间戳
isXjrpy
:
false
,
//是否小巨人培育企业
xjrpyMs
:
0
,
//小巨人培育企业时间戳
isXjr
:
false
,
//是否是小巨人企业
xjrMs
:
0
,
//小巨人企业认证时间
beOnTheMarket
:[],
//上市情况
isBeOnTheMarket
:
false
};
return
enterpriseInfo
.
qualification
||
defaultQualification
;
}
/**
* 修改企业资质
* @param uscc 企业统一信用代码
* @returns
*/
export
async
function
updateQualification
(
uscc
:
string
,
param
)
{
eccFormParam
(
"修改企业资质"
,
EnterpriseQualificationUpdateConfig
,
param
);
if
(
param
.
isBeOnTheMarket
)
{
if
(
!
param
.
beOnTheMarket
.
length
)
throw
new
BizError
(
ERRORENUM
.
参数错误
,
'修改企业资质'
,
'缺失 beOnTheMarket '
)
eccEnumValue
(
"修改企业资质"
,
"beOnTheMarket"
,
LISTINGSITUATION
,
param
.
beOnTheMarket
);
}
else
param
.
beOnTheMarket
=
[];
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
enterpriseInfo
.
qualification
=
JSON
.
parse
(
JSON
.
stringify
(
param
)
);
if
(
!
enterpriseInfo
.
tipsQualification
)
{
enterpriseInfo
.
tipsQualification
=
true
;
}
await
enterpriseInfo
.
save
();
return
{
isSuccess
:
true
};
}
src/biz/mobileEnterprise/enterprise.ts
deleted
100644 → 0
View file @
35ecb360
/**
* 小程序端 企业用户的 企业基础信息
* 作者:lxm
*/
import
{
EnterpriseQualificationUpdateConfig
,
EnterpriseUpdateBaseDataConfig
,
InitialTeamUpdateConfig
}
from
"../../config/eccFormParamConfig"
;
import
{
ENTERPRISETEAM
,
INDUSTRY
,
LISTINGSITUATION
,
STATEENUM
}
from
"../../config/enum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
EnterpriseBaseConfig
,
EnterpriseInitialTeamConfig
}
from
"../../config/splitResultConfig"
;
import
*
as
enterpriseData
from
"../../data/enterprise/enterprise"
;
import
{
addMoneyEnterpriseInitialTeam
,
deleteMoneyEnterpriseInitialTeam
,
findEnterpriseInitialTeam
,
updateMoneyEnterpriseInitialTeam
}
from
"../../data/enterprise/initialTeam"
;
import
{
findEnterpriseNewTeamData
}
from
"../../data/enterprise/quarterTask/team"
;
import
{
getInitialTeamMemberId
}
from
"../../tools/system"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
checkChange
,
checkDataHaveNull
,
extractData
}
from
"../../util/piecemeal"
;
import
{
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
eccFormParam
}
from
"../../util/verificationParam"
;
/**
* 校验参数是否为空
* @param param 参数
* @returns true就是空
*/
function
paramIsNull
(
param
)
{
if
(
!
param
)
return
true
;
let
isNull
=
false
;
if
(
typeof
param
==
"object"
)
{
if
(
Array
.
isArray
(
param
)
)
isNull
=
param
.
length
==
0
;
else
isNull
=
Object
.
keys
(
param
).
length
==
0
;
}
else
isNull
=
!
param
;
return
isNull
;
}
/**
* 获取首页基础信(首页顶端数据)
* 知识产权,融资情况,企业资质 第一次进来会红,点开之后红点提示 会永久消失 2023-05-08
* @param uscc 企业统一信用代码
* @returns
*/
export
async
function
getHomePageHeaderData
(
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
selectOneEnterpriseByParam
({
uscc
});
//企业名称
let
name
=
enterpriseInfo
.
name
;
let
newTeamInfo
=
await
findEnterpriseNewTeamData
(
uscc
);
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
initialTeam
=
enterpriseInfo
.
haveFirstClassTalent
==
STATEENUM
.
未选
||
!
enterpriseInfo
.
haveFirstClassTalent
;
//创始团队缺失 true=缺失
let
qualification
=
!
enterpriseInfo
.
tipsQualification
;
//企业资质缺失 true=缺失 需要标红
let
intellectualProperty
=
!
enterpriseInfo
.
tipsIntellectualProperty
;
//知识产权缺失 true=缺失 需要标红
let
financing
=
!
enterpriseInfo
.
tipsFinancingInfo
;
//融资情况缺失 true=缺失 需要标红
let
checkEnterpriseInfo
=
extractData
(
EnterpriseBaseConfig
,
enterpriseInfo
,
false
);
let
baseInfo
=
checkDataHaveNull
(
checkEnterpriseInfo
,
true
)
return
{
name
,
memberCount
,
hiatus
:{
initialTeam
,
qualification
,
financing
,
intellectualProperty
,
baseInfo
}
}
}
/**
* 修改创始团队信息
* 修改 删除 添加 为一个接口 根据数据情况与老数据情况做匹配
* @param uscc 企业统一信用代码
* @param firstClassTalent 是否拥有国际一流人才
* @param teams 创始团队信息
* @returns isSuccess
*/
export
async
function
updateInitialTeamInfo
(
uscc
:
string
,
firstClassTalent
:
number
,
teams
)
{
eccEnumValue
(
"修改创始团队信息"
,
"firstClassTalent"
,
STATEENUM
,
firstClassTalent
);
if
(
firstClassTalent
==
STATEENUM
.
未选
)
throw
new
BizError
(
ERRORENUM
.
请先选择是否拥有
,
'修改创始团队信息 没有选是和否'
);
/**校验参数 */
if
(
(
firstClassTalent
==
STATEENUM
.
是
&&
!
Array
.
isArray
(
teams
))
||
(
firstClassTalent
==
STATEENUM
.
是
&&
!
teams
.
length
)
)
{
throw
new
BizError
(
ERRORENUM
.
参数错误
,
"修改创始团队信息"
,
"缺少参数 teams"
);
}
if
(
!
firstClassTalent
)
teams
=
[];
teams
.
forEach
((
info
,
index
)
=>
{
eccFormParam
(
`修改创始团队信息 下标:
${
index
}
`
,
InitialTeamUpdateConfig
,
info
);
eccEnumValue
(
'修改创始团队信息'
,
'type'
,
ENTERPRISETEAM
,
info
.
type
);
if
(
info
.
des
.
length
>
200
)
throw
new
BizError
(
ERRORENUM
.
字数超过
200
限制
,
`修改创始团队信息 下标:
${
index
}
`
);
});
//是否拥有国际人才这个字段在 企业表中 需要单独做更改
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
enterpriseInfo
.
haveFirstClassTalent
=
firstClassTalent
;
await
enterpriseInfo
.
save
();
let
enterpriseInitialTeamList
=
await
findEnterpriseInitialTeam
(
uscc
);
/**匹配数据操作逻辑 */
let
newTeamIdList
=
[];
//用于匹配新数据,老数据不在新数据中 判定为被删除
teams
.
forEach
(
info
=>
{
if
(
info
.
id
&&
info
.
id
!=
"newdata"
)
newTeamIdList
.
push
(
info
.
id
);
//todo
});
let
deleteList
=
[];
//老数据将出现在这个map里 用于与新数据id匹配,匹配id不在老数据中判定为添加操作
let
dataBaseTeamMap
=
{};
enterpriseInitialTeamList
.
forEach
(
info
=>
{
dataBaseTeamMap
[
info
.
id
]
=
info
;
if
(
newTeamIdList
.
indexOf
(
info
.
id
)
==
-
1
)
{
deleteList
.
push
(
info
);
}
});
let
addList
=
[];
let
updateList
=
[];
teams
.
forEach
(
info
=>
{
let
{
id
}
=
info
;
let
dataBaseInfo
=
dataBaseTeamMap
[
id
];
if
(
!
dataBaseInfo
)
{
//不存在老的id 判定为添加操作
info
.
id
=
getInitialTeamMemberId
(
uscc
,
info
.
name
);
info
.
uscc
=
uscc
;
info
.
name
=
enterpriseInfo
.
name
;
addList
.
push
(
info
);
}
else
{
//比对新老数据判断数据需不需要修改
let
changeList
=
checkChange
(
info
,
Object
.
assign
({
name
:
enterpriseInfo
.
name
,
uscc
},
dataBaseInfo
));
if
(
changeList
.
length
)
updateList
.
push
(
info
);
}
});
/**修改数据 */
if
(
addList
.
length
)
await
addMoneyEnterpriseInitialTeam
(
addList
);
if
(
updateList
.
length
)
await
updateMoneyEnterpriseInitialTeam
(
updateList
);
if
(
deleteList
.
length
)
await
deleteMoneyEnterpriseInitialTeam
(
deleteList
);
return
{
isSuccess
:
true
};
}
/**
* 获取创始团队信息
* 回显
* @param uscc 企业统一信用代码
* @returns initialTeam 团队列表 firstClassTalent 是否拥有国际一流人才
*/
export
async
function
selectInitialTeamInfo
(
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
let
firstClassTalent
=
enterpriseInfo
.
haveFirstClassTalent
||
STATEENUM
.
未选
;
let
initialTeamList
=
await
findEnterpriseInitialTeam
(
uscc
);
let
initialTeam
=
[];
initialTeamList
.
forEach
(
info
=>
{
let
changeData
=
extractData
(
EnterpriseInitialTeamConfig
,
info
,
false
);
initialTeam
.
push
(
changeData
);
});
return
{
initialTeam
,
firstClassTalent
};
}
/**
* 修改企业知识产权信息
* @param uscc 企业统一信用代码
* @param alienPatent 海外专利个数
* @param classIPatent 一类专利个数
* @param secondClassPatent 二类专利个数
* @returns isSuccess
*/
export
async
function
updateIntellectualProperty
(
uscc
:
string
,
alienPatent
:
number
,
classIPatent
:
number
,
secondClassPatent
:
number
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
enterpriseInfo
.
intellectualProperty
=
{
alienPatent
,
classIPatent
,
secondClassPatent
};
if
(
!
enterpriseInfo
.
tipsIntellectualProperty
)
{
enterpriseInfo
.
tipsIntellectualProperty
=
true
;
}
await
enterpriseInfo
.
save
();
return
{
isSuccess
:
true
}
}
/**
* 查询企业专利信息
* 回显
* @param uscc 企业统一信用代码
* @returns
*/
export
async
function
selectIntellectualProperty
(
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
let
intellectualProperty
=
{
alienPatent
:
0
,
classIPatent
:
0
,
secondClassPatent
:
0
};
if
(
!
paramIsNull
(
enterpriseInfo
.
intellectualProperty
))
{
intellectualProperty
=
enterpriseInfo
.
intellectualProperty
;
}
return
intellectualProperty
;
}
/**
* 获取企业资质信息
* @param uscc 企业统一信用代码
* @returns
*/
export
async
function
selectQualification
(
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
let
defaultQualification
=
{
isHighTech
:
false
,
//是否是高新技术企业
highTechMs
:
0
,
//高新技术认证时间戳
isZjtx
:
false
,
//是否专精特新企业
zjtxMs
:
0
,
//专精特新认证时间戳
isXjrpy
:
false
,
//是否小巨人培育企业
xjrpyMs
:
0
,
//小巨人培育企业时间戳
isXjr
:
false
,
//是否是小巨人企业
xjrMs
:
0
,
//小巨人企业认证时间
beOnTheMarket
:[],
//上市情况
isBeOnTheMarket
:
false
};
return
enterpriseInfo
.
qualification
||
defaultQualification
;
}
/**
* 修改企业资质
* @param uscc 企业统一信用代码
* @returns
*/
export
async
function
updateQualification
(
uscc
:
string
,
param
)
{
eccFormParam
(
"修改企业资质"
,
EnterpriseQualificationUpdateConfig
,
param
);
if
(
param
.
isBeOnTheMarket
)
{
if
(
!
param
.
beOnTheMarket
.
length
)
throw
new
BizError
(
ERRORENUM
.
参数错误
,
'修改企业资质'
,
'缺失 beOnTheMarket '
)
eccEnumValue
(
"修改企业资质"
,
"beOnTheMarket"
,
LISTINGSITUATION
,
param
.
beOnTheMarket
);
}
else
param
.
beOnTheMarket
=
[];
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
enterpriseInfo
.
qualification
=
JSON
.
parse
(
JSON
.
stringify
(
param
)
);
if
(
!
enterpriseInfo
.
tipsQualification
)
{
enterpriseInfo
.
tipsQualification
=
true
;
}
await
enterpriseInfo
.
save
();
return
{
isSuccess
:
true
};
}
/**
* 获取企业基本信息
* 回显
* @param uscc
*/
export
async
function
enterpriseBaseInfo
(
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
let
updateInfo
=
extractData
(
EnterpriseBaseConfig
,
enterpriseInfo
,
false
);
return
updateInfo
;
}
/**
* 修改我的企业信息
* @param uscc 企业统一信用代码
* @param param 表单
* @returns
*/
export
async
function
updateEnterpriseBaseInfo
(
uscc
:
string
,
param
)
{
eccFormParam
(
"企业修改我的信息"
,
EnterpriseUpdateBaseDataConfig
,
param
);
eccEnumValue
(
'企业修改我的信息'
,
'industry'
,
INDUSTRY
,
param
.
industry
);
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
/**修改字段 */
let
changeList
=
checkChange
(
param
,
enterpriseInfo
);
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
changeList
.
forEach
(
key
=>
{
if
(
key
!=
"uscc"
&&
key
!=
"name"
)
{
enterpriseInfo
[
key
]
=
param
[
key
];
}
});
await
enterpriseInfo
.
save
();
return
{
isSuccess
:
true
};
}
src/biz/mobileEnterprise/businessData.ts
→
src/biz/mobileEnterprise/
quarterTask/
businessData.ts
View file @
549887c0
...
...
@@ -6,10 +6,10 @@
*/
import
moment
=
require
(
"moment"
);
import
{
findBusinessDataByUsccAndYear
}
from
"../../data/enterprise/quarterTask/businessdata"
;
import
{
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
BUSINESSDATATYPE
}
from
"../../config/enum"
;
import
{
findRepleishDataByTypeAndYear
,
replenishData
,
selectRepleishData
}
from
"../../data/enterprise/replenish"
;
import
{
findBusinessDataByUsccAndYear
}
from
"../../
../
data/enterprise/quarterTask/businessdata"
;
import
{
eccEnumValue
}
from
"../../
../
util/verificationEnum"
;
import
{
BUSINESSDATATYPE
}
from
"../../
../
config/enum"
;
import
{
findRepleishDataByTypeAndYear
,
replenishData
,
selectRepleishData
}
from
"../../
../
data/enterprise/replenish"
;
/**
...
...
src/biz/mobileEnterprise/dataDeclaration.ts
→
src/biz/mobileEnterprise/
quarterTask/
dataDeclaration.ts
View file @
549887c0
...
...
@@ -7,18 +7,18 @@
*/
import
moment
=
require
(
"moment"
);
import
{
addManyBusinessData
,
findBusinessDataByTimeAndUscc
,
findBusinessDataCountByTime
,
findNotSubmitBusinessDataByTimeAndUscc
}
from
"../../data/enterprise/quarterTask/businessdata"
;
import
{
addManyTeamData
,
addTeamData
,
findNotSubmitTeamByUsccAndTime
,
findTeamByUsccAndTime
,
findTeamDataCountByTime
}
from
"../../data/enterprise/quarterTask/team"
;
import
{
changeEnumValue
,
eccEnumValue
}
from
"../../util/verificationEnum"
;
import
{
ENTERPRISEDECLARATIONTYPE
,
FUHUASTATE
}
from
"../../config/enum"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
eccFormParam
}
from
"../../util/verificationParam"
;
import
{
EnterpriseAddTeamDataConfig
}
from
"../../config/eccFormParamConfig"
;
import
{
EnterpriseTeamConfig
}
from
"../../config/splitResultConfig"
;
import
{
checkChange
,
extractData
}
from
"../../util/piecemeal"
;
import
{
findEnterpriseByUscc
,
findEnterpriseList
}
from
"../../data/enterprise/enterprise"
;
import
{
logHandle
}
from
"../../util/log"
;
import
{
addManyBusinessData
,
findBusinessDataByTimeAndUscc
,
findBusinessDataCountByTime
,
findNotSubmitBusinessDataByTimeAndUscc
}
from
"../../
../
data/enterprise/quarterTask/businessdata"
;
import
{
addManyTeamData
,
addTeamData
,
findNotSubmitTeamByUsccAndTime
,
findTeamByUsccAndTime
,
findTeamDataCountByTime
}
from
"../../
../
data/enterprise/quarterTask/team"
;
import
{
changeEnumValue
,
eccEnumValue
}
from
"../../
../
util/verificationEnum"
;
import
{
ENTERPRISEDECLARATIONTYPE
,
FUHUASTATE
}
from
"../../
../
config/enum"
;
import
{
BizError
}
from
"../../
../
util/bizError"
;
import
{
ERRORENUM
}
from
"../../
../
config/errorEnum"
;
import
{
eccFormParam
}
from
"../../
../
util/verificationParam"
;
import
{
EnterpriseAddTeamDataConfig
}
from
"../../
../
config/eccFormParamConfig"
;
import
{
EnterpriseTeamConfig
}
from
"../../
../
config/splitResultConfig"
;
import
{
checkChange
,
extractData
}
from
"../../
../
util/piecemeal"
;
import
{
findEnterpriseByUscc
,
findEnterpriseList
}
from
"../../
../
data/enterprise/enterprise"
;
import
{
logHandle
}
from
"../../
../
util/log"
;
/** ----------------------------------------------------- 通用方法 start -------------------------------------- */
...
...
src/biz/mobileFuHuaQi/enterprise/enterprise.ts
View file @
549887c0
...
...
@@ -190,294 +190,3 @@ export async function deleteEnterpriseByDraftId(draftId:string) {
return
{
isSuccess
:
true
};
}
/**
* 我的企业列表
* 小程序端 2.0
* @param uscc 孵化器统一信用代码
* @param state 孵化器状态 遵循 枚举FUHUASTATE
* @param name 孵化器名称
* @param page 当前页面
*/
export
async
function
myEnterprise
(
uscc
:
string
,
state
:
number
,
name
:
string
,
page
:
number
)
{
let
result
:
any
=
{};
let
selectParam
:
any
=
{
fuHuaQiUscc
:
uscc
};
if
(
name
)
selectParam
.
name
=
{
"$regex"
:
`
${
name
}
`
};
if
(
state
==
configEnum
.
INSIDESTATE
.
全部
)
{
selectParam
.
state
=
{
"$lt"
:
4
};
}
else
selectParam
.
state
=
state
;
let
dataList
=
await
enterpriseData
.
findEnterpriseListToPage
(
selectParam
,
(
page
-
1
)
*
10
);
/**当前条件数据量 */
let
dataCount
=
await
enterpriseData
.
findEnterpriseCount
(
selectParam
);
/**当前条件页面数量 */
result
.
dataCount
=
dataCount
;
result
.
pageCount
=
Math
.
ceil
(
dataCount
/
10
);
if
(
state
!=
configEnum
.
FUHUASTATE
.
迁出
)
{
/**查询所有的数据量 */
let
allCount
=
await
enterpriseData
.
findEnterpriseCount
({
fuHuaQiUscc
:
uscc
});
let
virtualCount
=
0
;
if
(
state
==
configEnum
.
FUHUASTATE
.
虚拟孵化
)
virtualCount
=
dataCount
;
else
virtualCount
=
await
enterpriseData
.
findEnterpriseCount
({
fuHuaQiUscc
:
uscc
,
state
:
configEnum
.
FUHUASTATE
.
虚拟孵化
});
result
.
dataNumberList
=
[
{
key
:
configEnum
.
INSIDESTATE
.
全部
,
value
:
`全部(
${
allCount
}
)`
},
{
key
:
configEnum
.
INSIDESTATE
.
实体孵化
,
value
:
`实体孵化(
${
allCount
-
virtualCount
}
)`
},
{
key
:
configEnum
.
INSIDESTATE
.
虚拟孵化
,
value
:
`虚拟孵化(
${
virtualCount
}
)`
},
];
}
let
enterpriseList
=
[];
dataList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
splitResultConfig
.
MyEnterpriseDataConfig
,
info
,
false
);
if
(
state
!=
configEnum
.
FUHUASTATE
.
迁出
)
{
changeData
.
virtualCause
=
info
.
virtualCause
||
0
;
changeData
.
virtualCauseDes
=
info
.
virtualCauseDes
||
""
;
}
changeData
.
state
=
verificationEnumTools
.
changeEnumValue
(
configEnum
.
FUHUASTATE
,
changeData
.
state
);
enterpriseList
.
push
(
changeData
);
});
result
.
enterpriseList
=
enterpriseList
;
return
result
;
}
/**
* 修改企业孵化状态 修改为实体
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param uscc 企业统一信用代码
* @param leasedArea 租赁面积
* @returns {isSuccess:true/false}
*/
export
async
function
updatePhysicalInfo
(
fuHuaQiUscc
:
string
,
uscc
:
string
,
leasedArea
:
number
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
enterpriseInfo
.
leasedArea
=
leasedArea
;
enterpriseInfo
.
state
=
configEnum
.
FUHUASTATE
.
实体孵化
;
/**修改为实体,需要把虚拟的和迁出的字段清空 */
enterpriseInfo
.
virtualCause
=
null
;
//虚拟孵化模式
enterpriseInfo
.
virtualCauseDes
=
""
;
//虚拟孵化原因
enterpriseInfo
.
moveOutType
=
null
;
//迁出类型
enterpriseInfo
.
moveOutCause
=
[];
//迁出原因
enterpriseInfo
.
moveOutTime
=
0
;
await
enterpriseInfo
.
save
();
return
{
isUsccess
:
true
};
}
/**
* 修改企业孵化状态 修改为虚拟
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param uscc 企业统一信用代码
* @param virtualCauseDes 虚拟孵化其他原因
* @param virtualCause 虚拟孵化模式
* @returns {isSuccess:true/false}
*/
export
async
function
updateVirtualInfo
(
fuHuaQiUscc
:
string
,
uscc
:
string
,
virtualCauseDes
:
string
,
virtualCause
:
number
)
{
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为虚拟'
,
configEnum
.
VIRTUALCAUSE
,
virtualCause
);
if
(
virtualCause
==
configEnum
.
VIRTUALCAUSE
.
其他
&&
!
virtualCauseDes
)
{
throw
new
BizError
(
ERRORENUM
.
请填入其他原因
,
"修改企业孵化状态 修改为虚拟"
,
`virtualCause:
${
virtualCause
}
, virtualCauseDes:
${
virtualCauseDes
}
`
);
}
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
enterpriseInfo
.
virtualCause
=
virtualCause
;
if
(
virtualCauseDes
)
enterpriseInfo
.
virtualCauseDes
=
virtualCauseDes
;
enterpriseInfo
.
state
=
configEnum
.
FUHUASTATE
.
虚拟孵化
;
/**修改为虚拟时,需要把实体的和迁出的字段清空 */
enterpriseInfo
.
moveOutType
=
null
;
//迁出类型
enterpriseInfo
.
moveOutCause
=
[];
//迁出原因
enterpriseInfo
.
leasedArea
=
0
;
//租赁面积
enterpriseInfo
.
moveOutTime
=
0
;
await
enterpriseInfo
.
save
();
return
{
isUsccess
:
true
};
}
/**
* 修改企业孵化状态 修改为迁出
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param uscc 企业统一信用代码
* @param moveOutType 迁出类型
* @param moveOutTrace 迁出去向 2.3新加字段
* @param moveOutCause 迁出原因 多选
* @returns {isSuccess:true/false}
*/
export
async
function
updateMoveOutInfo
(
fuHuaQiUscc
:
string
,
uscc
:
string
,
moveOutType
:
number
,
moveOutTrace
:
number
,
moveOutCause
)
{
/**校验参数 */
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为迁出'
,
configEnum
.
MOVEOUTTYPE
,
moveOutType
);
if
(
moveOutType
!=
configEnum
.
MOVEOUTTYPE
.
企业注销
)
{
//选择了 非企业注销时 moveOutTrace 和 moveOutCause 为必选项
await
eccReqParamater
({
moveOutTrace
:
"Number"
,
moveOutCause
:
"[Number]"
},
{
moveOutTrace
,
moveOutCause
}
);
/**校验moveOutCause 和 moveOutTrace 是否符合规则*/
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为迁出'
,
configEnum
.
MOVEOUTTRACE
,
moveOutTrace
);
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为迁出'
,
configEnum
.
MOVEOUTCAUSE
,
moveOutCause
);
/**根据 不同的迁出类型 校验不同的迁出原因枚举 */
if
(
moveOutType
==
configEnum
.
MOVEOUTTYPE
.
毕业迁出
)
{
moveOutCause
=
[
moveOutCause
[
0
]];
//非毕业迁出是单选
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为迁出'
,
configEnum
.
MOVEOUTCAUSECLIENT
,
moveOutCause
);
}
if
(
moveOutType
==
configEnum
.
MOVEOUTTYPE
.
非毕业迁出
)
{
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为迁出'
,
configEnum
.
MOVEOUTCAUSENOTCLIENT
,
moveOutCause
);
}
}
else
{
/**如果是选择了企业注销 这里的两个参数要为空 */
moveOutTrace
=
0
;
moveOutCause
=
[];
}
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
enterpriseInfo
.
moveOutType
=
moveOutType
;
enterpriseInfo
.
moveOutCause
=
moveOutCause
;
enterpriseInfo
.
moveOutTrace
=
moveOutTrace
;
enterpriseInfo
.
moveOutTime
=
new
Date
().
valueOf
();
enterpriseInfo
.
state
=
configEnum
.
FUHUASTATE
.
迁出
;
/**修改为迁出时,需要把实体的和虚拟的字段清空 */
enterpriseInfo
.
virtualCause
=
null
;
//虚拟孵化模式
enterpriseInfo
.
virtualCauseDes
=
""
;
//虚拟孵化原因
enterpriseInfo
.
leasedArea
=
0
;
//租赁面积
await
enterpriseInfo
.
save
();
return
{
isUsccess
:
true
};
}
/**
* 企业基本信息 回显
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param uscc 企业统一信用代码
*/
export
async
function
getMyEnterpriseBaseInfo
(
fuHuaQiUscc
:
string
,
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
`我的企业 回显企业信息
${
uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
'企业基本信息回显'
,
`孵化器:
${
fuHuaQiUscc
}
企业:
${
uscc
}
`
);
let
changeData
=
extractData
(
splitResultConfig
.
MyEnterpriseBaseDataConfig
,
enterpriseInfo
,
false
);
return
{
enterpriseInfo
:
changeData
};
}
/**
* 修改我的企业基本信息
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param param 表单
*/
export
async
function
updateMyEnterpriseBaseInfo
(
fuHuaQiUscc
:
string
,
param
)
{
eccFormParam
(
"修改我的企业基本信息"
,
eccFormParamConfig
.
UpdateMyEnterpriseBaseDataConfig
,
param
);
verificationEnumTools
.
eccEnumValue
(
'修改新注册企业'
,
'industry'
,
configEnum
.
INDUSTRY
,
param
.
industry
);
if
(
!
sysTools
.
eccUscc
(
param
.
uscc
)
)
throw
new
BizError
(
ERRORENUM
.
统一社会信用代码不合法
);
const
Uscc
=
param
.
uscc
;
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
Uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
`我的企业 修改我的企业基本信息
${
Uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
'修改我的企业基本信息'
,
`孵化器:
${
fuHuaQiUscc
}
企业:
${
Uscc
}
`
);
/**修改字段 */
let
changeList
=
checkChange
(
param
,
enterpriseInfo
);
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
changeList
.
forEach
(
key
=>
{
enterpriseInfo
[
key
]
=
param
[
key
];
});
await
enterpriseInfo
.
save
();
/**更新分数 */
await
scoreBiz
.
updateScore
(
fuHuaQiUscc
,
configEnum
.
SCOREWAYS
.
我的企业数据
,
false
);
return
{
isSuccess
:
true
};
}
/**
* 补录新迁入企业信息
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param param 表单
*/
export
async
function
replenishMyEnterpriseInPutInfo
(
fuHuaQiUscc
:
string
,
param
)
{
eccFormParam
(
"补录新迁入企业信息"
,
eccFormParamConfig
.
ReplenishMyEnterpriseInPutDataConfig
,
param
);
verificationEnumTools
.
eccEnumValue
(
'补录新迁入企业信息'
,
'industry'
,
configEnum
.
INDUSTRY
,
param
.
industry
);
if
(
!
sysTools
.
eccUscc
(
param
.
uscc
)
)
throw
new
BizError
(
ERRORENUM
.
统一社会信用代码不合法
);
/**不能出现重复的统一社会信用代码 草稿的也不行 */
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
/**添加新注册企业标识 */
param
.
isCreate
=
false
;
//标识此次操作是否是迁入企业并不是新注册企业
param
.
state
=
configEnum
.
FUHUASTATE
.
实体孵化
;
await
enterpriseData
.
replenishEnterpriseData
(
fuHuaQiUscc
,
param
);
return
{
isSuccess
:
true
};
}
/**
* 补录新注册企业信息
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param param 表单
*/
export
async
function
replenishMyEnterpriseCreateInfo
(
fuHuaQiUscc
:
string
,
param
)
{
eccFormParam
(
"补录新迁入企业信息"
,
eccFormParamConfig
.
ReplenishMyEnterpriseCreateDataConfig
,
param
);
verificationEnumTools
.
eccEnumValue
(
'补录新迁入企业信息'
,
'industry'
,
configEnum
.
INDUSTRY
,
param
.
industry
);
if
(
!
sysTools
.
eccUscc
(
param
.
uscc
)
)
throw
new
BizError
(
ERRORENUM
.
统一社会信用代码不合法
);
/**不能出现重复的统一社会信用代码 草稿的也不行 */
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
/**添加新注册企业标识 */
param
.
isCreate
=
false
;
//标识此次操作是否是迁入企业并不是新注册企业
param
.
state
=
configEnum
.
FUHUASTATE
.
实体孵化
;
await
enterpriseData
.
replenishEnterpriseData
(
fuHuaQiUscc
,
param
);
return
{
isSuccess
:
true
};
}
src/biz/mobileFuHuaQi/enterprise/myEnterprise.ts
0 → 100644
View file @
549887c0
/**
* 我的企业相关逻辑
* 作者:lxm
*/
import
*
as
eccFormParamConfig
from
"../../../config/eccFormParamConfig"
;
import
{
ERRORENUM
}
from
"../../../config/errorEnum"
;
import
{
BizError
}
from
"../../../util/bizError"
;
import
*
as
sysTools
from
"../../../tools/system"
;
import
*
as
enterpriseData
from
"../../../data/enterprise/enterprise"
;
import
*
as
splitResultConfig
from
"../../../config/splitResultConfig"
;
import
*
as
configEnum
from
"../../../config/enum"
;
import
{
eccFormParam
,
eccReqParamater
}
from
"../../../util/verificationParam"
;
import
*
as
verificationEnumTools
from
"../../../util/verificationEnum"
;
import
{
checkChange
,
extractData
}
from
"../../../util/piecemeal"
;
import
*
as
scoreBiz
from
"../fuHuaQi/score"
;
/**
* 我的企业列表
* 小程序端 2.0
* @param uscc 孵化器统一信用代码
* @param state 孵化器状态 遵循 枚举FUHUASTATE
* @param name 孵化器名称
* @param page 当前页面
*/
export
async
function
myEnterprise
(
uscc
:
string
,
state
:
number
,
name
:
string
,
page
:
number
)
{
let
result
:
any
=
{};
let
selectParam
:
any
=
{
fuHuaQiUscc
:
uscc
};
if
(
name
)
selectParam
.
name
=
{
"$regex"
:
`
${
name
}
`
};
if
(
state
==
configEnum
.
INSIDESTATE
.
全部
)
{
selectParam
.
state
=
{
"$lt"
:
4
};
}
else
selectParam
.
state
=
state
;
let
dataList
=
await
enterpriseData
.
findEnterpriseListToPage
(
selectParam
,
(
page
-
1
)
*
10
);
/**当前条件数据量 */
let
dataCount
=
await
enterpriseData
.
findEnterpriseCount
(
selectParam
);
/**当前条件页面数量 */
result
.
dataCount
=
dataCount
;
result
.
pageCount
=
Math
.
ceil
(
dataCount
/
10
);
if
(
state
!=
configEnum
.
FUHUASTATE
.
迁出
)
{
/**查询所有的数据量 */
let
allCount
=
await
enterpriseData
.
findEnterpriseCount
({
fuHuaQiUscc
:
uscc
});
let
virtualCount
=
0
;
if
(
state
==
configEnum
.
FUHUASTATE
.
虚拟孵化
)
virtualCount
=
dataCount
;
else
virtualCount
=
await
enterpriseData
.
findEnterpriseCount
({
fuHuaQiUscc
:
uscc
,
state
:
configEnum
.
FUHUASTATE
.
虚拟孵化
});
result
.
dataNumberList
=
[
{
key
:
configEnum
.
INSIDESTATE
.
全部
,
value
:
`全部(
${
allCount
}
)`
},
{
key
:
configEnum
.
INSIDESTATE
.
实体孵化
,
value
:
`实体孵化(
${
allCount
-
virtualCount
}
)`
},
{
key
:
configEnum
.
INSIDESTATE
.
虚拟孵化
,
value
:
`虚拟孵化(
${
virtualCount
}
)`
},
];
}
let
enterpriseList
=
[];
dataList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
splitResultConfig
.
MyEnterpriseDataConfig
,
info
,
false
);
if
(
state
!=
configEnum
.
FUHUASTATE
.
迁出
)
{
changeData
.
virtualCause
=
info
.
virtualCause
||
0
;
changeData
.
virtualCauseDes
=
info
.
virtualCauseDes
||
""
;
}
changeData
.
state
=
verificationEnumTools
.
changeEnumValue
(
configEnum
.
FUHUASTATE
,
changeData
.
state
);
enterpriseList
.
push
(
changeData
);
});
result
.
enterpriseList
=
enterpriseList
;
return
result
;
}
/**
* 修改企业孵化状态 修改为实体
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param uscc 企业统一信用代码
* @param leasedArea 租赁面积
* @returns {isSuccess:true/false}
*/
export
async
function
updatePhysicalInfo
(
fuHuaQiUscc
:
string
,
uscc
:
string
,
leasedArea
:
number
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
enterpriseInfo
.
leasedArea
=
leasedArea
;
enterpriseInfo
.
state
=
configEnum
.
FUHUASTATE
.
实体孵化
;
/**修改为实体,需要把虚拟的和迁出的字段清空 */
enterpriseInfo
.
virtualCause
=
null
;
//虚拟孵化模式
enterpriseInfo
.
virtualCauseDes
=
""
;
//虚拟孵化原因
enterpriseInfo
.
moveOutType
=
null
;
//迁出类型
enterpriseInfo
.
moveOutCause
=
[];
//迁出原因
enterpriseInfo
.
moveOutTime
=
0
;
await
enterpriseInfo
.
save
();
return
{
isUsccess
:
true
};
}
/**
* 修改企业孵化状态 修改为虚拟
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param uscc 企业统一信用代码
* @param virtualCauseDes 虚拟孵化其他原因
* @param virtualCause 虚拟孵化模式
* @returns {isSuccess:true/false}
*/
export
async
function
updateVirtualInfo
(
fuHuaQiUscc
:
string
,
uscc
:
string
,
virtualCauseDes
:
string
,
virtualCause
:
number
)
{
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为虚拟'
,
configEnum
.
VIRTUALCAUSE
,
virtualCause
);
if
(
virtualCause
==
configEnum
.
VIRTUALCAUSE
.
其他
&&
!
virtualCauseDes
)
{
throw
new
BizError
(
ERRORENUM
.
请填入其他原因
,
"修改企业孵化状态 修改为虚拟"
,
`virtualCause:
${
virtualCause
}
, virtualCauseDes:
${
virtualCauseDes
}
`
);
}
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
enterpriseInfo
.
virtualCause
=
virtualCause
;
if
(
virtualCauseDes
)
enterpriseInfo
.
virtualCauseDes
=
virtualCauseDes
;
enterpriseInfo
.
state
=
configEnum
.
FUHUASTATE
.
虚拟孵化
;
/**修改为虚拟时,需要把实体的和迁出的字段清空 */
enterpriseInfo
.
moveOutType
=
null
;
//迁出类型
enterpriseInfo
.
moveOutCause
=
[];
//迁出原因
enterpriseInfo
.
leasedArea
=
0
;
//租赁面积
enterpriseInfo
.
moveOutTime
=
0
;
await
enterpriseInfo
.
save
();
return
{
isUsccess
:
true
};
}
/**
* 修改企业孵化状态 修改为迁出
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param uscc 企业统一信用代码
* @param moveOutType 迁出类型
* @param moveOutTrace 迁出去向 2.3新加字段
* @param moveOutCause 迁出原因 多选
* @returns {isSuccess:true/false}
*/
export
async
function
updateMoveOutInfo
(
fuHuaQiUscc
:
string
,
uscc
:
string
,
moveOutType
:
number
,
moveOutTrace
:
number
,
moveOutCause
)
{
/**校验参数 */
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为迁出'
,
configEnum
.
MOVEOUTTYPE
,
moveOutType
);
if
(
moveOutType
!=
configEnum
.
MOVEOUTTYPE
.
企业注销
)
{
//选择了 非企业注销时 moveOutTrace 和 moveOutCause 为必选项
await
eccReqParamater
({
moveOutTrace
:
"Number"
,
moveOutCause
:
"[Number]"
},
{
moveOutTrace
,
moveOutCause
}
);
/**校验moveOutCause 和 moveOutTrace 是否符合规则*/
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为迁出'
,
configEnum
.
MOVEOUTTRACE
,
moveOutTrace
);
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为迁出'
,
configEnum
.
MOVEOUTCAUSE
,
moveOutCause
);
/**根据 不同的迁出类型 校验不同的迁出原因枚举 */
if
(
moveOutType
==
configEnum
.
MOVEOUTTYPE
.
毕业迁出
)
{
moveOutCause
=
[
moveOutCause
[
0
]];
//非毕业迁出是单选
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为迁出'
,
configEnum
.
MOVEOUTCAUSECLIENT
,
moveOutCause
);
}
if
(
moveOutType
==
configEnum
.
MOVEOUTTYPE
.
非毕业迁出
)
{
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为迁出'
,
configEnum
.
MOVEOUTCAUSENOTCLIENT
,
moveOutCause
);
}
}
else
{
/**如果是选择了企业注销 这里的两个参数要为空 */
moveOutTrace
=
0
;
moveOutCause
=
[];
}
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
enterpriseInfo
.
moveOutType
=
moveOutType
;
enterpriseInfo
.
moveOutCause
=
moveOutCause
;
enterpriseInfo
.
moveOutTrace
=
moveOutTrace
;
enterpriseInfo
.
moveOutTime
=
new
Date
().
valueOf
();
enterpriseInfo
.
state
=
configEnum
.
FUHUASTATE
.
迁出
;
/**修改为迁出时,需要把实体的和虚拟的字段清空 */
enterpriseInfo
.
virtualCause
=
null
;
//虚拟孵化模式
enterpriseInfo
.
virtualCauseDes
=
""
;
//虚拟孵化原因
enterpriseInfo
.
leasedArea
=
0
;
//租赁面积
await
enterpriseInfo
.
save
();
return
{
isUsccess
:
true
};
}
/**
* 企业基本信息 回显
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param uscc 企业统一信用代码
*/
export
async
function
getMyEnterpriseBaseInfo
(
fuHuaQiUscc
:
string
,
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
`我的企业 回显企业信息
${
uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
'企业基本信息回显'
,
`孵化器:
${
fuHuaQiUscc
}
企业:
${
uscc
}
`
);
let
changeData
=
extractData
(
splitResultConfig
.
MyEnterpriseBaseDataConfig
,
enterpriseInfo
,
false
);
return
{
enterpriseInfo
:
changeData
};
}
/**
* 修改我的企业基本信息
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param param 表单
*/
export
async
function
updateMyEnterpriseBaseInfo
(
fuHuaQiUscc
:
string
,
param
)
{
eccFormParam
(
"修改我的企业基本信息"
,
eccFormParamConfig
.
UpdateMyEnterpriseBaseDataConfig
,
param
);
verificationEnumTools
.
eccEnumValue
(
'修改新注册企业'
,
'industry'
,
configEnum
.
INDUSTRY
,
param
.
industry
);
if
(
!
sysTools
.
eccUscc
(
param
.
uscc
)
)
throw
new
BizError
(
ERRORENUM
.
统一社会信用代码不合法
);
const
Uscc
=
param
.
uscc
;
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
Uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
`我的企业 修改我的企业基本信息
${
Uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
'修改我的企业基本信息'
,
`孵化器:
${
fuHuaQiUscc
}
企业:
${
Uscc
}
`
);
/**修改字段 */
let
changeList
=
checkChange
(
param
,
enterpriseInfo
);
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
changeList
.
forEach
(
key
=>
{
enterpriseInfo
[
key
]
=
param
[
key
];
});
await
enterpriseInfo
.
save
();
/**更新分数 */
await
scoreBiz
.
updateScore
(
fuHuaQiUscc
,
configEnum
.
SCOREWAYS
.
我的企业数据
,
false
);
return
{
isSuccess
:
true
};
}
/**
* 补录新迁入企业信息
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param param 表单
*/
export
async
function
replenishMyEnterpriseInPutInfo
(
fuHuaQiUscc
:
string
,
param
)
{
eccFormParam
(
"补录新迁入企业信息"
,
eccFormParamConfig
.
ReplenishMyEnterpriseInPutDataConfig
,
param
);
verificationEnumTools
.
eccEnumValue
(
'补录新迁入企业信息'
,
'industry'
,
configEnum
.
INDUSTRY
,
param
.
industry
);
if
(
!
sysTools
.
eccUscc
(
param
.
uscc
)
)
throw
new
BizError
(
ERRORENUM
.
统一社会信用代码不合法
);
/**不能出现重复的统一社会信用代码 草稿的也不行 */
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
/**添加新注册企业标识 */
param
.
isCreate
=
false
;
//标识此次操作是否是迁入企业并不是新注册企业
param
.
state
=
configEnum
.
FUHUASTATE
.
实体孵化
;
await
enterpriseData
.
replenishEnterpriseData
(
fuHuaQiUscc
,
param
);
return
{
isSuccess
:
true
};
}
/**
* 补录新注册企业信息
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param param 表单
*/
export
async
function
replenishMyEnterpriseCreateInfo
(
fuHuaQiUscc
:
string
,
param
)
{
eccFormParam
(
"补录新迁入企业信息"
,
eccFormParamConfig
.
ReplenishMyEnterpriseCreateDataConfig
,
param
);
verificationEnumTools
.
eccEnumValue
(
'补录新迁入企业信息'
,
'industry'
,
configEnum
.
INDUSTRY
,
param
.
industry
);
if
(
!
sysTools
.
eccUscc
(
param
.
uscc
)
)
throw
new
BizError
(
ERRORENUM
.
统一社会信用代码不合法
);
/**不能出现重复的统一社会信用代码 草稿的也不行 */
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
/**添加新注册企业标识 */
param
.
isCreate
=
false
;
//标识此次操作是否是迁入企业并不是新注册企业
param
.
state
=
configEnum
.
FUHUASTATE
.
实体孵化
;
await
enterpriseData
.
replenishEnterpriseData
(
fuHuaQiUscc
,
param
);
return
{
isSuccess
:
true
};
}
src/biz/systemTask.ts
View file @
549887c0
...
...
@@ -16,7 +16,7 @@ import { sendTaskPointOut } from "./sms";
import
{
logHandle
}
from
"../util/log"
;
import
{
createSmsPointOutData
,
findSmsPointOutData
}
from
"../data/fuHuaQi/smsPointOut"
;
import
{
SMSTYPE
}
from
"../config/enum"
;
import
{
dataDeclarationTask
}
from
"./mobileEnterprise/dataDeclaration"
;
import
{
dataDeclarationTask
}
from
"./mobileEnterprise/
quarterTask/
dataDeclaration"
;
export
function
initSystemTask
()
{
/**孵化器任务 */
...
...
src/routers/enterpriseMobileClient/base.ts
View file @
549887c0
...
...
@@ -5,8 +5,11 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
{
checkEnterpriseToken
}
from
'../../middleware/user'
;
import
{
eccReqParamater
}
from
'../../util/verificationParam'
;
import
*
as
enterpriseBiz
from
'../../biz/mobileEnterprise/enterprise'
;
import
*
as
dataDeclarationBiz
from
'../../biz/mobileEnterprise/dataDeclaration'
;
import
*
as
enterpriseBiz
from
'../../biz/mobileEnterprise/base/enterprise'
;
import
*
as
initialTeamsBiz
from
'../../biz/mobileEnterprise/base/initialTeams'
;
import
*
as
intellectualPropertyBiz
from
'../../biz/mobileEnterprise/base/intellectualProperty'
;
import
*
as
qualificationBiz
from
'../../biz/mobileEnterprise/base/qualification'
;
import
*
as
dataDeclarationBiz
from
'../../biz/mobileEnterprise/quarterTask/dataDeclaration'
;
import
*
as
policyBiz
from
'../../biz/mobileEnterprise/policy'
;
...
...
@@ -57,7 +60,7 @@ async function updateTeamsState(req, res) {
let
reqConf
=
{
firstClassTalent
:
'Number'
,
teams
:
'[Object]'
};
let
{
firstClassTalent
,
teams
}
=
eccReqParamater
(
reqConf
,
req
.
body
,
[
"teams"
]);
let
result
=
await
enterprise
Biz
.
updateInitialTeamInfo
(
Uscc
,
firstClassTalent
,
teams
);
let
result
=
await
initialTeams
Biz
.
updateInitialTeamInfo
(
Uscc
,
firstClassTalent
,
teams
);
res
.
success
(
result
);
}
...
...
@@ -70,7 +73,7 @@ async function updateTeamsState(req, res) {
*/
async
function
initialTeamInfo
(
req
,
res
)
{
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterprise
Biz
.
selectInitialTeamInfo
(
Uscc
);
let
result
=
await
initialTeams
Biz
.
selectInitialTeamInfo
(
Uscc
);
res
.
success
(
result
);
}
...
...
@@ -87,7 +90,7 @@ async function updateIntellectualproperty(req, res) {
let
reqConf
=
{
alienPatent
:
'Number'
,
classIPatent
:
'Number'
,
secondClassPatent
:
'Number'
};
let
{
alienPatent
,
classIPatent
,
secondClassPatent
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
let
result
=
await
enterprise
Biz
.
updateIntellectualProperty
(
Uscc
,
alienPatent
,
classIPatent
,
secondClassPatent
);
let
result
=
await
intellectualProperty
Biz
.
updateIntellectualProperty
(
Uscc
,
alienPatent
,
classIPatent
,
secondClassPatent
);
res
.
success
(
result
);
}
...
...
@@ -100,7 +103,7 @@ async function updateIntellectualproperty(req, res) {
*/
async
function
intellectualpropertyInfo
(
req
,
res
)
{
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterprise
Biz
.
selectIntellectualProperty
(
Uscc
);
let
result
=
await
intellectualProperty
Biz
.
selectIntellectualProperty
(
Uscc
);
res
.
success
(
result
);
}
...
...
@@ -113,7 +116,7 @@ async function intellectualpropertyInfo(req, res) {
*/
async
function
qualificationInfo
(
req
,
res
)
{
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterprise
Biz
.
selectQualification
(
Uscc
);
let
result
=
await
qualification
Biz
.
selectQualification
(
Uscc
);
res
.
success
(
result
);
}
...
...
@@ -129,7 +132,7 @@ async function updateQualification(req, res) {
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
let
result
=
await
enterprise
Biz
.
updateQualification
(
Uscc
,
form
);
let
result
=
await
qualification
Biz
.
updateQualification
(
Uscc
,
form
);
res
.
success
(
result
);
}
...
...
src/routers/enterpriseMobileClient/businessdata.ts
View file @
549887c0
...
...
@@ -4,7 +4,7 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
{
checkEnterpriseToken
}
from
'../../middleware/user'
;
import
*
as
businessDataBiz
from
'../../biz/mobileEnterprise/businessData'
;
import
*
as
businessDataBiz
from
'../../biz/mobileEnterprise/
quarterTask/
businessData'
;
import
{
eccReqParamater
}
from
'../../util/verificationParam'
;
export
function
setRouter
(
httpServer
)
{
...
...
src/routers/enterpriseMobileClient/datadeclaration.ts
View file @
549887c0
...
...
@@ -4,7 +4,7 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
{
checkEnterpriseToken
}
from
'../../middleware/user'
;
import
*
as
dataDeclarationBiz
from
'../../biz/mobileEnterprise/dataDeclaration'
;
import
*
as
dataDeclarationBiz
from
'../../biz/mobileEnterprise/
quarterTask/
dataDeclaration'
;
import
{
eccReqParamater
}
from
'../../util/verificationParam'
;
...
...
src/routers/mobileClient/enterprise.ts
View file @
549887c0
...
...
@@ -4,6 +4,7 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
enterpriseBiz
from
'../../biz/mobileFuHuaQi/enterprise/enterprise'
;
import
*
as
myEnterpriseBiz
from
'../../biz/mobileFuHuaQi/enterprise/myEnterprise'
;
import
*
as
toExamineBiz
from
'../../biz/mobileFuHuaQi/enterprise/toExamine'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
import
{
eccReqParamater
}
from
'../../util/verificationParam'
;
...
...
@@ -146,7 +147,7 @@ async function myEnterpriseList(req, res) {
let
reqConf
=
{
name
:
'String'
,
state
:
"Number"
,
page
:
"Number"
};
let
{
name
,
state
,
page
}
=
eccReqParamater
(
reqConf
,
req
.
body
,
[
"name"
]);
const
Uscc
=
req
.
headers
.
uscc
;
let
data
=
await
e
nterpriseBiz
.
myEnterprise
(
Uscc
,
state
,
name
,
page
);
let
data
=
await
myE
nterpriseBiz
.
myEnterprise
(
Uscc
,
state
,
name
,
page
);
res
.
success
(
data
);
}
...
...
@@ -162,7 +163,7 @@ async function myEnterpriseMoveOutList(req, res) {
let
reqConf
=
{
name
:
'String'
,
page
:
"Number"
};
let
{
name
,
page
}
=
eccReqParamater
(
reqConf
,
req
.
body
,
[
"name"
]);
const
Uscc
=
req
.
headers
.
uscc
;
let
data
=
await
e
nterpriseBiz
.
myEnterprise
(
Uscc
,
FUHUASTATE
.
迁出
,
name
,
page
);
let
data
=
await
myE
nterpriseBiz
.
myEnterprise
(
Uscc
,
FUHUASTATE
.
迁出
,
name
,
page
);
res
.
success
(
data
);
}
...
...
@@ -180,7 +181,7 @@ async function myEnterpriseInfo(req, res) {
let
reqConf
=
{
uscc
:
'String'
};
let
{
uscc
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
FuHuaQiUscc
=
req
.
headers
.
uscc
;
let
result
=
await
e
nterpriseBiz
.
getMyEnterpriseBaseInfo
(
FuHuaQiUscc
,
uscc
);
let
result
=
await
myE
nterpriseBiz
.
getMyEnterpriseBaseInfo
(
FuHuaQiUscc
,
uscc
);
res
.
success
(
result
);
}
...
...
@@ -196,7 +197,7 @@ async function updatePhysical(req, res) {
let
{
leasedArea
,
uscc
}
=
await
eccReqParamater
(
reqConf
,
req
.
body
);
const
FuHuaQiUscc
=
req
.
headers
.
uscc
;
let
result
=
await
e
nterpriseBiz
.
updatePhysicalInfo
(
FuHuaQiUscc
,
uscc
,
leasedArea
);
let
result
=
await
myE
nterpriseBiz
.
updatePhysicalInfo
(
FuHuaQiUscc
,
uscc
,
leasedArea
);
res
.
success
(
result
);
}
...
...
@@ -213,7 +214,7 @@ async function updateVirtual(req, res) {
let
{
virtualCause
,
uscc
,
virtualCauseDes
}
=
await
eccReqParamater
(
reqConf
,
req
.
body
,
[
"virtualCauseDes"
]);
const
FuHuaQiUscc
=
req
.
headers
.
uscc
;
let
result
=
await
e
nterpriseBiz
.
updateVirtualInfo
(
FuHuaQiUscc
,
uscc
,
virtualCauseDes
,
virtualCause
);
let
result
=
await
myE
nterpriseBiz
.
updateVirtualInfo
(
FuHuaQiUscc
,
uscc
,
virtualCauseDes
,
virtualCause
);
res
.
success
(
result
);
}
...
...
@@ -231,7 +232,7 @@ async function updateMoveOut(req, res) {
let
{
moveOutType
,
uscc
,
moveOutCause
,
moveOutTrace
}
=
await
eccReqParamater
(
reqConf
,
req
.
body
,
skipList
);
const
FuHuaQiUscc
=
req
.
headers
.
uscc
;
let
result
=
await
e
nterpriseBiz
.
updateMoveOutInfo
(
FuHuaQiUscc
,
uscc
,
moveOutType
,
moveOutTrace
,
moveOutCause
);
let
result
=
await
myE
nterpriseBiz
.
updateMoveOutInfo
(
FuHuaQiUscc
,
uscc
,
moveOutType
,
moveOutTrace
,
moveOutCause
);
res
.
success
(
result
);
}
...
...
@@ -248,7 +249,7 @@ async function updateMyEnterpriseInfo(req, res) {
let
{
form
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
e
nterpriseBiz
.
updateMyEnterpriseBaseInfo
(
Uscc
,
form
);
let
result
=
await
myE
nterpriseBiz
.
updateMyEnterpriseBaseInfo
(
Uscc
,
form
);
res
.
success
(
result
);
}
...
...
@@ -264,7 +265,7 @@ async function replenishCreate(req, res) {
let
{
form
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
e
nterpriseBiz
.
replenishMyEnterpriseCreateInfo
(
Uscc
,
form
);
let
result
=
await
myE
nterpriseBiz
.
replenishMyEnterpriseCreateInfo
(
Uscc
,
form
);
res
.
success
(
result
);
}
...
...
@@ -280,7 +281,7 @@ async function replenishInPut(req, res) {
let
{
form
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
e
nterpriseBiz
.
replenishMyEnterpriseInPutInfo
(
Uscc
,
form
);
let
result
=
await
myE
nterpriseBiz
.
replenishMyEnterpriseInPutInfo
(
Uscc
,
form
);
res
.
success
(
result
);
}
...
...
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