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
22a50adf
Commit
22a50adf
authored
May 25, 2020
by
yangshuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug优化
parent
b36eb861
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
20 deletions
+40
-20
ScoreExcelBean.java
...a/com/dlbridge/jadp/plugins/cmpt/bean/ScoreExcelBean.java
+3
-1
UserScoreExcelBean.java
...m/dlbridge/jadp/plugins/cmpt/bean/UserScoreExcelBean.java
+1
-1
CmptScoreRuleMapper.xml
...idge/jadp/plugins/cmpt/dao/mapper/CmptScoreRuleMapper.xml
+11
-5
ScoreController.java
...a/com/dlbridge/jadp/plugins/cmpt/web/ScoreController.java
+12
-7
application.properties
src/main/resources/application.properties
+1
-1
score.jsp
src/main/webapp/WEB-INF/views/cmpt/score.jsp
+1
-1
score_review.jsp
src/main/webapp/WEB-INF/views/cmpt/score_review.jsp
+6
-3
score.js
src/main/webapp/static/js/score.js
+5
-1
No files found.
src/main/java/com/dlbridge/jadp/plugins/cmpt/bean/ScoreExcelBean.java
View file @
22a50adf
...
@@ -18,10 +18,12 @@ public class ScoreExcelBean {
...
@@ -18,10 +18,12 @@ public class ScoreExcelBean {
private
int
duration
;
private
int
duration
;
//分段里程
//分段里程
private
int
m
ileage
;
private
int
subsectionM
ileage
;
private
String
date
;
private
String
date
;
private
String
insertTime
;
private
List
<
CmptScoreFieldValue
>
fieldValues
;
private
List
<
CmptScoreFieldValue
>
fieldValues
;
}
}
src/main/java/com/dlbridge/jadp/plugins/cmpt/bean/UserScoreExcelBean.java
View file @
22a50adf
src/main/java/com/dlbridge/jadp/plugins/cmpt/dao/mapper/CmptScoreRuleMapper.xml
View file @
22a50adf
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
inner join geerunner.cmpt_enroll enroll on rule.cmpt_id=enroll.cmpt_id
inner join geerunner.cmpt_enroll enroll on rule.cmpt_id=enroll.cmpt_id
and score.mark_no=enroll.nick_id and enroll.del_flg=0
and score.mark_no=enroll.nick_id and enroll.del_flg=0
where rule.cmpt_id=#{cmptId} and rule.id=#{ruleId}
where rule.cmpt_id=#{cmptId} and rule.id=#{ruleId}
and enroll.cmpt_item=#{roadId}
and enroll.cmpt_item=#{roadId}
and score.isDelete=0
</select>
</select>
...
@@ -101,6 +101,8 @@
...
@@ -101,6 +101,8 @@
<result
column=
"date"
property=
"date"
></result>
<result
column=
"date"
property=
"date"
></result>
<result
column=
"ruleId"
property=
"ruleId"
></result>
<result
column=
"ruleId"
property=
"ruleId"
></result>
<result
column=
"duration"
property=
"duration"
></result>
<result
column=
"duration"
property=
"duration"
></result>
<result
column=
"subsectionMileage"
property=
"subsectionMileage"
></result>
<result
column=
"insertTime"
property=
"insertTime"
></result>
<collection
property=
"fieldValues"
columnPrefix=
"field_"
ofType=
"com.dlbridge.jadp.plugins.cmpt.bean.CmptScoreFieldValue"
>
<collection
property=
"fieldValues"
columnPrefix=
"field_"
ofType=
"com.dlbridge.jadp.plugins.cmpt.bean.CmptScoreFieldValue"
>
<id
column=
"fvid"
property=
"id"
></id>
<id
column=
"fvid"
property=
"id"
></id>
<result
column=
"scoreFieldName"
property=
"scoreFieldName"
></result>
<result
column=
"scoreFieldName"
property=
"scoreFieldName"
></result>
...
@@ -111,16 +113,20 @@
...
@@ -111,16 +113,20 @@
<select
id=
"getRoadStatisticByCmptIdAndRoadId"
resultMap=
"userMap"
>
<select
id=
"getRoadStatisticByCmptIdAndRoadId"
resultMap=
"userMap"
>
select enroll.enroll_id user_enroll_id,enroll.member_name user_memberName,enroll.sex user_sex,item.item_name user_itemName,
select enroll.enroll_id user_enroll_id,enroll.member_name user_memberName,
enroll.sex user_sex,item.item_name user_itemName,
enroll.nick_id user_markNo,score.rule_id score_ruleId,
enroll.nick_id user_markNo,score.rule_id score_ruleId,
score.id score_scoreId,score.subsectionscore score_duration,score.subsectionTime score_date,
score.id score_scoreId,score.subsectionscore score_duration,
fv.id score_field_fvid, fv.scoreFieldValue score_field_scoreFieldValue,fv.scoreFieldName score_field_scoreFieldName
DATE_FORMAT(score.subsectionTime,'%Y-%m-%d %H:%i:%s') score_date,DATE_FORMAT(score.insertTime,'%Y-%m-%d %H:%i:%s') score_insertTime,
score.subsectionMileage score_subsectionMileAge,
fv.id score_field_fvid, fv.scoreFieldValue score_field_scoreFieldValue,
fv.scoreFieldName score_field_scoreFieldName
from geerunner.cmpt_enroll enroll
from geerunner.cmpt_enroll enroll
left join gksite.gk_cmpt_score_rule rule on rule.cmpt_id=enroll.cmpt_id
left join gksite.gk_cmpt_score_rule rule on rule.cmpt_id=enroll.cmpt_id
left join gk_cmpt_score_rule_scoreinfo score on rule.id = score.rule_id and score.mark_no = enroll.nick_id
left join gk_cmpt_score_rule_scoreinfo score on rule.id = score.rule_id and score.mark_no = enroll.nick_id
left join geerunner.cmpt_item item on item.item_id = enroll.cmpt_item
left join geerunner.cmpt_item item on item.item_id = enroll.cmpt_item
left join gksite.gk_cmpt_score_field_value fv on fv.rule_id=rule.id and fv.markNo=enroll.nick_id and fv.isDelete=0
left join gksite.gk_cmpt_score_field_value fv on fv.rule_id=rule.id and fv.markNo=enroll.nick_id and fv.isDelete=0
where enroll.cmpt_id=#{cmptId} and enroll.cmpt_item=#{roadId} and enroll.del_flg=0
where enroll.cmpt_id=#{cmptId} and enroll.cmpt_item=#{roadId} and enroll.del_flg=0
and score.isDelete=0
</select>
</select>
<select
id=
"getCmptScoreRulesMapByMarkNoAndScoreId"
resultType=
"java.lang.Integer"
>
<select
id=
"getCmptScoreRulesMapByMarkNoAndScoreId"
resultType=
"java.lang.Integer"
>
...
...
src/main/java/com/dlbridge/jadp/plugins/cmpt/web/ScoreController.java
View file @
22a50adf
...
@@ -277,7 +277,7 @@ public class ScoreController {
...
@@ -277,7 +277,7 @@ public class ScoreController {
// 计算 总成绩 以及 总排名 以及总里程
// 计算 总成绩 以及 总排名 以及总里程
users
.
forEach
(
user
->
{
users
.
forEach
(
user
->
{
long
total
=
user
.
getScores
().
stream
().
mapToLong
(
ScoreExcelBean:
:
getDuration
).
sum
();
long
total
=
user
.
getScores
().
stream
().
mapToLong
(
ScoreExcelBean:
:
getDuration
).
sum
();
int
totalMileage
=
user
.
getScores
().
stream
().
mapToInt
(
ScoreExcelBean:
:
getMileage
).
sum
();
int
totalMileage
=
user
.
getScores
().
stream
().
mapToInt
(
ScoreExcelBean:
:
get
Subsection
Mileage
).
sum
();
// 判断是否完赛
// 判断是否完赛
if
(
user
.
getScores
().
size
()
==
rules
.
size
()){
if
(
user
.
getScores
().
size
()
==
rules
.
size
()){
user
.
setDone
(
true
);
user
.
setDone
(
true
);
...
@@ -339,10 +339,11 @@ public class ScoreController {
...
@@ -339,10 +339,11 @@ public class ScoreController {
row
.
createCell
(
5
).
setCellValue
(
"合计排名"
);
row
.
createCell
(
5
).
setCellValue
(
"合计排名"
);
row
.
createCell
(
6
).
setCellValue
(
"分段成绩"
);
row
.
createCell
(
6
).
setCellValue
(
"分段成绩"
);
row
.
createCell
(
7
).
setCellValue
(
"完成时间"
);
row
.
createCell
(
7
).
setCellValue
(
"完成时间"
);
row
.
createCell
(
8
).
setCellValue
(
"用时"
);
row
.
createCell
(
8
).
setCellValue
(
"提交时间"
);
row
.
createCell
(
9
).
setCellValue
(
"里程"
);
//用户填写的里程数
row
.
createCell
(
9
).
setCellValue
(
"用时"
);
row
.
createCell
(
10
).
setCellValue
(
"里程"
);
//用户填写的里程数
for
(
int
m
=
0
;
m
<
fields
.
size
();
m
++){
for
(
int
m
=
0
;
m
<
fields
.
size
();
m
++){
row
.
createCell
(
1
0
+
m
).
setCellValue
(
fields
.
get
(
m
).
getFieldName
());
row
.
createCell
(
1
1
+
m
).
setCellValue
(
fields
.
get
(
m
).
getFieldName
());
}
}
int
startNum
=
1
;
int
startNum
=
1
;
...
@@ -370,11 +371,12 @@ public class ScoreController {
...
@@ -370,11 +371,12 @@ public class ScoreController {
first
.
ifPresent
(
scoreExcelBean
->
{
first
.
ifPresent
(
scoreExcelBean
->
{
sub
.
createCell
(
6
).
setCellValue
(
"第"
+
sq
+
"次成绩"
);
sub
.
createCell
(
6
).
setCellValue
(
"第"
+
sq
+
"次成绩"
);
sub
.
createCell
(
7
).
setCellValue
(
scoreExcelBean
.
getDate
());
sub
.
createCell
(
7
).
setCellValue
(
scoreExcelBean
.
getDate
());
sub
.
createCell
(
8
).
setCellValue
(
DateUtil
.
formatDate
(
scoreExcelBean
.
getDuration
()));
sub
.
createCell
(
8
).
setCellValue
(
scoreExcelBean
.
getInsertTime
());
sub
.
createCell
(
9
).
setCellValue
(
scoreExcelBean
.
getMileage
());
sub
.
createCell
(
9
).
setCellValue
(
DateUtil
.
formatDate
(
scoreExcelBean
.
getDuration
()));
sub
.
createCell
(
10
).
setCellValue
(
String
.
format
(
"%.3f"
,
scoreExcelBean
.
getSubsectionMileage
()/
1000.0
)+
"KM"
);
List
<
CmptScoreFieldValue
>
fieldValues
=
scoreExcelBean
.
getFieldValues
();
List
<
CmptScoreFieldValue
>
fieldValues
=
scoreExcelBean
.
getFieldValues
();
for
(
int
m
=
0
;
m
<
fieldValues
.
size
();
m
++){
for
(
int
m
=
0
;
m
<
fieldValues
.
size
();
m
++){
sub
.
createCell
(
1
0
+
m
).
setCellValue
(
fieldValues
.
get
(
m
).
getScoreFieldValue
());
sub
.
createCell
(
1
1
+
m
).
setCellValue
(
fieldValues
.
get
(
m
).
getScoreFieldValue
());
}
}
});
});
...
@@ -426,4 +428,7 @@ public class ScoreController {
...
@@ -426,4 +428,7 @@ public class ScoreController {
}
}
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
String
.
format
(
"%.4f"
,
102.102918110f
)+
"KM"
);
}
}
}
src/main/resources/application.properties
View file @
22a50adf
spring.profiles.active
=
test
spring.profiles.active
=
dev
src/main/webapp/WEB-INF/views/cmpt/score.jsp
View file @
22a50adf
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
<h3
class=
"title"
>
上传次数
</h3>
<h3
class=
"title"
>
上传次数
</h3>
<div>
<div>
<label
for=
""
class=
"tip"
>
比赛期间上传成绩次数
</label>
<label
for=
""
class=
"tip"
>
比赛期间上传成绩次数
</label>
<input
type=
"number"
class=
"count-input"
placeholder=
"请填写上传次数"
value=
"${fn:length(rules)}"
>
<input
type=
"number"
class=
"count-input"
placeholder=
"请填写上传次数"
value=
"${fn:length(rules)}"
data-value=
"${fn:length(rules)}"
>
</div>
</div>
<div
id=
"rule-section"
style=
"margin-bottom: 15px"
>
<div
id=
"rule-section"
style=
"margin-bottom: 15px"
>
<c:forEach
var=
"item"
items=
"
${
rules
}
"
varStatus=
"vs"
>
<c:forEach
var=
"item"
items=
"
${
rules
}
"
varStatus=
"vs"
>
...
...
src/main/webapp/WEB-INF/views/cmpt/score_review.jsp
View file @
22a50adf
...
@@ -139,7 +139,7 @@
...
@@ -139,7 +139,7 @@
.data-cloumn
span
,
.score-info
span
{
.data-cloumn
span
,
.score-info
span
{
display
:
inline-block
;
display
:
inline-block
;
width
:
1
20
px
;
width
:
1
05
px
;
height
:
45px
;
height
:
45px
;
line-height
:
45px
;
line-height
:
45px
;
font-size
:
16px
;
font-size
:
16px
;
...
@@ -259,8 +259,9 @@
...
@@ -259,8 +259,9 @@
background-position
:
center
;
background-position
:
center
;
background-repeat
:
no-repeat
;
background-repeat
:
no-repeat
;
right
:
0px
;
right
:
0px
;
z-index
:
100
;
z-index
:
99
;
top
:
0px
;
top
:
0px
;
background-size
:
contain
;
}
}
.iconClose
{
.iconClose
{
position
:
absolute
;
position
:
absolute
;
...
@@ -354,6 +355,7 @@
...
@@ -354,6 +355,7 @@
<span>
姓名
</span>
<span>
姓名
</span>
<span>
参赛号码
</span>
<span>
参赛号码
</span>
<span>
上传时间
</span>
<span>
上传时间
</span>
<span>
完成时间
</span>
<span>
里程(KM)
</span>
<span>
里程(KM)
</span>
<span>
用时
</span>
<span>
用时
</span>
<span>
平均配速
</span>
<span>
平均配速
</span>
...
@@ -365,6 +367,7 @@
...
@@ -365,6 +367,7 @@
<div
class=
"score-info"
>
<div
class=
"score-info"
>
<span
v-text=
"score.name"
></span>
<span
v-text=
"score.name"
></span>
<span
v-text=
"score.markNo"
></span>
<span
v-text=
"score.markNo"
></span>
<span>
{{score.updateTime | substr(10)}}
</span>
<span>
{{score.subsectionTime | substr(10)}}
</span>
<span>
{{score.subsectionTime | substr(10)}}
</span>
<span>
{{Number(score.subsectionMileage/1000).toFixed(3)}}
</span>
<span>
{{Number(score.subsectionMileage/1000).toFixed(3)}}
</span>
<span>
{{score.subsectionscore | date_format}}
</span>
<span>
{{score.subsectionscore | date_format}}
</span>
...
@@ -390,7 +393,7 @@
...
@@ -390,7 +393,7 @@
<div
id=
"dialog"
v-show=
"dialog"
>
<div
id=
"dialog"
v-show=
"dialog"
>
<div
style=
"position: relative;"
class=
"preview"
>
<div
style=
"position: relative;"
class=
"preview"
>
<img
width=
"
100%
"
height=
"100%"
v-bind:src=
"previewImg"
alt=
""
>
<img
width=
"
auto
"
height=
"100%"
v-bind:src=
"previewImg"
alt=
""
>
<span
v-on:click=
"closeDialog"
class=
"iconClose"
></span>
<span
v-on:click=
"closeDialog"
class=
"iconClose"
></span>
</div>
</div>
</div>
</div>
...
...
src/main/webapp/static/js/score.js
View file @
22a50adf
...
@@ -36,10 +36,12 @@ $(document).ready(function () {
...
@@ -36,10 +36,12 @@ $(document).ready(function () {
var
result
=
data
.
content
;
var
result
=
data
.
content
;
if
(
!
result
.
user
){
if
(
!
result
.
user
){
layer
.
msg
(
"未查到人员信息"
);
layer
.
msg
(
"未查到人员信息"
);
$
(
'#data thead'
).
hide
();
$
(
'#score-body'
).
empty
();
return
;
return
;
}
}
$
(
'#score-body'
).
empty
();
if
(
result
.
scores
.
length
>
0
){
if
(
result
.
scores
.
length
>
0
){
$
(
'#data thead'
).
fadeIn
();
$
(
'#data'
).
fadeIn
();
$
(
'#data'
).
fadeIn
();
$
(
'#score-body'
).
append
(
'<tr>'
+
$
(
'#score-body'
).
append
(
'<tr>'
+
'<td>'
+
result
.
user
.
userName
+
'</td>'
+
'<td>'
+
result
.
user
.
userName
+
'</td>'
+
...
@@ -172,6 +174,7 @@ $(document).ready(function () {
...
@@ -172,6 +174,7 @@ $(document).ready(function () {
$
(
'.count-input'
).
keyup
(
function
()
{
$
(
'.count-input'
).
keyup
(
function
()
{
if
(
$
(
'.save-btn'
).
length
==
0
){
if
(
$
(
'.save-btn'
).
length
==
0
){
layer
.
alert
(
'比赛已经开始,不能修改规则!'
);
layer
.
alert
(
'比赛已经开始,不能修改规则!'
);
$
(
'.count-input'
).
val
(
$
(
'.count-input'
).
attr
(
'data-value'
))
return
;
return
;
}
}
var
value
=
$
(
this
).
val
();
var
value
=
$
(
this
).
val
();
...
@@ -183,6 +186,7 @@ $(document).ready(function () {
...
@@ -183,6 +186,7 @@ $(document).ready(function () {
layer
.
msg
(
'请输入大于0的数字!'
);
layer
.
msg
(
'请输入大于0的数字!'
);
return
;
return
;
}
}
$
(
'.count-input'
).
attr
(
'data-value'
,
value
);
var
rules
=
$
(
'#rule-section .rule-item'
);
var
rules
=
$
(
'#rule-section .rule-item'
);
if
(
value
>
rules
.
length
){
if
(
value
>
rules
.
length
){
for
(
var
i
=
0
;
i
<
value
-
rules
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
value
-
rules
.
length
;
i
++
){
...
...
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