Commit 1e1bdb89 authored by yangshuxing's avatar yangshuxing

Merge remote-tracking branch 'origin/master'

parents 4249f340 e2c9b856
......@@ -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>
......
......@@ -28,14 +28,15 @@
checkpoint_latitude = #{checkpointLatitude},
</if>
<if test="checkpointLongitude != 0">
checkpoint_longitude = #{checkpointLongitude}
checkpoint_longitude = #{checkpointLongitude},
</if>
inster_time=now(),update_time=now()
</set>
where id = #{id}
</update>
<insert id="save" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
insert into gk_roads_gps_checkpoint_map(cmpt_id,road_id ,checkpoint_id,checkpoint_name,checkpoint_distance,checkpoint_gps_name ,checkpoint_latitude,checkpoint_longitude,is_delete)
values (#{cmptId},#{roadId},#{checkpointId},#{checkpointName},#{checkpointDistance},#{checkpointGpsName},#{checkpointLatitude},#{checkpointLongitude},0)
insert into gk_roads_gps_checkpoint_map(cmpt_id,road_id ,checkpoint_id,checkpoint_name,checkpoint_distance,checkpoint_gps_name ,checkpoint_latitude,checkpoint_longitude,is_delete,inster_time,update_time)
values (#{cmptId},#{roadId},#{checkpointId},#{checkpointName},#{checkpointDistance},#{checkpointGpsName},#{checkpointLatitude},#{checkpointLongitude},0,now(),now())
</insert>
</mapper>
\ No newline at end of file
......@@ -38,11 +38,11 @@ public class QRCodeUtil {
/**
* 二维码宽
*/
private static final int WIDTH = 400;
private static final int WIDTH = 1000;
/**
* 二维码高
*/
private static final int HEIGHT = 400;
private static final int HEIGHT = 1000;
/**
* 用于设置QR二维码参数
......
......@@ -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);
}
}
......@@ -93,12 +93,15 @@ public class ScanController {
Cmpt cmpt=cmptService.queryCmptBycmptId(cmptId);
String logostr=cmpt.getLogo();
HttpURLConnection httpUrl = null;
BufferedImage logoimg=null;
try {
URL url = new URL(logostr);
httpUrl = (HttpURLConnection) url.openConnection();
httpUrl.connect();
InputStream in=httpUrl.getInputStream();
BufferedImage logoimg=ImageIO.read(in);
if(logostr!=null && logostr.isEmpty()) {
URL url = new URL(logostr);
httpUrl = (HttpURLConnection) url.openConnection();
httpUrl.connect();
InputStream in = httpUrl.getInputStream();
logoimg = ImageIO.read(in);
}
//导出zip文件的名字
String zipName=new String(roadName.getBytes(),"ISO-8859-1") + ".zip";
//定义返回zip文件的输出流格式
......
......@@ -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));
});
// 一条成绩没有的
......
......@@ -51,7 +51,7 @@ server.url=http://testzs.geexek.com.cn/
server.url.https=https://testzs.geexek.com.cn/
spring.redis.cluster.max-redirects=3
spring.redis.cluster.nodes=172.16.214.235:7001,172.16.214.235:7002,172.16.214.235:7003
spring.servlet.multipart.max-file-size=10Mb
spring.servlet.multipart.max-file-size=1500Mb
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-request-size=50Mb
spring.application.name=micro-gksite
......
......@@ -141,9 +141,7 @@
background-position: center;
background-repeat: no-repeat;
}
.load{
display: none;
}
.noroute{
display: none;
position: absolute;
......
......@@ -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>
......
......@@ -155,6 +155,8 @@ function getGpsCp(roadId) {
if(data.status){
$('.load').hide();
$('.noroute').hide();
$('.QRCodeDown').show();
$('.save-btn').show();
var optionstring="<option value='' data-lat='' data-lng='' >- -</option>";
//将之前的下拉框的值清空
$(".gpscheckpoint").empty();
......@@ -169,6 +171,8 @@ function getGpsCp(roadId) {
}else{
$('.road-name[road-id="'+roadId+'"]').append($('.noroute'));
$('.noroute').show();
$('.QRCodeDown').hide();
$('.save-btn').hide();
$('.load').attr('road-id',roadId)
$('.load').show();
$(".gpscheckpoint").append("<option value='' data-lat='' data-lng=''>- -</option>");
......
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