Commit 69ab9eda17dc6d5cfe55b85624ba11d591a624eb
1 parent
2377da07
首末班准点率
电量拆分 调度日报加入大间隔 线路资料修改添加权证配车数
Showing
19 changed files
with
603 additions
and
153 deletions
src/main/java/com/bsth/controller/report/ReportController.java
| @@ -84,12 +84,19 @@ public class ReportController { | @@ -84,12 +84,19 @@ public class ReportController { | ||
| 84 | @RequestParam int zd){ | 84 | @RequestParam int zd){ |
| 85 | return service.queryStrinon(line,zd); | 85 | return service.queryStrinon(line,zd); |
| 86 | } | 86 | } |
| 87 | + //根据排班查到离站 | ||
| 87 | @RequestMapping(value="/queryInOutStrtion" ,method = RequestMethod.GET) | 88 | @RequestMapping(value="/queryInOutStrtion" ,method = RequestMethod.GET) |
| 88 | public List<Map<String, Object>> queryInOutStrtion(@RequestParam String line, | 89 | public List<Map<String, Object>> queryInOutStrtion(@RequestParam String line, |
| 89 | @RequestParam String date,@RequestParam int zd,@RequestParam String lzsj){ | 90 | @RequestParam String date,@RequestParam int zd,@RequestParam String lzsj){ |
| 90 | return service.queryInOutStrtion(line,date,zd,lzsj); | 91 | return service.queryInOutStrtion(line,date,zd,lzsj); |
| 91 | } | 92 | } |
| 92 | 93 | ||
| 94 | + //根据GPS数据查到离站 | ||
| 95 | + @RequestMapping(value="/queryInOutStrtions" ,method = RequestMethod.GET) | ||
| 96 | + public List<Map<String, Object>> queryInOutStrtions(@RequestParam String line, | ||
| 97 | + @RequestParam String date,@RequestParam int zd,@RequestParam String lzsj){ | ||
| 98 | + return service.queryInOutStrtions(line,date,zd,lzsj); | ||
| 99 | + } | ||
| 93 | @RequestMapping(value="/queryListClzd" ,method = RequestMethod.GET) | 100 | @RequestMapping(value="/queryListClzd" ,method = RequestMethod.GET) |
| 94 | public List<ArrivalInfo> queryListClzd(@RequestParam String zd,@RequestParam String line, | 101 | public List<ArrivalInfo> queryListClzd(@RequestParam String zd,@RequestParam String line, |
| 95 | @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){ | 102 | @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){ |
src/main/java/com/bsth/entity/excep/ArrivalInfo.java
| @@ -61,11 +61,12 @@ public class ArrivalInfo { | @@ -61,11 +61,12 @@ public class ArrivalInfo { | ||
| 61 | private String jzsj; | 61 | private String jzsj; |
| 62 | /** -1 则信号有效,但程序标记为不使用 */ | 62 | /** -1 则信号有效,但程序标记为不使用 */ |
| 63 | private int flag = 0; | 63 | private int flag = 0; |
| 64 | - | 64 | + private Date dates; |
| 65 | + private int route; | ||
| 65 | public ArrivalInfo(){} | 66 | public ArrivalInfo(){} |
| 66 | 67 | ||
| 67 | public ArrivalInfo(String deviceId, long ts, String lineCode, int upDown, String stopNo, int inOut, long createDate, | 68 | public ArrivalInfo(String deviceId, long ts, String lineCode, int upDown, String stopNo, int inOut, long createDate, |
| 68 | - int weeksYear, String stopName) { | 69 | + int weeksYear, String stopName,Date dates,int route) { |
| 69 | 70 | ||
| 70 | this.deviceId = deviceId; | 71 | this.deviceId = deviceId; |
| 71 | this.ts = ts; | 72 | this.ts = ts; |
| @@ -75,6 +76,8 @@ public class ArrivalInfo { | @@ -75,6 +76,8 @@ public class ArrivalInfo { | ||
| 75 | this.stopName = stopName; | 76 | this.stopName = stopName; |
| 76 | this.inOut = inOut; | 77 | this.inOut = inOut; |
| 77 | this.createDate = createDate; | 78 | this.createDate = createDate; |
| 79 | + this.dates=dates; | ||
| 80 | + this.route=route; | ||
| 78 | } | 81 | } |
| 79 | 82 | ||
| 80 | /* @Override | 83 | /* @Override |
| @@ -253,6 +256,22 @@ public class ArrivalInfo { | @@ -253,6 +256,22 @@ public class ArrivalInfo { | ||
| 253 | public void setPzh(String pzh) { | 256 | public void setPzh(String pzh) { |
| 254 | this.pzh = pzh; | 257 | this.pzh = pzh; |
| 255 | } | 258 | } |
| 259 | + | ||
| 260 | + public Date getDates() { | ||
| 261 | + return dates; | ||
| 262 | + } | ||
| 263 | + | ||
| 264 | + public void setDates(Date dates) { | ||
| 265 | + this.dates = dates; | ||
| 266 | + } | ||
| 267 | + | ||
| 268 | + public int getRoute() { | ||
| 269 | + return route; | ||
| 270 | + } | ||
| 271 | + | ||
| 272 | + public void setRoute(int route) { | ||
| 273 | + this.route = route; | ||
| 274 | + } | ||
| 256 | 275 | ||
| 257 | 276 | ||
| 258 | 277 |
src/main/java/com/bsth/repository/oil/DlbRepository.java
| @@ -53,7 +53,7 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ | @@ -53,7 +53,7 @@ public interface DlbRepository extends BaseRepository<Dlb, Integer>{ | ||
| 53 | + " ssgsdm like %?2% " | 53 | + " ssgsdm like %?2% " |
| 54 | + " and fgsdm like %?3%" | 54 | + " and fgsdm like %?3%" |
| 55 | + " and xlbm like %?4% and nbbm like %?5% " | 55 | + " and xlbm like %?4% and nbbm like %?5% " |
| 56 | - + " group by nbbm,rq,ssgsdm,fgsdm,xlbm",nativeQuery=true) | 56 | + + " group by nbbm,rq,ssgsdm,fgsdm",nativeQuery=true) |
| 57 | List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); | 57 | List<Object[]> checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm); |
| 58 | 58 | ||
| 59 | @Query(value="select nbbm,sum(cdl*100) as cdl ,sum(zlc*100) as zlc from bsth_c_dlb where to_days(?1)=to_days(rq) and " | 59 | @Query(value="select nbbm,sum(cdl*100) as cdl ,sum(zlc*100) as zlc from bsth_c_dlb where to_days(?1)=to_days(rq) and " |
src/main/java/com/bsth/repository/oil/JdlRepository.java
| @@ -17,25 +17,25 @@ public interface JdlRepository extends BaseRepository<Jdl, Integer>{ | @@ -17,25 +17,25 @@ public interface JdlRepository extends BaseRepository<Jdl, Integer>{ | ||
| 17 | @Transactional | 17 | @Transactional |
| 18 | @Modifying | 18 | @Modifying |
| 19 | @Query(value="INSERT INTO bsth_c_jdl("+ | 19 | @Query(value="INSERT INTO bsth_c_jdl("+ |
| 20 | - "gs_bm, gs_name, fgs_bm, fgs_name, rq, nbbm, jdl, jdz, remarks, creater_date,jsy)" + | 20 | + "gs_bm, gs_name, fgs_bm, fgs_name, rq, nbbm, jdl, jdz, remarks, creater_date)" + |
| 21 | " VALUES(" + | 21 | " VALUES(" + |
| 22 | - "?1,?2,?3,?4,str_to_date(?5,'%Y-%m-%d'),?6,?7,?8,?9,str_to_date(?10,'%Y-%m-%d %H:%i:%s'),?11)", nativeQuery=true) | ||
| 23 | - void insertData(String gsbm, String gsName, String fgsbm, String fgsName, String rq, String nbbm, String jdl, String jdz, String remarks, String createrDate,String jsy); | 22 | + "?1,?2,?3,?4,str_to_date(?5,'%Y-%m-%d'),?6,?7,?8,?9,str_to_date(?10,'%Y-%m-%d %H:%i:%s'))", nativeQuery=true) |
| 23 | + void insertData(String gsbm, String gsName, String fgsbm, String fgsName, String rq, String nbbm, String jdl, String jdz, String remarks, String createrDate); | ||
| 24 | 24 | ||
| 25 | - @Query(value="SELECT * FROM bsth_c_jdl where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm like %?4% and jsy like %?5%" ,nativeQuery=true) | ||
| 26 | - List<Jdl> query(String gsbm, String fgsbm, String rq, String nbbm,String jsy); | 25 | + @Query(value="SELECT * FROM bsth_c_jdl where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm like %?4% " ,nativeQuery=true) |
| 26 | + List<Jdl> query(String gsbm, String fgsbm, String rq, String nbbm); | ||
| 27 | 27 | ||
| 28 | 28 | ||
| 29 | @Query(value="SELECT * FROM bsth_c_jdl where rq = ?",nativeQuery=true) | 29 | @Query(value="SELECT * FROM bsth_c_jdl where rq = ?",nativeQuery=true) |
| 30 | List<Jdl> JdlList( String rq); | 30 | List<Jdl> JdlList( String rq); |
| 31 | 31 | ||
| 32 | - @Query(value="SELECT jdl FROM bsth_c_jdl where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm = ?4 and jsy = ?5 ",nativeQuery=true) | ||
| 33 | - List<Double> queryBySame(String gsbm, String fgsbm, String rq, String nbbm, String jsy); | 32 | + @Query(value="SELECT jdl FROM bsth_c_jdl where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm = ?4 ",nativeQuery=true) |
| 33 | + List<Double> queryBySame(String gsbm, String fgsbm, String rq, String nbbm); | ||
| 34 | 34 | ||
| 35 | 35 | ||
| 36 | @Transactional | 36 | @Transactional |
| 37 | @Modifying | 37 | @Modifying |
| 38 | - @Query(value="UPDATE bsth_c_jdl set jdl = ?1 where gs_bm = ?2 and fgs_bm = ?3 and rq = ?4 and nbbm = ?5 and jsy = ?6",nativeQuery=true) | ||
| 39 | - void UpdateJdl(String jdl, String gsbm, String fgsbm, String rq, String nbbm, String jsy); | 38 | + @Query(value="UPDATE bsth_c_jdl set jdl = ?1 where gs_bm = ?2 and fgs_bm = ?3 and rq = ?4 and nbbm = ?5",nativeQuery=true) |
| 39 | + void UpdateJdl(String jdl, String gsbm, String fgsbm, String rq, String nbbm); | ||
| 40 | 40 | ||
| 41 | } | 41 | } |
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| @@ -9,6 +9,8 @@ import java.text.ParseException; | @@ -9,6 +9,8 @@ import java.text.ParseException; | ||
| 9 | import java.text.SimpleDateFormat; | 9 | import java.text.SimpleDateFormat; |
| 10 | import java.util.ArrayList; | 10 | import java.util.ArrayList; |
| 11 | import java.util.Calendar; | 11 | import java.util.Calendar; |
| 12 | +import java.util.Collections; | ||
| 13 | +import java.util.Comparator; | ||
| 12 | import java.util.Date; | 14 | import java.util.Date; |
| 13 | import java.util.HashMap; | 15 | import java.util.HashMap; |
| 14 | import java.util.Iterator; | 16 | import java.util.Iterator; |
| @@ -428,13 +430,22 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -428,13 +430,22 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 428 | // repository.obtainYl(rq,gsbm,fgsbm,line,nbbm,"nbbm"); | 430 | // repository.obtainYl(rq,gsbm,fgsbm,line,nbbm,"nbbm"); |
| 429 | // 当天YLXXB信息 | 431 | // 当天YLXXB信息 |
| 430 | List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm); | 432 | List<Ylxxb> ylxxList = ylxxbRepository.obtainYlxx(rq, 0,gsbm); |
| 431 | - // 前一天所有车辆最后进场班次信息 | ||
| 432 | -// List<Ylb> ylListBe = repository.obtainYlbefore(rq, gsbm, fgsbm, line, nbbm); | ||
| 433 | -// List<Dlb> ylListBe =repository.listMaxRqJcsx(rq, gsbm, fgsbm, line, nbbm); | ||
| 434 | -// List<Cyl> clyList = cylRepository.obtainCyl(nbbm,gsbm); | ||
| 435 | // 从排班表中计算出行驶的总里程 | 433 | // 从排班表中计算出行驶的总里程 |
| 436 | List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); | 434 | List<Map<String, Object>> listpb =new ArrayList<Map<String, Object>>(); |
| 437 | List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm); | 435 | List<Map<String, Object>> listpbs=scheduleRealInfoService.yesterdayDataList(line, rq, gsbm, fgsbm, "", nbbm); |
| 436 | + Map<String, Double> lcMap=new HashMap<String,Double>(); | ||
| 437 | + for (int i = 0; i < listpbs.size(); i++) { | ||
| 438 | + String cl=listpbs.get(i).get("clZbh").toString(); | ||
| 439 | + Double lc= listpbs.get(i).get("totalKilometers") == null ? 0.0 | ||
| 440 | + : Double.parseDouble(listpbs.get(i).get("totalKilometers").toString()); | ||
| 441 | + if(lcMap.get(cl)==null){ | ||
| 442 | + lcMap.put(cl, lc); | ||
| 443 | + }else{ | ||
| 444 | + Double lc_=lcMap.get(cl); | ||
| 445 | + lcMap.remove(cl); | ||
| 446 | + lcMap.put(cl, Arith.add(lc, lc_)); | ||
| 447 | + } | ||
| 448 | + } | ||
| 438 | List<Jdl> jdlList=jdlRepository.JdlList(rq); | 449 | List<Jdl> jdlList=jdlRepository.JdlList(rq); |
| 439 | String sxtj=map2.get("sxtj").toString(); | 450 | String sxtj=map2.get("sxtj").toString(); |
| 440 | if(sxtj.equals("0")){ | 451 | if(sxtj.equals("0")){ |
| @@ -470,126 +481,134 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -470,126 +481,134 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 470 | } | 481 | } |
| 471 | } | 482 | } |
| 472 | } | 483 | } |
| 473 | - | 484 | + Map<String, Object> newMap_=new HashMap<String,Object>(); |
| 474 | List<Dlb> addList = new ArrayList<Dlb>(); | 485 | List<Dlb> addList = new ArrayList<Dlb>(); |
| 475 | List<Dlb> updateList = new ArrayList<Dlb>(); | 486 | List<Dlb> updateList = new ArrayList<Dlb>(); |
| 476 | String ins=""; | 487 | String ins=""; |
| 477 | Map<String, Object> ylMap=new HashMap<String, Object>(); | 488 | Map<String, Object> ylMap=new HashMap<String, Object>(); |
| 478 | - for (int x = 0; x < listpb.size(); x++) { | 489 | + List<Map<String, Object>> listpb_=listpb; |
| 490 | + Collections.sort(listpb,new NbbmJcsxMap()); | ||
| 491 | + for (int x = 0; x < listpb_.size(); x++) { | ||
| 479 | String type = "add"; | 492 | String type = "add"; |
| 480 | boolean sfdc = false; | 493 | boolean sfdc = false; |
| 481 | - Map<String, Object> map = listpb.get(x); | ||
| 482 | - if (carsMap.get(map.get("clZbh").toString()) != null) { | ||
| 483 | - sfdc = carsMap.get(map.get("clZbh").toString()); | 494 | + Map<String, Object> map_ = listpb_.get(x); |
| 495 | + if (carsMap.get(map_.get("clZbh").toString()) != null) { | ||
| 496 | + sfdc = carsMap.get(map_.get("clZbh").toString()); | ||
| 484 | } else { | 497 | } else { |
| 485 | sfdc = false; | 498 | sfdc = false; |
| 486 | } | 499 | } |
| 487 | if (sfdc) { | 500 | if (sfdc) { |
| 488 | - // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | ||
| 489 | - Dlb t = new Dlb(); | ||
| 490 | - for (int k = 0; k < dlList.size(); k++) { | ||
| 491 | - Dlb t1 = dlList.get(k); | ||
| 492 | - if (t1.getNbbm().equals(map.get("clZbh").toString()) | ||
| 493 | - && t1.getJsy().equals(map.get("jGh").toString()) | ||
| 494 | - && t1.getXlbm().equals(map.get("xlBm").toString())) { | ||
| 495 | - t = t1; | ||
| 496 | - type = "update"; | 501 | + if(newMap_.get(map_.get("clZbh").toString())==null){ |
| 502 | + newMap_.put(map_.get("clZbh").toString(), map_.get("clZbh").toString()); | ||
| 503 | + //车辆总里程 | ||
| 504 | + double zlc =lcMap.get(map_.get("clZbh").toString()); | ||
| 505 | + //车辆总加电量 | ||
| 506 | + Double zjzl = 0.0; | ||
| 507 | + for (int j = 0; j < ylxxList.size(); j++) { | ||
| 508 | + Ylxxb ylxxb = ylxxList.get(j); | ||
| 509 | + if (map_.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 510 | + && map_.get("company").toString().equals(ylxxb.getGsdm())) { | ||
| 511 | + zjzl = Arith.add(zjzl, ylxxb.getJzl()); | ||
| 512 | + } | ||
| 497 | } | 513 | } |
| 498 | - } | ||
| 499 | - | ||
| 500 | - // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | ||
| 501 | - /* if (map.get("seqNumber").toString().equals("1")) { | ||
| 502 | - boolean fage = true; | ||
| 503 | - for (int i = 0; i < ylListBe.size(); i++) { | ||
| 504 | - Ylb ylb = ylListBe.get(i); | ||
| 505 | - if (map.get("clZbh").toString().equals(ylb.getNbbm())) { | ||
| 506 | - if(ylb.getJzyl()>0){ | ||
| 507 | - t.setCzyl(ylb.getJzyl()); | ||
| 508 | - fage = false; | ||
| 509 | - break; | ||
| 510 | - } | ||
| 511 | - | 514 | + for (int i = 0; i < jdlList.size(); i++) { |
| 515 | + Jdl jdl=jdlList.get(i); | ||
| 516 | + if(map_.get("clZbh").toString().equals(jdl.getNbbm()) | ||
| 517 | + &&map_.get("company").toString().equals(jdl.getGsBm()) | ||
| 518 | + &&map_.get("bCompany").toString().equals(jdl.getFgsBm())){ | ||
| 519 | + zjzl = Arith.add(zjzl,jdl.getJdl()); | ||
| 512 | } | 520 | } |
| 513 | } | 521 | } |
| 514 | - if (fage) { | ||
| 515 | - for (int y = 0; y < clyList.size(); y++) { | ||
| 516 | - Cyl cyl = clyList.get(y); | ||
| 517 | - if (map.get("clZbh").toString().equals(cyl.getNbbm())) { | ||
| 518 | - if(cyl!=null){ | ||
| 519 | - if(cyl.getCyl()>=0){ | ||
| 520 | - t.setCzyl(cyl.getCyl()); | ||
| 521 | - fage = false; | ||
| 522 | - break; | ||
| 523 | - }else { | ||
| 524 | - if(cyl.getCxrl()!=null){ | ||
| 525 | - if(cyl.getCxrl()>0){ | ||
| 526 | - t.setCzyl(cyl.getCxrl()); | ||
| 527 | - fage = false; | ||
| 528 | - break; | ||
| 529 | - } | 522 | + |
| 523 | + Double nextJzyl = 0.0; | ||
| 524 | + for (int i = 0; i < listpb.size(); i++) { | ||
| 525 | + Map<String, Object> map = listpb.get(i); | ||
| 526 | + if(map_.get("clZbh").toString().equals(map.get("clZbh").toString())){ | ||
| 527 | + // 判断驾驶员驾驶的该车辆是否已经存入了(查出的结果集中日期是相同的,根据驾驶员、内部编号、线路编码判断) | ||
| 528 | + Dlb t = new Dlb(); | ||
| 529 | + for (int k = 0; k < dlList.size(); k++) { | ||
| 530 | + Dlb t1 = dlList.get(k); | ||
| 531 | + if (t1.getNbbm().equals(map.get("clZbh").toString()) | ||
| 532 | + && t1.getJsy().equals(map.get("jGh").toString()) | ||
| 533 | + && t1.getXlbm().equals(map.get("xlBm").toString())) { | ||
| 534 | + t = t1; | ||
| 535 | + type = "update"; | ||
| 536 | + } | ||
| 537 | + } | ||
| 538 | + Double lc= Double.parseDouble(map.get("totalKilometers").toString()); | ||
| 539 | + if(map.get("seqNumber").toString().equals("1")){ | ||
| 540 | + // 当日的第一个班次,出场油量等于前一天的最后一个班次的进场油量 | ||
| 541 | + Double dh=0.0; | ||
| 542 | + if(zlc>0){ | ||
| 543 | + dh = Double.parseDouble(df.format(zjzl * (lc / zlc))); | ||
| 544 | + } | ||
| 545 | + nextJzyl =Arith.sub(zjzl,dh); | ||
| 546 | + if(zlc>0){ | ||
| 547 | + long l=Math.round(nextJzyl); | ||
| 548 | + double ylxs=l*100/100; | ||
| 549 | + dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); | ||
| 550 | + t.setHd(dh); | ||
| 551 | + t.setCdl(dh); | ||
| 552 | + nextJzyl=ylxs; | ||
| 553 | + }else{ | ||
| 554 | + t.setHd(0.0); | ||
| 555 | + t.setCdl(0.0); | ||
| 556 | + } | ||
| 557 | + }else{ | ||
| 558 | + Double dh=0.0; | ||
| 559 | + if(zlc>0){ | ||
| 560 | + dh = Double.parseDouble(df.format(zjzl * (lc / zlc))); | ||
| 561 | + } | ||
| 562 | + nextJzyl =Arith.sub( nextJzyl,dh); | ||
| 563 | + if(zlc>0){ | ||
| 564 | + long l=0l; | ||
| 565 | + double ylxs=0.0; | ||
| 566 | + if(i==listpb.size()-1){ | ||
| 567 | +// ylxs=czyl; | ||
| 568 | + }else{ | ||
| 569 | + if(listpb.get(i+1).get("clZbh").toString().equals(map.get("clZbh").toString())){ | ||
| 570 | + l=Math.round(nextJzyl); | ||
| 571 | + ylxs=l*100/100; | ||
| 530 | } | 572 | } |
| 573 | + | ||
| 531 | } | 574 | } |
| 575 | + dh=Arith.add(dh, Arith.sub(nextJzyl,ylxs)); | ||
| 576 | + t.setHd(dh); | ||
| 577 | + t.setCdl(dh); | ||
| 578 | + nextJzyl=ylxs; | ||
| 579 | + }else{ | ||
| 580 | + t.setHd(0.0); | ||
| 581 | + t.setCdl(0.0); | ||
| 532 | } | 582 | } |
| 533 | } | 583 | } |
| 584 | + t.setCzcd(100.0); | ||
| 585 | + t.setJzcd(100.0); | ||
| 586 | + t.setNbbm(map.get("clZbh").toString()); | ||
| 587 | + t.setJsy(map.get("jGh") == null ? "" : map.get("jGh").toString()); | ||
| 588 | + t.setZlc(map.get("totalKilometers") == null ? 0.0 | ||
| 589 | + : Double.parseDouble(map.get("totalKilometers").toString())); | ||
| 590 | + t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | ||
| 591 | + t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | ||
| 592 | + t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); | ||
| 593 | + t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | ||
| 594 | + t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | ||
| 595 | + t.setRq(sdf.parse(rq)); | ||
| 596 | + | ||
| 597 | + if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 598 | + if(type.equals("add")){ | ||
| 599 | + t.setCreatetime(date); | ||
| 600 | + addList.add(t); | ||
| 601 | + }else{ | ||
| 602 | + t.setUpdatetime(date); | ||
| 603 | + updateList.add(t); | ||
| 604 | + ins += t.getId().toString()+","; | ||
| 605 | + } | ||
| 606 | + } | ||
| 607 | +// repository.save(t); | ||
| 608 | + newMap.put("status", ResponseCode.SUCCESS); | ||
| 534 | } | 609 | } |
| 535 | } | 610 | } |
| 536 | - if (fage) { | ||
| 537 | - t.setCzyl(0.0); | ||
| 538 | - } | ||
| 539 | - } | ||
| 540 | - */ | ||
| 541 | - Double jzl = 0.0; | ||
| 542 | - //一人一车加注量只匹配一次 | ||
| 543 | - if(ylMap.get(map.get("clZbh").toString()+"_"+ map.get("jGh").toString())!=null){ | ||
| 544 | - | ||
| 545 | - }else{ | ||
| 546 | - // 把当天的YLXXB的加注量设置为当天YLB的加注量(根据车号,驾驶员判断) | ||
| 547 | - for (int j = 0; j < ylxxList.size(); j++) { | ||
| 548 | - Ylxxb ylxxb = ylxxList.get(j); | ||
| 549 | - if (map.get("clZbh").toString().equals(ylxxb.getNbbm()) | ||
| 550 | - && map.get("jGh").toString().equals(ylxxb.getJsy())) { | ||
| 551 | - jzl +=Arith.add(jzl, ylxxb.getJzl()); | ||
| 552 | - } | ||
| 553 | - } | ||
| 554 | - ylMap.put(map.get("clZbh").toString()+"_"+ map.get("jGh").toString(),map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | ||
| 555 | } | 611 | } |
| 556 | - for (int i = 0; i < jdlList.size(); i++) { | ||
| 557 | - Jdl jdl=jdlList.get(i); | ||
| 558 | - if(map.get("clZbh").toString().equals(jdl.getNbbm()) | ||
| 559 | - &&map.get("jGh").toString().equals(jdl.getJsy()) | ||
| 560 | - &&map.get("bCompany").toString().equals(jdl.getFgsBm())){ | ||
| 561 | - jzl+=jdl.getJdl(); | ||
| 562 | - } | ||
| 563 | - } | ||
| 564 | - | ||
| 565 | - t.setCdl(jzl); | ||
| 566 | - t.setCzcd(100.0); | ||
| 567 | - t.setJzcd(100.0); | ||
| 568 | - t.setHd(jzl); | ||
| 569 | - t.setNbbm(map.get("clZbh").toString()); | ||
| 570 | - t.setJsy(map.get("jGh") == null ? "" : map.get("jGh").toString()); | ||
| 571 | - t.setZlc(map.get("totalKilometers") == null ? 0.0 | ||
| 572 | - : Double.parseDouble(map.get("totalKilometers").toString())); | ||
| 573 | - t.setXlbm(map.get("xlBm") == null ? "" : map.get("xlBm").toString()); | ||
| 574 | - t.setJcsx(Integer.parseInt(map.get("seqNumber").toString())); | ||
| 575 | - t.setSsgsdm(map.get("company") == null ? "" : map.get("company").toString()); | ||
| 576 | - t.setFgsdm(map.get("bCompany") == null ? "" : map.get("bCompany").toString()); | ||
| 577 | - t.setJhsj(map.get("fcsj")==null?"":map.get("fcsj").toString()); | ||
| 578 | - t.setRq(sdf.parse(rq)); | ||
| 579 | - | ||
| 580 | - if(!(t.getSsgsdm().equals("") || t.getFgsdm().equals(""))){ | ||
| 581 | - if(type.equals("add")){ | ||
| 582 | - t.setCreatetime(date); | ||
| 583 | - addList.add(t); | ||
| 584 | - }else{ | ||
| 585 | - t.setUpdatetime(date); | ||
| 586 | - updateList.add(t); | ||
| 587 | - ins += t.getId().toString()+","; | ||
| 588 | - } | ||
| 589 | - } | ||
| 590 | -// repository.save(t); | ||
| 591 | - newMap.put("status", ResponseCode.SUCCESS); | ||
| 592 | - | ||
| 593 | } | 612 | } |
| 594 | } | 613 | } |
| 595 | if(addList.size()>0){ | 614 | if(addList.size()>0){ |
| @@ -1014,3 +1033,11 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -1014,3 +1033,11 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 1014 | return lists; | 1033 | return lists; |
| 1015 | } | 1034 | } |
| 1016 | } | 1035 | } |
| 1036 | + | ||
| 1037 | +class NbbmJcsxMap implements Comparator<Map<String, Object>>{ | ||
| 1038 | + @Override | ||
| 1039 | + public int compare(Map<String, Object> o1, Map<String, Object> o2) { | ||
| 1040 | + // TODO Auto-generated method stub | ||
| 1041 | + return (o1.get("clZbh").toString()+o1.get("seqNumber").toString()).compareTo((o2.get("clZbh").toString()+o1.get("seqNumber").toString())); | ||
| 1042 | + } | ||
| 1043 | +} |
src/main/java/com/bsth/service/oil/impl/JdlServiceImpl.java
| @@ -63,7 +63,7 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | @@ -63,7 +63,7 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | ||
| 63 | } | 63 | } |
| 64 | String[] split = (text+";").split(","); | 64 | String[] split = (text+";").split(","); |
| 65 | String str = ""; | 65 | String str = ""; |
| 66 | - for(int j = 0; j < split.length && j < 6; j++){ | 66 | + for(int j = 0; j < split.length && j < 5; j++){ |
| 67 | str += split[j]; | 67 | str += split[j]; |
| 68 | } | 68 | } |
| 69 | if(str.trim().length() == 0) | 69 | if(str.trim().length() == 0) |
| @@ -75,22 +75,22 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | @@ -75,22 +75,22 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | ||
| 75 | String[] split = text.split(","); | 75 | String[] split = text.split(","); |
| 76 | String rq = split[0].trim(); | 76 | String rq = split[0].trim(); |
| 77 | String nbbm = split[1].trim(); | 77 | String nbbm = split[1].trim(); |
| 78 | - String jsy= split[2].trim(); | ||
| 79 | - double jdl = Double.valueOf(split[3].trim().length()!=0?split[3]:"0"); | ||
| 80 | - String jdz = split[4].trim(); | ||
| 81 | - String remarks = split[5].trim(); | 78 | +// String jsy= split[2].trim(); |
| 79 | + double jdl = Double.valueOf(split[2].trim().length()!=0?split[2]:"0"); | ||
| 80 | + String jdz = split[3].trim(); | ||
| 81 | + String remarks = split[4].trim(); | ||
| 82 | if(rq.trim().length() == 0){ | 82 | if(rq.trim().length() == 0){ |
| 83 | rq = sdf.format(new Date()); | 83 | rq = sdf.format(new Date()); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | - List<Double> jdl_ = repository.queryBySame(gsbm, fgsbm, rq, nbbm, jsy); | 86 | + List<Double> jdl_ = repository.queryBySame(gsbm, fgsbm, rq, nbbm); |
| 87 | 87 | ||
| 88 | if(jdl_.size() == 0){ | 88 | if(jdl_.size() == 0){ |
| 89 | repository.insertData(gsbm, gsName, fgsbm, fgsName, rq, nbbm, | 89 | repository.insertData(gsbm, gsName, fgsbm, fgsName, rq, nbbm, |
| 90 | - df.format(jdl), jdz, remarks, sd.format(new Date()),jsy); | 90 | + df.format(jdl), jdz, remarks, sd.format(new Date())); |
| 91 | }else{ | 91 | }else{ |
| 92 | // jdl += jdl_.get(0); | 92 | // jdl += jdl_.get(0); |
| 93 | - repository.UpdateJdl(df.format(jdl), gsbm, fgsbm, rq, nbbm, jsy); | 93 | + repository.UpdateJdl(df.format(jdl), gsbm, fgsbm, rq, nbbm); |
| 94 | } | 94 | } |
| 95 | } | 95 | } |
| 96 | wb.close(); | 96 | wb.close(); |
| @@ -112,9 +112,9 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | @@ -112,9 +112,9 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | ||
| 112 | String fgsbm = map.get("fgsbm").toString(); | 112 | String fgsbm = map.get("fgsbm").toString(); |
| 113 | String rq = map.get("rq").toString(); | 113 | String rq = map.get("rq").toString(); |
| 114 | String nbbm = map.get("nbbm").toString(); | 114 | String nbbm = map.get("nbbm").toString(); |
| 115 | - String jsy =map.get("jsy").toString(); | 115 | +// String jsy =map.get("jsy").toString(); |
| 116 | Integer page = Integer.valueOf(map.containsKey("page")?map.get("page").toString():"0"); | 116 | Integer page = Integer.valueOf(map.containsKey("page")?map.get("page").toString():"0"); |
| 117 | - List<Jdl> query = repository.query(gsbm, fgsbm, rq, nbbm,jsy); | 117 | + List<Jdl> query = repository.query(gsbm, fgsbm, rq, nbbm); |
| 118 | 118 | ||
| 119 | if(!map.containsKey("type")){ | 119 | if(!map.containsKey("type")){ |
| 120 | 120 | ||
| @@ -133,7 +133,6 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | @@ -133,7 +133,6 @@ public class JdlServiceImpl extends BaseServiceImpl<Jdl, Integer> implements Jdl | ||
| 133 | m.put("nbbm", jdl.getNbbm()); | 133 | m.put("nbbm", jdl.getNbbm()); |
| 134 | m.put("jdl", jdl.getJdl()); | 134 | m.put("jdl", jdl.getJdl()); |
| 135 | m.put("jdz", jdl.getJdz()); | 135 | m.put("jdz", jdl.getJdz()); |
| 136 | - m.put("jsy", jdl.getJsy()); | ||
| 137 | m.put("remarks", jdl.getRemarks()); | 136 | m.put("remarks", jdl.getRemarks()); |
| 138 | list.add(m); | 137 | list.add(m); |
| 139 | } | 138 | } |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -1837,7 +1837,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1837,7 +1837,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1837 | map = new HashMap<String, Object>(); | 1837 | map = new HashMap<String, Object>(); |
| 1838 | map.put("num", i++); | 1838 | map.put("num", i++); |
| 1839 | map.put("xlName", xlName); | 1839 | map.put("xlName", xlName); |
| 1840 | - map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2])); | 1840 | + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2])==null?"":BasicData.deviceId2NbbmMap.get(obj[2])); |
| 1841 | map.put("company",fgs); | 1841 | map.put("company",fgs); |
| 1842 | map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase()); | 1842 | map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase()); |
| 1843 | map.put("requestTime", obj[1]); | 1843 | map.put("requestTime", obj[1]); |
| @@ -2324,10 +2324,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2324,10 +2324,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2324 | map.put("dtbc", 0); | 2324 | map.put("dtbc", 0); |
| 2325 | map.put("dtbc_m", 0); | 2325 | map.put("dtbc_m", 0); |
| 2326 | map.put("dtbc_a", 0); | 2326 | map.put("dtbc_a", 0); |
| 2327 | - map.put("djg", 0); | ||
| 2328 | - map.put("djg_m", 0); | ||
| 2329 | - map.put("djg_a", 0); | ||
| 2330 | - map.put("djg_time", 0); | 2327 | + Map<String, Object> m=culateService.culateDjg(list_s, line); |
| 2328 | + map.put("djg", m.get("djgcsq")); | ||
| 2329 | + map.put("djg_m", m.get("djgcsz")); | ||
| 2330 | + map.put("djg_a", m.get("djgcsw")); | ||
| 2331 | + map.put("djg_time", m.get("djgsj")); | ||
| 2331 | map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl)); | 2332 | map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl)); |
| 2332 | lMap.add(map); | 2333 | lMap.add(map); |
| 2333 | return lMap; | 2334 | return lMap; |
src/main/java/com/bsth/service/report/CulateMileageService.java
| @@ -30,6 +30,8 @@ public interface CulateMileageService { | @@ -30,6 +30,8 @@ public interface CulateMileageService { | ||
| 30 | 30 | ||
| 31 | int culateFzbc(List<ScheduleRealInfo> lists,String item); | 31 | int culateFzbc(List<ScheduleRealInfo> lists,String item); |
| 32 | 32 | ||
| 33 | + Map<String, Object> culateDjg(List<ScheduleRealInfo> lists,String line); | ||
| 34 | + | ||
| 33 | 35 | ||
| 34 | 36 | ||
| 35 | //以下计算方法供新报表使用 | 37 | //以下计算方法供新报表使用 |
src/main/java/com/bsth/service/report/ReportService.java
| @@ -17,6 +17,8 @@ public interface ReportService { | @@ -17,6 +17,8 @@ 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 | + | ||
| 21 | + List<Map<String, Object>> queryInOutStrtions(String line,String date,int zd,String lzsj); | ||
| 20 | List<Map<String, String>> sreachZd(String line,int zdlx); | 22 | List<Map<String, String>> sreachZd(String line,int zdlx); |
| 21 | 23 | ||
| 22 | List<Object[]> historyMessageCount(String line, String date, String code); | 24 | List<Object[]> historyMessageCount(String line, String date, String code); |
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
| 1 | package com.bsth.service.report.impl; | 1 | package com.bsth.service.report.impl; |
| 2 | 2 | ||
| 3 | +import java.sql.ResultSet; | ||
| 4 | +import java.sql.SQLException; | ||
| 5 | +import java.text.DecimalFormat; | ||
| 6 | +import java.text.ParseException; | ||
| 7 | +import java.text.SimpleDateFormat; | ||
| 3 | import java.util.ArrayList; | 8 | import java.util.ArrayList; |
| 4 | import java.util.Collections; | 9 | import java.util.Collections; |
| 5 | import java.util.HashMap; | 10 | import java.util.HashMap; |
| @@ -9,18 +14,26 @@ import java.util.Map; | @@ -9,18 +14,26 @@ import java.util.Map; | ||
| 9 | import java.util.Set; | 14 | import java.util.Set; |
| 10 | 15 | ||
| 11 | import org.apache.commons.lang.StringUtils; | 16 | import org.apache.commons.lang.StringUtils; |
| 17 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 18 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 19 | +import org.springframework.jdbc.core.RowMapper; | ||
| 12 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
| 13 | 21 | ||
| 22 | +import com.bsth.data.BasicData; | ||
| 14 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 23 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 15 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 24 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 25 | +import com.bsth.entity.sys.Interval; | ||
| 16 | import com.bsth.service.report.CulateMileageService; | 26 | import com.bsth.service.report.CulateMileageService; |
| 17 | import com.bsth.util.Arith; | 27 | import com.bsth.util.Arith; |
| 28 | +import com.bsth.util.ComparableChild; | ||
| 18 | import com.bsth.util.ComparableJob; | 29 | import com.bsth.util.ComparableJob; |
| 30 | +import com.bsth.util.ReportUtils; | ||
| 19 | import com.google.common.util.concurrent.AbstractScheduledService.Scheduler; | 31 | import com.google.common.util.concurrent.AbstractScheduledService.Scheduler; |
| 20 | 32 | ||
| 21 | @Service | 33 | @Service |
| 22 | public class CulateMileageServiceImpl implements CulateMileageService{ | 34 | public class CulateMileageServiceImpl implements CulateMileageService{ |
| 23 | - | 35 | + @Autowired |
| 36 | + JdbcTemplate jdbcTemplate; | ||
| 24 | private static long zgf1 = 6 * 60 + 31, | 37 | private static long zgf1 = 6 * 60 + 31, |
| 25 | zgf2 = 8 * 60 + 30, | 38 | zgf2 = 8 * 60 + 30, |
| 26 | wgf1 = 16 * 60 + 1, | 39 | wgf1 = 16 * 60 + 1, |
| @@ -943,6 +956,209 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -943,6 +956,209 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 943 | } | 956 | } |
| 944 | return kfks; | 957 | return kfks; |
| 945 | } | 958 | } |
| 959 | + | ||
| 960 | + @Override | ||
| 961 | + public Map<String, Object> culateDjg(List<ScheduleRealInfo> lists, String line) { | ||
| 962 | + // TODO Auto-generated method stub | ||
| 963 | + | ||
| 964 | + | ||
| 965 | + // TODO Auto-generated method stub | ||
| 966 | + List<ScheduleRealInfo> list=lists; | ||
| 967 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 968 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); | ||
| 969 | +// Collections.sort(listInfo,new ComparableAcuals()); | ||
| 970 | + //查询所有线路 | ||
| 971 | + String xlSql="select line_code,spac_grade from bsth_c_line" | ||
| 972 | + + " where line_code ='"+line+"'"; | ||
| 973 | + | ||
| 974 | + List<Map<String, Object>> xlList=jdbcTemplate.query(xlSql, new RowMapper<Map<String, Object>>() { | ||
| 975 | + @Override | ||
| 976 | + public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 977 | + Map<String, Object> map=new HashMap<String,Object>(); | ||
| 978 | + map.put("line",arg0.getString("line_code")); | ||
| 979 | + map.put("grade", arg0.getString("spac_grade")); | ||
| 980 | + return map; | ||
| 981 | + } | ||
| 982 | + }); | ||
| 983 | + //查询大间隔时间 | ||
| 984 | + String djgSql="select * from bsth_c_interval"; | ||
| 985 | + List<Interval> djgList=jdbcTemplate.query(djgSql, new RowMapper<Interval>() { | ||
| 986 | + @Override | ||
| 987 | + public Interval mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 988 | + Interval m=new Interval(); | ||
| 989 | + m.setLevel(arg0.getString("level")); | ||
| 990 | + m.setPeak(arg0.getInt("peak")); | ||
| 991 | + m.setTrough(arg0.getInt("trough")); | ||
| 992 | + return m; | ||
| 993 | + } | ||
| 994 | + }); | ||
| 995 | + | ||
| 996 | + for (int i = 0; i < xlList.size(); i++) { | ||
| 997 | + String lineCode=xlList.get(i).get("line").toString(); | ||
| 998 | + String grade =xlList.get(i).get("grade")==null?"1":xlList.get(i).get("grade").toString(); | ||
| 999 | + int peak=0; | ||
| 1000 | + int trough=0; | ||
| 1001 | + for (int j = 0; j < djgList.size(); j++) { | ||
| 1002 | + Interval il=djgList.get(j); | ||
| 1003 | + if(il.getLevel().equals(grade)){ | ||
| 1004 | + peak=il.getPeak(); | ||
| 1005 | + trough=il.getTrough(); | ||
| 1006 | + continue; | ||
| 1007 | + } | ||
| 1008 | + } | ||
| 1009 | + List<ScheduleRealInfo> listInfo=new ArrayList<ScheduleRealInfo>(); | ||
| 1010 | + for (int j = 0; j < list.size(); j++) { | ||
| 1011 | + ScheduleRealInfo sinfo=list.get(j); | ||
| 1012 | + try { | ||
| 1013 | + if(sinfo.getXlBm().equals(lineCode)){ | ||
| 1014 | + ScheduleRealInfo s=checkBc(sinfo); | ||
| 1015 | + String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual(); | ||
| 1016 | + if(!fcsj.equals("")){ | ||
| 1017 | + Long fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime(); | ||
| 1018 | + s.setFcsjActualTime(fcsjAcual); | ||
| 1019 | + s.setFcsjActual(fcsj); | ||
| 1020 | + listInfo.add(s); | ||
| 1021 | + } | ||
| 1022 | + | ||
| 1023 | + } | ||
| 1024 | + } catch (ParseException e) { | ||
| 1025 | + // TODO Auto-generated catch block | ||
| 1026 | + e.printStackTrace(); | ||
| 1027 | + } | ||
| 1028 | + } | ||
| 1029 | + | ||
| 1030 | + if(listInfo.size()>0){ | ||
| 1031 | + m=listDjg(peak,trough,listInfo,grade); | ||
| 1032 | + } | ||
| 1033 | + } | ||
| 1034 | + return m; | ||
| 1035 | + | ||
| 1036 | + } | ||
| 1037 | + | ||
| 1038 | + public ScheduleRealInfo checkBc(ScheduleRealInfo s){ | ||
| 1039 | + //如果班次有子任务 且 子任务中有属于营运的。把该子任务的发车时间设置成班次的发车时间 | ||
| 1040 | + String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual(); | ||
| 1041 | + if(fcsj.equals("")){ | ||
| 1042 | + Set<ChildTaskPlan> childTaskPlans = s.getcTasks(); | ||
| 1043 | + if(!childTaskPlans.isEmpty()){ | ||
| 1044 | + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans); | ||
| 1045 | + Collections.sort(listit, new ComparableChild()); | ||
| 1046 | + for (int i = 0; i < listit.size(); i++) { | ||
| 1047 | + ChildTaskPlan c=listit.get(i); | ||
| 1048 | + if(!c.isDestroy()){ | ||
| 1049 | + if(c.getMileageType().equals("service")){ | ||
| 1050 | + s.setFcsjActual(c.getStartDate()); | ||
| 1051 | + break; | ||
| 1052 | + } | ||
| 1053 | + | ||
| 1054 | + } | ||
| 1055 | + } | ||
| 1056 | + } | ||
| 1057 | + } | ||
| 1058 | + return s; | ||
| 1059 | + } | ||
| 946 | 1060 | ||
| 1061 | + public Map<String, Object> listDjg(int peak,int trough,List<ScheduleRealInfo> listInfo,String grade){ | ||
| 1062 | + DecimalFormat df = new DecimalFormat("#0.00"); | ||
| 1063 | + Collections.sort(listInfo,new ComparableAcuals()); | ||
| 1064 | + List<ScheduleRealInfo> listInfo0=new ArrayList<ScheduleRealInfo>(); | ||
| 1065 | + List<ScheduleRealInfo> listInfo1=new ArrayList<ScheduleRealInfo>(); | ||
| 1066 | + for (int i = 0; i < listInfo.size(); i++) { | ||
| 1067 | + ScheduleRealInfo s=listInfo.get(i); | ||
| 1068 | + if(s.getXlDir().equals("0")){ | ||
| 1069 | + listInfo0.add(s); | ||
| 1070 | + }else{ | ||
| 1071 | + listInfo0.add(s); | ||
| 1072 | + } | ||
| 1073 | + | ||
| 1074 | + } | ||
| 1075 | + Map<String, Object> map=new HashMap<String,Object>(); | ||
| 1076 | + int djgcsz=0; | ||
| 1077 | + int djgcsw=0; | ||
| 1078 | + int djgcsq=0; | ||
| 1079 | + long djcsj=0l; | ||
| 1080 | + for (int i = 0; i < listInfo0.size(); i++) { | ||
| 1081 | + ScheduleRealInfo s=listInfo.get(i); | ||
| 1082 | + Long fcsjTime=s.getFcsjActualTime(); | ||
| 1083 | + String time=s.getFcsjActual(); | ||
| 1084 | + String[] fcsjStr = time.split(":"); | ||
| 1085 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 1086 | + if(i<listInfo.size()-1){ | ||
| 1087 | + Long djg=0l; | ||
| 1088 | + Long fscjNext=listInfo.get(i+1).getFcsjActualTime(); | ||
| 1089 | + if((fcsj>=zgf1&&fcsj<=zgf2)){ | ||
| 1090 | + djg = (long) (peak*60*1000); | ||
| 1091 | + if(fscjNext-fcsjTime>djg){ | ||
| 1092 | + djgcsz ++; | ||
| 1093 | + djgcsq ++; | ||
| 1094 | + if(fscjNext-fcsjTime>djcsj){ | ||
| 1095 | + djcsj=(fscjNext-fcsjTime)/1000; | ||
| 1096 | + } | ||
| 1097 | + } | ||
| 1098 | + }else if((fcsj>=wgf1&&fcsj<=wgf2)){ | ||
| 1099 | + djg = (long) (peak*60*1000); | ||
| 1100 | + if(fscjNext-fcsjTime>djg){ | ||
| 1101 | + djgcsw ++; | ||
| 1102 | + djgcsq ++; | ||
| 1103 | + if(fscjNext-fcsjTime>djcsj){ | ||
| 1104 | + djcsj=(fscjNext-fcsjTime)/1000; | ||
| 1105 | + } | ||
| 1106 | + } | ||
| 1107 | + }else{ | ||
| 1108 | + djg = (long) (trough*60*1000); | ||
| 1109 | + if(fscjNext-fcsjTime>djg){ | ||
| 1110 | + djgcsq ++; | ||
| 1111 | + if(fscjNext-fcsjTime>djcsj){ | ||
| 1112 | + djcsj=(fscjNext-fcsjTime)/1000; | ||
| 1113 | + } | ||
| 1114 | + } | ||
| 1115 | + } | ||
| 1116 | + } | ||
| 1117 | + } | ||
| 1118 | + for (int i = 0; i < listInfo1.size(); i++) { | ||
| 1119 | + ScheduleRealInfo s=listInfo.get(i); | ||
| 1120 | + Long fcsjTime=s.getFcsjActualTime(); | ||
| 1121 | + String time=s.getFcsjActual(); | ||
| 1122 | + String[] fcsjStr = time.split(":"); | ||
| 1123 | + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 1124 | + if(i<listInfo.size()-1){ | ||
| 1125 | + Long djg=0l; | ||
| 1126 | + Long fscjNext=listInfo.get(i+1).getFcsjActualTime(); | ||
| 1127 | + if(fcsj>=zgf1&&fcsj<=zgf2){ | ||
| 1128 | + djg = (long) (peak*60*1000); | ||
| 1129 | + if(fscjNext-fcsjTime>djg){ | ||
| 1130 | + djgcsz ++; | ||
| 1131 | + djgcsq ++; | ||
| 1132 | + if(fscjNext-fcsjTime>djcsj){ | ||
| 1133 | + djcsj=(fscjNext-fcsjTime)/1000; | ||
| 1134 | + } | ||
| 1135 | + } | ||
| 1136 | + }else if(fcsj>=wgf1&&fcsj<=wgf2){ | ||
| 1137 | + djg = (long) (peak*60*1000); | ||
| 1138 | + if(fscjNext-fcsjTime>djg){ | ||
| 1139 | + djgcsw ++; | ||
| 1140 | + djgcsq ++; | ||
| 1141 | + if(fscjNext-fcsjTime>djcsj){ | ||
| 1142 | + djcsj=(fscjNext-fcsjTime)/1000; | ||
| 1143 | + } | ||
| 1144 | + } | ||
| 1145 | + }else{ | ||
| 1146 | + djg = (long) (trough*60*1000); | ||
| 1147 | + if(fscjNext-fcsjTime>djg){ | ||
| 1148 | + djgcsq ++; | ||
| 1149 | + if(fscjNext-fcsjTime>djcsj){ | ||
| 1150 | + djcsj=(fscjNext-fcsjTime)/1000; | ||
| 1151 | + } | ||
| 1152 | + } | ||
| 1153 | + } | ||
| 1154 | + } | ||
| 1155 | + } | ||
| 1156 | + | ||
| 1157 | + map.put("djgcsz", djgcsz); | ||
| 1158 | + map.put("djgcsw", djgcsw); | ||
| 1159 | + map.put("djgcsq", djgcsq); | ||
| 1160 | + map.put("djgsj", djcsj); | ||
| 1161 | + return map; | ||
| 1162 | + } | ||
| 947 | 1163 | ||
| 948 | } | 1164 | } |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -598,7 +598,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -598,7 +598,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 598 | 598 | ||
| 599 | String sqlCl="SELECT cl_zbh,qdz_name,bc_type,fcsj,bcsj FROM" | 599 | String sqlCl="SELECT cl_zbh,qdz_name,bc_type,fcsj,bcsj FROM" |
| 600 | + " bsth_c_s_sp_info WHERE tt_info = '"+ttinfo+"' " | 600 | + " bsth_c_s_sp_info WHERE tt_info = '"+ttinfo+"' " |
| 601 | - + " AND bc_type = 'normal' order by qdz_name"; | 601 | + + " AND (bc_type = 'normal' or bc_type='region') order by qdz_name"; |
| 602 | 602 | ||
| 603 | List<Map<String, Object>> listj= jdbcTemplate.query(sqlCl, | 603 | List<Map<String, Object>> listj= jdbcTemplate.query(sqlCl, |
| 604 | new RowMapper<Map<String, Object>>(){ | 604 | new RowMapper<Map<String, Object>>(){ |
| @@ -1885,6 +1885,50 @@ public class ReportServiceImpl implements ReportService{ | @@ -1885,6 +1885,50 @@ public class ReportServiceImpl implements ReportService{ | ||
| 1885 | return list; | 1885 | return list; |
| 1886 | } | 1886 | } |
| 1887 | 1887 | ||
| 1888 | + public List<ArrivalInfo> load4(String line, String date, int zd,String minfcsj){ | ||
| 1889 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 1890 | + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); | ||
| 1891 | + Long date1=0L; | ||
| 1892 | + Long date2=0L; | ||
| 1893 | + Calendar cal = Calendar.getInstance(); | ||
| 1894 | + List<ArrivalInfo> list=null; | ||
| 1895 | + try { | ||
| 1896 | + Date dates1 = simpleDateFormat.parse(date+" "+minfcsj+":01"); | ||
| 1897 | + String d1=date+" "+minfcsj+":01"; | ||
| 1898 | +// Date dates2=simpleDateFormat.parse(date+" 23:59:59"); | ||
| 1899 | + date1=dates1.getTime(); | ||
| 1900 | +// date2=dates2.getTime(); | ||
| 1901 | + cal.setTime(dates1); | ||
| 1902 | + int weeks_year1 = cal.get(Calendar.WEEK_OF_YEAR); | ||
| 1903 | + cal.add(cal.DATE,1);//把日期往后增加一天.整数往后推,负数往前移动 | ||
| 1904 | + int weeks_year2 = cal.get(Calendar.WEEK_OF_YEAR); | ||
| 1905 | + Date dates2=cal.getTime(); | ||
| 1906 | + String d2=simpleDateFormat.format(dates2); | ||
| 1907 | + String sql="select *,UNIX_TIMESTAMP(times) as ts from bsth_c_arrival_info where times >= '"+d1 +"'and " | ||
| 1908 | + + " times <='"+d2+"' and line_id = '"+line+"' and up_down = '"+zd+"'" | ||
| 1909 | + + " order by device_id,times"; | ||
| 1910 | + | ||
| 1911 | + list =jdbcTemplate.query(sql, new RowMapper<ArrivalInfo>() { | ||
| 1912 | + @Override | ||
| 1913 | + public ArrivalInfo mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 1914 | + ArrivalInfo ai=new ArrivalInfo(); | ||
| 1915 | + ai.setInOut(arg0.getInt("in_out")); | ||
| 1916 | + ai.setDeviceId(arg0.getString("device_id")); | ||
| 1917 | + ai.setStopNo(arg0.getString("stop_no")); | ||
| 1918 | + ai.setDates(arg0.getDate("times")); | ||
| 1919 | + ai.setTs(arg0.getLong("ts")*1000); | ||
| 1920 | + return ai; | ||
| 1921 | + } | ||
| 1922 | + }); | ||
| 1923 | + | ||
| 1924 | + } catch (ParseException e1) { | ||
| 1925 | + // TODO Auto-generated catch block | ||
| 1926 | + e1.printStackTrace(); | ||
| 1927 | + } | ||
| 1928 | + return list; | ||
| 1929 | + | ||
| 1930 | + } | ||
| 1931 | + | ||
| 1888 | public List<ArrivalInfo> load3(String line, String date, int zd){ | 1932 | public List<ArrivalInfo> load3(String line, String date, int zd){ |
| 1889 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 1933 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 1890 | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); | 1934 | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); |
| @@ -1928,6 +1972,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -1928,6 +1972,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 1928 | } | 1972 | } |
| 1929 | return list; | 1973 | return list; |
| 1930 | } | 1974 | } |
| 1975 | + | ||
| 1976 | + //根据排班查到离站 | ||
| 1931 | @Override | 1977 | @Override |
| 1932 | public List<Map<String, Object>> queryInOutStrtion(String line, String date, int zd,String lzsj) { | 1978 | public List<Map<String, Object>> queryInOutStrtion(String line, String date, int zd,String lzsj) { |
| 1933 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 1979 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| @@ -1997,6 +2043,106 @@ public class ReportServiceImpl implements ReportService{ | @@ -1997,6 +2043,106 @@ public class ReportServiceImpl implements ReportService{ | ||
| 1997 | return inoutList; | 2043 | return inoutList; |
| 1998 | } | 2044 | } |
| 1999 | 2045 | ||
| 2046 | + //根据GPS查到离站 | ||
| 2047 | + @Override | ||
| 2048 | + public List<Map<String, Object>> queryInOutStrtions(String line, String date, int zd,String lzsj) { | ||
| 2049 | + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
| 2050 | + String sqlMinYysj="select start_opt from bsth_c_line_config where " | ||
| 2051 | + + " id = (" | ||
| 2052 | + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'" | ||
| 2053 | + + ")"; | ||
| 2054 | + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); | ||
| 2055 | + List<ArrivalInfo> arrInfoList=this.load4(line, date, zd,minfcsj); | ||
| 2056 | + | ||
| 2057 | + //查询线路所有的站点 | ||
| 2058 | + List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd); | ||
| 2059 | + List<Map<String, Object>> inoutList=new ArrayList<Map<String,Object>>(); | ||
| 2060 | + //保存的所以的站点信息 | ||
| 2061 | + Map<String, Object> map1=new HashMap<String,Object>(); | ||
| 2062 | + map1.put("bc", ""); | ||
| 2063 | + map1.put("nbbm", ""); | ||
| 2064 | + | ||
| 2065 | + for (int i = 0; i < listStation.size(); i++) { | ||
| 2066 | + map1.put(listStation.get(i).getStationCode()+"in" | ||
| 2067 | + , listStation.get(i).getStationName()); | ||
| 2068 | + map1.put(listStation.get(i).getStationCode()+"out" | ||
| 2069 | + , (i+1)); | ||
| 2070 | + } | ||
| 2071 | + inoutList.add(map1); | ||
| 2072 | + | ||
| 2073 | + /*for (int j = 0; j < listStation.size(); j++) { | ||
| 2074 | + map2=new HashMap<String,Object>(); | ||
| 2075 | + StationRoute s=listStation.get(j); | ||
| 2076 | + List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>(); | ||
| 2077 | + for (int j2 = 0; j2 < arrInfoList.size(); j2++) { | ||
| 2078 | + ArrivalInfo a=arrivalList.get(j2); | ||
| 2079 | + if(s.getStationCode().equals(a.getStopNo())){ | ||
| 2080 | + arrivalList.add(a); | ||
| 2081 | + } | ||
| 2082 | + } | ||
| 2083 | + Map<String, String> m=this.strInOut(arrivalList,lzsj); | ||
| 2084 | + | ||
| 2085 | + map2.put(s.getStationCode()+"in", m.get("in")); | ||
| 2086 | + map2.put(s.getStationCode()+"out", m.get("out")); | ||
| 2087 | + map2.put(s.getStationCode(), m.get("type")); | ||
| 2088 | + }*/ | ||
| 2089 | + List<String> list_nbbm=new ArrayList<String>(); | ||
| 2090 | + Map<String, Object> m=new HashMap<String,Object>(); | ||
| 2091 | + for (int i = 0; i < arrInfoList.size(); i++) { | ||
| 2092 | + arrInfoList.get(i).setRoute(-1); | ||
| 2093 | + for (int j = 0; j < listStation.size(); j++) { | ||
| 2094 | + if(arrInfoList.get(i).getStopNo().equals(listStation.get(j).getStationCode())){ | ||
| 2095 | + arrInfoList.get(i).setRoute(listStation.get(j).getStationRouteCode()); | ||
| 2096 | + | ||
| 2097 | + } | ||
| 2098 | + } | ||
| 2099 | + if(m.get(arrInfoList.get(i).getDeviceId())==null){ | ||
| 2100 | + m.put(arrInfoList.get(i).getDeviceId(), arrInfoList.get(i).getDeviceId()); | ||
| 2101 | + list_nbbm.add(arrInfoList.get(i).getDeviceId()); | ||
| 2102 | + } | ||
| 2103 | + } | ||
| 2104 | + | ||
| 2105 | + Map<String, Object> map2=new HashMap<String, Object>(); | ||
| 2106 | + for (int i = 0; i < list_nbbm.size(); i++) { | ||
| 2107 | + String nbbm=list_nbbm.get(i); | ||
| 2108 | + | ||
| 2109 | + int zdbm =0; | ||
| 2110 | + int inout=-1; | ||
| 2111 | + List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>(); | ||
| 2112 | + for (int j = 0; j < arrInfoList.size(); j++) { | ||
| 2113 | + ArrivalInfo aif=arrInfoList.get(j); | ||
| 2114 | + | ||
| 2115 | + if(aif.getDeviceId().equals(nbbm)){ | ||
| 2116 | + map2.put("nbbm", BasicData.deviceId2NbbmMap.get(nbbm)); | ||
| 2117 | + if(aif.getRoute()>-1){ | ||
| 2118 | + if(((inout==aif.getInOut() && zdbm==aif.getRoute()) || !(zdbm ==aif.getRoute()))){ | ||
| 2119 | + if(aif.getRoute()<=zdbm ){ | ||
| 2120 | + inoutList.add(map2); | ||
| 2121 | + map2=new HashMap<String, Object>(); | ||
| 2122 | + arrivalList=new ArrayList<ArrivalInfo>(); | ||
| 2123 | + } | ||
| 2124 | + } | ||
| 2125 | + arrivalList.add(aif); | ||
| 2126 | +// if(!(zdbm ==aif.getRoute())){ | ||
| 2127 | + Map<String, String> m_=this.strInOut(arrivalList,lzsj); | ||
| 2128 | + map2.put(aif.getStopNo()+"in", m_.get("in")); | ||
| 2129 | + map2.put(aif.getStopNo()+"out", m_.get("out")); | ||
| 2130 | + map2.put(aif.getStopNo(), m_.get("type")); | ||
| 2131 | +// arrivalList=new ArrayList<ArrivalInfo>(); | ||
| 2132 | +// } | ||
| 2133 | + zdbm =aif.getRoute(); | ||
| 2134 | + inout=aif.getInOut(); | ||
| 2135 | + | ||
| 2136 | + } | ||
| 2137 | + | ||
| 2138 | + } | ||
| 2139 | + | ||
| 2140 | + } | ||
| 2141 | + } | ||
| 2142 | + | ||
| 2143 | + return inoutList; | ||
| 2144 | + } | ||
| 2145 | + | ||
| 2000 | public Map<String, String> strInOut(List<ArrivalInfo> lists,String lzsj){ | 2146 | public Map<String, String> strInOut(List<ArrivalInfo> lists,String lzsj){ |
| 2001 | String inout=""; | 2147 | String inout=""; |
| 2002 | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); | 2148 | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); |
| @@ -2015,6 +2161,9 @@ public class ReportServiceImpl implements ReportService{ | @@ -2015,6 +2161,9 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2015 | t1.setCzsj(sdf.format(new Date(t2.getTs()))); | 2161 | t1.setCzsj(sdf.format(new Date(t2.getTs()))); |
| 2016 | out =t2.getTs(); | 2162 | out =t2.getTs(); |
| 2017 | break; | 2163 | break; |
| 2164 | + }else{ | ||
| 2165 | + t1.setCzsj(""); | ||
| 2166 | + out =0l; | ||
| 2018 | } | 2167 | } |
| 2019 | } | 2168 | } |
| 2020 | 2169 | ||
| @@ -2721,7 +2870,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -2721,7 +2870,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2721 | 2870 | ||
| 2722 | for (int i = 0; i < xlList.size(); i++) { | 2871 | for (int i = 0; i < xlList.size(); i++) { |
| 2723 | String lineCode=xlList.get(i).get("line").toString(); | 2872 | String lineCode=xlList.get(i).get("line").toString(); |
| 2724 | - String grade =xlList.get(i).get("grade").toString(); | 2873 | + String grade =xlList.get(i).get("grade")==null?"1":xlList.get(i).get("grade").toString(); |
| 2725 | int peak=0; | 2874 | int peak=0; |
| 2726 | int trough=0; | 2875 | int trough=0; |
| 2727 | for (int j = 0; j < djgList.size(); j++) { | 2876 | for (int j = 0; j < djgList.size(); j++) { |
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
| @@ -1233,7 +1233,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1233,7 +1233,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1233 | String sql = "select a.schedule_date_Str, a.real_exec_date, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name," | 1233 | String sql = "select a.schedule_date_Str, a.real_exec_date, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name," |
| 1234 | + " b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line" | 1234 | + " b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line" |
| 1235 | + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'" | 1235 | + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') = '"+date+"'" |
| 1236 | - + " and fcsj_actual is not null and fcsj_actual != '' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'"; | 1236 | + + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'"; |
| 1237 | if(line.trim().length() != 0) | 1237 | if(line.trim().length() != 0) |
| 1238 | sql += " and xl_bm = '"+line+"'"; | 1238 | sql += " and xl_bm = '"+line+"'"; |
| 1239 | else if(company.length() != 0) | 1239 | else if(company.length() != 0) |
| @@ -1326,14 +1326,18 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1326,14 +1326,18 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1326 | for(ScheduleRealInfo s : keyMap.get(xlName)){ | 1326 | for(ScheduleRealInfo s : keyMap.get(xlName)){ |
| 1327 | if(s.getXlDir().equals("0")){ | 1327 | if(s.getXlDir().equals("0")){ |
| 1328 | up1.add(s.getFcsjT()); | 1328 | up1.add(s.getFcsjT()); |
| 1329 | - up2.add(s.getFcsjActualTime()); | ||
| 1330 | up1Map.put(s.getFcsjT(), s); | 1329 | up1Map.put(s.getFcsjT(), s); |
| 1331 | - up2Map.put(s.getFcsjActualTime(), s); | 1330 | + if(s.getFcsjActual() != null){ |
| 1331 | + up2.add(s.getFcsjActualTime()); | ||
| 1332 | + up2Map.put(s.getFcsjActualTime(), s); | ||
| 1333 | + } | ||
| 1332 | } else if(s.getXlDir().equals("1")){ | 1334 | } else if(s.getXlDir().equals("1")){ |
| 1333 | dn1.add(s.getFcsjT()); | 1335 | dn1.add(s.getFcsjT()); |
| 1334 | - dn2.add(s.getFcsjActualTime()); | ||
| 1335 | dn1Map.put(s.getFcsjT(), s); | 1336 | dn1Map.put(s.getFcsjT(), s); |
| 1336 | - dn2Map.put(s.getFcsjActualTime(), s); | 1337 | + if(s.getFcsjActual() != null){ |
| 1338 | + dn2.add(s.getFcsjActualTime()); | ||
| 1339 | + dn2Map.put(s.getFcsjActualTime(), s); | ||
| 1340 | + } | ||
| 1337 | } | 1341 | } |
| 1338 | } | 1342 | } |
| 1339 | if(up1.size() > 0 && up2.size() > 0){ | 1343 | if(up1.size() > 0 && up2.size() > 0){ |
| @@ -1455,7 +1459,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1455,7 +1459,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1455 | String sql = "select a.schedule_date_Str, a.real_exec_date, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name," | 1459 | String sql = "select a.schedule_date_Str, a.real_exec_date, a.xl_name, a.fcsj, a.fcsj_actual, a.zdsj, a.zdsj_actual, a.qdz_name, a.zdz_name, a.xl_dir, a.status, a.gs_name, a.fgs_name," |
| 1456 | + " b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line" | 1460 | + " b.start_opt from bsth_c_s_sp_info_real a left join (select line, start_opt from bsth_c_line_config order by id desc) b on a.xl_bm = b.line" |
| 1457 | + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'" | 1461 | + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'" |
| 1458 | - + " and fcsj_actual is not null and fcsj_actual != '' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'"; | 1462 | + + " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks' and bc_type != 'region'"; |
| 1459 | if(line.length() != 0) | 1463 | if(line.length() != 0) |
| 1460 | sql += " and xl_bm = '"+line+"'"; | 1464 | sql += " and xl_bm = '"+line+"'"; |
| 1461 | if(company.length() != 0) | 1465 | if(company.length() != 0) |
| @@ -1565,14 +1569,18 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1565,14 +1569,18 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1565 | for(ScheduleRealInfo s : keyMap.get(xlName).get(date)){ | 1569 | for(ScheduleRealInfo s : keyMap.get(xlName).get(date)){ |
| 1566 | if(s.getXlDir().equals("0")){ | 1570 | if(s.getXlDir().equals("0")){ |
| 1567 | up1.add(s.getFcsjT()); | 1571 | up1.add(s.getFcsjT()); |
| 1568 | - up2.add(s.getFcsjActualTime()); | ||
| 1569 | up1Map.put(s.getFcsjT(), s); | 1572 | up1Map.put(s.getFcsjT(), s); |
| 1570 | - up2Map.put(s.getFcsjActualTime(), s); | 1573 | + if(s.getFcsjActual() != null){ |
| 1574 | + up2.add(s.getFcsjActualTime()); | ||
| 1575 | + up2Map.put(s.getFcsjActualTime(), s); | ||
| 1576 | + } | ||
| 1571 | } else if(s.getXlDir().equals("1")){ | 1577 | } else if(s.getXlDir().equals("1")){ |
| 1572 | dn1.add(s.getFcsjT()); | 1578 | dn1.add(s.getFcsjT()); |
| 1573 | - dn2.add(s.getFcsjActualTime()); | ||
| 1574 | dn1Map.put(s.getFcsjT(), s); | 1579 | dn1Map.put(s.getFcsjT(), s); |
| 1575 | - dn2Map.put(s.getFcsjActualTime(), s); | 1580 | + if(s.getFcsjActual() != null){ |
| 1581 | + dn2.add(s.getFcsjActualTime()); | ||
| 1582 | + dn2Map.put(s.getFcsjActualTime(), s); | ||
| 1583 | + } | ||
| 1576 | } | 1584 | } |
| 1577 | } | 1585 | } |
| 1578 | if(up1.size() > 0 && up2.size() > 0){ | 1586 | if(up1.size() > 0 && up2.size() > 0){ |
| @@ -1687,7 +1695,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1687,7 +1695,6 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1687 | 1695 | ||
| 1688 | return resList; | 1696 | return resList; |
| 1689 | } | 1697 | } |
| 1690 | - | ||
| 1691 | /*@Override | 1698 | /*@Override |
| 1692 | public List<Map<String, Object>> commandState(Map<String, Object> map) { | 1699 | public List<Map<String, Object>> commandState(Map<String, Object> map) { |
| 1693 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | 1700 | List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); |
src/main/resources/static/pages/base/line/details.html
| @@ -408,7 +408,18 @@ | @@ -408,7 +408,18 @@ | ||
| 408 | <!-- 开辟日期 END --> | 408 | <!-- 开辟日期 END --> |
| 409 | </div> | 409 | </div> |
| 410 | <!-- 表单分组组件 form-group END --> | 410 | <!-- 表单分组组件 form-group END --> |
| 411 | - | 411 | + <!-- 表单分组组件 form-group START --> |
| 412 | + <div class="form-group"> | ||
| 413 | + <!-- 权证车辆数 START --> | ||
| 414 | + <div class="col-md-6"> | ||
| 415 | + <label class="control-label col-md-5"> 权证车辆数 : </label> | ||
| 416 | + <div class="col-md-4"> | ||
| 417 | + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数"> | ||
| 418 | + </div> | ||
| 419 | + </div> | ||
| 420 | + <!-- 权证车辆数 END --> | ||
| 421 | + </div> | ||
| 422 | + <!-- 表单分组组件 form-group END --> | ||
| 412 | <!-- 表单分组组件 form-group START --> | 423 | <!-- 表单分组组件 form-group START --> |
| 413 | <div class="form-group"> | 424 | <div class="form-group"> |
| 414 | <!-- 线路沿革 START --> | 425 | <!-- 线路沿革 START --> |
src/main/resources/static/pages/base/line/edit.html
| @@ -417,6 +417,18 @@ | @@ -417,6 +417,18 @@ | ||
| 417 | </div> | 417 | </div> |
| 418 | <!-- 表单分组组件 form-group END --> | 418 | <!-- 表单分组组件 form-group END --> |
| 419 | 419 | ||
| 420 | + <!-- 表单分组组件 form-group START --> | ||
| 421 | + <div class="form-group"> | ||
| 422 | + <!-- 权证车辆数 START --> | ||
| 423 | + <div class="col-md-6"> | ||
| 424 | + <label class="control-label col-md-5"> 权证车辆数 : </label> | ||
| 425 | + <div class="col-md-4"> | ||
| 426 | + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数"> | ||
| 427 | + </div> | ||
| 428 | + </div> | ||
| 429 | + <!-- 权证车辆数 END --> | ||
| 430 | + </div> | ||
| 431 | + <!-- 表单分组组件 form-group END --> | ||
| 420 | <!-- 表单分组组件 form-group START --> | 432 | <!-- 表单分组组件 form-group START --> |
| 421 | <div class="form-group"> | 433 | <div class="form-group"> |
| 422 | <!-- 线路沿革 START --> | 434 | <!-- 线路沿革 START --> |
src/main/resources/static/pages/electricity/jdl/list.html
| @@ -55,8 +55,7 @@ | @@ -55,8 +55,7 @@ | ||
| 55 | <td> | 55 | <td> |
| 56 | <select class="form-control" name="nbbm" id="nbbm" style="width: 120px;"></select> | 56 | <select class="form-control" name="nbbm" id="nbbm" style="width: 120px;"></select> |
| 57 | </td> | 57 | </td> |
| 58 | - <td>驾驶员:</td> | ||
| 59 | - <td><input type="text" style="width: 80px" name="jsy" id="jsy"/></td> | 58 | + |
| 60 | <td width="20%"> | 59 | <td width="20%"> |
| 61 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px"> | 60 | <button class="btn btn-sm green btn-outline filter-submit margin-bottom" style="margin-right:0px"> |
| 62 | <i class="fa fa-search"></i> 搜索 | 61 | <i class="fa fa-search"></i> 搜索 |
| @@ -73,7 +72,6 @@ | @@ -73,7 +72,6 @@ | ||
| 73 | <th>#</th> | 72 | <th>#</th> |
| 74 | <th>日期</th> | 73 | <th>日期</th> |
| 75 | <th colspan="2">内部编码</th> | 74 | <th colspan="2">内部编码</th> |
| 76 | - <th colspan="2">驾驶员</th> | ||
| 77 | <th colspan="2">充电量</th> | 75 | <th colspan="2">充电量</th> |
| 78 | <th colspan="2">充电站</th> | 76 | <th colspan="2">充电站</th> |
| 79 | <th colspan="2">备注</th> | 77 | <th colspan="2">备注</th> |
| @@ -382,7 +380,7 @@ | @@ -382,7 +380,7 @@ | ||
| 382 | </td> | 380 | </td> |
| 383 | <td>{{obj.rq}}</td> | 381 | <td>{{obj.rq}}</td> |
| 384 | <td colspan="2">{{obj.nbbm}}</td> | 382 | <td colspan="2">{{obj.nbbm}}</td> |
| 385 | - <td colspan="2">{{obj.jsy}}</td> | 383 | + |
| 386 | <td colspan="2">{{obj.jdl}}</td> | 384 | <td colspan="2">{{obj.jdl}}</td> |
| 387 | <td colspan="2">{{obj.jdz}}</td> | 385 | <td colspan="2">{{obj.jdz}}</td> |
| 388 | <td>{{obj.remarks}}</td> | 386 | <td>{{obj.remarks}}</td> |
src/main/resources/static/pages/forms/export/import_Jdl.xls
No preview for this file type
src/main/resources/static/pages/forms/mould/export_Jdl.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/scheduleDaily.html
| @@ -86,7 +86,7 @@ | @@ -86,7 +86,7 @@ | ||
| 86 | <td colspan="3">放站班次</td> | 86 | <td colspan="3">放站班次</td> |
| 87 | <td colspan="3">调头班次</td> | 87 | <td colspan="3">调头班次</td> |
| 88 | <td colspan="3">发生次数</td> | 88 | <td colspan="3">发生次数</td> |
| 89 | - <td rowspan="2">最大间隔时间(分)</td> | 89 | + <td rowspan="2">最大间隔时间(秒)</td> |
| 90 | <td colspan="5" rowspan="2">原因</td> | 90 | <td colspan="5" rowspan="2">原因</td> |
| 91 | </tr> | 91 | </tr> |
| 92 | <tr> | 92 | <tr> |
src/main/resources/static/pages/report/inoutstation/inoutstation.html
| @@ -199,7 +199,7 @@ | @@ -199,7 +199,7 @@ | ||
| 199 | layer.msg("请选择方向"); | 199 | layer.msg("请选择方向"); |
| 200 | }else{ | 200 | }else{ |
| 201 | $get('/report/queryStrinon',{line:line,zd:zdlx},function(result){ | 201 | $get('/report/queryStrinon',{line:line,zd:zdlx},function(result){ |
| 202 | - $get('/report/queryInOutStrtion',{line:line,date:date,zd:zdlx,lzsj:lzsj},function(result2){ | 202 | + $get('/report/queryInOutStrtions',{line:line,date:date,zd:zdlx,lzsj:lzsj},function(result2){ |
| 203 | console.log(result2); | 203 | console.log(result2); |
| 204 | /* getTime(result); */ | 204 | /* getTime(result); */ |
| 205 | var ludan_ll_1 = template('ludan_ll_1',{list:result2,lists:result}); | 205 | var ludan_ll_1 = template('ludan_ll_1',{list:result2,lists:result}); |