Commit 60a7e7e79b1368c5014f933b3376ed15c43c5b07

Authored by 潘钊
1 parent 489a76c8

update...

src/main/java/com/bsth/controller/gps/GpsController.java
@@ -91,11 +91,12 @@ public class GpsController { @@ -91,11 +91,12 @@ public class GpsController {
91 91
92 /** 92 /**
93 * gps补全 93 * gps补全
  94 + * type 0 : 实时GPS 1:走补传
94 * @return 95 * @return
95 */ 96 */
96 @RequestMapping(value = "/gpsCompletion", method = RequestMethod.POST) 97 @RequestMapping(value = "/gpsCompletion", method = RequestMethod.POST)
97 - public Map<String, Object> gpsCompletion(@RequestParam long schId) {  
98 - return gpsService.gpsCompletion(schId); 98 + public Map<String, Object> gpsCompletion(@RequestParam long schId, @RequestParam int type) {
  99 + return gpsService.gpsCompletion(schId, type);
99 } 100 }
100 101
101 /** 102 /**
src/main/java/com/bsth/service/gps/GpsService.java
@@ -21,7 +21,7 @@ public interface GpsService { @@ -21,7 +21,7 @@ public interface GpsService {
21 21
22 Map<String,Object> findRoadSpeed(String lineCode); 22 Map<String,Object> findRoadSpeed(String lineCode);
23 23
24 - Map<String,Object> gpsCompletion(long schId); 24 + Map<String,Object> gpsCompletion(long schId, int type);
25 25
26 Map<String,Object> history_v2(String nbbm, long st, long et); 26 Map<String,Object> history_v2(String nbbm, long st, long et);
27 27
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
@@ -445,7 +445,7 @@ public class GpsServiceImpl implements GpsService { @@ -445,7 +445,7 @@ public class GpsServiceImpl implements GpsService {
445 * @return 445 * @return
446 */ 446 */
447 @Override 447 @Override
448 - public Map<String, Object> gpsCompletion(long schId) { 448 + public Map<String, Object> gpsCompletion(long schId, int type) {
449 Map<String, Object> rs = new HashMap<>(); 449 Map<String, Object> rs = new HashMap<>();
450 450
451 try { 451 try {
@@ -482,9 +482,15 @@ public class GpsServiceImpl implements GpsService { @@ -482,9 +482,15 @@ public class GpsServiceImpl implements GpsService {
482 long diff = ((sch.getDfsjT() - Long.parseLong(fs.get("ts").toString())) - 1000 * 70); 482 long diff = ((sch.getDfsjT() - Long.parseLong(fs.get("ts").toString())) - 1000 * 70);
483 483
484 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); 484 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh());
  485 + int serviceState;
485 for (Map<String, Object> map : list) { 486 for (Map<String, Object> map : list) {
486 map.put("device_id", deviceId); 487 map.put("device_id", deviceId);
487 map.put("ts", Long.parseLong(map.get("ts").toString()) + diff); 488 map.put("ts", Long.parseLong(map.get("ts").toString()) + diff);
  489 + if(type==1){
  490 + //走补传协议
  491 + serviceState = Integer.parseInt(map.get("service_state").toString());
  492 + map.put("service_state", serviceState |= 0x00100000);
  493 + }
488 } 494 }
489 495
490 String sqlBefore = "insert into bsth_c_template(", sqlValues = " values("; 496 String sqlBefore = "insert into bsth_c_template(", sqlValues = " values(";
src/main/resources/static/real_control_v2/sch_manage/sch_imitate.html
@@ -379,15 +379,33 @@ @@ -379,15 +379,33 @@
379 } 379 }
380 alt_confirm('确定班次信息? ' + sch.xlName + '、起点 ' + sch.qdzName + ' , 终点 ' + sch.zdzName + ' 、待发 ' + sch.dfsj, function () { 380 alt_confirm('确定班次信息? ' + sch.xlName + '、起点 ' + sch.qdzName + ' , 终点 ' + sch.zdzName + ' 、待发 ' + sch.dfsj, function () {
381 $('.shade-loading').show(); 381 $('.shade-loading').show();
382 - gb_common.$post('/gps/gpsCompletion', {schId: schId}, function (rs) { 382 + gb_common.$post('/gps/gpsCompletion', {schId: schId, type: 0}, function (rs) {
383 $('.shade-loading').hide(); 383 $('.shade-loading').hide();
384 $('.search-form').trigger('submit'); 384 $('.search-form').trigger('submit');
385 }); 385 });
386 }, '我确定是这个班次'); 386 }, '我确定是这个班次');
387 }; 387 };
388 388
  389 + var gps_imitate_after = function (schId) {
  390 + var sch = schArray[schId];
  391 + if(sch.reissue){
  392 + UIkit.notify("<i class='uk-icon-times'></i> 你不能对一个班次重复操作!", {
  393 + status: 'danger'
  394 + });
  395 + return;
  396 + }
  397 + alt_confirm('确定补传班次信息? ' + sch.xlName + '、起点 ' + sch.qdzName + ' , 终点 ' + sch.zdzName + ' 、待发 ' + sch.dfsj, function () {
  398 + $('.shade-loading').show();
  399 + gb_common.$post('/gps/gpsCompletion', {schId: schId, type: 1}, function (rs) {
  400 + $('.shade-loading').hide();
  401 + $('.search-form').trigger('submit');
  402 + });
  403 + }, '我确定补传这个班次');
  404 + }
  405 +
389 var callbackHandler = { 406 var callbackHandler = {
390 - gps_imitate: gps_imitate 407 + gps_imitate: gps_imitate,
  408 + gps_imitate_after: gps_imitate_after
391 } 409 }
392 410
393 $.contextMenu({ 411 $.contextMenu({
@@ -399,7 +417,11 @@ @@ -399,7 +417,11 @@
399 }, 417 },
400 items: { 418 items: {
401 'gps_imitate': { 419 'gps_imitate': {
402 - name: '模拟轨迹' 420 + name: '模拟轨迹(事前)'
  421 +
  422 + },
  423 + 'gps_imitate_after':{
  424 + name: '模拟轨迹(事后补传)'
403 } 425 }
404 } 426 }
405 }); 427 });