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
ba138579
Commit
ba138579
authored
Jul 10, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
骑行日志增加 源头名称
parent
2bf58d5a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
17 deletions
+24
-17
SportUserTrainingLog.java
.../server/repository/sport/entity/SportUserTrainingLog.java
+10
-0
RoomModeService.java
...server/api/business/roommode/service/RoomModeService.java
+2
-2
SimpleMatchService.java
.../api/business/simplematch/service/SimpleMatchService.java
+5
-9
TeamTrainingService.java
...pi/business/teamtraining/service/TeamTrainingService.java
+1
-2
TourService.java
.../server/server/api/business/tour/service/TourService.java
+1
-2
SportUserTrainingLogVO.java
.../api/business/traininglog/dto/SportUserTrainingLogVO.java
+2
-0
SportUserTrainingLogService.java
...ness/traininglog/service/SportUserTrainingLogService.java
+2
-1
SportUserTrainingLogBusinessMapper.xml
...mapper/traininglog/SportUserTrainingLogBusinessMapper.xml
+1
-1
No files found.
repository/src/main/java/com/antai/sport/http/server/repository/sport/entity/SportUserTrainingLog.java
View file @
ba138579
...
...
@@ -50,6 +50,11 @@ public class SportUserTrainingLog implements Serializable {
*/
private
Long
sourceId
;
/**
* 源头名称 比如比赛名称 团练名称 娱乐赛房间名称
*/
private
String
sourceName
;
/**
* 运动记录id
*/
...
...
@@ -114,6 +119,11 @@ public class SportUserTrainingLog implements Serializable {
*/
private
Integer
praiseNum
;
/**
* fit文件url地址
*/
private
String
fitUrl
;
/**
* 创建日期不带时分秒
*/
...
...
server-api/src/main/java/com/antai/sport/http/server/server/api/business/roommode/service/RoomModeService.java
View file @
ba138579
...
...
@@ -84,7 +84,7 @@ public class RoomModeService {
public
void
upload
(
List
<
CyclingDataDTO
>
dataList
)
{
dataList
.
forEach
(
item
->
{
RoomModePlayerRecord
oldRecord
=
roomModePlayerRecordMapper
.
selectById
(
item
.
getRecordId
());
if
(
oldRecord
.
getStatus
().
equals
(
RoomModeRecordStatus
.
UNFINISHED
))
{
if
(
oldRecord
.
getStatus
().
equals
(
RoomModeRecordStatus
.
UNFINISHED
))
{
SportUser
user
=
sportUserMapper
.
selectById
(
oldRecord
.
getPlayerId
());
item
.
setWeight
(
user
.
getWeight
());
RoomModePlayerRecord
record
=
roomModeConverter
.
toRoomModePlayerRecord
(
item
,
RoomModeRecordStatus
.
FINISHED
);
...
...
@@ -93,7 +93,7 @@ public class RoomModeService {
//生成骑行日志
RoomMode
roomMode
=
roomModeMapper
.
selectById
(
oldRecord
.
getRoomId
());
sportUserTrainingLogService
.
createBicycleTrainingLog
(
oldRecord
.
getPlayerId
(),
GameMode
.
ROOM_MODE
,
oldRecord
.
getId
(),
roomMode
.
getMap
(),
roomMode
.
getPath
(),
0
,
item
);
roomMode
.
getId
(),
roomMode
.
getName
(),
roomMode
.
getMap
(),
roomMode
.
getPath
(),
0
,
item
);
}
});
}
...
...
server-api/src/main/java/com/antai/sport/http/server/server/api/business/simplematch/service/SimpleMatchService.java
View file @
ba138579
...
...
@@ -62,18 +62,15 @@ public class SimpleMatchService {
throw
new
BusinessException
(
"比赛名称不能为空"
);
}
if
(
initData
.
getEntryTime
()
==
null
||
initData
.
getStartTime
()
==
null
||
initData
.
getEndTime
()
==
null
)
{
if
(
initData
.
getEntryTime
()
==
null
||
initData
.
getStartTime
()
==
null
||
initData
.
getEndTime
()
==
null
)
{
throw
new
BusinessException
(
"所有输入时间不能为空"
);
}
if
(
initData
.
getEntryTime
().
equals
(
initData
.
getStartTime
())
||
initData
.
getEntryTime
().
isAfter
(
initData
.
getStartTime
()))
{
if
(
initData
.
getEntryTime
().
equals
(
initData
.
getStartTime
())
||
initData
.
getEntryTime
().
isAfter
(
initData
.
getStartTime
()))
{
throw
new
BusinessException
(
"允许进入时间必须早于比赛开始时间"
);
}
if
(
initData
.
getStartTime
().
equals
(
initData
.
getEndTime
())
||
initData
.
getStartTime
().
isAfter
(
initData
.
getEndTime
()))
{
if
(
initData
.
getStartTime
().
equals
(
initData
.
getEndTime
())
||
initData
.
getStartTime
().
isAfter
(
initData
.
getEndTime
()))
{
throw
new
BusinessException
(
"比赛开始时间必须早于比赛结束时间"
);
}
...
...
@@ -88,8 +85,7 @@ public class SimpleMatchService {
*/
public
List
<
RespSimpleMatchBanner
>
getSimpleMatchBannerList
()
{
QueryWrapper
<
SimpleMatchBanner
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"deleted"
,
DeleteStatus
.
UNDELETED
)
.
orderBy
(
true
,
true
,
"show_order"
);
queryWrapper
.
eq
(
"deleted"
,
DeleteStatus
.
UNDELETED
).
orderBy
(
true
,
true
,
"show_order"
);
List
<
SimpleMatchBanner
>
bannerList
=
simpleMatchBannerMapper
.
selectList
(
queryWrapper
);
return
simpleMatchConverter
.
toRespBannerList
(
bannerList
);
}
...
...
@@ -195,7 +191,7 @@ public class SimpleMatchService {
//生成骑行日志
SimpleMatch
match
=
simpleMatchMapper
.
selectById
(
oldRecord
.
getMatchId
());
sportUserTrainingLogService
.
createBicycleTrainingLog
(
oldRecord
.
getPlayerId
(),
GameMode
.
SIMPLE_MATCH
,
oldRecord
.
getId
(),
match
.
getMap
(),
match
.
getPath
(),
record
.
getPraiseNum
(),
item
);
match
.
getId
(),
match
.
getName
(),
match
.
getMap
(),
match
.
getPath
(),
record
.
getPraiseNum
(),
item
);
}
});
}
...
...
server-api/src/main/java/com/antai/sport/http/server/server/api/business/teamtraining/service/TeamTrainingService.java
View file @
ba138579
...
...
@@ -4,7 +4,6 @@ import com.antai.sport.http.server.common.exception.BusinessException;
import
com.antai.sport.http.server.constants.DeleteStatus
;
import
com.antai.sport.http.server.constants.GameMode
;
import
com.antai.sport.http.server.constants.SportType
;
import
com.antai.sport.http.server.repository.simplematch.entity.SimpleMatch
;
import
com.antai.sport.http.server.repository.sport.entity.SportUser
;
import
com.antai.sport.http.server.repository.sport.mapper.SportUserMapper
;
import
com.antai.sport.http.server.repository.teamtraining.entity.*
;
...
...
@@ -186,7 +185,7 @@ public class TeamTrainingService {
//生成骑行日志
TeamTraining
teamTraining
=
teamTrainingMapper
.
selectById
(
oldRecord
.
getTeamTrainingId
());
sportUserTrainingLogService
.
createBicycleTrainingLog
(
oldRecord
.
getPlayerId
(),
GameMode
.
GROUP_TRAINING
,
oldRecord
.
getId
(),
teamTraining
.
getMap
(),
teamTraining
.
getPath
(),
record
.
getPraiseNum
(),
item
);
teamTraining
.
getId
(),
teamTraining
.
getName
(),
teamTraining
.
getMap
(),
teamTraining
.
getPath
(),
record
.
getPraiseNum
(),
item
);
}
});
}
...
...
server-api/src/main/java/com/antai/sport/http/server/server/api/business/tour/service/TourService.java
View file @
ba138579
...
...
@@ -17,7 +17,6 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.math.RoundingMode
;
import
java.time.LocalDateTime
;
import
java.util.List
;
...
...
@@ -77,7 +76,7 @@ public class TourService {
//生成骑行日志
sportUserTrainingLogService
.
createBicycleTrainingLog
(
oldRecord
.
getPlayerId
(),
GameMode
.
TOUR
,
oldRecord
.
getId
(),
oldRecord
.
getMap
(),
oldRecord
.
getPath
(),
tourRecord
.
getPraiseNum
(),
item
);
oldRecord
.
getId
(),
null
,
oldRecord
.
getMap
(),
oldRecord
.
getPath
(),
tourRecord
.
getPraiseNum
(),
item
);
}
});
}
...
...
server-api/src/main/java/com/antai/sport/http/server/server/api/business/traininglog/dto/SportUserTrainingLogVO.java
View file @
ba138579
...
...
@@ -19,6 +19,8 @@ public class SportUserTrainingLogVO {
private
Long
playerId
;
@ApiModelProperty
(
"主数据id 如比赛为比赛id 房间模式为房间id 漫游为漫游记录id"
)
private
Long
sourceId
;
@ApiModelProperty
(
"源头名称"
)
private
String
sourceName
;
@ApiModelProperty
(
"运动记录Id"
)
private
Long
recordId
;
@ApiModelProperty
(
"地图名称"
)
...
...
server-api/src/main/java/com/antai/sport/http/server/server/api/business/traininglog/service/SportUserTrainingLogService.java
View file @
ba138579
...
...
@@ -65,12 +65,13 @@ public class SportUserTrainingLogService {
@Resource
private
SportUserConverter
sportUserConverter
;
public
void
createBicycleTrainingLog
(
Long
playerId
,
Integer
gameMode
,
Long
sourceId
,
String
map
,
String
path
,
Integer
praiseNum
,
CyclingDataDTO
sportData
)
{
public
void
createBicycleTrainingLog
(
Long
playerId
,
Integer
gameMode
,
Long
sourceId
,
String
sourceName
,
String
map
,
String
path
,
Integer
praiseNum
,
CyclingDataDTO
sportData
)
{
SportUserTrainingLog
log
=
sportUserTrainingLogConverter
.
toSportUserTrainingLog
(
sportData
);
log
.
setSportType
(
SportType
.
BICYCLE
);
log
.
setGameMode
(
gameMode
);
log
.
setPlayerId
(
playerId
);
log
.
setSourceId
(
sourceId
);
log
.
setSourceName
(
sourceName
);
log
.
setMap
(
map
);
log
.
setPath
(
path
);
log
.
setPraiseNum
(
praiseNum
);
...
...
server-api/src/main/resources/mapper/traininglog/SportUserTrainingLogBusinessMapper.xml
View file @
ba138579
...
...
@@ -16,7 +16,7 @@
</select>
<select
id=
"getSportUserTrainingLog"
resultType=
"com.antai.sport.http.server.server.api.business.traininglog.dto.SportUserTrainingLogVO"
>
select t1.sport_type,t1.game_mode,t1.player_id,t1.source_id,t1.record_id,
select t1.sport_type,t1.game_mode,t1.player_id,t1.source_id,t1.
source_name,t1.
record_id,
t2.map_name,t3.path_name,t1.calorie,t1.duration,t1.match_rank,
t1.distance,t1.climb_distance,t1.avg_ftp,t1.avg_speed,t1.praise_num,t1.create_time
from sport_user_training_log t1
...
...
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