Commit e2c9b856 authored by sunyuhua's avatar sunyuhua

1/添加里程

2/二维码
parent 498cbe94
...@@ -17,6 +17,7 @@ public class ScoreItem { ...@@ -17,6 +17,7 @@ public class ScoreItem {
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")
private String subsectionTime; private String subsectionTime;
private Integer subsectionscore; private Integer subsectionscore;
private Integer subsectionMileage;
private Integer subsectionRankNo; private Integer subsectionRankNo;
private String subsectionRemark; private String subsectionRemark;
private Integer isDelete; private Integer isDelete;
......
...@@ -24,6 +24,8 @@ public class FuncSetting { ...@@ -24,6 +24,8 @@ public class FuncSetting {
private Integer news; private Integer news;
@ApiModelProperty(value = "轮播开关") @ApiModelProperty(value = "轮播开关")
private Integer banner; private Integer banner;
@ApiModelProperty(value = "里程开关,小程序成绩提交页面")
private Integer mileage;
@JsonIgnore @JsonIgnore
private String newsAlias; private String newsAlias;
} }
...@@ -22,4 +22,8 @@ public class Score { ...@@ -22,4 +22,8 @@ public class Score {
private String durationStr; private String durationStr;
private int mileage;
private String mileageStr;
} }
...@@ -14,8 +14,12 @@ public class ScoreExcelBean { ...@@ -14,8 +14,12 @@ public class ScoreExcelBean {
// 分段ID // 分段ID
private int ruleId; private int ruleId;
//分段耗时
private int duration; private int duration;
//分段里程
private int mileage;
private String date; private String date;
private List<CmptScoreFieldValue> fieldValues; private List<CmptScoreFieldValue> fieldValues;
......
...@@ -17,6 +17,10 @@ public class UserScoreExcelBean { ...@@ -17,6 +17,10 @@ public class UserScoreExcelBean {
private String durationStr; private String durationStr;
private int totalMileage;
private String mileageStr;
private int rankNo; private int rankNo;
private boolean isDone; private boolean isDone;
...@@ -101,6 +105,22 @@ public class UserScoreExcelBean { ...@@ -101,6 +105,22 @@ public class UserScoreExcelBean {
this.noDuration = noDuration; 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 @Override
public String toString() { public String toString() {
return "UserScoreExcelBean{" + return "UserScoreExcelBean{" +
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<mapper namespace="com.dlbridge.jadp.plugins.cmpt.dao.mapper.FuncSettingMapper"> <mapper namespace="com.dlbridge.jadp.plugins.cmpt.dao.mapper.FuncSettingMapper">
<insert id="saveSetting"> <insert id="saveSetting">
insert into gk_cmpt_func(cmpt_id,switch_mobile,switch_countdown,switch_news,switch_banner,create_date) 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}, now()) values (#{setting.cmptId},#{setting.mobile},#{setting.countDown},#{setting.news},#{setting.banner},#{setting.mileage},now())
</insert> </insert>
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
<if test="setting.newsAlias != null"> <if test="setting.newsAlias != null">
news_alias=#{setting.newsAlias} news_alias=#{setting.newsAlias}
</if> </if>
<if test="setting.mileage != null">
switch_mileage=#{setting.mileage}
</if>
</set> </set>
where cmpt_id = #{setting.cmptId} where cmpt_id = #{setting.cmptId}
</update> </update>
...@@ -33,7 +36,7 @@ ...@@ -33,7 +36,7 @@
<select id="getSettingByCmptId" resultType="com.dlbridge.jadp.plugins.cmpt.bean.FuncSetting"> <select id="getSettingByCmptId" resultType="com.dlbridge.jadp.plugins.cmpt.bean.FuncSetting">
select cmpt_id cmptId,switch_mobile mobile, select cmpt_id cmptId,switch_mobile mobile,
switch_countdown countdown, 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 from gk_cmpt_func
where cmpt_id=#{cmptId} where cmpt_id=#{cmptId}
</select> </select>
......
...@@ -44,4 +44,24 @@ public class FuncSettingController { ...@@ -44,4 +44,24 @@ public class FuncSettingController {
funcSettingService.updateSetting(setting); funcSettingService.updateSetting(setting);
return Result.success(); 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 { ...@@ -849,7 +849,7 @@ public class MicroApiController {
} }
ScoreItem scoreItem = new ScoreItem() ScoreItem scoreItem = new ScoreItem()
.setSubsectionscore(score.getScore().getDuration()) .setSubsectionscore(score.getScore().getDuration()).setSubsectionMileage(score.getScore().getMileage())
.setSubsectionTime(score.getScore().getDate()) .setSubsectionTime(score.getScore().getDate())
.setCmptId(score.getCmptId()) .setCmptId(score.getCmptId())
.setCmptScoreId(1); .setCmptScoreId(1);
...@@ -1027,4 +1027,13 @@ public class MicroApiController { ...@@ -1027,4 +1027,13 @@ public class MicroApiController {
return Result.success().setContent(roadTimerCheckpointList); 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 { ...@@ -265,7 +265,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();
// 判断是否完赛 // 判断是否完赛
if(user.getScores().size() == rules.size()){ if(user.getScores().size() == rules.size()){
user.setDone(true); user.setDone(true);
...@@ -274,6 +274,8 @@ public class ScoreController { ...@@ -274,6 +274,8 @@ public class ScoreController {
} }
user.setTotalDuration(total); user.setTotalDuration(total);
user.setDurationStr(DateUtil.formatDate(total)); user.setDurationStr(DateUtil.formatDate(total));
user.setTotalMileage(totalMileage);
user.setMileageStr(String.valueOf(totalMileage/1000));
}); });
// 一条成绩没有的 // 一条成绩没有的
......
...@@ -152,9 +152,6 @@ ...@@ -152,9 +152,6 @@
left: 50%; left: 50%;
margin-left: -69px; margin-left: -69px;
} }
.QRCodeDown{
display: none;
}
</style> </style>
</head> </head>
<body> <body>
......
...@@ -167,6 +167,20 @@ ...@@ -167,6 +167,20 @@
</tbody> </tbody>
</table> </table>
</div> </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>
</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