Commit 6ccfc922 authored by daniel's avatar daniel

fix(guide): 赛事列表查询恢复

parent 22e55209
...@@ -211,56 +211,15 @@ ...@@ -211,56 +211,15 @@
<select id="countCommitteeCmpt" resultType="long"> <select id="countCommitteeCmpt" resultType="long">
select count(1) select count(1)
from ( from gk_cmpt a left join common.neucmpt b on a.cmpt_id=b.gtCmptId
select a.cmpt_id
from gk_cmpt a
left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neuuser nu on b.neuUserId=nu.neuUserId
left join raceenroll.competition c on b.gcmptid=c.cmptid left join raceenroll.competition c on b.gcmptid=c.cmptid
where a.del_flag=0 where a.del_flag=0
<include refid="committee-cmpt-where-sql"/>
union all
select a.cmpt_id
from gk_cmpt a
left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neuuser nu on nu.neuUserId=b.committeeNeuUserId
left join raceenroll.competition c on b.gcmptid=c.cmptid
where a.del_flag=0
<include refid="committee-cmpt-where-sql"/> <include refid="committee-cmpt-where-sql"/>
) tmp
</select> </select>
<select id="queryCommitteeCmpt" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt"> <select id="queryCommitteeCmpt" resultType="com.dlbridge.jadp.plugins.cmpt.dao.model.Cmpt">
(select a.cmpt_id, select a.cmpt_id,
a.cmpt_name as cmptName,
a.logo,
b.gCmptId,
date_format(start_time,'%Y-%m-%d') startTime,
date_format(end_time,'%Y-%m-%d') endTime,
date_format(a.start_time,'%Y-%m-%d %H:%i:%s') as startTimeStr,
date_format(a.end_time,'%Y-%m-%d %H:%i:%s') as endTimeStr,
date_format(c.openTime,'%Y-%m-%d %H:%i:%s') as openTime,
date_format(c.deadLine,'%Y-%m-%d %H:%i:%s') as deadLine,
a.bg_color as cmptbgColor,
a.create_by AS "createBy",
a.create_date AS "createDate",
a.update_by AS "updateBy",
a.update_date AS "updateDate",
a.del_flag AS "delFlag",
c.city as city,
c.province as province,
c.area as area,
c.location as location
from gk_cmpt a
left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neuuser nu on b.neuUserId=nu.neuUserId
left join raceenroll.competition c on b.gcmptid=c.cmptid
where a.del_flag=0
<include refid="committee-cmpt-where-sql"/>)
union all
(select a.cmpt_id,
a.cmpt_name as cmptName, a.cmpt_name as cmptName,
a.logo, a.logo,
b.gCmptId, b.gCmptId,
...@@ -280,13 +239,11 @@ ...@@ -280,13 +239,11 @@
c.province as province, c.province as province,
c.area as area, c.area as area,
c.location as location c.location as location
from gk_cmpt a from gk_cmpt a left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neucmpt b on a.cmpt_id=b.gtCmptId
left join common.neuuser nu on nu.neuUserId =b.committeeNeuUserId
left join raceenroll.competition c on b.gcmptid=c.cmptid left join raceenroll.competition c on b.gcmptid=c.cmptid
where a.del_flag=0 where a.del_flag=0
<include refid="committee-cmpt-where-sql"/>) <include refid="committee-cmpt-where-sql"/>
order by startTime desc order by c.startTime desc
limit #{page.offset},#{page.size} limit #{page.offset},#{page.size}
</select> </select>
<sql id="committee-cmpt-where-sql"> <sql id="committee-cmpt-where-sql">
...@@ -300,7 +257,7 @@ ...@@ -300,7 +257,7 @@
and now() >= c.startTime and c.endTime >= now() and now() >= c.startTime and c.endTime >= now()
</if> </if>
<if test="param.userId > 0"> <if test="param.userId > 0">
and nu.gUserId=#{param.userId} and c.createUserId=#{param.userId}
</if> </if>
<if test="param.userId lt 0"> <if test="param.userId lt 0">
AND c.createUserId NOT IN (SELECT user_id from gksite.gk_app_info WHERE user_id>0) AND c.createUserId NOT IN (SELECT user_id from gksite.gk_app_info WHERE user_id>0)
......
...@@ -51,15 +51,14 @@ public class RoadController { ...@@ -51,15 +51,14 @@ public class RoadController {
Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId); Cmpt cmpt = cmptService.queryCmptBycmptId(cmptId);
mv.addObject("cmpt", cmpt); mv.addObject("cmpt", cmpt);
List<Road> list = roadService.queryRoadsMultiPath(cmptId); List<Road> list = roadService.queryRoadsMultiPath(cmptId);
// if(list != null){ if(list != null){
// for (Road road : list) {
// log.info("RoadController getName:" + road.getName() + " getRoadId:" + road.getRoadId() + " getFileName:" + road.getFileName());
// }
// }
Map<String,String> multiMap = roadService.getMultiRouteInfo(cmptId); Map<String,String> multiMap = roadService.getMultiRouteInfo(cmptId);
for(Road road : list){ for(Road road : list){
road.setIsMultiRoute(multiMap.get("isMultiRoute")); road.setIsMultiRoute(multiMap.get("isMultiRoute"));
} }
}else{
list = new ArrayList<>();
}
mv.addObject("list", list); mv.addObject("list", list);
mv.setViewName("cmpt/road"); mv.setViewName("cmpt/road");
return mv; return mv;
......
...@@ -95,7 +95,10 @@ function getCpGpsList(roadId) { ...@@ -95,7 +95,10 @@ function getCpGpsList(roadId) {
*/ */
function getTimeCp(roadId) { function getTimeCp(roadId) {
$('tbody').empty() $('tbody').empty()
if (!roadId) return if (!roadId) {
layer.msg('请选择组别!')
return
}
$.ajax({ $.ajax({
url: '/gk/roadGpsCheckpoint/getTimeCheckpointByRoadId/' + getCId() + "/" + roadId, url: '/gk/roadGpsCheckpoint/getTimeCheckpointByRoadId/' + getCId() + "/" + roadId,
success: function (data) { success: function (data) {
......
...@@ -2,16 +2,16 @@ $(document).ready(function () { ...@@ -2,16 +2,16 @@ $(document).ready(function () {
//切换项目,获取不同计时的打卡点 //切换项目,获取不同计时的打卡点
var roadId = $('.road-name').first().attr('road-id'); var roadId = $('.road-name').first().attr('road-id');
var pathId = $('.road-name').first().attr('path-id'); var pathId = $('.road-name').first().attr('path-id');
getTimeCp(roadId,pathId); getTimeCp(roadId, pathId);
//获取gpx路线上的打卡点 //获取gpx路线上的打卡点
//初始化已经配置好的GPS计时点配置列表 //初始化已经配置好的GPS计时点配置列表
$('body').on('change','table select',function () { $('body').on('change', 'table select', function () {
var option = $(this).find('option:selected') var option = $(this).find('option:selected')
var lat = Number(option.attr('data-lat')).toFixed(6); var lat = Number(option.attr('data-lat')).toFixed(6);
var lng = Number(option.attr('data-lng')).toFixed(6); var lng = Number(option.attr('data-lng')).toFixed(6);
$(this).parents('td').next().text(lat+","+lng); $(this).parents('td').next().text(lat + "," + lng);
}); });
...@@ -25,15 +25,15 @@ $(document).ready(function () { ...@@ -25,15 +25,15 @@ $(document).ready(function () {
//获取计时系统的计时点列表 //获取计时系统的计时点列表
getTimeCp(roadId); getTimeCp(roadId);
}); });
*/ */
$('.save-btn').click(function () { $('.save-btn').click(function () {
var params = []; var params = [];
var roadId = $('.road-name.active').attr('road-id'); var roadId = $('.road-name.active').attr('road-id');
$.each($('tbody tr'),function (i,e) { $.each($('tbody tr'), function (i, e) {
var param = {}; var param = {};
var id = $(e).attr('data-cpmap-id'); var id = $(e).attr('data-cpmap-id');
var checkpointId = $(e).find('td:eq(0)').attr('data-cp-id'); var checkpointId = $(e).find('td:eq(0)').attr('data-cp-id');
var checkpointDistance=$(e).find('td:eq(0)').attr('data-cp-distance'); var checkpointDistance = $(e).find('td:eq(0)').attr('data-cp-distance');
var cmptId = getCmptId(); var cmptId = getCmptId();
var checkpointName = $(e).find('td:eq(0)').text(); var checkpointName = $(e).find('td:eq(0)').text();
var checkpointGpsName = $(e).find('select').val() var checkpointGpsName = $(e).find('select').val()
...@@ -43,7 +43,7 @@ $(document).ready(function () { ...@@ -43,7 +43,7 @@ $(document).ready(function () {
param.id = id; param.id = id;
param.roadId = roadId; param.roadId = roadId;
param.checkpointId = checkpointId; param.checkpointId = checkpointId;
param.checkpointDistance=checkpointDistance; param.checkpointDistance = checkpointDistance;
param.cmptId = cmptId; param.cmptId = cmptId;
param.checkpointName = checkpointName; param.checkpointName = checkpointName;
param.checkpointGpsName = checkpointGpsName; param.checkpointGpsName = checkpointGpsName;
...@@ -63,13 +63,13 @@ $(document).ready(function () { ...@@ -63,13 +63,13 @@ $(document).ready(function () {
*/ */
$('.QRCodeDown').click(function () { $('.QRCodeDown').click(function () {
var hasCp = $(this).attr('data-hasCp'); var hasCp = $(this).attr('data-hasCp');
if(hasCp == 'false') return; if (hasCp == 'false') return;
var roadId = $(this).parent().attr('road-id'); var roadId = $(this).parent().attr('road-id');
var pathId = $(this).parent().attr('path-id'); var pathId = $(this).parent().attr('path-id');
console.log(roadId); console.log(roadId);
const link = document.createElement('a') const link = document.createElement('a')
const body = document.querySelector('body') const body = document.querySelector('body')
link.href = "/gk/scan/downLoadAllQRByRoadId/"+getCId()+"/"+roadId+"/"+pathId link.href = "/gk/scan/downLoadAllQRByRoadId/" + getCId() + "/" + roadId + "/" + pathId
// fix Firefox // fix Firefox
link.style.display = 'none' link.style.display = 'none'
body.appendChild(link) body.appendChild(link)
...@@ -82,7 +82,7 @@ $(document).ready(function () { ...@@ -82,7 +82,7 @@ $(document).ready(function () {
//路线标注下来点击事情,获取下拉值,并更新选中的值 //路线标注下来点击事情,获取下拉值,并更新选中的值
$(".selectgpscheckpoint").change(function(){ $(".selectgpscheckpoint").change(function () {
}); });
...@@ -93,15 +93,15 @@ $(".selectgpscheckpoint").change(function(){ ...@@ -93,15 +93,15 @@ $(".selectgpscheckpoint").change(function(){
*/ */
function getCpGpsList(roadId) { function getCpGpsList(roadId) {
$.ajax({ $.ajax({
url : '/gk/roadGpsCheckpoint/getRoadsGpsCheckpoint/'+getCId()+"/"+roadId, url: '/gk/roadGpsCheckpoint/getRoadsGpsCheckpoint/' + getCId() + "/" + roadId,
success:function (data) { success: function (data) {
if(data.status){ if (data.status) {
$.each(data.content,function (i,e) { $.each(data.content, function (i, e) {
var tr = $('td[data-cp-id='+e.checkpointId+']').parent(); var tr = $('td[data-cp-id=' + e.checkpointId + ']').parent();
tr.find('select').val(e.checkpointGpsName); tr.find('select').val(e.checkpointGpsName);
tr.find('select').trigger('change'); tr.find('select').trigger('change');
tr.attr('data-cpmap-id',e.id); tr.attr('data-cpmap-id', e.id);
}); });
} }
} }
...@@ -113,16 +113,20 @@ function getCpGpsList(roadId) { ...@@ -113,16 +113,20 @@ function getCpGpsList(roadId) {
* 获取计时的打卡点 * 获取计时的打卡点
* @param roadId * @param roadId
*/ */
function getTimeCp(roadId,pathId) { function getTimeCp(roadId, pathId) {
$('tbody').empty() $('tbody').empty()
if (!roadId) {
layer.msg('请选择组别!')
return
}
$.ajax({ $.ajax({
url : '/gk/roadGpsCheckpoint/getTimeCheckpointByRoadId/'+getCId()+"/"+roadId, url: '/gk/roadGpsCheckpoint/getTimeCheckpointByRoadId/' + getCId() + "/" + roadId,
success:function (data) { success: function (data) {
if(data.status){ if (data.status) {
$.each(data.content,function (i,e) { $.each(data.content, function (i, e) {
$('tbody').append(' \n' + $('tbody').append(' \n' +
' <tr>\n' + ' <tr>\n' +
' <td data-cp-id="'+e.checkpointId+'" data-cp-distance="'+e.checkpointDistance+'">'+e.checkpointName+'</td>\n' + ' <td data-cp-id="' + e.checkpointId + '" data-cp-distance="' + e.checkpointDistance + '">' + e.checkpointName + '</td>\n' +
' <td>\n' + ' <td>\n' +
' <div class="select-group">\n' + ' <div class="select-group">\n' +
' <select class="select gpscheckpoint">\n' + ' <select class="select gpscheckpoint">\n' +
...@@ -130,10 +134,10 @@ function getTimeCp(roadId,pathId) { ...@@ -130,10 +134,10 @@ function getTimeCp(roadId,pathId) {
' <span class="down-arrow"></span>\n' + ' <span class="down-arrow"></span>\n' +
' </div>\n' + ' </div>\n' +
' </td>\n' + ' </td>\n' +
' <td>'+Number(e.checkpointLatitude == null? "0" : e.checkpointLatitude).toFixed(6)+','+Number(e.checkpointLongitude==null?"0":e.checkpointLongitude).toFixed(6)+'</td>\n' + ' <td>' + Number(e.checkpointLatitude == null ? "0" : e.checkpointLatitude).toFixed(6) + ',' + Number(e.checkpointLongitude == null ? "0" : e.checkpointLongitude).toFixed(6) + '</td>\n' +
' </tr>'); ' </tr>');
}) })
getGpsCp(roadId,pathId); getGpsCp(roadId, pathId);
} }
} }
}) })
...@@ -145,32 +149,32 @@ function getTimeCp(roadId,pathId) { ...@@ -145,32 +149,32 @@ function getTimeCp(roadId,pathId) {
* 获取路线上的打卡点 * 获取路线上的打卡点
* @param roadId * @param roadId
*/ */
function getGpsCp(roadId,pathId) { function getGpsCp(roadId, pathId) {
$.ajax({ $.ajax({
url : '/gk/roadGpsCheckpoint/getGpsCheckPointByRoadId/'+getCId()+"/"+roadId+"/"+pathId, url: '/gk/roadGpsCheckpoint/getGpsCheckPointByRoadId/' + getCId() + "/" + roadId + "/" + pathId,
success:function (data) { success: function (data) {
if(data.status){ if (data.status) {
$('.load').show(); $('.load').show();
$('.noroute').hide(); $('.noroute').hide();
$('.QRCodeDown').show(); $('.QRCodeDown').show();
$('.save-btn').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();
$.each(data.content,function (i,e) { $.each(data.content, function (i, e) {
//获取项目路线上的打卡点并初始化到下拉框 //获取项目路线上的打卡点并初始化到下拉框
optionstring+='<option data-lat="'+e.checkpointLatitude+'" data-lng="'+e.checkpointLongitude+'" value="'+e.checkpointGpsName+'">'+e.checkpointGpsName+'</option>'; optionstring += '<option data-lat="' + e.checkpointLatitude + '" data-lng="' + e.checkpointLongitude + '" value="' + e.checkpointGpsName + '">' + e.checkpointGpsName + '</option>';
}); });
$.each($(".gpscheckpoint"),function (i,e) { $.each($(".gpscheckpoint"), function (i, e) {
$(e).append(optionstring); $(e).append(optionstring);
}); });
getCpGpsList(roadId); getCpGpsList(roadId);
}else{ } else {
$('.road-name[road-id="'+roadId+'"]').append($('.noroute')); $('.road-name[road-id="' + roadId + '"]').append($('.noroute'));
$('.noroute').show(); $('.noroute').show();
$('.QRCodeDown').hide(); $('.QRCodeDown').hide();
$('.save-btn').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>");
} }
...@@ -183,16 +187,16 @@ function getGpsCp(roadId,pathId) { ...@@ -183,16 +187,16 @@ function getGpsCp(roadId,pathId) {
* 保存对应关系 * 保存对应关系
* *
*/ */
function saveCpMap(param){ function saveCpMap(param) {
$.ajax({ $.ajax({
url : '/gk/roadGpsCheckpoint/save', url: '/gk/roadGpsCheckpoint/save',
type:'post', type: 'post',
contentType:'application/json', contentType: 'application/json',
data:JSON.stringify(param), data: JSON.stringify(param),
success:function (data) { success: function (data) {
if(data.status){ if (data.status) {
layer.msg('保存成功!') layer.msg('保存成功!')
}else{ } else {
layer.msg('操作失败!') layer.msg('操作失败!')
} }
} }
......
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