Commit a7f0e7a2 authored by sunyuhua's avatar sunyuhua

设置打卡点,需要对打卡点进行排序,添加了里程的字段

parent 432253ce
...@@ -21,6 +21,8 @@ public class RoadsGpsCheckpointMap { ...@@ -21,6 +21,8 @@ public class RoadsGpsCheckpointMap {
private int checkpointId; private int checkpointId;
@ApiModelProperty(value = "计时打卡点名字", notes = "计时打卡点名字") @ApiModelProperty(value = "计时打卡点名字", notes = "计时打卡点名字")
private String checkpointName; private String checkpointName;
@ApiModelProperty(value = "计时打卡点距离", notes = "计时打卡点距离")
private double checkpointDistance;
@ApiModelProperty(value = "GPS轨迹上标注的打卡点名字", notes = "GPS轨迹上标注的打卡点名字") @ApiModelProperty(value = "GPS轨迹上标注的打卡点名字", notes = "GPS轨迹上标注的打卡点名字")
private String checkpointGpsName; private String checkpointGpsName;
@ApiModelProperty(value = "打卡点的纬度", notes = "打卡点的纬度") @ApiModelProperty(value = "打卡点的纬度", notes = "打卡点的纬度")
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<mapper namespace="com.dlbridge.jadp.plugins.cmpt.dao.mapper.RoadsGpsCheckpointMapper"> <mapper namespace="com.dlbridge.jadp.plugins.cmpt.dao.mapper.RoadsGpsCheckpointMapper">
<select id="getRoadsGpsCheckpoint" resultType="com.dlbridge.jadp.plugins.cmpt.bean.RoadsGpsCheckpointMap"> <select id="getRoadsGpsCheckpoint" resultType="com.dlbridge.jadp.plugins.cmpt.bean.RoadsGpsCheckpointMap">
select id as Id,cmpt_id as cmptId, road_id as roadId,checkpoint_id as checkpointId,checkpoint_name as checkpointName,checkpoint_gps_name as checkpointGpsName,checkpoint_latitude as checkpointLatitude,checkpoint_longitude as checkpointLongitude from gk_roads_gps_checkpoint_map where cmpt_id=#{cmptId} and road_id=#{roadId} and is_delete=0 order by Id select id as Id,cmpt_id as cmptId, road_id as roadId,checkpoint_id as checkpointId,checkpoint_distance AS checkpointDistance,checkpoint_name as checkpointName,checkpoint_gps_name as checkpointGpsName,checkpoint_latitude as checkpointLatitude,checkpoint_longitude as checkpointLongitude from gk_roads_gps_checkpoint_map where cmpt_id=#{cmptId} and road_id=#{roadId} and is_delete=0 order by checkpoint_distance
</select> </select>
...@@ -13,6 +13,9 @@ select id as Id,cmpt_id as cmptId, road_id as roadId,checkpoint_id as checkpoint ...@@ -13,6 +13,9 @@ 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="checkpointDistance != null">
checkpoint_distance = #{checkpointDistance},
</if>
<if test="checkpointGpsName !=null"> <if test="checkpointGpsName !=null">
checkpoint_gps_name = #{checkpointGpsName}, checkpoint_gps_name = #{checkpointGpsName},
</if> </if>
...@@ -27,7 +30,7 @@ select id as Id,cmpt_id as cmptId, road_id as roadId,checkpoint_id as checkpoint ...@@ -27,7 +30,7 @@ select id as Id,cmpt_id as cmptId, road_id as roadId,checkpoint_id as checkpoint
</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_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)
values (#{cmptId},#{roadId},#{checkpointId},#{checkpointName},#{checkpointGpsName},#{checkpointLatitude},#{checkpointLongitude},0) values (#{cmptId},#{roadId},#{checkpointId},#{checkpointName},#{checkpointDistance},#{checkpointGpsName},#{checkpointLatitude},#{checkpointLongitude},0)
</insert> </insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -381,7 +381,8 @@ public class RemoteService { ...@@ -381,7 +381,8 @@ public class RemoteService {
JSONObject o = (JSONObject) result.get(i); JSONObject o = (JSONObject) result.get(i);
String checkpointId = o.getString("checkPointId"); String checkpointId = o.getString("checkPointId");
String checkpointName = o.getString("cpName"); String checkpointName = o.getString("cpName");
roadsGpsCheckpointMap.setCmptId(cmptId).setRoadId(roadId).setCheckpointId(Integer.parseInt(checkpointId)).setCheckpointName(checkpointName); String checkpointDistance=o.getString("distance");
roadsGpsCheckpointMap.setCmptId(cmptId).setRoadId(roadId).setCheckpointId(Integer.parseInt(checkpointId)).setCheckpointName(checkpointName).setCheckpointDistance(Double.parseDouble(checkpointDistance));
roadsGpsCheckpointMapList.add(roadsGpsCheckpointMap); roadsGpsCheckpointMapList.add(roadsGpsCheckpointMap);
} }
return roadsGpsCheckpointMapList; return roadsGpsCheckpointMapList;
......
spring.profiles.active=dev spring.profiles.active=test
...@@ -30,6 +30,7 @@ $(document).ready(function () { ...@@ -30,6 +30,7 @@ $(document).ready(function () {
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 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()
...@@ -39,6 +40,7 @@ $(document).ready(function () { ...@@ -39,6 +40,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.cmptId = cmptId; param.cmptId = cmptId;
param.checkpointName = checkpointName; param.checkpointName = checkpointName;
param.checkpointGpsName = checkpointGpsName; param.checkpointGpsName = checkpointGpsName;
...@@ -97,7 +99,7 @@ function getTimeCp(roadId) { ...@@ -97,7 +99,7 @@ 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 data-cp-id="'+e.checkpointId+'">'+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' +
......
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