Commit aadde91f95120ddca333e8dc7a981c253e5d5231

Authored by 潘钊
2 parents 96338789 0c21b422
src/main/java/com/bsth/repository/schedule/SchedulePlanInfoRepository.java
@@ -21,4 +21,6 @@ public interface SchedulePlanInfoRepository extends BaseRepository<SchedulePlanI @@ -21,4 +21,6 @@ public interface SchedulePlanInfoRepository extends BaseRepository<SchedulePlanI
21 @Query(value = "select s from SchedulePlanInfo s where scheduleDate=?1") 21 @Query(value = "select s from SchedulePlanInfo s where scheduleDate=?1")
22 List<SchedulePlanInfo> findByDate(Date date); 22 List<SchedulePlanInfo> findByDate(Date date);
23 23
  24 + Long deleteByXlAndScheduleDateGreaterThanEqualAndScheduleDateLessThanEqual(Integer xlid, Date startDate, Date endDate);
  25 +
24 } 26 }
src/main/java/com/bsth/service/schedule/SchedulePlanServiceImpl.java
@@ -3,6 +3,7 @@ package com.bsth.service.schedule; @@ -3,6 +3,7 @@ package com.bsth.service.schedule;
3 import com.bsth.entity.Line; 3 import com.bsth.entity.Line;
4 import com.bsth.entity.schedule.*; 4 import com.bsth.entity.schedule.*;
5 import com.bsth.entity.schedule.rule.ScheduleRule1Flat; 5 import com.bsth.entity.schedule.rule.ScheduleRule1Flat;
  6 +import com.bsth.repository.schedule.SchedulePlanInfoRepository;
6 import com.bsth.repository.schedule.SchedulePlanRepository; 7 import com.bsth.repository.schedule.SchedulePlanRepository;
7 import com.bsth.service.LineService; 8 import com.bsth.service.LineService;
8 import com.bsth.service.impl.BaseServiceImpl; 9 import com.bsth.service.impl.BaseServiceImpl;
@@ -37,6 +38,8 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl&lt;SchedulePlan, Long&gt; @@ -37,6 +38,8 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl&lt;SchedulePlan, Long&gt;
37 private IStrategy strategy; 38 private IStrategy strategy;
38 @Autowired 39 @Autowired
39 private SchedulePlanRepository schedulePlanRepository; 40 private SchedulePlanRepository schedulePlanRepository;
  41 + @Autowired
  42 + private SchedulePlanInfoRepository schedulePlanInfoRepository;
40 43
41 @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED) 44 @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
42 @Override 45 @Override
@@ -79,6 +82,11 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl&lt;SchedulePlan, Long&gt; @@ -79,6 +82,11 @@ public class SchedulePlanServiceImpl extends BaseServiceImpl&lt;SchedulePlan, Long&gt;
79 82
80 System.out.println(scheduleResults_output.showGuideboardDesc1()); 83 System.out.println(scheduleResults_output.showGuideboardDesc1());
81 84
  85 + // 2-3、如果排班的数据之前已经有了,删除之前的数据
  86 + schedulePlanInfoRepository.deleteByXlAndScheduleDateGreaterThanEqualAndScheduleDateLessThanEqual(
  87 + xl.getId(), schedulePlan.getScheduleFromTime(), schedulePlan.getScheduleToTime()
  88 + );
  89 +
82 // 3、根据规则返回,组合最后的输出数据 90 // 3、根据规则返回,组合最后的输出数据
83 // 3-1、根据注入的策略服务,获取原始数据 91 // 3-1、根据注入的策略服务,获取原始数据
84 Multimap<Long, TTInfoDetail> gbdTTinfoMaps = strategy.getGuideboardXlTTInfoDetailMaps(xl.getId()); // 路牌对应时刻明细 92 Multimap<Long, TTInfoDetail> gbdTTinfoMaps = strategy.getGuideboardXlTTInfoDetailMaps(xl.getId()); // 路牌对应时刻明细
src/main/resources/static/pages/base/stationroute/addstationstemplate.html
@@ -241,42 +241,45 @@ $(&#39;#add_station_template_mobal&#39;).on(&#39;AddStationTempMobal.show&#39;, function(e,map,a @@ -241,42 +241,45 @@ $(&#39;#add_station_template_mobal&#39;).on(&#39;AddStationTempMobal.show&#39;, function(e,map,a
241 // 如果线路信息不为空 241 // 如果线路信息不为空
242 if(BusLine){ 242 if(BusLine){
243 243
244 - if(BusLine.zB.length == 0){  
245 -  
246 - // 根据坐标点获取两点之间的折线路段  
247 - map.getSectionListPlonly(stationdataList,function(sectiondata) {  
248 -  
249 - // 定义路段信息字符串  
250 - var sectionJSON = JSON.stringify(sectiondata);  
251 -  
252 - // 路段信息JSON字符串  
253 - params.sectionJSON = sectionJSON;  
254 -  
255 - addSave(params,addLine.id,directionData);  
256 -  
257 - }); 244 + // 获取公交线几何对象, 仅当结果自动添加到地图上时有效
  245 + var Polygon = BusLine.getPolyline();
  246 +
  247 + // 返回多边型的点数组(自1.2新增)
  248 + var polyGonArray = Polygon.getPath();
  249 +
  250 + var jsonArray = [{sectionName:lineNameV+dirStr,points:polyGonArray}];
  251 +
  252 + // 定义路段信息字符串
  253 + var sectionJSON = JSON.stringify(jsonArray);
  254 +
  255 + // 路段信息JSON字符串
  256 + params.sectionJSON = sectionJSON;
  257 +
  258 + addSave(params,addLine.id,directionData);
  259 + /* if(BusLine.zB.length == 0){
258 260
259 261
260 262
261 }else { 263 }else {
262 264
263 - // 获取公交线几何对象, 仅当结果自动添加到地图上时有效  
264 - var Polygon = BusLine.getPolyline();  
265 -  
266 - // 返回多边型的点数组(自1.2新增)  
267 - var polyGonArray = Polygon.getPath();  
268 -  
269 - var jsonArray = [{sectionName:lineNameV+dirStr,points:polyGonArray}]; 265 + } */
  266 + }else {
  267 +
  268 +
  269 + // 根据坐标点获取两点之间的折线路段
  270 + map.getSectionListPlonly(stationdataList,function(sectiondata) {
270 271
271 // 定义路段信息字符串 272 // 定义路段信息字符串
272 - var sectionJSON = JSON.stringify(jsonArray); 273 + var sectionJSON = JSON.stringify(sectiondata);
273 274
274 // 路段信息JSON字符串 275 // 路段信息JSON字符串
275 params.sectionJSON = sectionJSON; 276 params.sectionJSON = sectionJSON;
276 277
277 addSave(params,addLine.id,directionData); 278 addSave(params,addLine.id,directionData);
278 279
279 - } 280 + });
  281 +
  282 +
280 } 283 }
281 }); 284 });
282 285
@@ -319,6 +322,7 @@ $(&#39;#add_station_template_mobal&#39;).on(&#39;AddStationTempMobal.show&#39;, function(e,map,a @@ -319,6 +322,7 @@ $(&#39;#add_station_template_mobal&#39;).on(&#39;AddStationTempMobal.show&#39;, function(e,map,a
319 322
320 function addSave(params,lineid,directionData) { 323 function addSave(params,lineid,directionData) {
321 324
  325 +
322 // 保存 326 // 保存
323 ajaxd.manualSave(params,function(rd) { 327 ajaxd.manualSave(params,function(rd) {
324 328
src/main/resources/static/pages/base/stationroute/js/stationroute-list-function.js
@@ -251,7 +251,7 @@ var PublicFunctions = function () { @@ -251,7 +251,7 @@ var PublicFunctions = function () {
251 251
252 console.log(BusLine); 252 console.log(BusLine);
253 253
254 - if(BusLine.zB.length == 0){ 254 + /*if(BusLine.zB.length == 0){
255 255
256 layer.confirm('系统生成该线路【'+lineNameV+'】时获取站点与路段异常!请联系管理员或者检查网络连接是否异常!', { 256 layer.confirm('系统生成该线路【'+lineNameV+'】时获取站点与路段异常!请联系管理员或者检查网络连接是否异常!', {
257 btn : [ '确认' ] 257 btn : [ '确认' ]
@@ -277,7 +277,7 @@ var PublicFunctions = function () { @@ -277,7 +277,7 @@ var PublicFunctions = function () {
277 return ; 277 return ;
278 }); 278 });
279 279
280 - } 280 + }*/
281 281
282 // 获取公交线几何对象, 仅当结果自动添加到地图上时有效 282 // 获取公交线几何对象, 仅当结果自动添加到地图上时有效
283 var Polygon = BusLine.getPolyline(); 283 var Polygon = BusLine.getPolyline();
src/main/resources/static/pages/base/stationroute/js/stationroute-list-map.js
@@ -175,11 +175,26 @@ var WorldsBMap = function () { @@ -175,11 +175,26 @@ var WorldsBMap = function () {
175 175
176 if(r.message=='ok') { 176 if(r.message=='ok') {
177 177
178 - // 获取距离(单位:米)  
179 - points[index+1].distance = r.result.taxi.distance; 178 + console.log(r);
  179 +
  180 + if(r.result.taxi==null) {
  181 +
  182 + // 获取距离(单位:米)
  183 + points[index+1].distance = 0;
  184 +
  185 + // 获取时间(单位:秒)
  186 + points[index+1].duration = 0;
  187 +
  188 + }else {
  189 +
  190 + // 获取距离(单位:米)
  191 + points[index+1].distance = r.result.taxi.distance;
  192 +
  193 + // 获取时间(单位:秒)
  194 + points[index+1].duration = r.result.taxi.duration;
  195 +
  196 + }
180 197
181 - // 获取时间(单位:秒)  
182 - points[index+1].duration = r.result.taxi.duration;  
183 198
184 } 199 }
185 200
@@ -928,7 +943,7 @@ var WorldsBMap = function () { @@ -928,7 +943,7 @@ var WorldsBMap = function () {
928 //获取第一个公交列表显示到map上 943 //获取第一个公交列表显示到map上
929 var fstLine = BusListResult.getBusListItem(i); 944 var fstLine = BusListResult.getBusListItem(i);
930 945
931 - if(fstLine==undefined){ 946 + /*if(fstLine==undefined){
932 947
933 layer.confirm('系统无法生成该线路【'+lineNameValue+'】的站点与路段!请点击返回选择其它方式规划', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){ 948 layer.confirm('系统无法生成该线路【'+lineNameValue+'】的站点与路段!请点击返回选择其它方式规划', {btn : [ '返回' ],icon: 3, title:'提示' }, function(index){
934 949
@@ -947,7 +962,7 @@ var WorldsBMap = function () { @@ -947,7 +962,7 @@ var WorldsBMap = function () {
947 return; 962 return;
948 }); 963 });
949 964
950 - } 965 + }*/
951 966
952 busline.getBusLine(fstLine); 967 busline.getBusLine(fstLine);
953 968