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,6 +84,7 @@ public class XDApplication implements CommandLineRunner {
84 } 84 }
85 85
86 public void devInit(){ 86 public void devInit(){
  87 + log.info("devInit...");
87 ScheduledExecutorService sexec = Application.mainServices; 88 ScheduledExecutorService sexec = Application.mainServices;
88 //抓取GPS数据 89 //抓取GPS数据
89 gpsDataLoader.setFlag(-1); 90 gpsDataLoader.setFlag(-1);
@@ -98,12 +99,13 @@ public class XDApplication implements CommandLineRunner { @@ -98,12 +99,13 @@ public class XDApplication implements CommandLineRunner {
98 } 99 }
99 100
100 public void prodInit(){ 101 public void prodInit(){
  102 + log.info("prodInit...");
101 ScheduledExecutorService sexec = Application.mainServices; 103 ScheduledExecutorService sexec = Application.mainServices;
102 //发车信息 104 //发车信息
103 sexec.scheduleWithFixedDelay(fcxxUpdateThread, 60, 40, TimeUnit.SECONDS); 105 sexec.scheduleWithFixedDelay(fcxxUpdateThread, 60, 40, TimeUnit.SECONDS);
104 //抓取GPS数据 106 //抓取GPS数据
105 sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS); 107 sexec.scheduleWithFixedDelay(gpsDataLoader, 30, 2, TimeUnit.SECONDS);
106 - //检查设备掉离线 108 + //GPS设备掉离线
107 sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS); 109 sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
108 //实际排班更新线程 110 //实际排班更新线程
109 sexec.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS); 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,6 +33,11 @@ public class CwjyController extends BaseController<Cwjy, Integer>{
33 return service.save(t); 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 @RequestMapping(value = "/queryList",method = RequestMethod.GET) 41 @RequestMapping(value = "/queryList",method = RequestMethod.GET)
37 public List<Ylxxb> queryList(@RequestParam Map<String, Object> map){ 42 public List<Ylxxb> queryList(@RequestParam Map<String, Object> map){
38 List<Ylxxb> pagequery=null; 43 List<Ylxxb> pagequery=null;
src/main/java/com/bsth/controller/report/ReportController.java
@@ -185,8 +185,8 @@ public class ReportController { @@ -185,8 +185,8 @@ public class ReportController {
185 return new ArrayList<Map<String, Object>>(); 185 return new ArrayList<Map<String, Object>>();
186 } 186 }
187 @RequestMapping(value = "/sreachZd", method = RequestMethod.GET) 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,7 +26,7 @@ public class ThreadMonotor extends Thread{
26 } 26 }
27 27
28 if(GpsRealAnalyse.isIdle()){ 28 if(GpsRealAnalyse.isIdle()){
29 - //尝试使用网关的GPS实时对照数据 29 + //切换到备用的网关实时GPS对照数据
30 GpsDataLoaderThread.setFlag(-1); 30 GpsDataLoaderThread.setFlag(-1);
31 } 31 }
32 32
@@ -42,4 +42,4 @@ public class ThreadMonotor extends Thread{ @@ -42,4 +42,4 @@ public class ThreadMonotor extends Thread{
42 DirectivePushQueue.start(); 42 DirectivePushQueue.start();
43 } 43 }
44 } 44 }
45 -} 45 +}
46 \ No newline at end of file 46 \ No newline at end of file
src/main/java/com/bsth/data/gpsdata/GpsEntity.java
@@ -93,7 +93,7 @@ public class GpsEntity { @@ -93,7 +93,7 @@ public class GpsEntity {
93 * 1:网关 93 * 1:网关
94 * 0:转发 94 * 0:转发
95 */ 95 */
96 - private int source; 96 + private int source = -1;
97 97
98 public String getDeviceId() { 98 public String getDeviceId() {
99 return deviceId; 99 return deviceId;
src/main/java/com/bsth/data/gpsdata/arrival/GpsRealAnalyse.java
@@ -56,9 +56,9 @@ public class GpsRealAnalyse { @@ -56,9 +56,9 @@ public class GpsRealAnalyse {
56 56
57 public void analyse(List<GpsEntity> list) { 57 public void analyse(List<GpsEntity> list) {
58 try { 58 try {
59 - st = System.currentTimeMillis();  
60 - if (GpsDataRecovery.run) 59 + if(list.size() == 0 || GpsDataRecovery.run)
61 return; 60 return;
  61 + st = System.currentTimeMillis();
62 62
63 //按线路分组gps 63 //按线路分组gps
64 ArrayListMultimap multimap = ArrayListMultimap.create(); 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,6 +176,10 @@ public class GpsDataLoaderThread extends Thread {
176 String nbbm; 176 String nbbm;
177 for (GpsEntity gps : list) { 177 for (GpsEntity gps : list) {
178 178
  179 + //没有设备号
  180 + if (StringUtils.isBlank(gps.getDeviceId()))
  181 + continue;
  182 +
179 nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId()); 183 nbbm = BasicData.deviceId2NbbmMap.get(gps.getDeviceId());
180 if (StringUtils.isBlank(nbbm)) 184 if (StringUtils.isBlank(nbbm))
181 gps.setIncomplete(true);//标记为异常数据 185 gps.setIncomplete(true);//标记为异常数据
src/main/java/com/bsth/data/safe_driv/SafeDrivDataLoadThread.java
@@ -21,7 +21,7 @@ import java.util.List; @@ -21,7 +21,7 @@ import java.util.List;
21 @Component 21 @Component
22 public class SafeDrivDataLoadThread extends Thread{ 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 Logger logger = LoggerFactory.getLogger(this.getClass()); 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,6 +56,11 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
56 + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc ",nativeQuery=true) 56 + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc ",nativeQuery=true)
57 List<Ylb> obtainYl(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px); 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 @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 ",nativeQuery=true) 65 @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3 ",nativeQuery=true)
61 List<Ylb> queryListYlb(String rq,String nbbm,String jgh); 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,9 +170,12 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
170 List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2); 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 List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm,String nbbm); 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 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir") 179 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir")
177 List<ScheduleRealInfo> setLD(String date); 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,16 +547,18 @@ public class FormsServiceImpl implements FormsService {
547 }); 547 });
548 548
549 List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); 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 for (int i = 0; i < list.size(); i++) { 551 for (int i = 0; i < list.size(); i++) {
552 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); 552 List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
553 Singledata sin=list.get(i); 553 Singledata sin=list.get(i);
554 - sin.setxL(BasicData.lineCode2NameMap.get(sin.getxL())); 554 +
555 String jsy=sin.getJsy(); 555 String jsy=sin.getJsy();
556 String clzbh=sin.getClzbh(); 556 String clzbh=sin.getClzbh();
  557 + String xl=sin.getxL();
  558 + sin.setxL(BasicData.lineCode2NameMap.get(xl));
557 for (int j = 0; j < listReal.size(); j++) { 559 for (int j = 0; j < listReal.size(); j++) {
558 ScheduleRealInfo s=listReal.get(j); 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 newList.add(s); 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,4 +14,6 @@ public interface CwjyService extends BaseService&lt;Cwjy, Integer&gt;{
14 Ylxxb bynbbm(Map<String, Object> map); 14 Ylxxb bynbbm(Map<String, Object> map);
15 15
16 Map<String, Object> savejzl(Map<String, Object> map) throws Exception ; 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,4 +317,13 @@ public class CwjyServiceImpl extends BaseServiceImpl&lt;Cwjy,Integer&gt; implements Cw
317 return yList; 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,6 +270,7 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
270 List<Ylb> addList = new ArrayList<Ylb>(); 270 List<Ylb> addList = new ArrayList<Ylb>();
271 List<Ylb> updateList = new ArrayList<Ylb>(); 271 List<Ylb> updateList = new ArrayList<Ylb>();
272 String ins=""; 272 String ins="";
  273 + Map<String, Object> ylMap=new HashMap<String, Object>();
273 for (int x = 0; x < listpb.size(); x++) { 274 for (int x = 0; x < listpb.size(); x++) {
274 String type = "add"; 275 String type = "add";
275 boolean sfdc = true; 276 boolean sfdc = true;
@@ -332,17 +333,23 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -332,17 +333,23 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
332 t.setCzyl(0.0); 333 t.setCzyl(0.0);
333 } 334 }
334 } 335 }
335 - 336 +
336 Double jzl = 0.0; 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 t.setJzl(jzl); 354 t.setJzl(jzl);
348 t.setNbbm(map.get("clZbh").toString()); 355 t.setNbbm(map.get("clZbh").toString());
@@ -435,8 +442,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -435,8 +442,16 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
435 // 获取车辆存油信息 442 // 获取车辆存油信息
436 List<Cyl> cylList = cylRepository.obtainCyl(nbbm,gsbm); 443 List<Cyl> cylList = cylRepository.obtainCyl(nbbm,gsbm);
437 // 指定日期YLB信息 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 for (int i=0;i<ylbList.size();i++) { 455 for (int i=0;i<ylbList.size();i++) {
441 Ylb ylb = ylbList.get(i); 456 Ylb ylb = ylbList.get(i);
442 // 判断是否已经计算过 457 // 判断是否已经计算过
@@ -499,9 +514,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -499,9 +514,6 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
499 t.setYh(yh); 514 t.setYh(yh);
500 t.setJzyl(nextJzyl); 515 t.setJzyl(nextJzyl);
501 } 516 }
502 -  
503 -  
504 -  
505 } else { 517 } else {
506 t.setCzyl(nextJzyl); 518 t.setCzyl(nextJzyl);
507 Double yh=0.0; 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,16 +2983,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2983 // String date = sdfMonth.format(org.apache.commons.lang.time.DateUtils.addDays(new Date(), -1)); 2983 // String date = sdfMonth.format(org.apache.commons.lang.time.DateUtils.addDays(new Date(), -1));
2984 // String date = "2016-09-20"; 2984 // String date = "2016-09-20";
2985 // System.out.println("shijian1:"+new Date()); 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 // System.out.println("shijian2:"+new Date()); 2994 // System.out.println("shijian2:"+new Date());
2988 // List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); 2995 // List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
2989 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm); 2996 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm);
2990 // System.out.println("shijian3:"+new Date()); 2997 // System.out.println("shijian3:"+new Date());
2991 for (int x = 0; x < yesterdayDataList.size(); x++) { 2998 for (int x = 0; x < yesterdayDataList.size(); x++) {
2992 -  
2993 String jName = yesterdayDataList.get(x).get("jGh").toString(); 2999 String jName = yesterdayDataList.get(x).get("jGh").toString();
2994 String clZbh = yesterdayDataList.get(x).get("clZbh").toString(); 3000 String clZbh = yesterdayDataList.get(x).get("clZbh").toString();
2995 - 3001 + String xlbm = yesterdayDataList.get(x).get("xlBm").toString();
2996 // double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0; 3002 // double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0;
2997 double addMileage = 0, remMileage = 0; 3003 double addMileage = 0, remMileage = 0;
2998 Map<String, Object> map = new HashMap<String, Object>(); 3004 Map<String, Object> map = new HashMap<String, Object>();
@@ -3001,7 +3007,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3001,7 +3007,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3001 String bCompany=""; 3007 String bCompany="";
3002 List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>(); 3008 List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>();
3003 for (ScheduleRealInfo scheduleRealInfo : lists) { 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 if (fage) { 3012 if (fage) {
3006 //根据线路代码获取公司 3013 //根据线路代码获取公司
3007 company=scheduleRealInfo.getGsBm(); 3014 company=scheduleRealInfo.getGsBm();
src/main/java/com/bsth/service/report/ReportService.java
@@ -17,7 +17,7 @@ public interface ReportService { @@ -17,7 +17,7 @@ public interface ReportService {
17 List<ArrivalInfo> queryListClzd(String line,String zd,String zdlx,String fcsj,String ddsj); 17 List<ArrivalInfo> queryListClzd(String line,String zd,String zdlx,String fcsj,String ddsj);
18 List<StationRoute> queryStrinon(String line,int zd); 18 List<StationRoute> queryStrinon(String line,int zd);
19 List<Map<String, Object>> queryInOutStrtion(String line,String date,int zd,String lzsj); 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 List<Object[]> historyMessageCount(String line, String date, String code); 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,18 +252,16 @@ public class ReportServiceImpl implements ReportService{
252 return list; 252 return list;
253 } 253 }
254 @Override 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 List<Map<String, String>> list = new ArrayList<>(); 256 List<Map<String, String>> list = new ArrayList<>();
257 // TODO Auto-generated method stub 257 // TODO Auto-generated method stub
258 List<StationRoute> listSr=stationRoutRepository.findByLine(line,zdlx); 258 List<StationRoute> listSr=stationRoutRepository.findByLine(line,zdlx);
259 for (int i = 0; i < listSr.size(); i++) { 259 for (int i = 0; i < listSr.size(); i++) {
260 StationRoute t=listSr.get(i); 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 return list; 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,7 +11,9 @@ spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11 spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false 11 spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 spring.datasource.username= root 12 spring.datasource.username= root
13 spring.datasource.password= 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 #DATASOURCE 17 #DATASOURCE
16 spring.datasource.max-active=100 18 spring.datasource.max-active=100
17 spring.datasource.max-idle=8 19 spring.datasource.max-idle=8
@@ -27,6 +29,7 @@ spring.datasource.validation-query=select 1 @@ -27,6 +29,7 @@ spring.datasource.validation-query=select 1
27 ## 29 ##
28 #222.66.0.204:5555 30 #222.66.0.204:5555
29 ##\u5B9E\u65F6gps 31 ##\u5B9E\u65F6gps
  32 +http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/
30 #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/ 33 #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/
31 ##\u6D88\u606F\u4E0B\u53D1 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 \ No newline at end of file 36 \ No newline at end of file
src/main/resources/static/pages/control/lineallot/allot.html
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 } 7 }
8 8
9 .line-select.selected { 9 .line-select.selected {
10 - height: 190px; 10 + height: 210px;
11 } 11 }
12 12
13 .line-select .company { 13 .line-select .company {
src/main/resources/static/pages/oil/jyszAdd.html
@@ -123,11 +123,18 @@ $(function(){ @@ -123,11 +123,18 @@ $(function(){
123 submitHandler : function(f) { 123 submitHandler : function(f) {
124 var params = form.serializeJSON(); 124 var params = form.serializeJSON();
125 error.hide(); 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,7 +66,7 @@
66 <span class="item-label" style="width: 60px;margin-left: 19px;">至: </span> 66 <span class="item-label" style="width: 60px;margin-left: 19px;">至: </span>
67 <input class="form-control" type="text" id="date2" style="width: 180px;"/> 67 <input class="form-control" type="text" id="date2" style="width: 180px;"/>
68 <span class="item-label" style="width: 80px;">站点: </span> 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 <option value="">请选择</option> 70 <option value="">请选择</option>
71 <option value="0">上行</option> 71 <option value="0">上行</option>
72 <option value="1">下行</option> 72 <option value="1">下行</option>
@@ -426,55 +426,31 @@ @@ -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 var line = $("#line").val(); 433 var line = $("#line").val();
432 var zdlx = $("#zdlx").val(); 434 var zdlx = $("#zdlx").val();
  435 + console.log(line+"===="+zdlx);
433 if(line==null|| line =="" || zdlx ==null || zdlx==""){ 436 if(line==null|| line =="" || zdlx ==null || zdlx==""){
434 -  
435 }else{ 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 $("#export").on("click",function(){ 455 $("#export").on("click",function(){
480 var rq=$("#date").val(); 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,4 +306,7 @@ span.signal-state-speed-limit{
306 306
307 .home-gps-table dl.offline dd:nth-of-type(1) a{ 307 .home-gps-table dl.offline dd:nth-of-type(1) a{
308 color: #a3a2a2; 308 color: #a3a2a2;
  309 +}
  310 +.uk-tab>li:nth-child(n+2)>a{
  311 + margin-left: 0 !important;
309 } 312 }
310 \ No newline at end of file 313 \ No newline at end of file
src/main/resources/static/real_control_v2/css/line_schedule.css
@@ -17,12 +17,12 @@ @@ -17,12 +17,12 @@
17 } 17 }
18 18
19 .line_schedule .footer-chart { 19 .line_schedule .footer-chart {
20 - height: 243px; 20 + height: 233px;
21 margin-top: 5px; 21 margin-top: 5px;
22 } 22 }
23 23
24 .line_schedule .uk-grid.top-container { 24 .line_schedule .uk-grid.top-container {
25 - height: calc(100% - 260px); 25 + height: calc(100% - 250px);
26 margin-top: 5px; 26 margin-top: 5px;
27 overflow: hidden; 27 overflow: hidden;
28 } 28 }
@@ -127,7 +127,7 @@ @@ -127,7 +127,7 @@
127 } 127 }
128 128
129 .schedule-body { 129 .schedule-body {
130 - height: calc(100% - 37px); 130 + height: calc(100% - 31px);
131 background: #fff; 131 background: #fff;
132 } 132 }
133 133
src/main/resources/static/real_control_v2/css/north.css
1 .north { 1 .north {
2 - height: 120px; 2 + /*height: 120px;*/
3 position: relative; 3 position: relative;
4 transition: all .3s ease; 4 transition: all .3s ease;
  5 + padding-bottom: 0;
5 } 6 }
6 7
7 .north.main { 8 .north.main {
8 background: linear-gradient(to right, #082F4A, #125688, #0a3f64); 9 background: linear-gradient(to right, #082F4A, #125688, #0a3f64);
9 /*background-image: url('/assets/img/title-bg.jpg');*/ 10 /*background-image: url('/assets/img/title-bg.jpg');*/
  11 + padding-bottom: 0;
10 } 12 }
11 13
12 .north.monitor { 14 .north.monitor {
@@ -65,10 +67,10 @@ @@ -65,10 +67,10 @@
65 } 67 }
66 68
67 .north .north-tabs { 69 .north .north-tabs {
68 - position: absolute;  
69 width: 100%; 70 width: 100%;
70 bottom: 1px; 71 bottom: 1px;
71 margin-left: -14px; 72 margin-left: -14px;
  73 + margin-top: 35px;
72 } 74 }
73 75
74 .north .north-tabs .uk-tab { 76 .north .north-tabs .uk-tab {
@@ -81,7 +83,7 @@ @@ -81,7 +83,7 @@
81 } 83 }
82 84
83 .north .north-tabs .uk-tab > li.tab-line > a { 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 .north .north-tabs .uk-tab > li > a:hover, 89 .north .north-tabs .uk-tab > li > a:hover,
@@ -352,4 +354,15 @@ @@ -352,4 +354,15 @@
352 .user_detail_tip .qtip-content{ 354 .user_detail_tip .qtip-content{
353 width: 300px; 355 width: 300px;
354 height: 220px; 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 \ No newline at end of file 369 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/north/toolbar.html
@@ -55,6 +55,9 @@ @@ -55,6 +55,9 @@
55 </li> 55 </li>
56 {{/each}} 56 {{/each}}
57 </ul> 57 </ul>
  58 + <a class="uk-navbar-brand op-beijingtime-time" title="每次秒数到0与服务器同步一次,睡眠状态唤醒会短暂异常,可鼠标右击横幅任意区域立刻同步!">
  59 + <span></span>
  60 + </a>
58 <div class="uk-navbar-content uk-navbar-flip uk-hidden-small" style="padding-left: 0;"> 61 <div class="uk-navbar-content uk-navbar-flip uk-hidden-small" style="padding-left: 0;">
59 <div class="uk-button-group"> 62 <div class="uk-button-group">
60 <button class="uk-button uk-button-danger exit-system">退出线调</button> 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,8 +169,8 @@ var disabled_submit_btn = function (form) {
169 function showUpdateDescription() { 169 function showUpdateDescription() {
170 //更新说明 170 //更新说明
171 var updateDescription = { 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 var storage = window.localStorage 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 \ No newline at end of file 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,6 +17,7 @@ var gb_tabs = (function() {
17 $('.north-tabs').html(tabHtmlStr); 17 $('.north-tabs').html(tabHtmlStr);
18 $('.main-container').html(tabContentHtmlStr); 18 $('.main-container').html(tabContentHtmlStr);
19 19
  20 + setTimeout(renderStyle, 4000);
20 //地图选项卡初始点击 21 //地图选项卡初始点击
21 $('#north_tabs_map_btn').one('click', function () { 22 $('#north_tabs_map_btn').one('click', function () {
22 if(typeof(gb_map_overlay_mge)!="undefined"){ 23 if(typeof(gb_map_overlay_mge)!="undefined"){
@@ -37,6 +38,15 @@ var gb_tabs = (function() { @@ -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 res_load_ep.emitLater('load_tab'); 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,7 +13,7 @@ var gb_safe_driv = (function () {
13 'A7': '与人交谈' 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 var $wrap = $('.safe_driv_pop_wrap'); 18 var $wrap = $('.safe_driv_pop_wrap');
19 var max = 5; 19 var max = 5;
src/main/resources/static/real_control_v2/main.html
@@ -163,6 +163,7 @@ @@ -163,6 +163,7 @@
163 <!-- north js --> 163 <!-- north js -->
164 <script src="/real_control_v2/js/north/toolbar.js" merge="custom_js"></script> 164 <script src="/real_control_v2/js/north/toolbar.js" merge="custom_js"></script>
165 <script src="/real_control_v2/js/north/tabs.js" merge="custom_js"></script> 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 <!-- home js --> 167 <!-- home js -->
167 <script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script> 168 <script src="/real_control_v2/js/home/layout.js" merge="custom_js"></script>
168 <script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script> 169 <script src="/real_control_v2/js/home/line_panel.js" merge="custom_js"></script>