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
82f0ed5f
Commit
82f0ed5f
authored
Sep 27, 2022
by
liming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
人员编排
parent
c335445c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
2 deletions
+106
-2
SeriesController.java
...ment/api/business/series/controller/SeriesController.java
+19
-2
SeriesBusinessMapper.java
...ment/api/business/series/mapper/SeriesBusinessMapper.java
+11
-0
SeriesService.java
...management/api/business/series/service/SeriesService.java
+45
-0
SeriesBusinessMapper.xml
...src/main/resources/mapper/series/SeriesBusinessMapper.xml
+31
-0
No files found.
management-api/src/main/java/com/antai/sport/http/server/management/api/business/series/controller/SeriesController.java
View file @
82f0ed5f
...
@@ -141,8 +141,7 @@ public class SeriesController {
...
@@ -141,8 +141,7 @@ public class SeriesController {
}
}
@GetMapping
(
"record/result/confirm/status/{recordId}/{status}"
)
@GetMapping
(
"record/result/confirm/status/{recordId}/{status}"
)
public
ResponseEntity
<
Result
>
changeMatchRecordStatus
(
@PathVariable
(
"recordId"
)
Long
recordId
,
public
ResponseEntity
<
Result
>
changeMatchRecordStatus
(
@PathVariable
(
"recordId"
)
Long
recordId
,
@PathVariable
(
"status"
)
Integer
status
)
{
@PathVariable
(
"status"
)
Integer
status
)
{
seriesService
.
changeMatchRecordStatus
(
recordId
,
status
);
seriesService
.
changeMatchRecordStatus
(
recordId
,
status
);
return
success
();
return
success
();
}
}
...
@@ -157,4 +156,22 @@ public class SeriesController {
...
@@ -157,4 +156,22 @@ public class SeriesController {
return
success
(
seriesService
.
getSeriesMatchFinalists
(
dto
));
return
success
(
seriesService
.
getSeriesMatchFinalists
(
dto
));
}
}
@PostMapping
(
"match/candidate"
)
public
ResponseEntity
<
Result
<
SeriesMatchFinalistsPageVO
>>
getKnockoutMatchCandidate
(
@RequestBody
SeriesMatchFinalistsPageDTO
dto
)
{
return
success
(
seriesService
.
getKnockoutMatchCandidate
(
dto
));
}
@GetMapping
(
"match/finalists/{matchId}/{sportUserId}"
)
public
ResponseEntity
<
Result
>
addToFinalists
(
@PathVariable
(
"matchId"
)
Long
matchId
,
@PathVariable
(
"sportUserId"
)
Long
sportUserId
)
{
seriesService
.
addToFinalists
(
matchId
,
sportUserId
);
return
success
();
}
@DeleteMapping
(
"match/finalists/{id}"
)
public
ResponseEntity
<
Result
>
deleteFinalists
(
@PathVariable
(
"id"
)
Long
id
)
{
seriesService
.
deleteFinalists
(
id
);
return
success
();
}
}
}
management-api/src/main/java/com/antai/sport/http/server/management/api/business/series/mapper/SeriesBusinessMapper.java
View file @
82f0ed5f
...
@@ -29,4 +29,15 @@ public interface SeriesBusinessMapper {
...
@@ -29,4 +29,15 @@ public interface SeriesBusinessMapper {
@Param
(
"seriesId"
)
Long
seriesId
,
@Param
(
"seriesId"
)
Long
seriesId
,
@Param
(
"matchId"
)
Long
matchId
,
@Param
(
"matchId"
)
Long
matchId
,
@Param
(
"preRoundId"
)
Long
preRoundId
);
@Param
(
"preRoundId"
)
Long
preRoundId
);
IPage
<
SeriesMatchFinalistsVO
>
getCandidateWithoutQualifying
(
IPage
<
SeriesMatchFinalistsVO
>
page
,
@Param
(
"seriesId"
)
Long
seriesId
,
@Param
(
"roundId"
)
Long
roundId
);
IPage
<
SeriesMatchFinalistsVO
>
getCandidate
(
IPage
<
SeriesMatchFinalistsVO
>
page
,
@Param
(
"seriesId"
)
Long
seriesId
,
@Param
(
"preRoundId"
)
Long
preRoundId
,
@Param
(
"roundId"
)
Long
roundId
);
}
}
management-api/src/main/java/com/antai/sport/http/server/management/api/business/series/service/SeriesService.java
View file @
82f0ed5f
...
@@ -45,6 +45,8 @@ public class SeriesService {
...
@@ -45,6 +45,8 @@ public class SeriesService {
private
SeriesMatchMapper
seriesMatchMapper
;
private
SeriesMatchMapper
seriesMatchMapper
;
@Resource
@Resource
private
SeriesMatchPlayerRecordMapper
seriesMatchPlayerRecordMapper
;
private
SeriesMatchPlayerRecordMapper
seriesMatchPlayerRecordMapper
;
@Resource
private
SeriesMatchFinalistsMapper
seriesMatchFinalistsMapper
;
@Resource
@Resource
private
SeriesConverter
seriesConverter
;
private
SeriesConverter
seriesConverter
;
...
@@ -365,4 +367,47 @@ public class SeriesService {
...
@@ -365,4 +367,47 @@ public class SeriesService {
return
result
;
return
result
;
}
}
public
SeriesMatchFinalistsPageVO
getKnockoutMatchCandidate
(
SeriesMatchFinalistsPageDTO
dto
)
{
SeriesMatchFinalistsPageVO
result
=
new
SeriesMatchFinalistsPageVO
();
result
.
setPageNo
(
dto
.
getPageNo
());
SeriesMatch
match
=
seriesMatchMapper
.
selectById
(
dto
.
getMatchId
());
SeriesRound
round
=
seriesRoundMapper
.
selectById
(
match
.
getRoundId
());
Page
<
SeriesMatchFinalistsVO
>
pageParam
=
new
Page
<>(
dto
.
getPageNo
(),
dto
.
getPageSize
());
IPage
<
SeriesMatchFinalistsVO
>
candidatePage
;
if
(
round
.
getPreRoundId
()
==
null
)
{
pageParam
.
addOrder
(
new
OrderItem
(
"t1.id"
,
true
));
candidatePage
=
seriesBusinessMapper
.
getCandidateWithoutQualifying
(
pageParam
,
round
.
getSeriesId
(),
round
.
getId
());
}
else
{
pageParam
.
addOrder
(
new
OrderItem
(
"t1.duration"
,
true
));
pageParam
.
addOrder
(
new
OrderItem
(
"t1.id"
,
true
));
candidatePage
=
seriesBusinessMapper
.
getCandidate
(
pageParam
,
match
.
getSeriesId
(),
round
.
getPreRoundId
(),
round
.
getId
());
}
result
.
setData
(
candidatePage
.
getRecords
());
result
.
setTotalCount
(
candidatePage
.
getTotal
());
return
result
;
}
public
void
addToFinalists
(
Long
matchId
,
Long
sportUserId
)
{
SeriesMatch
match
=
seriesMatchMapper
.
selectById
(
matchId
);
QueryWrapper
<
SeriesMatchFinalists
>
finalistsQuery
=
new
QueryWrapper
<>();
finalistsQuery
.
lambda
().
eq
(
SeriesMatchFinalists:
:
getRoundId
,
match
.
getRoundId
())
.
eq
(
SeriesMatchFinalists:
:
getSportUserId
,
sportUserId
);
Integer
count
=
seriesMatchFinalistsMapper
.
selectCount
(
finalistsQuery
);
if
(
count
>
0
)
{
throw
new
BusinessException
(
"当前用户已经加入到当前轮次当中,不能重复添加"
);
}
SeriesMatchFinalists
finalists
=
new
SeriesMatchFinalists
();
finalists
.
setMatchId
(
matchId
);
finalists
.
setRoundId
(
match
.
getRoundId
());
finalists
.
setSportUserId
(
sportUserId
);
seriesMatchFinalistsMapper
.
insert
(
finalists
);
}
public
void
deleteFinalists
(
Long
id
)
{
seriesMatchFinalistsMapper
.
deleteById
(
id
);
}
}
}
management-api/src/main/resources/mapper/series/SeriesBusinessMapper.xml
View file @
82f0ed5f
...
@@ -80,4 +80,35 @@
...
@@ -80,4 +80,35 @@
left join series_match_player_record t5 on t5.id = t4.record_id
left join series_match_player_record t5 on t5.id = t4.record_id
where t1.match_id = #{matchId}
where t1.match_id = #{matchId}
</select>
</select>
<select
id=
"getCandidateWithoutQualifying"
resultType=
"com.antai.sport.http.server.management.api.business.series.vo.SeriesMatchFinalistsVO"
>
select t1.sport_user_id,t1.name as real_name,if(t1.sex = 1,'男','女') as sex,
t1.height,t1.weight,t2.name as area,t1.ftp
from series_apply t1
left join series_area t2 on t1.area_id = t2.id
where t1.series_id = #{seriesId}
and t1.sport_user_id not in (
select w1.sport_user_id
from series_match_finalists w1
where w1.round_id = #{roundId}
)
</select>
<select
id=
"getCandidate"
resultType=
"com.antai.sport.http.server.management.api.business.series.vo.SeriesMatchFinalistsVO"
>
select t1.player_id as sport_user_id,t2.name as real_name,
if(t2.sex = 1,'男','女') as sex,t2.height,t2.weight,t3.name as area,
t2.ftp,t1.avg_ftp,t1.one_minutes_ftp as cp1,t1.five_minutes_ftp as cp5,
t1.twenty_minutes_ftp as cp20,t1.duration
from series_match_player_record t1
left join series_apply t2 on t2.series_id = #{seriesId} and t1.player_id = t2.sport_user_id
left join series_area t3 on t2.area_id = t3.id
where t1.result_confirm_status = 40 and t1.round_id = #{preRoundId}
and t1.player_id not in (
select w1.sport_user_id
from series_match_finalists w1
where w1.round_id = #{roundId}
)
</select>
</mapper>
</mapper>
\ No newline at end of file
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