Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gk
Project
Project
Details
Activity
Releases
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
micro_app
gk
Commits
3911fb52
Commit
3911fb52
authored
May 23, 2020
by
sunyuhua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目Id不存在,避免null指针异常
parent
9bc0a6df
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
2 deletions
+3
-2
CmptScoreRuleScoreInfoService.java
...p/plugins/cmpt/service/CmptScoreRuleScoreInfoService.java
+1
-1
RemoteService.java
...com/dlbridge/jadp/plugins/cmpt/service/RemoteService.java
+1
-0
application.properties
src/main/resources/application.properties
+1
-1
No files found.
src/main/java/com/dlbridge/jadp/plugins/cmpt/service/CmptScoreRuleScoreInfoService.java
View file @
3911fb52
...
@@ -56,7 +56,7 @@ public class CmptScoreRuleScoreInfoService {
...
@@ -56,7 +56,7 @@ public class CmptScoreRuleScoreInfoService {
long
userTotalScore
=
cmptScoreRuleScoreInfoList
.
stream
().
filter
(
entry
->
entry
.
getSubsectionscore
()
!=
null
).
mapToInt
(
CmptScoreRuleScoreInfo:
:
getSubsectionscore
).
sum
();
long
userTotalScore
=
cmptScoreRuleScoreInfoList
.
stream
().
filter
(
entry
->
entry
.
getSubsectionscore
()
!=
null
).
mapToInt
(
CmptScoreRuleScoreInfo:
:
getSubsectionscore
).
sum
();
//计算里程之和
//计算里程之和
//int userTotalMileage=cmptScoreRuleScoreInfoList.stream().mapToInt(CmptScoreRuleScoreInfo::getSubsectionMileage).sum();
//int userTotalMileage=cmptScoreRuleScoreInfoList.stream().mapToInt(CmptScoreRuleScoreInfo::getSubsectionMileage).sum();
int
userTotalMileage
=
Optional
.
of
(
cmptScoreRuleScoreInfoList
).
orElse
(
cmptScoreRuleScoreInfoList
).
stream
().
filter
(
entry
->
entry
.
getSubsectionMileage
()
!=
null
).
mapToInt
(
CmptScoreRuleScoreInfo:
:
getSubsectionMileage
).
sum
();
int
userTotalMileage
=
Optional
.
of
(
cmptScoreRuleScoreInfoList
).
orElse
(
cmptScoreRuleScoreInfoList
).
stream
().
filter
(
entry
->
entry
.
getSubsectionMileage
()
!=
0
).
mapToInt
(
CmptScoreRuleScoreInfo:
:
getSubsectionMileage
).
sum
();
HashMap
<
String
,
Object
>
userScore
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
userScore
=
new
HashMap
<>();
userScore
.
put
(
"userTotalScore"
,
userTotalScore
);
userScore
.
put
(
"userTotalScore"
,
userTotalScore
);
userScore
.
put
(
"userTotalMileage"
,
Integer
.
valueOf
(
userTotalMileage
));
userScore
.
put
(
"userTotalMileage"
,
Integer
.
valueOf
(
userTotalMileage
));
...
...
src/main/java/com/dlbridge/jadp/plugins/cmpt/service/RemoteService.java
View file @
3911fb52
...
@@ -583,6 +583,7 @@ public class RemoteService {
...
@@ -583,6 +583,7 @@ public class RemoteService {
log
.
info
(
"计时打卡点:"
+
resultString
);
log
.
info
(
"计时打卡点:"
+
resultString
);
JSONObject
object
=
JSONObject
.
parseObject
(
resultString
);
JSONObject
object
=
JSONObject
.
parseObject
(
resultString
);
JSONObject
roadJsonObject
=
object
.
getJSONObject
(
"road"
);
JSONObject
roadJsonObject
=
object
.
getJSONObject
(
"road"
);
if
(
roadJsonObject
==
null
||
roadJsonObject
.
isEmpty
())
return
null
;
JSONArray
segsResult
=
roadJsonObject
.
getJSONArray
(
"segs"
);
JSONArray
segsResult
=
roadJsonObject
.
getJSONArray
(
"segs"
);
if
(
segsResult
==
null
||
segsResult
.
isEmpty
())
return
null
;
if
(
segsResult
==
null
||
segsResult
.
isEmpty
())
return
null
;
//支持多日赛
//支持多日赛
...
...
src/main/resources/application.properties
View file @
3911fb52
spring.profiles.active
=
dev
spring.profiles.active
=
test
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