Commit 69d4f740b1e6e4af12aecdad32d0a06062e355c4

Authored by 廖磊
2 parents e445d7c3 1f3dbbf6

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang
@@ -24,7 +24,12 @@ @@ -24,7 +24,12 @@
24 <artifactId>spring-boot-starter-tomcat</artifactId> 24 <artifactId>spring-boot-starter-tomcat</artifactId>
25 <scope>provided</scope> 25 <scope>provided</scope>
26 </dependency> 26 </dependency>
27 - 27 + <dependency>
  28 + <groupId>javax.servlet</groupId>
  29 + <artifactId>javax.servlet-api</artifactId>
  30 + <version>3.1.0</version>
  31 + <scope>provided</scope>
  32 + </dependency>
28 <dependency> 33 <dependency>
29 <groupId>org.springframework.boot</groupId> 34 <groupId>org.springframework.boot</groupId>
30 <artifactId>spring-boot-starter-security</artifactId> 35 <artifactId>spring-boot-starter-security</artifactId>
@@ -229,6 +234,23 @@ @@ -229,6 +234,23 @@
229 <version>1.1</version> 234 <version>1.1</version>
230 </dependency> 235 </dependency>
231 236
  237 + <dependency>
  238 + <groupId>org.apache.axis2</groupId>
  239 + <artifactId>axis2-adb</artifactId>
  240 + <version>1.7.4</version>
  241 + </dependency>
  242 + <dependency>
  243 + <groupId>org.apache.axis2</groupId>
  244 + <artifactId>axis2-transport-local</artifactId>
  245 + <version>1.7.4</version>
  246 + </dependency>
  247 + <dependency>
  248 + <groupId>org.apache.axis2</groupId>
  249 + <artifactId>axis2-transport-http</artifactId>
  250 + <version>1.7.4</version>
  251 + </dependency>
  252 +
  253 +
232 <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> 254 <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId>
233 <optional>true</optional> </dependency> --> 255 <optional>true</optional> </dependency> -->
234 <dependency> 256 <dependency>
src/main/java/com/bsth/controller/traffic/SKBUploadLoggerController.java 0 → 100644
  1 +package com.bsth.controller.traffic;
  2 +
  3 +import com.bsth.controller.BaseController;
  4 +import com.bsth.entity.traffic.SKBUploadLogger;
  5 +import com.bsth.service.traffic.SKBUploadLoggerService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RestController;
  9 +
  10 +/**
  11 + *
  12 + * @author BSTH
  13 + *
  14 + */
  15 +@RestController
  16 +@RequestMapping("skb_log")
  17 +public class SKBUploadLoggerController extends BaseController<SKBUploadLogger,Integer> {
  18 +
  19 + @Autowired
  20 + private SKBUploadLoggerService skbUploadLoggerService;
  21 +
  22 +}
src/main/java/com/bsth/entity/traffic/SKBUploadLogger.java 0 → 100644
  1 +package com.bsth.entity.traffic;
  2 +
  3 +import com.bsth.entity.schedule.TTInfo;
  4 +import com.bsth.entity.sys.SysUser;
  5 +import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  6 +
  7 +import javax.persistence.*;
  8 +import java.util.Date;
  9 +
  10 +/**
  11 + *
  12 + * @ClassName : SKBUploadLogger(时刻表上传日志实体类)
  13 + *
  14 + * @Author : bsth@zq
  15 + *
  16 + * @Description :
  17 + *
  18 + * @Data : 2016-04-27
  19 + *
  20 + * @Version 公交调度系统BS版 0.1
  21 + *
  22 + */
  23 +
  24 +@Entity
  25 +@Table(name = "bsth_t_upload_logger")
  26 +@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
  27 +public class SKBUploadLogger {
  28 +
  29 + // ID
  30 + @Id
  31 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  32 + private Integer id;
  33 +
  34 + /** 时刻表信息 */
  35 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  36 + private TTInfo ttInfo;
  37 +
  38 + /** 用户 关联 */
  39 + @ManyToOne(optional = false, cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  40 + private SysUser user;
  41 +
  42 + // 创建日期
  43 + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  44 + private Date createDate;
  45 +
  46 + public Integer getId() {
  47 + return id;
  48 + }
  49 +
  50 + public void setId(Integer id) {
  51 + this.id = id;
  52 + }
  53 +
  54 + public TTInfo getTtInfo() {
  55 + return ttInfo;
  56 + }
  57 +
  58 + public void setTtInfo(TTInfo ttInfo) {
  59 + this.ttInfo = ttInfo;
  60 + }
  61 +
  62 + public SysUser getUser() {
  63 + return user;
  64 + }
  65 +
  66 + public void setUser(SysUser user) {
  67 + this.user = user;
  68 + }
  69 +
  70 + public Date getCreateDate() {
  71 + return createDate;
  72 + }
  73 +
  74 + public void setCreateDate(Date createDate) {
  75 + this.createDate = createDate;
  76 + }
  77 +}
src/main/java/com/bsth/repository/traffic/SKBUploadLoggerRepository.java 0 → 100644
  1 +package com.bsth.repository.traffic;
  2 +
  3 +import com.bsth.entity.traffic.SKBUploadLogger;
  4 +import com.bsth.repository.BaseRepository;
  5 +
  6 +public interface SKBUploadLoggerRepository extends BaseRepository<SKBUploadLogger, Integer> {
  7 +}
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -1068,12 +1068,10 @@ public class FormsServiceImpl implements FormsService { @@ -1068,12 +1068,10 @@ public class FormsServiceImpl implements FormsService {
1068 } 1068 }
1069 } 1069 }
1070 Map<String, Object> tempMap = new HashMap<String, Object>(); 1070 Map<String, Object> tempMap = new HashMap<String, Object>();
1071 - int jhcc = 0;  
1072 - int sjcc = 0;  
1073 - int jhbc = 0;  
1074 - int sjbc = 0; 1071 + int jhcc = 0, sjcc = 0;
  1072 + int jhbc = 0, sjbc = 0;
1075 int qz = 0; 1073 int qz = 0;
1076 - for(Map<String, Object> m : tempList){ 1074 + for(Map<String, Object> m : resList){
1077 jhcc += Integer.valueOf(m.get("jhcc").toString()); 1075 jhcc += Integer.valueOf(m.get("jhcc").toString());
1078 sjcc += Integer.valueOf(m.get("sjcc").toString()); 1076 sjcc += Integer.valueOf(m.get("sjcc").toString());
1079 jhbc += Integer.valueOf(m.get("jhbc").toString()); 1077 jhbc += Integer.valueOf(m.get("jhbc").toString());
@@ -1081,7 +1079,7 @@ public class FormsServiceImpl implements FormsService { @@ -1081,7 +1079,7 @@ public class FormsServiceImpl implements FormsService {
1081 qz += Integer.valueOf(m.get("qz").toString()); 1079 qz += Integer.valueOf(m.get("qz").toString());
1082 } 1080 }
1083 tempMap.put("rq", "分类汇总"); 1081 tempMap.put("rq", "分类汇总");
1084 - tempMap.put("line", "共" + tempList.size() + "条线路"); 1082 + tempMap.put("line", "共" + resList.size() + "条线路");
1085 tempMap.put("jhcc", jhcc); 1083 tempMap.put("jhcc", jhcc);
1086 tempMap.put("sjcc", sjcc); 1084 tempMap.put("sjcc", sjcc);
1087 tempMap.put("jhbc", jhbc); 1085 tempMap.put("jhbc", jhbc);
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
@@ -421,10 +421,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -421,10 +421,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
421 long fcsj1 = fcsjs.get(i - 1); 421 long fcsj1 = fcsjs.get(i - 1);
422 long fcsj2 = fcsjs.get(i); 422 long fcsj2 = fcsjs.get(i);
423 Long time = fcsj1/60; 423 Long time = fcsj1/60;
424 - if(!timeMap0.containsKey(time) && !timeMap1.containsKey(time)){ 424 + if(!timeMap0.containsKey(time)){
425 timeMap0.put(time, new ArrayList<Long>()); 425 timeMap0.put(time, new ArrayList<Long>());
426 - timeMap1.put(time, new ArrayList<Long>());  
427 - timeList.add(time); 426 + if(!timeList.contains(time))
  427 + timeList.add(time);
428 } 428 }
429 timeMap0.get(time).add(fcsj2 - fcsj1); 429 timeMap0.get(time).add(fcsj2 - fcsj1);
430 } 430 }
@@ -432,6 +432,11 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -432,6 +432,11 @@ public class BusIntervalServiceImpl implements BusIntervalService {
432 long fcsj1 = fcsjAs.get(i - 1); 432 long fcsj1 = fcsjAs.get(i - 1);
433 long fcsj2 = fcsjAs.get(i); 433 long fcsj2 = fcsjAs.get(i);
434 Long time = fcsj1/60; 434 Long time = fcsj1/60;
  435 + if(!timeMap1.containsKey(time)){
  436 + timeMap1.put(time, new ArrayList<Long>());
  437 + if(!timeList.contains(time))
  438 + timeList.add(time);
  439 + }
435 if(timeMap1.containsKey(time)){ 440 if(timeMap1.containsKey(time)){
436 timeMap1.get(time).add(fcsj2 - fcsj1); 441 timeMap1.get(time).add(fcsj2 - fcsj1);
437 } 442 }
@@ -440,9 +445,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -440,9 +445,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
440 for(int i = 1; i < fcsjs.size(); i++){ 445 for(int i = 1; i < fcsjs.size(); i++){
441 long fcsj1 = fcsjs.get(i - 1); 446 long fcsj1 = fcsjs.get(i - 1);
442 long fcsj2 = fcsjs.get(i); 447 long fcsj2 = fcsjs.get(i);
443 - if(!temp0.containsKey(key) && !temp1.containsKey(key)){ 448 + if(!temp0.containsKey(key)){
444 temp0.put(key, new ArrayList<Long>()); 449 temp0.put(key, new ArrayList<Long>());
445 - temp1.put(key, new ArrayList<Long>());  
446 if(!keyList.contains(key)) 450 if(!keyList.contains(key))
447 keyList.add(key); 451 keyList.add(key);
448 } 452 }
@@ -451,6 +455,12 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -451,6 +455,12 @@ public class BusIntervalServiceImpl implements BusIntervalService {
451 for(int i = 1; i < fcsjAs.size(); i++){ 455 for(int i = 1; i < fcsjAs.size(); i++){
452 long fcsj1 = fcsjAs.get(i - 1); 456 long fcsj1 = fcsjAs.get(i - 1);
453 long fcsj2 = fcsjAs.get(i); 457 long fcsj2 = fcsjAs.get(i);
  458 + if(!temp1.containsKey(key)){
  459 + temp1.put(key, new ArrayList<Long>());
  460 + if(!keyList.contains(key))
  461 + keyList.add(key);
  462 + }
  463 + System.out.println("key:"+key+" fcsj2:"+fcsj2+" fcsj1:"+fcsj2+" temp1:"+temp1.get(key)+" tem0:"+temp0.get(key));
454 temp1.get(key).add(fcsj2 - fcsj1); 464 temp1.get(key).add(fcsj2 - fcsj1);
455 } 465 }
456 } 466 }
@@ -461,14 +471,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -461,14 +471,16 @@ public class BusIntervalServiceImpl implements BusIntervalService {
461 Map<String, Object> tempMap = new HashMap<String, Object>(); 471 Map<String, Object> tempMap = new HashMap<String, Object>();
462 List<Long> fcsjs = new ArrayList<Long>(); 472 List<Long> fcsjs = new ArrayList<Long>();
463 List<Long> fcsjAs = new ArrayList<Long>(); 473 List<Long> fcsjAs = new ArrayList<Long>();
464 - for(Long l : timeMap0.get(time)){  
465 - if(l < 90)  
466 - fcsjs.add(l);  
467 - }  
468 - for(Long l : timeMap1.get(time)){  
469 - if(l < 90)  
470 - fcsjAs.add(l);  
471 - } 474 + if(timeMap0.containsKey(time))
  475 + for(Long l : timeMap0.get(time)){
  476 + if(l < 90)
  477 + fcsjs.add(l);
  478 + }
  479 + if(timeMap1.containsKey(time))
  480 + for(Long l : timeMap1.get(time)){
  481 + if(l < 90)
  482 + fcsjAs.add(l);
  483 + }
472 Collections.sort(fcsjs); 484 Collections.sort(fcsjs);
473 Collections.sort(fcsjAs); 485 Collections.sort(fcsjAs);
474 String[] split = key.split("/"); 486 String[] split = key.split("/");
@@ -495,7 +507,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -495,7 +507,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
495 tempMap.put("deviation", df.format(Double.valueOf(tempMap.get("sjInterval").toString()) 507 tempMap.put("deviation", df.format(Double.valueOf(tempMap.get("sjInterval").toString())
496 - Double.valueOf(tempMap.get("jhInterval").toString()))); 508 - Double.valueOf(tempMap.get("jhInterval").toString())));
497 } 509 }
498 - tempList.add(tempMap); 510 + if(fcsjs.size() != 0 || fcsjAs.size() != 0)
  511 + tempList.add(tempMap);
499 } 512 }
500 } 513 }
501 } 514 }
@@ -504,11 +517,24 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -504,11 +517,24 @@ public class BusIntervalServiceImpl implements BusIntervalService {
504 List<Long> sortList = new ArrayList<Long>(); 517 List<Long> sortList = new ArrayList<Long>();
505 Map<Long, List<Map<String, Object>>> sortMap = new HashMap<Long, List<Map<String, Object>>>(); 518 Map<Long, List<Map<String, Object>>> sortMap = new HashMap<Long, List<Map<String, Object>>>();
506 for(Map<String, Object> m : tempList){ 519 for(Map<String, Object> m : tempList){
507 - Long sort = Long.valueOf(m.get("times").toString().substring(0, 2)); 520 + String times = m.get("times").toString();
  521 + Long sort = Long.valueOf(times.substring(0, 2));
508 if(!sortMap.containsKey(sort)){ 522 if(!sortMap.containsKey(sort)){
509 sortMap.put(sort, new ArrayList<Map<String, Object>>()); 523 sortMap.put(sort, new ArrayList<Map<String, Object>>());
510 sortList.add(sort); 524 sortList.add(sort);
511 } 525 }
  526 + String[] split = times.split("-");
  527 + String[] split0 = split[0].split(":");
  528 + String[] split1 = split[1].split(":");
  529 + int t0 = Integer.valueOf(split0[0]);
  530 + int t1 = Integer.valueOf(split1[0]);
  531 + if(t0 >= 24){
  532 + t0 = t0 - 24;
  533 + }
  534 + if(t1 >= 24){
  535 + t1 = t1 - 24;
  536 + }
  537 + m.put("times", (t0>9?t0:("0"+t0))+":"+split0[1]+"-"+(t1>9?t1:("0"+t1))+":"+split1[1]);
512 sortMap.get(sort).add(m); 538 sortMap.get(sort).add(m);
513 } 539 }
514 Collections.sort(sortList); 540 Collections.sort(sortList);
@@ -531,14 +557,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -531,14 +557,16 @@ public class BusIntervalServiceImpl implements BusIntervalService {
531 Map<String, Object> tempMap = new HashMap<String, Object>(); 557 Map<String, Object> tempMap = new HashMap<String, Object>();
532 List<Long> fcsjs = new ArrayList<Long>(); 558 List<Long> fcsjs = new ArrayList<Long>();
533 List<Long> fcsjAs = new ArrayList<Long>(); 559 List<Long> fcsjAs = new ArrayList<Long>();
534 - for(Long l : temp0.get(key)){  
535 - if(l < 90)  
536 - fcsjs.add(l);  
537 - }  
538 - for(Long l : temp1.get(key)){  
539 - if(l < 90)  
540 - fcsjAs.add(l);  
541 - } 560 + if(temp0.containsKey(key))
  561 + for(Long l : temp0.get(key)){
  562 + if(l < 90)
  563 + fcsjs.add(l);
  564 + }
  565 + if(temp0.containsKey(key))
  566 + for(Long l : temp1.get(key)){
  567 + if(l < 90)
  568 + fcsjAs.add(l);
  569 + }
542 Collections.sort(fcsjs); 570 Collections.sort(fcsjs);
543 Collections.sort(fcsjAs); 571 Collections.sort(fcsjAs);
544 long fcsj = 0l; 572 long fcsj = 0l;
@@ -563,7 +591,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -563,7 +591,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
563 tempMap.put("deviation", df.format(Double.valueOf(tempMap.get("sjInterval").toString()) 591 tempMap.put("deviation", df.format(Double.valueOf(tempMap.get("sjInterval").toString())
564 - Double.valueOf(tempMap.get("jhInterval").toString()))); 592 - Double.valueOf(tempMap.get("jhInterval").toString())));
565 } 593 }
566 - resList.add(tempMap); 594 + if(fcsjs.size() != 0 || fcsjAs.size() != 0)
  595 + resList.add(tempMap);
567 } 596 }
568 } 597 }
569 } 598 }
@@ -601,6 +630,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -601,6 +630,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
601 Map<String, List<ChildTaskPlan>> cMap = new HashMap<String, List<ChildTaskPlan>>(); 630 Map<String, List<ChildTaskPlan>> cMap = new HashMap<String, List<ChildTaskPlan>>();
602 Map<String, Object> modelMap = new HashMap<String, Object>(); 631 Map<String, Object> modelMap = new HashMap<String, Object>();
603 Set<Long> tsSet = new HashSet<Long>(); 632 Set<Long> tsSet = new HashSet<Long>();
  633 + Set<Long> ttSet = new HashSet<Long>();
604 634
605 String company = map.get("company").toString(); 635 String company = map.get("company").toString();
606 String subCompany = map.get("subCompany").toString(); 636 String subCompany = map.get("subCompany").toString();
@@ -639,7 +669,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -639,7 +669,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
639 } 669 }
640 where += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; 670 where += " and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'";
641 671
642 - String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"'" 672 + String sql = "select id, schedule_date_Str, real_exec_date, xl_name, lp_name, bcs, bcsj, jhlc,"
  673 + + " fcsj, fcsj_actual, zdsj, zdsj_actual, qdz_name, zdz_name, xl_dir, status, remarks, gs_name, fgs_name, sp_id"
  674 + + " from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"'"
643 + " and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'"+where+""; 675 + " and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'"+where+"";
644 676
645 list = jdbcTemplate.query(sql, 677 list = jdbcTemplate.query(sql,
@@ -652,11 +684,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -652,11 +684,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
652 schedule.setRealExecDate(rs.getString("real_exec_date")); 684 schedule.setRealExecDate(rs.getString("real_exec_date"));
653 schedule.setXlName(rs.getString("xl_name")); 685 schedule.setXlName(rs.getString("xl_name"));
654 schedule.setLpName(rs.getString("lp_name")); 686 schedule.setLpName(rs.getString("lp_name"));
655 - schedule.setBcType(rs.getString("bc_type"));  
656 schedule.setBcs(rs.getInt("bcs")); 687 schedule.setBcs(rs.getInt("bcs"));
657 schedule.setBcsj(rs.getInt("bcsj")); 688 schedule.setBcsj(rs.getInt("bcsj"));
658 schedule.setJhlc(rs.getDouble("jhlc")); 689 schedule.setJhlc(rs.getDouble("jhlc"));
659 - schedule.setDfsj(rs.getString("dfsj"));  
660 schedule.setFcsj(rs.getString("fcsj")); 690 schedule.setFcsj(rs.getString("fcsj"));
661 schedule.setFcsjActual(rs.getString("fcsj_actual")); 691 schedule.setFcsjActual(rs.getString("fcsj_actual"));
662 schedule.setZdsj(rs.getString("zdsj")); 692 schedule.setZdsj(rs.getString("zdsj"));
@@ -668,12 +698,6 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -668,12 +698,6 @@ public class BusIntervalServiceImpl implements BusIntervalService {
668 schedule.setRemarks(rs.getString("remarks")); 698 schedule.setRemarks(rs.getString("remarks"));
669 schedule.setGsName(rs.getString("gs_name")); 699 schedule.setGsName(rs.getString("gs_name"));
670 schedule.setFgsName(rs.getString("fgs_name")); 700 schedule.setFgsName(rs.getString("fgs_name"));
671 - schedule.setDfAuto(rs.getBoolean("df_auto"));  
672 - schedule.setOnline(rs.getBoolean("online"));  
673 - schedule.setClZbh(rs.getString("cl_zbh"));  
674 - schedule.setjGh(rs.getString("j_gh"));  
675 - schedule.setjName(rs.getString("j_name"));  
676 - schedule.setStatus(rs.getInt("status"));  
677 schedule.setSpId(rs.getLong("sp_id")); 701 schedule.setSpId(rs.getLong("sp_id"));
678 702
679 if(schedule.getFcsjActual() != null && schedule.getFcsjActual().trim().length() == 0){ 703 if(schedule.getFcsjActual() != null && schedule.getFcsjActual().trim().length() == 0){
@@ -726,7 +750,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -726,7 +750,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
726 { 750 {
727 List<Map<String, String>> temp1 = new ArrayList<Map<String, String>>(); 751 List<Map<String, String>> temp1 = new ArrayList<Map<String, String>>();
728 List<Map<String, String>> temp2 = new ArrayList<Map<String, String>>(); 752 List<Map<String, String>> temp2 = new ArrayList<Map<String, String>>();
729 - sql = "select * from bsth_c_s_sp_info where bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; 753 + sql = "select id, lp, fcsj, xl_bm, tt_info from bsth_c_s_sp_info where bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'";
730 754
731 if(startDate.equals(endDate)){ 755 if(startDate.equals(endDate)){
732 sql += " and schedule_date = '"+startDate+"'"; 756 sql += " and schedule_date = '"+startDate+"'";
@@ -782,7 +806,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -782,7 +806,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
782 } 806 }
783 } 807 }
784 808
785 - sql = "select * from bsth_c_s_child_task order by start_date"; 809 + sql = "select destroy, start_date, end_date, mileage, mileage_type, schedule from bsth_c_s_child_task order by start_date";
786 810
787 cList = jdbcTemplate.query(sql, 811 cList = jdbcTemplate.query(sql,
788 new RowMapper<ChildTaskPlan>(){ 812 new RowMapper<ChildTaskPlan>(){
@@ -798,10 +822,12 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -798,10 +822,12 @@ public class BusIntervalServiceImpl implements BusIntervalService {
798 return cTask; 822 return cTask;
799 } 823 }
800 }); 824 });
801 - 825 +
802 if(model.length() != 0){ 826 if(model.length() != 0){
803 - sql = "select sp.id from bsth_c_s_sp_info sp left join bsth_c_s_ttinfo_detail tt on sp.tt_info = tt.ttinfo and sp.xl_bm = tt.xl and sp.lp = tt.lp and sp.fcsj = tt.fcsj "  
804 - + "where tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks'"; 827 + sql = "select sp.id from "
  828 + + "(select id, tt_info, xl_bm, lp, fcsj from bsth_c_s_sp_info where schedule_date >= '"+startDate+"' and schedule_date <= '"+endDate+"'"
  829 + + " and tt_info = '" + model + "' and bc_type != 'in' and bc_type != 'out' and bc_type != 'ldks') sp"
  830 + + " left join bsth_c_s_ttinfo_detail tt on sp.tt_info = tt.ttinfo and sp.xl_bm = tt.xl and sp.lp = tt.lp and sp.fcsj = tt.fcsj";
805 831
806 ttList = jdbcTemplate.query(sql, 832 ttList = jdbcTemplate.query(sql,
807 new RowMapper<Map<String, Object>>(){ 833 new RowMapper<Map<String, Object>>(){
@@ -809,10 +835,14 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -809,10 +835,14 @@ public class BusIntervalServiceImpl implements BusIntervalService {
809 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException { 835 public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
810 Map<String, Object> m = new HashMap<String, Object>(); 836 Map<String, Object> m = new HashMap<String, Object>();
811 m.put("id", rs.getString("id")); 837 m.put("id", rs.getString("id"));
812 - m.put("ists", rs.getString("ists")!=null?rs.getString("ists"):"0"); 838 +// m.put("ists", rs.getString("ists")!=null?rs.getString("ists"):"0");
813 return m; 839 return m;
814 } 840 }
815 }); 841 });
  842 +
  843 + for(Map<String, Object> m : ttList){
  844 + ttSet.add(Long.valueOf(m.get("id").toString()));
  845 + }
816 } 846 }
817 847
818 } catch (Exception e) { 848 } catch (Exception e) {
@@ -852,15 +882,21 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -852,15 +882,21 @@ public class BusIntervalServiceImpl implements BusIntervalService {
852 if(schedule.getXlName()==null || schedule.getXlName().trim().length()==0) 882 if(schedule.getXlName()==null || schedule.getXlName().trim().length()==0)
853 continue; 883 continue;
854 if(model.length() != 0){ 884 if(model.length() != 0){
855 - for(Map<String, Object> tt : ttList){  
856 - long id = Long.valueOf(tt.get("id").toString());  
857 - if(id == (long)schedule.getSpId()){  
858 - String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName();  
859 - if(!keyMap.containsKey(key))  
860 - keyMap.put(key, new ArrayList<ScheduleRealInfo>());  
861 - keyMap.get(key).add(schedule);  
862 - } 885 + if(ttSet.contains(schedule.getSpId())){
  886 + String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName();
  887 + if(!keyMap.containsKey(key))
  888 + keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  889 + keyMap.get(key).add(schedule);
863 } 890 }
  891 +// for(Map<String, Object> tt : ttList){
  892 +// long id = Long.valueOf(tt.get("id").toString());
  893 +// if(id == (long)schedule.getSpId()){
  894 +// String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName();
  895 +// if(!keyMap.containsKey(key))
  896 +// keyMap.put(key, new ArrayList<ScheduleRealInfo>());
  897 +// keyMap.get(key).add(schedule);
  898 +// }
  899 +// }
864 }else{ 900 }else{
865 String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName(); 901 String key = schedule.getScheduleDateStr() + "/" + schedule.getXlName() + "/" + schedule.getLpName();
866 if(!keyMap.containsKey(key)) 902 if(!keyMap.containsKey(key))
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
@@ -8,9 +8,13 @@ import com.bsth.entity.schedule.SchedulePlanInfo; @@ -8,9 +8,13 @@ import com.bsth.entity.schedule.SchedulePlanInfo;
8 import com.bsth.entity.schedule.TTInfo; 8 import com.bsth.entity.schedule.TTInfo;
9 import com.bsth.entity.schedule.TTInfoDetail; 9 import com.bsth.entity.schedule.TTInfoDetail;
10 import com.bsth.entity.search.CustomerSpecs; 10 import com.bsth.entity.search.CustomerSpecs;
  11 +import com.bsth.entity.sys.SysUser;
  12 +import com.bsth.entity.traffic.SKBUploadLogger;
11 import com.bsth.repository.*; 13 import com.bsth.repository.*;
12 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 14 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
13 import com.bsth.repository.schedule.*; 15 import com.bsth.repository.schedule.*;
  16 +import com.bsth.repository.traffic.SKBUploadLoggerRepository;
  17 +import com.bsth.security.util.SecurityUtils;
14 import com.bsth.service.TrafficManageService; 18 import com.bsth.service.TrafficManageService;
15 import com.bsth.util.TimeUtils; 19 import com.bsth.util.TimeUtils;
16 import com.bsth.util.db.DBUtils_MS; 20 import com.bsth.util.db.DBUtils_MS;
@@ -101,6 +105,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -101,6 +105,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{
101 @Autowired 105 @Autowired
102 private ScheduleRealInfoRepository scheduleRealInfoRepository; 106 private ScheduleRealInfoRepository scheduleRealInfoRepository;
103 107
  108 + // 时刻表上传记录repository
  109 + @Autowired
  110 + private SKBUploadLoggerRepository skbUploadLoggerRepository;
  111 +
104 112
105 // 运管处接口 113 // 运管处接口
106 private InternalPortType portType = null;//new Internal().getInternalHttpSoap11Endpoint(); 114 private InternalPortType portType = null;//new Internal().getInternalHttpSoap11Endpoint();
@@ -763,11 +771,12 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -763,11 +771,12 @@ public class TrafficManageServiceImpl implements TrafficManageService{
763 String[] idArray = ids.split(","); 771 String[] idArray = ids.split(",");
764 StringBuffer sBufferA; 772 StringBuffer sBufferA;
765 StringBuffer sBufferB; 773 StringBuffer sBufferB;
  774 + // 上传的时刻表集合
  775 + List<TTInfo> ttinfoList = new ArrayList<>();
766 TTInfo ttInfo; 776 TTInfo ttInfo;
767 TTInfoDetail ttInfoDetail; 777 TTInfoDetail ttInfoDetail;
768 Iterator<TTInfoDetail> ttInfoDetailIterator; 778 Iterator<TTInfoDetail> ttInfoDetailIterator;
769 HashMap<String,Object> param = new HashMap<String, Object>(); 779 HashMap<String,Object> param = new HashMap<String, Object>();
770 - String lineCode ;  
771 sBuffer.append("<SKBs>"); 780 sBuffer.append("<SKBs>");
772 HashMap<String,String> paramMap; 781 HashMap<String,String> paramMap;
773 HashMap<String,String> otherMap = new HashMap<String, String>(); 782 HashMap<String,String> otherMap = new HashMap<String, String>();
@@ -775,6 +784,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -775,6 +784,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
775 ttInfo = ttInfoRepository.findOne(Long.valueOf(idArray[i])); 784 ttInfo = ttInfoRepository.findOne(Long.valueOf(idArray[i]));
776 if(ttInfo == null) 785 if(ttInfo == null)
777 continue; 786 continue;
  787 + ttinfoList.add(ttInfo); // 保存时刻表
778 param.put("ttinfo.id_eq", ttInfo.getId()); 788 param.put("ttinfo.id_eq", ttInfo.getId());
779 ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param), 789 ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param),
780 new Sort(Direction.ASC, "xlDir")).iterator(); 790 new Sort(Direction.ASC, "xlDir")).iterator();
@@ -802,7 +812,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -802,7 +812,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
802 sBufferA.append("<JHYYLC>").append(ttInfoDetail.getJhlc()).append("</JHYYLC>"); 812 sBufferA.append("<JHYYLC>").append(ttInfoDetail.getJhlc()).append("</JHYYLC>");
803 sBuffer.append(sBufferA).append(sBufferB); 813 sBuffer.append(sBufferA).append(sBufferB);
804 } 814 }
805 - lineCode = ttInfoDetail.getXl().getLineCode();  
806 // 如果发车时间格式错误,忽略此条 815 // 如果发车时间格式错误,忽略此条
807 if(changeTimeFormat(ttInfoDetail) == null){ 816 if(changeTimeFormat(ttInfoDetail) == null){
808 continue; 817 continue;
@@ -831,6 +840,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -831,6 +840,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{
831 sBuffer.append("</SKBs>"); 840 sBuffer.append("</SKBs>");
832 if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ 841 if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
833 result = "success"; 842 result = "success";
  843 + SKBUploadLogger skbUploadLogger ;
  844 + SysUser user = SecurityUtils.getCurrentUser();
  845 + // 保存时刻表上传记录
  846 + for(TTInfo ttInfo1 : ttinfoList){
  847 + skbUploadLogger = new SKBUploadLogger();
  848 + skbUploadLogger.setTtInfo(ttInfo1);
  849 + skbUploadLogger.setUser(user);
  850 + skbUploadLoggerRepository.save(skbUploadLogger);
  851 + }
834 } 852 }
835 } catch (Exception e) { 853 } catch (Exception e) {
836 logger.error("setSKB:", e); 854 logger.error("setSKB:", e);
src/main/java/com/bsth/service/traffic/SKBUploadLoggerService.java 0 → 100644
  1 +package com.bsth.service.traffic;
  2 +
  3 +import com.bsth.entity.traffic.SKBUploadLogger;
  4 +import com.bsth.service.BaseService;
  5 +
  6 +
  7 +/**
  8 + * 时刻模板上传日志
  9 + */
  10 +public interface SKBUploadLoggerService extends BaseService<SKBUploadLogger,Integer> {
  11 +
  12 +}
src/main/java/com/bsth/service/traffic/impl/SKBUploadLoggerServiceImpl.java 0 → 100644
  1 +package com.bsth.service.traffic.impl;
  2 +
  3 +import com.bsth.entity.traffic.SKBUploadLogger;
  4 +import com.bsth.service.impl.BaseServiceImpl;
  5 +import com.bsth.service.traffic.SKBUploadLoggerService;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.stereotype.Service;
  9 +
  10 +/**
  11 + *
  12 + * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类)
  13 + *
  14 + * @Extends : BaseService
  15 + *
  16 + * @Description:
  17 + *
  18 + * @Author bsth@zq
  19 + *
  20 + * @Date 2016年10月28日 上午9:21:17
  21 + *
  22 + * @Version 公交调度系统BS版 0.1
  23 + *
  24 + */
  25 +
  26 +@Service
  27 +public class SKBUploadLoggerServiceImpl extends BaseServiceImpl<SKBUploadLogger,Integer> implements SKBUploadLoggerService{
  28 +
  29 + Logger logger = LoggerFactory.getLogger(this.getClass());
  30 +
  31 +}
src/main/resources/static/pages/forms/statement/correctStatis.html
@@ -7,7 +7,8 @@ @@ -7,7 +7,8 @@
7 .table-bordered > tbody > tr > td, 7 .table-bordered > tbody > tr > td,
8 .table-bordered > tfoot > tr > th, 8 .table-bordered > tfoot > tr > th,
9 .table-bordered > tfoot > tr > td { 9 .table-bordered > tfoot > tr > td {
10 - border: 1px solid; } 10 + border: 1px solid;
  11 + text-align: center; }
11 .table-bordered > thead > tr > th, 12 .table-bordered > thead > tr > th,
12 .table-bordered > thead > tr > td { 13 .table-bordered > thead > tr > td {
13 border-bottom-width: 2px; } 14 border-bottom-width: 2px; }
src/main/resources/static/pages/forms/statement/historyMessage.html
@@ -46,7 +46,7 @@ @@ -46,7 +46,7 @@
46 </form> 46 </form>
47 </div> 47 </div>
48 <div class="portlet-body"> 48 <div class="portlet-body">
49 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;max-height: 520px;"> 49 + <div class="table-container" id="table" style="margin-top: 10px;overflow:auto;min-width: 906px;">
50 <table class="table table-bordered table-hover table-checkable" id="forms"> 50 <table class="table table-bordered table-hover table-checkable" id="forms">
51 <thead> 51 <thead>
52 <tr class="hidden"> 52 <tr class="hidden">
@@ -80,6 +80,7 @@ @@ -80,6 +80,7 @@
80 format : 'YYYY-MM-DD', 80 format : 'YYYY-MM-DD',
81 locale : 'zh-cn' 81 locale : 'zh-cn'
82 }); 82 });
  83 + $("#table").height($(window).height()-280);
83 84
84 $.get('/basic/lineCode2Name',function(result){ 85 $.get('/basic/lineCode2Name',function(result){
85 var data=[]; 86 var data=[];
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
@@ -57,7 +57,7 @@ @@ -57,7 +57,7 @@
57 <span class="item-label" style="width: 80px;">选择线路: </span> 57 <span class="item-label" style="width: 80px;">选择线路: </span>
58 <select class="form-control" name="line" id="line" style="width: 150px;"></select> 58 <select class="form-control" name="line" id="line" style="width: 150px;"></select>
59 </div> 59 </div>
60 - <div style="display: inline-block; margin-left: 10px"> 60 + <div style="display: inline-block; margin-left: 10px; display: none;">
61 <span class="item-label" style="width: 80px;">时刻类型: </span> 61 <span class="item-label" style="width: 80px;">时刻类型: </span>
62 <select class="form-control" name="model" id="model" style="width: 165px;"> 62 <select class="form-control" name="model" id="model" style="width: 165px;">
63 <option value="">请选择...</option> 63 <option value="">请选择...</option>
@@ -93,7 +93,7 @@ @@ -93,7 +93,7 @@
93 </form> 93 </form>
94 </div> 94 </div>
95 <div class="portlet-body"> 95 <div class="portlet-body">
96 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px"> 96 + <div class="table-container" id="table" style="margin-top: 0px;overflow:auto;min-width: 906px;height:481px;">
97 <table class="table table-bordered table-hover table-checkable" id="forms"> 97 <table class="table table-bordered table-hover table-checkable" id="forms">
98 <thead> 98 <thead>
99 99
@@ -135,6 +135,7 @@ @@ -135,6 +135,7 @@
135 format : 'HH:mm', 135 format : 'HH:mm',
136 locale : 'zh-cn' 136 locale : 'zh-cn'
137 }); 137 });
  138 + $("#table").height($(window).height()-320);
138 139
139 var d = new Date(); 140 var d = new Date();
140 var year = d.getFullYear(); 141 var year = d.getFullYear();
@@ -239,6 +240,7 @@ @@ -239,6 +240,7 @@
239 $("#subCompany").on("change",initXl); 240 $("#subCompany").on("change",initXl);
240 function initXl(){ 241 function initXl(){
241 var data=[]; 242 var data=[];
  243 + data.push({id:" ", text:"全部线路"});
242 if(fage){ 244 if(fage){
243 $("#line").select2("destroy").html(''); 245 $("#line").select2("destroy").html('');
244 } 246 }
@@ -310,6 +312,8 @@ @@ -310,6 +312,8 @@
310 } 312 }
311 var reason = $("input[name='reason']"); 313 var reason = $("input[name='reason']");
312 var params = {}; 314 var params = {};
  315 + if(line == " ")
  316 + line = "";
313 // line = $("#line").val(); 317 // line = $("#line").val();
314 startDate = $("#startDate").val(); 318 startDate = $("#startDate").val();
315 endDate = $("#endDate").val(); 319 endDate = $("#endDate").val();
@@ -454,7 +458,7 @@ @@ -454,7 +458,7 @@
454 <thead> 458 <thead>
455 <tr> 459 <tr>
456 <th class="hidden"></th> 460 <th class="hidden"></th>
457 - <th rowspan="3">日期</th> 461 + <th rowspan="3" style=" width:120px;">日期</th>
458 <th rowspan="3">时段</th> 462 <th rowspan="3">时段</th>
459 <th rowspan="3">公司</th> 463 <th rowspan="3">公司</th>
460 <th rowspan="3">分公司</th> 464 <th rowspan="3">分公司</th>
src/main/resources/static/pages/forms/statement/waybill.html
@@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
71 </div> 71 </div>
72 </div> 72 </div>
73 <div class="col-md-9" id="printArea"> 73 <div class="col-md-9" id="printArea">
74 - <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;height: 520px"> 74 + <div class="table-container" id="xcld_height" style="margin-top: 10px;overflow:auto;min-width: 906px;">
75 <table class="table table-bordered table-checkable" id="forms"> 75 <table class="table table-bordered table-checkable" id="forms">
76 <tbody class="ludan_1"> 76 <tbody class="ludan_1">
77 77
@@ -106,6 +106,7 @@ @@ -106,6 +106,7 @@
106 locale : 'zh-cn' 106 locale : 'zh-cn'
107 }); 107 });
108 108
  109 + $("#xcld_height").height($(window).height()-100);
109 var d = new Date(); 110 var d = new Date();
110 var year = d.getFullYear(); 111 var year = d.getFullYear();
111 var month = d.getMonth() + 1; 112 var month = d.getMonth() + 1;
@@ -257,7 +258,7 @@ @@ -257,7 +258,7 @@
257 if($(this).children().size() < 2){ 258 if($(this).children().size() < 2){
258 return; 259 return;
259 } 260 }
260 - 261 + $("#xcld_height").height($(window).height()-100);
261 $(this).children().each(function(index){ 262 $(this).children().each(function(index){
262 params[index] = $(this).text(); 263 params[index] = $(this).text();
263 }); 264 });
src/main/resources/static/pages/mforms/operationservices/operationservice.html
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 <th>线路名称</th> 78 <th>线路名称</th>
79 <th>加注量</th> 79 <th>加注量</th>
80 <th>消耗量</th> 80 <th>消耗量</th>
81 - <th>行驶公里(含空放里程)</th> 81 + <th>行驶总公里(含空驶里程)</th>
82 <th>空驶里程</th> 82 <th>空驶里程</th>
83 <th>实际班次(包含空放班次)</th> 83 <th>实际班次(包含空放班次)</th>
84 </tr> 84 </tr>
src/main/resources/static/pages/trafficManage/js/timeTempletUpload.js
@@ -92,16 +92,17 @@ @@ -92,16 +92,17 @@
92 $("#right_div table tbody").empty(); 92 $("#right_div table tbody").empty();
93 var params = {}; 93 var params = {};
94 // 取得输入框的值 94 // 取得输入框的值
95 - var inputs = $(".param input,select");debugger; 95 + var inputs = $(".param input,select");
96 // 遍历数组 96 // 遍历数组
97 $.each(inputs, function(i, element) { 97 $.each(inputs, function(i, element) {
98 params[$(element).attr("name")] = $(element).val(); 98 params[$(element).attr("name")] = $(element).val();
99 }); 99 });
100 var i = layer.load(2); 100 var i = layer.load(2);
101 $get('/tic_ec', params, function(data) { 101 $get('/tic_ec', params, function(data) {
102 - _dateFormat(data.content); 102 + var content = data.data.content;
  103 + _dateFormat(content);
103 var bodyHtm = template('timeTemplet_list_temp', { 104 var bodyHtm = template('timeTemplet_list_temp', {
104 - list : data.content 105 + list : content
105 }); 106 });
106 $("#left_div table tbody").empty(); 107 $("#left_div table tbody").empty();
107 $("#left_div table tbody").append(bodyHtm); 108 $("#left_div table tbody").append(bodyHtm);
src/main/resources/static/pages/trafficManage/js/timeTempletUploadRecord.js
@@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
13 */ 13 */
14 14
15 (function(){ 15 (function(){
  16 + var page = 0, initPagination;
16 // 关闭左侧栏 17 // 关闭左侧栏
17 if (!$('body').hasClass('page-sidebar-closed')) 18 if (!$('body').hasClass('page-sidebar-closed'))
18 $('.menu-toggler.sidebar-toggler').click(); 19 $('.menu-toggler.sidebar-toggler').click();
@@ -69,6 +70,49 @@ @@ -69,6 +70,49 @@
69 $('#brancheCompanySelect').html(options).on('change', setLineAutocompleteOptions); 70 $('#brancheCompanySelect').html(options).on('change', setLineAutocompleteOptions);
70 } 71 }
71 } 72 }
  73 +
  74 + function setLineAutocompleteOptions(){
  75 + // 搜索参数集合
  76 + var params = {};
  77 + // 搜索字段名称
  78 + var name;
  79 + var items = $("ul.breadcrumb select");
  80 + // 遍历items集合
  81 + for(var j = 0, item; item = items[j++];){
  82 + // 获取字段名称
  83 + name = $(item).attr('name');
  84 + if(name){
  85 + // 赋取相对应的值
  86 + params[name] = $(item).val();
  87 + }
  88 + }
  89 + var lines = new Array();
  90 + var gsmap = getBusMap();
  91 + // 取得所有线路
  92 + $get('/line/all', params, function(allLine) {
  93 + // 遍历数组
  94 + $.each(allLine, function(i, e) {
  95 + var companyCode = e.company;
  96 + e.company = gsmap[e.company];
  97 + e.brancheCompany = gsmap[companyCode+"_"+e.brancheCompany];
  98 + var line = '{"hex":"'+e.company+'","label":"'+e.name+'"}';
  99 + var obj = jQuery.parseJSON(line);
  100 + lines[i]= obj;
  101 + });
  102 +
  103 +
  104 + });
  105 + // 给输入框绑定autocomplete事件
  106 + $("#line_name").autocompleter({
  107 + highlightMatches: true,
  108 + source: lines,
  109 + template: '{{ label }} <span>({{ hex }})</span>',
  110 + hint: true,
  111 + empty: false,
  112 + limit: 5,
  113 + });
  114 + }
  115 +
72 // 日期控件 116 // 日期控件
73 $('#dateInput').datetimepicker({ 117 $('#dateInput').datetimepicker({
74 // 日期控件时间格式 118 // 日期控件时间格式
@@ -140,7 +184,7 @@ @@ -140,7 +184,7 @@
140 }); 184 });
141 }); 185 });
142 // 给输入框绑定autocomplete事件 186 // 给输入框绑定autocomplete事件
143 - $("input[name='xl.name_eq']").autocompleter({ 187 + $("#line_name").autocompleter({
144 highlightMatches : true, 188 highlightMatches : true,
145 source : lines, 189 source : lines,
146 template : '{{ label }} <span>({{ hex }})</span>', 190 template : '{{ label }} <span>({{ hex }})</span>',
@@ -150,5 +194,66 @@ @@ -150,5 +194,66 @@
150 }); 194 });
151 // 设置autocompleter的宽度和输入框一样 195 // 设置autocompleter的宽度和输入框一样
152 $(".autocompleter").css("width", 196 $(".autocompleter").css("width",
153 - $("input[name='xl.name_eq']").css("width")); 197 + $("#line_name").css("width"));
  198 +
  199 + searchM(null, true);
  200 + // 绑定查询事件
  201 + $("#search").click(searchM);
  202 + // 查询方法
  203 + function searchM(p, pagination) {
  204 + var params = {};
  205 + // 取得输入框的值
  206 + var inputs = $(".breadcrumb input,select");
  207 + // 遍历数组
  208 + $.each(inputs, function(i, element) {
  209 + params[$(element).attr("name")] = $(element).val();
  210 + });
  211 + var i = layer.load(2);
  212 + $get('/skb_log', params, function(data) {
  213 + var content = data.content;
  214 + _dateFormat(content);
  215 + var bodyHtm = template('timeTempletUploadRecord_list_temp', {
  216 + list : content
  217 + });
  218 + $('#datatable_logger tbody').html(bodyHtm);
  219 + if(pagination && data.content.length > 0){
  220 + //重新分页
  221 + initPagination = true;
  222 + showPagination(data);
  223 + }
  224 + layer.close(i);
  225 + });
  226 + }
  227 +
  228 + //转换时间格式
  229 + function _dateFormat(list) {
  230 + var fs = 'YYYY-MM-DD HH:mm';
  231 + $.each(list, function(i, obj) {
  232 + obj.createDate = moment(obj.createDate).format(fs);
  233 + });
  234 + }
  235 +
  236 + function showPagination(data){
  237 + //分页
  238 + $('#pagination').jqPaginator({
  239 + totalPages: data.totalPages,
  240 + visiblePages: 6,
  241 + currentPage: page + 1,
  242 + first: '<li class="first"><a href="javascript:void(0);">首页<\/a><\/li>',
  243 + prev: '<li class="prev"><a href="javascript:void(0);">上一页<\/a><\/li>',
  244 + next: '<li class="next"><a href="javascript:void(0);">下一页<\/a><\/li>',
  245 + last: '<li class="last"><a href="javascript:void(0);">尾页<\/a><\/li>',
  246 + page: '<li class="page"><a href="javascript:void(0);">{{page}}<\/a><\/li>',
  247 + onPageChange: function (num, type) {
  248 + if(initPagination){
  249 + initPagination = false;
  250 + return;
  251 + }
  252 +
  253 +
  254 + page = num - 1;
  255 + searchM(null, false);
  256 + }
  257 + });
  258 + }
154 })(); 259 })();
155 \ No newline at end of file 260 \ No newline at end of file
src/main/resources/static/pages/trafficManage/timeTempletUploadRecord.html
@@ -10,16 +10,16 @@ @@ -10,16 +10,16 @@
10 <div class="col-md-12"> 10 <div class="col-md-12">
11 <ul class="breadcrumb"> 11 <ul class="breadcrumb">
12 <li>筛选数据:</li> 12 <li>筛选数据:</li>
13 - <li><select name="company_eq" class="form-control" id="companySelect"></select></li>  
14 - <li><select name="brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select></li> 13 + <li><select name="ttInfo.xl.company_eq" class="form-control" id="companySelect"></select></li>
  14 + <li><select name="ttInfo.xl.brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select></li>
15 <li>日期:</li> 15 <li>日期:</li>
16 - <li><input type="text" class="inputCommon dateTime" name="date" id="dateInput" placeholder="日期"></li> 16 + <li><input type="text" class="inputCommon dateTime" name="createDate_date_eq" id="dateInput" placeholder="日期"></li>
17 <li>线路名称:</li> 17 <li>线路名称:</li>
18 <li><input type="text" class="form-control form-filter input-sm" 18 <li><input type="text" class="form-control form-filter input-sm"
19 - name="xl.name_eq" maxlength="40" /></li> 19 + name="ttInfo.xl.name_eq" id="line_name" maxlength="40" /></li>
20 <li>上传用户:</li> 20 <li>上传用户:</li>
21 <li><input type="text" class="inputCommon inputCarPlate" 21 <li><input type="text" class="inputCommon inputCarPlate"
22 - name="xl.user_eq" maxlength="40" /></li> 22 + name="user.name_like" maxlength="40" /></li>
23 <li><a class="btn btn-circle blue" id="search">筛选</a></li> 23 <li><a class="btn btn-circle blue" id="search">筛选</a></li>
24 </ul> 24 </ul>
25 </div> 25 </div>
@@ -27,7 +27,8 @@ @@ -27,7 +27,8 @@
27 <div class="_panel"> 27 <div class="_panel">
28 <div class="table-container"> 28 <div class="table-container">
29 <table 29 <table
30 - class="table table-striped table-bordered table-advance pb-table head"> 30 + class="table table-striped table-bordered table-advance pb-table head"
  31 + id="datatable_logger">
31 <thead> 32 <thead>
32 <tr> 33 <tr>
33 <th>序号</th> 34 <th>序号</th>
@@ -49,35 +50,97 @@ @@ -49,35 +50,97 @@
49 </div> 50 </div>
50 </div> 51 </div>
51 </div> 52 </div>
52 -<script id="lineStationRecord_list_temp" type="text/html"> 53 +<script id="timeTempletUploadRecord_list_temp" type="text/html">
53 {{each list as obj i}} 54 {{each list as obj i}}
54 <tr> 55 <tr>
55 <td class="seq" style="vertical-align: middle;"> 56 <td class="seq" style="vertical-align: middle;">
56 {{i+1}} 57 {{i+1}}
57 </td> 58 </td>
58 <td> 59 <td>
59 - {{obj.name}} 60 + {{if obj.ttInfo.xl.company == '55'}}
  61 + 上南公司
  62 + {{else if obj.ttInfo.xl.company == '22'}}
  63 + 金高公司
  64 + {{else if obj.ttInfo.xl.company == '05'}}
  65 + 杨高公司
  66 + {{else if obj.ttInfo.xl.company == '26'}}
  67 + 南汇公司
  68 + {{else if obj.ttInfo.xl.company == '77'}}
  69 + 闵行公司
  70 + {{/if}}
60 </td> 71 </td>
61 - <td class="ttInfoId">  
62 - {{obj.company}} 72 + <td>
  73 + {{if obj.ttInfo.xl.company == '55'}}
  74 +
  75 + {{if obj.ttInfo.xl.brancheCompany == '1'}}
  76 + 上南二分公司
  77 + {{else if obj.ttInfo.xl.brancheCompany == '2'}}
  78 + 上南三分公司
  79 + {{else if obj.ttInfo.xl.brancheCompany == '3'}}
  80 + 上南六分公司
  81 + {{else if obj.ttInfo.xl.brancheCompany == '4'}}
  82 + 上南一分公司
  83 + {{/if}}
  84 +
  85 + {{else if obj.ttInfo.xl.company == '22'}}
  86 +
  87 + {{if obj.ttInfo.xl.brancheCompany == '1'}}
  88 + 四分公司
  89 + {{else if obj.ttInfo.xl.brancheCompany == '2'}}
  90 + 二分公司
  91 + {{else if obj.ttInfo.xl.brancheCompany == '3'}}
  92 + 三分公司
  93 + {{else if obj.ttInfo.xl.brancheCompany == '5'}}
  94 + 一分公司
  95 + {{/if}}
  96 +
  97 + {{else if obj.ttInfo.xl.company == '05'}}
  98 +
  99 + {{if obj.ttInfo.xl.brancheCompany == '1'}}
  100 + 川沙分公司
  101 + {{else if obj.ttInfo.xl.brancheCompany == '2'}}
  102 + 金桥分公司
  103 + {{else if obj.ttInfo.xl.brancheCompany == '3'}}
  104 + 芦潮港分公司
  105 + {{else if obj.ttInfo.xl.brancheCompany == '5'}}
  106 + 杨高分公司
  107 + {{else if obj.ttInfo.xl.brancheCompany == '6'}}
  108 + 周浦分公司
  109 + {{/if}}
  110 +
  111 + {{else if obj.ttInfo.xl.company == '26'}}
  112 +
  113 + {{if obj.ttInfo.xl.brancheCompany == '1'}}
  114 + 南汇一分
  115 + {{else if obj.ttInfo.xl.brancheCompany == '2'}}
  116 + 南汇二分
  117 + {{else if obj.ttInfo.xl.brancheCompany == '3'}}
  118 + 南汇三分
  119 + {{else if obj.ttInfo.xl.brancheCompany == '4'}}
  120 + 南汇维修公司
  121 + {{else if obj.ttInfo.xl.brancheCompany == '5'}}
  122 + 南汇公司
  123 + {{/if}}
  124 +
  125 + {{/if}}
63 </td> 126 </td>
64 <td> 127 <td>
65 - {{obj.name}} 128 + {{obj.ttInfo.xl.name}}
66 </td> 129 </td>
67 <td> 130 <td>
68 - {{obj.company}} 131 + {{obj.ttInfo.name}}
69 </td> 132 </td>
70 <td> 133 <td>
71 - 134 + {{obj.user.name}}
72 </td> 135 </td>
73 - <td >  
74 - 136 + <td>
  137 + {{obj.createDate}}
75 </td> 138 </td>
76 </tr> 139 </tr>
77 {{/each}} 140 {{/each}}
78 {{if list.length == 0}} 141 {{if list.length == 0}}
79 <tr class="muted"> 142 <tr class="muted">
80 - <td colspan=5 style="text-align: center;"><h6>没有找到相关数据</h6></td> 143 + <td colspan=7 style="text-align: center;"><h6>没有找到相关数据</h6></td>
81 </tr> 144 </tr>
82 {{/if}} 145 {{/if}}
83 </script> 146 </script>