Commit 25084a57 authored by sunyuhua's avatar sunyuhua

上传成绩精确到分钟

parent 3fd2c198
......@@ -38,6 +38,7 @@ import java.net.HttpURLConnection;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.time.LocalTime;
import java.util.*;
......@@ -897,10 +898,13 @@ public class MicroApiController {
DecimalFormat df = new DecimalFormat("0.##");
cmptPace=Float.valueOf(df.format((float)duration/mileage));
}
LocalTime nowTime = LocalTime.now().withNano(0);
//提交时间,根据服务器的时间补充
String subsectionTime=score.getScore().getDate()+" "+nowTime;
//前端上传json中取出里程,耗时,提交时间,赛事地,规则id,markNo
CmptScoreRuleScoreInfo cmptScoreRuleScoreInfo = new CmptScoreRuleScoreInfo().setCmptId(score.getCmptId())
.setSubsectionscore(score.getScore().getDuration()).setSubsectionMileage(mileage).setCmptPace(cmptPace)
.setSubsectionTime(score.getScore().getDate())
.setSubsectionTime(subsectionTime)
.setCmptId(score.getCmptId()).setRuleId(rule.getId()).setMarkNo(score.getMarkNo()).setCheckStatus(0);
//如果自动审核开启的话,进行单条成绩的审核处理
if(settingByCmptId.getSwitchScoreReview()==1){
......@@ -932,7 +936,7 @@ public class MicroApiController {
@ApiResponse(code = 200, message = "成功"),
@ApiResponse(code = -1, message = "失败"),
@ApiResponse(code = 200, message = "成功", response = Result.class)})
@ApiOperation(value = "上传成绩", notes = "上传成绩", response = Result.class, tags = "上传成绩")
@ApiOperation(value = "获取成绩", notes = "获取成绩", response = Result.class, tags = "获取成绩")
public Result getScore(UserScore score) {
log.info("用户提交的成绩信息:"+score.toString());
CmptScoreRule rule = cmptScoreRuleService.getCmptScoreRulesByCmptIdAndIndex(score.getCmptId(),score.getIndexId());
......
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