Commit 9dd3899d authored by sunyuhua's avatar sunyuhua

扫码打卡

添加里程
parent d36320b4
...@@ -22,8 +22,9 @@ public class Score { ...@@ -22,8 +22,9 @@ public class Score {
private String durationStr; private String durationStr;
//小程序前端用户填写的里程
private int mileage; private int mileage;
private String mileageStr; //小程序前端是否需要用户填写里程
private int switchMileage;
} }
...@@ -847,9 +847,10 @@ public class MicroApiController { ...@@ -847,9 +847,10 @@ public class MicroApiController {
if(scoreId != null){ if(scoreId != null){
return Result.fail().setMsg("已经上传过成绩!"); return Result.fail().setMsg("已经上传过成绩!");
} }
//前端上传的里程数
int mileage=score.getScore().getMileage();
ScoreItem scoreItem = new ScoreItem() ScoreItem scoreItem = new ScoreItem()
.setSubsectionscore(score.getScore().getDuration()).setSubsectionMileage(score.getScore().getMileage()) .setSubsectionscore(score.getScore().getDuration()).setSubsectionMileage(mileage)
.setSubsectionTime(score.getScore().getDate()) .setSubsectionTime(score.getScore().getDate())
.setCmptId(score.getCmptId()) .setCmptId(score.getCmptId())
.setCmptScoreId(1); .setCmptScoreId(1);
...@@ -903,10 +904,22 @@ public class MicroApiController { ...@@ -903,10 +904,22 @@ public class MicroApiController {
result.put("user",userInfo); result.put("user",userInfo);
Integer scoreItemId = cmptScoreRuleService.getCmptScoreRulesMapByMarkNoAndRuleId(userInfo.getMarkNo(),rule.getId()); Integer scoreItemId = cmptScoreRuleService.getCmptScoreRulesMapByMarkNoAndRuleId(userInfo.getMarkNo(),rule.getId());
//小程序添加里程的是否需要用户填写
FuncSetting funcSetting =funcSettingService.getSettingByCmptId(score.getCmptId());
Integer switchMileage=funcSetting.getMileage();
Integer subsectionMileage=0;
if(scoreItemId != null){ if(scoreItemId != null){
Result<ScoreItem> scoreItem = scoreService.getScoreItem(scoreItemId); Result<ScoreItem> scoreItem = scoreService.getScoreItem(scoreItemId);
ScoreItem content = scoreItem.getContent(); ScoreItem content = scoreItem.getContent();
result.put("score",new Score().setDate(content.getSubsectionTime().substring(0,10)).setDuration(content.getSubsectionscore())); if(content.getSubsectionMileage()==null)
subsectionMileage=0;
result.put("score",new Score().setDate(content.getSubsectionTime().substring(0,10)).setDuration(content.getSubsectionscore()).setMileage(subsectionMileage).setSwitchMileage(switchMileage));
}else{
//初始阶段没有上传成绩,json也显示score,方便前端判断
result.put("score",new Score().setDate("0000-00-00").setDuration(0).setMileage(subsectionMileage).setSwitchMileage(switchMileage));
} }
......
...@@ -111,7 +111,7 @@ public class ScoreController { ...@@ -111,7 +111,7 @@ public class ScoreController {
Score score = new Score() Score score = new Score()
.setDate(content.getSubsectionTime().substring(0,10)) .setDate(content.getSubsectionTime().substring(0,10))
.setDuration(content.getSubsectionscore()) .setDuration(content.getSubsectionscore())
.setDurationStr(DateUtil.formatDate(content.getSubsectionscore())) .setDurationStr(DateUtil.formatDate(content.getSubsectionscore())).setMileage(content.getSubsectionMileage())
.setId(content.getId()); .setId(content.getId());
scores.add(score); scores.add(score);
duration += content.getSubsectionscore(); duration += content.getSubsectionscore();
...@@ -281,7 +281,6 @@ public class ScoreController { ...@@ -281,7 +281,6 @@ public class ScoreController {
user.setTotalDuration(total); user.setTotalDuration(total);
user.setDurationStr(DateUtil.formatDate(total)); user.setDurationStr(DateUtil.formatDate(total));
user.setTotalMileage(totalMileage); user.setTotalMileage(totalMileage);
user.setMileageStr(String.valueOf(totalMileage/1000));
}); });
// 一条成绩没有的 // 一条成绩没有的
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>扫描打卡</title> <title>扫码打卡</title>
<!-- Bootstrap CSS--> <!-- Bootstrap CSS-->
<link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="${ctxStatic}/newdermon/vendor/bootstrap/css/bootstrap.min.css">
<!-- Font Awesome CSS--> <!-- Font Awesome CSS-->
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
cursor: pointer; cursor: pointer;
} }
.load{ .load{
display: none;
width: 146px; width: 146px;
height: 40px; height: 40px;
background: rgba(206,57,57,1); background: rgba(206,57,57,1);
...@@ -160,7 +159,7 @@ ...@@ -160,7 +159,7 @@
<jsp:include page="../common/menu.jsp"></jsp:include> <jsp:include page="../common/menu.jsp"></jsp:include>
<div class="rght"> <div class="rght">
<div class="title-new"> <div class="title-new">
<span class="title">扫描打卡</span> <span class="title">扫码打卡</span>
<div style="line-height: 22px"> <div style="line-height: 22px">
<span class="road-notice"></span> <span class="road-notice"></span>
<span class="road-notice-txt">此功能仅适用于线下自助赛</span> <span class="road-notice-txt">此功能仅适用于线下自助赛</span>
......
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
<li class="scan menu-item"> <li class="scan menu-item">
<a href="/gk/scan/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}"> <a href="/gk/scan/index/${cmpt.cmptId}?uId=${uId}&cId=${cId}&timestamp=${timestamp}&sign=${sign}">
<span class="menuico left-arrow"></span> <span class="menuico left-arrow"></span>
<span class="menu-txt">扫描打卡</span> <span class="menu-txt">扫码打卡</span>
</a> </a>
</li> </li>
</ul> </ul>
......
...@@ -153,7 +153,7 @@ function getGpsCp(roadId) { ...@@ -153,7 +153,7 @@ function getGpsCp(roadId) {
url : '/gk/roadGpsCheckpoint/getGpsCheckPointByRoadId/'+getCId()+"/"+roadId, url : '/gk/roadGpsCheckpoint/getGpsCheckPointByRoadId/'+getCId()+"/"+roadId,
success:function (data) { success:function (data) {
if(data.status){ if(data.status){
$('.load').hide(); $('.load').show();
$('.noroute').hide(); $('.noroute').hide();
$('.QRCodeDown').show(); $('.QRCodeDown').show();
$('.save-btn').show(); $('.save-btn').show();
......
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