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
04c1ecd5
Commit
04c1ecd5
authored
Mar 08, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2.0主要功能
parent
f413e134
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
638 additions
and
47 deletions
+638
-47
fuHuaQi.ts
src/biz/admin/fuHuaQi/fuHuaQi.ts
+3
-5
provide.ts
src/biz/admin/provide.ts
+6
-2
enterprise.ts
src/biz/mobileFuHuaQi/enterprise/enterprise.ts
+105
-1
score.ts
src/biz/mobileFuHuaQi/fuHuaQi/score.ts
+104
-0
task.ts
src/biz/mobileFuHuaQi/fuHuaQi/task.ts
+5
-7
user.ts
src/biz/mobileFuHuaQi/fuHuaQi/user.ts
+88
-6
eccFormParamConfig.ts
src/config/eccFormParamConfig.ts
+63
-2
errorEnum.ts
src/config/errorEnum.ts
+1
-0
scoreConfig.ts
src/config/scoreConfig.ts
+51
-0
splitResultConfig.ts
src/config/splitResultConfig.ts
+21
-3
enterprise.ts
src/data/enterprise/enterprise.ts
+11
-3
fuhuaqi.ts
src/data/fuHuaQi/fuhuaqi.ts
+19
-2
task.ts
src/data/fuHuaQi/task.ts
+17
-2
fuHuaQi.ts
src/routers/admin/fuHuaQi.ts
+9
-0
enterprise.ts
src/routers/mobileClient/enterprise.ts
+62
-5
fuHuaQi.ts
src/routers/mobileClient/fuHuaQi.ts
+5
-1
user.ts
src/routers/mobileClient/user.ts
+54
-3
system.ts
src/tools/system.ts
+14
-5
No files found.
src/biz/admin/fuHuaQi/fuHuaQi.ts
View file @
04c1ecd5
...
...
@@ -275,13 +275,11 @@ export async function addUser(param) {
let
addList
=
[];
//任务列表
let
monthList
=
[];
//月度填报列表
// const MonthNumber = moment().subtract(1, 'months').month() + 1;//数据填报月份
// const YearNumber =moment().subtract(1, 'months').year();
const
MonthNumber
=
1
;
//todo 数据填报月份 15号改回来
const
YearNumber
=
2023
const
MonthNumber
=
moment
().
subtract
(
1
,
'months'
).
month
()
+
1
;
//数据填报月份
const
YearNumber
=
moment
().
subtract
(
1
,
'months'
).
year
();
const
MonthTableName
=
`
${
MonthNumber
}
月孵化器月度填报`
;
const
TimeKey
=
"20232"
;
//todo 这里要用20232 15号 改回来
const
TimeKey
=
getTimeKey
();
let
fuHuaQiList
=
[{
uscc
:
param
.
uscc
}];
fuHuaQiList
.
forEach
(
info
=>
{
...
...
src/biz/admin/provide.ts
View file @
04c1ecd5
...
...
@@ -51,4 +51,9 @@ export async function provideLastTask() {
export
async
function
updateEnterpriseFuHuaState
()
{
await
enterpriseData
.
updateEnterpriseState
(
FUHUASTATE
.
实体孵化
);
return
{};
}
\ No newline at end of file
}
export
async
function
updateFuHuaQiTaskYear
()
{
await
taskData
.
updateTaskYearData
(
2023
);
return
{};
}
src/biz/mobileFuHuaQi/enterprise/enterprise.ts
View file @
04c1ecd5
...
...
@@ -220,7 +220,7 @@ export async function myEnterprise(uscc:string, state:number, name:string, page:
let
enterpriseList
=
[];
dataList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
splitResultConfig
.
m
yEnterpriseDataConfig
,
info
,
false
);
let
changeData
:
any
=
extractData
(
splitResultConfig
.
M
yEnterpriseDataConfig
,
info
,
false
);
changeData
.
state
=
verificationEnumTools
.
changeEnumValue
(
configEnum
.
FUHUASTATE
,
changeData
.
state
);
enterpriseList
.
push
(
changeData
);
});
...
...
@@ -307,4 +307,107 @@ export async function updateMoveOutInfo(fuHuaQiUscc:string, uscc:string, moveOu
await
enterpriseInfo
.
save
();
return
{
isUsccess
:
true
};
}
/**
* 企业基本信息 回显
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param uscc 企业统一信用代码
*/
export
async
function
getMyEnterpriseBaseInfo
(
fuHuaQiUscc
:
string
,
uscc
:
string
)
{
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
`我的企业 回显企业信息
${
uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
'企业基本信息回显'
,
`孵化器:
${
fuHuaQiUscc
}
企业:
${
uscc
}
`
);
let
changeData
=
extractData
(
splitResultConfig
.
MyEnterpriseBaseDataConfig
,
enterpriseInfo
,
false
);
return
{
enterpriseInfo
:
changeData
};
}
/**
* 修改我的企业基本信息
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param param 表单
*/
export
async
function
updateMyEnterpriseBaseInfo
(
fuHuaQiUscc
:
string
,
param
)
{
eccFormParam
(
"修改我的企业基本信息"
,
eccFormParamConfig
.
UpdateMyEnterpriseBaseDataConfig
,
param
);
verificationEnumTools
.
eccEnumValue
(
'修改新注册企业'
,
'industry'
,
configEnum
.
INDUSTRY
,
param
.
industry
);
if
(
!
sysTools
.
eccUscc
(
param
.
uscc
)
)
throw
new
BizError
(
ERRORENUM
.
统一社会信用代码不合法
);
const
Uscc
=
param
.
uscc
;
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
Uscc
);
if
(
!
enterpriseInfo
)
throw
new
BizError
(
ERRORENUM
.
该企业不存在
,
`我的企业 修改我的企业基本信息
${
Uscc
}
`
);
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
'修改我的企业基本信息'
,
`孵化器:
${
fuHuaQiUscc
}
企业:
${
Uscc
}
`
);
/**修改字段 */
let
changeList
=
checkChange
(
param
,
enterpriseInfo
);
if
(
!
changeList
.
length
)
throw
new
BizError
(
ERRORENUM
.
数据无更新
,
`
${
param
.
uscc
}
数据无更新`
);
changeList
.
forEach
(
key
=>
{
enterpriseInfo
[
key
]
=
param
[
key
];
});
await
enterpriseInfo
.
save
();
return
{
isSuccess
:
true
};
}
/**
* 补录新迁入企业信息
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param param 表单
*/
export
async
function
replenishMyEnterpriseInPutInfo
(
fuHuaQiUscc
:
string
,
param
)
{
eccFormParam
(
"补录新迁入企业信息"
,
eccFormParamConfig
.
ReplenishMyEnterpriseInPutDataConfig
,
param
);
verificationEnumTools
.
eccEnumValue
(
'补录新迁入企业信息'
,
'industry'
,
configEnum
.
INDUSTRY
,
param
.
industry
);
if
(
!
sysTools
.
eccUscc
(
param
.
uscc
)
)
throw
new
BizError
(
ERRORENUM
.
统一社会信用代码不合法
);
/**不能出现重复的统一社会信用代码 草稿的也不行 */
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
/**添加新注册企业标识 */
param
.
isCreate
=
false
;
//标识此次操作是否是迁入企业并不是新注册企业
param
.
state
=
configEnum
.
FUHUASTATE
.
实体孵化
;
await
enterpriseData
.
replenishData
(
fuHuaQiUscc
,
param
);
return
{
isSuccess
:
true
};
}
/**
* 补录新注册企业信息
* 小程序端 2.0
* @param fuHuaQiUscc 孵化器统一信用代码
* @param param 表单
*/
export
async
function
replenishMyEnterpriseCreateInfo
(
fuHuaQiUscc
:
string
,
param
)
{
eccFormParam
(
"补录新迁入企业信息"
,
eccFormParamConfig
.
ReplenishMyEnterpriseCreateDataConfig
,
param
);
verificationEnumTools
.
eccEnumValue
(
'补录新迁入企业信息'
,
'industry'
,
configEnum
.
INDUSTRY
,
param
.
industry
);
if
(
!
sysTools
.
eccUscc
(
param
.
uscc
)
)
throw
new
BizError
(
ERRORENUM
.
统一社会信用代码不合法
);
/**不能出现重复的统一社会信用代码 草稿的也不行 */
let
dataBaseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
param
.
uscc
);
if
(
dataBaseInfo
&&
dataBaseInfo
.
uscc
)
throw
new
BizError
(
ERRORENUM
.
该企业已存在
,
`
${
param
.
uscc
}
已经在库中存在`
);
/**添加新注册企业标识 */
param
.
isCreate
=
false
;
//标识此次操作是否是迁入企业并不是新注册企业
param
.
state
=
configEnum
.
FUHUASTATE
.
实体孵化
;
await
enterpriseData
.
replenishData
(
fuHuaQiUscc
,
param
);
return
{
isSuccess
:
true
};
}
\ No newline at end of file
src/biz/mobileFuHuaQi/fuHuaQi/score.ts
0 → 100644
View file @
04c1ecd5
/**
* 分数
*/
import
{
FuHuaQiMyDataScoreConfig
,
ScoreConfig
,
FuHuaQiBaseDataScoreConfig
,
EnterpriseScoreConfig
,
StarConfig
}
from
"../../../config/scoreConfig"
;
import
{
findEnterpriseList
}
from
"../../../data/enterprise/enterprise"
;
import
{
findFuHuaQiByUSCC
}
from
"../../../data/fuHuaQi/fuhuaqi"
;
import
{
findTaskListByParam
}
from
"../../../data/fuHuaQi/task"
;
/**
* 统计孵化器分数
* @param uscc 孵化器统一信用代码
*/
export
async
function
MyScore
(
uscc
:
string
)
{
let
fuHuaQiInfo
=
await
findFuHuaQiByUSCC
(
uscc
);
/** 初始分*/
let
startScore
=
fuHuaQiInfo
.
startScore
||
400
;
/**我的数据分 */
let
isValueCount
=
0
;
let
valueCount
=
Object
.
keys
(
FuHuaQiMyDataScoreConfig
).
length
;
for
(
let
key
in
FuHuaQiMyDataScoreConfig
)
{
let
type
=
FuHuaQiMyDataScoreConfig
[
key
];
if
(
type
==
'[Object]'
||
type
==
'[Number]'
)
{
if
(
fuHuaQiInfo
[
key
]
&&
fuHuaQiInfo
[
key
].
length
)
isValueCount
+=
1
;
}
else
if
(
fuHuaQiInfo
[
key
])
isValueCount
+=
1
;
}
let
myDataScore
=
ScoreConfig
[
"我的数据"
]
*
(
isValueCount
/
valueCount
);
/**基础数据分 */
isValueCount
=
0
;
valueCount
=
Object
.
keys
(
FuHuaQiBaseDataScoreConfig
).
length
;
for
(
let
key
in
FuHuaQiBaseDataScoreConfig
)
{
let
type
=
FuHuaQiBaseDataScoreConfig
[
key
];
if
(
type
==
'[Object]'
||
type
==
'[Number]'
)
{
if
(
fuHuaQiInfo
[
key
]
&&
fuHuaQiInfo
[
key
].
length
)
isValueCount
+=
1
;
}
else
if
(
fuHuaQiInfo
[
key
])
isValueCount
+=
1
;
}
let
baseDataScore
=
ScoreConfig
[
"孵化器基础数据"
]
*
(
isValueCount
/
valueCount
);
/**我的企业数据分 */
let
enterpriseList
=
await
findEnterpriseList
({
fuHuaQiUscc
:
uscc
,
draftLock
:
true
});
isValueCount
=
0
;
valueCount
=
0
;
enterpriseList
.
forEach
(
info
=>
{
for
(
let
key
in
EnterpriseScoreConfig
)
{
let
type
=
EnterpriseScoreConfig
[
key
];
if
(
type
==
'[Object]'
||
type
==
'[Number]'
)
{
if
(
fuHuaQiInfo
[
key
]
&&
fuHuaQiInfo
[
key
].
length
)
isValueCount
+=
1
;
}
else
if
(
type
==
'Boolean'
)
{
isValueCount
+=
1
;
}
else
if
(
fuHuaQiInfo
[
key
])
isValueCount
+=
1
;
}
valueCount
+=
Object
.
keys
(
EnterpriseScoreConfig
).
length
;
});
let
enterpriseDataScore
=
ScoreConfig
[
"企业基础数据"
]
*
(
isValueCount
/
valueCount
);
/**算任务的分 */
let
taskScore
=
0
;
let
taskList
=
await
findTaskListByParam
({
fuHuaQiUscc
:
uscc
});
ScoreConfig
[
"任务分数"
]
taskList
.
forEach
(
info
=>
{
// if (isSubmit)
});
let
newScore
=
startScore
+
myDataScore
+
baseDataScore
+
enterpriseDataScore
+
taskScore
;
let
oldScore
=
fuHuaQiInfo
.
socre
;
/**根据分数算星星 */
let
oldStar
=
starCount
(
oldScore
);
let
newStar
=
starCount
(
newScore
);
let
starUp
=
newStar
>
oldStar
;
fuHuaQiInfo
.
socre
=
newScore
;
await
fuHuaQiInfo
.
save
();
return
{
scoreInfo
:{
star
:
newStar
,
starUp
,
score
:
newScore
-
oldScore
}}
;
}
function
count
(
config
:
object
,
scoreCount
:
number
,
data
)
{
let
isValueCount
=
0
;
for
(
let
key
in
config
)
{
let
type
=
config
[
key
];
}
}
function
starCount
(
socre
:
number
)
{
let
star
=
1
;
for
(
let
i
=
0
;
i
<
StarConfig
.
length
;
i
++
)
{
let
{
name
,
value
,
starNum
}
=
StarConfig
[
i
];
if
(
socre
<=
value
)
{
star
=
starNum
;
break
;
}
}
return
star
;
}
export
async
function
updateScore
()
{
}
\ No newline at end of file
src/biz/mobileFuHuaQi/fuHuaQi/task.ts
View file @
04c1ecd5
...
...
@@ -22,7 +22,7 @@ import * as monthTableData from "../../../data/fuHuaQi/monthTable";
import
*
as
taskData
from
"../../../data/fuHuaQi/task"
;
import
{
BizError
}
from
"../../../util/bizError"
;
import
{
logHandle
}
from
"../../../util/log"
;
import
{
get
LastTimeKey
,
get
TaskId
,
getTaskIdByTime
,
getTimeKey
}
from
"../../../tools/system"
;
import
{
getTaskId
,
getTaskIdByTime
,
getTimeKey
}
from
"../../../tools/system"
;
/**
...
...
@@ -33,9 +33,7 @@ import { getLastTimeKey, getTaskId, getTaskIdByTime, getTimeKey } from "../../..
*/
export
async
function
fuHuaQiTaskList
(
uscc
:
string
)
{
/**得到这个月的任务map taskMap格式为{type:{isSubmit}} */
// const TaskId = getTaskId(uscc);
//todo 测试代码 15日把注释放开把下面的代码删了
const
TaskId
=
`
${
uscc
}${
20232
}
`
;
const
TaskId
=
getTaskId
(
uscc
);
let
taskMap
=
await
taskData
.
findFuHuaQiTaskByTaskId
(
TaskId
);
...
...
@@ -49,14 +47,14 @@ export async function fuHuaQiTaskList(uscc:string) {
let
onceObj
=
{
key
:
ValueNumber
,
title
:
anyKey
,
//标题
month
:
taskMap
[
ValueStr
].
month
+
'月
'
,
month
:
'
'
,
enterpriseList
:[]
//相关的列表 这里不应该用这个字段名称 当时不能修改前端 沿用了这个字段名称
};
/**没有提交任务 则获取本月提交的任务相关信息 */
if
(
!
taskMap
[
ValueStr
].
isSubmit
)
{
if
(
taskMap
[
ValueStr
]
&&
!
taskMap
[
ValueStr
].
isSubmit
)
{
let
dataList
=
[];
onceObj
.
month
=
taskMap
[
ValueStr
].
month
+
'月'
switch
(
ValueNumber
)
{
case
TASKTYPEENUM
.
孵化器月度填报
:
/** 这里加限制 在月度任务中 isUpdate=true代表已经修改 isUpdate=false表示没有这个任务 详细说明看./month.ts注释*/
...
...
src/biz/mobileFuHuaQi/fuHuaQi/user.ts
View file @
04c1ecd5
...
...
@@ -62,7 +62,7 @@ export async function firstLoginChangePwd(uscc:string, pwd:string, confirmPwd:st
let
dataBaseInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
if
(
dataBaseInfo
.
firstLoginIsChangePwd
)
throw
new
BizError
(
ERRORENUM
.
不能重复修改密码
,
`重复调用了首次登录之后的修改密码接口
${
uscc
}
`
);
//todo 校验密码
dataBaseInfo
.
pwd
=
sysTools
.
getPwdMd5
(
uscc
,
sysTools
.
md5PwdStr
(
pwd
));
dataBaseInfo
.
firstLoginIsChangePwd
=
true
;
await
dataBaseInfo
.
save
();
...
...
@@ -120,19 +120,100 @@ export async function logout(uscc:string){
}
/**
* 绑定账号
* 小程序端 2.0
* 说明: 一个账号只能被一个群体绑定 例如:A账号被B绑定着,今天被C绑定了,
* @param uscc 发起账号的统一信用代码
* @param bindUscc 被绑定账号统一信用代码
* @param bindPwd 被绑定账号密码
* @param deviceId 绑定时的设备号id
*/
export
async
function
bindFuHuaQi
(
uscc
:
string
,
bindUscc
:
string
,
bindPwd
:
string
,
deviceId
:
string
)
{
/**校验被绑定账号存不存在 */
let
bindFuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
bindUscc
);
if
(
!
bindFuhuaqiInfo
)
throw
new
BizError
(
ERRORENUM
.
账号不存在
,
`绑定账号时 =
${
bindUscc
}
=`
);
export
async
function
bindFuHuaQi
(
uscc
:
string
,
bindUscc
:
string
,
bindPwd
:
string
)
{
/**校验被绑定账号密码是否正确 */
let
checkBindPwd
=
sysTools
.
getPwdMd5
(
bindFuhuaqiInfo
.
uscc
,
bindPwd
);
if
(
bindFuhuaqiInfo
.
pwd
!=
checkBindPwd
)
throw
new
BizError
(
ERRORENUM
.
密码错误
);
/**发起账号信息 */
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
// if ( !fuhuaqiInfo ) throw new BizError(ERRORENUM.);
/**如果操作账号从来没有绑定行为 则生成一个绑定id 否则沿用*/
const
BindId
=
!
fuhuaqiInfo
.
bindId
?
sysTools
.
getBindId
(
uscc
,
bindUscc
)
:
fuhuaqiInfo
.
bindId
;
bindFuhuaqiInfo
.
bindId
=
BindId
;
bindFuhuaqiInfo
.
bindDeviceId
=
deviceId
;
await
bindFuhuaqiInfo
.
save
();
/**直接覆盖发起账号的设备信息 */
fuhuaqiInfo
.
bindDeviceId
=
deviceId
;
fuhuaqiInfo
.
bindId
=
BindId
;
await
fuhuaqiInfo
.
save
();
return
{
isSuccess
:
true
};
}
/**
*
切换
账号列表
*
已绑定
账号列表
* 小程序端 2.0
* @param uscc
* @param uscc 孵化器统一信用代码
* @param deviceId 当前设备号id
*/
export
async
function
changeUserList
(
uscc
:
string
)
{
export
async
function
bindUserList
(
uscc
:
string
,
deviceId
:
string
)
{
/**发起账号信息 */
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
/**找绑定关系 */
let
bindList
=
[];
if
(
fuhuaqiInfo
.
bindId
&&
fuhuaqiInfo
.
bindDeviceId
&&
deviceId
==
fuhuaqiInfo
.
bindDeviceId
)
{
let
checkList
=
await
fuhuaqiData
.
findFuHuaQiList
({
bindId
:
fuhuaqiInfo
.
bindId
,
deviceId
:
deviceId
});
checkList
.
forEach
(
info
=>
{
let
currentAccount
=
info
.
uscc
==
fuhuaqiInfo
.
uscc
;
bindList
.
push
({
uscc
:
info
.
uscc
,
currentAccount
,
personInChargePhone
:
info
.
personInChargePhone
,
operationName
:
info
.
operationName
});
});
}
return
{
bindList
}
}
/**
* 切换账号
* @param uscc 发起账号统一信用代码
* @param targetUscc 目标账号统一信用代码
*/
export
async
function
changeUser
(
uscc
:
string
,
targetUscc
:
string
)
{
/**发起账号信息 */
let
fuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
/**目标账号信息 */
let
targetFuhuaqiInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
targetUscc
);
if
(
!
targetFuhuaqiInfo
)
throw
new
BizError
(
ERRORENUM
.
账号不存在
,
`切换账号时=
${
targetUscc
}
=`
);
if
(
fuhuaqiInfo
.
bindId
!=
targetFuhuaqiInfo
.
bindId
||
targetFuhuaqiInfo
.
bindDeviceId
!=
fuhuaqiInfo
.
bindDeviceId
)
{
throw
new
BizError
(
ERRORENUM
.
账号非绑定关系
,
`发起账号:
${
uscc
}
目标账号:
${
targetUscc
}
`
);
}
const
Token
=
sysTools
.
getToken
(
uscc
+
targetUscc
);
targetFuhuaqiInfo
.
token
=
Token
;
targetFuhuaqiInfo
.
tokenMs
=
new
Date
().
valueOf
();
await
targetFuhuaqiInfo
.
save
();
return
{
uscc
:
targetFuhuaqiInfo
.
uscc
,
firstLogin
:
!
targetFuhuaqiInfo
.
firstLoginIsChangePwd
,
token
:
Token
};
}
\ No newline at end of file
src/config/eccFormParamConfig.ts
View file @
04c1ecd5
...
...
@@ -189,6 +189,8 @@ export const FinancingParamUpdateConfig = {
fuHuaQiInvestmentStyle
:{
type
:
"Number"
,
notMustHave
:
true
},
//孵化器投资方式
financingRounds
:{
type
:
"Number"
},
//融资轮次
};
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 创建融资企业登记选择了孵化器投资
...
...
@@ -199,6 +201,7 @@ export const FinancingParamSubConfig = {
fuHuaQiInvestmentStyle
:{
type
:
"Number"
}
}
/**
* 使用端: 管理后台
* 场景: 新增孵化器账号
...
...
@@ -209,4 +212,63 @@ export const FuHuaQiUserConfig = {
uscc
:{
type
:
"String"
},
//营业执照
personInChargePhone
:{
type
:
"String"
},
//负责人手机号
personInCharge
:{
type
:
"String"
}
//负责人
}
\ No newline at end of file
}
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 修改我的企业列表里的 我的企业信息
* 备注: 所有参数为必填
*/
export
const
UpdateMyEnterpriseBaseDataConfig
=
{
name
:{
type
:
"String"
},
//企业名称
uscc
:{
type
:
"String"
},
//统一信用代码
industry
:{
type
:
"[Number]"
},
//领域
mainBusiness
:{
type
:
"String"
},
//主营业务
logonTime
:{
type
:
"Number"
},
//注册时间
firstIncubationTime
:{
type
:
"Number"
},
//首次入孵时间
isNaturalPersonHolding
:{
type
:
"Boolean"
},
//是否自然人控股企业
logonAdd
:{
type
:
"String"
},
//注册地址
operatingAdd
:{
type
:
"String"
},
//经营地址
}
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 我的企业列表里的 补录 迁入企业
* 备注: 所有参数为必填
*/
export
const
ReplenishMyEnterpriseInPutDataConfig
=
{
name
:{
type
:
"String"
},
//企业名称
uscc
:{
type
:
"String"
},
//统一信用代码
industry
:{
type
:
"[Number]"
},
//领域
mainBusiness
:{
type
:
"String"
},
//主营业务
logonTime
:{
type
:
"Number"
},
//注册时间
firstIncubationTime
:{
type
:
"Number"
},
//首次入孵时间
isNaturalPersonHolding
:{
type
:
"Boolean"
},
//是否自然人控股企业
logonAdd
:{
type
:
"String"
},
//注册地址
operatingAdd
:{
type
:
"String"
},
//经营地址
leasedArea
:{
type
:
"Number"
},
//租赁面积(平方米)
timeOfImmigration
:{
type
:
"Number"
},
//迁入时间
oldLogonAdd
:{
type
:
"String"
},
//迁入前注册地址
}
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 我的企业列表里的 补录 新注册企业
* 备注: 所有参数为必填
*/
export
const
ReplenishMyEnterpriseCreateDataConfig
=
{
name
:{
type
:
"String"
},
//企业名称
uscc
:{
type
:
"String"
},
//统一信用代码
industry
:{
type
:
"[Number]"
},
//领域
mainBusiness
:{
type
:
"String"
},
//主营业务
logonTime
:{
type
:
"Number"
},
//注册时间
firstIncubationTime
:{
type
:
"Number"
},
//首次入孵时间
isNaturalPersonHolding
:{
type
:
"Boolean"
},
//是否自然人控股企业
logonAdd
:{
type
:
"String"
},
//注册地址
operatingAdd
:{
type
:
"String"
},
//经营地址
leasedArea
:{
type
:
"Number"
},
//租赁面积(平方米)
}
src/config/errorEnum.ts
View file @
04c1ecd5
...
...
@@ -29,6 +29,7 @@ export enum ERRORENUM {
该任务已提交
,
无法操作其他孵化器的企业
,
请填入其他原因
,
账号非绑定关系
}
export
enum
ERRORCODEENUM
{
...
...
src/config/scoreConfig.ts
0 → 100644
View file @
04c1ecd5
export
const
ScoreConfig
=
{
"我的数据"
:
25
,
"孵化器基础数据"
:
25
,
"企业基础数据"
:
50
,
"任务分数"
:
10
,
}
export
const
StarConfig
=
[
{
name
:
"一星"
,
starNum
:
1
,
value
:
100
},
{
name
:
"二星"
,
starNum
:
2
,
value
:
300
},
{
name
:
"三星"
,
starNum
:
3
,
value
:
500
},
{
name
:
"四星"
,
starNum
:
4
,
value
:
600
},
{
name
:
"五星"
,
starNum
:
5
,
value
:
700
}
]
export
const
FuHuaQiMyDataScoreConfig
=
{
incubatedAcreage
:
"Number"
,
//在孵面积(㎡)
acreageTotal
:
"Number"
,
//孵化器总面积(㎡)
acreagePersonalUse
:
"Number"
,
//孵化器自用面积(㎡)
hatchingGround
:
"[Object]"
,
//经备案场地
};
export
const
FuHuaQiBaseDataScoreConfig
=
{
name
:{
type
:
"String"
},
// {key:"名称"},
logonTime
:{
type
:
"Number"
},
// {key:"注册时间", changeDate:true},
lv
:{
type
:
"Number"
},
// {key:"孵化器级别"},
identificationTime
:{
type
:
"Number"
},
// {key:"认定时间", changeDate:true},
industry
:{
type
:
"[Number]"
},
// {key:"孵化领域"},
institutionalNature
:{
type
:
"Number"
},
// {key:"机构性质"},
operationModel
:{
type
:
"[Number]"
},
// {key:"运营模式"},//新加
foundingTeam
:{
type
:
"[Object]"
},
// {key:"创始团队"},//新加
liaison
:{
type
:
"String"
},
// {key:"联系人"},
liaisonPhone
:{
type
:
"String"
},
// {key:"联系电话"},
personInCharge
:{
type
:
"String"
},
// {key:"负责人"},
personInChargePhone
:{
type
:
"String"
},
// {key:"负责人联系电话"},
}
export
const
EnterpriseScoreConfig
=
{
name
:
"String"
,
//企业名称
industry
:
"[Number]"
,
//领域
mainBusiness
:
"String"
,
//主营业务
logonTime
:
"Number"
,
//注册时间
firstIncubationTime
:
"Number"
,
//首次入孵时间
isNaturalPersonHolding
:
"Boolean"
,
//是否自然人控股企业
logonAdd
:
"String"
,
//注册地址
operatingAdd
:
"String"
,
//经营地址
}
\ No newline at end of file
src/config/splitResultConfig.ts
View file @
04c1ecd5
...
...
@@ -230,9 +230,28 @@ export const OrganizationBaseDataConfig = {
* 场景: 我的企业列表
* 备注:
*/
export
const
m
yEnterpriseDataConfig
=
{
export
const
M
yEnterpriseDataConfig
=
{
name
:{
key
:
"名称"
},
uscc
:{
key
:
"统一信用代码"
},
state
:{
key
:
"孵化器状态"
},
leasedArea
:{
key
:
"租赁面积"
}
}
\ No newline at end of file
}
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 我的企业列表中的企业详情
* 备注: 回显
*/
export
const
MyEnterpriseBaseDataConfig
=
{
name
:
{
key
:
"企业名称"
},
//
uscc
:{
key
:
"统一信用代码"
},
//
industry
:{
key
:
"领域"
},
//
mainBusiness
:{
key
:
"主营业务"
},
//
logonTime
:{
key
:
"注册时间"
},
//
firstIncubationTime
:{
key
:
"首次入孵时间"
},
//
isNaturalPersonHolding
:{
key
:
"是否自然人控股企业"
},
//
logonAdd
:{
key
:
"注册地址"
},
//
operatingAdd
:{
key
:
"经营地址"
},
//
}
src/data/enterprise/enterprise.ts
View file @
04c1ecd5
...
...
@@ -5,6 +5,7 @@
import
{
Schema
}
from
'mongoose'
;
import
{
baseDB
}
from
'../../db/mongo/dbInit'
;
import
{
FUHUASTATE
}
from
'../../config/enum'
;
const
enterpriseSchema
=
new
Schema
({
name
:
{
type
:
String
,
index
:
true
},
//企业名称
...
...
@@ -22,12 +23,12 @@ const enterpriseSchema = new Schema({
isCreate
:{
type
:
Boolean
,
default
:
false
},
//是否新建
// isPhysicalPresence:{type:Boolean, default:true},//是否实地孵化 暂时弃用
leasedArea
:
Number
,
//租赁面积(平方米)
draftLock
:{
type
:
Boolean
,
default
:
false
},
//草稿锁,true为提交之后,false为草稿
mainBusiness
:{
type
:
String
,
default
:
""
},
//主营业务
createTime
:
Number
,
//录入时间
draftLock
:{
type
:
Boolean
,
default
:
false
},
//草稿锁,true为提交之后,false为草稿
enterpriseIsInPut
:{
type
:
Boolean
,
default
:
false
},
//是否是初始数据 todo 后续要弃用 兼容原始数据无法判断是否是迁入企业这个问题加的字段
draftId
:{
type
:
String
,
index
:
true
},
//草稿id 编辑的时候使用这个id 保存之后就不认这个id了
mainBusiness
:{
type
:
String
,
default
:
""
},
//主营业务
state
:
Number
,
//孵化状态 遵循枚举 FUHUASTATE 值 ----2.0
state
:{
type
:
Number
,
default
:
FUHUASTATE
.
实体孵化
},
//孵化状态 遵循枚举 FUHUASTATE 值 默认实体孵化 ----2.0
virtualCause
:[
Number
],
//虚拟孵化原因 遵循 VIRTUALCAUSE 的值 ----2.0
virtualCauseDes
:
String
,
//虚拟孵化描述 ----2.0
moveOutType
:
Number
,
// 迁出类型 遵循 MOVEOUTTYPE 的值 ----2.0
...
...
@@ -230,3 +231,9 @@ export async function createEnterpriseToList(fuHuaQiList:object) {
export
async
function
updateEnterpriseState
(
state
:
number
)
{
return
await
enterpriseModel
.
updateMany
({},
{
$set
:{
state
}});
}
export
async
function
replenishData
(
fuHuaQiUscc
:
string
,
param
)
{
let
addInfo
=
Object
.
assign
({
fuHuaQiUscc
,
createTime
:
new
Date
().
valueOf
()},
param
);
await
enterpriseModel
.
create
(
addInfo
);
}
\ No newline at end of file
src/data/fuHuaQi/fuhuaqi.ts
View file @
04c1ecd5
...
...
@@ -48,14 +48,20 @@ const fuHuaQiSchema = new Schema({
foundingTeamType
:{
type
:
Number
,
default
:
1
},
//创业团队类型
operationModel
:{
type
:[
Number
],
default
:[]},
//运营模式
operationModelDes
:
String
,
//运营模式描述
/**
登录
相关 */
/**
用户
相关 */
pwd
:
String
,
//登录密码
token
:{
type
:
String
,
index
:
true
},
tokenMs
:
Number
,
firstLoginIsChangePwd
:{
type
:
Boolean
,
default
:
false
},
//首次登录是否修改密码
createTime
:
Number
,
userState
:{
type
:
Boolean
,
default
:
false
},
//是否禁用
bindId
:{
type
:
String
}
//绑定标识
/**绑定账号相关 */
bindDeviceId
:
String
,
//绑定时的设备号
bindId
:{
type
:
String
},
//绑定标识
/**分数相关 */
score
:
Number
,
//分数
startScore
:
Number
,
//初始分 400 创建孵化器的时候要在这里加上
lastYearStar
:
Number
,
//去年星值 这里默认是3星 每年12月31日12时,需要根据分算星然后更新到这里
});
var
fuHuaQiModel
;
...
...
@@ -226,4 +232,14 @@ export async function createFuHuaQiUser(param) {
export
async
function
createFuHuaQiToList
(
fuHuaQiList
:
object
)
{
await
fuHuaQiModel
.
insertMany
(
fuHuaQiList
);
}
/**
* 根据绑定id查找孵化器列表
* @param bindId 绑定id
* @returns {}
*/
export
async
function
findFuHuaQiByBindId
(
bindId
:
string
)
{
return
await
fuHuaQiModel
.
find
({
bindId
});
}
\ No newline at end of file
src/data/fuHuaQi/task.ts
View file @
04c1ecd5
...
...
@@ -19,6 +19,7 @@ const fuHuaQiTaskSchema = new Schema({
// relevanceId:String,//任务关联的表 financing 或 enterprise 的id 弃用
isSubmit
:
Boolean
,
//是否提交
month
:
Number
,
//数据填报月
year
:
Number
,
//数据填报年 2.0算分的时候加入的
});
var
fuHuaQiTaskModel
;
...
...
@@ -86,4 +87,19 @@ export async function findTaskListByType(param) {
map
[
info
.
taskId
]
=
info
.
isSubmit
});
return
map
;
}
\ No newline at end of file
}
export
async
function
findTaskListByParam
(
param
)
{
let
taskList
=
await
fuHuaQiTaskModel
.
find
(
param
);
return
taskList
;
}
/**
* 将所有数据的年份加上 2023
* 2.0上线后去掉
* @param state 孵化状态
*/
export
async
function
updateTaskYearData
(
year
:
number
)
{
return
await
fuHuaQiTaskModel
.
updateMany
({},
{
$set
:{
year
}});
}
src/routers/admin/fuHuaQi.ts
View file @
04c1ecd5
...
...
@@ -23,8 +23,17 @@ export function setRouter(httpServer) {
/**测试接口 用于发放1月份任务 */
httpServer
.
post
(
'/admin/provide/task/add12'
,
checkInterior
,
asyncHandler
(
provideLastTask
));
httpServer
.
post
(
'/admin/provide/enterprise/updatestate'
,
checkInterior
,
asyncHandler
(
updateEnterpriseState
));
httpServer
.
post
(
'/admin/provide/task/updatetaskyear'
,
checkInterior
,
asyncHandler
(
updateTaskYear
));
}
async
function
updateTaskYear
(
req
,
res
)
{
let
data
=
await
provideBiz
.
updateEnterpriseFuHuaState
();
res
.
success
({
isUsccess
:
true
});
}
async
function
updateEnterpriseState
(
req
,
res
)
{
let
data
=
await
provideBiz
.
updateEnterpriseFuHuaState
();
res
.
success
({
isUsccess
:
true
});
...
...
src/routers/mobileClient/enterprise.ts
View file @
04c1ecd5
...
...
@@ -18,12 +18,17 @@ export function setRouter(httpServer) {
httpServer
.
post
(
'/fuhuaqi/enterprise/delete'
,
checkFuHuaQiToken
,
asyncHandler
(
delEnterpriseInfo
));
/**我的企业 */
httpServer
.
post
(
'/fuhuaqi/myenterprise/list'
,
checkFuHuaQiToken
,
asyncHandler
(
myEnterpriseList
));
httpServer
.
post
(
'/fuhuaqi/myenterprise/info'
,
checkFuHuaQiToken
,
asyncHandler
(
myEnterpriseInfo
));
httpServer
.
post
(
'/fuhuaqi/myenterprise/moveoutlist'
,
checkFuHuaQiToken
,
asyncHandler
(
myEnterpriseMoveOutList
));
httpServer
.
post
(
'/fuhuaqi/myenterprise/info'
,
checkFuHuaQiToken
,
asyncHandler
(
myEnterpriseInfo
));
httpServer
.
post
(
'/fuhuaqi/myenterprise/update'
,
checkFuHuaQiToken
,
asyncHandler
(
updateMyEnterpriseInfo
));
httpServer
.
post
(
'/fuhuaqi/myenterprise/replenish/create'
,
checkFuHuaQiToken
,
asyncHandler
(
replenishCreate
));
httpServer
.
post
(
'/fuhuaqi/myenterprise/replenish/input'
,
checkFuHuaQiToken
,
asyncHandler
(
replenishInPut
));
/**我的企业 修改 */
httpServer
.
post
(
'/fuhuaqi/myenterprise/update/physical'
,
checkFuHuaQiToken
,
asyncHandler
(
updatePhysical
));
//todo 实体
httpServer
.
post
(
'/fuhuaqi/myenterprise/update/virtual'
,
checkFuHuaQiToken
,
asyncHandler
(
updateVirtual
));
//todo 虚拟
httpServer
.
post
(
'/fuhuaqi/myenterprise/update/moveout'
,
checkFuHuaQiToken
,
asyncHandler
(
updateMoveOut
));
//todo 迁出
httpServer
.
post
(
'/fuhuaqi/myenterprise/update/physical'
,
checkFuHuaQiToken
,
asyncHandler
(
updatePhysical
));
httpServer
.
post
(
'/fuhuaqi/myenterprise/update/virtual'
,
checkFuHuaQiToken
,
asyncHandler
(
updateVirtual
));
httpServer
.
post
(
'/fuhuaqi/myenterprise/update/moveout'
,
checkFuHuaQiToken
,
asyncHandler
(
updateMoveOut
));
/**我的企业信息 回显 */
// httpServer.post('/fuhuaqi/myenterprise//moveout', checkFuHuaQiToken, asyncHandler(updateMoveOut));
}
...
...
@@ -158,7 +163,8 @@ async function myEnterpriseMoveOutList(req, res) {
/**
* 企业基本信息
* 我的企业列表中点击查看按钮
* 我的企业列表中的企业基本信息
* 回显
* 2.0
* @param req
* @param res
...
...
@@ -167,6 +173,8 @@ async function myEnterpriseInfo(req, res) {
let
reqConf
=
{
uscc
:
'String'
};
let
{
uscc
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
FuHuaQiUscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterpriseBiz
.
getMyEnterpriseBaseInfo
(
FuHuaQiUscc
,
uscc
);
res
.
success
(
result
);
}
...
...
@@ -219,3 +227,51 @@ async function updateMoveOut(req, res) {
res
.
success
(
result
);
}
/**
* 修改我的企业信息
* 2.0
* @param req
* @param res
*/
async
function
updateMyEnterpriseInfo
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterpriseBiz
.
updateMyEnterpriseBaseInfo
(
Uscc
,
form
);
res
.
success
(
result
);
}
/**
* 补录 新注册企业信息
* 2.0
* @param req
* @param res
*/
async
function
replenishCreate
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterpriseBiz
.
replenishMyEnterpriseCreateInfo
(
Uscc
,
form
);
res
.
success
(
result
);
}
/**
* 补录 新迁入企业信息
* 2.0
* @param req
* @param res
*/
async
function
replenishInPut
(
req
,
res
)
{
let
reqConf
=
{
form
:
'Object'
};
let
{
form
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
enterpriseBiz
.
replenishMyEnterpriseInPutInfo
(
Uscc
,
form
);
res
.
success
(
result
);
}
\ No newline at end of file
src/routers/mobileClient/fuHuaQi.ts
View file @
04c1ecd5
...
...
@@ -7,6 +7,7 @@
import
*
as
asyncHandler
from
'express-async-handler'
;
import
*
as
baseBiz
from
'../../biz/mobileFuHuaQi/fuHuaQi/base'
;
import
*
as
taskBiz
from
'../../biz/mobileFuHuaQi/fuHuaQi/task'
;
import
*
as
scoreBiz
from
'../../biz/mobileFuHuaQi/fuHuaQi/score'
;
import
{
eccReqParamater
}
from
'../../util/verificationParam'
;
import
{
checkFuHuaQiToken
}
from
'../../middleware/user'
;
...
...
@@ -109,7 +110,10 @@ async function updateOrganizationInfo(req, res) {
*/
async
function
taskList
(
req
,
res
)
{
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
taskBiz
.
fuHuaQiTaskList
(
Uscc
);
let
taskListObj
=
await
taskBiz
.
fuHuaQiTaskList
(
Uscc
);
/**拼接分数 */
let
scoreObj
=
await
scoreBiz
.
MyScore
(
Uscc
);
let
result
=
Object
.
assign
(
scoreObj
,
taskListObj
);
res
.
success
(
result
);
}
...
...
src/routers/mobileClient/user.ts
View file @
04c1ecd5
...
...
@@ -13,6 +13,9 @@ export function setRouter(httpServer) {
httpServer
.
post
(
'/fuhuaqi/login/firstupdate'
,
checkFuHuaQiToken
,
asyncHandler
(
firstUpdatePwd
));
httpServer
.
post
(
'/fuhuaqi/changepwd'
,
checkFuHuaQiToken
,
asyncHandler
(
changePwd
));
httpServer
.
post
(
'/fuhuaqi/binduser'
,
checkFuHuaQiToken
,
asyncHandler
(
bindUser
));
httpServer
.
post
(
'/fuhuaqi/bindlist'
,
checkFuHuaQiToken
,
asyncHandler
(
bindList
));
httpServer
.
post
(
'/fuhuaqi/changeuser'
,
checkFuHuaQiToken
,
asyncHandler
(
changeUser
));
}
...
...
@@ -75,6 +78,55 @@ async function changePwd(req, res) {
res
.
success
(
result
);
}
async
function
bindUser
()
{
}
\ No newline at end of file
/**
* 绑定账号
* @param req
* @param res
*/
async
function
bindUser
(
req
,
res
)
{
let
reqConf
=
{
bindUscc
:
'String'
,
bindPwd
:
'String'
,
deviceId
:
'String'
};
let
{
bindUscc
,
bindPwd
,
deviceId
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
userBiz
.
bindFuHuaQi
(
Uscc
,
bindUscc
,
bindPwd
,
deviceId
);
res
.
success
(
result
);
}
/**
* 已绑定的账号列表
* @param req
* @param res
*/
async
function
bindList
(
req
,
res
)
{
let
reqConf
=
{
deviceId
:
'String'
};
let
{
deviceId
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
userBiz
.
bindUserList
(
Uscc
,
deviceId
);
res
.
success
(
result
);
}
/**
* 切换账号账号
* @param req
* @param res
*/
async
function
changeUser
(
req
,
res
)
{
let
reqConf
=
{
targetUscc
:
'String'
};
let
{
targetUscc
}
=
eccReqParamater
(
reqConf
,
req
.
body
);
const
Uscc
=
req
.
headers
.
uscc
;
let
result
=
await
userBiz
.
changeUser
(
Uscc
,
targetUscc
);
res
.
success
(
result
);
}
src/tools/system.ts
View file @
04c1ecd5
...
...
@@ -17,9 +17,7 @@ const md5 = require("md5");
* @returns
*/
export
function
getTaskId
(
uscc
:
string
)
{
// return `${uscc}${getTimeKey()}`;
//todo 这里15号要改掉
return
`
${
uscc
}${
20232
}
`
;
return
`
${
uscc
}${
getTimeKey
()}
`
;
}
...
...
@@ -103,4 +101,15 @@ export function eccUscc(uscc:string) {
if
(
uscc
.
search
(
/^
[
A-Za-z0-9
]{16}
$/
)
>
-
1
)
isSuccess
=
true
;
else
if
(
uscc
.
search
(
/^
[
A-Za-z0-9
]{18}
$/
)
>
-
1
)
isSuccess
=
true
;
return
isSuccess
;
}
\ No newline at end of file
}
/**
* 获取绑定id
* @param uscc 孵化器统一信用代码
* @param bindUscc 被绑定的孵化器统一信用代码
* @returns
*/
export
function
getBindId
(
uscc
:
string
,
bindUscc
:
string
)
{
return
md5
(
`
${
uscc
}${
bindUscc
}${
Math
.
ceil
(
Math
.
random
()
*
100
)}
`
);
}
\ 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