Commit 9df0610fb451ad35ef82960718684e18df169406
1 parent
93332032
update...
Showing
3 changed files
with
8 additions
and
17 deletions
src/main/java/com/bsth/data/directive/DirectivesPstThread.java
| @@ -45,6 +45,8 @@ public class DirectivesPstThread extends Thread { | @@ -45,6 +45,8 @@ public class DirectivesPstThread extends Thread { | ||
| 45 | for (int i = 0; i < 1000; i++) { | 45 | for (int i = 0; i < 1000; i++) { |
| 46 | try { | 46 | try { |
| 47 | directive = list.poll(); | 47 | directive = list.poll(); |
| 48 | + if(null == directive) | ||
| 49 | + break; | ||
| 48 | //日期 | 50 | //日期 |
| 49 | directive.setRq(fmtyyyyMMdd.print(directive.getTimestamp())); | 51 | directive.setRq(fmtyyyyMMdd.print(directive.getTimestamp())); |
| 50 | if (directive instanceof D60) { | 52 | if (directive instanceof D60) { |
src/main/java/com/bsth/data/gpsdata_v2/handlers/GpsStateProcess.java
| @@ -28,15 +28,15 @@ public class GpsStateProcess { | @@ -28,15 +28,15 @@ public class GpsStateProcess { | ||
| 28 | return; | 28 | return; |
| 29 | 29 | ||
| 30 | byte upDown = Byte.parseByte(sch.getXlDir()); | 30 | byte upDown = Byte.parseByte(sch.getXlDir()); |
| 31 | + int schState = dayOfSchedule.emptyService(sch)?1:0; | ||
| 31 | 32 | ||
| 32 | - if (gps.getUpDown() != upDown) { | ||
| 33 | - gps.setUpDown(upDown);//修正走向 | 33 | + if(gps.getState() != schState || gps.getUpDown() != upDown){ |
| 34 | + //下发指令纠正车载的 营运状态 和 走向 | ||
| 35 | + gpsStatusManager.changeServiceState(gps.getNbbm(), upDown, schState, "同步@系统"); | ||
| 34 | } | 36 | } |
| 35 | 37 | ||
| 36 | - if ((!gps.isService() || gps.getUpDown() != upDown) && | ||
| 37 | - !dayOfSchedule.emptyService(sch)) { | ||
| 38 | - //下发指令纠正车载的 营运状态 和 走向 | ||
| 39 | - gpsStatusManager.changeServiceState(gps.getNbbm(), upDown, 0, "同步@系统"); | 38 | + if (gps.getUpDown() != upDown) { |
| 39 | + gps.setUpDown(upDown);//修正走向 | ||
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | if (!sch.getXlBm().equals(gps.getLineId())) { | 42 | if (!sch.getXlBm().equals(gps.getLineId())) { |
src/main/java/com/bsth/data/schedule/thread/SchedulePstThread.java
| @@ -66,22 +66,11 @@ public class SchedulePstThread extends Thread { | @@ -66,22 +66,11 @@ public class SchedulePstThread extends Thread { | ||
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | -/* PropertyFilter filter = new PropertyFilter() { | ||
| 70 | - //过滤不需要的字段 | ||
| 71 | - public boolean apply(Object source, String name, Object value) { | ||
| 72 | - if("cTasks".equals(name)||"createBy".equals(name)||"updateBy".equals(name)){ | ||
| 73 | - return false; | ||
| 74 | - } | ||
| 75 | - return true; | ||
| 76 | - } | ||
| 77 | - };*/ | ||
| 78 | - | ||
| 79 | private void save(){ | 69 | private void save(){ |
| 80 | if(saveList.size() == 0) | 70 | if(saveList.size() == 0) |
| 81 | return; | 71 | return; |
| 82 | //记录同步数据 | 72 | //记录同步数据 |
| 83 | logger.info("real schedule update size: " + saveList.size()); | 73 | logger.info("real schedule update size: " + saveList.size()); |
| 84 | - //logger.info(JSON.toJSONString(saveList, filter)); | ||
| 85 | 74 | ||
| 86 | //批量入库 | 75 | //批量入库 |
| 87 | update2Db(); | 76 | update2Db(); |