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
5519de88
Commit
5519de88
authored
Feb 20, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化工具层
parent
327bde65
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
373 additions
and
370 deletions
+373
-370
enterprise.ts
src/biz/enterprise/enterprise.ts
+39
-36
financing.ts
src/biz/enterprise/financing.ts
+39
-20
base.ts
src/biz/fuHuqQi/base.ts
+51
-27
month.ts
src/biz/fuHuqQi/month.ts
+27
-6
task.ts
src/biz/fuHuqQi/task.ts
+1
-1
user.ts
src/biz/fuHuqQi/user.ts
+10
-8
user.ts
src/biz/guanWeiHui/user.ts
+1
-1
systemTask.ts
src/biz/systemTask.ts
+1
-1
main.ts
src/main.ts
+1
-2
enterprise.ts
src/routers/admin/enterprise.ts
+8
-43
fuHuaQi.ts
src/routers/admin/fuHuaQi.ts
+13
-48
user.ts
src/routers/admin/user.ts
+6
-2
enterprise.ts
src/routers/mobileClient/enterprise.ts
+7
-7
financing.ts
src/routers/mobileClient/financing.ts
+5
-5
fuHuaQi.ts
src/routers/mobileClient/fuHuaQi.ts
+5
-7
month.ts
src/routers/mobileClient/month.ts
+3
-3
user.ts
src/routers/mobileClient/user.ts
+3
-3
public.ts
src/routers/public.ts
+0
-1
dataInit.ts
src/tools/dataInit.ts
+1
-1
system.ts
src/tools/system.ts
+49
-0
log.ts
src/util/log.ts
+2
-2
piecemeal.ts
src/util/piecemeal.ts
+38
-0
verificationEnum.ts
src/util/verificationEnum.ts
+40
-0
verificationParam.ts
src/util/verificationParam.ts
+23
-146
No files found.
src/biz/enterprise/enterprise.ts
View file @
5519de88
...
@@ -8,11 +8,14 @@ import * as paramConfig from "../../config/checkParamConfig";
...
@@ -8,11 +8,14 @@ import * as paramConfig from "../../config/checkParamConfig";
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
EnterpriseInfoConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
EnterpriseInfoConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
*
as
tools
from
"../../util/tools
"
;
import
*
as
sysTools
from
"../../tools/system
"
;
import
*
as
enterpriseData
from
"../../data/enterprise/enterprise"
;
import
*
as
enterpriseData
from
"../../data/enterprise/enterprise"
;
import
{
EnterpriseListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
EnterpriseListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
*
as
fuHuaQiData
from
"../../data/fuHuaQi/fuhuaqi"
;
import
*
as
fuHuaQiData
from
"../../data/fuHuaQi/fuhuaqi"
;
import
*
as
configEnum
from
"../../config/enum"
;
import
*
as
configEnum
from
"../../config/enum"
;
import
{
eccFormParam
}
from
"../../util/verificationParam"
;
import
{
changeEnumValue
}
from
"../../util/verificationEnum"
;
import
{
checkChange
,
extractData
}
from
"../../util/piecemeal"
;
/**
/**
...
@@ -23,15 +26,15 @@ import * as configEnum from "../../config/enum";
...
@@ -23,15 +26,15 @@ import * as configEnum from "../../config/enum";
* @returns {isSuccess:true/false}
* @returns {isSuccess:true/false}
*/
*/
export
async
function
registerEnterprise
(
uscc
:
string
,
param
)
{
export
async
function
registerEnterprise
(
uscc
:
string
,
param
)
{
const
TaskId
=
t
ools
.
getTaskId
(
uscc
);
const
TaskId
=
sysT
ools
.
getTaskId
(
uscc
);
tools
.
checkParamater
(
"新注册企业"
,
paramConfig
.
RegisterEnterpriseParamConfig
,
param
);
//校验表单参数
eccFormParam
(
"新注册企业"
,
paramConfig
.
RegisterEnterpriseParamConfig
,
param
);
//校验表单参数
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
param
.
draftId
=
t
ools
.
getDraftId
(
uscc
);
//草稿箱id
param
.
draftId
=
sysT
ools
.
getDraftId
(
uscc
);
//草稿箱id
param
.
isCreate
=
true
;
//标识此次操作是否是新注册企业并不是迁入企业
param
.
isCreate
=
true
;
//标识此次操作是否是新注册企业并不是迁入企业
await
enterpriseData
.
createEnterprise
(
uscc
,
TaskId
,
param
);
await
enterpriseData
.
createEnterprise
(
uscc
,
TaskId
,
param
);
...
@@ -49,7 +52,7 @@ export async function registerEnterprise(uscc:string, param) {
...
@@ -49,7 +52,7 @@ export async function registerEnterprise(uscc:string, param) {
*/
*/
export
async
function
updateRegisterEnterprise
(
uscc
:
string
,
param
)
{
export
async
function
updateRegisterEnterprise
(
uscc
:
string
,
param
)
{
tools
.
checkParamater
(
"新注册企业表单修改"
,
paramConfig
.
EnterpriseParamFormConfig
,
param
,[
"oldLogonAdd"
,
"timeOfImmigration"
]);
//校验表单参数
eccFormParam
(
"新注册企业表单修改"
,
paramConfig
.
EnterpriseParamFormConfig
,
param
,[
"oldLogonAdd"
,
"timeOfImmigration"
]);
//校验表单参数
let
usccSelectDataBaseList
=
await
enterpriseData
.
findEnterpriseList
({
uscc
:
param
.
uscc
});
let
usccSelectDataBaseList
=
await
enterpriseData
.
findEnterpriseList
({
uscc
:
param
.
uscc
});
...
@@ -60,7 +63,7 @@ export async function updateRegisterEnterprise(uscc:string, param) {
...
@@ -60,7 +63,7 @@ export async function updateRegisterEnterprise(uscc:string, param) {
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByDraftId
(
param
.
draftId
);
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByDraftId
(
param
.
draftId
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
param
.
uscc
}
这个企业`
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
param
.
uscc
}
这个企业`
);
let
changeList
=
tools
.
checkChange
(
param
,
dataBaseInfo
);
//比对修改字段
let
changeList
=
checkChange
(
param
,
dataBaseInfo
);
//比对修改字段
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
changeList
.
forEach
(
key
=>
{
changeList
.
forEach
(
key
=>
{
...
@@ -81,14 +84,14 @@ export async function updateRegisterEnterprise(uscc:string, param) {
...
@@ -81,14 +84,14 @@ export async function updateRegisterEnterprise(uscc:string, param) {
* @returns {isSuccess:true/false}
* @returns {isSuccess:true/false}
*/
*/
export
async
function
moveInEnterprise
(
uscc
:
string
,
param
)
{
export
async
function
moveInEnterprise
(
uscc
:
string
,
param
)
{
const
TaskId
=
t
ools
.
getTaskId
(
uscc
);
const
TaskId
=
sysT
ools
.
getTaskId
(
uscc
);
tools
.
checkParamater
(
"迁入企业登记"
,
paramConfig
.
MoveInEnterpriseParamConfig
,
param
,
[
"oldLogonAdd"
,
"timeOfImmigration"
]);
//校验表单参数
eccFormParam
(
"迁入企业登记"
,
paramConfig
.
MoveInEnterpriseParamConfig
,
param
,
[
"oldLogonAdd"
,
"timeOfImmigration"
]);
//校验表单参数
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
param
.
draftId
=
t
ools
.
getDraftId
(
uscc
);
//草稿箱id
param
.
draftId
=
sysT
ools
.
getDraftId
(
uscc
);
//草稿箱id
await
enterpriseData
.
createEnterprise
(
uscc
,
TaskId
,
param
);
await
enterpriseData
.
createEnterprise
(
uscc
,
TaskId
,
param
);
return
{
isSuccess
:
true
};
return
{
isSuccess
:
true
};
...
@@ -104,12 +107,12 @@ export async function moveInEnterprise(uscc:string, param) {
...
@@ -104,12 +107,12 @@ export async function moveInEnterprise(uscc:string, param) {
*/
*/
export
async
function
updateMoveInEnterprise
(
uscc
:
string
,
param
)
{
export
async
function
updateMoveInEnterprise
(
uscc
:
string
,
param
)
{
tools
.
checkParamater
(
"修改迁入企业登记信息"
,
paramConfig
.
EnterpriseParamFormConfig
,
param
);
//校验表单参数
eccFormParam
(
"修改迁入企业登记信息"
,
paramConfig
.
EnterpriseParamFormConfig
,
param
);
//校验表单参数
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByDraftId
(
param
.
draftId
);
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByDraftId
(
param
.
draftId
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
param
.
uscc
}
这个企业`
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
param
.
uscc
}
这个企业`
);
let
changeList
=
tools
.
checkChange
(
param
,
dataBaseInfo
);
let
changeList
=
checkChange
(
param
,
dataBaseInfo
);
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
changeList
.
forEach
(
key
=>
{
changeList
.
forEach
(
key
=>
{
...
@@ -131,7 +134,7 @@ export async function getEnterpriseByDraftId(draftId:string) {
...
@@ -131,7 +134,7 @@ export async function getEnterpriseByDraftId(draftId:string) {
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByDraftId
(
draftId
);
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByDraftId
(
draftId
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在draftId=
${
draftId
}
这个企业`
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在draftId=
${
draftId
}
这个企业`
);
let
data
:
any
=
tools
.
extractData
(
EnterpriseInfoConfig
,
dataBaseInfo
,
false
);
let
data
:
any
=
extractData
(
EnterpriseInfoConfig
,
dataBaseInfo
,
false
);
data
.
draftId
=
dataBaseInfo
.
draftId
;
data
.
draftId
=
dataBaseInfo
.
draftId
;
return
{
data
};
return
{
data
};
...
@@ -167,15 +170,6 @@ export async function deleteEnterpriseByDraftId(draftId:string) {
...
@@ -167,15 +170,6 @@ export async function deleteEnterpriseByDraftId(draftId:string) {
*/
*/
export
async
function
enterpriseList
(
createType
:
number
,
fuHuaQiUscc
:
string
,
industry
,
isNaturalPersonHolding
:
number
,
page
:
number
)
{
export
async
function
enterpriseList
(
createType
:
number
,
fuHuaQiUscc
:
string
,
industry
,
isNaturalPersonHolding
:
number
,
page
:
number
)
{
let
selectParam
:
any
=
{};
let
selectParam
:
any
=
{};
// if ( time.length > 0 ) {
// let startT = moment(time).startOf('month').valueOf();
// let endT = moment(time).endOf('month').valueOf();
// selectParam['$or'] = [
// {"firstIncubationTime":{'$gt':startT, '$lt':endT}},
// {"timeOfImmigration":{'$gt':startT, '$lt':endT}},
// ];
// }
// if (time) selectParam.logonTime = time; selectParam.timeOfImmigration = time;
if
(
createType
==
2
||
createType
==
3
)
{
if
(
createType
==
2
||
createType
==
3
)
{
selectParam
.
isCreate
=
createType
==
2
?
true
:
false
;
selectParam
.
isCreate
=
createType
==
2
?
true
:
false
;
...
@@ -193,7 +187,7 @@ export async function enterpriseList(createType:number, fuHuaQiUscc:string, indu
...
@@ -193,7 +187,7 @@ export async function enterpriseList(createType:number, fuHuaQiUscc:string, indu
let
dataList
=
[];
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
tools
.
extractData
(
EnterpriseListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
EnterpriseListConfig
,
info
,
true
);
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
if
(
info
.
enterpriseIsInPut
)
{
if
(
info
.
enterpriseIsInPut
)
{
...
@@ -201,7 +195,7 @@ export async function enterpriseList(createType:number, fuHuaQiUscc:string, indu
...
@@ -201,7 +195,7 @@ export async function enterpriseList(createType:number, fuHuaQiUscc:string, indu
}
else
{
}
else
{
(
changeData
.
isCreate
)
?
changeData
.
isCreate
=
"新注册"
:
changeData
.
isCreate
=
"新迁入"
;
(
changeData
.
isCreate
)
?
changeData
.
isCreate
=
"新注册"
:
changeData
.
isCreate
=
"新迁入"
;
}
}
changeData
.
industry
=
tools
.
changeEnumValue
(
configEnum
.
INDUSTRY
,
changeData
.
industry
);
changeData
.
industry
=
changeEnumValue
(
configEnum
.
INDUSTRY
,
changeData
.
industry
);
dataList
.
push
(
changeData
);
dataList
.
push
(
changeData
);
});
});
...
@@ -222,15 +216,6 @@ export async function enterpriseList(createType:number, fuHuaQiUscc:string, indu
...
@@ -222,15 +216,6 @@ export async function enterpriseList(createType:number, fuHuaQiUscc:string, indu
export
async
function
outPutEnterpriseData
(
createType
:
number
,
fuHuaQiUscc
:
string
,
industry
,
isNaturalPersonHolding
:
number
,
type
:
Number
)
{
export
async
function
outPutEnterpriseData
(
createType
:
number
,
fuHuaQiUscc
:
string
,
industry
,
isNaturalPersonHolding
:
number
,
type
:
Number
)
{
let
selectParam
:
any
=
{};
let
selectParam
:
any
=
{};
if
(
type
==
configEnum
.
OUTPUTTYPE
.
当前数据
)
{
if
(
type
==
configEnum
.
OUTPUTTYPE
.
当前数据
)
{
// if ( time.length > 0 ) {
// let startT = moment(time).startOf('month').valueOf();
// let endT = moment(time).endOf('month').valueOf();
// selectParam['$or'] = [
// {"firstIncubationTime":{'$gt':startT, '$lt':endT}},
// {"timeOfImmigration":{'$gt':startT, '$lt':endT}},
// ];
// }
// if (time) selectParam.logonTime = time; selectParam.timeOfImmigration = time;
if
(
createType
==
2
||
createType
==
3
)
{
if
(
createType
==
2
||
createType
==
3
)
{
selectParam
.
isCreate
=
createType
==
2
?
true
:
false
;
selectParam
.
isCreate
=
createType
==
2
?
true
:
false
;
}
}
...
@@ -239,7 +224,6 @@ export async function outPutEnterpriseData(createType:number, fuHuaQiUscc:string
...
@@ -239,7 +224,6 @@ export async function outPutEnterpriseData(createType:number, fuHuaQiUscc:string
if
(
isNaturalPersonHolding
==
2
||
isNaturalPersonHolding
==
3
)
{
if
(
isNaturalPersonHolding
==
2
||
isNaturalPersonHolding
==
3
)
{
selectParam
.
isNaturalPersonHolding
=
isNaturalPersonHolding
==
2
?
true
:
false
;
selectParam
.
isNaturalPersonHolding
=
isNaturalPersonHolding
==
2
?
true
:
false
;
}
}
}
}
let
usccMap
=
await
fuHuaQiData
.
findAllFuHuaQiOperationNameMap
();
let
usccMap
=
await
fuHuaQiData
.
findAllFuHuaQiOperationNameMap
();
...
@@ -247,18 +231,37 @@ export async function outPutEnterpriseData(createType:number, fuHuaQiUscc:string
...
@@ -247,18 +231,37 @@ export async function outPutEnterpriseData(createType:number, fuHuaQiUscc:string
let
dataBaseList
=
await
enterpriseData
.
findEnterpriseList
(
selectParam
);
let
dataBaseList
=
await
enterpriseData
.
findEnterpriseList
(
selectParam
);
let
dataList
=
[];
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
tools
.
extractData
(
EnterpriseListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
EnterpriseListConfig
,
info
,
true
);
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
if
(
info
.
enterpriseIsInPut
)
{
if
(
info
.
enterpriseIsInPut
)
{
changeData
.
isCreate
=
""
;
changeData
.
isCreate
=
""
;
}
else
{
}
else
{
(
changeData
.
isCreate
)
?
changeData
.
isCreate
=
"新注册"
:
changeData
.
isCreate
=
"新迁入"
;
(
changeData
.
isCreate
)
?
changeData
.
isCreate
=
"新注册"
:
changeData
.
isCreate
=
"新迁入"
;
}
}
changeData
.
industry
=
tools
.
changeEnumValue
(
configEnum
.
INDUSTRY
,
changeData
.
industry
);
changeData
.
industry
=
changeEnumValue
(
configEnum
.
INDUSTRY
,
changeData
.
industry
);
dataList
.
push
(
changeData
);
dataList
.
push
(
changeData
);
});
});
return
dataList
;
let
keyList
=
[
"name"
,
"createTime"
,
"fuhuaqiUscc"
,
"uscc"
,
"industry"
,
"logonTime"
,
"firstIncubationTime"
,
"timeOfImmigration"
,
"isNaturalPersonHolding"
,
"oldLogonAdd"
,
"logonAdd"
,
"operatingAdd"
,
"leasedArea"
];
let
titleList
=
[
"企业名称"
,
"入库时间"
,
"所属孵化器"
,
"统一信用代码"
,
"行业领域"
,
"注册时间"
,
"首次入孵时间"
,
"迁入时间"
,
"是否自然人控股"
,
"迁入前注册地址"
,
"注册地址"
,
"经营地址"
,
"租赁面积(平方米)"
];
let
result
=
[
titleList
];
dataList
.
forEach
(
info
=>
{
let
subList
=
[];
keyList
.
forEach
(
subInfo
=>
{
subList
.
push
(
info
[
subInfo
]
||
''
);
});
result
.
push
(
subList
);
});
return
result
;
}
}
...
...
src/biz/enterprise/financing.ts
View file @
5519de88
...
@@ -10,11 +10,14 @@ import { EnterpriseFinancingInfoConfig } from "../../config/ojbectResultKeyConfi
...
@@ -10,11 +10,14 @@ import { EnterpriseFinancingInfoConfig } from "../../config/ojbectResultKeyConfi
import
*
as
financingData
from
"../../data/enterprise/financing"
;
import
*
as
financingData
from
"../../data/enterprise/financing"
;
import
{
FinancingListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
FinancingListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
*
as
tool
from
"../../util/tools
"
;
import
*
as
sysTools
from
"../../tools/system
"
;
import
*
as
enterpriseData
from
"../../data/enterprise/enterprise"
;
import
*
as
enterpriseData
from
"../../data/enterprise/enterprise"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
;
import
moment
=
require
(
"moment"
);
import
moment
=
require
(
"moment"
);
import
*
as
configEnum
from
"../../config/enum"
;
import
*
as
configEnum
from
"../../config/enum"
;
import
{
eccFormParam
}
from
"../../util/verificationParam"
;
import
{
changeEnumValue
}
from
"../../util/verificationEnum"
;
import
{
checkChange
,
extractData
}
from
"../../util/piecemeal"
;
/**
/**
...
@@ -25,7 +28,7 @@ import * as configEnum from "../../config/enum";
...
@@ -25,7 +28,7 @@ import * as configEnum from "../../config/enum";
* @returns {isSuccess:true/false}
* @returns {isSuccess:true/false}
*/
*/
export
async
function
createFinancingInfo
(
uscc
:
string
,
param
)
{
export
async
function
createFinancingInfo
(
uscc
:
string
,
param
)
{
tool
.
checkParamater
(
"录入企业融资信息"
,
FinancingParamConfig
,
param
,
[
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentAmount"
,
"fuHuaQiInvestmentStyle"
]);
eccFormParam
(
"录入企业融资信息"
,
FinancingParamConfig
,
param
,
[
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentAmount"
,
"fuHuaQiInvestmentStyle"
]);
if
(
param
.
fuHuaQiInvestment
)
{
if
(
param
.
fuHuaQiInvestment
)
{
let
subCheckName
=
"录入企业融资信息_孵化器是否参与"
;
let
subCheckName
=
"录入企业融资信息_孵化器是否参与"
;
...
@@ -33,7 +36,7 @@ export async function createFinancingInfo(uscc:string, param) {
...
@@ -33,7 +36,7 @@ export async function createFinancingInfo(uscc:string, param) {
fuHuaQiInvestmentAmount
:
param
.
fuHuaQiInvestmentAmount
,
fuHuaQiInvestmentAmount
:
param
.
fuHuaQiInvestmentAmount
,
fuHuaQiInvestmentStyle
:
param
.
fuHuaQiInvestmentStyle
,
fuHuaQiInvestmentStyle
:
param
.
fuHuaQiInvestmentStyle
,
};
};
tool
.
checkParamater
(
subCheckName
,
{
fuHuaQiInvestmentAmount
:
"Number"
,
fuHuaQiInvestmentStyle
:
"Number"
},
subCheckData
);
eccFormParam
(
subCheckName
,
{
fuHuaQiInvestmentAmount
:
"Number"
,
fuHuaQiInvestmentStyle
:
"Number"
},
subCheckData
);
}
else
{
}
else
{
param
.
fuHuaQiInvestmentAmount
=
0
;
param
.
fuHuaQiInvestmentAmount
=
0
;
param
.
fuHuaQiInvestmentStyle
=
0
;
param
.
fuHuaQiInvestmentStyle
=
0
;
...
@@ -44,7 +47,7 @@ export async function createFinancingInfo(uscc:string, param) {
...
@@ -44,7 +47,7 @@ export async function createFinancingInfo(uscc:string, param) {
param
.
uscc
=
enterpriseInfo
.
uscc
;
//前端无需传入企业的uscc 库中需要企业的uscc
param
.
uscc
=
enterpriseInfo
.
uscc
;
//前端无需传入企业的uscc 库中需要企业的uscc
const
TaskId
=
tool
.
getTaskId
(
uscc
);
const
TaskId
=
sysTools
.
getTaskId
(
uscc
);
/**一个企业一个月只能填报一次融资信息 */
/**一个企业一个月只能填报一次融资信息 */
let
dataBaseInfo
=
await
financingData
.
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
param
.
uscc
);
let
dataBaseInfo
=
await
financingData
.
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
param
.
uscc
);
...
@@ -65,7 +68,7 @@ export async function createFinancingInfo(uscc:string, param) {
...
@@ -65,7 +68,7 @@ export async function createFinancingInfo(uscc:string, param) {
* @returns {isSuccess:true/false}
* @returns {isSuccess:true/false}
*/
*/
export
async
function
updateFinancingInfo
(
uscc
:
string
,
param
)
{
export
async
function
updateFinancingInfo
(
uscc
:
string
,
param
)
{
tool
.
checkParamater
(
"更新融资企业信息"
,
FinancingParamUpdateConfig
,
param
,
[
"fuHuaQiInvestmentAmount"
,
"fuHuaQiInvestmentStyle"
]);
eccFormParam
(
"更新融资企业信息"
,
FinancingParamUpdateConfig
,
param
,
[
"fuHuaQiInvestmentAmount"
,
"fuHuaQiInvestmentStyle"
]);
if
(
param
.
fuHuaQiInvestment
)
{
if
(
param
.
fuHuaQiInvestment
)
{
let
subCheckName
=
"录入企业融资信息_孵化器是否参与"
;
let
subCheckName
=
"录入企业融资信息_孵化器是否参与"
;
...
@@ -73,17 +76,17 @@ export async function updateFinancingInfo(uscc:string, param) {
...
@@ -73,17 +76,17 @@ export async function updateFinancingInfo(uscc:string, param) {
fuHuaQiInvestmentAmount
:
param
.
fuHuaQiInvestmentAmount
,
fuHuaQiInvestmentAmount
:
param
.
fuHuaQiInvestmentAmount
,
fuHuaQiInvestmentStyle
:
param
.
fuHuaQiInvestmentStyle
,
fuHuaQiInvestmentStyle
:
param
.
fuHuaQiInvestmentStyle
,
};
};
tool
.
checkParamater
(
subCheckName
,
{
fuHuaQiInvestmentAmount
:
"Number"
,
fuHuaQiInvestmentStyle
:
"Number"
},
subCheckData
);
eccFormParam
(
subCheckName
,
{
fuHuaQiInvestmentAmount
:
"Number"
,
fuHuaQiInvestmentStyle
:
"Number"
},
subCheckData
);
}
else
{
}
else
{
param
.
fuHuaQiInvestmentAmount
=
0
;
param
.
fuHuaQiInvestmentAmount
=
0
;
param
.
fuHuaQiInvestmentStyle
=
0
;
param
.
fuHuaQiInvestmentStyle
=
0
;
}
}
const
TaskId
=
tool
.
getTaskId
(
uscc
);
const
TaskId
=
sysTools
.
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
financingData
.
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
param
.
uscc
);
let
dataBaseInfo
=
await
financingData
.
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
param
.
uscc
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
TaskId
}
的任务`
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
TaskId
}
的任务`
);
let
changeList
=
tool
.
checkChange
(
param
,
dataBaseInfo
);
let
changeList
=
checkChange
(
param
,
dataBaseInfo
);
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
changeList
.
forEach
(
key
=>
{
changeList
.
forEach
(
key
=>
{
dataBaseInfo
[
key
]
=
param
[
key
];
dataBaseInfo
[
key
]
=
param
[
key
];
...
@@ -103,12 +106,12 @@ export async function updateFinancingInfo(uscc:string, param) {
...
@@ -103,12 +106,12 @@ export async function updateFinancingInfo(uscc:string, param) {
* @returns {data:{}} 表单
* @returns {data:{}} 表单
*/
*/
export
async
function
getEnterpriseFinancingByUscc
(
fuHuaQiUscc
:
string
,
uscc
:
string
)
{
export
async
function
getEnterpriseFinancingByUscc
(
fuHuaQiUscc
:
string
,
uscc
:
string
)
{
const
TaskId
=
tool
.
getTaskId
(
fuHuaQiUscc
);
const
TaskId
=
sysTools
.
getTaskId
(
fuHuaQiUscc
);
let
dataBaseInfo
=
await
financingData
.
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
uscc
);
let
dataBaseInfo
=
await
financingData
.
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
uscc
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
uscc
}
这个企业的本次融资数据`
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
uscc
}
这个企业的本次融资数据`
);
let
data
=
tool
.
extractData
(
EnterpriseFinancingInfoConfig
,
dataBaseInfo
,
false
);
let
data
=
extractData
(
EnterpriseFinancingInfoConfig
,
dataBaseInfo
,
false
);
return
{
data
};
return
{
data
};
}
}
...
@@ -122,7 +125,7 @@ export async function getEnterpriseFinancingByUscc(fuHuaQiUscc:string, uscc:stri
...
@@ -122,7 +125,7 @@ export async function getEnterpriseFinancingByUscc(fuHuaQiUscc:string, uscc:stri
* @returns {isSuccess:true/false}
* @returns {isSuccess:true/false}
*/
*/
export
async
function
deleteEnterpriseFinancingByUscc
(
fuHuaQiUscc
:
string
,
uscc
:
string
)
{
export
async
function
deleteEnterpriseFinancingByUscc
(
fuHuaQiUscc
:
string
,
uscc
:
string
)
{
const
TaskId
=
tool
.
getTaskId
(
fuHuaQiUscc
);
const
TaskId
=
sysTools
.
getTaskId
(
fuHuaQiUscc
);
let
dataBaseInfo
=
await
financingData
.
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
uscc
);
let
dataBaseInfo
=
await
financingData
.
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
uscc
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
uscc
}
这个企业`
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
uscc
}
这个企业`
);
...
@@ -194,12 +197,12 @@ export async function financingList(monthData:string, fuHuaQiName:string, indust
...
@@ -194,12 +197,12 @@ export async function financingList(monthData:string, fuHuaQiName:string, indust
let
dataList
=
[];
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
tool
.
extractData
(
FinancingListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
FinancingListConfig
,
info
,
true
);
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
changeData
.
industry
=
tool
.
changeEnumValue
(
configEnum
.
INDUSTRY
,
info
.
industry
);
changeData
.
industry
=
changeEnumValue
(
configEnum
.
INDUSTRY
,
info
.
industry
);
changeData
.
financingRounds
=
tool
.
changeEnumValue
(
configEnum
.
FINANCINGROUNDS
,
info
.
financingRounds
);
changeData
.
financingRounds
=
changeEnumValue
(
configEnum
.
FINANCINGROUNDS
,
info
.
financingRounds
);
changeData
.
fuHuaQiInvestmentStyle
=
tool
.
changeEnumValue
(
configEnum
.
FUHUAQILNVESTMENTSTYLE
,
info
.
fuHuaQiInvestmentStyle
);
changeData
.
fuHuaQiInvestmentStyle
=
changeEnumValue
(
configEnum
.
FUHUAQILNVESTMENTSTYLE
,
info
.
fuHuaQiInvestmentStyle
);
dataList
.
push
(
changeData
);
dataList
.
push
(
changeData
);
});
});
...
@@ -228,7 +231,6 @@ export async function outPutFinancingList(monthData:string, fuHuaQiName:string,
...
@@ -228,7 +231,6 @@ export async function outPutFinancingList(monthData:string, fuHuaQiName:string,
if
(
fuHuaQiInfo
)
fuHuaQiUscc
=
fuHuaQiInfo
.
uscc
;
if
(
fuHuaQiInfo
)
fuHuaQiUscc
=
fuHuaQiInfo
.
uscc
;
}
}
if
(
monthData
.
length
>
0
)
{
if
(
monthData
.
length
>
0
)
{
let
startT
=
moment
(
monthData
).
startOf
(
'month'
).
valueOf
();
let
startT
=
moment
(
monthData
).
startOf
(
'month'
).
valueOf
();
let
endT
=
moment
(
monthData
).
endOf
(
'month'
).
valueOf
();
let
endT
=
moment
(
monthData
).
endOf
(
'month'
).
valueOf
();
...
@@ -239,7 +241,6 @@ export async function outPutFinancingList(monthData:string, fuHuaQiName:string,
...
@@ -239,7 +241,6 @@ export async function outPutFinancingList(monthData:string, fuHuaQiName:string,
if
(
fuHuaQiInvestment
==
2
||
fuHuaQiInvestment
==
3
)
{
if
(
fuHuaQiInvestment
==
2
||
fuHuaQiInvestment
==
3
)
{
selectParam
.
fuHuaQiInvestment
=
fuHuaQiInvestment
==
2
?
true
:
false
;
selectParam
.
fuHuaQiInvestment
=
fuHuaQiInvestment
==
2
?
true
:
false
;
}
}
}
}
let
dataBaseList
=
await
financingData
.
findFinancingList
(
selectParam
);
let
dataBaseList
=
await
financingData
.
findFinancingList
(
selectParam
);
...
@@ -247,11 +248,28 @@ export async function outPutFinancingList(monthData:string, fuHuaQiName:string,
...
@@ -247,11 +248,28 @@ export async function outPutFinancingList(monthData:string, fuHuaQiName:string,
let
usccMap
=
await
fuhuaqiData
.
findAllFuHuaQiOperationNameMap
();
let
usccMap
=
await
fuhuaqiData
.
findAllFuHuaQiOperationNameMap
();
dataBaseList
.
forEach
(
info
=>
{
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
tool
.
extractData
(
FinancingListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
FinancingListConfig
,
info
,
true
);
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
changeData
.
industry
=
tool
.
changeEnumValue
(
configEnum
.
INDUSTRY
,
info
.
industry
);
changeData
.
industry
=
changeEnumValue
(
configEnum
.
INDUSTRY
,
info
.
industry
);
dataList
.
push
(
changeData
);
dataList
.
push
(
changeData
);
});
});
return
dataList
;
let
keyList
=
[
"name"
,
"logonAdd"
,
"operatingAdd"
,
"financingAmount"
,
"investmentInstitutionsName"
,
"timeToObtainInvestment"
,
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentAmount"
,
"fuHuaQiInvestmentStyle"
,
"createTime"
];
let
titleList
=
[
"企业名称"
,
"注册地址"
,
"经营地址"
,
"融资金额(万元)"
,
"投资机构名称"
,
"获得投资时间"
,
"孵化器是否投资"
,
"孵化器投资金额(万元)"
,
"孵化器投资方式"
,
"录入时间"
,
];
let
result
=
[
titleList
];
dataList
.
forEach
(
info
=>
{
let
subList
=
[];
keyList
.
forEach
(
subInfo
=>
{
subList
.
push
(
info
[
subInfo
]
||
''
);
});
result
.
push
(
subList
);
});
return
result
;
}
}
\ No newline at end of file
src/biz/fuHuqQi/base.ts
View file @
5519de88
...
@@ -7,12 +7,13 @@
...
@@ -7,12 +7,13 @@
import
{
BaseParamUpdateConfig
,
OrganizationParamUpdateConfig
}
from
"../../config/checkParamConfig"
;
import
{
BaseParamUpdateConfig
,
OrganizationParamUpdateConfig
}
from
"../../config/checkParamConfig"
;
import
{
findEnterpriseCountByFuHuaQiUscc
,
groupFindEnterprise
}
from
"../../data/enterprise/enterprise"
;
import
{
findEnterpriseCountByFuHuaQiUscc
,
groupFindEnterprise
}
from
"../../data/enterprise/enterprise"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
;
import
*
as
tools
from
"../../util/tools"
;
import
*
as
resultConfig
from
"../../config/ojbectResultKeyConfig"
;
import
*
as
resultConfig
from
"../../config/ojbectResultKeyConfig"
;
import
*
as
configEnum
from
"../../config/enum"
;
import
*
as
configEnum
from
"../../config/enum"
;
import
{
extractData
}
from
"../../util/tools
"
;
import
{
checkChange
,
extractData
}
from
"../../util/piecemeal
"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
eccFormParam
}
from
"../../util/verificationParam"
;
import
{
changeEnumValue
}
from
"../../util/verificationEnum"
;
/**
/**
...
@@ -28,8 +29,8 @@ export async function homeData(uscc:string) {
...
@@ -28,8 +29,8 @@ export async function homeData(uscc:string) {
let
data
:
any
=
extractData
(
resultConfig
.
FuHuaQiHomeDataConfig
,
dataBaseInfo
,
false
);
let
data
:
any
=
extractData
(
resultConfig
.
FuHuaQiHomeDataConfig
,
dataBaseInfo
,
false
);
data
.
enterpriseCount
=
await
findEnterpriseCountByFuHuaQiUscc
(
uscc
);
data
.
enterpriseCount
=
await
findEnterpriseCountByFuHuaQiUscc
(
uscc
);
data
.
lv
=
tools
.
changeEnumValue
(
configEnum
.
FUHUAQILV
,
dataBaseInfo
.
lv
);
data
.
lv
=
changeEnumValue
(
configEnum
.
FUHUAQILV
,
dataBaseInfo
.
lv
);
data
.
institutionalNature
=
tools
.
changeEnumValue
(
configEnum
.
INSTITUTIONALNATURE
,
dataBaseInfo
.
institutionalNature
);
data
.
institutionalNature
=
changeEnumValue
(
configEnum
.
INSTITUTIONALNATURE
,
dataBaseInfo
.
institutionalNature
);
return
data
;
return
data
;
}
}
...
@@ -81,7 +82,7 @@ export async function updateFuHuaQiBaseData(uscc:string, param) {
...
@@ -81,7 +82,7 @@ export async function updateFuHuaQiBaseData(uscc:string, param) {
let
skipKeyList
=
[
let
skipKeyList
=
[
"virtualEnterpriseNum"
,
"incubatedAcreage"
,
"acreageTotal"
,
"acreagePersonalUse"
,
"hatchingGround"
"virtualEnterpriseNum"
,
"incubatedAcreage"
,
"acreageTotal"
,
"acreagePersonalUse"
,
"hatchingGround"
];
];
tools
.
checkParamater
(
"更新孵化器基础数据"
,
BaseParamUpdateConfig
,
param
,
skipKeyList
);
eccFormParam
(
"更新孵化器基础数据"
,
BaseParamUpdateConfig
,
param
,
skipKeyList
);
let
baseDataInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
let
baseDataInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
for
(
let
key
in
param
)
{
for
(
let
key
in
param
)
{
...
@@ -96,7 +97,7 @@ export async function updateFuHuaQiBaseData(uscc:string, param) {
...
@@ -96,7 +97,7 @@ export async function updateFuHuaQiBaseData(uscc:string, param) {
}
}
/**这里无法判断数组里面的内容是否有变化 所以 hatchingGround 直接赋值 */
/**这里无法判断数组里面的内容是否有变化 所以 hatchingGround 直接赋值 */
let
changeList
=
tools
.
checkChange
(
param
,
baseDataInfo
);
let
changeList
=
checkChange
(
param
,
baseDataInfo
);
for
(
let
i
=
0
;
i
<
changeList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
changeList
.
length
;
i
++
)
{
let
key
=
changeList
[
i
];
let
key
=
changeList
[
i
];
baseDataInfo
[
key
]
=
param
[
key
];
baseDataInfo
[
key
]
=
param
[
key
];
...
@@ -121,12 +122,12 @@ export async function updateOrganizationData(uscc:string, param) {
...
@@ -121,12 +122,12 @@ export async function updateOrganizationData(uscc:string, param) {
"name"
,
"virtualEnterpriseNum"
,
"hatchingGround"
,
"operationModelDes"
//todo 写到这里了 这里和甘明讨论好哪些是必填的
"name"
,
"virtualEnterpriseNum"
,
"hatchingGround"
,
"operationModelDes"
//todo 写到这里了 这里和甘明讨论好哪些是必填的
,
"logonTime"
,
"lv"
,
"identificationTime"
,
"industry"
,
"institutionalNature"
,
"foundingTeam"
,
"liaison"
,
"liaisonPhone"
,
"personInCharge"
,
"personInChargePhone"
,
,
"logonTime"
,
"lv"
,
"identificationTime"
,
"industry"
,
"institutionalNature"
,
"foundingTeam"
,
"liaison"
,
"liaisonPhone"
,
"personInCharge"
,
"personInChargePhone"
,
];
];
tools
.
checkParamater
(
"更新孵化器基础数据"
,
OrganizationParamUpdateConfig
,
param
,
skipKeyList
);
eccFormParam
(
"更新孵化器基础数据"
,
OrganizationParamUpdateConfig
,
param
,
skipKeyList
);
let
baseDataInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
let
baseDataInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
/**这里无法判断数组里面的内容是否有变化 所以 hatchingGround 直接赋值 */
/**这里无法判断数组里面的内容是否有变化 所以 hatchingGround 直接赋值 */
let
changeList
=
tools
.
checkChange
(
param
,
baseDataInfo
);
let
changeList
=
checkChange
(
param
,
baseDataInfo
);
for
(
let
i
=
0
;
i
<
changeList
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
changeList
.
length
;
i
++
)
{
let
key
=
changeList
[
i
];
let
key
=
changeList
[
i
];
if
(
key
==
"operationName"
||
key
==
"uscc"
)
continue
;
if
(
key
==
"operationName"
||
key
==
"uscc"
)
continue
;
...
@@ -169,7 +170,7 @@ export async function fuHuaQiBaseList(lv:number, institutionalNature:number, ind
...
@@ -169,7 +170,7 @@ export async function fuHuaQiBaseList(lv:number, institutionalNature:number, ind
let
dataList
=
[];
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
tools
.
extractData
(
resultConfig
.
FuHuaQiBaseListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
resultConfig
.
FuHuaQiBaseListConfig
,
info
,
true
);
// let hatchingGround = info.hatchingGround;
// let hatchingGround = info.hatchingGround;
// hatchingGround.forEach (info => {
// hatchingGround.forEach (info => {
// let {personInChargeAdd, siteAcreage, leasePrice} = info;
// let {personInChargeAdd, siteAcreage, leasePrice} = info;
...
@@ -184,10 +185,10 @@ export async function fuHuaQiBaseList(lv:number, institutionalNature:number, ind
...
@@ -184,10 +185,10 @@ export async function fuHuaQiBaseList(lv:number, institutionalNature:number, ind
changeData
.
enterpriseTotal
=
enterpriseTotal
;
changeData
.
enterpriseTotal
=
enterpriseTotal
;
changeData
.
numOfEntities
=
numOfEntities
;
changeData
.
numOfEntities
=
numOfEntities
;
changeData
.
lv
=
tools
.
changeEnumValue
(
configEnum
.
FUHUAQILV
,
changeData
.
lv
);
changeData
.
lv
=
changeEnumValue
(
configEnum
.
FUHUAQILV
,
changeData
.
lv
);
changeData
.
industry
=
tools
.
changeEnumValue
(
configEnum
.
FUHUAINDUSTRY
,
changeData
.
industry
);
changeData
.
industry
=
changeEnumValue
(
configEnum
.
FUHUAINDUSTRY
,
changeData
.
industry
);
changeData
.
institutionalNature
=
tools
.
changeEnumValue
(
configEnum
.
INSTITUTIONALNATURE
,
changeData
.
institutionalNature
);
changeData
.
institutionalNature
=
changeEnumValue
(
configEnum
.
INSTITUTIONALNATURE
,
changeData
.
institutionalNature
);
changeData
.
operationModel
=
tools
.
changeEnumValue
(
configEnum
.
OPERATIONMODEL
,
changeData
.
operationModel
);
changeData
.
operationModel
=
changeEnumValue
(
configEnum
.
OPERATIONMODEL
,
changeData
.
operationModel
);
if
(
changeData
.
operationModel
==
"_投资__孵化_类型"
){
if
(
changeData
.
operationModel
==
"_投资__孵化_类型"
){
changeData
.
operationModel
=
changeData
.
operationModel
.
replace
(
"__"
,
"+"
);
changeData
.
operationModel
=
changeData
.
operationModel
.
replace
(
"__"
,
"+"
);
changeData
.
operationModel
=
changeData
.
operationModel
.
replace
(
"_"
,
"“"
);
changeData
.
operationModel
=
changeData
.
operationModel
.
replace
(
"_"
,
"“"
);
...
@@ -199,13 +200,13 @@ export async function fuHuaQiBaseList(lv:number, institutionalNature:number, ind
...
@@ -199,13 +200,13 @@ export async function fuHuaQiBaseList(lv:number, institutionalNature:number, ind
if
(
changeData
.
foundingTeam
&&
changeData
.
foundingTeam
.
length
)
{
if
(
changeData
.
foundingTeam
&&
changeData
.
foundingTeam
.
length
)
{
changeData
.
foundingTeam
.
forEach
(
item
=>
{
changeData
.
foundingTeam
.
forEach
(
item
=>
{
let
{
memberName
,
memberAge
,
memberSchool
,
des
}
=
item
;
let
{
memberName
,
memberAge
,
memberSchool
,
des
}
=
item
;
let
type
=
tools
.
changeEnumValue
(
configEnum
.
TEAM
,
item
.
type
);
//人才类型
let
type
=
changeEnumValue
(
configEnum
.
TEAM
,
item
.
type
);
//人才类型
foundingTeam
.
push
({
foundingTeam
.
push
({
memberName
,
memberAge
,
memberSchool
,
des
,
type
,
memberName
,
memberAge
,
memberSchool
,
des
,
type
,
memberSex
:
tools
.
changeEnumValue
(
configEnum
.
SEX
,
item
.
memberSex
),
//成员性别
memberSex
:
changeEnumValue
(
configEnum
.
SEX
,
item
.
memberSex
),
//成员性别
memberDEGREE
:
tools
.
changeEnumValue
(
configEnum
.
DEGREE
,
item
.
memberDEGREE
),
//成员最高学历
memberDEGREE
:
changeEnumValue
(
configEnum
.
DEGREE
,
item
.
memberDEGREE
),
//成员最高学历
});
});
// item.memberDEGREE =
tools.
changeEnumValue(configEnum.DEGREE, item.foundingTeamStr);//成员最高学历
// item.memberDEGREE = changeEnumValue(configEnum.DEGREE, item.foundingTeamStr);//成员最高学历
/* 这里兼容了一下,团队类型数据库里存到了每一个人的信息里 以防后续要修改 */
/* 这里兼容了一下,团队类型数据库里存到了每一个人的信息里 以防后续要修改 */
changeData
.
foundingTeamStr
=
type
;
changeData
.
foundingTeamStr
=
type
;
});
});
...
@@ -242,7 +243,7 @@ export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:numbe
...
@@ -242,7 +243,7 @@ export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:numbe
let
dataList
=
[];
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
tools
.
extractData
(
resultConfig
.
FuHuaQiBaseListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
resultConfig
.
FuHuaQiBaseListConfig
,
info
,
true
);
let
enterpriseTotal
=
enterpriseMap
[
info
.
uscc
]
||
0
;
let
enterpriseTotal
=
enterpriseMap
[
info
.
uscc
]
||
0
;
let
numOfEntities
=
enterpriseTotal
-
(
info
.
virtualEnterpriseNum
||
0
);
let
numOfEntities
=
enterpriseTotal
-
(
info
.
virtualEnterpriseNum
||
0
);
...
@@ -251,10 +252,10 @@ export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:numbe
...
@@ -251,10 +252,10 @@ export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:numbe
changeData
.
enterpriseTotal
=
enterpriseTotal
;
changeData
.
enterpriseTotal
=
enterpriseTotal
;
changeData
.
numOfEntities
=
numOfEntities
;
changeData
.
numOfEntities
=
numOfEntities
;
changeData
.
lv
=
tools
.
changeEnumValue
(
configEnum
.
FUHUAQILV
,
changeData
.
lv
);
changeData
.
lv
=
changeEnumValue
(
configEnum
.
FUHUAQILV
,
changeData
.
lv
);
changeData
.
industry
=
tools
.
changeEnumValue
(
configEnum
.
FUHUAINDUSTRY
,
changeData
.
industry
);
changeData
.
industry
=
changeEnumValue
(
configEnum
.
FUHUAINDUSTRY
,
changeData
.
industry
);
changeData
.
institutionalNature
=
tools
.
changeEnumValue
(
configEnum
.
INSTITUTIONALNATURE
,
changeData
.
institutionalNature
);
changeData
.
institutionalNature
=
changeEnumValue
(
configEnum
.
INSTITUTIONALNATURE
,
changeData
.
institutionalNature
);
changeData
.
operationModel
=
tools
.
changeEnumValue
(
configEnum
.
OPERATIONMODEL
,
changeData
.
operationModel
);
changeData
.
operationModel
=
changeEnumValue
(
configEnum
.
OPERATIONMODEL
,
changeData
.
operationModel
);
if
(
changeData
.
operationModel
==
"_投资__孵化_类型"
){
if
(
changeData
.
operationModel
==
"_投资__孵化_类型"
){
changeData
.
operationModel
=
changeData
.
operationModel
.
replace
(
"__"
,
"+"
);
changeData
.
operationModel
=
changeData
.
operationModel
.
replace
(
"__"
,
"+"
);
changeData
.
operationModel
=
changeData
.
operationModel
.
replace
(
"_"
,
"“"
);
changeData
.
operationModel
=
changeData
.
operationModel
.
replace
(
"_"
,
"“"
);
...
@@ -266,13 +267,13 @@ export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:numbe
...
@@ -266,13 +267,13 @@ export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:numbe
if
(
changeData
.
foundingTeam
&&
changeData
.
foundingTeam
.
length
)
{
if
(
changeData
.
foundingTeam
&&
changeData
.
foundingTeam
.
length
)
{
changeData
.
foundingTeam
.
forEach
(
item
=>
{
changeData
.
foundingTeam
.
forEach
(
item
=>
{
let
{
memberName
,
memberAge
,
memberSchool
,
des
}
=
item
;
let
{
memberName
,
memberAge
,
memberSchool
,
des
}
=
item
;
let
type
=
tools
.
changeEnumValue
(
configEnum
.
TEAM
,
item
.
type
);
//人才类型
let
type
=
changeEnumValue
(
configEnum
.
TEAM
,
item
.
type
);
//人才类型
foundingTeam
.
push
({
foundingTeam
.
push
({
memberName
,
memberAge
,
memberSchool
,
des
,
type
,
memberName
,
memberAge
,
memberSchool
,
des
,
type
,
memberSex
:
tools
.
changeEnumValue
(
configEnum
.
SEX
,
item
.
memberSex
),
//成员性别
memberSex
:
changeEnumValue
(
configEnum
.
SEX
,
item
.
memberSex
),
//成员性别
memberDEGREE
:
tools
.
changeEnumValue
(
configEnum
.
DEGREE
,
item
.
memberDEGREE
),
//成员最高学历
memberDEGREE
:
changeEnumValue
(
configEnum
.
DEGREE
,
item
.
memberDEGREE
),
//成员最高学历
});
});
// item.memberDEGREE =
tools.
changeEnumValue(configEnum.DEGREE, item.foundingTeamStr);//成员最高学历
// item.memberDEGREE = changeEnumValue(configEnum.DEGREE, item.foundingTeamStr);//成员最高学历
/* 这里兼容了一下,团队类型数据库里存到了每一个人的信息里 以防后续要修改 */
/* 这里兼容了一下,团队类型数据库里存到了每一个人的信息里 以防后续要修改 */
changeData
.
foundingTeamStr
=
type
;
changeData
.
foundingTeamStr
=
type
;
});
});
...
@@ -282,5 +283,27 @@ export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:numbe
...
@@ -282,5 +283,27 @@ export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:numbe
dataList
.
push
(
changeData
);
dataList
.
push
(
changeData
);
});
});
return
dataList
;
let
keyList
=
[
"name"
,
"operationName"
,
"uscc"
,
"virtualEnterpriseNum"
,
"logonTime"
,
"incubatedAcreage"
,
"acreageTotal"
,
"acreagePersonalUse"
,
"lv"
,
"identificationTime"
,
"industry"
,
"institutionalNature"
,
"liaison"
,
"liaisonPhone"
,
"personInCharge"
,
"personInChargePhone"
,
"personInChargeAdd"
,
"siteAcreage"
,
"leasePrice"
];
let
titleList
=
[
"名称"
,
"运营机构名称"
,
"统一信用代码"
,
"虚拟企业数量"
,
"注册时间"
,
"在孵面积"
,
"孵化器总面积"
,
"孵化器自用面积"
,
"孵化器级别"
,
"认定时间"
,
"领域"
,
"机构性质"
,
"联系人"
,
"联系电话"
,
"负责人"
,
"负责人联系电话"
,
"孵化场地地址"
,
"孵化场地面积"
,
"孵化场地出租单价"
];
let
result
=
[
titleList
];
dataList
.
forEach
(
info
=>
{
let
subList
=
[];
keyList
.
forEach
(
subInfo
=>
{
subList
.
push
(
info
[
subInfo
]
||
''
);
});
result
.
push
(
subList
);
});
return
result
;
}
}
\ No newline at end of file
src/biz/fuHuqQi/month.ts
View file @
5519de88
...
@@ -7,7 +7,8 @@
...
@@ -7,7 +7,8 @@
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
*
as
monthData
from
"../../data/fuHuaQi/monthTable"
;
import
*
as
monthData
from
"../../data/fuHuaQi/monthTable"
;
import
{
extractData
,
getTaskId
}
from
"../../util/tools"
;
import
{
extractData
}
from
"../../util/piecemeal"
;
import
*
as
sysTools
from
"../../tools/system"
;
import
{
findAllFuHuaQiOperationNameMap
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
{
findAllFuHuaQiOperationNameMap
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
{
MonthConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
MonthConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
OUTPUTTYPE
}
from
"../../config/enum"
;
import
{
OUTPUTTYPE
}
from
"../../config/enum"
;
...
@@ -22,7 +23,7 @@ import { OUTPUTTYPE } from "../../config/enum";
...
@@ -22,7 +23,7 @@ import { OUTPUTTYPE } from "../../config/enum";
* @returns {isSuccess:true/false}
* @returns {isSuccess:true/false}
*/
*/
export
async
function
createReport
(
uscc
:
string
,
occupancyRate
:
number
)
{
export
async
function
createReport
(
uscc
:
string
,
occupancyRate
:
number
)
{
const
TaskId
=
getTaskId
(
uscc
);
const
TaskId
=
sysTools
.
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
monthData
.
findMonthTableByTaskId
(
TaskId
);
let
dataBaseInfo
=
await
monthData
.
findMonthTableByTaskId
(
TaskId
);
if
(
dataBaseInfo
.
isUpdate
)
throw
new
BizError
(
ERRORENUM
.
该孵化器月度填报已存在
,
`
${
uscc
}
重复提交了月度填报值为
${
occupancyRate
}
`
);
if
(
dataBaseInfo
.
isUpdate
)
throw
new
BizError
(
ERRORENUM
.
该孵化器月度填报已存在
,
`
${
uscc
}
重复提交了月度填报值为
${
occupancyRate
}
`
);
...
@@ -44,7 +45,7 @@ export async function createReport(uscc:string, occupancyRate:number) {
...
@@ -44,7 +45,7 @@ export async function createReport(uscc:string, occupancyRate:number) {
* @returns {isSuccess:true/false}
* @returns {isSuccess:true/false}
*/
*/
export
async
function
updateReport
(
uscc
:
string
,
occupancyRate
:
number
)
{
export
async
function
updateReport
(
uscc
:
string
,
occupancyRate
:
number
)
{
const
TaskId
=
getTaskId
(
uscc
);
const
TaskId
=
sysTools
.
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
monthData
.
findMonthTableByTaskId
(
TaskId
);
let
dataBaseInfo
=
await
monthData
.
findMonthTableByTaskId
(
TaskId
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
taskId
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`未找到
${
uscc
}
的月度报表`
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
taskId
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`未找到
${
uscc
}
的月度报表`
);
...
@@ -62,7 +63,7 @@ export async function updateReport(uscc:string, occupancyRate:number) {
...
@@ -62,7 +63,7 @@ export async function updateReport(uscc:string, occupancyRate:number) {
* @returns {isSuccess:true/false}
* @returns {isSuccess:true/false}
*/
*/
export
async
function
deleteReport
(
uscc
:
string
)
{
export
async
function
deleteReport
(
uscc
:
string
)
{
const
TaskId
=
getTaskId
(
uscc
);
const
TaskId
=
sysTools
.
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
monthData
.
findMonthTableByTaskId
(
TaskId
);
let
dataBaseInfo
=
await
monthData
.
findMonthTableByTaskId
(
TaskId
);
if
(
!
dataBaseInfo
.
isUpdate
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`未找到
${
uscc
}
的月度报表`
);
if
(
!
dataBaseInfo
.
isUpdate
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`未找到
${
uscc
}
的月度报表`
);
...
@@ -81,7 +82,7 @@ export async function deleteReport(uscc:string) {
...
@@ -81,7 +82,7 @@ export async function deleteReport(uscc:string) {
* @returns {occupancyRate:0} occupancyRate 本月出租率
* @returns {occupancyRate:0} occupancyRate 本月出租率
*/
*/
export
async
function
getMonthByUscc
(
uscc
:
string
)
{
export
async
function
getMonthByUscc
(
uscc
:
string
)
{
const
TaskId
=
getTaskId
(
uscc
);
const
TaskId
=
sysTools
.
getTaskId
(
uscc
);
let
dataBaseInfo
=
await
monthData
.
findMonthTableByTaskId
(
TaskId
);
let
dataBaseInfo
=
await
monthData
.
findMonthTableByTaskId
(
TaskId
);
if
(
!
dataBaseInfo
.
isUpdate
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`未找到
${
uscc
}
的月度报表`
);
if
(
!
dataBaseInfo
.
isUpdate
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`未找到
${
uscc
}
的月度报表`
);
...
@@ -164,5 +165,24 @@ export async function outPutMonthTableList(state:number, year:number, month:numb
...
@@ -164,5 +165,24 @@ export async function outPutMonthTableList(state:number, year:number, month:numb
dataList
.
push
(
onceInfo
);
dataList
.
push
(
onceInfo
);
});
});
return
dataList
;
let
keyList
=
[
"operationName"
,
"state"
,
"time"
,
"occupancyRate"
,
];
let
titleList
=
[
"运营机构名称"
,
"填报状态"
,
"数据月份"
,
"出租率(%)"
];
let
result
=
[
titleList
];
dataList
.
forEach
(
info
=>
{
let
subList
=
[];
keyList
.
forEach
(
subInfo
=>
{
subList
.
push
(
info
[
subInfo
]
||
''
);
});
result
.
push
(
subList
);
});
return
result
;
}
}
\ No newline at end of file
src/biz/fuHuqQi/task.ts
View file @
5519de88
...
@@ -15,7 +15,7 @@ import * as monthTableData from "../../data/fuHuaQi/monthTable";
...
@@ -15,7 +15,7 @@ import * as monthTableData from "../../data/fuHuaQi/monthTable";
import
*
as
taskData
from
"../../data/fuHuaQi/task"
;
import
*
as
taskData
from
"../../data/fuHuaQi/task"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
logHandle
}
from
"../../util/log"
;
import
{
logHandle
}
from
"../../util/log"
;
import
{
getTaskId
,
getTimeKey
}
from
"../../
util/tools
"
;
import
{
getTaskId
,
getTimeKey
}
from
"../../
tools/system
"
;
/**
/**
...
...
src/biz/fuHuqQi/user.ts
View file @
5519de88
...
@@ -9,7 +9,9 @@ import { ERRORENUM } from "../../config/errorEnum";
...
@@ -9,7 +9,9 @@ import { ERRORENUM } from "../../config/errorEnum";
import
{
FuHuaQiListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
FuHuaQiListConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
*
as
tools
from
"../../util/tools"
;
import
*
as
sysTools
from
"../../tools/system"
;
import
{
eccFormParam
}
from
"../../util/verificationParam"
;
import
{
extractData
}
from
"../../util/piecemeal"
;
/**
/**
...
@@ -23,10 +25,10 @@ export async function login(uscc:string, pwd:string) {
...
@@ -23,10 +25,10 @@ export async function login(uscc:string, pwd:string) {
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
if
(
!
fuhuaqiInfo
)
throw
new
BizError
(
ERRORENUM
.
账号不存在
);
if
(
!
fuhuaqiInfo
)
throw
new
BizError
(
ERRORENUM
.
账号不存在
);
let
checkPwd
=
t
ools
.
getPwdMd5
(
fuhuaqiInfo
.
uscc
,
pwd
);
let
checkPwd
=
sysT
ools
.
getPwdMd5
(
fuhuaqiInfo
.
uscc
,
pwd
);
if
(
fuhuaqiInfo
.
pwd
!=
checkPwd
)
throw
new
BizError
(
ERRORENUM
.
密码错误
);
if
(
fuhuaqiInfo
.
pwd
!=
checkPwd
)
throw
new
BizError
(
ERRORENUM
.
密码错误
);
const
Token
=
t
ools
.
getToken
(
uscc
);
const
Token
=
sysT
ools
.
getToken
(
uscc
);
let
fuhuaqiUserInfo
=
{
let
fuhuaqiUserInfo
=
{
uscc
:
fuhuaqiInfo
.
uscc
,
uscc
:
fuhuaqiInfo
.
uscc
,
...
@@ -56,7 +58,7 @@ export async function firstLoginChangePwd(uscc:string, pwd:string, confirmPwd:st
...
@@ -56,7 +58,7 @@ export async function firstLoginChangePwd(uscc:string, pwd:string, confirmPwd:st
let
dataBaseInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
let
dataBaseInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
if
(
dataBaseInfo
.
firstLoginIsChangePwd
)
throw
new
BizError
(
ERRORENUM
.
不能重复修改密码
,
`重复调用了首次登录之后的修改密码接口
${
uscc
}
`
);
if
(
dataBaseInfo
.
firstLoginIsChangePwd
)
throw
new
BizError
(
ERRORENUM
.
不能重复修改密码
,
`重复调用了首次登录之后的修改密码接口
${
uscc
}
`
);
//todo 校验密码
//todo 校验密码
dataBaseInfo
.
pwd
=
t
ools
.
getPwdMd5
(
uscc
,
pwd
);
dataBaseInfo
.
pwd
=
sysT
ools
.
getPwdMd5
(
uscc
,
pwd
);
dataBaseInfo
.
firstLoginIsChangePwd
=
true
;
dataBaseInfo
.
firstLoginIsChangePwd
=
true
;
await
dataBaseInfo
.
save
();
await
dataBaseInfo
.
save
();
...
@@ -82,9 +84,9 @@ export async function changePassword(uscc:string, pwd:string, newPwd:string) {
...
@@ -82,9 +84,9 @@ export async function changePassword(uscc:string, pwd:string, newPwd:string) {
}
}
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
if
(
!
fuhuaqiInfo
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
);
if
(
!
fuhuaqiInfo
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
);
let
checkPwd
=
t
ools
.
getPwdMd5
(
fuhuaqiInfo
.
uscc
,
pwd
);
let
checkPwd
=
sysT
ools
.
getPwdMd5
(
fuhuaqiInfo
.
uscc
,
pwd
);
if
(
fuhuaqiInfo
.
pwd
!=
checkPwd
)
throw
new
BizError
(
ERRORENUM
.
密码错误
);
if
(
fuhuaqiInfo
.
pwd
!=
checkPwd
)
throw
new
BizError
(
ERRORENUM
.
密码错误
);
fuhuaqiInfo
.
pwd
=
t
ools
.
getPwdMd5
(
uscc
,
newPwd
);
fuhuaqiInfo
.
pwd
=
sysT
ools
.
getPwdMd5
(
uscc
,
newPwd
);
await
fuhuaqiInfo
.
save
();
await
fuhuaqiInfo
.
save
();
return
{
isSuccess
:
true
};
return
{
isSuccess
:
true
};
...
@@ -127,7 +129,7 @@ export async function logout(uscc:string){
...
@@ -127,7 +129,7 @@ export async function logout(uscc:string){
let
count
=
await
fuhuaqiData
.
findFuHuaQiUserCount
(
selectParam
);
let
count
=
await
fuhuaqiData
.
findFuHuaQiUserCount
(
selectParam
);
let
dataList
=
[];
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
dataBaseList
.
forEach
(
info
=>
{
let
changeData
=
tools
.
extractData
(
FuHuaQiListConfig
,
info
,
true
);
let
changeData
=
extractData
(
FuHuaQiListConfig
,
info
,
true
);
const
Count
=
enterpriseMap
[
info
.
uscc
]
||
0
;
const
Count
=
enterpriseMap
[
info
.
uscc
]
||
0
;
dataList
.
push
(
changeData
);
dataList
.
push
(
changeData
);
});
});
...
@@ -161,7 +163,7 @@ export async function updateState(uscc:string, userState:boolean) {
...
@@ -161,7 +163,7 @@ export async function updateState(uscc:string, userState:boolean) {
* @returns
* @returns
*/
*/
export
async
function
addUser
(
param
)
{
export
async
function
addUser
(
param
)
{
tools
.
checkParamater
(
"新增孵化器账号信息"
,
FuHuaQiUserConfig
,
param
);
//校验表单参数
eccFormParam
(
"新增孵化器账号信息"
,
FuHuaQiUserConfig
,
param
);
//校验表单参数
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
param
.
uscc
);
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
param
.
uscc
);
...
...
src/biz/guanWeiHui/user.ts
View file @
5519de88
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
findGuanWeiHuiUserInfoByLoginId
}
from
"../../data/guanWeiHui/guanweihui"
;
import
{
findGuanWeiHuiUserInfoByLoginId
}
from
"../../data/guanWeiHui/guanweihui"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
{
getPwdMd5
,
getToken
}
from
"../../
util/tools
"
;
import
{
getPwdMd5
,
getToken
}
from
"../../
tools/system
"
;
/**
/**
...
...
src/biz/systemTask.ts
View file @
5519de88
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*/
*/
import
{
findTaskCountByKey
}
from
"../data/fuHuaQi/task"
;
import
{
findTaskCountByKey
}
from
"../data/fuHuaQi/task"
;
import
{
getTimeKey
}
from
"../
util/tools
"
;
import
{
getTimeKey
}
from
"../
tools/system
"
;
import
{
provideTask
}
from
"./fuHuqQi/task"
;
import
{
provideTask
}
from
"./fuHuqQi/task"
;
export
function
initSystemTask
()
{
export
function
initSystemTask
()
{
...
...
src/main.ts
View file @
5519de88
import
{
fuHuaQiTaskList
}
from
"./biz/fuHuqQi/task"
;
import
{
initSystemTask
}
from
"./biz/systemTask"
;
import
{
initSystemTask
}
from
"./biz/systemTask"
;
import
{
initConfig
,
systemConfig
}
from
"./config/serverConfig"
;
import
{
initConfig
,
systemConfig
}
from
"./config/serverConfig"
;
import
{
initDB
}
from
"./db/mongo/dbInit"
;
import
{
initDB
}
from
"./db/mongo/dbInit"
;
import
{
httpServer
}
from
"./net/http_server"
;
import
{
httpServer
}
from
"./net/http_server"
;
import
{
initBasicData
}
from
"./
util
/dataInit"
;
import
{
initBasicData
}
from
"./
tools
/dataInit"
;
async
function
lanuch
()
{
async
function
lanuch
()
{
await
initConfig
();
//初始化配置解析
await
initConfig
();
//初始化配置解析
...
...
src/routers/admin/enterprise.ts
View file @
5519de88
...
@@ -7,8 +7,9 @@
...
@@ -7,8 +7,9 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
enterpriseBiz
from
'../../biz/enterprise/enterprise'
;
import
*
as
enterpriseBiz
from
'../../biz/enterprise/enterprise'
;
import
*
as
financingBiz
from
'../../biz/enterprise/financing'
;
import
*
as
financingBiz
from
'../../biz/enterprise/financing'
;
import
{
checkParamaterType
,
getTimeKey
}
from
'../../util/tools
'
;
import
{
getTimeKey
}
from
'../../tools/system
'
;
import
{
checkGuanWeiHuiToken
}
from
'../../middleware/user'
;
import
{
checkGuanWeiHuiToken
}
from
'../../middleware/user'
;
import
{
eccReqNotMustHaveParam
}
from
'../../util/verificationParam'
;
export
function
setRouter
(
httpServer
)
{
export
function
setRouter
(
httpServer
)
{
...
@@ -27,7 +28,7 @@ export function setRouter(httpServer) {
...
@@ -27,7 +28,7 @@ export function setRouter(httpServer) {
*/
*/
async
function
getEnterpriseList
(
req
,
res
)
{
async
function
getEnterpriseList
(
req
,
res
)
{
let
reqConf
=
{
createType
:
'Number'
,
fuHuaQiUscc
:
'String'
,
industry
:
'[Number]'
,
isNaturalPersonHolding
:
'Number'
,
page
:
'Number'
};
let
reqConf
=
{
createType
:
'Number'
,
fuHuaQiUscc
:
'String'
,
industry
:
'[Number]'
,
isNaturalPersonHolding
:
'Number'
,
page
:
'Number'
};
let
{
createType
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
{
createType
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
}
=
eccReqNotMustHaveParam
(
reqConf
,
req
.
body
);
let
result
=
await
enterpriseBiz
.
enterpriseList
(
createType
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
);
let
result
=
await
enterpriseBiz
.
enterpriseList
(
createType
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
);
res
.
success
(
result
);
res
.
success
(
result
);
...
@@ -41,7 +42,7 @@ async function getEnterpriseList(req, res) {
...
@@ -41,7 +42,7 @@ async function getEnterpriseList(req, res) {
*/
*/
async
function
getFinancingList
(
req
,
res
)
{
async
function
getFinancingList
(
req
,
res
)
{
let
reqConf
=
{
monthData
:
'String'
,
fuHuaQiName
:
'String'
,
fuHuaQiInvestment
:
'Number'
,
industry
:
'[Number]'
,
page
:
'Number'
};
let
reqConf
=
{
monthData
:
'String'
,
fuHuaQiName
:
'String'
,
fuHuaQiInvestment
:
'Number'
,
industry
:
'[Number]'
,
page
:
'Number'
};
let
{
monthData
,
fuHuaQiName
,
industry
,
fuHuaQiInvestment
,
page
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
{
monthData
,
fuHuaQiName
,
industry
,
fuHuaQiInvestment
,
page
}
=
eccReqNotMustHaveParam
(
reqConf
,
req
.
body
);
let
result
=
await
financingBiz
.
financingList
(
monthData
,
fuHuaQiName
,
industry
,
fuHuaQiInvestment
,
page
);
let
result
=
await
financingBiz
.
financingList
(
monthData
,
fuHuaQiName
,
industry
,
fuHuaQiInvestment
,
page
);
res
.
success
(
result
);
res
.
success
(
result
);
...
@@ -67,32 +68,13 @@ async function affiliationFuHuaQi(req, res) {
...
@@ -67,32 +68,13 @@ async function affiliationFuHuaQi(req, res) {
*/
*/
async
function
outPutEnterpriseData
(
req
,
res
)
{
async
function
outPutEnterpriseData
(
req
,
res
)
{
let
reqConf
=
{
createType
:
'Number'
,
fuHuaQiUscc
:
'String'
,
industry
:
'[Number]'
,
isNaturalPersonHolding
:
'Number'
,
type
:
'Number'
};
let
reqConf
=
{
createType
:
'Number'
,
fuHuaQiUscc
:
'String'
,
industry
:
'[Number]'
,
isNaturalPersonHolding
:
'Number'
,
type
:
'Number'
};
let
{
createType
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
page
,
type
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
{
createType
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
type
}
=
eccReqNotMustHaveParam
(
reqConf
,
req
.
body
);
let
dataList
=
await
enterpriseBiz
.
outPutEnterpriseData
(
createType
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
type
);
let
dataList
=
await
enterpriseBiz
.
outPutEnterpriseData
(
createType
,
fuHuaQiUscc
,
industry
,
isNaturalPersonHolding
,
type
);
let
keyList
=
[
"name"
,
"createTime"
,
"fuhuaqiUscc"
,
"uscc"
,
"industry"
,
"logonTime"
,
"firstIncubationTime"
,
"timeOfImmigration"
,
"isNaturalPersonHolding"
,
"oldLogonAdd"
,
"logonAdd"
,
"operatingAdd"
,
"leasedArea"
];
let
titleList
=
[
"企业名称"
,
"入库时间"
,
"所属孵化器"
,
"统一信用代码"
,
"行业领域"
,
"注册时间"
,
"首次入孵时间"
,
"迁入时间"
,
"是否自然人控股"
,
"迁入前注册地址"
,
"注册地址"
,
"经营地址"
,
"租赁面积(平方米)"
];
let
result
=
[
titleList
];
dataList
.
forEach
(
info
=>
{
let
subList
=
[];
keyList
.
forEach
(
subInfo
=>
{
subList
.
push
(
info
[
subInfo
]
||
''
);
});
result
.
push
(
subList
);
});
let
name
=
`在孵企业
${
getTimeKey
()}
.xlsx`
;
let
name
=
`在孵企业
${
getTimeKey
()}
.xlsx`
;
res
.
success
({
name
,
data
:
resul
t
});
res
.
success
({
name
,
data
:
dataLis
t
});
}
}
...
@@ -103,28 +85,11 @@ async function outPutEnterpriseData(req, res) {
...
@@ -103,28 +85,11 @@ async function outPutEnterpriseData(req, res) {
*/
*/
async
function
outPutFinancingData
(
req
,
res
)
{
async
function
outPutFinancingData
(
req
,
res
)
{
let
reqConf
=
{
monthData
:
'String'
,
fuHuaQiName
:
'String'
,
fuHuaQiInvestment
:
'Number'
,
industry
:
'[Number]'
,
type
:
'Number'
};
let
reqConf
=
{
monthData
:
'String'
,
fuHuaQiName
:
'String'
,
fuHuaQiInvestment
:
'Number'
,
industry
:
'[Number]'
,
type
:
'Number'
};
let
{
monthData
,
fuHuaQiName
,
industry
,
fuHuaQiInvestment
,
type
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
{
monthData
,
fuHuaQiName
,
industry
,
fuHuaQiInvestment
,
type
}
=
eccReqNotMustHaveParam
(
reqConf
,
req
.
body
);
let
dataList
=
await
financingBiz
.
outPutFinancingList
(
monthData
,
fuHuaQiName
,
industry
,
fuHuaQiInvestment
,
type
);
let
dataList
=
await
financingBiz
.
outPutFinancingList
(
monthData
,
fuHuaQiName
,
industry
,
fuHuaQiInvestment
,
type
);
let
keyList
=
[
"name"
,
"logonAdd"
,
"operatingAdd"
,
"financingAmount"
,
"investmentInstitutionsName"
,
"timeToObtainInvestment"
,
"fuHuaQiInvestment"
,
"fuHuaQiInvestmentAmount"
,
"fuHuaQiInvestmentStyle"
,
"createTime"
];
let
titleList
=
[
"企业名称"
,
"注册地址"
,
"经营地址"
,
"融资金额(万元)"
,
"投资机构名称"
,
"获得投资时间"
,
"孵化器是否投资"
,
"孵化器投资金额(万元)"
,
"孵化器投资方式"
,
"录入时间"
,
];
let
result
=
[
titleList
];
dataList
.
forEach
(
info
=>
{
let
subList
=
[];
keyList
.
forEach
(
subInfo
=>
{
subList
.
push
(
info
[
subInfo
]
||
''
);
});
result
.
push
(
subList
);
});
let
name
=
`融资企业
${
getTimeKey
()}
.xlsx`
;
let
name
=
`融资企业
${
getTimeKey
()}
.xlsx`
;
res
.
success
({
name
,
data
:
resul
t
});
res
.
success
({
name
,
data
:
dataLis
t
});
}
}
src/routers/admin/fuHuaQi.ts
View file @
5519de88
/**
/**
* 管理后台端 孵化器
信息
* 管理后台端 孵化器
相关
*/
*/
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
userBiz
from
'../../biz/fuHuqQi/user'
;
import
*
as
userBiz
from
'../../biz/fuHuqQi/user'
;
import
*
as
baseBiz
from
'../../biz/fuHuqQi/base'
;
import
*
as
baseBiz
from
'../../biz/fuHuqQi/base'
;
import
{
checkParamaterType
,
checkReqParam
,
getTimeKey
}
from
'../../util/tools
'
;
import
{
getTimeKey
}
from
'../../tools/system
'
;
import
{
monthTableList
}
from
'../../biz/fuHuqQi/month'
;
import
{
monthTableList
}
from
'../../biz/fuHuqQi/month'
;
import
{
checkGuanWeiHuiToken
}
from
'../../middleware/user'
;
import
{
checkGuanWeiHuiToken
}
from
'../../middleware/user'
;
import
*
as
monthBiz
from
'../../biz/fuHuqQi/month'
;
import
*
as
monthBiz
from
'../../biz/fuHuqQi/month'
;
import
{
eccReqNotMustHaveParam
,
eccReqMustHaveParam
}
from
'../../util/verificationParam'
;
export
function
setRouter
(
httpServer
)
{
export
function
setRouter
(
httpServer
)
{
...
@@ -36,7 +37,7 @@ async function fuHuaQiBaseList(req, res) {
...
@@ -36,7 +37,7 @@ async function fuHuaQiBaseList(req, res) {
industry
:
'Number'
,
industry
:
'Number'
,
page
:
'Number'
page
:
'Number'
};
};
let
{
lv
,
institutionalNature
,
industry
,
operationModel
,
foundingTeam
,
page
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
{
lv
,
institutionalNature
,
industry
,
operationModel
,
foundingTeam
,
page
}
=
eccReqNotMustHaveParam
(
reqConf
,
req
.
body
);
let
result
=
await
baseBiz
.
fuHuaQiBaseList
(
lv
,
institutionalNature
,
industry
,
operationModel
,
foundingTeam
,
page
);
let
result
=
await
baseBiz
.
fuHuaQiBaseList
(
lv
,
institutionalNature
,
industry
,
operationModel
,
foundingTeam
,
page
);
...
@@ -51,7 +52,7 @@ async function fuHuaQiBaseList(req, res) {
...
@@ -51,7 +52,7 @@ async function fuHuaQiBaseList(req, res) {
*/
*/
async
function
getMonthList
(
req
,
res
)
{
async
function
getMonthList
(
req
,
res
)
{
let
reqConf
=
{
state
:
'Number'
,
year
:
'Number'
,
month
:
'Number'
,
page
:
'Number'
};
let
reqConf
=
{
state
:
'Number'
,
year
:
'Number'
,
month
:
'Number'
,
page
:
'Number'
};
let
{
state
,
year
,
month
,
page
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
{
state
,
year
,
month
,
page
}
=
eccReqNotMustHaveParam
(
reqConf
,
req
.
body
);
let
result
=
await
monthTableList
(
state
,
year
,
month
,
page
);
let
result
=
await
monthTableList
(
state
,
year
,
month
,
page
);
res
.
success
(
result
);
res
.
success
(
result
);
...
@@ -65,7 +66,7 @@ async function getMonthList(req, res) {
...
@@ -65,7 +66,7 @@ async function getMonthList(req, res) {
*/
*/
async
function
getFuHuaQiUserList
(
req
,
res
)
{
async
function
getFuHuaQiUserList
(
req
,
res
)
{
let
reqConf
=
{
operationName
:
'String'
,
page
:
'Number'
};
let
reqConf
=
{
operationName
:
'String'
,
page
:
'Number'
};
let
{
operationName
,
page
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
{
operationName
,
page
}
=
eccReqNotMustHaveParam
(
reqConf
,
req
.
body
);
let
result
=
await
userBiz
.
fuHuaQiUserList
(
operationName
,
page
);
let
result
=
await
userBiz
.
fuHuaQiUserList
(
operationName
,
page
);
res
.
success
(
result
);
res
.
success
(
result
);
...
@@ -79,7 +80,7 @@ async function getMonthList(req, res) {
...
@@ -79,7 +80,7 @@ async function getMonthList(req, res) {
*/
*/
async
function
updateState
(
req
,
res
)
{
async
function
updateState
(
req
,
res
)
{
let
reqConf
=
{
userState
:
'Boolean'
,
uscc
:
'String'
};
let
reqConf
=
{
userState
:
'Boolean'
,
uscc
:
'String'
};
let
{
userState
,
uscc
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
userState
,
uscc
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
let
result
=
await
userBiz
.
updateState
(
uscc
,
userState
);
let
result
=
await
userBiz
.
updateState
(
uscc
,
userState
);
res
.
success
(
result
);
res
.
success
(
result
);
...
@@ -93,7 +94,7 @@ async function getMonthList(req, res) {
...
@@ -93,7 +94,7 @@ async function getMonthList(req, res) {
*/
*/
async
function
addUser
(
req
,
res
)
{
async
function
addUser
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
form
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
let
result
=
await
userBiz
.
addUser
(
form
);
let
result
=
await
userBiz
.
addUser
(
form
);
res
.
success
(
result
);
res
.
success
(
result
);
...
@@ -103,33 +104,13 @@ async function addUser(req, res) {
...
@@ -103,33 +104,13 @@ async function addUser(req, res) {
async
function
outPutFuHuaQiData
(
req
,
res
)
{
async
function
outPutFuHuaQiData
(
req
,
res
)
{
let
reqConf
=
{
lv
:
'Number'
,
institutionalNature
:
'Number'
,
industry
:
'Number'
,
dataType
:
'Number'
,
type
:
'Number'
};
let
reqConf
=
{
lv
:
'Number'
,
institutionalNature
:
'Number'
,
industry
:
'Number'
,
dataType
:
'Number'
,
type
:
'Number'
};
let
{
lv
,
institutionalNature
,
industry
,
type
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
{
lv
,
institutionalNature
,
industry
,
type
}
=
eccReqNotMustHaveParam
(
reqConf
,
req
.
body
);
let
dataList
=
await
baseBiz
.
outPutFuHuaQiBaseData
(
lv
,
institutionalNature
,
industry
,
type
);
let
dataList
=
await
baseBiz
.
outPutFuHuaQiBaseData
(
lv
,
institutionalNature
,
industry
,
type
);
let
keyList
=
[
"name"
,
"operationName"
,
"uscc"
,
"virtualEnterpriseNum"
,
"logonTime"
,
"incubatedAcreage"
,
"acreageTotal"
,
"acreagePersonalUse"
,
"lv"
,
"identificationTime"
,
"industry"
,
"institutionalNature"
,
"liaison"
,
"liaisonPhone"
,
"personInCharge"
,
"personInChargePhone"
,
"personInChargeAdd"
,
"siteAcreage"
,
"leasePrice"
];
let
titleList
=
[
"名称"
,
"运营机构名称"
,
"统一信用代码"
,
"虚拟企业数量"
,
"注册时间"
,
"在孵面积"
,
"孵化器总面积"
,
"孵化器自用面积"
,
"孵化器级别"
,
"认定时间"
,
"领域"
,
"机构性质"
,
"联系人"
,
"联系电话"
,
"负责人"
,
"负责人联系电话"
,
"孵化场地地址"
,
"孵化场地面积"
,
"孵化场地出租单价"
];
let
result
=
[
titleList
];
dataList
.
forEach
(
info
=>
{
let
subList
=
[];
keyList
.
forEach
(
subInfo
=>
{
subList
.
push
(
info
[
subInfo
]
||
''
);
});
result
.
push
(
subList
);
});
let
name
=
`孵化器列表
${
getTimeKey
()}
.xlsx`
;
let
name
=
`孵化器列表
${
getTimeKey
()}
.xlsx`
;
res
.
success
({
name
,
data
:
resul
t
});
res
.
success
({
name
,
data
:
dataLis
t
});
}
}
...
@@ -137,29 +118,12 @@ async function outPutFuHuaQiData(req, res) {
...
@@ -137,29 +118,12 @@ async function outPutFuHuaQiData(req, res) {
async
function
outPutMonthData
(
req
,
res
)
{
async
function
outPutMonthData
(
req
,
res
)
{
let
reqConf
=
{
state
:
'Number'
,
year
:
'Number'
,
month
:
'Number'
,
type
:
'Number'
};
let
reqConf
=
{
state
:
'Number'
,
year
:
'Number'
,
month
:
'Number'
,
type
:
'Number'
};
let
{
state
,
year
,
month
,
type
}
=
checkParamaterType
(
reqConf
,
req
.
body
);
let
{
state
,
year
,
month
,
type
}
=
eccReqNotMustHaveParam
(
reqConf
,
req
.
body
);
let
dataList
=
await
monthBiz
.
outPutMonthTableList
(
state
,
year
,
month
,
type
);
let
dataList
=
await
monthBiz
.
outPutMonthTableList
(
state
,
year
,
month
,
type
);
let
keyList
=
[
"operationName"
,
"state"
,
"time"
,
"occupancyRate"
,
];
let
titleList
=
[
"运营机构名称"
,
"填报状态"
,
"数据月份"
,
"出租率(%)"
];
let
result
=
[
titleList
];
dataList
.
forEach
(
info
=>
{
let
subList
=
[];
keyList
.
forEach
(
subInfo
=>
{
subList
.
push
(
info
[
subInfo
]
||
''
);
});
result
.
push
(
subList
);
});
let
name
=
`月度任务
${
getTimeKey
()}
.xlsx`
;
let
name
=
`月度任务
${
getTimeKey
()}
.xlsx`
;
res
.
success
({
name
,
data
:
resul
t
});
res
.
success
({
name
,
data
:
dataLis
t
});
}
}
\ No newline at end of file
src/routers/admin/user.ts
View file @
5519de88
/**
* 管理后台端 管委会相关
*/
import
*
as
guanWeiHuiBiz
from
'../../biz/guanWeiHui/user'
;
import
*
as
guanWeiHuiBiz
from
'../../biz/guanWeiHui/user'
;
import
{
checkReqParam
}
from
'../../util/tools'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
{
eccReqMustHaveParam
}
from
'../../util/verificationParam'
;
export
function
setRouter
(
httpServer
)
{
export
function
setRouter
(
httpServer
)
{
httpServer
.
post
(
'/admin/login'
,
asyncHandler
(
login
));
httpServer
.
post
(
'/admin/login'
,
asyncHandler
(
login
));
...
@@ -14,7 +18,7 @@ export function setRouter(httpServer) {
...
@@ -14,7 +18,7 @@ export function setRouter(httpServer) {
*/
*/
async
function
login
(
req
,
res
)
{
async
function
login
(
req
,
res
)
{
let
reqConf
=
{
loginId
:
'String'
,
pwd
:
'String'
};
let
reqConf
=
{
loginId
:
'String'
,
pwd
:
'String'
};
let
{
loginId
,
pwd
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
loginId
,
pwd
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
let
userInfo
=
await
guanWeiHuiBiz
.
login
(
loginId
,
pwd
);
let
userInfo
=
await
guanWeiHuiBiz
.
login
(
loginId
,
pwd
);
res
.
success
(
userInfo
);
res
.
success
(
userInfo
);
...
...
src/routers/mobileClient/enterprise.ts
View file @
5519de88
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
enterpriseBiz
from
'../../biz/enterprise/enterprise'
;
import
*
as
enterpriseBiz
from
'../../biz/enterprise/enterprise'
;
import
{
checkReqParam
}
from
'../../util/tools'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
import
{
eccReqMustHaveParam
}
from
'../../util/verificationParam'
;
export
function
setRouter
(
httpServer
)
{
export
function
setRouter
(
httpServer
)
{
httpServer
.
post
(
'/fuhuaqi/enterprise/register'
,
checkFuHuaQiToken
,
asyncHandler
(
registerEnterprise
));
httpServer
.
post
(
'/fuhuaqi/enterprise/register'
,
checkFuHuaQiToken
,
asyncHandler
(
registerEnterprise
));
...
@@ -24,7 +24,7 @@ export function setRouter(httpServer) {
...
@@ -24,7 +24,7 @@ export function setRouter(httpServer) {
*/
*/
async
function
registerEnterprise
(
req
,
res
)
{
async
function
registerEnterprise
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
form
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterpriseBiz
.
registerEnterprise
(
Uscc
,
form
);
let
result
=
await
enterpriseBiz
.
registerEnterprise
(
Uscc
,
form
);
...
@@ -39,7 +39,7 @@ async function registerEnterprise(req, res) {
...
@@ -39,7 +39,7 @@ async function registerEnterprise(req, res) {
*/
*/
async
function
updateRegisterEnterprise
(
req
,
res
)
{
async
function
updateRegisterEnterprise
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
form
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterpriseBiz
.
updateRegisterEnterprise
(
Uscc
,
form
);
let
result
=
await
enterpriseBiz
.
updateRegisterEnterprise
(
Uscc
,
form
);
...
@@ -54,7 +54,7 @@ async function updateRegisterEnterprise(req, res) {
...
@@ -54,7 +54,7 @@ async function updateRegisterEnterprise(req, res) {
*/
*/
async
function
moveInEnterprise
(
req
,
res
)
{
async
function
moveInEnterprise
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
form
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterpriseBiz
.
moveInEnterprise
(
Uscc
,
form
);
let
result
=
await
enterpriseBiz
.
moveInEnterprise
(
Uscc
,
form
);
...
@@ -69,7 +69,7 @@ async function updateRegisterEnterprise(req, res) {
...
@@ -69,7 +69,7 @@ async function updateRegisterEnterprise(req, res) {
*/
*/
async
function
updateMoveInEnterprise
(
req
,
res
)
{
async
function
updateMoveInEnterprise
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
form
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterpriseBiz
.
updateMoveInEnterprise
(
Uscc
,
form
);
let
result
=
await
enterpriseBiz
.
updateMoveInEnterprise
(
Uscc
,
form
);
...
@@ -86,7 +86,7 @@ async function updateMoveInEnterprise(req, res) {
...
@@ -86,7 +86,7 @@ async function updateMoveInEnterprise(req, res) {
async
function
selectEnterpriseInfo
(
req
,
res
)
{
async
function
selectEnterpriseInfo
(
req
,
res
)
{
/*这里改成了用DraftId,为了不改前端 依然使用uscc这个参数*/
/*这里改成了用DraftId,为了不改前端 依然使用uscc这个参数*/
let
reqConf
=
{
uscc
:
'String'
};
let
reqConf
=
{
uscc
:
'String'
};
let
{
uscc
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
uscc
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
let
result
=
await
enterpriseBiz
.
getEnterpriseByDraftId
(
uscc
);
let
result
=
await
enterpriseBiz
.
getEnterpriseByDraftId
(
uscc
);
res
.
success
(
result
);
res
.
success
(
result
);
...
@@ -101,7 +101,7 @@ async function updateMoveInEnterprise(req, res) {
...
@@ -101,7 +101,7 @@ async function updateMoveInEnterprise(req, res) {
async
function
delEnterpriseInfo
(
req
,
res
)
{
async
function
delEnterpriseInfo
(
req
,
res
)
{
/*这里改成了用DraftId,为了不改前端 依然使用uscc这个参数*/
/*这里改成了用DraftId,为了不改前端 依然使用uscc这个参数*/
let
reqConf
=
{
uscc
:
'String'
};
let
reqConf
=
{
uscc
:
'String'
};
let
{
uscc
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
uscc
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
let
result
=
await
enterpriseBiz
.
deleteEnterpriseByDraftId
(
uscc
);
let
result
=
await
enterpriseBiz
.
deleteEnterpriseByDraftId
(
uscc
);
res
.
success
(
result
);
res
.
success
(
result
);
...
...
src/routers/mobileClient/financing.ts
View file @
5519de88
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
financingBiz
from
'../../biz/enterprise/financing'
;
import
*
as
financingBiz
from
'../../biz/enterprise/financing'
;
import
{
checkReqParam
}
from
'../../util/tools'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
import
{
eccReqMustHaveParam
}
from
'../../util/verificationParam'
;
export
function
setRouter
(
httpServer
)
{
export
function
setRouter
(
httpServer
)
{
httpServer
.
post
(
'/fuhuaqi/financing/create'
,
checkFuHuaQiToken
,
asyncHandler
(
createFinancingInfo
));
httpServer
.
post
(
'/fuhuaqi/financing/create'
,
checkFuHuaQiToken
,
asyncHandler
(
createFinancingInfo
));
...
@@ -23,7 +23,7 @@ export function setRouter(httpServer) {
...
@@ -23,7 +23,7 @@ export function setRouter(httpServer) {
*/
*/
async
function
createFinancingInfo
(
req
,
res
)
{
async
function
createFinancingInfo
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
form
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
financingBiz
.
createFinancingInfo
(
Uscc
,
form
);
let
result
=
await
financingBiz
.
createFinancingInfo
(
Uscc
,
form
);
...
@@ -38,7 +38,7 @@ async function createFinancingInfo(req, res) {
...
@@ -38,7 +38,7 @@ async function createFinancingInfo(req, res) {
*/
*/
async
function
updateFinancingInfo
(
req
,
res
)
{
async
function
updateFinancingInfo
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
form
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
financingBiz
.
updateFinancingInfo
(
Uscc
,
form
);
let
result
=
await
financingBiz
.
updateFinancingInfo
(
Uscc
,
form
);
...
@@ -54,7 +54,7 @@ async function createFinancingInfo(req, res) {
...
@@ -54,7 +54,7 @@ async function createFinancingInfo(req, res) {
*/
*/
async
function
selectEnterpriseFinancingInfo
(
req
,
res
)
{
async
function
selectEnterpriseFinancingInfo
(
req
,
res
)
{
let
reqConf
=
{
uscc
:
'String'
};
let
reqConf
=
{
uscc
:
'String'
};
let
{
uscc
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
uscc
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
FHQUscc
=
req
.
headers
.
uscc
;
const
FHQUscc
=
req
.
headers
.
uscc
;
let
result
=
await
financingBiz
.
getEnterpriseFinancingByUscc
(
FHQUscc
,
uscc
);
let
result
=
await
financingBiz
.
getEnterpriseFinancingByUscc
(
FHQUscc
,
uscc
);
...
@@ -69,7 +69,7 @@ async function selectEnterpriseFinancingInfo(req, res) {
...
@@ -69,7 +69,7 @@ async function selectEnterpriseFinancingInfo(req, res) {
*/
*/
async
function
delEnterpriseFinancingInfo
(
req
,
res
)
{
async
function
delEnterpriseFinancingInfo
(
req
,
res
)
{
let
reqConf
=
{
uscc
:
'String'
};
let
reqConf
=
{
uscc
:
'String'
};
let
{
uscc
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
uscc
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
FHQUscc
=
req
.
headers
.
uscc
;
const
FHQUscc
=
req
.
headers
.
uscc
;
let
result
=
await
financingBiz
.
deleteEnterpriseFinancingByUscc
(
FHQUscc
,
uscc
);
let
result
=
await
financingBiz
.
deleteEnterpriseFinancingByUscc
(
FHQUscc
,
uscc
);
...
...
src/routers/mobileClient/fuHuaQi.ts
View file @
5519de88
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
baseBiz
from
'../../biz/fuHuqQi/base'
;
import
*
as
baseBiz
from
'../../biz/fuHuqQi/base'
;
import
*
as
taskBiz
from
'../../biz/fuHuqQi/task'
;
import
*
as
taskBiz
from
'../../biz/fuHuqQi/task'
;
import
{
checkReqParam
}
from
'../../util/tools
'
;
import
{
eccReqMustHaveParam
}
from
'../../util/verificationParam
'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
export
function
setRouter
(
httpServer
)
{
export
function
setRouter
(
httpServer
)
{
...
@@ -55,7 +55,7 @@ async function myDataInfo(req, res) {
...
@@ -55,7 +55,7 @@ async function myDataInfo(req, res) {
*/
*/
async
function
updateMyDataInfo
(
req
,
res
)
{
async
function
updateMyDataInfo
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
form
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
baseBiz
.
updateFuHuaQiBaseData
(
Uscc
,
form
);
let
result
=
await
baseBiz
.
updateFuHuaQiBaseData
(
Uscc
,
form
);
...
@@ -78,7 +78,7 @@ async function organizationInfo(req, res) {
...
@@ -78,7 +78,7 @@ async function organizationInfo(req, res) {
*/
*/
async
function
updateOrganizationInfo
(
req
,
res
)
{
async
function
updateOrganizationInfo
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
form
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
baseBiz
.
updateOrganizationData
(
Uscc
,
form
);
let
result
=
await
baseBiz
.
updateOrganizationData
(
Uscc
,
form
);
...
@@ -105,12 +105,9 @@ async function taskList(req, res) {
...
@@ -105,12 +105,9 @@ async function taskList(req, res) {
*/
*/
async
function
submitTask
(
req
,
res
)
{
async
function
submitTask
(
req
,
res
)
{
let
reqConf
=
{
taskType
:
'Number'
};
let
reqConf
=
{
taskType
:
'Number'
};
let
{
taskType
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
taskType
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
taskBiz
.
checkTask
(
Uscc
,
taskType
);
let
result
=
await
taskBiz
.
checkTask
(
Uscc
,
taskType
);
res
.
success
(
result
);
res
.
success
(
result
);
}
}
\ No newline at end of file
src/routers/mobileClient/month.ts
View file @
5519de88
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
monthBiz
from
'../../biz/fuHuqQi/month'
;
import
*
as
monthBiz
from
'../../biz/fuHuqQi/month'
;
import
{
checkReqParam
}
from
'../../util/tools
'
;
import
{
eccReqMustHaveParam
}
from
'../../util/verificationParam
'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
export
function
setRouter
(
httpServer
)
{
export
function
setRouter
(
httpServer
)
{
...
@@ -22,7 +22,7 @@ export function setRouter(httpServer) {
...
@@ -22,7 +22,7 @@ export function setRouter(httpServer) {
*/
*/
async
function
addReport
(
req
,
res
)
{
async
function
addReport
(
req
,
res
)
{
let
reqConf
=
{
occupancyRate
:
'Number'
};
let
reqConf
=
{
occupancyRate
:
'Number'
};
let
{
occupancyRate
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
occupancyRate
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
monthInfo
=
monthBiz
.
createReport
(
Uscc
,
occupancyRate
);
let
monthInfo
=
monthBiz
.
createReport
(
Uscc
,
occupancyRate
);
...
@@ -63,7 +63,7 @@ async function deleteReport(req, res) {
...
@@ -63,7 +63,7 @@ async function deleteReport(req, res) {
*/
*/
async
function
updateReport
(
req
,
res
)
{
async
function
updateReport
(
req
,
res
)
{
let
reqConf
=
{
occupancyRate
:
'Number'
};
let
reqConf
=
{
occupancyRate
:
'Number'
};
let
{
occupancyRate
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
occupancyRate
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
let
monthInfo
=
monthBiz
.
updateReport
(
Uscc
,
occupancyRate
);
let
monthInfo
=
monthBiz
.
updateReport
(
Uscc
,
occupancyRate
);
...
...
src/routers/mobileClient/user.ts
View file @
5519de88
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
userBiz
from
'../../biz/fuHuqQi/user'
;
import
*
as
userBiz
from
'../../biz/fuHuqQi/user'
;
import
{
checkReqParam
}
from
'../../util/tools
'
;
import
{
eccReqMustHaveParam
}
from
'../../util/verificationParam
'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
export
function
setRouter
(
httpServer
)
{
export
function
setRouter
(
httpServer
)
{
...
@@ -21,7 +21,7 @@ export function setRouter(httpServer) {
...
@@ -21,7 +21,7 @@ export function setRouter(httpServer) {
*/
*/
async
function
login
(
req
,
res
)
{
async
function
login
(
req
,
res
)
{
let
reqConf
=
{
uscc
:
'String'
,
pwd
:
'String'
};
let
reqConf
=
{
uscc
:
'String'
,
pwd
:
'String'
};
let
{
uscc
,
pwd
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
uscc
,
pwd
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
let
result
=
await
userBiz
.
login
(
uscc
,
pwd
);
let
result
=
await
userBiz
.
login
(
uscc
,
pwd
);
...
@@ -48,7 +48,7 @@ async function logout(req, res) {
...
@@ -48,7 +48,7 @@ async function logout(req, res) {
*/
*/
async
function
firstUpdatePwd
(
req
,
res
)
{
async
function
firstUpdatePwd
(
req
,
res
)
{
let
reqConf
=
{
confirmPwd
:
'String'
,
pwd
:
'String'
,
};
let
reqConf
=
{
confirmPwd
:
'String'
,
pwd
:
'String'
,
};
let
{
confirmPwd
,
pwd
}
=
checkReq
Param
(
reqConf
,
req
.
body
);
let
{
confirmPwd
,
pwd
}
=
eccReqMustHave
Param
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
const
Uscc
=
req
.
headers
.
uscc
;
...
...
src/routers/public.ts
View file @
5519de88
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
asyncHandler
from
'express-async-handler'
;
import
{
FUHUAQILV
,
INSTITUTIONALNATURE
,
FUHUAINDUSTRY
,
INDUSTRY
,
FUHUAQILNVESTMENTSTYLE
,
OPERATIONMODEL
,
TEAM
,
DEGREE
,
FINANCINGROUNDS
}
from
'../config/enum'
;
import
{
FUHUAQILV
,
INSTITUTIONALNATURE
,
FUHUAINDUSTRY
,
INDUSTRY
,
FUHUAQILNVESTMENTSTYLE
,
OPERATIONMODEL
,
TEAM
,
DEGREE
,
FINANCINGROUNDS
}
from
'../config/enum'
;
import
{
checkFuHuaQiToken
}
from
'../middleware/user'
;
export
function
setRouter
(
httpServer
)
{
export
function
setRouter
(
httpServer
)
{
httpServer
.
post
(
'/public/fuhuaqilv'
,
asyncHandler
(
getFuHuaQiLv
));
httpServer
.
post
(
'/public/fuhuaqilv'
,
asyncHandler
(
getFuHuaQiLv
));
...
...
src/
util
/dataInit.ts
→
src/
tools
/dataInit.ts
View file @
5519de88
import
{
FUHUAINDUSTRY
,
FUHUAQILV
,
INDUSTRY
,
INSTITUTIONALNATURE
}
from
"../config/enum"
;
import
{
FUHUAINDUSTRY
,
FUHUAQILV
,
INDUSTRY
,
INSTITUTIONALNATURE
}
from
"../config/enum"
;
import
{
createEnterpriseToList
,
findEnterpriseCount
}
from
"../data/enterprise/enterprise"
;
import
{
createEnterpriseToList
,
findEnterpriseCount
}
from
"../data/enterprise/enterprise"
;
import
{
createFuHuaQiToList
,
findAllFuHuaQiOperationUsccMap
,
findFuHuaQiUserCount
}
from
"../data/fuHuaQi/fuhuaqi"
;
import
{
createFuHuaQiToList
,
findAllFuHuaQiOperationUsccMap
,
findFuHuaQiUserCount
}
from
"../data/fuHuaQi/fuhuaqi"
;
import
{
getPwdMd5
,
getTaskId
}
from
"./
tools
"
;
import
{
getPwdMd5
,
getTaskId
}
from
"./
system
"
;
const
fs
=
require
(
'fs'
);
const
fs
=
require
(
'fs'
);
const
xlsx
=
require
(
'node-xlsx'
);
const
xlsx
=
require
(
'node-xlsx'
);
const
path
=
require
(
'path'
);
const
path
=
require
(
'path'
);
...
...
src/tools/system.ts
0 → 100644
View file @
5519de88
const
md5
=
require
(
"md5"
);
/**
* 生成任务id
* @param uscc 企业标识
* @returns
*/
export
function
getTaskId
(
uscc
:
string
)
{
return
`
${
uscc
}${
getTimeKey
()}
`
}
/**
* 获取当前日期的key
* @returns
*/
export
function
getTimeKey
()
{
return
`
${
new
Date
().
getFullYear
()}${
new
Date
().
getMonth
()
+
1
}
`
}
/**
* 生成草稿箱Id
* @param uscc
* @returns
*/
export
function
getDraftId
(
uscc
:
string
)
{
return
md5
(
`
${
uscc
}${
new
Date
().
valueOf
()}${
Math
.
ceil
(
Math
.
random
()
*
1000
)}
`
);
}
/**
* 密码加密
* @param uscc 信用代码
* @param pwd 密码
* @returns md5后的密码
*/
export
function
getPwdMd5
(
uscc
:
string
,
pwd
:
string
)
{
return
md5
(
uscc
+
pwd
);
}
/**
* 获取token
* @param uscc 统一信用代码
*/
export
function
getToken
(
uscc
:
string
)
{
return
md5
(
`
${
uscc
}${
new
Date
().
valueOf
()}${
Math
.
ceil
(
Math
.
random
()
*
100
)}
`
);
}
\ No newline at end of file
src/util/log.ts
View file @
5519de88
...
@@ -21,7 +21,7 @@ let config = {
...
@@ -21,7 +21,7 @@ let config = {
"errorLogger"
:
{
"errorLogger"
:
{
"type"
:
"dateFile"
,
// 日志类型
"type"
:
"dateFile"
,
// 日志类型
"filename"
:
errFile
,
// 输出文件名
"filename"
:
errFile
,
// 输出文件名
"pattern"
:
"
-
yyyy-MM-dd.log"
,
// 后缀
"pattern"
:
"yyyy-MM-dd.log"
,
// 后缀
"alwaysIncludePattern"
:
true
,
// 上面两个参数是否合并
"alwaysIncludePattern"
:
true
,
// 上面两个参数是否合并
"encoding"
:
"utf-8"
,
// 编码格式
"encoding"
:
"utf-8"
,
// 编码格式
"maxLogSize"
:
1000
,
// 最大存储内容
"maxLogSize"
:
1000
,
// 最大存储内容
...
@@ -31,7 +31,7 @@ let config = {
...
@@ -31,7 +31,7 @@ let config = {
"handleLogger"
:
{
"handleLogger"
:
{
"type"
:
"dateFile"
,
"type"
:
"dateFile"
,
"filename"
:
handFile
,
"filename"
:
handFile
,
"pattern"
:
"
-
yyyy-MM-dd.log"
,
"pattern"
:
"yyyy-MM-dd.log"
,
"alwaysIncludePattern"
:
true
,
"alwaysIncludePattern"
:
true
,
"encoding"
:
"utf-8"
,
"encoding"
:
"utf-8"
,
"maxLogSize"
:
1000
,
"maxLogSize"
:
1000
,
...
...
src/util/piecemeal.ts
0 → 100644
View file @
5519de88
import
moment
=
require
(
"moment"
);
/**
* 匹配新旧对象变化
* 将newObj 与 oldObj 比对,将newObj中发生变化的key返回
* 使用前需要校验对象中的内容
* @param newObj 新对象
* @param oldObj 旧对象
* @returns [key] 发生变化的key
*/
export
function
checkChange
(
newObj
,
oldObj
)
{
let
changeKeyList
=
[];
for
(
let
newKey
in
newObj
)
{
if
(
`
${
newObj
[
newKey
]}
`
!=
`
${
oldObj
[
newKey
]}
`
)
changeKeyList
.
push
(
newKey
);
}
return
changeKeyList
;
}
/**
* 根据conf截取data中的数据
* @param conf
* @param data
* @returns
*/
export
function
extractData
(
conf
,
data
,
isAdmin
)
{
let
result
=
{};
for
(
let
key
in
conf
)
{
let
confInfo
=
conf
[
key
];
if
(
confInfo
.
changeDate
)
{
if
(
isAdmin
)
result
[
key
]
=
data
[
key
]
?
moment
(
data
[
key
]).
format
(
"YYYY-MM-DD"
)
:
'-'
;
else
result
[
key
]
=
data
[
key
]
||
0
;
}
else
{
result
[
key
]
=
data
[
key
];
if
(
typeof
result
[
key
]
==
'string'
&&
!
result
[
key
])
result
[
key
]
=
''
;
}
}
return
result
;
}
src/util/verificationEnum.ts
0 → 100644
View file @
5519de88
/**
* 校验value是否符合传入的枚举
* @param enumConf 目标枚举
* @param value 目标值
* @returns true/false 是否通过校验
*/
export
function
checkEnumValue
(
enumConf
,
value
:
any
)
{
if
(
typeof
value
==
'number'
)
{
return
enumConf
[
value
]
?
true
:
false
;
}
let
checkSuccess
=
true
;
value
.
forEach
(
item
=>
{
if
(
!
enumConf
[
item
]
)
checkSuccess
=
false
;
});
return
checkSuccess
;
}
/**
* 将枚举值转换成对应的枚举名(key)
* @param enumConf 目标枚举
* @param value 目标值
* @returns string 返回字符串 如果传入多个枚举值,就拼接字符串
*/
export
function
changeEnumValue
(
enumConf
,
value
:
any
)
{
if
(
!
value
)
return
''
;
if
(
typeof
value
==
'number'
)
{
return
enumConf
[
value
];
}
let
str
=
""
;
value
.
forEach
((
item
,
index
)
=>
{
str
+=
enumConf
[
item
];
if
(
index
==
value
.
length
-
1
)
str
+=
""
;
else
str
+=
","
});
return
str
;
}
\ No newline at end of file
src/util/
tools
.ts
→
src/util/
verificationParam
.ts
View file @
5519de88
import
moment
=
require
(
"moment"
);
import
{
ERRORENUM
}
from
"../config/errorEnum"
;
import
{
BizError
}
from
"./bizError"
;
const
md5
=
require
(
"md5"
);
/**
/**
* 生成任务id
* 校验参数工具
* @param uscc 企业标识
*
* @returns
*/
*/
export
function
getTaskId
(
uscc
:
string
)
{
return
`
${
uscc
}${
getTimeKey
()}
`
}
/**
import
{
ERRORENUM
}
from
"../config/errorEnum"
;
* 获取当前日期的key
import
{
BizError
}
from
"./bizError"
;
* @returns
*/
export
function
getTimeKey
()
{
return
`
${
new
Date
().
getFullYear
()}${
new
Date
().
getMonth
()
+
1
}
`
}
/**
/**
* 生成草稿箱Id
* 通过config校验表单参数param
* @param uscc
* 包括类型 String, Number, Boolean, [Number], [Object]
* @returns
* 参数是必填
*/
* 方法会校验表单中存在的多余字段
export
function
getDraftId
(
uscc
:
string
)
{
* todo 后续优化配置
return
md5
(
`
${
uscc
}${
new
Date
().
valueOf
()}${
Math
.
ceil
(
Math
.
random
()
*
1000
)}
`
);
}
/**
* 通过config校验参数param
* 包括类型 String, Number, Boolean, [Number]
* @param name 被调用的方法名
* @param name 被调用的方法名
* @param config 校验配置
* @param config 校验配置
* @param param 需要校验的参数
* @param param 需要校验的参数
* @param skipKeys 跳过验证的字段
* @returns true 无需关注返回
*/
*/
export
function
checkParamater
(
name
:
string
,
keyTypeConf
:
object
,
param
:
object
,
skipKeys
?)
{
export
function
eccFormParam
(
name
:
string
,
keyTypeConf
:
object
,
param
:
object
,
skipKeys
?)
{
for
(
let
key
in
keyTypeConf
)
{
for
(
let
key
in
keyTypeConf
)
{
if
(
skipKeys
&&
skipKeys
.
indexOf
(
key
)
>
-
1
&&
!
param
[
key
])
{
if
(
skipKeys
&&
skipKeys
.
indexOf
(
key
)
>
-
1
&&
!
param
[
key
])
{
continue
;
continue
;
...
@@ -78,41 +61,15 @@ export function checkParamater(name:string, keyTypeConf:object, param:object, sk
...
@@ -78,41 +61,15 @@ export function checkParamater(name:string, keyTypeConf:object, param:object, sk
return
true
;
return
true
;
}
}
/**
* 匹配新旧对象变化
* 将newObj 与 oldObj 比对,将newObj中发生变化的key返回
* 使用前需要校验对象中的内容
* @param newObj 新对象
* @param oldObj 旧对象
* @returns [key] 发生变化的key
*/
export
function
checkChange
(
newObj
,
oldObj
)
{
let
changeKeyList
=
[];
for
(
let
newKey
in
newObj
)
{
if
(
`
${
newObj
[
newKey
]}
`
!=
`
${
oldObj
[
newKey
]}
`
)
changeKeyList
.
push
(
newKey
);
}
return
changeKeyList
;
}
/**
/**
* 密码加密
* 根据conf配置校验请求参数
* @param uscc 信用代码
* 参数为必填
* @param pwd 密码
* @param conf 配置
* @returns md5后的密码
* @param param 待校验对象
* @returns 原有表单数据
*/
*/
export
function
getPwdMd5
(
uscc
:
string
,
pwd
:
string
)
{
export
function
eccReqMustHaveParam
(
conf
:
object
,
param
)
{
return
md5
(
uscc
+
pwd
);
}
/**
* 校验请求参数
* 判断参数为必填
* @param conf
* @param param
* @returns
*/
export
function
checkReqParam
(
conf
,
param
)
{
for
(
let
key
in
conf
)
{
for
(
let
key
in
conf
)
{
if
(
typeof
param
[
key
]
!=
'boolean'
&&
!
param
[
key
]
)
throw
new
BizError
(
ERRORENUM
.
参数错误
,
`缺失
${
key
}
字段`
);
if
(
typeof
param
[
key
]
!=
'boolean'
&&
!
param
[
key
]
)
throw
new
BizError
(
ERRORENUM
.
参数错误
,
`缺失
${
key
}
字段`
);
let
type
=
typeof
param
[
key
];
let
type
=
typeof
param
[
key
];
...
@@ -155,12 +112,12 @@ export function checkReqParam(conf, param) {
...
@@ -155,12 +112,12 @@ export function checkReqParam(conf, param) {
/**
/**
* 校验请求参数
* 校验请求参数
*
判断参数可以不
填
*
参数为非必
填
* @param conf
* @param conf
配置
* @param param
* @param param
待校验对象
* @returns
* @returns
原有表单数据
*/
*/
export
function
checkParamaterType
(
conf
,
param
)
{
export
function
eccReqNotMustHaveParam
(
conf
,
param
)
{
for
(
let
key
in
conf
)
{
for
(
let
key
in
conf
)
{
if
(
!
param
[
key
])
continue
;
if
(
!
param
[
key
])
continue
;
let
type
=
typeof
param
[
key
];
let
type
=
typeof
param
[
key
];
...
@@ -200,82 +157,3 @@ export function checkParamaterType(conf, param) {
...
@@ -200,82 +157,3 @@ export function checkParamaterType(conf, param) {
}
}
return
param
;
return
param
;
}
}
/**
* 获取token
* @param uscc 统一信用代码
*/
export
function
getToken
(
uscc
:
string
)
{
return
md5
(
`
${
uscc
}${
new
Date
().
valueOf
()}${
Math
.
ceil
(
Math
.
random
()
*
100
)}
`
);
}
/**
* 根据conf截取data中的数据
* @param conf
* @param data
* @returns
*/
export
function
extractData
(
conf
,
data
,
isAdmin
)
{
let
result
=
{};
for
(
let
key
in
conf
)
{
let
confInfo
=
conf
[
key
];
if
(
confInfo
.
changeDate
)
{
if
(
isAdmin
)
result
[
key
]
=
data
[
key
]
?
moment
(
data
[
key
]).
format
(
"YYYY-MM-DD"
)
:
'-'
;
else
result
[
key
]
=
data
[
key
]
||
0
;
}
else
{
result
[
key
]
=
data
[
key
];
if
(
typeof
result
[
key
]
==
'string'
&&
!
result
[
key
])
result
[
key
]
=
''
;
}
}
return
result
;
}
/**
* 校验value是否符合传入的枚举
* @param enumConf 目标枚举
* @param value 目标值
* @returns true/false 是否通过校验
*/
export
function
checkEnumValue
(
enumConf
,
value
:
any
)
{
if
(
typeof
value
==
'number'
)
{
return
enumConf
[
value
]
?
true
:
false
;
}
let
checkSuccess
=
true
;
value
.
forEach
(
item
=>
{
if
(
!
enumConf
[
item
]
)
checkSuccess
=
false
;
});
return
checkSuccess
;
}
/**
* 将枚举值转换成对应的枚举名(key)
* @param enumConf 目标枚举
* @param value 目标值
* @returns string 返回字符串 如果传入多个枚举值,就拼接字符串
*/
export
function
changeEnumValue
(
enumConf
,
value
:
any
)
{
if
(
!
value
)
return
''
;
if
(
typeof
value
==
'number'
)
{
return
enumConf
[
value
];
}
let
str
=
""
;
value
.
forEach
((
item
,
index
)
=>
{
str
+=
enumConf
[
item
];
if
(
index
==
value
.
length
-
1
)
str
+=
""
;
else
str
+=
","
});
return
str
;
}
export
function
checkPhone
(
phoneNumber
:
string
)
{
}
export
function
checkUscc
()
{
}
\ 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