Commit b7d53c7c authored by chenlin's avatar chenlin

增加路线删除功能

parent ee3c964e
......@@ -29,7 +29,7 @@ public interface RoadMapper {
int updateRoadGps(RoadGpsPoint point);
void deleteGps(Integer roadId, Integer pathId);
int deleteGpsPath(int pathId);
void countDownload(Integer roadId);
......
......@@ -13,6 +13,7 @@
, a.create_time createTime
from gk_roads_gps a
WHERE 1=1
AND a.is_delete = 0
AND a.cmpt_id = #{cmptId}
AND a.road_id = #{roadId}
</select>
......@@ -50,6 +51,7 @@
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}
AND a.is_delete = 0
AND c.is_delete = 0
</select>
<update id="delete">
......@@ -97,10 +99,11 @@
</update>
<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
from gk_roads_gps
where road_id = #{roadId}
and id = #{pathId}
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
WHERE road_id = #{roadId}
AND id = #{pathId}
AND is_delete = 0
limit 1
</select>
......@@ -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
from gk_roads_gps
where road_id = #{roadId}
AND is_delete = 0
</select>
<delete id="deleteGps">
delete from gk_roads_gps
where road_id = #{roadId}
and id = #{pathId}
</delete>
<update id="deleteGpsPath">
UPDATE gk_roads_gps
SET is_delete = 1
WHERE id = #{pathId}
</update>
<update id="countDownload">
update gk_road set times = times+1
......
......@@ -701,7 +701,7 @@
select null, #{new_gk_cmptId},
#{new_gk_itemId}, points, now()
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>
<!--复制 gksite 下的表 gk_roads_gps_checkpoint_map -->
......
......@@ -43,6 +43,10 @@ public class RoadService {
return roadMapper.delete(id);
}
public int deleteGpsPath(int pathId) {
return roadMapper.deleteGpsPath(pathId);
}
/**
* 根据赛事、组别 获取路线列表
* @param cmptId 赛事ID
......
......@@ -150,6 +150,13 @@ public class RoadController {
return Result.success();
}
@RequestMapping("delGpsPath")
@ResponseBody
public Result deleteGpsPath(int pathId) {
int count = roadService.deleteGpsPath(pathId);
return Result.success();
}
/**
* 上传轨迹的接口,针对不同的项目,上传不同的gpx,kml轨迹文件
* @param url
......
......@@ -83,7 +83,7 @@
</div>
<div class="divhorizontal divhorizontal-item3 edit-new">
<span class="edit-road"></span>
<span class="edit-text " name="name">路线编辑</span>
<span class="edit-text " name="name">编辑路线</span>
</div>
<c:if test="${item.isMultiRoute == '1'}">
<div class="divhorizontal divhorizontal-item3 add-new">
......@@ -91,6 +91,10 @@
<span class="edit-text " name="name">新增路线</span>
</div>
</c:if>
<div class="divhorizontal divhorizontal-item3 del-new">
<span class="edit-road"></span>
<span class="edit-text " name="name">删除路线</span>
</div>
</div>
</c:forEach>
</c:when>
......@@ -195,5 +199,6 @@
</div>
</div>
</body>
<script src="${ctxStatic}/js/qikoo.js"></script>
<script type="text/javascript" src="${ctxStatic}/js/road-new.js"></script>
</html>
......@@ -49,7 +49,7 @@
}
.divhorizontal-item3 {
width: 140px;
width: 110px;
text-align: center;
padding-right: 0px !important;
background-color: #F7F7F7 !important;
......@@ -171,6 +171,10 @@ nav.side-navbar .sidebar-header
.edit-new {
cursor: pointer;
}
.del-new {
margin-left: 5px;
cursor: pointer;
}
.add-new {
cursor: pointer;
margin-left: 5px;
......
......@@ -152,6 +152,30 @@ $(document).ready(function () {
$('.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 () {
$(this).hide();
$('.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