Commit 020ed47d3b5e77f6cc68dd57a3e1ff0c7f1e2e42
1 parent
2fbadc1e
update...
Showing
5 changed files
with
40 additions
and
28 deletions
src/main/java/com/bsth/data/BasicData.java
| @@ -257,7 +257,7 @@ public class BasicData { | @@ -257,7 +257,7 @@ public class BasicData { | ||
| 257 | * @Description: TODO(加载线路相关信息) | 257 | * @Description: TODO(加载线路相关信息) |
| 258 | */ | 258 | */ |
| 259 | public void loadLineInfo() { | 259 | public void loadLineInfo() { |
| 260 | - Iterator<Line> iterator = lineRepository.findAll().iterator(); | 260 | + Iterator<Line> iterator = lineRepository.findAllService().iterator(); |
| 261 | 261 | ||
| 262 | Line line; | 262 | Line line; |
| 263 | BiMap<Integer, String> biMap = HashBiMap.create(); | 263 | BiMap<Integer, String> biMap = HashBiMap.create(); |
src/main/java/com/bsth/data/schedule/thread/ScheduleRefreshThread.java
| @@ -49,30 +49,34 @@ public class ScheduleRefreshThread extends Thread{ | @@ -49,30 +49,34 @@ public class ScheduleRefreshThread extends Thread{ | ||
| 49 | Collection<LineConfig> confs = lineConfs.getAll(); | 49 | Collection<LineConfig> confs = lineConfs.getAll(); |
| 50 | 50 | ||
| 51 | String currSchDate, oldSchDate; | 51 | String currSchDate, oldSchDate; |
| 52 | - String lineCode; | 52 | + String lineCode = null; |
| 53 | for(LineConfig conf : confs){ | 53 | for(LineConfig conf : confs){ |
| 54 | - lineCode = conf.getLine().getLineCode(); | ||
| 55 | - oldSchDate = dayOfSchedule.getCurrSchDate().get(lineCode); | ||
| 56 | - currSchDate = dayOfSchedule.calcSchDate(lineCode); | ||
| 57 | - | ||
| 58 | - if(oldSchDate == null || !oldSchDate.equals(currSchDate)){ | 54 | + try{ |
| 55 | + lineCode = conf.getLine().getLineCode(); | ||
| 56 | + oldSchDate = dayOfSchedule.getCurrSchDate().get(lineCode); | ||
| 57 | + currSchDate = dayOfSchedule.calcSchDate(lineCode); | ||
| 59 | 58 | ||
| 60 | - logger.info(lineCode + "开始翻班, " + currSchDate); | 59 | + if(oldSchDate == null || !oldSchDate.equals(currSchDate)){ |
| 61 | 60 | ||
| 62 | - try{ | ||
| 63 | - //清除指令数据 | ||
| 64 | - Set<String> cars = dayOfSchedule.findCarByLineCode(lineCode); | ||
| 65 | - for(String car : cars) | ||
| 66 | - dayOfDirectives.clear(BasicData.deviceId2NbbmMap.inverse().get(car)); | ||
| 67 | - //清除驾驶员上报数据 | ||
| 68 | - pilotReport.clear(lineCode); | ||
| 69 | - }catch (Exception e){ | ||
| 70 | - logger.error("清理 60 和 80出现问题", e); | 61 | + logger.info(lineCode + "开始翻班, " + currSchDate); |
| 62 | + | ||
| 63 | + try{ | ||
| 64 | + //清除指令数据 | ||
| 65 | + Set<String> cars = dayOfSchedule.findCarByLineCode(lineCode); | ||
| 66 | + for(String car : cars) | ||
| 67 | + dayOfDirectives.clear(BasicData.deviceId2NbbmMap.inverse().get(car)); | ||
| 68 | + //清除驾驶员上报数据 | ||
| 69 | + pilotReport.clear(lineCode); | ||
| 70 | + }catch (Exception e){ | ||
| 71 | + logger.error("清理 60 和 80出现问题", e); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + //重载排班数据 | ||
| 75 | + dayOfSchedule.reloadSch(lineCode, currSchDate, false); | ||
| 76 | + logger.info(lineCode + "翻班完成, " + currSchDate + " -班次数量:" + dayOfSchedule.findByLineCode(lineCode).size()); | ||
| 71 | } | 77 | } |
| 72 | - | ||
| 73 | - //重载排班数据 | ||
| 74 | - dayOfSchedule.reloadSch(lineCode, currSchDate, false); | ||
| 75 | - logger.info(lineCode + "翻班完成, " + currSchDate + " -班次数量:" + dayOfSchedule.findByLineCode(lineCode).size()); | 78 | + }catch (Exception e){ |
| 79 | + logger.error("班次更新失败!! -" + lineCode, e); | ||
| 76 | } | 80 | } |
| 77 | } | 81 | } |
| 78 | 82 |
src/main/java/com/bsth/repository/LineRepository.java
| @@ -41,4 +41,7 @@ public interface LineRepository extends BaseRepository<Line, Integer> { | @@ -41,4 +41,7 @@ public interface LineRepository extends BaseRepository<Line, Integer> { | ||
| 41 | 41 | ||
| 42 | @Query(value = " SELECT l FROM Line l where l.company like %?1% and l.brancheCompany like %?2% and l.lineCode like ?3") | 42 | @Query(value = " SELECT l FROM Line l where l.company like %?1% and l.brancheCompany like %?2% and l.lineCode like ?3") |
| 43 | public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); | 43 | public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); |
| 44 | + | ||
| 45 | + @Query("SELECT L FROM Line L where L.destroy=0") | ||
| 46 | + List<Line> findAllService(); | ||
| 44 | } | 47 | } |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -16,8 +16,6 @@ import com.bsth.repository.StationRepository; | @@ -16,8 +16,6 @@ import com.bsth.repository.StationRepository; | ||
| 16 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 16 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 17 | import com.bsth.service.gps.entity.*; | 17 | import com.bsth.service.gps.entity.*; |
| 18 | import com.bsth.util.DateUtils; | 18 | import com.bsth.util.DateUtils; |
| 19 | -import com.bsth.util.PageHelper; | ||
| 20 | -import com.bsth.util.PageObject; | ||
| 21 | import com.bsth.util.TransGPS; | 19 | import com.bsth.util.TransGPS; |
| 22 | import com.bsth.util.TransGPS.Location; | 20 | import com.bsth.util.TransGPS.Location; |
| 23 | import com.bsth.util.db.DBUtils_MS; | 21 | import com.bsth.util.db.DBUtils_MS; |
| @@ -985,11 +983,18 @@ public class GpsServiceImpl implements GpsService { | @@ -985,11 +983,18 @@ public class GpsServiceImpl implements GpsService { | ||
| 985 | 983 | ||
| 986 | public boolean fieldEquals(List<Field> fs, Object obj, Map<String, Object> map) { | 984 | public boolean fieldEquals(List<Field> fs, Object obj, Map<String, Object> map) { |
| 987 | try { | 985 | try { |
| 986 | + String fv, v; | ||
| 988 | for (Field f : fs) { | 987 | for (Field f : fs) { |
| 989 | if (StringUtils.isEmpty(map.get(f.getName()).toString())) | 988 | if (StringUtils.isEmpty(map.get(f.getName()).toString())) |
| 990 | continue; | 989 | continue; |
| 991 | 990 | ||
| 992 | - if (f.get(obj) == null || f.get(obj).toString().indexOf(map.get(f.getName()).toString()) == -1) | 991 | + if(f.get(obj) == null) |
| 992 | + return false; | ||
| 993 | + | ||
| 994 | + fv = f.get(obj).toString(); | ||
| 995 | + v = map.get(f.getName()).toString(); | ||
| 996 | + | ||
| 997 | + if(!fv.startsWith(v) && !fv.endsWith(v)) | ||
| 993 | return false; | 998 | return false; |
| 994 | } | 999 | } |
| 995 | } catch (Exception e) { | 1000 | } catch (Exception e) { |
src/main/resources/static/real_control_v2/fragments/north/nav/all_devices.html
| @@ -7,12 +7,12 @@ | @@ -7,12 +7,12 @@ | ||
| 7 | <div class="uk-panel uk-panel-box uk-panel-box-primary"> | 7 | <div class="uk-panel uk-panel-box uk-panel-box-primary"> |
| 8 | <form class="uk-form search-form"> | 8 | <form class="uk-form search-form"> |
| 9 | <fieldset data-uk-margin> | 9 | <fieldset data-uk-margin> |
| 10 | - <legend> | 10 | + <!--<legend> |
| 11 | 数据检索 | 11 | 数据检索 |
| 12 | - <!-- <div class="legend-tools"> | 12 | + <!– <div class="legend-tools"> |
| 13 | <a class="uk-icon-small uk-icon-hover uk-icon-file-excel-o" data-uk-tooltip title="导出excel"></a> | 13 | <a class="uk-icon-small uk-icon-hover uk-icon-file-excel-o" data-uk-tooltip title="导出excel"></a> |
| 14 | - </div> --> | ||
| 15 | - </legend> | 14 | + </div> –> |
| 15 | + </legend>--> | ||
| 16 | <span class="horizontal-field">线路</span> | 16 | <span class="horizontal-field">线路</span> |
| 17 | <div class="uk-autocomplete uk-form autocomplete-line" > | 17 | <div class="uk-autocomplete uk-form autocomplete-line" > |
| 18 | <input type="text" name="lineId" placeholder="线路"> | 18 | <input type="text" name="lineId" placeholder="线路"> |