Commit 1e1bdb89 authored by yangshuxing's avatar yangshuxing

Merge remote-tracking branch 'origin/master'

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