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
f06d7585
Commit
f06d7585
authored
Jul 24, 2023
by
lixinming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复 做任务得负分的bug
parent
f4443e74
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
score.ts
src/biz/mobileFuHuaQi/fuHuaQi/score.ts
+8
-10
scoreLog.ts
src/data/fuHuaQi/scoreLog.ts
+1
-1
No files found.
src/biz/mobileFuHuaQi/fuHuaQi/score.ts
View file @
f06d7585
...
...
@@ -70,9 +70,9 @@ export async function updateScore(uscc:string, type:number, isSubmitTask:boolean
/**得分信息 */
let
scoreInfo
=
await
scoreData
.
findFuHuaQiScoreInfo
(
uscc
);
let
fuHuaQiInfo
=
await
findFuHuaQiByUSCC
(
uscc
);
let
newScore
=
0
;
//新分数
let
oldScore
=
0
;
//老分数
let
countScore
=
scoreInfo
.
startScore
+
scoreInfo
.
myDataScore
+
scoreInfo
.
baseDataScore
+
scoreInfo
.
myEnterpriseScore
+
scoreInfo
.
taskScore
;
let
newScore
=
0
;
//新
_模块
分数
let
oldScore
=
0
;
//老
_模块
分数
let
countScore
=
scoreInfo
.
startScore
+
scoreInfo
.
myDataScore
+
scoreInfo
.
baseDataScore
+
scoreInfo
.
myEnterpriseScore
+
scoreInfo
.
taskScore
;
//总分
switch
(
type
)
{
case
SCOREWAYS
.
任务得分
:
/**单个任务得分 */
...
...
@@ -124,7 +124,7 @@ export async function updateScore(uscc:string, type:number, isSubmitTask:boolean
let
newCountScore
=
countScore
-
oldScore
+
newScore
;
if
(
SCOREWAYS
.
任务得分
==
type
)
{
newScore
=
-
1
*
newScore
;
//
newScore = -1 * newScore;
await
scoreLogData
.
addLog
(
uscc
,
type
,
changeMode
,
newCountScore
,
newScore
,
subType
);
}
else
{
await
scoreLogData
.
addLog
(
uscc
,
type
,
changeMode
,
newCountScore
,
newScore
);
...
...
@@ -199,13 +199,13 @@ export async function fuHuaQiScoreLog(uscc:string, year:number) {
let
logList
=
await
scoreLogData
.
getLog
(
uscc
,
startTime
,
endTime
);
logList
.
sort
(
(
a
,
b
)
=>
{
return
a
.
timeMs
-
b
.
timeMs
});
let
distinctMap
=
{};
let
distinctMap
=
{};
//{timeKey:[] }
logList
.
forEach
(
info
=>
{
let
timeKey
=
moment
(
info
.
timeMs
).
format
(
"YYYY-MM"
);
if
(
!
distinctMap
[
timeKey
]
)
distinctMap
[
timeKey
]
=
[];
let
itemWaysStr
=
waysStr
(
info
.
ways
,
info
.
taskType
,
info
.
changeMode
);
itemWaysStr
+=
`
${
Math
.
ceil
(
info
.
addScore
)}
分`
;
itemWaysStr
+=
`
${
Math
.
abs
(
info
.
addScore
)}
分`
;
distinctMap
[
timeKey
].
push
({
score
:
Math
.
ceil
(
info
.
score
),
...
...
@@ -217,6 +217,7 @@ export async function fuHuaQiScoreLog(uscc:string, year:number) {
let
dataList
=
[];
for
(
let
key
in
distinctMap
)
{
let
count
=
distinctMap
[
key
].
length
;
distinctMap
[
key
].
sort
((
a
,
b
)
=>
{
return
b
.
timeMs
-
a
.
timeMs
});
dataList
.
push
({
key
,
count
,
...
...
@@ -253,8 +254,6 @@ function waysStr(ways:number, type:number, changeMode) {
return
str
;
}
/**
* 排行榜
* @param uscc 孵化器统一信用代码
...
...
@@ -280,4 +279,4 @@ export async function rankList(uscc:string) {
});
return
{
rankList
,
thisFuHuaQiIndex
};
}
\ No newline at end of file
}
src/data/fuHuaQi/scoreLog.ts
View file @
f06d7585
...
...
@@ -13,7 +13,7 @@ const fuHuaQiScoreLogSchema = new Schema({
ways
:
Number
,
//途径 遵循枚举 SCOREWAYS 值
taskType
:
Number
,
//任务类型 遵循枚举 TASKTYPEENUM 值
changeMode
:
Number
,
//分数变化方式 遵循枚举 CHANGEMODE 值
score
:
Number
,
//分数
score
:
Number
,
//
变化后的
分数
addScore
:
Number
,
//增加/减少的分数
timeMs
:{
type
:
Number
,
index
:
true
}
//获得时间 时间戳
});
...
...
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