Commit b7d53c7c authored by chenlin's avatar chenlin

增加路线删除功能

parent ee3c964e
...@@ -29,7 +29,7 @@ public interface RoadMapper { ...@@ -29,7 +29,7 @@ public interface RoadMapper {
int updateRoadGps(RoadGpsPoint point); int updateRoadGps(RoadGpsPoint point);
void deleteGps(Integer roadId, Integer pathId); int deleteGpsPath(int pathId);
void countDownload(Integer roadId); void countDownload(Integer roadId);
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
, a.create_time createTime , a.create_time createTime
from gk_roads_gps a from gk_roads_gps a
WHERE 1=1 WHERE 1=1
AND a.is_delete = 0
AND a.cmpt_id = #{cmptId} AND a.cmpt_id = #{cmptId}
AND a.road_id = #{roadId} AND a.road_id = #{roadId}
</select> </select>
...@@ -50,6 +51,7 @@ ...@@ -50,6 +51,7 @@
LEFT JOIN gk_roads_gps c ON c.cmpt_id = a.cmpt_id AND a.road_id=c.road_id LEFT JOIN gk_roads_gps c ON c.cmpt_id = a.cmpt_id AND a.road_id=c.road_id
WHERE a.cmpt_id = #{cmptId} WHERE a.cmpt_id = #{cmptId}
AND a.is_delete = 0 AND a.is_delete = 0
AND c.is_delete = 0
</select> </select>
<update id="delete"> <update id="delete">
...@@ -97,10 +99,11 @@ ...@@ -97,10 +99,11 @@
</update> </update>
<select id="getGps" resultType="com.dlbridge.jadp.plugins.cmpt.bean.RoadGpsPoint"> <select id="getGps" resultType="com.dlbridge.jadp.plugins.cmpt.bean.RoadGpsPoint">
select id,cmpt_id cmptId,road_id roadId,points,path_name pathName,file_name fileName,file_url fileUrl,file_size fileSize SELECT id,cmpt_id cmptId,road_id roadId,points,path_name pathName,file_name fileName,file_url fileUrl,file_size fileSize
from gk_roads_gps FROM gk_roads_gps
where road_id = #{roadId} WHERE road_id = #{roadId}
and id = #{pathId} AND id = #{pathId}
AND is_delete = 0
limit 1 limit 1
</select> </select>
...@@ -108,13 +111,14 @@ ...@@ -108,13 +111,14 @@
select id,cmpt_id cmptId,road_id roadId,points,path_name pathName,file_name fileName,file_url fileUrl,file_size fileSize select id,cmpt_id cmptId,road_id roadId,points,path_name pathName,file_name fileName,file_url fileUrl,file_size fileSize
from gk_roads_gps from gk_roads_gps
where road_id = #{roadId} where road_id = #{roadId}
AND is_delete = 0
</select> </select>
<delete id="deleteGps"> <update id="deleteGpsPath">
delete from gk_roads_gps UPDATE gk_roads_gps
where road_id = #{roadId} SET is_delete = 1
and id = #{pathId} WHERE id = #{pathId}
</delete> </update>
<update id="countDownload"> <update id="countDownload">
update gk_road set times = times+1 update gk_road set times = times+1
......
...@@ -701,7 +701,7 @@ ...@@ -701,7 +701,7 @@
select null, #{new_gk_cmptId}, select null, #{new_gk_cmptId},
#{new_gk_itemId}, points, now() #{new_gk_itemId}, points, now()
from gksite.gk_roads_gps from gksite.gk_roads_gps
where cmpt_id = #{cmpt_id} and road_id = #{item_id} where cmpt_id = #{cmpt_id} and road_id = #{item_id} AND is_delete = 0
</insert> </insert>
<!--复制 gksite 下的表 gk_roads_gps_checkpoint_map --> <!--复制 gksite 下的表 gk_roads_gps_checkpoint_map -->
......
...@@ -43,6 +43,10 @@ public class RoadService { ...@@ -43,6 +43,10 @@ public class RoadService {
return roadMapper.delete(id); return roadMapper.delete(id);
} }
public int deleteGpsPath(int pathId) {
return roadMapper.deleteGpsPath(pathId);
}
/** /**
* 根据赛事、组别 获取路线列表 * 根据赛事、组别 获取路线列表
* @param cmptId 赛事ID * @param cmptId 赛事ID
......
...@@ -150,6 +150,13 @@ public class RoadController { ...@@ -150,6 +150,13 @@ public class RoadController {
return Result.success(); return Result.success();
} }
@RequestMapping("delGpsPath")
@ResponseBody
public Result deleteGpsPath(int pathId) {
int count = roadService.deleteGpsPath(pathId);
return Result.success();
}
/** /**
* 上传轨迹的接口,针对不同的项目,上传不同的gpx,kml轨迹文件 * 上传轨迹的接口,针对不同的项目,上传不同的gpx,kml轨迹文件
* @param url * @param url
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</div> </div>
<div class="divhorizontal divhorizontal-item3 edit-new"> <div class="divhorizontal divhorizontal-item3 edit-new">
<span class="edit-road"></span> <span class="edit-road"></span>
<span class="edit-text " name="name">路线编辑</span> <span class="edit-text " name="name">编辑路线</span>
</div> </div>
<c:if test="${item.isMultiRoute == '1'}"> <c:if test="${item.isMultiRoute == '1'}">
<div class="divhorizontal divhorizontal-item3 add-new"> <div class="divhorizontal divhorizontal-item3 add-new">
...@@ -91,6 +91,10 @@ ...@@ -91,6 +91,10 @@
<span class="edit-text " name="name">新增路线</span> <span class="edit-text " name="name">新增路线</span>
</div> </div>
</c:if> </c:if>
<div class="divhorizontal divhorizontal-item3 del-new">
<span class="edit-road"></span>
<span class="edit-text " name="name">删除路线</span>
</div>
</div> </div>
</c:forEach> </c:forEach>
</c:when> </c:when>
...@@ -195,5 +199,6 @@ ...@@ -195,5 +199,6 @@
</div> </div>
</div> </div>
</body> </body>
<script src="${ctxStatic}/js/qikoo.js"></script>
<script type="text/javascript" src="${ctxStatic}/js/road-new.js"></script> <script type="text/javascript" src="${ctxStatic}/js/road-new.js"></script>
</html> </html>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
} }
.divhorizontal-item3 { .divhorizontal-item3 {
width: 140px; width: 110px;
text-align: center; text-align: center;
padding-right: 0px !important; padding-right: 0px !important;
background-color: #F7F7F7 !important; background-color: #F7F7F7 !important;
...@@ -171,6 +171,10 @@ nav.side-navbar .sidebar-header ...@@ -171,6 +171,10 @@ nav.side-navbar .sidebar-header
.edit-new { .edit-new {
cursor: pointer; cursor: pointer;
} }
.del-new {
margin-left: 5px;
cursor: pointer;
}
.add-new { .add-new {
cursor: pointer; cursor: pointer;
margin-left: 5px; margin-left: 5px;
......
...@@ -152,6 +152,30 @@ $(document).ready(function () { ...@@ -152,6 +152,30 @@ $(document).ready(function () {
$('.force').hide(); $('.force').hide();
}); });
// 删除路线
$('body').on('click', '.del-new', function () {
var parent = $(this).parent();
var pathId = parent.attr('data-path-id');
qikoo.dialog.confirm('确认要删除?',
function () {
$.ajax({
url: '/gk/road/delGpsPath',
data: {pathId: pathId},
type: 'post',
success: function (data) {
if (data.status) {
parent.remove();
layer.msg('删除成功!');
} else {
layer.msg('操作失败', {icon: 5, time: 1500});
}
}, error: function () {
layer.msg('操作失败', {icon: 5, time: 1500});
}
});
});
});
$('body').on('click','.map-data .edit',function () { $('body').on('click','.map-data .edit',function () {
$(this).hide(); $(this).hide();
$('.save').fadeIn(); $('.save').fadeIn();
......
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