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
97c0ab9e
Commit
97c0ab9e
authored
Apr 12, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
生成日常赛归集日志
parent
32e7b583
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
SimpleMatchService.java
.../api/business/simplematch/service/SimpleMatchService.java
+16
-3
No files found.
server-api/src/main/java/com/antai/sport/http/server/server/api/business/simplematch/service/SimpleMatchService.java
View file @
97c0ab9e
...
@@ -16,9 +16,11 @@ import com.antai.sport.http.server.server.api.business.praise.service.PraiseServ
...
@@ -16,9 +16,11 @@ import com.antai.sport.http.server.server.api.business.praise.service.PraiseServ
import
com.antai.sport.http.server.server.api.business.simplematch.converter.SimpleMatchConverter
;
import
com.antai.sport.http.server.server.api.business.simplematch.converter.SimpleMatchConverter
;
import
com.antai.sport.http.server.server.api.business.simplematch.dto.*
;
import
com.antai.sport.http.server.server.api.business.simplematch.dto.*
;
import
com.antai.sport.http.server.server.api.business.simplematch.mapper.SimpleMatchBusinessMapper
;
import
com.antai.sport.http.server.server.api.business.simplematch.mapper.SimpleMatchBusinessMapper
;
import
com.antai.sport.http.server.server.api.business.traininglog.service.SportUserTrainingLogService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
...
@@ -43,6 +45,8 @@ public class SimpleMatchService {
...
@@ -43,6 +45,8 @@ public class SimpleMatchService {
@Resource
@Resource
private
PraiseService
praiseService
;
private
PraiseService
praiseService
;
@Resource
private
SportUserTrainingLogService
sportUserTrainingLogService
;
/**
/**
* 创建比赛
* 创建比赛
...
@@ -173,11 +177,20 @@ public class SimpleMatchService {
...
@@ -173,11 +177,20 @@ public class SimpleMatchService {
/**
/**
* 比赛记录上传
* 比赛记录上传
*/
*/
@Transactional
public
void
recordUpload
(
List
<
ReqSimpleMatchRecord
>
dataList
)
{
public
void
recordUpload
(
List
<
ReqSimpleMatchRecord
>
dataList
)
{
dataList
.
forEach
(
item
->
{
dataList
.
forEach
(
item
->
{
SimpleMatchPlayerRecord
record
=
simpleMatchConverter
.
toSimpleMatchPlayerRecord
(
item
);
SimpleMatchPlayerRecord
oldRecord
=
simpleMatchPlayerRecordMapper
.
selectById
(
item
.
getRecordId
());
record
.
setPraiseNum
(
praiseService
.
getPraiseByGameModeAndRecordId
(
GameMode
.
SIMPLE_MATCH
,
item
.
getRecordId
()));
if
(
oldRecord
.
getStatus
()
==
null
)
{
simpleMatchPlayerRecordMapper
.
updateById
(
record
);
SimpleMatchPlayerRecord
record
=
simpleMatchConverter
.
toSimpleMatchPlayerRecord
(
item
);
record
.
setPraiseNum
(
praiseService
.
getPraiseByGameModeAndRecordId
(
GameMode
.
SIMPLE_MATCH
,
item
.
getRecordId
()));
simpleMatchPlayerRecordMapper
.
updateById
(
record
);
//生成骑行日志
SimpleMatch
match
=
simpleMatchMapper
.
selectById
(
oldRecord
.
getMatchId
());
sportUserTrainingLogService
.
createBicycleTrainingLog
(
oldRecord
.
getPlayerId
(),
GameMode
.
SIMPLE_MATCH
,
oldRecord
.
getId
(),
match
.
getMap
(),
match
.
getPath
(),
record
.
getPraiseNum
(),
item
);
}
});
});
}
}
...
...
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