Commit 887b7ff47a2111c4efcfab8c1f63e3d2efbb08fc

Authored by 游瑞烽
2 parents f95acdc4 49954100

Merge branch 'pudong' of 192.168.168.201:panzhaov5/bsth_control into pudong

Showing 29 changed files with 2079 additions and 449 deletions
src/main/java/com/bsth/controller/calc/CalcIntervalController.java 0 → 100644
  1 +package com.bsth.controller.calc;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RequestParam;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import com.bsth.controller.BaseController;
  12 +import com.bsth.entity.calc.CalcInterval;
  13 +import com.bsth.service.calc.CalcIntervalService;
  14 +
  15 +@RestController
  16 +@RequestMapping("calcInterval")
  17 +public class CalcIntervalController extends BaseController<CalcInterval,Integer>{
  18 + @Autowired
  19 + CalcIntervalService calcIntervalService;
  20 + @RequestMapping(value="/countList")
  21 + public List<Map<String,Object>> countList(@RequestParam Map<String, Object> map){
  22 + List<Map<String, Object>> list=calcIntervalService.countList(map);
  23 + return list;
  24 + }
  25 +
  26 + @RequestMapping(value="/listInterval")
  27 + public List<Map<String, Object>> listInterval(@RequestParam Map<String, Object> map){
  28 + List<Map<String, Object>>list=calcIntervalService.listInterval(map);
  29 + return list;
  30 + }
  31 +
  32 + @RequestMapping(value="/interval")
  33 + public List<Map<String,Object>> interval(@RequestParam Map<String, Object> map){
  34 + List<Map<String,Object>> list=calcIntervalService.interval(map);
  35 + return list;
  36 + }
  37 +
  38 +
  39 +}
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
1 package com.bsth.controller.realcontrol; 1 package com.bsth.controller.realcontrol;
2 2
3 import java.util.ArrayList; 3 import java.util.ArrayList;
  4 +import java.util.Arrays;
4 import java.util.Collection; 5 import java.util.Collection;
5 import java.util.HashMap; 6 import java.util.HashMap;
6 import java.util.List; 7 import java.util.List;
@@ -134,7 +135,7 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -134,7 +135,7 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
134 * @throws 135 * @throws
135 */ 136 */
136 @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST) 137 @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST)
137 - public Map<String, Object> realOutAdjust(Map<String, String> map) { 138 + public Map<String, Object> realOutAdjust(@RequestParam Map<String, String> map) {
138 return scheduleRealInfoService.realOutAdjust(map); 139 return scheduleRealInfoService.realOutAdjust(map);
139 } 140 }
140 141
@@ -722,4 +723,9 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo, @@ -722,4 +723,9 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
722 public List<RepairReport> repairReportList(@RequestParam String line, @RequestParam String date, @RequestParam String code, @RequestParam String type){ 723 public List<RepairReport> repairReportList(@RequestParam String line, @RequestParam String date, @RequestParam String code, @RequestParam String type){
723 return scheduleRealInfoService.repairReportList(line, date, code, type); 724 return scheduleRealInfoService.repairReportList(line, date, code, type);
724 } 725 }
  726 +
  727 + @RequestMapping(value = "lineLevel", method = RequestMethod.GET)
  728 + public Map<String, String> lineLevel(@RequestParam String idx){
  729 + return scheduleRealInfoService.getLevelsByLines(Arrays.asList(idx.split(",")));
  730 + }
725 } 731 }
src/main/java/com/bsth/controller/report/CalcSheetController.java
@@ -29,6 +29,14 @@ public class CalcSheetController extends BaseController&lt;CalcSheet, Integer&gt;{ @@ -29,6 +29,14 @@ public class CalcSheetController extends BaseController&lt;CalcSheet, Integer&gt;{
29 List<CalcSheet> list=calcSheetService.calcListSheet(map); 29 List<CalcSheet> list=calcSheetService.calcListSheet(map);
30 return list; 30 return list;
31 } 31 }
  32 +
  33 + //D级别线路发车到站准点率列表
  34 + @RequestMapping(value = "/calcListSheet_d",method = RequestMethod.GET)
  35 + public List<CalcSheet> calcListSheet_d(@RequestParam Map<String, Object> map){
  36 + List<CalcSheet> list=calcSheetService.calcListSheet_d(map);
  37 + return list;
  38 + }
  39 +
32 //发车站点准点率详细 40 //发车站点准点率详细
33 @RequestMapping(value = "/calcSheet",method = RequestMethod.GET) 41 @RequestMapping(value = "/calcSheet",method = RequestMethod.GET)
34 public List<Sheet> calcSheet(@RequestParam Map<String, Object> map){ 42 public List<Sheet> calcSheet(@RequestParam Map<String, Object> map){
src/main/java/com/bsth/data/BasicData.java
1 package com.bsth.data; 1 package com.bsth.data;
2 2
3 -import com.bsth.data.gpsdata_v2.cache.GeoCacheData;  
4 -import com.bsth.data.pinyin.PersionPinYinBuffer;  
5 -import com.bsth.entity.*;  
6 -import com.bsth.entity.schedule.CarConfigInfo;  
7 -import com.bsth.repository.*;  
8 -import com.bsth.repository.schedule.CarConfigInfoRepository;  
9 -import com.google.common.collect.BiMap;  
10 -import com.google.common.collect.HashBiMap; 3 +import java.text.DateFormat;
  4 +import java.text.SimpleDateFormat;
  5 +import java.util.ArrayList;
  6 +import java.util.Calendar;
  7 +import java.util.Date;
  8 +import java.util.HashMap;
  9 +import java.util.Iterator;
  10 +import java.util.List;
  11 +import java.util.Map;
  12 +
11 import org.apache.commons.lang3.StringUtils; 13 import org.apache.commons.lang3.StringUtils;
12 import org.slf4j.Logger; 14 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory; 15 import org.slf4j.LoggerFactory;
14 import org.springframework.beans.factory.annotation.Autowired; 16 import org.springframework.beans.factory.annotation.Autowired;
15 import org.springframework.stereotype.Component; 17 import org.springframework.stereotype.Component;
16 18
17 -import java.util.*; 19 +import com.bsth.data.gpsdata_v2.cache.GeoCacheData;
  20 +import com.bsth.data.pinyin.PersionPinYinBuffer;
  21 +import com.bsth.entity.Business;
  22 +import com.bsth.entity.CarPark;
  23 +import com.bsth.entity.Cars;
  24 +import com.bsth.entity.Line;
  25 +import com.bsth.entity.Personnel;
  26 +import com.bsth.entity.StationRoute;
  27 +import com.bsth.entity.calc.CalcInterval;
  28 +import com.bsth.entity.schedule.CarConfigInfo;
  29 +import com.bsth.repository.BusinessRepository;
  30 +import com.bsth.repository.CarParkRepository;
  31 +import com.bsth.repository.CarsRepository;
  32 +import com.bsth.repository.LineRepository;
  33 +import com.bsth.repository.PersonnelRepository;
  34 +import com.bsth.repository.StationRepository;
  35 +import com.bsth.repository.StationRouteRepository;
  36 +import com.bsth.repository.calc.CalcIntervalRepository;
  37 +import com.bsth.repository.schedule.CarConfigInfoRepository;
  38 +import com.google.common.collect.BiMap;
  39 +import com.google.common.collect.HashBiMap;
18 40
19 /** 41 /**
20 * @author PanZhao 42 * @author PanZhao
@@ -77,6 +99,8 @@ public class BasicData { @@ -77,6 +99,8 @@ public class BasicData {
77 //站点名和运管处编号 对照 99 //站点名和运管处编号 对照
78 public static Map<String, Integer> stationName2YgcNumber; 100 public static Map<String, Integer> stationName2YgcNumber;
79 101
  102 + // 线路编码_日期 等级
  103 + public static Map<String, String> lineDate2Level;
80 104
81 static Logger logger = LoggerFactory.getLogger(BasicData.class); 105 static Logger logger = LoggerFactory.getLogger(BasicData.class);
82 106
@@ -132,7 +156,9 @@ public class BasicData { @@ -132,7 +156,9 @@ public class BasicData {
132 156
133 @Autowired 157 @Autowired
134 PersionPinYinBuffer persionPinYinBuffer; 158 PersionPinYinBuffer persionPinYinBuffer;
135 - 159 +
  160 + @Autowired
  161 + CalcIntervalRepository calcIntervalRepository;
136 162
137 @Override 163 @Override
138 public void run() { 164 public void run() {
@@ -158,7 +184,9 @@ public class BasicData { @@ -158,7 +184,9 @@ public class BasicData {
158 loadPersonnelInfo(); 184 loadPersonnelInfo();
159 //公司信息 185 //公司信息
160 loadBusinessInfo(); 186 loadBusinessInfo();
161 - 187 + // 线路等级信息
  188 + loadLineLevel();
  189 +
162 logger.info("load geo cache..,"); 190 logger.info("load geo cache..,");
163 geoCacheData.loadData(); 191 geoCacheData.loadData();
164 station2ParkBuffer.saveAll(); 192 station2ParkBuffer.saveAll();
@@ -365,5 +393,30 @@ public class BasicData { @@ -365,5 +393,30 @@ public class BasicData {
365 //人员拼音转换 393 //人员拼音转换
366 persionPinYinBuffer.refresh(); 394 persionPinYinBuffer.refresh();
367 } 395 }
  396 +
  397 + /**
  398 + * 加载线路级别信息 按当前日期取(当前+前后一天)的数据
  399 + */
  400 + public void loadLineLevel() {
  401 + List<String> dates = new ArrayList<>();
  402 + Map<String, String> result = new HashMap<>();
  403 + DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
  404 +
  405 + Calendar c = Calendar.getInstance();
  406 + c.setTime(new Date(System.currentTimeMillis() - 86400000));
  407 + dates.add(df.format(c.getTime()));
  408 +
  409 + for (int i = 0;i < 2;i++) {
  410 + c.add(Calendar.DATE, 1);
  411 + dates.add(df.format(c.getTime()));
  412 + }
  413 +
  414 + List<CalcInterval> l = calcIntervalRepository.selectByDates(dates);
  415 + for (CalcInterval ci : l) {
  416 + result.put(ci.getXlBm() + "_" + ci.getDate(), ci.getLevel());
  417 + }
  418 +
  419 + lineDate2Level = result;
  420 + }
368 } 421 }
369 } 422 }
src/main/java/com/bsth/data/gpsdata_v2/load/GatewayHttpLoader.java
@@ -64,6 +64,7 @@ public class GatewayHttpLoader implements ApplicationContextAware{ @@ -64,6 +64,7 @@ public class GatewayHttpLoader implements ApplicationContextAware{
64 response = httpClient.execute(get); 64 response = httpClient.execute(get);
65 entity = response.getEntity(); 65 entity = response.getEntity();
66 66
  67 + logger.info("entity:" + entity + "get:" + get);
67 if(null == entity) 68 if(null == entity)
68 return list; 69 return list;
69 70
@@ -74,6 +75,7 @@ public class GatewayHttpLoader implements ApplicationContextAware{ @@ -74,6 +75,7 @@ public class GatewayHttpLoader implements ApplicationContextAware{
74 while ((str = br.readLine()) != null) 75 while ((str = br.readLine()) != null)
75 sb.append(str); 76 sb.append(str);
76 77
  78 + logger.info("gps:" + sb.toString());
77 list = JSON.parseArray(JSON.parseObject(sb.toString()).getString("data"), GpsEntity.class); 79 list = JSON.parseArray(JSON.parseObject(sb.toString()).getString("data"), GpsEntity.class);
78 //过滤掉无效的点位 80 //过滤掉无效的点位
79 list = GpsDataUtils.clearInvalid(list); 81 list = GpsDataUtils.clearInvalid(list);
src/main/java/com/bsth/entity/calc/CalcInterval.java
@@ -6,123 +6,167 @@ import javax.persistence.Entity; @@ -6,123 +6,167 @@ import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue; 6 import javax.persistence.GeneratedValue;
7 import javax.persistence.Id; 7 import javax.persistence.Id;
8 import javax.persistence.Table; 8 import javax.persistence.Table;
  9 +import javax.persistence.Transient;
9 10
  11 +import com.bsth.data.BasicData;
  12 +
  13 +/**
  14 + * @author bsth-a
  15 + *
  16 + */
10 @Entity 17 @Entity
11 -@Table(name = "calc_interval") 18 +@Table(name = "bsth_c_calc_interval")
12 public class CalcInterval { 19 public class CalcInterval {
13 /* 主键*/ 20 /* 主键*/
14 @Id 21 @Id
15 @GeneratedValue 22 @GeneratedValue
16 private Long id; 23 private Long id;
17 /* 公司代码*/ 24 /* 公司代码*/
18 - private String gsdm;  
19 - /* 公司名称*/  
20 - private String gsname; 25 + private String gsbm;
21 /* 分公司代码*/ 26 /* 分公司代码*/
22 - private String fgsdm;  
23 - /* 分公司名称*/  
24 - private String fgsname;  
25 - /* 日期*/  
26 - private Date rq; 27 + private String fgsbm;
27 /* 日期字符串*/ 28 /* 日期字符串*/
28 - private String rqStr; 29 + private String date;
29 /* 线路编码*/ 30 /* 线路编码*/
30 - private String xl; 31 + private String xlBm;
31 /* 线路名称*/ 32 /* 线路名称*/
32 private String xlName; 33 private String xlName;
33 - /* 大间隔次数*/  
34 - private int djg;  
35 - /* 大间隔次数(早高峰)*/  
36 - private int djgM;  
37 - /* 大间隔次数(晚高峰)*/  
38 - private int djgA;  
39 - /* 最大大间隔时间*/  
40 - private int djgTime;  
41 - /* 备注*/  
42 - private String remark; 34 + /*大间隔等级*/
  35 + private String level;
  36 + /*等级具体时间*/
  37 + private Integer levelTime;
  38 + /*全日大间隔次数*/
  39 + private Integer djgAll;
  40 + /*高峰大间隔次数*/
  41 + private Integer djgGf;
  42 + /*早高峰大间隔次数*/
  43 + private Integer djgZgf;
  44 + /*晚高峰大间隔次数*/
  45 + private Integer djgWgf;
  46 + /*低谷大间隔次数*/
  47 + private Integer djgDg;
  48 + /*最大间隔时间*/
  49 + private Integer djgTime;
  50 + /*数据创建时间*/
  51 + private Date createtime;
  52 + /*数据修改时间*/
  53 + private Date updatetime;
  54 +
  55 + /*公司名字*/
  56 + @Transient
  57 + private String gsname;
  58 + /*分公司名字*/
  59 + @Transient
  60 + private String fgsname;
43 public Long getId() { 61 public Long getId() {
44 return id; 62 return id;
45 } 63 }
46 public void setId(Long id) { 64 public void setId(Long id) {
47 this.id = id; 65 this.id = id;
48 } 66 }
49 - public String getGsdm() {  
50 - return gsdm; 67 + public String getGsbm() {
  68 + return gsbm;
51 } 69 }
52 - public void setGsdm(String gsdm) {  
53 - this.gsdm = gsdm; 70 + public void setGsbm(String gsbm) {
  71 + this.gsbm = gsbm;
54 } 72 }
55 - public String getGsname() {  
56 - return gsname; 73 + public String getFgsbm() {
  74 + return fgsbm;
57 } 75 }
58 - public void setGsname(String gsname) {  
59 - this.gsname = gsname; 76 + public void setFgsbm(String fgsbm) {
  77 + this.fgsbm = fgsbm;
60 } 78 }
61 - public String getFgsdm() {  
62 - return fgsdm; 79 + public String getDate() {
  80 + return date;
63 } 81 }
64 - public void setFgsdm(String fgsdm) {  
65 - this.fgsdm = fgsdm; 82 + public void setDate(String date) {
  83 + this.date = date;
66 } 84 }
67 - public String getFgsname() {  
68 - return fgsname; 85 + public String getXlBm() {
  86 + return xlBm;
69 } 87 }
70 - public void setFgsname(String fgsname) {  
71 - this.fgsname = fgsname; 88 + public void setXlBm(String xlBm) {
  89 + this.xlBm = xlBm;
72 } 90 }
73 - public Date getRq() {  
74 - return rq; 91 + public String getXlName() {
  92 + return xlName;
75 } 93 }
76 - public void setRq(Date rq) {  
77 - this.rq = rq; 94 + public void setXlName(String xlName) {
  95 + this.xlName = xlName;
78 } 96 }
79 - public String getRqStr() {  
80 - return rqStr; 97 + public String getLevel() {
  98 + return level;
81 } 99 }
82 - public void setRqStr(String rqStr) {  
83 - this.rqStr = rqStr; 100 + public void setLevel(String level) {
  101 + this.level = level;
84 } 102 }
85 - public String getXl() {  
86 - return xl; 103 + public Integer getLevelTime() {
  104 + return levelTime;
87 } 105 }
88 - public void setXl(String xl) {  
89 - this.xl = xl; 106 + public void setLevelTime(Integer levelTime) {
  107 + this.levelTime = levelTime;
90 } 108 }
91 - public String getXlName() {  
92 - return xlName; 109 + public Integer getDjgAll() {
  110 + return djgAll;
93 } 111 }
94 - public void setXlName(String xlName) {  
95 - this.xlName = xlName; 112 + public void setDjgAll(Integer djgAll) {
  113 + this.djgAll = djgAll;
  114 + }
  115 + public Integer getDjgGf() {
  116 + return djgGf;
96 } 117 }
97 - public int getDjg() {  
98 - return djg; 118 + public void setDjgGf(Integer djgGf) {
  119 + this.djgGf = djgGf;
  120 + }
  121 +
  122 + public Integer getDjgZgf() {
  123 + return djgZgf;
99 } 124 }
100 - public void setDjg(int djg) {  
101 - this.djg = djg; 125 + public void setDjgZgf(Integer djgZgf) {
  126 + this.djgZgf = djgZgf;
102 } 127 }
103 - public int getDjgM() {  
104 - return djgM; 128 + public Integer getDjgWgf() {
  129 + return djgWgf;
105 } 130 }
106 - public void setDjgM(int djgM) {  
107 - this.djgM = djgM; 131 + public void setDjgWgf(Integer djgWgf) {
  132 + this.djgWgf = djgWgf;
108 } 133 }
109 - public int getDjgA() {  
110 - return djgA; 134 + public Integer getDjgDg() {
  135 + return djgDg;
111 } 136 }
112 - public void setDjgA(int djgA) {  
113 - this.djgA = djgA; 137 + public void setDjgDg(Integer djgDg) {
  138 + this.djgDg = djgDg;
114 } 139 }
115 - public int getDjgTime() { 140 + public Integer getDjgTime() {
116 return djgTime; 141 return djgTime;
117 } 142 }
118 - public void setDjgTime(int djgTime) { 143 + public void setDjgTime(Integer djgTime) {
119 this.djgTime = djgTime; 144 this.djgTime = djgTime;
120 } 145 }
121 - public String getRemark() {  
122 - return remark; 146 + public Date getCreatetime() {
  147 + return createtime;
  148 + }
  149 + public void setCreatetime(Date createtime) {
  150 + this.createtime = createtime;
  151 + }
  152 + public Date getUpdatetime() {
  153 + return updatetime;
  154 + }
  155 + public void setUpdatetime(Date updatetime) {
  156 + this.updatetime = updatetime;
  157 + }
  158 + public String getGsname() {
  159 + return BasicData.businessCodeNameMap.get(this.gsbm);
123 } 160 }
124 - public void setRemark(String remark) {  
125 - this.remark = remark; 161 + public void setGsname(String gsname) {
  162 + this.gsname = gsname;
  163 + }
  164 + public String getFgsname() {
  165 + return BasicData.businessFgsCodeNameMap.get(this.fgsbm+"_"+this.gsbm);
126 } 166 }
  167 + public void setFgsname(String fgsname) {
  168 + this.fgsname = fgsname;
  169 + }
  170 +
127 171
128 } 172 }
src/main/java/com/bsth/repository/calc/CalcIntervalRepository.java
@@ -2,15 +2,13 @@ package com.bsth.repository.calc; @@ -2,15 +2,13 @@ package com.bsth.repository.calc;
2 2
3 import java.util.List; 3 import java.util.List;
4 4
5 -import javax.transaction.Transactional; 5 +import org.springframework.data.jpa.repository.Query;
  6 +import org.springframework.data.repository.query.Param;
  7 +import org.springframework.stereotype.Repository;
6 8
7 import com.bsth.entity.calc.CalcInterval; 9 import com.bsth.entity.calc.CalcInterval;
8 import com.bsth.repository.BaseRepository; 10 import com.bsth.repository.BaseRepository;
9 11
10 -import org.springframework.data.jpa.repository.Modifying;  
11 -import org.springframework.data.jpa.repository.Query;  
12 -import org.springframework.stereotype.Repository;  
13 -  
14 /** 12 /**
15 * 13 *
16 */ 14 */
@@ -18,23 +16,36 @@ import org.springframework.stereotype.Repository; @@ -18,23 +16,36 @@ import org.springframework.stereotype.Repository;
18 public interface CalcIntervalRepository extends BaseRepository<CalcInterval, Integer>{ 16 public interface CalcIntervalRepository extends BaseRepository<CalcInterval, Integer>{
19 17
20 //按照时间段统计,公司下线路 18 //按照时间段统计,公司下线路
21 - @Query(value="select DISTINCT c from CalcInterval c where c.xl like %?1% and c.rqStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.xl")  
22 - List<CalcInterval> selectByDateAndLine(String line,String date,String date2,String gsdm,String fgsdm); 19 + @Query(value="select DISTINCT c from CalcInterval c where c.date >= ?1 and c.date<= ?2 and c.gsbm like %?3% and c.fgsbm like %?4% and c.level like %?5% order by c.xlBm")
  20 + List<CalcInterval> selectByDateAndCompany(String date,String date2,String gsdm,String fgsdm,String level);
23 21
24 - //按照时间段统计,单条线路  
25 - @Query(value="select DISTINCT c from CalcInterval c where c.xl = ?1 and c.rqStr between ?2 and ?3 order by c.xl")  
26 - List<CalcInterval> selectByDateAndLine(String line,String date,String date2); 22 + //按照时间,公司下线路
  23 + @Query(value="select DISTINCT c from CalcInterval c where c.date = ?1 and c.gsbm like %?2% and c.fgsbm like %?3% and c.level like %?4% order by c.xlBm")
  24 + List<CalcInterval> selectByDateAndCompany(String date,String gsdm,String fgsdm,String level);
27 25
28 - //按照日期和线路删除数据  
29 - @Modifying  
30 - @Transactional  
31 - @Query(value = "delete CalcInterval c where c.rqStr=?1 and c.xl=?2")  
32 - void deleteByDateAndLine(String date, String line);  
33 26
34 - //按照日期删除数据  
35 - @Modifying  
36 - @Transactional  
37 - @Query(value = "delete CalcInterval c where c.rqStr=?1")  
38 - void deleteByDate(String date); 27 + //按照时间段统计,单条线路
  28 + @Query(value="select DISTINCT c from CalcInterval c where c.xlBm = ?1 and c.date >= ?2 and c.date <=?3 and c.level like %?4% order by c.xlBm")
  29 + List<CalcInterval> selectByDateAndLine(String line,String date,String date2,String level);
  30 +
39 31
  32 + //按照时间,单条线路
  33 + @Query(value="select DISTINCT c from CalcInterval c where c.xlBm = ?1 and c.date = ?2 and c.level like %?3% order by c.xlBm")
  34 + List<CalcInterval> selectByDateAndLine(String line,String date,String level);
  35 +
  36 + //按照时间段,公司统计
  37 + @Query(value="select gsbm,fgsbm,xl_bm,SUM(djg_all) as djgAll,SUM(djg_gf) as djgGf,SUM(djg_dg) as djgDg,SUM(djg_zgf) as djgZgf,SUM(djg_wgf) as djgWgf,MAX(djg_time) as djgTime "
  38 + + " from bsth_c_calc_interval where gsbm like %?1% and fgsbm like %?2% and date >=?3 and date <=?4 "
  39 + + " group by xl_bm,gsbm,fgsbm",nativeQuery=true)
  40 + List<Object[]> countByDateAndLine(String gsbm,String fgsbm,String date,String date2);
  41 +
  42 + //按照时间段,线路统计
  43 + @Query(value="select gsbm,fgsbm,xl_bm,SUM(djg_all) as djgAll,SUM(djg_gf) as djgGf,SUM(djg_dg) as djgDg,SUM(djg_zgf) as djgZgf,SUM(djg_wgf) as djgWgf,MAX(djg_time) as djgTime "
  44 + + " from bsth_c_calc_interval where xl_bm =?1 and date >=?2 and date <=?3 "
  45 + + " group by xl_bm,gsbm,fgsbm",nativeQuery=true)
  46 + List<Object[]> countByDateAndLine(String xlbm,String date,String date2);
  47 +
  48 + // 按日期查询
  49 + @Query(value="select c from CalcInterval c where c.date in (:dates)")
  50 + List<CalcInterval> selectByDates(@Param("dates")List<String> dates);
40 } 51 }
src/main/java/com/bsth/service/calc/CalcIntervalService.java 0 → 100644
  1 +package com.bsth.service.calc;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.entity.calc.CalcInterval;
  7 +import com.bsth.service.BaseService;
  8 +
  9 +/**
  10 + * Created by 17/11/16.
  11 + */
  12 +public interface CalcIntervalService extends BaseService<CalcInterval,Integer> {
  13 +
  14 + List<Map<String,Object>> countList(Map<String, Object> map);
  15 + List<Map<String,Object>> listInterval(Map<String, Object> map);
  16 + List<Map<String,Object>> interval(Map<String, Object> map);
  17 +}
src/main/java/com/bsth/service/calc/impl/CalcIntervalServiceImpl.java 0 → 100644
  1 +package com.bsth.service.calc.impl;
  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;
  8 +import java.util.ArrayList;
  9 +import java.util.Calendar;
  10 +import java.util.Collections;
  11 +import java.util.Comparator;
  12 +import java.util.Date;
  13 +import java.util.GregorianCalendar;
  14 +import java.util.HashMap;
  15 +import java.util.Iterator;
  16 +import java.util.List;
  17 +import java.util.Map;
  18 +
  19 +import org.apache.commons.lang3.StringUtils;
  20 +import org.springframework.beans.factory.annotation.Autowired;
  21 +import org.springframework.jdbc.core.JdbcTemplate;
  22 +import org.springframework.jdbc.core.RowMapper;
  23 +import org.springframework.stereotype.Service;
  24 +
  25 +import com.bsth.data.BasicData;
  26 +import com.bsth.entity.Line;
  27 +import com.bsth.entity.calc.CalcInterval;
  28 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  29 +import com.bsth.entity.sheet.CalcSheet;
  30 +import com.bsth.entity.sheet.Sheet;
  31 +import com.bsth.repository.LineRepository;
  32 +import com.bsth.repository.calc.CalcIntervalRepository;
  33 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  34 +import com.bsth.service.calc.CalcIntervalService;
  35 +import com.bsth.service.impl.BaseServiceImpl;
  36 +import com.bsth.util.ComparableReal;
  37 +import com.bsth.util.ReportUtils;
  38 +
  39 +@Service
  40 +public class CalcIntervalServiceImpl extends BaseServiceImpl<CalcInterval,Integer> implements CalcIntervalService {
  41 + private static long zgf1 = 6 * 60 + 31,
  42 + zgf2 = 8 * 60 + 30,
  43 + wgf1 = 16 * 60 + 1,
  44 + wgf2 = 18 * 60;
  45 +
  46 + @Autowired
  47 + CalcIntervalRepository calcIntervalRepository;
  48 + @Autowired
  49 + ScheduleRealInfoRepository scheduleRealInfoRepository;
  50 + @Autowired
  51 + LineRepository lineRepository;
  52 + @Autowired
  53 + JdbcTemplate jdbcTemplate;
  54 + @Override
  55 + public List<Map<String, Object>> countList(Map<String, Object> map) {
  56 + // TODO Auto-generated method stub
  57 + final DecimalFormat df = new DecimalFormat("0.00");
  58 + List<Map<String, Object>> list=new ArrayList<>();
  59 + String level=map.get("levelType").toString();
  60 + String line=map.get("line").toString().trim();
  61 + String gs=map.get("gs").toString().trim();
  62 + String fgs=map.get("fgs").toString().trim();
  63 + String sDate=map.get("date").toString();
  64 + String eDate=map.get("endDate").toString();
  65 +
  66 + //D级线路显示发车准点率
  67 + if(level.equals("D")){
  68 + String sql1=" select xl_bm,gsbm,fgsbm,xl_name from bsth_c_calc_interval where date >='"+sDate+"' and date <= '"+eDate+"' and `level`='D'";
  69 + if(line.equals("")){
  70 + sql1 +=" and gsbm like '%"+gs+"%' and fgsbm like '%"+fgs+"%'";
  71 + }else{
  72 + sql1 +=" and xl_bm ='"+line+"'";
  73 + }
  74 + sql1+=" group by xl_bm,gsbm,fgsbm,xl_name";
  75 +
  76 + String sql2="select gsdm,fgsdm,xl,xl_name,max(id) as id,sum(jhszfcs) as jhszfcs,"
  77 + + " sum(sjszfczds) as sjszfczds,sum(sjszddzds) as sjszddzds from bsth_c_calc_sheet where date >= '"+sDate+"' and date <= '"+eDate+"'";
  78 + if(line.trim().equals("")){
  79 + sql2 +=" and gsdm = '"+gs+"' and fgsdm like '%"+fgs+"%'";
  80 + }else{
  81 + sql2 +=" and xl ='"+line+"'";
  82 + }
  83 + sql2 +=" group by gsdm,fgsdm,xl,xl_name";
  84 +
  85 + String sql="select b.* from ("+sql1+") a left join ("+sql2+") b"
  86 + + " on a.xl_bm=b.xl and a.gsbm=b.gsdm and a.fgsbm=b.fgsdm and a.xl_name=b.xl_name";
  87 +
  88 + list=jdbcTemplate.query(sql,
  89 + new RowMapper<Map<String,Object>>(){
  90 + @Override
  91 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  92 + Map<String, Object> m=new HashMap<String,Object>();
  93 + m.put("gs", BasicData.businessCodeNameMap.get(rs.getString("gsdm")));
  94 + m.put("fgs", BasicData.businessFgsCodeNameMap.get(rs.getString("fgsdm")+"_"+rs.getString("gsdm")));
  95 + m.put("xlBm", rs.getString("xl"));
  96 + m.put("xlName", rs.getString("xl_name"));
  97 + m.put("id", rs.getInt("id"));
  98 + m.put("jhszfcs", rs.getString("jhszfcs"));
  99 + m.put("sjszfczds", rs.getString("sjszfczds"));
  100 + m.put("sjszddzds", rs.getString("sjszddzds"));
  101 + int jhfc=rs.getInt("jhszfcs");
  102 + int zdfc=rs.getInt("sjszfczds");
  103 + int zddd=rs.getInt("sjszddzds");
  104 + if(jhfc>0){
  105 + double zdl=(zdfc*1.0)/(jhfc*1.0)*100;
  106 + m.put("szfczdl", df.format(zdl)+"%");
  107 + zdl=(zddd*1.0)/(jhfc*1.0)*100;
  108 + m.put("szddzdl", df.format(zdl)+"%");
  109 + }else{
  110 + m.put("szfczdl", "0.0%");
  111 + m.put("szddzdl", "0.0%");
  112 +
  113 + }
  114 + return m;
  115 + }
  116 + });
  117 + }else{
  118 + String sql="select gsbm,fgsbm,xl_bm,xl_name,MAX(id) as id,SUM(djg_all) as djgAll,SUM(djg_gf) as djgGf,"
  119 + + "SUM(djg_dg) as djgDg,SUM(djg_zgf) as djgZgf,SUM(djg_wgf) as djgWgf,MAX(djg_time) as djgTime "
  120 + + "from bsth_c_calc_interval where date>= '"+sDate+"' and date<='"+eDate+"' and level <> 'D' ";
  121 + if(line.equals("")){
  122 + sql +=" and gsbm like '%"+gs+"%' and fgsbm like '%"+fgs+"%'";
  123 + }else{
  124 + sql +=" and xl_bm ='"+line+"'";
  125 + }
  126 + sql += " group by xl_bm,gsbm,fgsbm,xl_name";
  127 +
  128 + list=jdbcTemplate.query(sql,
  129 + new RowMapper<Map<String,Object>>(){
  130 + @Override
  131 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  132 + Map<String, Object> m=new HashMap<String,Object>();
  133 + m.put("gs", BasicData.businessCodeNameMap.get(rs.getString("gsbm")));
  134 + m.put("fgs", BasicData.businessFgsCodeNameMap.get(rs.getString("fgsbm")+"_"+rs.getString("gsbm")));
  135 + m.put("xlBm", rs.getString("xl_bm"));
  136 + m.put("xlName", rs.getString("xl_name"));
  137 + m.put("id", rs.getInt("id"));
  138 + m.put("djgAll", rs.getString("djgAll"));
  139 + m.put("djgGf", rs.getString("djgGf"));
  140 + m.put("djgZgf", rs.getString("djgZgf"));
  141 + m.put("djgWgf", rs.getString("djgWgf"));
  142 + m.put("djgDg", rs.getString("djgDg"));
  143 + m.put("djgTime", rs.getString("djgTime"));
  144 + return m;
  145 + }
  146 + });
  147 + }
  148 +
  149 + if(map.get("type").equals("export")){
  150 + String lineName="";
  151 + if(!line.equals("")){
  152 + lineName=list.get(0).get("xlName").toString();
  153 + }else if(!fgs.equals("")){
  154 + lineName=list.get(0).get("fgs").toString();
  155 + }else{
  156 + lineName=list.get(0).get("gs").toString();
  157 + }
  158 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  159 + Map<String, Object> m = new HashMap<String, Object>();
  160 + m.put("sdate", sDate);
  161 + m.put("eDate", eDate);
  162 + ReportUtils ee = new ReportUtils();
  163 + try {
  164 + String dateTime = "";
  165 + if(sDate.equals(eDate)){
  166 + dateTime = sDate.replaceAll("-", "");
  167 + } else {
  168 + dateTime = sDate.replaceAll("-", "")+"-"+
  169 + eDate.replaceAll("-", "");
  170 + }
  171 + listI.add(list.iterator());
  172 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  173 + String xls="";
  174 + String xlsName="";
  175 + if(level.equals("D")){
  176 + xls="calcSheetList.xls";
  177 + xlsName="发车到站准点率.xls";
  178 + }else{
  179 + xls="calcIntervalCount.xls";
  180 + xlsName="大间隔汇总表.xls";
  181 + }
  182 +
  183 + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + ""+xls,
  184 + path + "export/"+dateTime+"-"+lineName+"-"+xlsName);
  185 + } catch (Exception e) {
  186 + // TODO: handle exception
  187 + e.printStackTrace();
  188 + }
  189 + }
  190 + return list;
  191 + }
  192 + @Override
  193 + public List<Map<String, Object>> listInterval(Map<String, Object> map) {
  194 + // TODO Auto-generated method stub
  195 + String line=map.get("line").toString();
  196 + String date=map.get("date").toString();
  197 + String endDate=map.get("endDate").toString();
  198 + List<CalcInterval> listAll=calcIntervalRepository.selectByDateAndLine(line, date, endDate, "");
  199 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
  200 + for (int i = 0; i < listAll.size(); i++) {
  201 + CalcInterval t=listAll.get(i);
  202 + if(!t.getLevel().equals("D") && t.getDjgAll()>0){
  203 + Map<String, Object> m=new HashMap<>();
  204 + m.put("gs", t.getGsname());
  205 + m.put("fgs", t.getFgsname());
  206 + m.put("date", t.getDate());
  207 + m.put("xl", t.getXlName());
  208 + m.put("xlBm", t.getXlBm());
  209 + m.put("level", t.getLevel());
  210 + m.put("djgAll", t.getDjgAll());
  211 + m.put("djgGf", t.getDjgGf());
  212 + m.put("djgZgf", t.getDjgZgf());
  213 + m.put("djgWgf", t.getDjgWgf());
  214 + m.put("djgDg", t.getDjgDg());
  215 + m.put("djgTime", t.getDjgTime());
  216 + tempList.add(m);
  217 + }
  218 + }
  219 + if(map.get("type").equals("export")){
  220 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  221 + Map<String, Object> m = new HashMap<String, Object>();
  222 + m.put("date", date);
  223 + m.put("endDate", endDate);
  224 + ReportUtils ee = new ReportUtils();
  225 + try {
  226 + listI.add(tempList.iterator());
  227 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  228 + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "calcIntervalList1.xls",
  229 + path + "export/大间距汇总表"+date.replaceAll("-", "")+"-"+endDate.replaceAll("-", "")+".xls");
  230 + } catch (Exception e) {
  231 + // TODO: handle exception
  232 + e.printStackTrace();
  233 + }
  234 +
  235 + }
  236 + return tempList;
  237 + }
  238 +
  239 + @Override
  240 + public List<Map<String, Object>> interval(Map<String, Object> map) {
  241 + // TODO Auto-generated method stub
  242 + List<Map<String, Object>> list=new ArrayList<>();
  243 + String line=map.get("line").toString();
  244 + String date=map.get("date").toString();
  245 + List<ScheduleRealInfo> listReal=scheduleRealInfoRepository.scheduleDaily(line, date);
  246 + List<CalcInterval> listInterval=calcIntervalRepository.selectByDateAndLine(line, date, "");
  247 + String level=listInterval.get(0).getLevel();
  248 + if(listReal.size()>0){
  249 + Line t=lineRepository.findByLineCode(line);
  250 + long minFcsj = minFcsjs(t.getId());
  251 + list=calcIntervalList(listReal, minFcsj,level,t);
  252 + }
  253 + if(map.get("type").toString().equals("export")){
  254 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  255 + Map<String, Object> m = new HashMap<String, Object>();
  256 + m.put("date", date);
  257 + ReportUtils ee = new ReportUtils();
  258 + try {
  259 + listI.add(list.iterator());
  260 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  261 + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "interval.xls",
  262 + path + "export/"+date+"大间隔详细.xls");
  263 + } catch (Exception e) {
  264 + // TODO: handle exception
  265 + e.printStackTrace();
  266 + }
  267 + }
  268 + return list;
  269 + }
  270 +
  271 + private List<Map<String, Object>> calcIntervalList(List<ScheduleRealInfo> lists,long minFcsj,String level,Line line) {
  272 + List<ScheduleRealInfo> listjh0 = new ArrayList<ScheduleRealInfo>();
  273 + List<ScheduleRealInfo> listjh1 = new ArrayList<ScheduleRealInfo>();
  274 + List<ScheduleRealInfo> listsj0 = new ArrayList<ScheduleRealInfo>();
  275 + List<ScheduleRealInfo> listsj1 = new ArrayList<ScheduleRealInfo>();
  276 + List<Map<String, Object>> list=new ArrayList<>();
  277 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  278 + SimpleDateFormat sdf_ = new SimpleDateFormat("yyyy-MM-dd");
  279 + String xlName=lists.get(0).getXlName();
  280 + String scheduleDate=lists.get(0).getScheduleDateStr();
  281 + for (int j = 0; j < lists.size(); j++) {
  282 + ScheduleRealInfo s = lists.get(j);
  283 + boolean fage=false;
  284 + if(s.getBcType().equals("normal")){
  285 + fage=true;
  286 + }
  287 + if(s.getBcType().equals("region")){
  288 + if(s.getXlDir().equals("0")){
  289 + if(s.getQdzName().equals(line.getStartStationName()));
  290 + fage=true;
  291 + }else{
  292 + if(s.getQdzName().equals(line.getEndStationName()));
  293 + fage=true;
  294 + }
  295 + }
  296 + if (fage) {
  297 + String[] fcsj = s.getFcsj().split(":");
  298 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
  299 + Long fcsjT = 0L;
  300 + if (fcsjL < minFcsj) {
  301 + Calendar calendar = new GregorianCalendar();
  302 + calendar.setTime(s.getScheduleDate());
  303 + calendar.add(calendar.DATE, 1);
  304 + Date date = calendar.getTime();
  305 + try {
  306 + fcsjT = sdf.parse(sdf_.format(date) + " " + s.getFcsj()).getTime();
  307 + } catch (ParseException e) {
  308 + // TODO Auto-generated catch block
  309 + e.printStackTrace();
  310 + }
  311 + } else {
  312 + try {
  313 + fcsjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
  314 + } catch (ParseException e) {
  315 + // TODO Auto-generated catch block
  316 + e.printStackTrace();
  317 + }
  318 + }
  319 + Long fcsjAcual = 0L;
  320 + if (StringUtils.isEmpty(s.getFcsjActual())) {
  321 + s.setFcsjActualTime(0L);
  322 + s.setFcsjT(fcsjT);
  323 + } else {
  324 + try {
  325 + fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime();
  326 + s.setFcsjActualTime(fcsjAcual);
  327 + s.setFcsjT(fcsjT);
  328 + } catch (ParseException e) {
  329 + // TODO Auto-generated catch block
  330 + e.printStackTrace();
  331 + }
  332 + }
  333 +
  334 + if (s.isSflj()) {
  335 + if(StringUtils.isNotEmpty(s.getFcsjActual())){
  336 + if (s.getXlDir().equals("0")) {
  337 + listsj0.add(s);
  338 + } else {
  339 + listsj1.add(s);
  340 + }
  341 + }
  342 + } else {
  343 + if (s.getXlDir().equals("0")) {
  344 + if(StringUtils.isNotEmpty(s.getFcsjActual())){
  345 + listsj0.add(s);
  346 + }
  347 + listjh0.add(s);
  348 + } else {
  349 + if(StringUtils.isNotEmpty(s.getFcsjActual())){
  350 + listsj1.add(s);
  351 + }
  352 + listjh1.add(s);
  353 + }
  354 + }
  355 + }
  356 + }
  357 + /*
  358 + * 所有班次信息按上下行计划实际班次分组和根据计划实际发车时间排序
  359 + */
  360 + Collections.sort(listjh0, new ComparableJhfc());
  361 + Collections.sort(listjh1, new ComparableJhfc());
  362 + Collections.sort(listsj0, new ComparableAcual());
  363 + Collections.sort(listsj1, new ComparableAcual());
  364 +
  365 + long max_time=0;
  366 +
  367 + String jhfc="";
  368 + String sjfc="";
  369 + if(listsj0.size()>2){
  370 + //首班与首二班,末班与末二班中间的间隔不参与到统计
  371 + int p_time=0;
  372 + boolean p_fage=false; //判断两个班次是否为高峰班次,只有前后两个班次都是高峰班次,班次大间隔标准才用高峰标准
  373 + long p_actual_time=0;
  374 + String p_type="";
  375 + for (int j = 1; j < listsj0.size()-1; j++) {
  376 + boolean isAdd=false; //判断是否需要往map里面添加值
  377 + ScheduleRealInfo s =listsj0.get(j);
  378 + Map<String, Object> mm=new HashMap<>();
  379 + String[] fcsj = s.getFcsjActual().split(":");
  380 + int time = Integer.parseInt(fcsj[0]) * 60 + Integer.parseInt(fcsj[1]);
  381 + boolean fage=false;
  382 + String type="";
  383 + if (time >= zgf1 && time <= zgf2) {
  384 + fage=true;
  385 + type="zgf";
  386 + } else if (time >= wgf1 && time <= wgf2) {
  387 + fage=true;
  388 + type="wgf";
  389 + } else {
  390 + fage=false;
  391 + }
  392 + long sub_time=(s.getFcsjActualTime()-p_actual_time)/1000/60;
  393 + if(p_time>0){
  394 + if(sub_time>max_time){
  395 + max_time=sub_time;
  396 + }
  397 + if(fage&&p_fage){
  398 + //高峰间隔统计
  399 + if("zgf".equals(type) && type.equals(p_type)){
  400 + if(level.equals("A")){
  401 + if(sub_time >15)
  402 + isAdd=true;
  403 +
  404 + }else if(level.equals("B")){
  405 + if(sub_time >20)
  406 + isAdd=true;
  407 + }else if(level.equals("C")){
  408 + if(sub_time >25)
  409 + isAdd=true;
  410 + }else {
  411 + //D类不计算大间隔时间,通过发车准点率
  412 + }
  413 + }else if("wgf".equals(type) && type.equals(p_type)){
  414 + if(level.equals("A")){
  415 + if(sub_time >15)
  416 + isAdd=true;
  417 + }else if(level.equals("B")){
  418 + if(sub_time >20)
  419 + isAdd=true;
  420 + }else if(level.equals("C")){
  421 + if(sub_time >25)
  422 + isAdd=true;
  423 + }else {
  424 + //D类不计算大间隔时间,通过发车准点率
  425 + }
  426 + }
  427 + }else{
  428 + //平谷间隔统计
  429 + if(level.equals("A")){
  430 + if(sub_time >29)
  431 + isAdd=true;
  432 + }else if(level.equals("B")){
  433 + if(sub_time >29)
  434 + isAdd=true;
  435 + }else if(level.equals("C")){
  436 + if(sub_time >40)
  437 + isAdd=true;
  438 + }else {
  439 + //D类不计算大间隔时间,通过发车准点率
  440 + max_time=0;
  441 + }
  442 + }
  443 + }
  444 + if(isAdd){
  445 + mm.put("xlName", xlName);
  446 + mm.put("level", level);
  447 + mm.put("jhfc1", jhfc);
  448 + mm.put("sjfc1", sjfc);
  449 + mm.put("jhfc2", s.getFcsj());
  450 + mm.put("sjfc2", s.getFcsjActual());
  451 + mm.put("subTime", sub_time);
  452 + mm.put("date", scheduleDate);
  453 + mm.put("station", s.getQdzName());
  454 + list.add(mm);
  455 + }
  456 + p_fage=fage;
  457 + p_type=type;
  458 + p_time =time;
  459 + p_actual_time=s.getFcsjActualTime();
  460 + jhfc=s.getFcsj();
  461 + sjfc=s.getFcsjActual();
  462 + }
  463 + }
  464 +
  465 +
  466 + jhfc="";
  467 + sjfc="";
  468 + if(listsj1.size()>2){
  469 + //首班与首二班,末班与末二班中间的间隔不参与到统计
  470 + int p_time=0;
  471 + boolean p_fage=false; //判断两个班次是否为高峰班次,只有前后两个班次都是高峰班次,班次大间隔标准才用高峰标准
  472 + long p_actual_time=0;
  473 + String p_type="";
  474 + for (int j = 1; j < listsj1.size()-1; j++) {
  475 + boolean isAdd=false; //判断是否需要往map里面添加值
  476 + ScheduleRealInfo s =listsj1.get(j);
  477 + Map<String, Object> mm=new HashMap<>();
  478 + String[] fcsj = s.getFcsjActual().split(":");
  479 + int time = Integer.parseInt(fcsj[0]) * 60 + Integer.parseInt(fcsj[1]);
  480 + boolean fage=false;
  481 + String type="";
  482 + if (time >= zgf1 && time <= zgf2) {
  483 + fage=true;
  484 + type="zgf";
  485 + } else if (time >= wgf1 && time <= wgf2) {
  486 + fage=true;
  487 + type="wgf";
  488 + } else {
  489 + fage=false;
  490 + }
  491 + long sub_time=(s.getFcsjActualTime()-p_actual_time)/1000/60;
  492 + if(p_time>0){
  493 + if(sub_time>max_time){
  494 + max_time=sub_time;
  495 + }
  496 + if(fage&&p_fage){
  497 + //高峰间隔统计
  498 + if("zgf".equals(type) && type.equals(p_type)){
  499 + if(level.equals("A")){
  500 + if(sub_time >15)
  501 + isAdd=true;
  502 +
  503 + }else if(level.equals("B")){
  504 + if(sub_time >20)
  505 + isAdd=true;
  506 + }else if(level.equals("C")){
  507 + if(sub_time >25)
  508 + isAdd=true;
  509 + }else {
  510 + //D类不计算大间隔时间,通过发车准点率
  511 + }
  512 + }else if("wgf".equals(type) && type.equals(p_type)){
  513 + if(level.equals("A")){
  514 + if(sub_time >15)
  515 + isAdd=true;
  516 + }else if(level.equals("B")){
  517 + if(sub_time >20)
  518 + isAdd=true;
  519 + }else if(level.equals("C")){
  520 + if(sub_time >25)
  521 + isAdd=true;
  522 + }else {
  523 + //D类不计算大间隔时间,通过发车准点率
  524 + }
  525 + }
  526 + }else{
  527 + //平谷间隔统计
  528 + if(level.equals("A")){
  529 + if(sub_time >29)
  530 + isAdd=true;
  531 + }else if(level.equals("B")){
  532 + if(sub_time >29)
  533 + isAdd=true;
  534 + }else if(level.equals("C")){
  535 + if(sub_time >40)
  536 + isAdd=true;
  537 + }else {
  538 + //D类不计算大间隔时间,通过发车准点率
  539 + max_time=0;
  540 + }
  541 + }
  542 + }
  543 + if(isAdd){
  544 + mm.put("xlName", xlName);
  545 + mm.put("level", level);
  546 + mm.put("jhfc1", jhfc);
  547 + mm.put("sjfc1", sjfc);
  548 + mm.put("jhfc2", s.getFcsj());
  549 + mm.put("sjfc2", s.getFcsjActual());
  550 + mm.put("subTime", sub_time);
  551 + mm.put("date", scheduleDate);
  552 + mm.put("station", s.getQdzName());
  553 +
  554 + list.add(mm);
  555 + }
  556 + p_fage=fage;
  557 + p_type=type;
  558 + p_time =time;
  559 + p_actual_time=s.getFcsjActualTime();
  560 + jhfc=s.getFcsj();
  561 + sjfc=s.getFcsjActual();
  562 + }
  563 + }
  564 + return list;
  565 + }
  566 +
  567 +
  568 + private Long minFcsjs(int id){
  569 + String minfcsj="02:00";
  570 + String sqlMinYysj="select ifnull(max(start_opt),'02:00') as start_opt from bsth_c_line_config where "
  571 + + " id = ("
  572 + + "select max(id) from bsth_c_line_config where line ='"+id +"'"
  573 + + ")";
  574 + minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  575 + String[] minSjs = minfcsj.split(":");
  576 + //车辆最早发车时间 用了过滤超第二天0点的数据
  577 + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
  578 + return minSj;
  579 + }
  580 +}
  581 +
  582 +class ComparableJhfc implements Comparator<ScheduleRealInfo>{
  583 + @Override
  584 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  585 + // TODO Auto-generated method stub
  586 + return o1.getFcsjT().compareTo(o2.getFcsjT());
  587 + }
  588 +}
  589 +
  590 +class ComparableAcual implements Comparator<ScheduleRealInfo>{
  591 + @Override
  592 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  593 + // TODO Auto-generated method stub
  594 + return o1.getFcsjActualTime().compareTo(o2.getFcsjActualTime());
  595 + }
  596 +}
src/main/java/com/bsth/service/calc/impl/CalcToolServiceImpl.java
1 package com.bsth.service.calc.impl; 1 package com.bsth.service.calc.impl;
2 2
3 -import java.sql.ResultSet;  
4 -import java.sql.SQLException;  
5 import java.util.ArrayList; 3 import java.util.ArrayList;
6 import java.util.Date; 4 import java.util.Date;
7 import java.util.HashMap; 5 import java.util.HashMap;
@@ -10,7 +8,6 @@ import java.util.List; @@ -10,7 +8,6 @@ import java.util.List;
10 import java.util.Map; 8 import java.util.Map;
11 import java.util.Set; 9 import java.util.Set;
12 10
13 -import com.bsth.entity.calc.CalcInterval;  
14 import com.bsth.entity.calc.CalcWaybill; 11 import com.bsth.entity.calc.CalcWaybill;
15 import com.bsth.entity.realcontrol.ChildTaskPlan; 12 import com.bsth.entity.realcontrol.ChildTaskPlan;
16 import com.bsth.entity.realcontrol.ScheduleRealInfo; 13 import com.bsth.entity.realcontrol.ScheduleRealInfo;
@@ -19,14 +16,12 @@ import com.bsth.repository.calc.CalcIntervalRepository; @@ -19,14 +16,12 @@ import com.bsth.repository.calc.CalcIntervalRepository;
19 import com.bsth.repository.calc.CalcWaybillRepository; 16 import com.bsth.repository.calc.CalcWaybillRepository;
20 import com.bsth.service.calc.CalcToolService; 17 import com.bsth.service.calc.CalcToolService;
21 import com.bsth.service.calc.CalcCulateMileageService; 18 import com.bsth.service.calc.CalcCulateMileageService;
22 -import com.bsth.service.report.CulateMileageService;  
23 import com.bsth.util.Arith; 19 import com.bsth.util.Arith;
24 20
25 import org.slf4j.Logger; 21 import org.slf4j.Logger;
26 import org.slf4j.LoggerFactory; 22 import org.slf4j.LoggerFactory;
27 import org.springframework.beans.factory.annotation.Autowired; 23 import org.springframework.beans.factory.annotation.Autowired;
28 import org.springframework.jdbc.core.JdbcTemplate; 24 import org.springframework.jdbc.core.JdbcTemplate;
29 -import org.springframework.jdbc.core.RowMapper;  
30 import org.springframework.stereotype.Service; 25 import org.springframework.stereotype.Service;
31 26
32 /** 27 /**
@@ -35,11 +30,6 @@ import org.springframework.stereotype.Service; @@ -35,11 +30,6 @@ import org.springframework.stereotype.Service;
35 @Service 30 @Service
36 public class CalcToolServiceImpl implements CalcToolService { 31 public class CalcToolServiceImpl implements CalcToolService {
37 32
38 - @Autowired  
39 - private CalcWaybillRepository clacRepository;  
40 -  
41 - @Autowired  
42 - private CalcIntervalRepository culcIntervalRepository;  
43 33
44 @Autowired 34 @Autowired
45 private CalcCulateMileageService culateMileageService; 35 private CalcCulateMileageService culateMileageService;
@@ -114,50 +104,6 @@ public class CalcToolServiceImpl implements CalcToolService { @@ -114,50 +104,6 @@ public class CalcToolServiceImpl implements CalcToolService {
114 listCal.addAll(this.cul(list_, lists_, xlList, djgList)); 104 listCal.addAll(this.cul(list_, lists_, xlList, djgList));
115 } 105 }
116 } 106 }
117 -  
118 - //按线路计算大间隔  
119 - if(list.size() > 0){  
120 - ScheduleRealInfo s = list.get(0);  
121 - Map<String, Object> culateDjg = culateMileageService.culateDjg(list, lineCode, xlList, djgList);  
122 - CalcInterval interval = new CalcInterval();  
123 - interval.setGsdm(s.getGsBm());  
124 - interval.setGsname(s.getGsName());  
125 - interval.setFgsdm(s.getFgsBm());  
126 - interval.setFgsname(s.getFgsName());  
127 - interval.setRq(s.getScheduleDate());  
128 - interval.setRqStr(s.getScheduleDateStr());  
129 - interval.setXl(s.getXlBm());  
130 - interval.setXlName(s.getXlName());  
131 - if(culateDjg.keySet().size() > 0){  
132 - if(culateDjg.containsKey("djgcsq")){  
133 - interval.setDjg(Integer.valueOf(culateDjg.get("djgcsq").toString()));  
134 - } else {  
135 - interval.setDjg(0);  
136 - }  
137 - if(culateDjg.containsKey("djgcsz")){  
138 - interval.setDjgM(Integer.valueOf(culateDjg.get("djgcsz").toString()));  
139 - } else {  
140 - interval.setDjgM(0);  
141 - }  
142 - if(culateDjg.containsKey("djgcsw")){  
143 - interval.setDjgA(Integer.valueOf(culateDjg.get("djgcsw").toString()));  
144 - } else {  
145 - interval.setDjgA(0);  
146 - }  
147 - if(culateDjg.containsKey("djgsj")){  
148 - interval.setDjgTime(Integer.valueOf(culateDjg.get("djgsj").toString()));  
149 - } else {  
150 - interval.setDjgTime(0);  
151 - }  
152 - } else {  
153 - interval.setDjg(0);  
154 - interval.setDjgM(0);  
155 - interval.setDjgA(0);  
156 - interval.setDjgTime(0);  
157 - }  
158 - culcIntervalRepository.save(interval);  
159 - }  
160 -  
161 while(true){ 107 while(true){
162 int i = 0, l = 0; 108 int i = 0, l = 0;
163 boolean flag = false; 109 boolean flag = false;
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
@@ -68,9 +68,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -68,9 +68,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
68 private CalcWaybillRepository calcRepository; 68 private CalcWaybillRepository calcRepository;
69 69
70 @Autowired 70 @Autowired
71 - private CalcIntervalRepository calcIntervalRepository;  
72 -  
73 - @Autowired  
74 private CalcStatisticsRepository calcStatisticsRepository; 71 private CalcStatisticsRepository calcStatisticsRepository;
75 72
76 @Autowired 73 @Autowired
@@ -92,6 +89,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -92,6 +89,9 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
92 private ScheduleRealInfoRepository scheduleRealInfoRepository; 89 private ScheduleRealInfoRepository scheduleRealInfoRepository;
93 90
94 @Autowired 91 @Autowired
  92 + private CalcIntervalRepository calcIntervalRepository;
  93 +
  94 + @Autowired
95 private LineRepository lineRepository; 95 private LineRepository lineRepository;
96 @Autowired 96 @Autowired
97 private LineService lineService; 97 private LineService lineService;
@@ -163,10 +163,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -163,10 +163,8 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
163 } 163 }
164 if(date.length() != 0 && line.length() != 0){ 164 if(date.length() != 0 && line.length() != 0){
165 calcRepository.deleteByDateAndLine(date, line); 165 calcRepository.deleteByDateAndLine(date, line);
166 - calcIntervalRepository.deleteByDateAndLine(date, line);  
167 } else if(date.length() != 0){ 166 } else if(date.length() != 0){
168 calcRepository.deleteByDate(date); 167 calcRepository.deleteByDate(date);
169 - calcIntervalRepository.deleteByDate(date);  
170 } else { 168 } else {
171 newMap.put("status", ResponseCode.ERROR); 169 newMap.put("status", ResponseCode.ERROR);
172 logger.error("save erro.", "日期不能为空"); 170 logger.error("save erro.", "日期不能为空");
@@ -283,19 +281,15 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -283,19 +281,15 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
283 List<String> keyList = new ArrayList<String>(); 281 List<String> keyList = new ArrayList<String>();
284 List<CalcWaybill> list = new ArrayList<CalcWaybill>(); 282 List<CalcWaybill> list = new ArrayList<CalcWaybill>();
285 List<CalcWaybill> lists = new ArrayList<CalcWaybill>(); 283 List<CalcWaybill> lists = new ArrayList<CalcWaybill>();
286 - List<CalcInterval> list_ = new ArrayList<CalcInterval>();  
287 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 284 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
288 Map<String, List<CalcWaybill>> keyMap = new HashMap<String, List<CalcWaybill>>(); 285 Map<String, List<CalcWaybill>> keyMap = new HashMap<String, List<CalcWaybill>>();
289 - Map<String, List<CalcInterval>> keyMap_ = new HashMap<String, List<CalcInterval>>();  
290 286
291 if(line.equals("")){ 287 if(line.equals("")){
292 //查询所有线路 288 //查询所有线路
293 list = calcRepository.scheduleByDateAndLineTj(line,date,date2,gsdm,fgsdm); 289 list = calcRepository.scheduleByDateAndLineTj(line,date,date2,gsdm,fgsdm);
294 - list_ = calcIntervalRepository.selectByDateAndLine(line, date, date2, gsdm, fgsdm);  
295 }else{ 290 }else{
296 //查询单条线路 291 //查询单条线路
297 list = calcRepository.scheduleByDateAndLineTj2(line,date,date2); 292 list = calcRepository.scheduleByDateAndLineTj2(line,date,date2);
298 - list_ = calcIntervalRepository.selectByDateAndLine(line, date, date2);  
299 } 293 }
300 294
301 for(CalcWaybill c : list){ 295 for(CalcWaybill c : list){
@@ -306,12 +300,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -306,12 +300,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
306 } 300 }
307 keyMap.get(key).add(c); 301 keyMap.get(key).add(c);
308 } 302 }
309 - for(CalcInterval c : list_){  
310 - String key = c.getXlName();  
311 - if(!keyMap_.containsKey(key))  
312 - keyMap_.put(key, new ArrayList<CalcInterval>());  
313 - keyMap_.get(key).add(c);  
314 - }  
315 Collections.sort(keyList, new AccountXlbmStr()); 303 Collections.sort(keyList, new AccountXlbmStr());
316 for(String key : keyList){ 304 for(String key : keyList){
317 CalcWaybill calc = keyMap.get(key).get(0); 305 CalcWaybill calc = keyMap.get(key).get(0);
@@ -356,26 +344,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -356,26 +344,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
356 calc.setSjfyylc(Arith.add(calc.getSjfyylc(), calc.getLjfyylc())); 344 calc.setSjfyylc(Arith.add(calc.getSjfyylc(), calc.getLjfyylc()));
357 lists.add(calc); 345 lists.add(calc);
358 } 346 }
359 - CalcInterval sum_ = new CalcInterval();  
360 - sum_.setXlName("合计");  
361 - sum_.setDjgTime(0);  
362 - for(String key : keyMap_.keySet()){  
363 - CalcInterval calc = keyMap_.get(key).get(0);  
364 - for(int i = 1; i < keyMap_.get(key).size(); i++){  
365 - CalcInterval calc_ = keyMap_.get(key).get(i);  
366 - calc.setDjg(calc.getDjg() + calc_.getDjg());  
367 - calc.setDjgM(calc.getDjgM() + calc_.getDjgM());  
368 - calc.setDjgA(calc.getDjgA() + calc_.getDjgA());  
369 - if(calc_.getDjgTime() > calc.getDjgTime())  
370 - calc.setDjgTime(calc_.getDjgTime());  
371 - }  
372 - sum_.setDjg(sum_.getDjg() + calc.getDjg());  
373 - sum_.setDjgM(sum_.getDjgM() + calc.getDjgM());  
374 - sum_.setDjgA(sum_.getDjgA() + calc.getDjgA());  
375 - if(calc.getDjgTime() > sum_.getDjgTime())  
376 - sum_.setDjgTime(calc.getDjgTime());  
377 - }  
378 -  
379 CalcWaybill sum = new CalcWaybill(); 347 CalcWaybill sum = new CalcWaybill();
380 sum.setXlName("合计"); 348 sum.setXlName("合计");
381 for(CalcWaybill c : lists){ 349 for(CalcWaybill c : lists){
@@ -459,22 +427,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -459,22 +427,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
459 m.put("dtbc", c.getDtbc()); 427 m.put("dtbc", c.getDtbc());
460 m.put("dtbc_m", c.getDtbczgf()); 428 m.put("dtbc_m", c.getDtbczgf());
461 m.put("dtbc_a", c.getDtbcwgf()); 429 m.put("dtbc_a", c.getDtbcwgf());
462 - if(keyMap_.containsKey(c.getXlName()) || c.getXlName().equals("合计")){  
463 - CalcInterval calc;  
464 - if(c.getXlName().equals("合计"))  
465 - calc = sum_;  
466 - else  
467 - calc = keyMap_.get(c.getXlName()).get(0);  
468 - m.put("djg", calc.getDjg());  
469 - m.put("djg_m", calc.getDjgM());  
470 - m.put("djg_a", calc.getDjgA());  
471 - m.put("djg_time", calc.getDjgTime());  
472 - } else {  
473 - m.put("djg", 0);  
474 - m.put("djg_m", 0);  
475 - m.put("djg_a", 0);  
476 - m.put("djg_time", 0);  
477 - }  
478 resList.add(m); 430 resList.add(m);
479 } 431 }
480 432
@@ -533,7 +485,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -533,7 +485,6 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
533 } else { 485 } else {
534 line = line.trim(); 486 line = line.trim();
535 } 487 }
536 -  
537 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); 488 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
538 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); 489 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
539 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); 490 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
@@ -555,6 +506,14 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -555,6 +506,14 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
555 for(Map<String, String> m : gsList){ 506 for(Map<String, String> m : gsList){
556 list.addAll(calcStatisticsRepository.scheduleByDateAndLine(line, rq, rq, m.get("gsdm"), m.get("fgsdm"))); 507 list.addAll(calcStatisticsRepository.scheduleByDateAndLine(line, rq, rq, m.get("gsdm"), m.get("fgsdm")));
557 } 508 }
  509 +
  510 + List<CalcInterval> listInterval=calcIntervalRepository.selectByDateAndCompany(rq, "", "","");
  511 + Map<String,CalcInterval> mapInterval=new HashMap<String,CalcInterval>();
  512 + for (int i = 0; i < listInterval.size(); i++) {
  513 + CalcInterval c=listInterval.get(i);
  514 + mapInterval.put(c.getXlBm(), c);
  515 + }
  516 +
558 517
559 for (int i = 0; i < list.size(); i++) { 518 for (int i = 0; i < list.size(); i++) {
560 ScheduleRealInfo s=list.get(i); 519 ScheduleRealInfo s=list.get(i);
@@ -574,19 +533,32 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -574,19 +533,32 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
574 lists.add(list.get(i)); 533 lists.add(list.get(i));
575 }else{ 534 }else{
576 lists.add(list.get(i)); 535 lists.add(list.get(i));
577 - CalcStatistics s=staticTj(lists); 536 + CalcInterval t=null;
  537 + if(mapInterval.get(lists.get(0).getXlBm())!=null){
  538 + t=mapInterval.get(lists.get(0).getXlBm());
  539 + }
  540 +
  541 + CalcStatistics s=staticTj(lists,t);
578 lMap.add(s); 542 lMap.add(s);
579 lists=new ArrayList<ScheduleRealInfo>(); 543 lists=new ArrayList<ScheduleRealInfo>();
580 } 544 }
581 }else{ 545 }else{
582 if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){ 546 if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){
583 lists.add(list.get(i)); 547 lists.add(list.get(i));
584 - CalcStatistics s=staticTj(lists); 548 + CalcInterval t=null;
  549 + if(mapInterval.get(lists.get(0).getXlBm())!=null){
  550 + t=mapInterval.get(lists.get(0).getXlBm());
  551 + }
  552 + CalcStatistics s=staticTj(lists,t);
585 lMap.add(s); 553 lMap.add(s);
586 }else{ 554 }else{
587 lists=new ArrayList<ScheduleRealInfo>(); 555 lists=new ArrayList<ScheduleRealInfo>();
588 lists.add(list.get(i)); 556 lists.add(list.get(i));
589 - CalcStatistics s=staticTj(lists); 557 + CalcInterval t=null;
  558 + if(mapInterval.get(lists.get(0).getXlBm())!=null){
  559 + t=mapInterval.get(lists.get(0).getXlBm());
  560 + }
  561 + CalcStatistics s=staticTj(lists,t);
590 lMap.add(s); 562 lMap.add(s);
591 } 563 }
592 } 564 }
@@ -609,7 +581,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -609,7 +581,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
609 return result; 581 return result;
610 } 582 }
611 583
612 - public final CalcStatistics staticTj(List<ScheduleRealInfo> list){ 584 + public final CalcStatistics staticTj(List<ScheduleRealInfo> list,CalcInterval t){
613 585
614 List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>(); 586 List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
615 for(int i=0;i<list.size();i++){ 587 for(int i=0;i<list.size();i++){
@@ -697,23 +669,30 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -697,23 +669,30 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
697 s.setDtbcq(0); 669 s.setDtbcq(0);
698 s.setDtbcz(0); 670 s.setDtbcz(0);
699 s.setDtbcw(0); 671 s.setDtbcw(0);
700 - Map<String, Object> m_=culateService.culateDjg(lists, list.get(0).getXlBm());  
701 - if(m_.containsKey("djgcsq") && m_.get("djgcsq")!=null)  
702 - s.setDjgq(Integer.valueOf(m_.get("djgcsq").toString()));  
703 - else  
704 - s.setDjgq(0);  
705 - if(m_.containsKey("djgcsz") && m_.get("djgcsz")!=null)  
706 - s.setDjgz(Integer.valueOf(m_.get("djgcsz").toString()));  
707 - else  
708 - s.setDjgz(0);  
709 - if(m_.containsKey("djgcsw") && m_.get("djgcsw")!=null)  
710 - s.setDjgw(Integer.valueOf(m_.get("djgcsw").toString()));  
711 - else  
712 - s.setDjgw(0);  
713 - if(m_.containsKey("djgsj") && m_.get("djgsj")!=null)  
714 - s.setDjgsj(Integer.valueOf(m_.get("djgsj").toString()));  
715 - else  
716 - s.setDjgsj(0); 672 + if(t==null){
  673 + Map<String, Object> m_=culateService.culateDjg(lists, list.get(0).getXlBm());
  674 + if(m_.containsKey("djgcsq") && m_.get("djgcsq")!=null)
  675 + s.setDjgq(Integer.valueOf(m_.get("djgcsq").toString()));
  676 + else
  677 + s.setDjgq(0);
  678 + if(m_.containsKey("djgcsz") && m_.get("djgcsz")!=null)
  679 + s.setDjgz(Integer.valueOf(m_.get("djgcsz").toString()));
  680 + else
  681 + s.setDjgz(0);
  682 + if(m_.containsKey("djgcsw") && m_.get("djgcsw")!=null)
  683 + s.setDjgw(Integer.valueOf(m_.get("djgcsw").toString()));
  684 + else
  685 + s.setDjgw(0);
  686 + if(m_.containsKey("djgsj") && m_.get("djgsj")!=null)
  687 + s.setDjgsj(Integer.valueOf(m_.get("djgsj").toString()));
  688 + else
  689 + s.setDjgsj(0);
  690 + }else{
  691 + s.setDjgq(t.getDjgAll());
  692 + s.setDjgz(t.getDjgZgf());
  693 + s.setDjgw(t.getDjgWgf());
  694 + s.setDjgsj(t.getDjgTime());
  695 + }
717 } 696 }
718 return s; 697 return s;
719 } 698 }
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
@@ -199,4 +199,6 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -199,4 +199,6 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
199 Map<String, Object> repairReport(Map<String, Object> map, boolean isActive); 199 Map<String, Object> repairReport(Map<String, Object> map, boolean isActive);
200 200
201 List<RepairReport> repairReportList(String line,String date,String code, String type); 201 List<RepairReport> repairReportList(String line,String date,String code, String type);
  202 +
  203 + Map<String, String> getLevelsByLines(List<String> lines);
202 } 204 }
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -73,6 +73,7 @@ import com.bsth.entity.CarDevice; @@ -73,6 +73,7 @@ import com.bsth.entity.CarDevice;
73 import com.bsth.entity.Cars; 73 import com.bsth.entity.Cars;
74 import com.bsth.entity.Line; 74 import com.bsth.entity.Line;
75 import com.bsth.entity.Personnel; 75 import com.bsth.entity.Personnel;
  76 +import com.bsth.entity.calc.CalcInterval;
76 import com.bsth.entity.oil.Dlb; 77 import com.bsth.entity.oil.Dlb;
77 import com.bsth.entity.oil.Ylb; 78 import com.bsth.entity.oil.Ylb;
78 import com.bsth.entity.oil.Ylxxb; 79 import com.bsth.entity.oil.Ylxxb;
@@ -94,6 +95,7 @@ import com.bsth.repository.CarDeviceRepository; @@ -94,6 +95,7 @@ import com.bsth.repository.CarDeviceRepository;
94 import com.bsth.repository.CarsRepository; 95 import com.bsth.repository.CarsRepository;
95 import com.bsth.repository.LineRepository; 96 import com.bsth.repository.LineRepository;
96 import com.bsth.repository.RepairReportRepository; 97 import com.bsth.repository.RepairReportRepository;
  98 +import com.bsth.repository.calc.CalcIntervalRepository;
97 import com.bsth.repository.oil.DlbRepository; 99 import com.bsth.repository.oil.DlbRepository;
98 import com.bsth.repository.oil.YlbRepository; 100 import com.bsth.repository.oil.YlbRepository;
99 import com.bsth.repository.oil.YlxxbRepository; 101 import com.bsth.repository.oil.YlxxbRepository;
@@ -154,6 +156,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -154,6 +156,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
154 156
155 @Autowired 157 @Autowired
156 DictionaryService dictionaryService; 158 DictionaryService dictionaryService;
  159 +
  160 + @Autowired
  161 + CalcIntervalRepository calcIntervalRepository;
157 /*@Autowired 162 /*@Autowired
158 BorrowCenter borrowCenter;*/ 163 BorrowCenter borrowCenter;*/
159 164
@@ -238,6 +243,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -238,6 +243,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
238 report2repair.put("9103", "9103"); 243 report2repair.put("9103", "9103");
239 report2repair.put("9104", "9104"); 244 report2repair.put("9104", "9104");
240 report2repair.put("9109", "9109"); 245 report2repair.put("9109", "9109");
  246 + report2repair.put("9201", "9201");
  247 + report2repair.put("9202", "9202");
  248 + report2repair.put("9203", "9203");
  249 + report2repair.put("9204", "9204");
  250 + report2repair.put("9209", "9209");
  251 + report2repair.put("9301", "9301");
  252 + report2repair.put("9302", "9302");
  253 + report2repair.put("9303", "9303");
  254 + report2repair.put("9304", "9304");
  255 + report2repair.put("9305", "9305");
  256 + report2repair.put("9306", "9306");
  257 + report2repair.put("9309", "9309");
241 } 258 }
242 259
243 260
@@ -2690,11 +2707,21 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2690,11 +2707,21 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2690 map.put("dtbc", 0); 2707 map.put("dtbc", 0);
2691 map.put("dtbc_m", 0); 2708 map.put("dtbc_m", 0);
2692 map.put("dtbc_a", 0); 2709 map.put("dtbc_a", 0);
2693 - Map<String, Object> m = culateService.culateDjg(list_s, line);  
2694 - map.put("djg", m.get("djgcsq"));  
2695 - map.put("djg_m", m.get("djgcsz"));  
2696 - map.put("djg_a", m.get("djgcsw"));  
2697 - map.put("djg_time", m.get("djgsj")); 2710 + List<CalcInterval> intervalList=calcIntervalRepository.selectByDateAndLine(line, date,"");
  2711 + if(intervalList.size()>0){
  2712 + CalcInterval c=intervalList.get(0);
  2713 + map.put("djg",c.getDjgAll());
  2714 + map.put("djg_m", c.getDjgZgf());
  2715 + map.put("djg_a", c.getDjgWgf());
  2716 + map.put("djg_time", c.getDjgTime());
  2717 + }else{
  2718 + Map<String, Object> m = culateService.culateDjg(list_s, line);
  2719 + map.put("djg", m.get("djgcsq"));
  2720 + map.put("djg_m", m.get("djgcsz"));
  2721 + map.put("djg_a", m.get("djgcsw"));
  2722 + map.put("djg_time", m.get("djgsj"));
  2723 + }
  2724 +
2698 map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl)); 2725 map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl));
2699 lMap.add(map); 2726 lMap.add(map);
2700 2727
@@ -2796,7 +2823,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2796,7 +2823,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2796 return lMap; 2823 return lMap;
2797 } 2824 }
2798 2825
2799 - public final Map<String, Object> staticTj(List<ScheduleRealInfo> list) { 2826 + public final Map<String, Object> staticTj(List<ScheduleRealInfo> list,Map<String, Object> m) {
2800 2827
2801 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); 2828 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2802 for (int i = 0; i < list.size(); i++) { 2829 for (int i = 0; i < list.size(); i++) {
@@ -2882,11 +2909,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2882,11 +2909,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2882 map.put("dtbc", 0); 2909 map.put("dtbc", 0);
2883 map.put("dtbc_m", 0); 2910 map.put("dtbc_m", 0);
2884 map.put("dtbc_a", 0); 2911 map.put("dtbc_a", 0);
2885 - Map<String, Object> m_ = culateService.culateDjg(lists, list.get(0).getXlBm());  
2886 - map.put("djg", m_.get("djgcsq"));  
2887 - map.put("djg_m", m_.get("djgcsz"));  
2888 - map.put("djg_a", m_.get("djgcsw"));  
2889 - map.put("djg_time", m_.get("djgsj")); 2912 + if(m.get("xl")==null){
  2913 + Map<String, Object> m_ = culateService.culateDjg(lists, list.get(0).getXlBm());
  2914 + map.put("djg", m_.get("djgcsq"));
  2915 + map.put("djg_m", m_.get("djgcsz"));
  2916 + map.put("djg_a", m_.get("djgcsw"));
  2917 + map.put("djg_time", m_.get("djgsj"));
  2918 + }else{
  2919 + map.put("djg", m.get("djgAll")==null?"0":m.get("djgAll"));
  2920 + map.put("djg_m", m.get("djgZgf")==null?"0":m.get("djgZgf"));
  2921 + map.put("djg_a", m.get("djgWgf")==null?"0":m.get("djgWgf"));
  2922 + map.put("djg_time", m.get("djgTime")==null?"0":m.get("djgTime"));
  2923 + }
2890 } 2924 }
2891 return map; 2925 return map;
2892 } 2926 }
@@ -2897,14 +2931,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2897,14 +2931,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2897 List<ScheduleRealInfo> listAll = new ArrayList<ScheduleRealInfo>(); 2931 List<ScheduleRealInfo> listAll = new ArrayList<ScheduleRealInfo>();
2898 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); 2932 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
2899 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); 2933 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
  2934 + List<Object[]> listInterval=new ArrayList<Object[]>();
2900 line = line.trim(); 2935 line = line.trim();
2901 if (line.equals("")) { 2936 if (line.equals("")) {
2902 //查询所有线路 2937 //查询所有线路
2903 listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm); 2938 listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  2939 + listInterval = calcIntervalRepository.countByDateAndLine(gsdm, fgsdm, date, date2);
2904 } else { 2940 } else {
2905 //查询单条线路 2941 //查询单条线路
2906 listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2); 2942 listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2);
2907 - } 2943 + listInterval = calcIntervalRepository.countByDateAndLine(line, date, date2);
  2944 + }
  2945 + Map<String, Map<String,Object>> mapInterval=new HashMap<String, Map<String,Object>>();
  2946 + for (int i = 0; i < listInterval.size(); i++) {
  2947 + Object[] interval=listInterval.get(i);
  2948 + String gs=interval[0].toString();
  2949 + String fgs=interval[1].toString();
  2950 + String xl=interval[2].toString();
  2951 + Map<String, Object> m=new HashMap<String,Object>();
  2952 + m.put("gs", gs);
  2953 + m.put("fgs", fgs);
  2954 + m.put("xl", xl);
  2955 + m.put("djgAll", interval[3]);
  2956 + m.put("djgZgf", interval[6]);
  2957 + m.put("djgWgf", interval[7]);
  2958 + m.put("djgTime", interval[8]);
  2959 + mapInterval.put(gs+"-"+fgs+"-"+xl, m);
  2960 + }
2908 Map<String, Boolean> lineMap=lineService.lineNature(); 2961 Map<String, Boolean> lineMap=lineService.lineNature();
2909 List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>(); 2962 List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
2910 for (int i = 0; i < listAll.size(); i++) { 2963 for (int i = 0; i < listAll.size(); i++) {
@@ -2939,19 +2992,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2939,19 +2992,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2939 lists.add(list.get(i)); 2992 lists.add(list.get(i));
2940 } else { 2993 } else {
2941 lists.add(list.get(i)); 2994 lists.add(list.get(i));
2942 - Map<String, Object> map = staticTj(lists); 2995 + Map<String, Object> mm=new HashMap<String,Object>();
  2996 + if(mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm())!=null){
  2997 + mm=mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm());
  2998 + }
  2999 + Map<String, Object> map = staticTj(lists,mm);
2943 lMap.add(map); 3000 lMap.add(map);
2944 lists = new ArrayList<ScheduleRealInfo>(); 3001 lists = new ArrayList<ScheduleRealInfo>();
2945 } 3002 }
2946 } else { 3003 } else {
2947 if ((list.get(i).getFgsBm()+list.get(i).getXlBm()).equals(list.get(i - 1).getFgsBm()+list.get(i - 1).getXlBm())) { 3004 if ((list.get(i).getFgsBm()+list.get(i).getXlBm()).equals(list.get(i - 1).getFgsBm()+list.get(i - 1).getXlBm())) {
2948 lists.add(list.get(i)); 3005 lists.add(list.get(i));
2949 - Map<String, Object> map = staticTj(lists); 3006 + Map<String, Object> mm=new HashMap<String,Object>();
  3007 + if(mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm())!=null){
  3008 + mm=mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm());
  3009 + }
  3010 + Map<String, Object> map = staticTj(lists,mm);
2950 lMap.add(map); 3011 lMap.add(map);
2951 } else { 3012 } else {
2952 lists = new ArrayList<ScheduleRealInfo>(); 3013 lists = new ArrayList<ScheduleRealInfo>();
2953 lists.add(list.get(i)); 3014 lists.add(list.get(i));
2954 - Map<String, Object> map = staticTj(lists); 3015 + Map<String, Object> mm=new HashMap<String,Object>();
  3016 + if(mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm())!=null){
  3017 + mm=mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm());
  3018 + }
  3019 + Map<String, Object> map = staticTj(lists,mm);
2955 lMap.add(map); 3020 lMap.add(map);
2956 } 3021 }
2957 } 3022 }
@@ -3091,14 +3156,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3091,14 +3156,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3091 List<ScheduleRealInfo> listAll = new ArrayList<ScheduleRealInfo>(); 3156 List<ScheduleRealInfo> listAll = new ArrayList<ScheduleRealInfo>();
3092 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); 3157 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
3093 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); 3158 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
  3159 + List<Object[]> listInterval=new ArrayList<Object[]>();
  3160 +
3094 line = line.trim(); 3161 line = line.trim();
3095 if (line.equals("")) { 3162 if (line.equals("")) {
3096 //查询所有线路 3163 //查询所有线路
3097 listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm); 3164 listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  3165 + listInterval = calcIntervalRepository.countByDateAndLine(gsdm, fgsdm, date, date2);
3098 } else { 3166 } else {
3099 //查询单条线路 3167 //查询单条线路
3100 listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2); 3168 listAll = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2);
3101 - } 3169 + listInterval = calcIntervalRepository.countByDateAndLine(line, date, date2);
  3170 + }
  3171 + Map<String, Map<String,Object>> mapInterval=new HashMap<>();
  3172 + for (int i = 0; i < listInterval.size(); i++) {
  3173 + Object[] interval=listInterval.get(i);
  3174 + String gs=interval[0].toString();
  3175 + String fgs=interval[1].toString();
  3176 + String xl=interval[2].toString();
  3177 + Map<String, Object> m=new HashMap<String,Object>();
  3178 + m.put("gs", gs);
  3179 + m.put("fgs", fgs);
  3180 + m.put("xl", xl);
  3181 + m.put("djgAll", interval[3]);
  3182 + m.put("djgZgf", interval[6]);
  3183 + m.put("djgWgf", interval[7]);
  3184 + m.put("djgTime", interval[8]);
  3185 + mapInterval.put(gs+"-"+fgs+"-"+xl, m);
  3186 + }
3102 3187
3103 Map<String, Boolean> lineMap=lineService.lineNature(); 3188 Map<String, Boolean> lineMap=lineService.lineNature();
3104 List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>(); 3189 List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
@@ -3134,19 +3219,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3134,19 +3219,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3134 lists.add(list.get(i)); 3219 lists.add(list.get(i));
3135 } else { 3220 } else {
3136 lists.add(list.get(i)); 3221 lists.add(list.get(i));
3137 - Map<String, Object> map = staticTj(lists); 3222 + Map<String, Object> mm=new HashMap<String,Object>();
  3223 + if(mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm())!=null){
  3224 + mm=mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm());
  3225 + }
  3226 + Map<String, Object> map = staticTj(lists,mm);
3138 lMap.add(map); 3227 lMap.add(map);
3139 lists = new ArrayList<ScheduleRealInfo>(); 3228 lists = new ArrayList<ScheduleRealInfo>();
3140 } 3229 }
3141 } else { 3230 } else {
3142 if ((list.get(i).getFgsBm()+list.get(i).getXlBm()).equals(list.get(i - 1).getFgsBm()+list.get(i - 1).getXlBm())) { 3231 if ((list.get(i).getFgsBm()+list.get(i).getXlBm()).equals(list.get(i - 1).getFgsBm()+list.get(i - 1).getXlBm())) {
3143 lists.add(list.get(i)); 3232 lists.add(list.get(i));
3144 - Map<String, Object> map = staticTj(lists); 3233 + Map<String, Object> mm=new HashMap<String,Object>();
  3234 + if(mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm())!=null){
  3235 + mm=mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm());
  3236 + }
  3237 + Map<String, Object> map = staticTj(lists,mm);
3145 lMap.add(map); 3238 lMap.add(map);
3146 } else { 3239 } else {
3147 lists = new ArrayList<ScheduleRealInfo>(); 3240 lists = new ArrayList<ScheduleRealInfo>();
3148 lists.add(list.get(i)); 3241 lists.add(list.get(i));
3149 - Map<String, Object> map = staticTj(lists); 3242 + Map<String, Object> mm=new HashMap<String,Object>();
  3243 + if(mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm())!=null){
  3244 + mm=mapInterval.get(lists.get(0).getGsBm()+"-"+lists.get(0).getFgsBm()+"-"+lists.get(0).getXlBm());
  3245 + }
  3246 + Map<String, Object> map = staticTj(lists,mm);
3150 lMap.add(map); 3247 lMap.add(map);
3151 } 3248 }
3152 } 3249 }
@@ -5273,20 +5370,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -5273,20 +5370,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5273 fcsjm = String.valueOf(fcsjActural_ - fcsj_); 5370 fcsjm = String.valueOf(fcsjActural_ - fcsj_);
5274 } 5371 }
5275 } 5372 }
5276 - String[] dfsj_s =schedule.getDfsj().split(":");  
5277 - Long dfsj_ = Long.parseLong(dfsj_s[0]) * 60 + Long.parseLong(dfsj_s[1]);  
5278 - if ((dfsj_ - fcsjActural_) > 0) {  
5279 - if(dfsj_ - fcsjActural_>1200){  
5280 - dfsjm=String.valueOf(1440-(dfsj_ - fcsjActural_));  
5281 - }else{  
5282 - dfsjk = String.valueOf(dfsj_ - fcsjActural_);  
5283 - }  
5284 - } else {  
5285 - if(fcsjActural_ - dfsj_>1200){  
5286 - dfsjk= String.valueOf(1440-(fcsjActural_ - dfsj_));  
5287 - }else{  
5288 - dfsjm = String.valueOf(fcsjActural_ - dfsj_);  
5289 - } 5373 + if(df.equals("df")){
  5374 + String[] dfsj_s =schedule.getDfsj().split(":");
  5375 + Long dfsj_ = Long.parseLong(dfsj_s[0]) * 60 + Long.parseLong(dfsj_s[1]);
  5376 + if ((dfsj_ - fcsjActural_) > 0) {
  5377 + if(dfsj_ - fcsjActural_>1200){
  5378 + dfsjm=String.valueOf(1440-(dfsj_ - fcsjActural_));
  5379 + }else{
  5380 + dfsjk = String.valueOf(dfsj_ - fcsjActural_);
  5381 + }
  5382 + } else {
  5383 + if(fcsjActural_ - dfsj_>1200){
  5384 + dfsjk= String.valueOf(1440-(fcsjActural_ - dfsj_));
  5385 + }else{
  5386 + dfsjm = String.valueOf(fcsjActural_ - dfsj_);
  5387 + }
  5388 + }
5290 } 5389 }
5291 } 5390 }
5292 if(df.equals("df")){ 5391 if(df.equals("df")){
@@ -6329,6 +6428,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -6329,6 +6428,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
6329 6428
6330 return result; 6429 return result;
6331 } 6430 }
  6431 +
  6432 + @Override
  6433 + public Map<String, String> getLevelsByLines(List<String> lines) {
  6434 + Map<String, String> result = new HashMap<String, String>(), currSchDate = dayOfSchedule.getCurrSchDate();
  6435 + for (String line : lines) {
  6436 + String level = BasicData.lineDate2Level.get(line + "_" + currSchDate.get(line));
  6437 + result.put(line, level == null ? "" : level);
  6438 + }
  6439 +
  6440 + return result;
  6441 + }
6332 6442
6333 6443
6334 @Override 6444 @Override
@@ -6352,7 +6462,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -6352,7 +6462,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
6352 while (it.hasNext()) { 6462 while (it.hasNext()) {
6353 RepairReport rr = it.next(); 6463 RepairReport rr = it.next();
6354 repairReport(rr); 6464 repairReport(rr);
6355 - if (rr.getReportState() == 1) queue.remove(rr); 6465 + if (rr.getReportState() == 1 || System.currentTimeMillis() - rr.getReportDate().getTime() > 86400000) queue.remove(rr);
6356 } 6466 }
6357 } catch (Exception e) { 6467 } catch (Exception e) {
6358 logger.error("维修上报重发错误", e); 6468 logger.error("维修上报重发错误", e);
src/main/java/com/bsth/service/report/CalcSheetService.java
@@ -10,6 +10,7 @@ import com.bsth.service.BaseService; @@ -10,6 +10,7 @@ import com.bsth.service.BaseService;
10 public interface CalcSheetService extends BaseService<CalcSheet, Integer>{ 10 public interface CalcSheetService extends BaseService<CalcSheet, Integer>{
11 public List<CalcSheet> countListCalcSheet(Map<String, Object> map); 11 public List<CalcSheet> countListCalcSheet(Map<String, Object> map);
12 public List<CalcSheet> calcListSheet(Map<String, Object> map); 12 public List<CalcSheet> calcListSheet(Map<String, Object> map);
  13 + public List<CalcSheet> calcListSheet_d(Map<String, Object> map);
13 public List<Sheet> calcSheet(Map<String, Object> map); 14 public List<Sheet> calcSheet(Map<String, Object> map);
14 public List<Map<String, Object>> calcTurnoutrate(Map<String, Object> map); 15 public List<Map<String, Object>> calcTurnoutrate(Map<String, Object> map);
15 public List<Map<String, Object>> calcTurnoutrateZgf(Map<String, Object> map); 16 public List<Map<String, Object>> calcTurnoutrateZgf(Map<String, Object> map);
src/main/java/com/bsth/service/report/impl/CalcSheetServiceImpl.java
@@ -179,6 +179,70 @@ public class CalcSheetServiceImpl extends BaseServiceImpl&lt;CalcSheet, Integer&gt; im @@ -179,6 +179,70 @@ public class CalcSheetServiceImpl extends BaseServiceImpl&lt;CalcSheet, Integer&gt; im
179 String endDate=map.get("endDate").toString(); 179 String endDate=map.get("endDate").toString();
180 String sql="select * from bsth_c_calc_sheet where date >= '"+date+"' and " 180 String sql="select * from bsth_c_calc_sheet where date >= '"+date+"' and "
181 + " date <= '"+endDate+"' and xl = '"+line+"' order by date"; 181 + " date <= '"+endDate+"' and xl = '"+line+"' order by date";
  182 +
  183 + List<CalcSheet> list=jdbcTemplate.query(sql,
  184 + new RowMapper<CalcSheet>(){
  185 + @Override
  186 + public CalcSheet mapRow(ResultSet rs, int rowNum) throws SQLException {
  187 + CalcSheet s=new CalcSheet();
  188 + s.setGsdm(rs.getString("gsdm"));
  189 + s.setFgsdm(rs.getString("fgsdm"));
  190 + s.setXl(rs.getString("xl"));
  191 + s.setXlName(rs.getString("xl_name"));
  192 + s.setId(rs.getInt("id"));
  193 + s.setDate(rs.getString("date"));
  194 + s.setJhszfcs(rs.getString("jhszfcs"));
  195 + s.setSjszfczds(rs.getString("sjszfczds"));
  196 + s.setSzfczdl(rs.getString("szfczdl"));
  197 + s.setSjszddzds(rs.getString("sjszddzds"));
  198 + s.setSzddzdl(rs.getString("szddzdl"));
  199 + return s;
  200 + }
  201 + });
  202 + if(map.get("type").equals("export")){
  203 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
  204 + for (int i = 0; i < list.size(); i++) {
  205 + Map<String, Object> m = new HashMap<String, Object>();
  206 + CalcSheet c = list.get(i);
  207 + m.put("gs", c.getGsname());
  208 + m.put("fgs", c.getFgsname());
  209 + m.put("date", c.getDate());
  210 + m.put("line", c.getXlName());
  211 + m.put("bcs", c.getJhszfcs());
  212 + m.put("zdbcs", c.getSjszfczds());
  213 + m.put("zdlv", c.getSzfczdl()+"%");
  214 + m.put("ddzdbcs", c.getSjszddzds());
  215 + m.put("ddzdlv", c.getSzddzdl()+"%");
  216 + tempList.add(m);
  217 + }
  218 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  219 + Map<String, Object> m = new HashMap<String, Object>();
  220 + m.put("date", date);
  221 + m.put("endDate", endDate);
  222 + ReportUtils ee = new ReportUtils();
  223 + try {
  224 + listI.add(tempList.iterator());
  225 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  226 + ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "calcSheetList1.xls",
  227 + path + "export/发车到站准点率"+date.replaceAll("-", "")+"-"+endDate.replaceAll("-", "")+".xls");
  228 + } catch (Exception e) {
  229 + // TODO: handle exception
  230 + e.printStackTrace();
  231 + }
  232 + }
  233 + return list;
  234 + }
  235 +
  236 + @Override
  237 + public List<CalcSheet> calcListSheet_d(Map<String, Object> map) {
  238 + // TODO Auto-generated method stub
  239 + String line=map.get("line").toString();
  240 + String date=map.get("date").toString();
  241 + String endDate=map.get("endDate").toString();
  242 + String sql=" select b.* from (select date from bsth_c_calc_interval where date>='"+date+"' and date <='"+endDate+"'"
  243 + + " and xl_bm='"+line+"' and `level`='D' group by date ) a left join ( "
  244 + + "select * from bsth_c_calc_sheet where date >= '"+date+"' and "
  245 + + " date <= '"+endDate+"' and xl = '"+line+"' order by date ) b on a.date =b.date";
182 List<CalcSheet> list=jdbcTemplate.query(sql, 246 List<CalcSheet> list=jdbcTemplate.query(sql,
183 new RowMapper<CalcSheet>(){ 247 new RowMapper<CalcSheet>(){
184 @Override 248 @Override
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -852,12 +852,12 @@ public class ReportServiceImpl implements ReportService{ @@ -852,12 +852,12 @@ public class ReportServiceImpl implements ReportService{
852 String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,2 as xh FROM " 852 String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,2 as xh FROM "
853 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and " 853 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
854 + " fcsj <='"+minfcsj+"' and bc_type!='ldks'" 854 + " fcsj <='"+minfcsj+"' and bc_type!='ldks'"
855 - + " and bc_type !='region') " 855 + + " and bc_type !='region' and bc_type !='venting' and bc_type !='major') "
856 + " union " 856 + " union "
857 + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,1 as xh FROM " 857 + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,1 as xh FROM "
858 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and " 858 + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
859 + " fcsj > '"+minfcsj+"' and bc_type!='ldks' " 859 + " fcsj > '"+minfcsj+"' and bc_type!='ldks' "
860 - + " and bc_type !='region') " 860 + + " and bc_type !='region' and bc_type !='venting' and bc_type !='major') "
861 + " order by xh, lp,fcsj"; 861 + " order by xh, lp,fcsj";
862 Map<String, Object> map=new HashMap<String,Object>(); 862 Map<String, Object> map=new HashMap<String,Object>();
863 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc, 863 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
src/main/resources/application-prodtest.properties
1 -server.port=9088  
2 -#management.port= 9001  
3 -#management.address= 127.0.0.1  
4 -management.security.enabled=false  
5 -management.context-path=/manage  
6 -dubbo.use=true  
7 -  
8 -spring.jpa.hibernate.ddl-auto= update  
9 -spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy  
10 -#DATABASE  
11 -spring.jpa.database= MYSQL  
12 -spring.jpa.show-sql= false  
13 -spring.datasource.driver-class-name= com.mysql.jdbc.Driver  
14 -spring.datasource.url= jdbc:mysql://10.10.150.24:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false  
15 -spring.datasource.username= root  
16 -spring.datasource.password= root2jsp  
17 -#DATASOURCE  
18 -spring.datasource.max-active=100  
19 -spring.datasource.max-idle=8  
20 -spring.datasource.min-idle=8  
21 -spring.datasource.initial-size=5  
22 -  
23 -spring.datasource.test-on-borrow=true  
24 -spring.datasource.test-on-connect=true  
25 -spring.datasource.test-on-return=true  
26 -spring.datasource.test-while-idle=true  
27 -spring.datasource.validation-query=select 1  
28 -  
29 -## gps client data  
30 -http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all  
31 -## gateway real data  
32 -http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/  
33 -## gateway send directive  
34 -http.send.directive = http://10.10.200.79:8080/transport_server/message/  
35 -## wxsb  
36 -#http.report.url.05= http://192.168.168.154:8088/ygjwsystem_j2ee/clbx/clbx_dd.do  
37 -#http.report.url.22= http://192.168.168.154:8088/jgjwsystem_j2ee/clbx/clbx_dd.do  
38 -#http.report.url.26= http://192.168.168.154:8088/nhjwsystem_j2ee/clbx/clbx_dd.do  
39 -#http.report.url.55= http://192.168.168.154:8088/snjwsystem_j2ee/clbx/clbx_dd.do  
40 -http.report.url.05= http://116.228.197.222:8081/ygjwsystem_j2ee/clbx/clbx_dd.do  
41 -http.report.url.22= http://116.247.73.122:9098/jgjwsystem_j2ee/clbx/clbx_dd.do  
42 -http.report.url.26= http://116.236.141.34:8088/nhjwsystem_j2ee/clbx/clbx_dd.do 1 +server.port=9088
  2 +#management.port= 9001
  3 +#management.address= 127.0.0.1
  4 +management.security.enabled=false
  5 +management.context-path=/manage
  6 +dubbo.use=true
  7 +
  8 +spring.jpa.hibernate.ddl-auto= update
  9 +spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
  10 +#DATABASE
  11 +spring.jpa.database= MYSQL
  12 +spring.jpa.show-sql= false
  13 +spring.datasource.driver-class-name= com.mysql.jdbc.Driver
  14 +spring.datasource.url= jdbc:mysql://10.10.150.24:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
  15 +spring.datasource.username= root
  16 +spring.datasource.password= root2jsp
  17 +#DATASOURCE
  18 +spring.datasource.max-active=100
  19 +spring.datasource.max-idle=8
  20 +spring.datasource.min-idle=8
  21 +spring.datasource.initial-size=5
  22 +
  23 +spring.datasource.test-on-borrow=true
  24 +spring.datasource.test-on-connect=true
  25 +spring.datasource.test-on-return=true
  26 +spring.datasource.test-while-idle=true
  27 +spring.datasource.validation-query=select 1
  28 +
  29 +## gps client data
  30 +http.gps.real.cache.url= http://10.10.150.24:12580/realGps/all
  31 +## gateway real data
  32 +http.gps.real.url= http://10.10.200.79:8080/transport_server/rtgps/
  33 +## gateway send directive
  34 +http.send.directive = http://10.10.200.79:8080/transport_server/message/
  35 +## wxsb
  36 +#http.report.url.05= http://192.168.168.154:8088/ygjwsystem_j2ee/clbx/clbx_dd.do
  37 +#http.report.url.22= http://192.168.168.154:8088/jgjwsystem_j2ee/clbx/clbx_dd.do
  38 +#http.report.url.26= http://192.168.168.154:8088/nhjwsystem_j2ee/clbx/clbx_dd.do
  39 +#http.report.url.55= http://192.168.168.154:8088/snjwsystem_j2ee/clbx/clbx_dd.do
  40 +http.report.url.05= http://116.228.197.222:8081/ygjwsystem_j2ee/clbx/clbx_dd.do
  41 +http.report.url.22= http://116.247.73.122:9098/jgjwsystem_j2ee/clbx/clbx_dd.do
  42 +http.report.url.26= http://116.236.141.34:8088/nhjwsystem_j2ee/clbx/clbx_dd.do
43 http.report.url.55= http://180.168.216.248:8088/snjwsystem_j2ee/clbx/clbx_dd.do 43 http.report.url.55= http://180.168.216.248:8088/snjwsystem_j2ee/clbx/clbx_dd.do
44 \ No newline at end of file 44 \ No newline at end of file
src/main/resources/datatools/config-prodtest.properties
1 -# 配置数据导入导出用到的配置信息  
2 -  
3 -# 1、kettle配置文件路径(类路径)  
4 -datatools.kettle_properties=/datatools/kettle.properties  
5 -# 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正)  
6 -  
7 -#数据库ip地址  
8 -datatools.kvars_dbip=10.10.150.24  
9 -#数据库用户名  
10 -datatools.kvars_dbuname=root  
11 -#数据库密码  
12 -datatools.kvars_dbpwd=root2jsp  
13 -#数据库库名  
14 -datatools.kvars_dbdname=control  
15 -  
16 -# 3、上传数据配置信息  
17 -# 上传文件目录配置(根据不同的环境需要修正)  
18 -datatools.fileupload_dir=/home/bsth_control_u_d_files  
19 -# ktr转换文件,中配置的错误输出目录(根据不同的环境需要修正)  
20 -datatools.trans_errordir=/home/bsth_control_u_d_files/erroroutput  
21 -# 临时输出文件目录  
22 -datatools.trans_tempdir=/home/bsth_control_u_d_files/temp  
23 -# 模版文件目录  
24 -datatools.trans_templatedir=/home/bsth_control_u_d_files/template  
25 -  
26 -##---------------------------- 导入数据ktr ----------------------------##  
27 -# 车辆信息导入ktr转换  
28 -datatools.cars_datainputktr=/datatools/ktrs/carsDataInput.ktr  
29 -# 人员信息导入  
30 -datatools.employees_datainputktr=/datatools/ktrs/employeesDataInput.ktr  
31 -# 路牌信息导入  
32 -datatools.guideboards_datainputktr=/datatools/ktrs/guideboardDataInput.ktr  
33 -# 时刻表基础信息导入  
34 -datatools.ttinfo_datainputktr=/datatools/ktrs/ttinfoDataInput.ktr  
35 -# 时刻表明细信息导入(元数据)  
36 -datatools.ttinfodetail_metadatainputktr=/datatools/ktrs/ttinfodetailDataInputMetaData.ktr  
37 -# 时刻表明细编辑用数据  
38 -datatools.ttinfodetail_foreditktr=/datatools/ktrs/ttinfodetailoutputforedit.ktr  
39 -# 时刻表明细信息导入  
40 -datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr  
41 -# 时刻表明细信息导入2  
42 -datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr  
43 -# 时刻表明细信息导入2(版本化)  
44 -datatools.ttinfodetail_datainputktr2version=/datatools/ktrs/ttinfodetailDataInput2_version.ktr  
45 -# 时刻表明细信息导入2(版本化),使用生成时刻表格式  
46 -datatools.ttinfodetail_datainputktr2version2=/datatools/ktrs/ttinfodetailDataInput2_version_2.ktr  
47 -  
48 -# 车辆配置信息导入  
49 -datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr  
50 -# 人员配置信息导入  
51 -datatools.employeesconfig_datainputktr=/datatools/ktrs/employeesConfigDataInput.ktr  
52 -  
53 -# 排版规则信息导入  
54 -datatools.schedulerule_datainputktr=/datatools/ktrs/scheduleRuleDataInput.ktr  
55 -  
56 -# 4、数据导出配置信息  
57 -# 导出数据文件目录配置(根据不同的环境需要修正)  
58 -datatools.fileoutput_dir=/home/bsth_control_u_d_files  
59 -  
60 -##---------------------------- 导出数据ktr -----------------------------##  
61 -# 车辆信息导出ktr转换  
62 -datatools.cars_dataoutputktr=/datatools/ktrs/carsDataOutput.ktr  
63 -# 人员信息导出ktr转换  
64 -datatools.employees_dataoutputktr=/datatools/ktrs/employeesDataOutput.ktr  
65 -# 时刻表导出元数据ktr转换  
66 -datatools.ttinfodetail_metaoutput=/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr  
67 -# 时刻表导出数据ktr转换  
68 -datatools.ttinfodetail_output=/datatools/ktrs/ttinfodetailDataOutput.ktr  
69 -# 排版规则导出数据ktr转换  
70 -datatools.schedulerule_output=/datatools/ktrs/scheduleRuleDataOutput.ktr  
71 -  
72 -# 车辆配置信息导出ktr转换  
73 -datatools.carsconfig_dataoutputktr=/datatools/ktrs/carsConfigDataOutput.ktr  
74 -# 人员配置信息导出ktr转换  
75 -datatools.employeesconfig_dataoutputktr=/datatools/ktrs/employeesConfigDataOutput.ktr  
76 -  
77 -# 路牌信息导出  
78 -datatools.guideboards_dataoutputktr=/datatools/ktrs/guideboardDataOutput.ktr  
79 -  
80 -  
81 -# TODO: 1 +# 配置数据导入导出用到的配置信息
  2 +
  3 +# 1、kettle配置文件路径(类路径)
  4 +datatools.kettle_properties=/datatools/kettle.properties
  5 +# 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正)
  6 +
  7 +#数据库ip地址
  8 +datatools.kvars_dbip=10.10.150.24
  9 +#数据库用户名
  10 +datatools.kvars_dbuname=root
  11 +#数据库密码
  12 +datatools.kvars_dbpwd=root2jsp
  13 +#数据库库名
  14 +datatools.kvars_dbdname=control
  15 +
  16 +# 3、上传数据配置信息
  17 +# 上传文件目录配置(根据不同的环境需要修正)
  18 +datatools.fileupload_dir=/home/bsth_control_u_d_files
  19 +# ktr转换文件,中配置的错误输出目录(根据不同的环境需要修正)
  20 +datatools.trans_errordir=/home/bsth_control_u_d_files/erroroutput
  21 +# 临时输出文件目录
  22 +datatools.trans_tempdir=/home/bsth_control_u_d_files/temp
  23 +# 模版文件目录
  24 +datatools.trans_templatedir=/home/bsth_control_u_d_files/template
  25 +
  26 +##---------------------------- 导入数据ktr ----------------------------##
  27 +# 车辆信息导入ktr转换
  28 +datatools.cars_datainputktr=/datatools/ktrs/carsDataInput.ktr
  29 +# 人员信息导入
  30 +datatools.employees_datainputktr=/datatools/ktrs/employeesDataInput.ktr
  31 +# 路牌信息导入
  32 +datatools.guideboards_datainputktr=/datatools/ktrs/guideboardDataInput.ktr
  33 +# 时刻表基础信息导入
  34 +datatools.ttinfo_datainputktr=/datatools/ktrs/ttinfoDataInput.ktr
  35 +# 时刻表明细信息导入(元数据)
  36 +datatools.ttinfodetail_metadatainputktr=/datatools/ktrs/ttinfodetailDataInputMetaData.ktr
  37 +# 时刻表明细编辑用数据
  38 +datatools.ttinfodetail_foreditktr=/datatools/ktrs/ttinfodetailoutputforedit.ktr
  39 +# 时刻表明细信息导入
  40 +datatools.ttinfodetail_datainputktr=/datatools/ktrs/ttinfodetailDataInput.ktr
  41 +# 时刻表明细信息导入2
  42 +datatools.ttinfodetail_datainputktr2=/datatools/ktrs/ttinfodetailDataInput2.ktr
  43 +# 时刻表明细信息导入2(版本化)
  44 +datatools.ttinfodetail_datainputktr2version=/datatools/ktrs/ttinfodetailDataInput2_version.ktr
  45 +# 时刻表明细信息导入2(版本化),使用生成时刻表格式
  46 +datatools.ttinfodetail_datainputktr2version2=/datatools/ktrs/ttinfodetailDataInput2_version_2.ktr
  47 +
  48 +# 车辆配置信息导入
  49 +datatools.carsconfig_datainputktr=/datatools/ktrs/carsConfigDataInput.ktr
  50 +# 人员配置信息导入
  51 +datatools.employeesconfig_datainputktr=/datatools/ktrs/employeesConfigDataInput.ktr
  52 +
  53 +# 排版规则信息导入
  54 +datatools.schedulerule_datainputktr=/datatools/ktrs/scheduleRuleDataInput.ktr
  55 +
  56 +# 4、数据导出配置信息
  57 +# 导出数据文件目录配置(根据不同的环境需要修正)
  58 +datatools.fileoutput_dir=/home/bsth_control_u_d_files
  59 +
  60 +##---------------------------- 导出数据ktr -----------------------------##
  61 +# 车辆信息导出ktr转换
  62 +datatools.cars_dataoutputktr=/datatools/ktrs/carsDataOutput.ktr
  63 +# 人员信息导出ktr转换
  64 +datatools.employees_dataoutputktr=/datatools/ktrs/employeesDataOutput.ktr
  65 +# 时刻表导出元数据ktr转换
  66 +datatools.ttinfodetail_metaoutput=/datatools/ktrs/ttinfodetailDataOutputMetaData.ktr
  67 +# 时刻表导出数据ktr转换
  68 +datatools.ttinfodetail_output=/datatools/ktrs/ttinfodetailDataOutput.ktr
  69 +# 排版规则导出数据ktr转换
  70 +datatools.schedulerule_output=/datatools/ktrs/scheduleRuleDataOutput.ktr
  71 +
  72 +# 车辆配置信息导出ktr转换
  73 +datatools.carsconfig_dataoutputktr=/datatools/ktrs/carsConfigDataOutput.ktr
  74 +# 人员配置信息导出ktr转换
  75 +datatools.employeesconfig_dataoutputktr=/datatools/ktrs/employeesConfigDataOutput.ktr
  76 +
  77 +# 路牌信息导出
  78 +datatools.guideboards_dataoutputktr=/datatools/ktrs/guideboardDataOutput.ktr
  79 +
  80 +
  81 +# TODO:
src/main/resources/dubbo/config-prod.properties
1 -# application名字  
2 -spring.dubbo.application.name=bsth_control_v2  
3 -# zookeeper注册中心地址  
4 -spring.dubbo.registry=zookeeper://127.0.0.1:2181  
5 -  
6 -#----------- dubbo:consumer 性能调优选项 -------------#  
7 -# 远程服务调用超时时间,单位毫秒,这里设置30分钟  
8 -spring.dubbo.consumer.timeout=1800000  
9 -# 远程服务调用重试次数,0表示不需要重试  
10 -spring.dubbo.consumer.retries=0  
11 -#----------- dubbo:consumer 服务治理选项 -------------#  
12 -# 启动不检查提供者是否存在  
13 -spring.dubbo.consumer.check=false 1 +# application名字
  2 +spring.dubbo.application.name=bsth_control_v2
  3 +# zookeeper注册中心地址
  4 +spring.dubbo.registry=zookeeper://127.0.0.1:2181
  5 +
  6 +#----------- dubbo:consumer 性能调优选项 -------------#
  7 +# 远程服务调用超时时间,单位毫秒,这里设置30分钟
  8 +spring.dubbo.consumer.timeout=1800000
  9 +# 远程服务调用重试次数,0表示不需要重试
  10 +spring.dubbo.consumer.retries=0
  11 +#----------- dubbo:consumer 服务治理选项 -------------#
  12 +# 启动不检查提供者是否存在
  13 +spring.dubbo.consumer.check=false
src/main/resources/dubbo/config-prodtest.properties
1 -# application名字  
2 -spring.dubbo.application.name=bsth_control_v2  
3 -# zookeeper注册中心地址  
4 -spring.dubbo.registry=zookeeper://127.0.0.1:2181  
5 -  
6 -#----------- dubbo:consumer 性能调优选项 -------------#  
7 -# 远程服务调用超时时间,单位毫秒,这里设置30分钟  
8 -spring.dubbo.consumer.timeout=1800000  
9 -# 远程服务调用重试次数,0表示不需要重试  
10 -spring.dubbo.consumer.retries=0  
11 -#----------- dubbo:consumer 服务治理选项 -------------#  
12 -# 启动不检查提供者是否存在  
13 -spring.dubbo.consumer.check=false 1 +# application名字
  2 +spring.dubbo.application.name=bsth_control_v2
  3 +# zookeeper注册中心地址
  4 +spring.dubbo.registry=zookeeper://127.0.0.1:2181
  5 +
  6 +#----------- dubbo:consumer 性能调优选项 -------------#
  7 +# 远程服务调用超时时间,单位毫秒,这里设置30分钟
  8 +spring.dubbo.consumer.timeout=1800000
  9 +# 远程服务调用重试次数,0表示不需要重试
  10 +spring.dubbo.consumer.retries=0
  11 +#----------- dubbo:consumer 服务治理选项 -------------#
  12 +# 启动不检查提供者是否存在
  13 +spring.dubbo.consumer.check=false
src/main/resources/static/pages/control/lineallot_v2/main.html
@@ -484,13 +484,12 @@ @@ -484,13 +484,12 @@
484 $.each(items, function () { 484 $.each(items, function () {
485 ls_line_data.push(codeMapps[$(this).data('id')]); 485 ls_line_data.push(codeMapps[$(this).data('id')]);
486 }); 486 });
487 - //将线路基础信息写入localStorage  
488 - storage.setItem('lineControlItems', JSON.stringify(ls_line_data));  
489 //监控模式还是主调模式 487 //监控模式还是主调模式
490 storage.setItem('operationMode', $('.pattern_type_label>input')[0].checked?1:0); 488 storage.setItem('operationMode', $('.pattern_type_label>input')[0].checked?1:0);
491 489
492 //进入线调 490 //进入线调
493 - var eq = EventProxy.create('cache_route', 'check_line_config', function () { 491 + var eq = EventProxy.create('cache_line_level', 'cache_mv_route', 'cache_route', 'check_line_config', function (lineLevel) {
  492 + debugger;
494 var newWinOpen = $('input','.new_window_open_label')[0].checked; 493 var newWinOpen = $('input','.new_window_open_label')[0].checked;
495 if(!newWinOpen) 494 if(!newWinOpen)
496 top.window.location.href = "/real_control/v2"; 495 top.window.location.href = "/real_control/v2";
@@ -498,6 +497,13 @@ @@ -498,6 +497,13 @@
498 window.open("/real_control/v2"); 497 window.open("/real_control/v2");
499 $('#go_to_real_system_btn').html('已经尝试打开新窗口,如看不到,可能被浏览器阻止了'); 498 $('#go_to_real_system_btn').html('已经尝试打开新窗口,如看不到,可能被浏览器阻止了');
500 } 499 }
  500 +
  501 + // 将线路级别赋值
  502 + $.each(ls_line_data, function () {
  503 + this.lineLevel = lineLevel[this.lineCode];
  504 + });
  505 + // 将线路基础信息写入localStorage
  506 + storage.setItem('lineControlItems', JSON.stringify(ls_line_data));
501 }); 507 });
502 508
503 //拼接线路编码 509 //拼接线路编码
@@ -508,15 +514,20 @@ @@ -508,15 +514,20 @@
508 //缓存路由 514 //缓存路由
509 idx=idx.substr(0, idx.length - 1); 515 idx=idx.substr(0, idx.length - 1);
510 516
511 - $.ajaxSettings.async = false; 517 + $.get('/realSchedule/lineLevel', {idx: idx}, function (rs) {
  518 + if (rs) {
  519 + eq.emit('cache_line_level', rs);
  520 + }
  521 + });
  522 +
512 $.get('/realMap/findRouteAndVersionByLine', {idx: idx}, function (rs) { 523 $.get('/realMap/findRouteAndVersionByLine', {idx: idx}, function (rs) {
513 if (rs) { 524 if (rs) {
514 for(var lineCode in rs) 525 for(var lineCode in rs)
515 storage.setItem(lineCode + '_route', JSON.stringify(rs[lineCode])); 526 storage.setItem(lineCode + '_route', JSON.stringify(rs[lineCode]));
516 - //eq.emit('cache_route'); 527 + eq.emit('cache_mv_route');
517 } 528 }
518 }); 529 });
519 - $.ajaxSettings.async = true; 530 +
520 $.get('/realMap/findRouteByLine', {idx: idx}, function (rs) { 531 $.get('/realMap/findRouteByLine', {idx: idx}, function (rs) {
521 if (rs) { 532 if (rs) {
522 for(var lineCode in rs) 533 for(var lineCode in rs)
src/main/resources/static/pages/forms/statement/scheduleDaily.html
@@ -87,7 +87,7 @@ @@ -87,7 +87,7 @@
87 <td colspan="3">放站班次</td> 87 <td colspan="3">放站班次</td>
88 <td colspan="3">调头班次</td> 88 <td colspan="3">调头班次</td>
89 <td colspan="3">发生次数</td> 89 <td colspan="3">发生次数</td>
90 - <td rowspan="2">最大间隔时间()</td> 90 + <td rowspan="2">最大间隔时间()</td>
91 <td colspan="5" rowspan="2">原因</td> 91 <td colspan="5" rowspan="2">原因</td>
92 </tr> 92 </tr>
93 <tr> 93 <tr>
src/main/resources/static/pages/report/sheet/intervalCount.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>大间隔情况表</h1>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form class="form-inline" action="">
  30 + <div style="display: inline-block; margin-left: 33px;" id="gsdmDiv">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
  33 + </div>
  34 + <div style="display: inline-block; margin-left: 38px;" id="fgsdmDiv">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
  37 + </div>
  38 + <div style="display: inline-block;margin-left: 33px;">
  39 + <span class="item-label" style="width: 80px;">线路: </span>
  40 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  41 + </div>
  42 + <div style="margin-top: 10px">
  43 + </div>
  44 + <div style="display: inline-block;margin-left: 33px;">
  45 + <span class="item-label" style="width: 80px;">等级: </span>
  46 + <select class="form-control" style="width: 180px;" id=levelType>
  47 + <option value="A,B,C">A,B,C级线路</option>
  48 + <option value="D">D级线路</option>
  49 + </select>
  50 + </div>
  51 + <div style="display: inline-block;">
  52 + <span class="item-label" style="width: 80px;margin-left: 24px;">开始时间: </span>
  53 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  54 + </div>
  55 + <div style="display: inline-block;">
  56 + <span class="item-label" style="width: 80px;margin-left: 24px;">结束时间: </span>
  57 + <input class="form-control" type="text" id="endDate" style="width: 180px;"/>
  58 + </div>
  59 +
  60 + <div class="form-group">
  61 + <input type="hidden" id="id"/>
  62 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  63 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  64 + </div>
  65 + </form>
  66 + </div>
  67 +
  68 + <div class="portlet-body">
  69 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  70 + <table class="table table-bordered table-hover table-checkable" id="forms">
  71 + <thead>
  72 + <tr>
  73 + <td>公司</td>
  74 + <td>分公司</td>
  75 + <td>线路</td>
  76 + <td>全日次数</td>
  77 + <td>高峰次数</td>
  78 + <td>早高峰次数</td>
  79 + <td>晚高峰次数</td>
  80 + <td>低谷次数</td>
  81 + <td>最大间隔时间</td>
  82 + <td>查看</td>
  83 + </tr>
  84 + </thead>
  85 + <tbody>
  86 + </tbody>
  87 + </table>
  88 +
  89 + <table class="table table-bordered table-hover table-checkable" style="display: none" id="forms_d">
  90 + <thead>
  91 + <tr>
  92 + <td>公司</td>
  93 + <td>分公司</td>
  94 + <td>线路</td>
  95 + <td>班次数</td>
  96 + <td>发车准点数</td>
  97 + <td>发车准点率</td>
  98 + <td>到站准点数</td>
  99 + <td>到站准点率</td>
  100 + <td>查看</td>
  101 + </tr>
  102 + </thead>
  103 + <tbody>
  104 + </tbody>
  105 + </table>
  106 +
  107 +
  108 + </div>
  109 +
  110 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  111 + <input class="btn btn-default" style="display: none" type="button" id="export_1" value="导出"/>
  112 + <table class="table table-bordered table-hover table-checkable" style="display: none" id="forms_1">
  113 + <thead>
  114 + <tr >
  115 + <td>公司</td>
  116 + <td>分公司</td>
  117 + <td>日期</td>
  118 + <td>线路</td>
  119 + <td>当天等级</td>
  120 + <td>全日次数</td>
  121 + <td>高峰次数</td>
  122 + <td>早高峰次数</td>
  123 + <td>晚高峰次数</td>
  124 + <td>低谷次数</td>
  125 + <td>最大间隔</td>
  126 + <td>查看</td>
  127 + </tr>
  128 + </thead>
  129 + <tbody>
  130 + </tbody>
  131 + </table>
  132 +
  133 + <table class="table table-bordered table-hover table-checkable" style="display: none" id="forms_d_1">
  134 + <thead>
  135 + <tr>
  136 + <td>公司</td>
  137 + <td>分公司</td>
  138 + <td>日期</td>
  139 + <td>线路</td>
  140 + <td>班次数</td>
  141 + <td>发车准点次数</td>
  142 + <td>发车准点率</td>
  143 + <td>查看</td>
  144 + <td>到站准点次数</td>
  145 + <td>到站准点率</td>
  146 + <td>查看</td>
  147 + </tr>
  148 + </thead>
  149 + <tbody>
  150 + </tbody>
  151 + </table>
  152 + </div>
  153 + </div>
  154 + </div>
  155 + </div>
  156 +</div>
  157 +<script src="/pages/mforms/singledatas/jquery.table2excel.min.js"></script>
  158 +<script>
  159 + $(function(){
  160 + // 关闭左侧栏
  161 + if (!$('body').hasClass('page-sidebar-closed'))
  162 + $('.menu-toggler.sidebar-toggler').click();
  163 +
  164 + var d = new Date();
  165 + d.setTime(d.getTime() - 1*1000*60*60*24);
  166 + var year = d.getFullYear();
  167 + var month = d.getMonth() + 1;
  168 + var day = d.getDate();
  169 + if(month < 10)
  170 + month = "0"+month;
  171 + if(day < 10)
  172 + day = "0"+day;
  173 + var dateTime = year + "-" + month + "-" + day;
  174 + $("#date").datetimepicker({
  175 + format : 'YYYY-MM-DD',
  176 + locale : 'zh-cn',
  177 + maxDate : dateTime
  178 + });
  179 + $("#endDate").datetimepicker({
  180 + format : 'YYYY-MM-DD',
  181 + locale : 'zh-cn',
  182 + maxDate : dateTime
  183 + });
  184 + $("#date").val(dateTime);
  185 + $("#endDate").val(dateTime);
  186 +
  187 + var fage=false;
  188 + var obj = [];
  189 + var xlList;
  190 + $.get('/report/lineList',function(result){
  191 + xlList=result;
  192 +
  193 + $.get('/user/companyData', function(result){
  194 + obj = result;
  195 + var options = '';
  196 + for(var i = 0; i < obj.length; i++){
  197 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  198 + }
  199 +
  200 + if(obj.length ==0){
  201 + $("#gsdmDiv").css('display','none');
  202 + }else if(obj.length ==1){
  203 + $("#gsdmDiv").css('display','none');
  204 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  205 + $('#fgsdmDiv').css('display','none');
  206 + }
  207 + $('#gsdm').html(options);
  208 +
  209 + updateCompany();
  210 + });
  211 + });
  212 +
  213 + $("#gsdm").on("change",updateCompany);
  214 + function updateCompany(){
  215 + var company = $('#gsdm').val();
  216 + var options = '';
  217 + for(var i = 0; i < obj.length; i++){
  218 + if(obj[i].companyCode == company){
  219 + var children = obj[i].children;
  220 + for(var j = 0; j < children.length; j++){
  221 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  222 + }
  223 + }
  224 + }
  225 + $('#fgsdm').html(options);
  226 + }
  227 +
  228 + var tempData = {};
  229 + $.get('/report/lineList',function(xlList){
  230 + var data = [];
  231 + data.push({id: " ", text: "全部线路"});
  232 + $.get('/user/companyData', function(result){
  233 + for(var i = 0; i < result.length; i++){
  234 + var companyCode = result[i].companyCode;
  235 + var children = result[i].children;
  236 + for(var j = 0; j < children.length; j++){
  237 + var code = children[j].code;
  238 + for(var k=0;k < xlList.length;k++ ){
  239 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  240 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  241 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  242 + }
  243 + }
  244 + }
  245 + }
  246 + initPinYinSelect2('#line',data,'');
  247 +
  248 + });
  249 + });
  250 +
  251 + $("#line").on("change", function(){
  252 + if($("#line").val() == " "){
  253 + $("#gsdm").attr("disabled", false);
  254 + $("#fgsdm").attr("disabled", false);
  255 + } else {
  256 + var temp = tempData[$("#line").val()].split(":");
  257 + $("#gsdm").val(temp[0]);
  258 + updateCompany();
  259 + $("#fgsdm").val(temp[1]);
  260 + $("#gsdm").attr("disabled", true);
  261 + $("#fgsdm").attr("disabled", true);
  262 + }
  263 + });
  264 +
  265 + $("#export").attr('disabled',"true");
  266 +
  267 + //查询
  268 + $("#query").on('click',function(){
  269 + var line = $("#line").val();
  270 + var date = $("#date").val();
  271 + var endDate = $("#endDate").val();
  272 + var fgs=$('#fgsdm').val();
  273 + var gs=$('#gsdm').val();
  274 + var levelType=$('#levelType').val();
  275 + var i = layer.load(2);
  276 + $get('/calcInterval/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,levelType:levelType,type:'query'},function(result){
  277 + if(levelType=="D"){
  278 + var intervalList_d = template('intervalList_d',{list:result});
  279 + $('#forms_d tbody').html(intervalList_d);
  280 + $('.btn-intervalList_d').on('click', showSheetList);
  281 + $("#forms").hide();
  282 + $("#forms_d").show();
  283 + }else{
  284 + var intervalList = template('intervalList',{list:result});
  285 + $('#forms tbody').html(intervalList);
  286 + $('.btn-intervalList').on('click', showIntervalList);
  287 + $("#forms_d").hide();
  288 + $("#forms").show();
  289 + }
  290 + $("#forms_d_1").hide();
  291 + $("#forms_1").hide();
  292 + $("#export_1").hide();
  293 +
  294 + layer.close(i);
  295 + if(result.length == 0)
  296 + $("#export").attr('disabled',"true");
  297 + else
  298 + $("#export").removeAttr("disabled");
  299 + });
  300 + });
  301 +
  302 + //查询大间隔
  303 + function showIntervalList(){
  304 + var id = $(this).data('id');
  305 + var date = $("#date").val();
  306 + var endDate = $("#endDate").val();
  307 + $("#id").val(id);
  308 + $get('/calcInterval/listInterval',{line:id,date:date,endDate:endDate,type:'query'},function(result){
  309 + var intervalList = template('intervalList_1',{list:result});
  310 + $('#forms_1 tbody').html(intervalList);
  311 + $('.btn-intervalList_1').on('click', openIntervalList);
  312 + $("#forms_1").show();
  313 + $("#export_1").show();
  314 + $("html,body").animate({scrollTop:$("#forms_1").offset().top},1000);
  315 + });
  316 + }
  317 +
  318 +
  319 + function openIntervalList(){
  320 + var id = $(this).data('id');
  321 +
  322 + id += ","+$(this).data('date')+",1";
  323 + $.get('/pages/report/sheet/intervalList.html', function (content) {
  324 + layer.open({
  325 + type: 1,
  326 + area: ['800px', '600px'],
  327 + content: content,
  328 + title: '线路准点率详细',
  329 + shift: 5,
  330 + scrollbar: false,
  331 + success: function () {
  332 + $('#calcIntervalList').trigger('init', id);
  333 + }
  334 + });
  335 + });
  336 + }
  337 + //查询首站发车
  338 + function showSheetList(){
  339 + var id = $(this).data('id');
  340 + var date = $("#date").val();
  341 + var endDate = $("#endDate").val();
  342 + $("#id").val(id);
  343 + $get('/calcSheet/calcListSheet_d',{line:id,date:date,endDate:endDate,type:'query'},function(result){
  344 + var sheetList = template('sheetList_1',{list:result});
  345 + $('#forms_d_1 tbody').html(sheetList);
  346 + $('.btn-calcSheetList_1').on('click', opencalcSheetList);
  347 + $('.btn-calcSheetList_2').on('click', opencalcSheetList2);
  348 + $("#forms_d_1").show();
  349 + $("#export_1").show();
  350 + $("html,body").animate({scrollTop:$("#forms_d_1").offset().top},1000);
  351 + });
  352 + }
  353 +
  354 +
  355 + function opencalcSheetList(){
  356 + var id = $(this).data('id');
  357 + id += ","+$(this).data('date')+",1";
  358 + $.get('/pages/report/sheet/calcList.html', function (content) {
  359 + layer.open({
  360 + type: 1,
  361 + area: ['800px', '600px'],
  362 + content: content,
  363 + title: '线路准点率详细',
  364 + shift: 5,
  365 + scrollbar: false,
  366 + success: function () {
  367 + $('#calcSheetList').trigger('init', id);
  368 + }
  369 + });
  370 + });
  371 + }
  372 + function opencalcSheetList2(){
  373 + var id = $(this).data('id');
  374 + id += ","+$(this).data('date')+",2";
  375 + $.get('/pages/report/sheet/calcList.html', function (content) {
  376 + layer.open({
  377 + type: 1,
  378 + area: ['800px', '600px'],
  379 + content: content,
  380 + title: '线路准点率详细',
  381 + shift: 5,
  382 + scrollbar: false,
  383 + success: function () {
  384 + $('#calcSheetList').trigger('init', id);
  385 + }
  386 + });
  387 + });
  388 + }
  389 + $("#export").on("click",function(){
  390 + var line = $("#line").val();
  391 + var date = $("#date").val();
  392 + var endDate = $("#endDate").val();
  393 + var fgs=$('#fgsdm').val();
  394 + var gs=$('#gsdm').val();
  395 + var levelType=$('#levelType').val();
  396 + var lineName = $('#line option:selected').text();
  397 + if(lineName == "全部线路")
  398 + lineName = $('#fgsdm option:selected').text();
  399 + var i = layer.load(2);
  400 + $get('/calcInterval/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,levelType:levelType,type:"export",lineName:lineName},function(result){
  401 + var dateTime = "";
  402 + if(date == endDate){
  403 + dateTime = moment(date).format("YYYYMMDD");
  404 + } else {
  405 + dateTime = moment(date).format("YYYYMMDD")+"-"+
  406 + moment(endDate).format("YYYYMMDD");
  407 + }
  408 + if(levelType=="D"){
  409 + window.open("/downloadFile/download?fileName="
  410 + +dateTime+"-"+lineName+"-发车到站准点率");
  411 + }else{
  412 + window.open("/downloadFile/download?fileName="
  413 + +dateTime+"-"+lineName+"-大间隔汇总表");
  414 + }
  415 +
  416 + layer.close(i);
  417 + });
  418 + });
  419 +
  420 + $("#export_1").on("click",function(){
  421 + var id = $("#id").val();
  422 + var date = $("#date").val();
  423 + var endDate = $("#endDate").val();
  424 + var levelType=$("#levelType").val();
  425 + if(levelType=='D'){
  426 + var i = layer.load(2);
  427 + $get('/calcSheet/calcListSheet',{line:id,date:date,endDate:endDate,type:'export'},function(result){
  428 + window.open("/downloadFile/download?fileName=发车到站准点率"+moment(date).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  429 + layer.close(i);
  430 + });
  431 + }else{
  432 + $get('/calcInterval/listInterval',{line:id,date:date,endDate:endDate,type:'export'},function(result){
  433 + window.open("/downloadFile/download?fileName=大间距汇总表"+moment(date).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  434 + layer.close(i);
  435 + });
  436 + }
  437 +
  438 + })
  439 +
  440 + });
  441 +</script>
  442 +<script type="text/html" id="intervalList">
  443 + {{each list as obj i}}
  444 + <tr>
  445 + <td>{{obj.gs}}</td>
  446 + <td>{{obj.fgs}}</td>
  447 + <td>{{obj.xlName}}</td>
  448 + <td>{{obj.djgAll}}</td>
  449 + <td>{{obj.djgGf}}</td>
  450 + <td>{{obj.djgZgf}}</td>
  451 + <td>{{obj.djgWgf}}</td>
  452 + <td>{{obj.djgDg}}</td>
  453 + <td>{{obj.djgTime}}</td>
  454 + <td>
  455 + <button type="button" class="btn btn-sm blue btn-intervalList"
  456 + data-id="{{obj.xlBm}}">查看</button>
  457 + </td>
  458 + </tr>
  459 + {{/each}}
  460 + {{if list.length == 0}}
  461 + <tr>
  462 + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td>
  463 + </tr>
  464 + {{/if}}
  465 +</script>
  466 +
  467 +<script type="text/html" id="intervalList_d">
  468 + {{each list as obj i}}
  469 + <tr>
  470 + <td>{{obj.gs}}</td>
  471 + <td>{{obj.fgs}}</td>
  472 + <td>{{obj.xlName}}</td>
  473 + <td>{{obj.jhszfcs}}</td>
  474 + <td>{{obj.sjszfczds}}</td>
  475 + <td>{{obj.szfczdl}}</td>
  476 + <td>{{obj.sjszddzds}}</td>
  477 + <td>{{obj.szddzdl}}</td>
  478 + <td>
  479 + <button type="button" class="btn btn-sm blue btn-intervalList_d"
  480 + data-id="{{obj.xlBm}}">查看</button>
  481 + </td>
  482 + </tr>
  483 + {{/each}}
  484 + {{if list.length == 0}}
  485 + <tr>
  486 + <td colspan="9"><h6 class="muted">没有找到相关数据</h6></td>
  487 + </tr>
  488 + {{/if}}
  489 +</script>
  490 +
  491 +
  492 +<script type="text/html" id="intervalList_1">
  493 + {{each list as obj i}}
  494 + <tr>
  495 + <td>{{obj.gs}}</td>
  496 + <td>{{obj.fgs}}</td>
  497 + <td>{{obj.date}}</td>
  498 + <td>{{obj.xl}}</td>
  499 + <td>{{obj.level}}</td>
  500 + <td>{{obj.djgAll}}</td>
  501 + <td>{{obj.djgGf}}</td>
  502 + <td>{{obj.djgZgf}}</td>
  503 + <td>{{obj.djgWgf}}</td>
  504 + <td>{{obj.djgDg}}</td>
  505 + <td>{{obj.djgTime}}</td>
  506 + <td>
  507 + <button type="button" class="btn btn-sm blue btn-intervalList_1"
  508 + data-id="{{obj.xlBm}}" data-date="{{obj.date}}">详细</button>
  509 + </td>
  510 + </tr>
  511 + {{/each}}
  512 + {{if list.length == 0}}
  513 + <tr>
  514 + <td colspan="11"><h6 class="muted">没有找到相关数据</h6></td>
  515 + </tr>
  516 + {{/if}}
  517 +</script>
  518 +
  519 +<script type="text/html" id="sheetList_1">
  520 + {{each list as obj i}}
  521 + <tr>
  522 + <td>{{obj.gsname}}</td>
  523 + <td>{{obj.fgsname}}</td>
  524 + <td>{{obj.xlName}}</td>
  525 + <td>{{obj.date}}</td>
  526 + <td>{{obj.jhszfcs}}</td>
  527 + <td>{{obj.sjszfczds}}</td>
  528 + <td>{{obj.szfczdl}}</td>
  529 + <td>
  530 + <button type="button" class="btn btn-sm blue btn-calcSheetList_1"
  531 + data-id="{{obj.xl}}" data-date="{{obj.date}}">详细</button>
  532 + </td>
  533 + <td>{{obj.sjszddzds}}</td>
  534 + <td>{{obj.szddzdl}}</td>
  535 + <td>
  536 + <button type="button" class="btn btn-sm blue btn-calcSheetList_2"
  537 + data-id="{{obj.xl}}" data-date="{{obj.date}}" >详细</button>
  538 + </td>
  539 + </tr>
  540 + {{/each}}
  541 + {{if list.length == 0}}
  542 + <tr>
  543 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  544 + </tr>
  545 + {{/if}}
  546 + {{if list.length == 0}}
  547 + <tr>
  548 + <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
  549 + </tr>
  550 + {{/if}}
  551 +</script>
  552 +
src/main/resources/static/pages/report/sheet/intervalList.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title" style="margin-left: 20px">
  21 + <button id="exportList">数据导出</button>
  22 + </div>
  23 +</div>
  24 +
  25 +<div class="row" id="calcIntervalList">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-body">
  29 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 600px">
  30 + <table class="table table-bordered table-hover table-checkable" id="forms_2">
  31 + <thead>
  32 + <tr>
  33 + <td></td>
  34 + <td>日期</td>
  35 + <td>线路</td>
  36 + <td>站点</td>
  37 + <td>等级</td>
  38 + <td>计发</td>
  39 + <td>实发</td>
  40 + <td>计发</td>
  41 + <td>实发</td>
  42 + <td>间隔时间</td>
  43 + </tr>
  44 + </thead>
  45 +
  46 + <tbody>
  47 +
  48 + </tbody>
  49 + </table>
  50 + </div>
  51 + </div>
  52 + </div>
  53 + </div>
  54 +</div>
  55 +<script>
  56 + $(function(){
  57 + // 关闭左侧栏
  58 + if (!$('body').hasClass('page-sidebar-closed'))
  59 + $('.menu-toggler.sidebar-toggler').click();
  60 + var no="";
  61 + var dates="";
  62 + $("#calcIntervalList").on('init', function (e, id) {
  63 + no=id.split(",")[0];
  64 + dates = id.split(",")[1];
  65 + var i = layer.load(2);
  66 + $get('/calcInterval/interval',{line:no,date:dates,type:'query'},function(result){
  67 + layer.close(i);
  68 + var calcIntervalList_2 = template('calcIntervalList_2',{list:result});
  69 + $('#forms_2 tbody').html(calcIntervalList_2);
  70 + });
  71 + })
  72 + $("#exportList").on('click',function(){
  73 + var i = layer.load(2);
  74 + $get('/calcInterval/interval',{line:no,date:dates,type:'export'},function(result){
  75 + window.open("/downloadFile/download?fileName="+dates+"大间隔详细");
  76 + layer.close(i);
  77 + });
  78 + });
  79 +
  80 +
  81 + });
  82 +</script>
  83 +<script type="text/html" id="calcIntervalList_2">
  84 + {{each list as obj i}}
  85 + <tr >
  86 + <td>{{i+1}}</td>
  87 + <td>{{obj.date}}</td>
  88 + <td>{{obj.xlName}}</td>
  89 + <td>{{obj.station}}</td>
  90 + <td>{{obj.level}}</td>
  91 + <td>{{obj.jhfc1}}</td>
  92 + <td>{{obj.sjfc1}}</td>
  93 + <td>{{obj.jhfc2}}</td>
  94 + <td>{{obj.sjfc2}}</td>
  95 + <td>{{obj.subTime}}</td>
  96 + </tr>
  97 + {{/each}}
  98 + {{if list.length == 0}}
  99 + <tr>
  100 + <td colspan="10"><h6 class="muted">没有找到相关数据</h6></td>
  101 + </tr>
  102 + {{/if}}
  103 +</script>
0 \ No newline at end of file 104 \ No newline at end of file
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/fcxxwt.html
@@ -182,8 +182,7 @@ @@ -182,8 +182,7 @@
182 (function() { 182 (function() {
183 var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他']; 183 var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他'];
184 var reportTypes = [{name:"无到", code:"9101"}, {name:"无出", code:"9109"}, {name:"掉线", code:"9102"}, {name:"指令故障", code:"9103"}, {name:"车辆漂移", code:"9104"}]; 184 var reportTypes = [{name:"无到", code:"9101"}, {name:"无出", code:"9109"}, {name:"掉线", code:"9102"}, {name:"指令故障", code:"9103"}, {name:"车辆漂移", code:"9104"}];
185 - var modal = '#schedule-fcxxwt-modal'  
186 - ,sch; 185 + var modal = '#schedule-fcxxwt-modal', sch, isReport = false;
187 $(modal).on('init', function(e, data) { 186 $(modal).on('init', function(e, data) {
188 e.stopPropagation(); 187 e.stopPropagation();
189 sch=data.sch; 188 sch=data.sch;
@@ -216,6 +215,7 @@ @@ -216,6 +215,7 @@
216 for (var j = 0;j < reportTypes.length;j++) { 215 for (var j = 0;j < reportTypes.length;j++) {
217 if (items[i] == reportTypes[j].name) { 216 if (items[i] == reportTypes[j].name) {
218 $('input:checkbox[value=' + reportTypes[j].code + ']').prop('checked', true); 217 $('input:checkbox[value=' + reportTypes[j].code + ']').prop('checked', true);
  218 + isReport = true;
219 } 219 }
220 } 220 }
221 } 221 }
@@ -226,7 +226,7 @@ @@ -226,7 +226,7 @@
226 var f = $('form', modal).formValidation(gb_form_validation_opts); 226 var f = $('form', modal).formValidation(gb_form_validation_opts);
227 f.on('success.form.fv', function(e) { 227 f.on('success.form.fv', function(e) {
228 e.preventDefault(); 228 e.preventDefault();
229 - var data = $(this).serializeJSON(); 229 + var data = $(this).serializeJSON(), reportText = new Array();
230 230
231 //校验实发实达时间 231 //校验实发实达时间
232 if(!validation_s_e_Time(data)){ 232 if(!validation_s_e_Time(data)){
@@ -239,11 +239,40 @@ @@ -239,11 +239,40 @@
239 //修改里程 239 //修改里程
240 var editJhlc = data.jhlc != sch.jhlc && data.jhlc != 0; 240 var editJhlc = data.jhlc != sch.jhlc && data.jhlc != 0;
241 // 修改报修类型为字符串 241 // 修改报修类型为字符串
242 - if (data.reportTypes) data.reportTypes = data.reportTypes.join(";");  
243 if(!data.adjustExps && (data.status==-1 || normalDestory || editJhlc)){ 242 if(!data.adjustExps && (data.status==-1 || normalDestory || editJhlc)){
244 notify_err("当前操作需要选择调整原因!"); 243 notify_err("当前操作需要选择调整原因!");
245 return; 244 return;
246 } 245 }
  246 + if (data.reportTypes) {
  247 + for (var i = 0;i < data.reportTypes.length;i++) {
  248 + for (var j = 0;j < reportTypes.length;j++) {
  249 + if (data.reportTypes[i] == reportTypes[j].code) {
  250 + reportText.push(reportTypes[j].name);
  251 + break;
  252 + }
  253 + }
  254 + }
  255 + if (!isReport) {
  256 + layer.confirm('确定上报类型[' + reportText.join(';') + ']?', {
  257 + btn : [ '确定', '取消' ],
  258 + icon : 3,
  259 + skin : 'layui-layer-cfm-add'
  260 + }, function() {
  261 + layer.closeAll();
  262 + // 修改报修类型为字符串
  263 + data.reportTypes = data.reportTypes.join(";");
  264 + postData(data);
  265 + }, function() {
  266 + $('.uk-button-primary').attr('disabled', false);
  267 + });
  268 + return;
  269 + }
  270 +
  271 + data.reportTypes = data.reportTypes.join(";");
  272 + postData(data);
  273 + return;
  274 + }
  275 +
247 postData(data); 276 postData(data);
248 }); 277 });
249 278
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sftz.html
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 <div class="uk-form-row"> 14 <div class="uk-form-row">
15 <label class="uk-form-label" >车辆</label> 15 <label class="uk-form-label" >车辆</label>
16 <div class="uk-form-controls"> 16 <div class="uk-form-controls">
17 - <input type="text" value="{{sch.clZbh}}" disabled> 17 + <input type="text" name="clZbh" value="{{sch.clZbh}}" readonly>
18 </div> 18 </div>
19 </div> 19 </div>
20 </div> 20 </div>
@@ -83,24 +83,65 @@ @@ -83,24 +83,65 @@
83 83
84 <script> 84 <script>
85 (function() { 85 (function() {
86 - var modal = '#schedule-sftz-modal',  
87 - sch; 86 + var modal = '#schedule-sftz-modal', sch, isReport = false;
88 var reportTypes = [{name:"无到", code:"9101"}, {name:"无出", code:"9109"}, {name:"掉线", code:"9102"}, {name:"指令故障", code:"9103"}, {name:"车辆漂移", code:"9104"}]; 87 var reportTypes = [{name:"无到", code:"9101"}, {name:"无出", code:"9109"}, {name:"掉线", code:"9102"}, {name:"指令故障", code:"9103"}, {name:"车辆漂移", code:"9104"}];
89 $(modal).on('init', function(e, data) { 88 $(modal).on('init', function(e, data) {
90 e.stopPropagation(); 89 e.stopPropagation();
91 sch = data.sch; 90 sch = data.sch;
  91 + debugger;
92 var formHtml = template('schedule-sftz-form-temp', {sch: sch, reportTypes:reportTypes}); 92 var formHtml = template('schedule-sftz-form-temp', {sch: sch, reportTypes:reportTypes});
93 $('form', modal).html(formHtml); 93 $('form', modal).html(formHtml);
  94 + $('input:checkbox').click(function(){
  95 + var remark = $('[name=remarks]').val(), title = $(this).prop("title");
  96 + if ($(this).prop('checked')) {
  97 + if (remark.indexOf(title) > -1) return;
  98 + $('[name=remarks]').val((remark ? remark + ";" : "") + title);
  99 + } else {
  100 + $('[name=remarks]').val(remark.replace(";" + title, "").replace(title + ";", "").replace(title, ""));
  101 + }
  102 + });
94 103
95 //submit 104 //submit
96 var f = $('form', modal).formValidation(gb_form_validation_opts); 105 var f = $('form', modal).formValidation(gb_form_validation_opts);
97 f.on('success.form.fv', function(e) { 106 f.on('success.form.fv', function(e) {
98 e.preventDefault(); 107 e.preventDefault();
99 - var data = $(this).serializeJSON(); 108 + var data = $(this).serializeJSON(), reportText = new Array();
100 109
101 - // 修改报修类型为字符串  
102 - if (data.reportTypes) data.reportTypes = data.reportTypes.join(";");  
103 - gb_common.$post('/realSchedule/realOutAdjust', data, function(rs) { 110 + if (data.reportTypes) {
  111 + for (var i = 0;i < data.reportTypes.length;i++) {
  112 + for (var j = 0;j < reportTypes.length;j++) {
  113 + if (data.reportTypes[i] == reportTypes[j].code) {
  114 + reportText.push(reportTypes[j].name);
  115 + break;
  116 + }
  117 + }
  118 + }
  119 + if (!isReport) {
  120 + layer.confirm('确定上报类型[' + reportText.join(';') + ']?', {
  121 + btn : [ '确定', '取消' ],
  122 + icon : 3,
  123 + skin : 'layui-layer-cfm-add'
  124 + }, function() {
  125 + layer.closeAll();
  126 + // 修改报修类型为字符串
  127 + data.reportTypes = data.reportTypes.join(";");
  128 + postData(data);
  129 + }, function() {
  130 + $('.uk-button-primary').attr('disabled', false);
  131 + });
  132 + return;
  133 + }
  134 +
  135 + data.reportTypes = data.reportTypes.join(";");
  136 + postData(data);
  137 + return;
  138 + }
  139 +
  140 + postData(data);
  141 + });
  142 +
  143 + var postData = function (data) {
  144 + gb_common.$post('/realSchedule/realOutAdjust', data, function(rs) {
104 if (rs.ts) { 145 if (rs.ts) {
105 //更新前端数据 146 //更新前端数据
106 gb_schedule_table.updateSchedule(rs.ts); 147 gb_schedule_table.updateSchedule(rs.ts);
@@ -111,7 +152,7 @@ @@ -111,7 +152,7 @@
111 gb_schedule_table.calc_yfwf_num(sch.xlBm); 152 gb_schedule_table.calc_yfwf_num(sch.xlBm);
112 } 153 }
113 }); 154 });
114 - }); 155 + }
115 156
116 // 维修类型选中 157 // 维修类型选中
117 var initReport = function() { 158 var initReport = function() {
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/wxsb.html
@@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
22 <div class="uk-form-row"> 22 <div class="uk-form-row">
23 <label class="uk-form-label" >故障类型</label> 23 <label class="uk-form-label" >故障类型</label>
24 <div class="uk-form-controls"> 24 <div class="uk-form-controls">
25 - <select name="repairTypes"></select> 25 + <select name="reportTypes"></select>
26 </div> 26 </div>
27 </div> 27 </div>
28 </div> 28 </div>
@@ -35,8 +35,7 @@ @@ -35,8 +35,7 @@
35 35
36 <script> 36 <script>
37 (function() { 37 (function() {
38 - var modal = '#schedule-wxsb-modal'  
39 - ,sch; 38 + var modal = '#schedule-wxsb-modal', sch;
40 39
41 $(modal).on('init', function(e, data) { 40 $(modal).on('init', function(e, data) {
42 e.stopPropagation(); 41 e.stopPropagation();
@@ -46,23 +45,40 @@ @@ -46,23 +45,40 @@
46 45
47 //报修类型字典 46 //报修类型字典
48 var opts = new Array(); 47 var opts = new Array();
49 - var repairTypes=[{name:"录像不连续", code:"9201"}, {name:"无录像", code:"9202"}, {name:"录像缺通告", code:"9203"}, {name:"无法调取录像", code:"9204"}, {name:"其它录像报修", code:"9209"}, {name:"黑屏", code:"9301"}, {name:"间歇性黑屏", code:"9302"}, {name:"中门视屏无", code:"9303"}, {name:"卡在启动界面", code:"9304"}, {name:"倒车视频无", code:"9305"}, {name:"启动后显示倒车", code:"9306"}, {name:"其它屏幕报修", code:"9309"}];  
50 - for(var i = 0;i < repairTypes.length;i++){  
51 - opts.push('<option value="'+repairTypes[i].code+'">'+repairTypes[i].name+'</option>'); 48 + var reportTypes = [{name:"录像不连续", code:"9201"}, {name:"无录像", code:"9202"}, {name:"录像缺通告", code:"9203"}, {name:"无法调取录像", code:"9204"}, {name:"其它录像报修", code:"9209"}, {name:"黑屏", code:"9301"}, {name:"间歇性黑屏", code:"9302"}, {name:"中门视屏无", code:"9303"}, {name:"卡在启动界面", code:"9304"}, {name:"倒车视频无", code:"9305"}, {name:"启动后显示倒车", code:"9306"}, {name:"其它屏幕报修", code:"9309"}];
  49 + for(var i = 0;i < reportTypes.length;i++){
  50 + opts.push('<option value="'+reportTypes[i].code+'">'+reportTypes[i].name+'</option>');
52 } 51 }
53 - $('[name=repairTypes]', modal).html(opts.join("")); 52 + $('[name=reportTypes]', modal).html(opts.join(""));
54 53
55 //submit 54 //submit
56 var f = $('form', modal).formValidation(gb_form_validation_opts); 55 var f = $('form', modal).formValidation(gb_form_validation_opts);
57 f.on('success.form.fv', function(e) { 56 f.on('success.form.fv', function(e) {
58 e.preventDefault(); 57 e.preventDefault();
59 $('[type=submit]', f).attr('disabled', 'disabled'); 58 $('[type=submit]', f).attr('disabled', 'disabled');
60 - var data = $(this).serializeJSON();  
61 - gb_common.$post('/realSchedule/wxsb', data, function(rs){  
62 - //更新班次信息  
63 - notify_succ('操作成功!');  
64 - UIkit.modal(modal).hide();  
65 - }); 59 + var data = $(this).serializeJSON(), reportText = new Array();
  60 +
  61 + for (var j = 0;j < reportTypes.length;j++) {
  62 + if (data.reportTypes == reportTypes[j].code) {
  63 + reportText.push(reportTypes[j].name);
  64 + break;
  65 + }
  66 + }
  67 +
  68 + layer.confirm('确定上报类型[' + reportText.join(';') + ']?', {
  69 + btn : [ '确定', '取消' ],
  70 + icon : 3,
  71 + skin : 'layui-layer-cfm-add'
  72 + }, function() {
  73 + layer.closeAll();
  74 + gb_common.$post('/realSchedule/wxsb', data, function(rs){
  75 + //更新班次信息
  76 + notify_succ('操作成功!');
  77 + UIkit.modal(modal).hide();
  78 + });
  79 + }, function() {
  80 + $('.uk-button-primary').attr('disabled', false);
  81 + });
66 }); 82 });
67 }); 83 });
68 })(); 84 })();
src/main/resources/static/real_control_v2/fragments/north/tabs.html
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <li class="uk-active" ><a>主页</a></li> 4 <li class="uk-active" ><a>主页</a></li>
5 <li id="north_tabs_map_btn"><a>地图</a></li> 5 <li id="north_tabs_map_btn"><a>地图</a></li>
6 {{each list as line i}} 6 {{each list as line i}}
7 - <li class="tab-line {{line.destroy==1?'destroy':''}}" data-code="{{line.lineCode}}"><a>{{line.name}}(<span id="badge_untreated_num_{{line.lineCode}}">0</span>, <span id="badge_yfwf_num_{{line.lineCode}}">0</span>)</a></li> 7 + <li class="tab-line {{line.destroy==1?'destroy':''}}" data-code="{{line.lineCode}}"><a>{{line.name}}&nbsp;(<span id="badge_untreated_num_{{line.lineCode}}">0</span>, <span id="badge_yfwf_num_{{line.lineCode}}">0</span>, <span id="level_{{line.lineCode}}">{{line.lineLevel}}</span>)</a></li>
8 {{/each}} 8 {{/each}}
9 </ul> 9 </ul>
10 </script> 10 </script>
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
@@ -289,7 +289,7 @@ var gb_schedule_context_menu = (function () { @@ -289,7 +289,7 @@ var gb_schedule_context_menu = (function () {
289 wxsb: function (sch) { 289 wxsb: function (sch) {
290 open_modal(folder + '/wxsb.html', { 290 open_modal(folder + '/wxsb.html', {
291 sch: sch 291 sch: sch
292 - }, modal_opts); 292 + }, {center: true, bgclose: false, modal: true});
293 } 293 }
294 }; 294 };
295 295