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
f07b788a
Commit
f07b788a
authored
Feb 28, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.0功能封版
parent
989ff822
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
109 additions
and
24 deletions
+109
-24
enterprise.ts
src/biz/enterprise/enterprise.ts
+2
-2
base.ts
src/biz/fuHuqQi/base.ts
+5
-9
task.ts
src/biz/fuHuqQi/task.ts
+62
-1
eccFormParamConfig.ts
src/config/eccFormParamConfig.ts
+1
-1
splitResultConfig.ts
src/config/splitResultConfig.ts
+1
-0
fuhuaqi.ts
src/data/fuHuaQi/fuhuaqi.ts
+2
-3
fuHuaQi.ts
src/routers/mobileClient/fuHuaQi.ts
+1
-0
system.ts
src/tools/system.ts
+31
-4
verificationEnum.ts
src/util/verificationEnum.ts
+3
-3
verificationParam.ts
src/util/verificationParam.ts
+1
-1
No files found.
src/biz/enterprise/enterprise.ts
View file @
f07b788a
...
...
@@ -151,7 +151,7 @@ export async function getEnterpriseByDraftId(draftId:string) {
/**新注册企业和迁入企业回显信息不一样 */
let
data
:
any
=
{};
if
(
dataBaseInfo
.
isCreate
)
extractData
(
splitResultConfig
.
EnterpriseInfoConfig
,
dataBaseInfo
,
false
);
if
(
dataBaseInfo
.
isCreate
)
data
=
extractData
(
splitResultConfig
.
EnterpriseInfoConfig
,
dataBaseInfo
,
false
);
else
data
=
extractData
(
splitResultConfig
.
EnterpriseMoveInInfoConfig
,
dataBaseInfo
,
false
);
return
{
data
};
...
...
@@ -195,7 +195,7 @@ export async function enterpriseList(createType:number, fuHuaQiUscc:string, indu
}
if
(
fuHuaQiUscc
)
selectParam
.
fuHuaQiUscc
=
fuHuaQiUscc
;
if
(
industry
.
length
>
0
)
{
verificationEnumTools
.
eccEnumValue
(
'管理后台获取在孵企业信息列表'
,
'industry'
,
configEnum
.
INDUSTRY
,
industry
);
//是否符合枚举范围
verificationEnumTools
.
eccEnumValue
(
'管理后台获取在孵企业信息列表'
,
'industry'
,
configEnum
.
INDUSTRY
,
industry
);
selectParam
.
industry
=
industry
;
}
if
(
isNaturalPersonHolding
==
2
||
isNaturalPersonHolding
==
3
)
{
...
...
src/biz/fuHuqQi/base.ts
View file @
f07b788a
...
...
@@ -114,13 +114,13 @@ export async function updateFuHuaQiBaseData(uscc:string, param) {
export
async
function
updateOrganizationData
(
uscc
:
string
,
param
)
{
/**校验表单内容 */
eccFormParam
(
"更新孵化器机构信息数据"
,
eccFormParamConfig
.
OrganizationParamUpdateConfig
,
param
);
if
(
param
.
foundingTeam
&&
param
.
foundingTeam
.
length
)
{
//创始团队参数校验
if
(
param
.
foundingTeam
Type
&&
param
.
foundingTeamType
!=
configEnum
.
TEAM
.
无
)
{
param
.
foundingTeam
.
forEach
((
subInfo
,
subIndex
)
=>
{
eccFormParam
(
`更新孵化器机构信息数据 创始团队
${
subIndex
}
`
,
eccFormParamConfig
.
OrganizationParamFoundingTeamUpdateConfig
,
subInfo
);
eccEnumValue
(
`更新孵化器机构信息数据 创始团队
${
subIndex
}
`
,
"团队类型"
,
configEnum
.
TEAM
,
subInfo
.
type
);
});
}
if
(
param
.
operationModel
&&
param
.
operationModel
.
length
)
{
}
else
param
.
foundingTeam
=
[];
if
(
param
.
operationModel
&&
param
.
operationModel
.
length
&&
param
.
operationModel
.
indexOf
(
configEnum
.
OPERATIONMODEL
.
其他
)
>
0
)
{
if
(
!
param
.
operationModelDes
)
throw
new
BizError
(
ERRORENUM
.
表单校验失败
,
`缺失运营模式描述`
);
}
/**校验是否符合枚举范围 */
...
...
@@ -131,7 +131,7 @@ export async function updateOrganizationData(uscc:string, param) {
let
baseDataInfo
=
await
fuhuaqiData
.
findFuHuaQiByUSCC
(
uscc
);
/**
这里无法判断数组里面的内容是否有变化 所以 foundingTeam 直接赋值
*/
/**
赋值内容
*/
let
changeList
=
checkChange
(
param
,
baseDataInfo
);
for
(
let
i
=
0
;
i
<
changeList
.
length
;
i
++
)
{
let
key
=
changeList
[
i
];
...
...
@@ -139,13 +139,9 @@ export async function updateOrganizationData(uscc:string, param) {
baseDataInfo
[
key
]
=
param
[
key
];
}
/**这里无法判断数组里面的内容是否有变化 所以 foundingTeam 直接赋值 */
baseDataInfo
[
"foundingTeam"
]
=
param
.
foundingTeam
;
/**由于前端的创始团队是在foundingTeam里面传的 所以这里要截出来赋值给foundingTeamType */
if
(
param
.
foundingTeam
&&
param
.
foundingTeam
.
length
>
0
)
{
baseDataInfo
.
foundingTeamType
=
param
.
foundingTeam
[
0
].
type
;
}
else
baseDataInfo
.
foundingTeamType
=
0
;
await
baseDataInfo
.
save
();
return
{
isSuccess
:
true
};
...
...
src/biz/fuHuqQi/task.ts
View file @
f07b788a
...
...
@@ -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
TaskId
,
getTimeKey
}
from
"../../tools/system"
;
import
{
get
LastTimeKey
,
getTaskId
,
getTaskIdByTime
,
getTimeKey
}
from
"../../tools/system"
;
/**
...
...
@@ -85,6 +85,67 @@ export async function fuHuaQiTaskList(uscc:string) {
/**
* 孵化器 已办任务列表
* 小程序端
* @param uscc 孵化器统一信用
* @returns [{type:1, title:'', enterpriseList:[] }]
*/
export
async
function
fuHuaQiCompletedList
(
uscc
:
string
,
selectTime
:
number
)
{
/**得到查询月的任务map taskMap格式为{type:{isSubmit}} */
const
TaskId
=
getTaskIdByTime
(
uscc
,
selectTime
);
let
taskMap
=
await
taskData
.
findFuHuaQiTaskByTaskId
(
TaskId
);
let
lastDateKey
=
getLastTimeKey
();
let
result
=
[];
for
(
let
key
in
TASKTYPEENUM
)
{
let
anyKey
:
any
=
key
;
/** 当key是枚举的键的时候 进入到逻辑 */
if
(
isNaN
(
anyKey
))
{
const
ValueStr
=
TASKTYPEENUM
[
key
];
//字符型的枚举值 也就是 "1"或者"2"或者"3"
const
ValueNumber
=
parseInt
(
ValueStr
);
//number型的枚举值 也就是 1或者2或者3
let
onceObj
=
{
key
:
ValueNumber
,
title
:
anyKey
,
//标题
enterpriseList
:[]
//相关的列表 这里不应该用这个字段名称 当时不能修改前端 沿用了这个字段名称
};
/**没有提交任务 则获取本月提交的任务相关信息 */
if
(
!
taskMap
[
ValueStr
].
isSubmit
)
{
let
dataList
=
[];
switch
(
ValueNumber
)
{
case
TASKTYPEENUM
.
孵化器月度填报
:
/** 这里加限制 在月度任务中 isUpdate=true代表已经修改 isUpdate=false表示没有这个任务 详细说明看./month.ts注释*/
dataList
=
await
monthTableData
.
findmonthTableListByTaskId
(
TaskId
);
break
;
case
TASKTYPEENUM
.
新注册或迁入企业登记
:
/**限制 draftLock = false 即草稿数据 这里可以不用这个限制 */
dataList
=
await
findEnterpriseListByTaskId
(
TaskId
);
dataList
.
forEach
(
item
=>
{
item
.
uscc
=
item
.
draftId
;
//这里转换一下,为了不改前端代码 使用uscc这个名称,但是实际是draftId
});
break
;
case
TASKTYPEENUM
.
融资企业填报
:
/**限制 draftLock = false 即草稿数据 这里可以不用这个限制 */
dataList
=
await
findFinancingListByTaskId
(
TaskId
);
break
;
}
dataList
.
forEach
(
info
=>
{
let
addInfo
:
any
=
{
name
:
info
.
name
,
id
:
info
.
uscc
,
isCreate
:
info
.
isCreate
||
false
};
onceObj
.
enterpriseList
.
push
(
addInfo
);
});
result
.
push
(
onceObj
);
}
}
}
return
{
taskList
:
result
};
}
/**
* 提交任务
* 小程序端
* @param uscc 孵化器统一信用代码
...
...
src/config/eccFormParamConfig.ts
View file @
f07b788a
...
...
@@ -52,6 +52,7 @@ export const OrganizationParamUpdateConfig = {
personInCharge
:{
type
:
"String"
,
notMustHave
:
true
},
// {key:"负责人"},
personInChargePhone
:{
type
:
"String"
,
notMustHave
:
true
},
// {key:"负责人联系电话"},
operationModelDes
:{
type
:
"String"
,
notMustHave
:
true
},
//{key:"运营模式描述"},
foundingTeamType
:{
type
:
"Number"
,
notMustHave
:
true
},
//{key:"团队类型"}
};
/**
* 使用端: 小程序端【孵化器入口】
...
...
@@ -59,7 +60,6 @@ export const OrganizationParamUpdateConfig = {
* 备注: 更新机构信息时 当选择了创始团队
*/
export
const
OrganizationParamFoundingTeamUpdateConfig
=
{
type
:{
type
:
"Number"
},
//人才类型
memberName
:{
type
:
"String"
},
//成员姓名
memberSex
:{
type
:
"Number"
},
//成员性别
memberAge
:{
type
:
"Number"
},
//成员年龄
...
...
src/config/splitResultConfig.ts
View file @
f07b788a
...
...
@@ -215,6 +215,7 @@ export const OrganizationBaseDataConfig = {
institutionalNature
:{
key
:
"机构性质"
},
operationModel
:{
key
:
"运营模式"
},
//新加
foundingTeam
:{
key
:
"创始团队"
},
//新加
foundingTeamType
:{
key
:
"创始团队类型"
},
//新加
liaison
:{
key
:
"联系人"
},
liaisonPhone
:{
key
:
"联系电话"
},
personInCharge
:{
key
:
"负责人"
},
...
...
src/data/fuHuaQi/fuhuaqi.ts
View file @
f07b788a
...
...
@@ -11,20 +11,19 @@ import {Schema} from 'mongoose';
import
{
baseDB
}
from
'../../db/mongo/dbInit'
;
const
foundingTeamSchema
=
new
Schema
({
type
:
Number
,
//人才类型
memberName
:
String
,
//成员姓名
memberSex
:
Number
,
//成员性别
memberAge
:
Number
,
//成员年龄
memberDEGREE
:
Number
,
//成员最高学历
memberSchool
:
String
,
//毕业学校
des
:
String
,
//履历描述
});
}
,{
_id
:
false
}
);
const
hatchingGroundSchema
=
new
Schema
({
personInChargeAdd
:
String
,
//孵化场地地址
siteAcreage
:
Number
,
//孵化场地面积(㎡)
leasePrice
:
Number
,
//孵化场地出租单价
});
}
,{
_id
:
false
}
);
const
fuHuaQiSchema
=
new
Schema
({
...
...
src/routers/mobileClient/fuHuaQi.ts
View file @
f07b788a
...
...
@@ -141,6 +141,7 @@ async function completedList(req, res) {
const
NotMustHaveKeys
=
[
"selectTime"
];
let
{
selectTime
}
=
eccReqParamater
(
reqConf
,
req
.
body
,
NotMustHaveKeys
);
const
Uscc
=
req
.
headers
.
uscc
;
res
.
success
({});
}
...
...
src/tools/system.ts
View file @
f07b788a
...
...
@@ -6,6 +6,8 @@
* 包括 密码加密规则
*/
import
moment
=
require
(
"moment"
);
const
md5
=
require
(
"md5"
);
...
...
@@ -15,17 +17,41 @@ const md5 = require("md5");
* @returns
*/
export
function
getTaskId
(
uscc
:
string
)
{
return
`
${
uscc
}${
getTimeKey
()}
`
return
`
${
uscc
}${
getTimeKey
()}
`
;
}
/**
* 根据时间生成任务id
* @param uscc 企业标识
* @param timeMs 时间戳
* @returns
*/
export
function
getTaskIdByTime
(
uscc
:
string
,
timeMs
:
number
)
{
return
`
${
uscc
}${
new
Date
(
timeMs
).
getFullYear
()}${
new
Date
(
timeMs
).
getMonth
()
+
1
}
`
;
}
/**
* 获取当前日期的key
* @param timeMs 指定时间,如果不传
* @returns
*/
export
function
getTimeKey
(
timeMs
?)
{
if
(
timeMs
)
return
`
${
new
Date
(
timeMs
).
getFullYear
()}${
new
Date
(
timeMs
).
getMonth
()
+
1
}
`
;
return
`
${
new
Date
().
getFullYear
()}${
new
Date
().
getMonth
()
+
1
}
`
;
}
/**
* 获取上一月的日期的key
* @returns
*/
export
function
getTimeKey
()
{
return
`
${
new
Date
().
getFullYear
()}${
new
Date
().
getMonth
()
+
1
}
`
export
function
get
Last
TimeKey
()
{
return
moment
().
subtract
(
1
,
'months'
).
format
(
'YYYYM'
);
}
/**
* 生成草稿箱Id
* @param uscc
...
...
@@ -73,6 +99,6 @@ export function getToken(uscc:string) {
export
function
eccUscc
(
uscc
:
string
)
{
let
isSuccess
=
false
;
if
(
uscc
.
search
(
/^
[
A-Za-z0-9
]{16}
$/
)
>
-
1
)
isSuccess
=
true
;
else
if
(
uscc
.
search
(
/^
[
A-Za-z0-9
]{1
6
}
$/
)
>
-
1
)
isSuccess
=
true
;
else
if
(
uscc
.
search
(
/^
[
A-Za-z0-9
]{1
8
}
$/
)
>
-
1
)
isSuccess
=
true
;
return
isSuccess
;
}
\ No newline at end of file
src/util/verificationEnum.ts
View file @
f07b788a
...
...
@@ -15,9 +15,9 @@ import { BizError } from "./bizError";
*/
export
function
eccEnumValue
(
name
:
string
,
key
:
string
,
enumConf
,
value
:
any
)
{
let
eccSuccess
=
true
;
if
(
typeof
value
==
'number'
&&
!
enumConf
[
value
]
)
{
eccSuccess
=
false
;
}
else
{
if
(
typeof
value
==
'number'
)
{
if
(
!
enumConf
[
value
]
)
eccSuccess
=
false
;
}
else
if
(
Array
.
isArray
(
value
))
{
value
.
forEach
(
item
=>
{
if
(
!
enumConf
[
item
]
)
eccSuccess
=
false
;
});
...
...
src/util/verificationParam.ts
View file @
f07b788a
...
...
@@ -86,7 +86,7 @@ export function eccReqParamater(conf:object, param, skipKeys?) {
skipKeys
=
skipKeys
||
[];
for
(
let
key
in
conf
)
{
let
type
=
conf
[
key
];
let
value
=
param
[
type
];
let
value
=
param
[
key
];
let
isError
=
false
;
//校验是否异常
let
errorStr
=
""
;
//异常说明
...
...
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