Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
antai-sport-http-server
Project
Project
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
antai-sport
antai-sport-http-server
Commits
087ca3d1
Commit
087ca3d1
authored
Jul 11, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加圈数保存
parent
c343503c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
TrainingDetailVO.java
...server/api/business/traininglog/dto/TrainingDetailVO.java
+8
-0
SportUserTrainingLogService.java
...ness/traininglog/service/SportUserTrainingLogService.java
+35
-0
No files found.
server-api/src/main/java/com/antai/sport/http/server/server/api/business/traininglog/dto/TrainingDetailVO.java
View file @
087ca3d1
...
...
@@ -49,6 +49,14 @@ public class TrainingDetailVO {
@ApiModelProperty
(
"记录时间 yyyy-MM-dd HH:mm"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm"
,
timezone
=
"GMT+8"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"模式: 10:竞速模式 2:道具模式"
)
private
Integer
roomMode
;
@ApiModelProperty
(
"圈数"
)
private
Integer
cycles
;
@ApiModelProperty
(
"活动总距离"
)
private
BigDecimal
eventsDistance
;
@ApiModelProperty
(
"活动总爬升高度"
)
private
BigDecimal
eventsClimbDistance
;
@ApiModelProperty
(
"体重"
)
private
BigDecimal
weight
;
...
...
server-api/src/main/java/com/antai/sport/http/server/server/api/business/traininglog/service/SportUserTrainingLogService.java
View file @
087ca3d1
...
...
@@ -4,6 +4,10 @@ import com.antai.sport.http.server.constants.DeleteStatus;
import
com.antai.sport.http.server.constants.GameMode
;
import
com.antai.sport.http.server.constants.RankType
;
import
com.antai.sport.http.server.constants.SportType
;
import
com.antai.sport.http.server.repository.roommode.entity.RoomMode
;
import
com.antai.sport.http.server.repository.roommode.mapper.RoomModeMapper
;
import
com.antai.sport.http.server.repository.simplematch.entity.SimpleMatch
;
import
com.antai.sport.http.server.repository.simplematch.mapper.SimpleMatchMapper
;
import
com.antai.sport.http.server.repository.sport.entity.SportUser
;
import
com.antai.sport.http.server.repository.sport.entity.SportUserMonthRank
;
import
com.antai.sport.http.server.repository.sport.entity.SportUserSummary
;
...
...
@@ -12,6 +16,8 @@ import com.antai.sport.http.server.repository.sport.mapper.SportUserMapper;
import
com.antai.sport.http.server.repository.sport.mapper.SportUserMonthRankMapper
;
import
com.antai.sport.http.server.repository.sport.mapper.SportUserSummaryMapper
;
import
com.antai.sport.http.server.repository.sport.mapper.SportUserTrainingLogMapper
;
import
com.antai.sport.http.server.repository.teamtraining.entity.TeamTraining
;
import
com.antai.sport.http.server.repository.teamtraining.mapper.TeamTrainingMapper
;
import
com.antai.sport.http.server.server.api.business.simplematch.dto.SimpleMatchUserScheduleVO
;
import
com.antai.sport.http.server.server.api.business.simplematch.mapper.SimpleMatchBusinessMapper
;
import
com.antai.sport.http.server.server.api.business.teamtraining.dto.TeamTrainingUserScheduleVO
;
...
...
@@ -51,6 +57,12 @@ public class SportUserTrainingLogService {
private
SportUserMonthRankMapper
sportUserMonthRankMapper
;
@Resource
private
SportUserMapper
sportUserMapper
;
@Resource
private
SimpleMatchMapper
simpleMatchMapper
;
@Resource
private
RoomModeMapper
roomModeMapper
;
@Resource
private
TeamTrainingMapper
teamTrainingMapper
;
@Resource
private
SportUserTrainingLogBusinessMapper
sportUserTrainingLogBusinessMapper
;
...
...
@@ -315,6 +327,29 @@ public class SportUserTrainingLogService {
*/
public
TrainingDetailVO
getTrainingDetail
(
Long
id
)
{
TrainingDetailVO
result
=
sportUserTrainingLogBusinessMapper
.
getSportUserTrainingLogDetail
(
id
);
if
(
GameMode
.
SIMPLE_MATCH
.
equals
(
result
.
getGameMode
()))
{
SimpleMatch
match
=
simpleMatchMapper
.
selectById
(
result
.
getSourceId
());
if
(
match
!=
null
)
{
result
.
setEventsDistance
(
match
.
getDistance
());
result
.
setEventsClimbDistance
(
match
.
getClimbDistance
());
}
}
if
(
GameMode
.
GROUP_TRAINING
.
equals
(
result
.
getGameMode
()))
{
TeamTraining
teamTraining
=
teamTrainingMapper
.
selectById
(
result
.
getSourceId
());
if
(
teamTraining
!=
null
)
{
result
.
setEventsDistance
(
teamTraining
.
getDistance
());
result
.
setEventsClimbDistance
(
teamTraining
.
getClimbDistance
());
}
}
if
(
GameMode
.
ROOM_MODE
.
equals
(
result
.
getGameMode
()))
{
RoomMode
roomMode
=
roomModeMapper
.
selectById
(
result
.
getSourceId
());
if
(
roomMode
!=
null
)
{
result
.
setCycles
(
roomMode
.
getCycles
());
result
.
setRoomMode
(
roomMode
.
getMode
());
result
.
setEventsDistance
(
roomMode
.
getDistance
());
result
.
setEventsClimbDistance
(
roomMode
.
getClimbDistance
());
}
}
if
(
SportType
.
BICYCLE
.
equals
(
result
.
getSportType
())
&&
(
GameMode
.
SIMPLE_MATCH
.
equals
(
result
.
getGameMode
())
||
GameMode
.
GROUP_TRAINING
.
equals
(
result
.
getGameMode
())
||
GameMode
.
ROOM_MODE
.
equals
(
result
.
getGameMode
())))
{
result
.
setRankList
(
sportUserTrainingLogBusinessMapper
.
getRank
(
result
.
getGameMode
(),
result
.
getSourceId
()));
...
...
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