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
ba0f10c9
Commit
ba0f10c9
authored
Mar 09, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修bug
parent
04c1ecd5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
45 deletions
+98
-45
enterprise.ts
src/biz/admin/enterprise/enterprise.ts
+5
-4
enterprise.ts
src/biz/mobileFuHuaQi/enterprise/enterprise.ts
+29
-2
score.ts
src/biz/mobileFuHuaQi/fuHuaQi/score.ts
+57
-35
scoreConfig.ts
src/config/scoreConfig.ts
+2
-1
splitResultConfig.ts
src/config/splitResultConfig.ts
+3
-2
enterprise.ts
src/data/enterprise/enterprise.ts
+2
-1
No files found.
src/biz/admin/enterprise/enterprise.ts
View file @
ba0f10c9
...
...
@@ -88,14 +88,14 @@ export async function outPutEnterpriseData(createType:number, fuHuaQiUscc:string
let
usccMap
=
await
fuHuaQiData
.
findAllFuHuaQiOperationNameMap
();
//用于将孵化器uscc变成孵化器名称
let
dataBaseList
=
await
enterpriseData
.
findEnterpriseList
(
selectParam
);
/**组合二维数组 titleList 与 keyList 要一一对应 */
/**组合二维数组 titleList 与 keyList 要一一对应 */
const
TitleList
=
[
"企业名称"
,
"入库时间"
,
"所属孵化器"
,
"
统一信用代码"
,
"行业领域
"
,
"企业名称"
,
"入库时间"
,
"所属孵化器"
,
"
新注册/新迁入"
,
"统一信用代码"
,
"行业领域"
,
"主营业务
"
,
"注册时间"
,
"首次入孵时间"
,
"迁入时间"
,
"是否自然人控股"
,
"迁入前注册地址"
,
"注册地址"
,
"经营地址"
,
"租赁面积(平方米)"
];
//表头顺序 如果这里修改了 下面的keyList也要修改
const
KeyList
=
[
"name"
,
"createTime"
,
"fuhuaqiUscc"
,
"
uscc"
,
"industry
"
,
"logonTime"
,
"name"
,
"createTime"
,
"fuhuaqiUscc"
,
"
isCreate"
,
"uscc"
,
"industry"
,
"mainBusiness
"
,
"logonTime"
,
"firstIncubationTime"
,
"timeOfImmigration"
,
"isNaturalPersonHolding"
,
"oldLogonAdd"
,
"logonAdd"
,
"operatingAdd"
,
"leasedArea"
];
//表头对应的字段顺序
...
...
@@ -110,6 +110,8 @@ export async function outPutEnterpriseData(createType:number, fuHuaQiUscc:string
if
(
info
.
enterpriseIsInPut
)
changeData
.
isCreate
=
""
;
else
changeData
.
isCreate
=
(
changeData
.
isCreate
)
?
"新注册"
:
"新迁入"
;
changeData
.
isNaturalPersonHolding
=
changeData
.
isNaturalPersonHolding
?
"是"
:
"否"
;
/**修改枚举值 */
changeData
.
industry
=
verificationEnumTools
.
changeEnumValue
(
configEnum
.
INDUSTRY
,
changeData
.
industry
);
// dataList.push(changeData);
...
...
@@ -125,7 +127,6 @@ export async function outPutEnterpriseData(createType:number, fuHuaQiUscc:string
}
/**
* 在孵企业页面的所属孵化器 下拉框
* 管理后台端
...
...
src/biz/mobileFuHuaQi/enterprise/enterprise.ts
View file @
ba0f10c9
...
...
@@ -221,7 +221,13 @@ export async function myEnterprise(uscc:string, state:number, name:string, page:
dataList
.
forEach
(
info
=>
{
let
changeData
:
any
=
extractData
(
splitResultConfig
.
MyEnterpriseDataConfig
,
info
,
false
);
if
(
state
!=
configEnum
.
FUHUASTATE
.
迁出
)
{
changeData
.
virtualCause
=
info
.
virtualCause
||
0
;
changeData
.
virtualCauseDes
=
info
.
virtualCauseDes
||
""
;
}
changeData
.
state
=
verificationEnumTools
.
changeEnumValue
(
configEnum
.
FUHUASTATE
,
changeData
.
state
);
enterpriseList
.
push
(
changeData
);
});
...
...
@@ -246,6 +252,13 @@ export async function updatePhysicalInfo(fuHuaQiUscc:string, uscc:string, leased
if
(
enterpriseInfo
.
fuHuaQiUscc
!=
fuHuaQiUscc
)
throw
new
BizError
(
ERRORENUM
.
无法操作其他孵化器的企业
,
"修改企业孵化状态 修改为实体"
,
`孵化器
${
fuHuaQiUscc
}
-> 企业
${
uscc
}
`
);
enterpriseInfo
.
leasedArea
=
leasedArea
;
enterpriseInfo
.
state
=
configEnum
.
FUHUASTATE
.
实体孵化
;
/**修改为实体,需要把虚拟的和迁出的字段清空 */
enterpriseInfo
.
virtualCause
=
null
;
//虚拟孵化模式
enterpriseInfo
.
virtualCauseDes
=
""
;
//虚拟孵化原因
enterpriseInfo
.
moveOutType
=
null
;
//迁出类型
enterpriseInfo
.
moveOutCause
=
[];
//迁出原因
await
enterpriseInfo
.
save
();
...
...
@@ -265,8 +278,8 @@ export async function updatePhysicalInfo(fuHuaQiUscc:string, uscc:string, leased
export
async
function
updateVirtualInfo
(
fuHuaQiUscc
:
string
,
uscc
:
string
,
virtualCauseDes
:
string
,
virtualCause
:
number
)
{
verificationEnumTools
.
eccEnumValue
(
'修改企业孵化状态'
,
'修改为虚拟'
,
configEnum
.
VIRTUALCAUSE
,
virtualCause
);
if
(
virtualCause
!
=
configEnum
.
VIRTUALCAUSE
.
其他
&&
!
virtualCauseDes
)
{
throw
new
BizError
(
ERRORENUM
.
请填入其他原因
,
"修改企业孵化状态 修改为虚拟"
);
if
(
virtualCause
=
=
configEnum
.
VIRTUALCAUSE
.
其他
&&
!
virtualCauseDes
)
{
throw
new
BizError
(
ERRORENUM
.
请填入其他原因
,
"修改企业孵化状态 修改为虚拟"
,
`virtualCause:
${
virtualCause
}
, virtualCauseDes:
${
virtualCauseDes
}
`
);
}
let
enterpriseInfo
=
await
enterpriseData
.
findEnterpriseByUscc
(
uscc
);
...
...
@@ -277,6 +290,13 @@ export async function updateVirtualInfo(fuHuaQiUscc:string, uscc:string, virtual
enterpriseInfo
.
virtualCause
=
virtualCause
;
if
(
virtualCauseDes
)
enterpriseInfo
.
virtualCauseDes
=
virtualCauseDes
;
enterpriseInfo
.
state
=
configEnum
.
FUHUASTATE
.
虚拟孵化
;
/**修改为虚拟时,需要把实体的和迁出的字段清空 */
enterpriseInfo
.
moveOutType
=
null
;
//迁出类型
enterpriseInfo
.
moveOutCause
=
[];
//迁出原因
enterpriseInfo
.
leasedArea
=
0
;
//租赁面积
await
enterpriseInfo
.
save
();
return
{
isUsccess
:
true
};
...
...
@@ -304,6 +324,13 @@ export async function updateMoveOutInfo(fuHuaQiUscc:string, uscc:string, moveOu
enterpriseInfo
.
moveOutType
=
moveOutType
;
enterpriseInfo
.
moveOutCause
=
moveOutCause
;
enterpriseInfo
.
state
=
configEnum
.
FUHUASTATE
.
迁出
;
/**修改为虚拟时,需要把实体的和迁出的字段清空 */
enterpriseInfo
.
virtualCause
=
null
;
//虚拟孵化模式
enterpriseInfo
.
virtualCauseDes
=
""
;
//虚拟孵化原因
enterpriseInfo
.
leasedArea
=
0
;
//租赁面积
await
enterpriseInfo
.
save
();
return
{
isUsccess
:
true
};
...
...
src/biz/mobileFuHuaQi/fuHuaQi/score.ts
View file @
ba0f10c9
...
...
@@ -39,52 +39,31 @@ export async function MyScore(uscc:string) {
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
myEnterpriseScore
=
await
myEnterpriseScoreCount
(
uscc
);
/**算任务的分 */
let
taskScore
=
0
;
let
taskList
=
await
findTaskListByParam
({
fuHuaQiUscc
:
uscc
});
ScoreConfig
[
"任务分数"
]
taskList
.
forEach
(
info
=>
{
// if (isSubmit)
});
/**任务分 */
let
taskScore
=
await
taskScoreCount
(
uscc
);
let
newScore
=
startScore
+
myDataScore
+
baseDataScore
+
enterpriseData
Score
+
taskScore
;
let
newScore
=
startScore
+
myDataScore
+
baseDataScore
+
myEnterprise
Score
+
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
}}
;
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
];
}
}
/**
* 根据分数算星数
* @param socre 分数
* @returns 星数
*/
function
starCount
(
socre
:
number
)
{
let
star
=
1
;
for
(
let
i
=
0
;
i
<
StarConfig
.
length
;
i
++
)
{
...
...
@@ -98,6 +77,50 @@ function starCount(socre:number) {
}
export
async
function
updateScore
()
{
/**
* 算任务分数
* @param uscc 孵化器统一信用代码
* @returns 任务得分
*/
async
function
taskScoreCount
(
uscc
:
string
)
{
let
taskList
=
await
findTaskListByParam
({
fuHuaQiUscc
:
uscc
});
let
should
=
taskList
.
length
;
let
completed
=
0
;
//已完成
let
unfinished
=
0
;
//未完成
taskList
.
forEach
(
info
=>
{
if
(
info
.
isSubmit
)
completed
+=
1
;
else
unfinished
+=
1
;
});
let
addScoreParam
=
ScoreConfig
[
"任务分数_加分"
]
*
3
*
12
;
let
subtractionScoreParam
=
ScoreConfig
[
"任务分数_扣分"
]
*
3
*
12
;
return
(
addScoreParam
*
(
completed
/
should
)
)
-
(
subtractionScoreParam
*
(
unfinished
/
should
)
);
}
/**
* 我的企业分数
* @param uscc 孵化器统一信用代码
* @returns 我的企业得分
*/
async
function
myEnterpriseScoreCount
(
uscc
:
string
)
{
let
enterpriseList
=
await
findEnterpriseList
({
fuHuaQiUscc
:
uscc
,
draftLock
:
true
});
let
isValueCount
=
0
;
let
valueCount
=
0
;
enterpriseList
.
forEach
(
info
=>
{
for
(
let
key
in
EnterpriseScoreConfig
)
{
let
type
=
EnterpriseScoreConfig
[
key
];
if
(
type
==
'[Object]'
||
type
==
'[Number]'
)
{
if
(
info
[
key
]
&&
info
[
key
].
length
)
isValueCount
+=
1
;
}
else
if
(
type
==
'Boolean'
)
{
isValueCount
+=
1
;
}
else
if
(
info
[
key
])
isValueCount
+=
1
;
}
valueCount
+=
Object
.
keys
(
EnterpriseScoreConfig
).
length
;
});
return
ScoreConfig
[
"企业基础数据"
]
*
(
isValueCount
/
valueCount
);
}
}
\ No newline at end of file
// async function
src/config/scoreConfig.ts
View file @
ba0f10c9
...
...
@@ -3,7 +3,8 @@ export const ScoreConfig = {
"我的数据"
:
25
,
"孵化器基础数据"
:
25
,
"企业基础数据"
:
50
,
"任务分数"
:
10
,
"任务分数_扣分"
:
10
,
"任务分数_加分"
:
5
,
}
export
const
StarConfig
=
[
...
...
src/config/splitResultConfig.ts
View file @
ba0f10c9
...
...
@@ -227,14 +227,15 @@ export const OrganizationBaseDataConfig = {
/**
* 使用端: 小程序端【孵化器入口】
* 场景: 我的企业列表
* 场景: 我的企业列表
(实体 虚拟)
* 备注:
*/
export
const
MyEnterpriseDataConfig
=
{
name
:{
key
:
"名称"
},
uscc
:{
key
:
"统一信用代码"
},
state
:{
key
:
"孵化器状态"
},
leasedArea
:{
key
:
"租赁面积"
}
leasedArea
:{
key
:
"租赁面积"
},
}
...
...
src/data/enterprise/enterprise.ts
View file @
ba0f10c9
...
...
@@ -28,8 +28,9 @@ const enterpriseSchema = new Schema({
draftLock
:{
type
:
Boolean
,
default
:
false
},
//草稿锁,true为提交之后,false为草稿
enterpriseIsInPut
:{
type
:
Boolean
,
default
:
false
},
//是否是初始数据 todo 后续要弃用 兼容原始数据无法判断是否是迁入企业这个问题加的字段
draftId
:{
type
:
String
,
index
:
true
},
//草稿id 编辑的时候使用这个id 保存之后就不认这个id了
/**孵化状态相关 */
state
:{
type
:
Number
,
default
:
FUHUASTATE
.
实体孵化
},
//孵化状态 遵循枚举 FUHUASTATE 值 默认实体孵化 ----2.0
virtualCause
:
[
Number
]
,
//虚拟孵化原因 遵循 VIRTUALCAUSE 的值 ----2.0
virtualCause
:
Number
,
//虚拟孵化原因 遵循 VIRTUALCAUSE 的值 ----2.0
virtualCauseDes
:
String
,
//虚拟孵化描述 ----2.0
moveOutType
:
Number
,
// 迁出类型 遵循 MOVEOUTTYPE 的值 ----2.0
moveOutCause
:[
Number
],
//迁出原因 遵循 MOVEOUTCAUSE 的值 ----2.0
...
...
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