Commit e2c9b856 authored by sunyuhua's avatar sunyuhua

1/添加里程

2/二维码
parent 498cbe94
......@@ -17,6 +17,7 @@ public class ScoreItem {
@JsonFormat(pattern = "yyyy-MM-dd")
private String subsectionTime;
private Integer subsectionscore;
private Integer subsectionMileage;
private Integer subsectionRankNo;
private String subsectionRemark;
private Integer isDelete;
......
......@@ -24,6 +24,8 @@ public class FuncSetting {
private Integer news;
@ApiModelProperty(value = "轮播开关")
private Integer banner;
@ApiModelProperty(value = "里程开关,小程序成绩提交页面")
private Integer mileage;
@JsonIgnore
private String newsAlias;
}
......@@ -22,4 +22,8 @@ public class Score {
private String durationStr;
private int mileage;
private String mileageStr;
}
......@@ -14,8 +14,12 @@ public class ScoreExcelBean {
// 分段ID
private int ruleId;
//分段耗时
private int duration;
//分段里程
private int mileage;
private String date;
private List<CmptScoreFieldValue> fieldValues;
......
......@@ -17,6 +17,10 @@ public class UserScoreExcelBean {
private String durationStr;
private int totalMileage;
private String mileageStr;
private int rankNo;
private boolean isDone;
......@@ -101,6 +105,22 @@ public class UserScoreExcelBean {
this.noDuration = noDuration;
}
public int getTotalMileage() {
return totalMileage;
}
public void setTotalMileage(int totalMileage) {
this.totalMileage = totalMileage;
}
public String getMileageStr() {
return mileageStr;
}
public void setMileageStr(String mileageStr) {
this.mileageStr = mileageStr;
}
@Override
public String toString() {
return "UserScoreExcelBean{" +
......
......@@ -3,8 +3,8 @@
<mapper namespace="com.dlbridge.jadp.plugins.cmpt.dao.mapper.FuncSettingMapper">
<insert id="saveSetting">
insert into gk_cmpt_func(cmpt_id,switch_mobile,switch_countdown,switch_news,switch_banner,create_date)
values (#{setting.cmptId},#{setting.mobile},#{setting.countDown},#{setting.news},#{setting.banner}, now())
insert into gk_cmpt_func(cmpt_id,switch_mobile,switch_countdown,switch_news,switch_banner,switch_mileage,create_date)
values (#{setting.cmptId},#{setting.mobile},#{setting.countDown},#{setting.news},#{setting.banner},#{setting.mileage},now())
</insert>
......@@ -26,6 +26,9 @@
<if test="setting.newsAlias != null">
news_alias=#{setting.newsAlias}
</if>
<if test="setting.mileage != null">
switch_mileage=#{setting.mileage}
</if>
</set>
where cmpt_id = #{setting.cmptId}
</update>
......@@ -33,7 +36,7 @@
<select id="getSettingByCmptId" resultType="com.dlbridge.jadp.plugins.cmpt.bean.FuncSetting">
select cmpt_id cmptId,switch_mobile mobile,
switch_countdown countdown,
switch_news news,switch_banner banner,news_alias newsAlias
switch_news news,switch_banner banner,news_alias newsAlias,switch_mileage mileage
from gk_cmpt_func
where cmpt_id=#{cmptId}
</select>
......
......@@ -44,4 +44,24 @@ public class FuncSettingController {
funcSettingService.updateSetting(setting);
return Result.success();
}
/**
* 后台成绩提交页面,设置是否在成绩提交页面显示里程
* @param cmptId
* @param mileage
* @return
*/
@RequestMapping("/upMileage/{cmptId}/{mileage}")
public Result upMileage(@PathVariable("cmptId") int cmptId,@PathVariable("mileage") int mileage){
FuncSetting setting=new FuncSetting();
setting.setCmptId(cmptId);
setting.setMileage(mileage);
FuncSetting settingByCmptId = funcSettingService.getSettingByCmptId(cmptId);
if (settingByCmptId == null) {
funcSettingService.saveSetting(setting);
}else {
funcSettingService.updateSetting(setting);
}
return Result.success();
}
}
......@@ -849,7 +849,7 @@ public class MicroApiController {
}
ScoreItem scoreItem = new ScoreItem()
.setSubsectionscore(score.getScore().getDuration())
.setSubsectionscore(score.getScore().getDuration()).setSubsectionMileage(score.getScore().getMileage())
.setSubsectionTime(score.getScore().getDate())
.setCmptId(score.getCmptId())
.setCmptScoreId(1);
......@@ -1027,4 +1027,13 @@ public class MicroApiController {
return Result.success().setContent(roadTimerCheckpointList);
}
@GetMapping(value = "/getSwitchMileage/{cmptId}")
@ApiResponses({
@ApiResponse(code = -1, message = "失败", response = ObjectUtils.Null.class),
@ApiResponse(code = 200, message = "成功", response = Result.class, responseContainer = "List")})
@ApiOperation(value = "根据赛事Id获取用户是否设置了成绩提交附加项:里程必填项", notes = "根据赛事Id获取用户是否设置了成绩提交附加项:里程必填项", tags = "根据赛事Id获取用户是否设置了成绩提交附加项:里程必填项")
public Result getSwitchMileage(@PathVariable("cmptId") int cmptId){
FuncSetting settingByCmptId = funcSettingService.getSettingByCmptId(cmptId);
return Result.success().setContent(settingByCmptId);
}
}
......@@ -265,7 +265,7 @@ public class ScoreController {
// 计算 总成绩 以及 总排名
users.forEach(user -> {
long total = user.getScores().stream().mapToLong(ScoreExcelBean::getDuration).sum();
int totalMileage = user.getScores().stream().mapToInt(ScoreExcelBean::getMileage).sum();
// 判断是否完赛
if(user.getScores().size() == rules.size()){
user.setDone(true);
......@@ -274,6 +274,8 @@ public class ScoreController {
}
user.setTotalDuration(total);
user.setDurationStr(DateUtil.formatDate(total));
user.setTotalMileage(totalMileage);
user.setMileageStr(String.valueOf(totalMileage/1000));
});
// 一条成绩没有的
......
......@@ -152,9 +152,6 @@
left: 50%;
margin-left: -69px;
}
.QRCodeDown{
display: none;
}
</style>
</head>
<body>
......
......@@ -167,6 +167,20 @@
</tbody>
</table>
</div>
<!--成绩附加项-->
<div class="section">
<h3 class="title">成绩附加项</h3>
<div style="line-height: 22px">
<span class="road-notice"></span>
<span class="road-notice-txt">每一个附加项在每次成绩上传时均为必填,请谨慎启用</span>
</div>
<div class="add-btn">
<span>+</span>
<span>添加照片项</span>
</div>
</div>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment