Commit f2a941c6 authored by yangshuxing's avatar yangshuxing

自动提交代码

parent d43a505e
...@@ -13,7 +13,7 @@ select id as Id,cmpt_id as cmptId, road_id as roadId,checkpoint_id as checkpoint ...@@ -13,7 +13,7 @@ select id as Id,cmpt_id as cmptId, road_id as roadId,checkpoint_id as checkpoint
<if test="checkpointName != null"> <if test="checkpointName != null">
checkpoint_name = #{checkpointName}, checkpoint_name = #{checkpointName},
</if> </if>
<if test="checkpointGpsName!=null"> <if test="checkpointGpsName !=null">
checkpoint_gps_name = #{checkpointGpsName}, checkpoint_gps_name = #{checkpointGpsName},
</if> </if>
<if test="checkpointLatitude !=0"> <if test="checkpointLatitude !=0">
...@@ -23,11 +23,11 @@ select id as Id,cmpt_id as cmptId, road_id as roadId,checkpoint_id as checkpoint ...@@ -23,11 +23,11 @@ select id as Id,cmpt_id as cmptId, road_id as roadId,checkpoint_id as checkpoint
checkpoint_longitude = #{checkpointLongitude} checkpoint_longitude = #{checkpointLongitude}
</if> </if>
</set> </set>
where road_id = #{roadId} 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_name,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_gps_name ,checkpoint_latitude,checkpoint_longitude,is_delete)
values (#{cmptId},#{roadId},#{checkpointName},#{checkpointGpsName},#{checkpointLatitude},#{checkpointLongitude},0) values (#{cmptId},#{roadId},#{checkpointId},#{checkpointName},#{checkpointGpsName},#{checkpointLatitude},#{checkpointLongitude},0)
</insert> </insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -13,6 +13,7 @@ import lombok.extern.log4j.Log4j2; ...@@ -13,6 +13,7 @@ import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
...@@ -96,9 +97,14 @@ public class RoadsGpsCheckpointController { ...@@ -96,9 +97,14 @@ public class RoadsGpsCheckpointController {
*/ */
@RequestMapping("save") @RequestMapping("save")
@ResponseBody @ResponseBody
public Result save(List<RoadsGpsCheckpointMap> roadsGpsCheckpointMapList) { public Result save(@RequestBody List<RoadsGpsCheckpointMap> roadsGpsCheckpointMapList) {
int count = roadsGpsCheckpointService.batchSaveOrUpdate(roadsGpsCheckpointMapList); int count = roadsGpsCheckpointService.batchSaveOrUpdate(roadsGpsCheckpointMapList);
if(count > 0){
return Result.success().setContent(count); return Result.success().setContent(count);
}else{
return Result.fail().setContent(count);
}
} }
/** /**
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
width: 100%; width: 100%;
margin: 20px 0px; margin: 20px 0px;
background: #FFFFFF; background: #FFFFFF;
position: relative;
} }
.road-name{ .road-name{
font-size: 20px; font-size: 20px;
...@@ -48,6 +49,9 @@ ...@@ -48,6 +49,9 @@
height: 65px; height: 65px;
border-radius: 0px 4px 0px 0px; border-radius: 0px 4px 0px 0px;
border: 1px solid rgba(229,229,229,1); border: 1px solid rgba(229,229,229,1);
position: relative;
min-width: 170px;
text-align: center;
} }
.road-name.active{ .road-name.active{
color: #ce3939; color: #ce3939;
...@@ -65,9 +69,11 @@ ...@@ -65,9 +69,11 @@
color: #f3f3f3; color: #f3f3f3;
} }
table tbody tr{ table tbody tr{
background:rgba(250,250,250,1); background: rgba(250,250,250,1);
border-radius:4px; border-radius: 4px;
height:70px; height: 70px;
border-bottom: 5px solid white;
border-radius: 5px;
} }
table tbody tr td{ table tbody tr td{
padding-left: 26px; padding-left: 26px;
...@@ -78,11 +84,11 @@ ...@@ -78,11 +84,11 @@
} }
.select-group{ .select-group{
position: relative; position: relative;
width: 120px; width: 200px;
} }
.select{ .select{
text-transform: none; text-transform: none;
width: 120px; width: 200px;
height: 40px; height: 40px;
padding: 0px 5px; padding: 0px 5px;
border-radius: 4px; border-radius: 4px;
...@@ -94,6 +100,43 @@ ...@@ -94,6 +100,43 @@
-webkit-appearance:none; -webkit-appearance:none;
cursor: pointer; cursor: pointer;
} }
.load{
display: none;
width: 146px;
height: 40px;
background: rgba(206,57,57,1);
border-radius: 4px;
color: white;
display: inline-block;
line-height: 40px;
position: absolute;
right: 35px;
top: 72px;
text-align: center;
font-size: 18px;
cursor: pointer;
}
.no-route-icon{
width: 16px;
height: 16px;
background: url("/static/images/warning.png");
background-size: contain;
background-position: center;
background-repeat: no-repeat;
}
.load{
display: none;
}
.noroute{
display: none;
position: absolute;
width: 140px;
font-size: 16px;
bottom: -32px;
height: 65px;
left: 50%;
margin-left: -69px;
}
</style> </style>
</head> </head>
<body> <body>
...@@ -118,15 +161,19 @@ ...@@ -118,15 +161,19 @@
<div class="data"> <div class="data">
<div class="road"> <div class="road">
<c:forEach var="item" items="${roads}"> <c:forEach var="item" items="${roads}" varStatus="idx">
<div class="road-name"> <div class="road-name ${idx.index==0?'active':''}" road-id="${item.roadId}">
<input type="hidden" id="roadId" name="roadId" value="${item.roadId}"> <input type="hidden" id="roadId" name="roadId" value="${item.roadId}">
<span>${item.name}</span> <span>${item.name}</span>
</div> </div>
</c:forEach> </c:forEach>
</div> </div>
<span class="load">导入路线</span>
<table cellpadding="2px" cellspacing="2px"> <div class="noroute">
<span class="no-route-icon"></span>
<span class="no-route">未检索到标记点</span>
</div>
<table>
<colgroup> <colgroup>
<col width="33%"> <col width="33%">
<col width="33%"> <col width="33%">
...@@ -156,13 +203,15 @@ ...@@ -156,13 +203,15 @@
</table> </table>
</div> </div>
</div> </div>
<div class="btn save-btn">保存</div> <div style="display: flex;justify-content: center; margin: 60px;">事
<span class=" save-btn">保存</span>
</div>
</div> </div>
<script src="${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"></script> <script src="${ctxStatic}/newdermon/vendor/popper.js/umd/popper.min.js"></script>
<script src="${ctxStatic}/js/qikoo.js"></script> <script src="${ctxStatic}/js/qikoo.js"></script>
<script src="${ctxStatic}/js/autoscore.js?<%=System.currentTimeMillis()%>%"></script> <script src="${ctxStatic}/js/autoscore.js"></script>
</body> </body>
......
...@@ -2,21 +2,59 @@ $(document).ready(function () { ...@@ -2,21 +2,59 @@ $(document).ready(function () {
//切换项目,获取不同计时的打卡点 //切换项目,获取不同计时的打卡点
getTimeCp(21177); getTimeCp(21177);
//获取gpx路线上的打卡点 //获取gpx路线上的打卡点
getGpsCp(21177);
//初始化已经配置好的GPS计时点配置列表 //初始化已经配置好的GPS计时点配置列表
//getCpGpsList(21177);
}); $('body').on('change','table select',function () {
var option = $(this).find('option:selected')
var lat = Number(option.attr('data-lat')).toFixed(6);
var lng = Number(option.attr('data-lng')).toFixed(6);
$(this).parents('td').next().text(lat+","+lng);
});
//点击事件,切换不同项目,获取不同项目的GPS计时点配置信息
$(".road-name").click(function(event){ $('body').on('click','.road-name',function () {
var roadId=$(this).children("input").val(); $('.road-name').removeClass('active');
$(this).addClass("active");
var roadId=$(this).attr('road-id');
//获取计时系统的计时点列表 //获取计时系统的计时点列表
getTimeCp(roadId); getTimeCp(roadId);
//切换不同个项目,获取不同项目下的打卡点配置 });
getCpGpsList(roadId);
$('.save-btn').click(function () {
var params = [];
var roadId = $('.road-name.active').attr('road-id');
$.each($('tbody tr'),function (i,e) {
var param = {};
var id = $(e).attr('data-cpmap-id');
var checkpointId = $(e).find('td:eq(0)').attr('data-cp-id');
var cmptId = getCmptId();
var checkpointName = $(e).find('td:eq(0)').text();
var checkpointGpsName = $(e).find('select').val()
var checkpointLatitude = $(e).find('td:eq(2)').text().split(',')[0];
var checkpointLongitude = $(e).find('td:eq(2)').text().split(',')[1];
param.id = id;
param.roadId = roadId;
param.checkpointId = checkpointId;
param.cmptId = cmptId;
param.checkpointName = checkpointName;
param.checkpointGpsName = checkpointGpsName;
param.checkpointLatitude = checkpointLatitude;
param.checkpointLongitude = checkpointLongitude;
params.push(param)
});
saveCpMap(params)
});
$('.load').click(function () {
$('li.road a').get()[0].click();
});
}); });
//路线标注下来点击事情,获取下拉值,并更新选中的值 //路线标注下来点击事情,获取下拉值,并更新选中的值
$(".selectgpscheckpoint").change(function(){ $(".selectgpscheckpoint").change(function(){
...@@ -28,28 +66,17 @@ $(".selectgpscheckpoint").change(function(){ ...@@ -28,28 +66,17 @@ $(".selectgpscheckpoint").change(function(){
* @param roadId * @param roadId
*/ */
function getCpGpsList(roadId) { function getCpGpsList(roadId) {
//清空所有值
$('tbody').empty();
$.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) {
$('tbody').append(' \n' + var tr = $('td[data-cp-id='+e.checkpointId+']').parent();
' <tr>\n' + tr.find('select').val(e.checkpointGpsName);
' <td>'+e.checkpointName+'</td>\n' + tr.find('select').trigger('change');
' <td>\n' + tr.attr('data-cpmap-id',e.id);
' <div class="select-group">\n' + });
' <select class="selectgpscheckpoint">\n' +
' <option value="'+e.checkpointGpsName+'">'+e.checkpointGpsName+'</option>\n' +
' </select>\n' +
' <span class="down-arrow"></span>\n' +
' </div>\n' +
' </td>\n' +
' <td>'+Number(e.checkpointLatitude).toFixed(6)+','+Number(e.checkpointLongitude).toFixed(6)+'</td>\n' +
' </tr>');
})
} }
} }
}) })
...@@ -61,6 +88,7 @@ function getCpGpsList(roadId) { ...@@ -61,6 +88,7 @@ function getCpGpsList(roadId) {
* @param roadId * @param roadId
*/ */
function getTimeCp(roadId) { function getTimeCp(roadId) {
$('tbody').empty()
$.ajax({ $.ajax({
url : '/gk/roadGpsCheckpoint/getTimeCheckpointByRoadId/'+getCId()+"/"+roadId, url : '/gk/roadGpsCheckpoint/getTimeCheckpointByRoadId/'+getCId()+"/"+roadId,
success:function (data) { success:function (data) {
...@@ -68,10 +96,10 @@ function getTimeCp(roadId) { ...@@ -68,10 +96,10 @@ function getTimeCp(roadId) {
$.each(data.content,function (i,e) { $.each(data.content,function (i,e) {
$('tbody').append(' \n' + $('tbody').append(' \n' +
' <tr>\n' + ' <tr>\n' +
' <td>'+e.checkpointName+'</td>\n' + ' <td data-cp-id="'+e.checkpointId+'">'+e.checkpointName+'</td>\n' +
' <td>\n' + ' <td>\n' +
' <div class="select-group">\n' + ' <div class="select-group">\n' +
' <select class="selectgpscheckpoint">\n' + ' <select class="select gpscheckpoint">\n' +
' </select>\n' + ' </select>\n' +
' <span class="down-arrow"></span>\n' + ' <span class="down-arrow"></span>\n' +
' </div>\n' + ' </div>\n' +
...@@ -79,6 +107,7 @@ function getTimeCp(roadId) { ...@@ -79,6 +107,7 @@ function getTimeCp(roadId) {
' <td>'+Number(e.checkpointLatitude).toFixed(6)+','+Number(e.checkpointLongitude).toFixed(6)+'</td>\n' + ' <td>'+Number(e.checkpointLatitude).toFixed(6)+','+Number(e.checkpointLongitude).toFixed(6)+'</td>\n' +
' </tr>'); ' </tr>');
}) })
getGpsCp(roadId);
} }
} }
}) })
...@@ -95,18 +124,48 @@ function getGpsCp(roadId) { ...@@ -95,18 +124,48 @@ function getGpsCp(roadId) {
url : '/gk/roadGpsCheckpoint/getGpsCheckPointByRoadId/'+getCId()+"/"+roadId, url : '/gk/roadGpsCheckpoint/getGpsCheckPointByRoadId/'+getCId()+"/"+roadId,
success:function (data) { success:function (data) {
if(data.status){ if(data.status){
var optionstring=""; $('.load').hide();
$('.noroute').hide();
var optionstring="<option value='' data-lat='' data-lng='' >- -</option>";
//将之前的下拉框的值清空 //将之前的下拉框的值清空
$(".selectgpscheckpoint").empty(); $(".gpscheckpoint").empty();
$.each(data.content,function (i,e) { $.each(data.content,function (i,e) {
//获取项目路线上的打卡点并初始化到下拉框 //获取项目路线上的打卡点并初始化到下拉框
optionstring+='<option value="'+e.checkpointGpsName+'">'+e.checkpointGpsName+'</option>'; optionstring+='<option data-lat="'+e.checkpointLatitude+'" data-lng="'+e.checkpointLongitude+'" value="'+e.checkpointGpsName+'">'+e.checkpointGpsName+'</option>';
}); });
console.log(optionstring); $.each($(".gpscheckpoint"),function (i,e) {
$.each($(".selectgpscheckpoint"),function (i,e) {
$(e).append(optionstring); $(e).append(optionstring);
});
getCpGpsList(roadId);
}else{
$('.road-name[road-id="'+roadId+'"]').append($('.noroute'));
$('.noroute').show();
$('.load').attr('road-id',roadId)
$('.load').show();
$(".gpscheckpoint").append("<option value='' data-lat='' data-lng=''>- -</option>");
}
}
}) })
}
/**
*
* 保存对应关系
*
*/
function saveCpMap(param){
$.ajax({
url : '/gk/roadGpsCheckpoint/save',
type:'post',
contentType:'application/json',
data:JSON.stringify(param),
success:function (data) {
if(data.status){
layer.msg('保存成功!')
}else{
layer.msg('操作失败!')
} }
} }
}) })
} }
\ No newline at end of file
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