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
98323d9d
Commit
98323d9d
authored
Feb 21, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
返回配置
parent
66f99b85
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
77 additions
and
39 deletions
+77
-39
enterprise.ts
src/biz/enterprise/enterprise.ts
+4
-5
financing.ts
src/biz/enterprise/financing.ts
+4
-5
base.ts
src/biz/fuHuqQi/base.ts
+7
-8
month.ts
src/biz/fuHuqQi/month.ts
+2
-2
user.ts
src/biz/fuHuqQi/user.ts
+8
-5
errorEnum.ts
src/config/errorEnum.ts
+3
-1
splitResultConfig.ts
src/config/splitResultConfig.ts
+38
-12
dataInit.ts
src/tools/dataInit.ts
+2
-1
system.ts
src/tools/system.ts
+9
-0
No files found.
src/biz/enterprise/enterprise.ts
View file @
98323d9d
...
...
@@ -6,11 +6,10 @@
*/
import
*
as
paramConfig
from
"../../config/checkParamConfig"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
EnterpriseInfoConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
*
as
sysTools
from
"../../tools/system"
;
import
*
as
enterpriseData
from
"../../data/enterprise/enterprise"
;
import
{
EnterpriseListConfig
}
from
"../../config/ojbectResultKey
Config"
;
import
*
as
splitResultConfig
from
"../../config/splitResult
Config"
;
import
*
as
fuHuaQiData
from
"../../data/fuHuaQi/fuhuaqi"
;
import
*
as
configEnum
from
"../../config/enum"
;
import
{
eccFormParam
}
from
"../../util/verificationParam"
;
...
...
@@ -134,7 +133,7 @@ export async function getEnterpriseByDraftId(draftId:string) {
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByDraftId
(
draftId
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在draftId=
${
draftId
}
这个企业`
);
let
data
:
any
=
extractData
(
EnterpriseInfoConfig
,
dataBaseInfo
,
false
);
let
data
:
any
=
extractData
(
splitResultConfig
.
EnterpriseInfoConfig
,
dataBaseInfo
,
false
);
data
.
draftId
=
dataBaseInfo
.
draftId
;
return
{
data
};
...
...
@@ -187,7 +186,7 @@ export async function enterpriseList(createType:number, fuHuaQiUscc:string, indu
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
EnterpriseListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
splitResultConfig
.
EnterpriseListConfig
,
info
,
true
);
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
if
(
info
.
enterpriseIsInPut
)
{
...
...
@@ -232,7 +231,7 @@ export async function outPutEnterpriseData(createType:number, fuHuaQiUscc:string
let
dataBaseList
=
await
enterpriseData
.
findEnterpriseList
(
selectParam
);
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
EnterpriseListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
splitResultConfig
.
EnterpriseListConfig
,
info
,
true
);
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
if
(
info
.
enterpriseIsInPut
)
{
changeData
.
isCreate
=
""
;
...
...
src/biz/enterprise/financing.ts
View file @
98323d9d
...
...
@@ -6,9 +6,8 @@
*/
import
{
FinancingParamConfig
,
FinancingParamUpdateConfig
}
from
"../../config/checkParamConfig"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
EnterpriseFinancingInfoConfig
}
from
"../../config/ojbectResultKeyConfig"
;
import
*
as
financingData
from
"../../data/enterprise/financing"
;
import
{
FinancingListConfig
}
from
"../../config/ojbectResultKey
Config"
;
import
*
as
splitResultConfig
from
"../../config/splitResult
Config"
;
import
{
BizError
}
from
"../../util/bizError"
;
import
*
as
sysTools
from
"../../tools/system"
;
import
*
as
enterpriseData
from
"../../data/enterprise/enterprise"
;
...
...
@@ -111,7 +110,7 @@ export async function getEnterpriseFinancingByUscc(fuHuaQiUscc:string, uscc:stri
let
dataBaseInfo
=
await
financingData
.
findFinancingInfoByTaskIdAndSucc
(
TaskId
,
uscc
);
if
(
!
dataBaseInfo
||
!
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`库中不存在
${
uscc
}
这个企业的本次融资数据`
);
let
data
=
extractData
(
EnterpriseFinancingInfoConfig
,
dataBaseInfo
,
false
);
let
data
=
extractData
(
splitResultConfig
.
EnterpriseFinancingInfoConfig
,
dataBaseInfo
,
false
);
return
{
data
};
}
...
...
@@ -197,7 +196,7 @@ export async function financingList(monthData:string, fuHuaQiName:string, indust
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
FinancingListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
splitResultConfig
.
FinancingListConfig
,
info
,
true
);
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
changeData
.
industry
=
changeEnumValue
(
configEnum
.
INDUSTRY
,
info
.
industry
);
...
...
@@ -248,7 +247,7 @@ export async function outPutFinancingList(monthData:string, fuHuaQiName:string,
let
usccMap
=
await
fuhuaqiData
.
findAllFuHuaQiOperationNameMap
();
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
FinancingListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
splitResultConfig
.
FinancingListConfig
,
info
,
true
);
changeData
.
fuhuaqiUscc
=
usccMap
[
info
.
fuHuaQiUscc
]
||
""
;
changeData
.
industry
=
changeEnumValue
(
configEnum
.
INDUSTRY
,
info
.
industry
);
dataList
.
push
(
changeData
);
...
...
src/biz/fuHuqQi/base.ts
View file @
98323d9d
...
...
@@ -7,7 +7,7 @@
import
{
BaseParamUpdateConfig
,
OrganizationParamUpdateConfig
}
from
"../../config/checkParamConfig"
;
import
{
findEnterpriseCountByFuHuaQiUscc
,
groupFindEnterpriseCount
}
from
"../../data/enterprise/enterprise"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
;
import
*
as
resultConfig
from
"../../config/ojbectResultKey
Config"
;
import
*
as
splitResultConfig
from
"../../config/splitResult
Config"
;
import
*
as
configEnum
from
"../../config/enum"
;
import
{
checkChange
,
extractData
}
from
"../../util/piecemeal"
;
import
{
BizError
}
from
"../../util/bizError"
;
...
...
@@ -26,9 +26,9 @@ import { changeEnumValue } from "../../util/verificationEnum";
export
async
function
homeData
(
uscc
:
string
)
{
let
dataBaseInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
let
data
:
any
=
extractData
(
r
esultConfig
.
FuHuaQiHomeDataConfig
,
dataBaseInfo
,
false
);
let
data
:
any
=
extractData
(
splitR
esultConfig
.
FuHuaQiHomeDataConfig
,
dataBaseInfo
,
false
);
data
.
enterpriseCount
=
await
findEnterpriseCountByFuHuaQiUscc
(
uscc
);
data
.
enterpriseCount
=
await
findEnterpriseCountByFuHuaQiUscc
(
uscc
)
||
0
;
data
.
lv
=
changeEnumValue
(
configEnum
.
FUHUAQILV
,
dataBaseInfo
.
lv
);
data
.
institutionalNature
=
changeEnumValue
(
configEnum
.
INSTITUTIONALNATURE
,
dataBaseInfo
.
institutionalNature
);
...
...
@@ -47,8 +47,7 @@ export async function selectFuHuaQiBaseData(uscc:string) {
let
enterpriseTotal
=
await
findEnterpriseCountByFuHuaQiUscc
(
uscc
);
//企业总数
let
data
:
any
=
extractData
(
resultConfig
.
FuHuaQiBaseDataConfig
,
dataBaseInfo
,
false
);
let
data
:
any
=
extractData
(
splitResultConfig
.
FuHuaQiBaseDataConfig
,
dataBaseInfo
,
false
);
data
.
enterpriseTotal
=
enterpriseTotal
;
data
.
numOfEntities
=
enterpriseTotal
-
dataBaseInfo
.
virtualEnterpriseNum
;
//企业总数 - 虚拟企业数量
...
...
@@ -65,7 +64,7 @@ export async function selectFuHuaQiBaseData(uscc:string) {
export
async
function
selectOrganizationInfo
(
uscc
:
string
)
{
let
dataBaseInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
let
data
:
any
=
extractData
(
r
esultConfig
.
OrganizationBaseDataConfig
,
dataBaseInfo
,
false
);
let
data
:
any
=
extractData
(
splitR
esultConfig
.
OrganizationBaseDataConfig
,
dataBaseInfo
,
false
);
return
data
;
}
...
...
@@ -172,7 +171,7 @@ export async function fuHuaQiBaseList(lv:number, institutionalNature:number, ind
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
r
esultConfig
.
FuHuaQiBaseListConfig
,
info
,
true
);
let
changeData
:
any
=
extractData
(
splitR
esultConfig
.
FuHuaQiBaseListConfig
,
info
,
true
);
// let hatchingGround = info.hatchingGround;
// hatchingGround.forEach (info => {
// let {personInChargeAdd, siteAcreage, leasePrice} = info;
...
...
@@ -276,7 +275,7 @@ export async function outPutFuHuaQiBaseData(lv:number, institutionalNature:numbe
let
maxTeamNumber
=
0
;
//最大团队数
let
maxHatching
=
0
;
//最大场地数
dataBaseList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
r
esultConfig
.
FuHuaQiBaseListConfig
,
info
,
true
);
//截取特定的字段
let
changeData
:
any
=
extractData
(
splitR
esultConfig
.
FuHuaQiBaseListConfig
,
info
,
true
);
//截取特定的字段
const
EnterpriseTotal
=
enterpriseMap
[
info
.
uscc
]
||
0
;
//企业总数
let
numOfEntities
=
EnterpriseTotal
-
(
info
.
virtualEnterpriseNum
||
0
);
//实体企业
...
...
src/biz/fuHuqQi/month.ts
View file @
98323d9d
...
...
@@ -10,7 +10,7 @@ import * as monthData from "../../data/fuHuaQi/monthTable";
import
{
extractData
}
from
"../../util/piecemeal"
;
import
*
as
sysTools
from
"../../tools/system"
;
import
{
findAllFuHuaQiOperationNameMap
}
from
"../../data/fuHuaQi/fuhuaqi"
;
import
{
MonthConfig
}
from
"../../config/ojbectResultKey
Config"
;
import
*
as
splitResultConfig
from
"../../config/splitResult
Config"
;
import
{
OUTPUTTYPE
}
from
"../../config/enum"
;
...
...
@@ -87,7 +87,7 @@ export async function getMonthByUscc(uscc:string) {
let
dataBaseInfo
=
await
monthData
.
findMonthTableByTaskId
(
TaskId
);
if
(
!
dataBaseInfo
.
isUpdate
)
throw
new
BizError
(
ERRORENUM
.
未找到数据
,
`未找到
${
uscc
}
的月度报表`
);
let
data
=
extractData
(
MonthConfig
,
dataBaseInfo
,
false
);
let
data
=
extractData
(
splitResultConfig
.
MonthConfig
,
dataBaseInfo
,
false
);
return
{
data
};
}
...
...
src/biz/fuHuqQi/user.ts
View file @
98323d9d
...
...
@@ -3,10 +3,12 @@
* 作者: 陈金晶
* 主要包括有 孵化器账号的登录
* 预留好 重置密码 退出登录 接口
* 密码规则:6-18位 只允许有数字和字符,可以只有数字也可以只有字母 不允许有特殊字符 2023年02月21日确定需求
*/
import
{
FuHuaQiUserConfig
}
from
"../../config/checkParamConfig"
;
import
{
ERRORENUM
}
from
"../../config/errorEnum"
;
import
{
FuHuaQiListConfig
}
from
"../../config/ojbectResultKey
Config"
;
import
*
as
splitResultConfig
from
"../../config/splitResult
Config"
;
import
*
as
fuhuaqiData
from
"../../data/fuHuaQi/fuhuaqi"
import
{
BizError
}
from
"../../util/bizError"
;
import
*
as
sysTools
from
"../../tools/system"
;
...
...
@@ -55,10 +57,13 @@ export async function login(uscc:string, pwd:string) {
* @returns
*/
export
async
function
firstLoginChangePwd
(
uscc
:
string
,
pwd
:
string
,
confirmPwd
:
string
)
{
if
(
pwd
!=
confirmPwd
)
throw
new
BizError
(
ERRORENUM
.
密码不一致
);
if
(
pwd
.
search
(
/^
[
A-Za-z0-9
]{6,18}
$/
)
<
0
)
throw
new
BizError
(
ERRORENUM
.
密码只能由
6
至
18
位字符和数字组成
);
let
dataBaseInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
if
(
dataBaseInfo
.
firstLoginIsChangePwd
)
throw
new
BizError
(
ERRORENUM
.
不能重复修改密码
,
`重复调用了首次登录之后的修改密码接口
${
uscc
}
`
);
//todo 校验密码
dataBaseInfo
.
pwd
=
sysTools
.
getPwdMd5
(
uscc
,
pwd
);
dataBaseInfo
.
pwd
=
sysTools
.
getPwdMd5
(
uscc
,
sysTools
.
md5PwdStr
(
pwd
)
);
dataBaseInfo
.
firstLoginIsChangePwd
=
true
;
await
dataBaseInfo
.
save
();
...
...
@@ -124,13 +129,11 @@ export async function logout(uscc:string){
selectParam
.
operationName
=
{
"$regex"
:
`
${
operationName
}
`
};;
}
let
enterpriseMap
=
await
fuhuaqiData
.
groupFindFuHuaQi
();
let
dataBaseList
=
await
fuhuaqiData
.
findFuHuaQiUserList
(
selectParam
,
(
page
-
1
)
*
10
);
let
count
=
await
fuhuaqiData
.
findFuHuaQiUserCount
(
selectParam
);
let
dataList
=
[];
dataBaseList
.
forEach
(
info
=>
{
let
changeData
=
extractData
(
FuHuaQiListConfig
,
info
,
true
);
const
Count
=
enterpriseMap
[
info
.
uscc
]
||
0
;
let
changeData
=
extractData
(
splitResultConfig
.
FuHuaQiListConfig
,
info
,
true
);
dataList
.
push
(
changeData
);
});
...
...
src/config/errorEnum.ts
View file @
98323d9d
...
...
@@ -20,7 +20,9 @@ export enum ERRORENUM {
已入库的数据不能删除
,
任务不存在
,
该企业不存在
,
该孵化器账号信息已存在
该孵化器账号信息已存在
,
密码不一致
,
密码只能由
6
至
18
位字符和数字组成
,
}
export
enum
ERRORCODEENUM
{
...
...
src/config/
ojbectResultKey
Config.ts
→
src/config/
splitResult
Config.ts
View file @
98323d9d
/**
* 返回配置
* 拆分返回结果配置
* 使用场景:逻辑层中需要返回数据给客户端的地方
* 限制:使用端不同不能共用一份配置
*/
/**
* 孵化器基础数据列表 参数转换配置
* 使用端: 管理后台
* 场景: 孵化器基础数据列表
* 备注: 导出和列表共用一份配置
*/
export
const
FuHuaQiBaseListConfig
=
{
name
:{
key
:
"名称"
},
...
...
@@ -29,8 +33,11 @@ export const FuHuaQiBaseListConfig = {
foundingTeamType
:{
key
:
"创业团队类型"
}
};
/**
* 企业信息 参数转换配置
* 使用端: 小程序端【孵化器入口】
* 场景: 新增或迁入企业信息
* 备注: 回显
*/
export
const
EnterpriseInfoConfig
=
{
name
:{
key
:
"企业名称"
},
//
...
...
@@ -49,7 +56,9 @@ export const EnterpriseInfoConfig = {
/**
* 企业融资信息 参数转换配置
* 使用端: 小程序端【孵化器入口】
* 场景: 企业融资信息
* 备注: 回显
*/
export
const
EnterpriseFinancingInfoConfig
=
{
uscc
:{
key
:
"统一信用代码"
},
//
...
...
@@ -65,10 +74,13 @@ export const EnterpriseFinancingInfoConfig = {
financingRounds
:{
key
:
"融资轮次"
}
};
/**
* 在孵企业列表 参数转换配置
* 使用端: 管理后台
* 场景: 在孵企业列表
* 备注: 导出和列表共用一份配置
*/
export
const
EnterpriseListConfig
=
{
export
const
EnterpriseListConfig
=
{
name
:{
key
:
"企业 名称"
},
createTime
:{
key
:
"入库时间 不可修改"
,
changeDate
:
true
},
fuhuaqiUscc
:{
key
:
"孵化器统一信用代码 不可修改 这里显示运营机构的名称"
},
...
...
@@ -86,8 +98,11 @@ export const EnterpriseFinancingInfoConfig = {
mainBusiness
:{
key
:
"主营业务"
},
//主营业务
};
/**
* 企业融资信息 参数转换配置
* 使用端: 管理后台
* 场景: 企业融资信息列表
* 备注: 导出和列表共用一份配置
*/
export
const
FinancingListConfig
=
{
uscc
:{
key
:
"企业统一信用代码"
},
...
...
@@ -106,8 +121,11 @@ export const FinancingListConfig = {
financingRounds
:{
key
:
"融资轮次"
}
}
/**
* 孵化器账号 参数转换配置
* 使用端: 管理后台
* 场景: 账号信息列表
* 备注:
*/
export
const
FuHuaQiListConfig
=
{
operationName
:{
key
:
"运营机构名称 不可修改"
},
...
...
@@ -120,7 +138,9 @@ export const FuHuaQiListConfig = {
/**
* 孵化器月度报表 参数转换配置
* 使用端: 小程序端【孵化器入口】
* 场景: 孵化器月度报表
* 备注: 回显
*/
export
const
MonthConfig
=
{
name
:{
key
:
"任务名称"
},
...
...
@@ -129,7 +149,9 @@ export const MonthConfig = {
/**
* 小程序首页的孵化器基础数据配置
* 使用端: 小程序端【孵化器入口】
* 场景: 主界面基础数据
* 备注:
*/
export
const
FuHuaQiHomeDataConfig
=
{
incubatedAcreage
:{
key
:
"在孵面积"
},
...
...
@@ -142,7 +164,9 @@ export const FuHuaQiHomeDataConfig = {
/**
* 小程序孵化器详细数据
* 使用端: 小程序端【孵化器入口】
* 场景: 孵化器详细数据
* 备注: 回显
*/
export
const
FuHuaQiBaseDataConfig
=
{
virtualEnterpriseNum
:{
key
:
"虚拟企业数量"
},
...
...
@@ -154,7 +178,9 @@ export const FuHuaQiBaseDataConfig = {
/**
* 机构信息
* 使用端: 小程序端【孵化器入口】
* 场景: 机构信息数据
* 备注: 回显
*/
export
const
OrganizationBaseDataConfig
=
{
name
:{
key
:
"名称"
},
...
...
src/tools/dataInit.ts
View file @
98323d9d
...
...
@@ -8,6 +8,7 @@ import { createFuHuaQiToList, findAllFuHuaQiOperationUsccMap, findFuHuaQiUserCou
import
{
getPwdMd5
,
getTaskId
}
from
"./system"
;
const
xlsx
=
require
(
'node-xlsx'
);
const
path
=
require
(
'path'
);
const
md5
=
require
(
"md5"
);
const
OldTypeChangeConfig
=
{
"文化创意"
:
INDUSTRY
.
文化创意
,
...
...
@@ -113,7 +114,7 @@ async function initFuHuaQiData() {
let
value
=
item
;
if
(
i
==
2
)
{
let
itemStr
=
`
${
item
}
`
;
addDataInfo
.
pwd
=
getPwdMd5
(
itemStr
,
itemStr
.
slice
(
itemStr
.
length
-
6
));
addDataInfo
.
pwd
=
getPwdMd5
(
itemStr
,
md5
(
itemStr
.
slice
(
itemStr
.
length
-
6
)
));
}
if
(
i
==
3
)
{
value
=
FUHUAQILV
[
item
]
||
0
;
...
...
src/tools/system.ts
View file @
98323d9d
...
...
@@ -48,6 +48,15 @@ export function getPwdMd5(uscc:string, pwd:string) {
/**
* md5加密
* @param pwd
* @returns pwd 加密后密码
*/
export
function
md5PwdStr
(
pwd
:
string
)
{
return
md5
(
pwd
);
}
/**
* 获取token
* @param uscc 统一信用代码
*/
...
...
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