Commit 0a2f209c63f07dc28e4dd2581c9fabbc539282b4

Authored by 徐烜
2 parents 28e9f1f9 806da7ab

Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang

Showing 30 changed files with 230 additions and 98 deletions
src/main/java/com/bsth/XDApplication.java
... ... @@ -84,6 +84,7 @@ public class XDApplication implements CommandLineRunner {
84 84 }
85 85  
86 86 public void devInit(){
  87 + log.info("devInit...");
87 88 ScheduledExecutorService sexec = Application.mainServices;
88 89 //抓取GPS数据
89 90 gpsDataLoader.setFlag(-1);
... ... @@ -98,12 +99,13 @@ public class XDApplication implements CommandLineRunner {
98 99 }
99 100  
100 101 public void prodInit(){
  102 + log.info("prodInit...");
101 103 ScheduledExecutorService sexec = Application.mainServices;
102 104 //发车信息
103 105 sexec.scheduleWithFixedDelay(fcxxUpdateThread, 60, 40, TimeUnit.SECONDS);
104 106 //抓取GPS数据
105 107 sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS);
106   - //检查设备掉离线
  108 + //GPS设备掉离线
107 109 sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
108 110 //实际排班更新线程
109 111 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
... ...
src/main/java/com/bsth/controller/oil/CwjyController.java
... ... @@ -33,6 +33,11 @@ public class CwjyController extends BaseController<Cwjy, Integer>{
33 33 return service.save(t);
34 34 }
35 35  
  36 + @RequestMapping(value = "/checkNbbm",method = RequestMethod.GET)
  37 + public int checkNbbm(Cwjy t){
  38 + return service.checkNbbm(t.getNbbm().trim());
  39 + }
  40 +
36 41 @RequestMapping(value = "/queryList",method = RequestMethod.GET)
37 42 public List<Ylxxb> queryList(@RequestParam Map<String, Object> map){
38 43 List<Ylxxb> pagequery=null;
... ...
src/main/java/com/bsth/controller/report/ReportController.java
... ... @@ -185,8 +185,8 @@ public class ReportController {
185 185 return new ArrayList<Map<String, Object>>();
186 186 }
187 187 @RequestMapping(value = "/sreachZd", method = RequestMethod.GET)
188   - public List<Map<String, String>> sreachPersonnel(@RequestParam String line,@RequestParam int zdlx,@RequestParam String zd) {
189   - return service.sreachZd(line,zdlx, zd);
  188 + public List<Map<String, String>> sreachPersonnel(@RequestParam String line,@RequestParam int zdlx) {
  189 + return service.sreachZd(line,zdlx);
190 190 }
191 191  
192 192  
... ...
src/main/java/com/bsth/data/ThreadMonotor.java
... ... @@ -26,7 +26,7 @@ public class ThreadMonotor extends Thread{
26 26 }
27 27  
28 28 if(GpsRealAnalyse.isIdle()){
29   - //尝试使用网关的GPS实时对照数据
  29 + //切换到备用的网关实时GPS对照数据
30 30 GpsDataLoaderThread.setFlag(-1);
31 31 }
32 32  
... ... @@ -42,4 +42,4 @@ public class ThreadMonotor extends Thread{
42 42 DirectivePushQueue.start();
43 43 }
44 44 }
45   -}
  45 +}
46 46 \ No newline at end of file
... ...
src/main/java/com/bsth/data/gpsdata/GpsEntity.java
... ... @@ -93,7 +93,7 @@ public class GpsEntity {
93 93 * 1:网关
94 94 * 0:转发
95 95 */
96   - private int source;
  96 + private int source = -1;
97 97  
98 98 public String getDeviceId() {
99 99 return deviceId;
... ...
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
... ... @@ -56,9 +56,9 @@ public class GpsRealAnalyse {
56 56  
57 57 public void analyse(List<GpsEntity> list) {
58 58 try {
59   - st = System.currentTimeMillis();
60   - if (GpsDataRecovery.run)
  59 + if(list.size() == 0 || GpsDataRecovery.run)
61 60 return;
  61 + st = System.currentTimeMillis();
62 62  
63 63 //按线路分组gps
64 64 ArrayListMultimap multimap = ArrayListMultimap.create();
... ...
src/main/java/com/bsth/data/gpsdata/thread/GpsDataLoaderThread.java
... ... @@ -176,6 +176,10 @@ public class GpsDataLoaderThread extends Thread {
176 176 String nbbm;
177 177 for (GpsEntity gps : list) {
178 178  
  179 + //没有设备号
  180 + if (StringUtils.isBlank(gps.getDeviceId()))
  181 + continue;
  182 +
179 183 nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId());
180 184 if (StringUtils.isBlank(nbbm))
181 185 gps.setIncomplete(true);//标记为异常数据
... ...
src/main/java/com/bsth/data/safe_driv/SafeDrivDataLoadThread.java
... ... @@ -21,7 +21,7 @@ import java.util.List;
21 21 @Component
22 22 public class SafeDrivDataLoadThread extends Thread{
23 23  
24   - private final static String url = "http://180.166.5.82:9988//bsth-safedriving/Crlcxb/realtimeInterface.do";
  24 + private final static String url = "http://118.178.187.115/bsth-safedriving/Crlcxb/realtimeInterface.do";
25 25  
26 26 Logger logger = LoggerFactory.getLogger(this.getClass());
27 27  
... ...
src/main/java/com/bsth/repository/oil/YlbRepository.java
... ... @@ -56,6 +56,11 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
56 56 + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc ",nativeQuery=true)
57 57 List<Ylb> obtainYl(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px);
58 58  
  59 + @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% "
  60 + + " and fgsdm like %?3%"
  61 + + " and xlbm = ?4 and nbbm like %?5% order by ?6 asc ",nativeQuery=true)
  62 + List<Ylb> obtainYl_eq(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px);
  63 +
59 64  
60 65 @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 ",nativeQuery=true)
61 66 List<Ylb> queryListYlb(String rq,String nbbm,String jgh);
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -170,9 +170,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
170 170 List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2);
171 171  
172 172  
173   - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY clZbh,fcsj")
  173 + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate ORDER BY clZbh,fcsj")
174 174 List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String nbbm);
175 175  
  176 + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% and s.clZbh like %?5% GROUP BY xlBm,clZbh,jGh,scheduleDate ORDER BY clZbh,fcsj")
  177 + List<Map<String,Object>> yesterdayDataList_eq(String line,String date,String gsbm,String fgsbm,String nbbm);
  178 +
176 179 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir")
177 180 List<ScheduleRealInfo> setLD(String date);
178 181  
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -547,16 +547,18 @@ public class FormsServiceImpl implements FormsService {
547 547 });
548 548  
549 549 List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm");
550   - List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(xlbm, startDate);
  550 + List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleByDateAndLine(xlbm, startDate);
551 551 for (int i = 0; i < list.size(); i++) {
552 552 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
553 553 Singledata sin=list.get(i);
554   - sin.setxL(BasicData.lineCode2NameMap.get(sin.getxL()));
  554 +
555 555 String jsy=sin.getJsy();
556 556 String clzbh=sin.getClzbh();
  557 + String xl=sin.getxL();
  558 + sin.setxL(BasicData.lineCode2NameMap.get(xl));
557 559 for (int j = 0; j < listReal.size(); j++) {
558 560 ScheduleRealInfo s=listReal.get(j);
559   - if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)){
  561 + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh)&&s.getXlBm().equals(xl)){
560 562 newList.add(s);
561 563 }
562 564 }
... ...
src/main/java/com/bsth/service/oil/CwjyService.java
... ... @@ -14,4 +14,6 @@ public interface CwjyService extends BaseService&lt;Cwjy, Integer&gt;{
14 14 Ylxxb bynbbm(Map<String, Object> map);
15 15  
16 16 Map<String, Object> savejzl(Map<String, Object> map) throws Exception ;
  17 +
  18 + int checkNbbm(String nbbm);
17 19 }
... ...
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
... ... @@ -317,4 +317,13 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
317 317 return yList;
318 318 }
319 319  
  320 + @Override
  321 + public int checkNbbm(String nbbm) {
  322 + // TODO Auto-generated method stub
  323 + String sql="select count(*) from bsth_c_cwjy where nbbm ='"+nbbm+"'";
  324 + int cs=jdbcTemplate.queryForObject(sql, Integer.class);
  325 +
  326 + return cs;
  327 + }
  328 +
320 329 }
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -270,6 +270,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
270 270 List<Ylb> addList = new ArrayList<Ylb>();
271 271 List<Ylb> updateList = new ArrayList<Ylb>();
272 272 String ins="";
  273 + Map<String, Object> ylMap=new HashMap<String, Object>();
273 274 for (int x = 0; x < listpb.size(); x++) {
274 275 String type = "add";
275 276 boolean sfdc = true;
... ... @@ -332,17 +333,23 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
332 333 t.setCzyl(0.0);
333 334 }
334 335 }
335   -
  336 +
336 337 Double jzl = 0.0;
337   - // 把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断)
338   - for (int j = 0; j < ylxxList.size(); j++) {
339   - Ylxxb ylxxb = ylxxList.get(j);
340   - if (map.get("clZbh").toString().equals(ylxxb.getNbbm())
341   - && map.get("jGh").toString().equals(ylxxb.getJsy())) {
342   -// jzl += ylxxb.getJzl();
343   - jzl =Arith.add(jzl, ylxxb.getJzl());
  338 + //一人一车加注量只匹配一次
  339 + if(ylMap.get(map.get("clZbh").toString()+"_"+ map.get("jGh").toString())!=null){
  340 +
  341 + }else{
  342 + // 把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断)
  343 + for (int j = 0; j < ylxxList.size(); j++) {
  344 + Ylxxb ylxxb = ylxxList.get(j);
  345 + if (map.get("clZbh").toString().equals(ylxxb.getNbbm())
  346 + && map.get("jGh").toString().equals(ylxxb.getJsy())) {
  347 + jzl =Arith.add(jzl, ylxxb.getJzl());
  348 + }
344 349 }
  350 + ylMap.put(map.get("clZbh").toString()+"_"+ map.get("jGh").toString(),map.get("xlBm") == null ? "" : map.get("xlBm").toString());
345 351 }
  352 +
346 353  
347 354 t.setJzl(jzl);
348 355 t.setNbbm(map.get("clZbh").toString());
... ... @@ -435,8 +442,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
435 442 // 获取车辆存油信息
436 443 List<Cyl> cylList = cylRepository.obtainCyl(nbbm,gsbm);
437 444 // 指定日期YLB信息
438   - List<Ylb> ylbList =repository.obtainYl(rq,gsbm,fgsbm,"",nbbm,"nbbm,jcsx");
439   - List<Ylb> iterator2=repository.obtainYl(rq,gsbm,fgsbm,"",nbbm,"jcsx");
  445 + List<Ylb> ylbList =new ArrayList<Ylb>();
  446 + List<Ylb> iterator2=new ArrayList<Ylb>();
  447 + if(xlbm.equals("")){
  448 + ylbList=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx");
  449 + iterator2=repository.obtainYl(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx");
  450 + }else{
  451 + ylbList=repository.obtainYl_eq(rq,gsbm,fgsbm,xlbm,nbbm,"jcsx");
  452 + iterator2=repository.obtainYl_eq(rq,gsbm,fgsbm,xlbm,nbbm,"nbbm,jcsx");
  453 + }
  454 +
440 455 for (int i=0;i<ylbList.size();i++) {
441 456 Ylb ylb = ylbList.get(i);
442 457 // 判断是否已经计算过
... ... @@ -499,9 +514,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
499 514 t.setYh(yh);
500 515 t.setJzyl(nextJzyl);
501 516 }
502   -
503   -
504   -
505 517 } else {
506 518 t.setCzyl(nextJzyl);
507 519 Double yh=0.0;
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -2983,16 +2983,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2983 2983 // String date = sdfMonth.format(org.apache.commons.lang.time.DateUtils.addDays(new Date(), -1));
2984 2984 // String date = "2016-09-20";
2985 2985 // System.out.println("shijian1:"+new Date());
2986   - List<Map<String, Object>> yesterdayDataList = scheduleRealInfoRepository.yesterdayDataList(line, date,gsbm,fgsbm,nbbm);
  2986 +
  2987 + List<Map<String, Object>> yesterdayDataList = new ArrayList<Map<String, Object>>();
  2988 + if(line.equals("")){
  2989 + yesterdayDataList=scheduleRealInfoRepository.yesterdayDataList(line, date,gsbm,fgsbm,nbbm);
  2990 + }else{
  2991 + yesterdayDataList=scheduleRealInfoRepository.yesterdayDataList_eq(line, date,gsbm,fgsbm,nbbm);
  2992 + }
  2993 +
2987 2994 // System.out.println("shijian2:"+new Date());
2988 2995 // List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
2989 2996 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm);
2990 2997 // System.out.println("shijian3:"+new Date());
2991 2998 for (int x = 0; x < yesterdayDataList.size(); x++) {
2992   -
2993 2999 String jName = yesterdayDataList.get(x).get("jGh").toString();
2994 3000 String clZbh = yesterdayDataList.get(x).get("clZbh").toString();
2995   -
  3001 + String xlbm = yesterdayDataList.get(x).get("xlBm").toString();
2996 3002 // double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0;
2997 3003 double addMileage = 0, remMileage = 0;
2998 3004 Map<String, Object> map = new HashMap<String, Object>();
... ... @@ -3001,7 +3007,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3001 3007 String bCompany="";
3002 3008 List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>();
3003 3009 for (ScheduleRealInfo scheduleRealInfo : lists) {
3004   - if(scheduleRealInfo.getjGh().equals(jName) && scheduleRealInfo.getClZbh().equals(clZbh)){
  3010 + if(scheduleRealInfo.getjGh().equals(jName) && scheduleRealInfo.getClZbh().equals(clZbh)
  3011 + && scheduleRealInfo.getXlBm().equals(xlbm)){
3005 3012 if (fage) {
3006 3013 //根据线路代码获取公司
3007 3014 company=scheduleRealInfo.getGsBm();
... ...
src/main/java/com/bsth/service/report/ReportService.java
... ... @@ -17,7 +17,7 @@ public interface ReportService {
17 17 List<ArrivalInfo> queryListClzd(String line,String zd,String zdlx,String fcsj,String ddsj);
18 18 List<StationRoute> queryStrinon(String line,int zd);
19 19 List<Map<String, Object>> queryInOutStrtion(String line,String date,int zd,String lzsj);
20   - List<Map<String, String>> sreachZd(String line,int zdlx,String zd);
  20 + List<Map<String, String>> sreachZd(String line,int zdlx);
21 21  
22 22 List<Object[]> historyMessageCount(String line, String date, String code);
23 23  
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -252,18 +252,16 @@ public class ReportServiceImpl implements ReportService{
252 252 return list;
253 253 }
254 254 @Override
255   - public List<Map<String, String>> sreachZd(String line, int zdlx,String zd) {
  255 + public List<Map<String, String>> sreachZd(String line, int zdlx) {
256 256 List<Map<String, String>> list = new ArrayList<>();
257 257 // TODO Auto-generated method stub
258 258 List<StationRoute> listSr=stationRoutRepository.findByLine(line,zdlx);
259 259 for (int i = 0; i < listSr.size(); i++) {
260 260 StationRoute t=listSr.get(i);
261   - if(t.getStationName().indexOf(zd)!=-1){
262   - Map<String, String> newMap=new HashMap<String,String>();
263   - newMap.put("id",t.getStationCode());
264   - newMap.put("text", t.getStationName());
265   - list.add(newMap);
266   - }
  261 + Map<String, String> newMap=new HashMap<String,String>();
  262 + newMap.put("id",t.getStationCode());
  263 + newMap.put("text", t.getStationName());
  264 + list.add(newMap);
267 265 }
268 266 return list;
269 267 }
... ...
src/main/resources/application-dev.properties
... ... @@ -11,7 +11,9 @@ spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11 11 spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 12 spring.datasource.username= root
13 13 spring.datasource.password=
14   -
  14 +#spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  15 +#spring.datasource.username= root
  16 +#spring.datasource.password= root
15 17 #DATASOURCE
16 18 spring.datasource.max-active=100
17 19 spring.datasource.max-idle=8
... ... @@ -27,6 +29,7 @@ spring.datasource.validation-query=select 1
27 29 ##
28 30 #222.66.0.204:5555
29 31 ##\u5B9E\u65F6gps
  32 +http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/
30 33 #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/
31 34 ##\u6D88\u606F\u4E0B\u53D1
32   -http.send.directive = http://192.168.168.201:9090/transport_server/message/
  35 +http.send.directive = http://192.168.168.201:9090/transport_server/message/
33 36 \ No newline at end of file
... ...
src/main/resources/static/pages/control/lineallot/allot.html
... ... @@ -7,7 +7,7 @@
7 7 }
8 8  
9 9 .line-select.selected {
10   - height: 190px;
  10 + height: 210px;
11 11 }
12 12  
13 13 .line-select .company {
... ...
src/main/resources/static/pages/oil/jyszAdd.html
... ... @@ -123,11 +123,18 @@ $(function(){
123 123 submitHandler : function(f) {
124 124 var params = form.serializeJSON();
125 125 error.hide();
126   - $post('/cwjy', params, function(res){
127   - layer.msg('新增加油设置成功.');
128   - $('#add_jysz').modal('hide');
129   - refreshJsTree();
130   - });
  126 + $get('/cwjy/checkNbbm',params,function(result){
  127 + if(result>0){
  128 + layer.msg('该车辆已经添加.');
  129 + }else{
  130 + $post('/cwjy', params, function(result){
  131 + layer.msg('新增加油设置成功.');
  132 + $('#add_jysz').modal('hide');
  133 + refreshJsTree();
  134 + });
  135 + }
  136 + })
  137 +
131 138 }
132 139 });
133 140  
... ...
src/main/resources/static/pages/report/inoutstation.html
... ... @@ -66,7 +66,7 @@
66 66 <span class="item-label" style="width: 60px;margin-left: 19px;">至: </span>
67 67 <input class="form-control" type="text" id="date2" style="width: 180px;"/>
68 68 <span class="item-label" style="width: 80px;">站点: </span>
69   - <select class="form-control" id="zdlx" class="sreach-zd" >
  69 + <select class="form-control sreach-zd" id="zdlx" >
70 70 <option value="">请选择</option>
71 71 <option value="0">上行</option>
72 72 <option value="1">下行</option>
... ... @@ -426,55 +426,31 @@
426 426 });
427 427 }
428 428 })
  429 + $(".sreach-zd").on("change",initZd);
  430 + var status=false;
429 431  
430   - $(".sreach-zd").click(function(){
  432 + function initZd(){
431 433 var line = $("#line").val();
432 434 var zdlx = $("#zdlx").val();
  435 + console.log(line+"===="+zdlx);
433 436 if(line==null|| line =="" || zdlx ==null || zdlx==""){
434   -
435 437 }else{
436   - $('#zd').select2({
437   - placeholder: '搜索站点...',
438   - ajax: {
439   - url: '/report/sreachZd',
440   - dataType: 'json',
441   - delay: 150,
442   - data: function(params){
443   - return{line: line,zdlx:zdlx,zd:params.term};
444   - },
445   - processResults: function (data) {
446   - return {
447   - results: data
448   - };
449   - },
450   - cache: true
451   - },
452   - templateResult: function(repo){
453   - if (repo.loading) return repo.text;
454   - var h = '<span>'+repo.text+'</span>';
455   - return h;
456   - },
457   - escapeMarkup: function (markup) { return markup; },
458   - minimumInputLength: 1,
459   - templateSelection: function(repo){
460   - return repo.text;
461   - },
462   - language: {
463   - noResults: function(){
464   - return '<span style="color:red;font-size: 12px;">没有搜索到站点!</span>';
465   - },
466   - inputTooShort : function(e) {
467   - return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入站点名称</span>';
468   - },
469   - searching : function() {
470   - return '<span style="color:gray;font-size: 12px;"> 正在搜索站点...</span>';
471   - }
  438 + $.get('/report/sreachZd',{line: line,zdlx:zdlx},function(result){
  439 + var zdList=result;
  440 + if(status){
  441 + $("#zd").select2("destroy").html('');
472 442 }
473   - });
  443 + console.log(zdList[0]["id"]);
  444 + var datas=[];
  445 + datas.push({id:" ",text:"全部"});
  446 + for(var i=0;i<zdList.length;i++){
  447 + datas.push({id: zdList[i]["id"], text: zdList[i]["text"]});
  448 + }
  449 + initPinYinSelect2('#zd',datas,'');
  450 + status=true;
  451 + })
474 452 }
475   - })
476   -
477   -
  453 + }
478 454  
479 455 $("#export").on("click",function(){
480 456 var rq=$("#date").val();
... ...
src/main/resources/static/real_control_v2/css/home.css
... ... @@ -306,4 +306,7 @@ span.signal-state-speed-limit{
306 306  
307 307 .home-gps-table dl.offline dd:nth-of-type(1) a{
308 308 color: #a3a2a2;
  309 +}
  310 +.uk-tab>li:nth-child(n+2)>a{
  311 + margin-left: 0 !important;
309 312 }
310 313 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/css/line_schedule.css
... ... @@ -17,12 +17,12 @@
17 17 }
18 18  
19 19 .line_schedule .footer-chart {
20   - height: 243px;
  20 + height: 233px;
21 21 margin-top: 5px;
22 22 }
23 23  
24 24 .line_schedule .uk-grid.top-container {
25   - height: calc(100% - 260px);
  25 + height: calc(100% - 250px);
26 26 margin-top: 5px;
27 27 overflow: hidden;
28 28 }
... ... @@ -127,7 +127,7 @@
127 127 }
128 128  
129 129 .schedule-body {
130   - height: calc(100% - 37px);
  130 + height: calc(100% - 31px);
131 131 background: #fff;
132 132 }
133 133  
... ...
src/main/resources/static/real_control_v2/css/north.css
1 1 .north {
2   - height: 120px;
  2 + /*height: 120px;*/
3 3 position: relative;
4 4 transition: all .3s ease;
  5 + padding-bottom: 0;
5 6 }
6 7  
7 8 .north.main {
8 9 background: linear-gradient(to right, #082F4A, #125688, #0a3f64);
9 10 /*background-image: url('/assets/img/title-bg.jpg');*/
  11 + padding-bottom: 0;
10 12 }
11 13  
12 14 .north.monitor {
... ... @@ -65,10 +67,10 @@
65 67 }
66 68  
67 69 .north .north-tabs {
68   - position: absolute;
69 70 width: 100%;
70 71 bottom: 1px;
71 72 margin-left: -14px;
  73 + margin-top: 35px;
72 74 }
73 75  
74 76 .north .north-tabs .uk-tab {
... ... @@ -81,7 +83,7 @@
81 83 }
82 84  
83 85 .north .north-tabs .uk-tab > li.tab-line > a {
84   - padding: 8px 0px 8px 12px;
  86 + padding: 8px 0px 8px 17px;
85 87 }
86 88  
87 89 .north .north-tabs .uk-tab > li > a:hover,
... ... @@ -352,4 +354,15 @@
352 354 .user_detail_tip .qtip-content{
353 355 width: 300px;
354 356 height: 220px;
  357 +}
  358 +
  359 +.op-beijingtime-time{
  360 + padding-left: 0px;
  361 + width: 107px;
  362 +}
  363 +
  364 +.op-beijingtime-time>span{
  365 + font-size: 18px !important;
  366 + font-family: Microsoft Yahei !important;
  367 + color: blue !important;
355 368 }
356 369 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/north/toolbar.html
... ... @@ -55,6 +55,9 @@
55 55 </li>
56 56 {{/each}}
57 57 </ul>
  58 + <a class="uk-navbar-brand op-beijingtime-time" title="每次秒数到0与服务器同步一次,睡眠状态唤醒会短暂异常,可鼠标右击横幅任意区域立刻同步!">
  59 + <span></span>
  60 + </a>
58 61 <div class="uk-navbar-content uk-navbar-flip uk-hidden-small" style="padding-left: 0;">
59 62 <div class="uk-button-group">
60 63 <button class="uk-button uk-button-danger exit-system">退出线调</button>
... ...
src/main/resources/static/real_control_v2/js/main.js
... ... @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) {
169 169 function showUpdateDescription() {
170 170 //更新说明
171 171 var updateDescription = {
172   - date: '2017-05-12',
173   - text: '<h5>现在班次调整时,备注是必填项</h5><h5>现在中途更换设备后,需要刷新缓存数据后,再刷新线调页面。</h5><h5>分班套跑车辆将在上午最后一个班次完成后发送线路切换指令。捕捉到出场信号时也会切换至出场班次所在线路,驾驶员请求出场时候也会同步一次状态</h5><h5>修复了一些其他问题。</h5>'
  172 + date: '2017-05-16',
  173 + text: '<h5>菜单栏加入了服务器时间</h5>'
174 174 };
175 175  
176 176 var storage = window.localStorage
... ...
src/main/resources/static/real_control_v2/js/north/second_timer.js 0 → 100644
  1 +/**
  2 + * 工具栏上的时钟
  3 + * @type {{}}
  4 + */
  5 +var gb_second_timer = (function () {
  6 +
  7 + var now;
  8 + var _this;
  9 + var secondTimer;
  10 + var contextFlag;
  11 +
  12 + var init = function () {
  13 + _this = $('.op-beijingtime-time>span')[0];
  14 + getServerTime(function (time) {
  15 + now = time;
  16 + $('div.north').bind("contextmenu", function () {
  17 + contextFlag = true;
  18 + });
  19 + setTime();
  20 +
  21 + secondTimer = window.setInterval(function () {
  22 + if(0 == now.getSeconds() || true == contextFlag){
  23 + minuteTimer();
  24 + contextFlag = false;
  25 + }
  26 +
  27 + now = new Date(now.getTime() + 1e3);
  28 + setTime();
  29 + }, 1e3);
  30 + });
  31 + };
  32 +
  33 + var getServerTime = function (callback) {
  34 + function oncallback(jqXHR) {
  35 + var time = jqXHR && jqXHR.getResponseHeader("Date");
  36 + if (time)
  37 + callback(new Date(time))
  38 + }
  39 +
  40 + if ("function" == typeof callback)
  41 + $.ajax({
  42 + url: "/real_control_v2/assets/imgs/time.gif",
  43 + type: "HEAD"
  44 + }).done(function (data, textStatus, jqXHR) {
  45 + oncallback(jqXHR)
  46 + }).fail(function (jqXHR, textStatus, errorThrown) {
  47 + oncallback(jqXHR)
  48 + })
  49 + };
  50 +
  51 + var timeFormat = function(str) {
  52 + return ("0" + str).slice(-2)
  53 + };
  54 +
  55 + var setTime = function () {
  56 + _this.innerHTML = timeFormat(now.getHours()) + ':' + timeFormat(now.getMinutes()) + '.' + timeFormat(now.getSeconds());
  57 + };
  58 +
  59 + var minuteTimer = function () {
  60 + getServerTime(function(time) {
  61 + now = time;
  62 + setTime()
  63 + })
  64 + };
  65 +
  66 + window.setTimeout(init, 6000);
  67 +})();
0 68 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/js/north/tabs.js
... ... @@ -17,6 +17,7 @@ var gb_tabs = (function() {
17 17 $('.north-tabs').html(tabHtmlStr);
18 18 $('.main-container').html(tabContentHtmlStr);
19 19  
  20 + setTimeout(renderStyle, 4000);
20 21 //地图选项卡初始点击
21 22 $('#north_tabs_map_btn').one('click', function () {
22 23 if(typeof(gb_map_overlay_mge)!="undefined"){
... ... @@ -37,6 +38,15 @@ var gb_tabs = (function() {
37 38 });
38 39 };
39 40  
  41 + function renderStyle(){
  42 + var rows = parseInt($('.north-tabs').height() / 32);
  43 + if(rows > 1){
  44 + var contHeight = 120 + ((rows - 1) * 36 - 15);
  45 + $('.main-container').css('height', 'calc(100% - '+contHeight+'px)');
  46 + $('.north .north-tabs').css('margin-top', '20px');
  47 + }
  48 + }
  49 +
40 50 //文件载入完毕
41 51 res_load_ep.emitLater('load_tab');
42 52  
... ...
src/main/resources/static/real_control_v2/js/safe_driv/safeDriv.js
... ... @@ -13,7 +13,7 @@ var gb_safe_driv = (function () {
13 13 'A7': '与人交谈'
14 14 };
15 15  
16   - var path = 'http://180.166.5.82:9988/CurrentSafeDriving/';
  16 + var path = 'http://118.178.187.115/CurrentSafeDriving/';
17 17  
18 18 var $wrap = $('.safe_driv_pop_wrap');
19 19 var max = 5;
... ...
src/main/resources/static/real_control_v2/main.html
... ... @@ -163,6 +163,7 @@
163 163 <!-- north js -->
164 164 <script src="/real_control_v2/js/north/toolbar.js" merge="custom_js"></script>
165 165 <script src="/real_control_v2/js/north/tabs.js" merge="custom_js"></script>
  166 +<script src="/real_control_v2/js/north/second_timer.js" merge="custom_js"></script>
166 167 <!-- home js -->
167 168 <script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script>
168 169 <script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script>
... ...