Commit 23716be8c1810d558a39fcdb8db19e1cf2722ab5

Authored by 廖磊
2 parents a457f9b5 2e25f1c9

Merge branch 'minhang' of

http://222.66.0.204:8090/panzhaov5/bsth_control into minhang

# Conflicts:
#	src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
Showing 41 changed files with 3015 additions and 2218 deletions
src/main/java/com/bsth/controller/realcontrol/RealMapController.java
1 1 package com.bsth.controller.realcontrol;
2 2  
  3 +import com.bsth.data.gpsdata.arrival.GeoCacheData;
  4 +import com.bsth.data.gpsdata.arrival.entity.TimedEnableStationRoute;
3 5 import com.bsth.service.realcontrol.RealMapService;
4 6 import org.springframework.beans.factory.annotation.Autowired;
5 7 import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RequestMethod;
6 9 import org.springframework.web.bind.annotation.RequestParam;
7 10 import org.springframework.web.bind.annotation.RestController;
8 11  
... ... @@ -74,4 +77,9 @@ public class RealMapController {
74 77 public Map<String, Object> multiSectionRoute(@RequestParam String codeIdx){
75 78 return realMapService.multiSectionRoute(codeIdx);
76 79 }
  80 +
  81 + @RequestMapping(value = "/lockAndFlxedTimeEnabled", method = RequestMethod.POST)
  82 + public void lockAndFlxedTimeEnabled(TimedEnableStationRoute tes){
  83 + GeoCacheData.tesMap.put(tes.getLineCode(), tes);
  84 + }
77 85 }
... ...
src/main/java/com/bsth/controller/realcontrol/anomalyCheckController.java
... ... @@ -102,7 +102,7 @@ public class anomalyCheckController {
102 102 }
103 103  
104 104 @RequestMapping(value = "/findSchByLpName")
105   - public List<ScheduleRealInfo> findSchByLpName(String lpName){
  105 + public List<ScheduleRealInfo> findSchByLpName(@RequestParam String lpName){
106 106 return dayOfSchedule.getLpScheduleMap().get(lpName);
107 107 }
108 108 }
... ...
src/main/java/com/bsth/data/LineConfigData.java
... ... @@ -77,7 +77,7 @@ public class LineConfigData implements CommandLineRunner {
77 77 public long applyIn(ScheduleRealInfo sch, Long timestamp){
78 78 LineConfig config = lineConfMap.get(sch.getXlBm());
79 79 int diff = sch.getXlDir().equals("0")?config.getUpInDiff():config.getDownInDiff();
80   - return timestamp - (diff * 1000);
  80 + return timestamp + (diff * 1000);
81 81 }
82 82  
83 83 @Component
... ...
src/main/java/com/bsth/data/gpsdata/arrival/GeoCacheData.java
... ... @@ -2,6 +2,7 @@ package com.bsth.data.gpsdata.arrival;
2 2  
3 3 import com.bsth.data.gpsdata.GpsEntity;
4 4 import com.bsth.data.gpsdata.arrival.entity.StationRoute;
  5 +import com.bsth.data.gpsdata.arrival.entity.TimedEnableStationRoute;
5 6 import com.bsth.data.gpsdata.arrival.utils.CircleQueue;
6 7 import com.bsth.data.gpsdata.arrival.utils.StationRouteComp;
7 8 import com.google.common.collect.ArrayListMultimap;
... ... @@ -53,6 +54,10 @@ public class GeoCacheData {
53 54 //线路限速信息
54 55 private static Map<String, Double> speedLimitMap;
55 56  
  57 + //需要定时刷新的站点路由
  58 + public static Map<String, TimedEnableStationRoute> tesMap = new HashMap<>();
  59 + //TimedEnableStationRoute
  60 +
56 61 @Autowired
57 62 JdbcTemplate jdbcTemplate;
58 63  
... ... @@ -282,6 +287,28 @@ public class GeoCacheData {
282 287 connectStationRoute(tempMap.get(key));
283 288 }
284 289  
  290 + //定时启用的站点走向
  291 + if(tesMap.size() > 0){
  292 + List<String> rems = new ArrayList<>();
  293 + long t = System.currentTimeMillis();
  294 + for(TimedEnableStationRoute tes : tesMap.values()){
  295 + if(tes.getEnableTime() > t){
  296 + logger.info("锁住站点路由," + tes.getLineCode());
  297 + tempMap.replaceValues(tes.getLineCode() + "_0", stationCacheMap.get(tes.getLineCode() + "_0"));
  298 + tempMap.replaceValues(tes.getLineCode() + "_1", stationCacheMap.get(tes.getLineCode() + "_1"));
  299 + }
  300 + else
  301 + rems.add(tes.getLineCode());
  302 + }
  303 +
  304 + //remove
  305 + if(rems.size() > 0){
  306 + for(String lineCode : rems){
  307 + logger.info("启用路由," + lineCode);
  308 + tesMap.remove(lineCode);
  309 + }
  310 + }
  311 + }
285 312 stationCacheMap = tempMap;
286 313 routeCodeMap = codeMap;
287 314 }
... ...
src/main/java/com/bsth/data/gpsdata/arrival/entity/TimedEnableStationRoute.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.entity;
  2 +
  3 +/**
  4 + * 定时启用站点路由
  5 + * Created by panzhao on 2017/8/28.
  6 + */
  7 +public class TimedEnableStationRoute {
  8 +
  9 + private String lineCode;
  10 +
  11 + private Long enableTime;
  12 +
  13 + public String getLineCode() {
  14 + return lineCode;
  15 + }
  16 +
  17 + public void setLineCode(String lineCode) {
  18 + this.lineCode = lineCode;
  19 + }
  20 +
  21 + public Long getEnableTime() {
  22 + return enableTime;
  23 + }
  24 +
  25 + public void setEnableTime(Long enableTime) {
  26 + this.enableTime = enableTime;
  27 + }
  28 +}
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/AbnormalStateHandle.java
... ... @@ -65,8 +65,8 @@ public class AbnormalStateHandle extends SignalHandle{
65 65 * @return
66 66 */
67 67 public boolean outOfBounds(GpsEntity gps){
68   - //场内的车不处理
69   - if(gps.getInstation() == 2){
  68 + //只处理电子围栏外的车
  69 + if(gps.getInstation() != 0){
70 70 return false;
71 71 }
72 72  
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
... ... @@ -239,9 +239,14 @@ public class InOutStationSignalHandle extends SignalHandle{
239 239 long t2 = gps.getTimestamp();
240 240 long c = sch.getDfsjT();
241 241  
242   - if(c - t1 > 1000 * 60 * 15 && Math.abs(t2 - c) < 1000 * 60 * 5){
  242 + /*if(c - t1 > 1000 * 60 * 15 && Math.abs(t2 - c) < 1000 * 60 * 5){
  243 + return true;
  244 + }*/
  245 + int threshold = 1000 * 60 * 5;
  246 + if(Math.abs(t2 - c) < threshold && c - t1 > threshold){
243 247 return true;
244 248 }
  249 + //if(Math.abs(t2 - c) < 1000 * 60 * 5 && c - t1 > 1000 * 60 * 5)
245 250 return false;
246 251 }
247 252  
... ... @@ -255,7 +260,7 @@ public class InOutStationSignalHandle extends SignalHandle{
255 260 if (config != null && config.getOutConfig() == 2) {
256 261 //出站既出场
257 262 ScheduleRealInfo schPrev = dayOfSchedule.prev(sch);
258   - if (schPrev != null && schPrev.getBcType().equals("out")
  263 + if (schPrev != null && schPrev.getBcType().equals("out") && (schPrev.getBcsj()==0 || schPrev.getJhlcOrig().equals(0))
259 264 && (!limitPark || park.equals(schPrev.getQdzCode()))) {
260 265  
261 266 schPrev.setFcsjActualAll(sch.getFcsjActualTime());
... ... @@ -447,7 +452,7 @@ public class InOutStationSignalHandle extends SignalHandle{
447 452 boolean limitPark = StringUtils.isNotEmpty(park);
448 453  
449 454  
450   - if (next.getBcType().equals("in") && config.getOutConfig() == 2
  455 + if (next.getBcType().equals("in") && config.getOutConfig() == 2 && (next.getBcsj()==0 || next.getJhlcOrig().equals(0))
451 456 && (!limitPark || park.equals(next.getZdzCode()))) {
452 457  
453 458 next.setFcsjActualAll(sch.getZdsjActualTime());
... ...
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
... ... @@ -60,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware {
60 60 for (String nbbm : keys) {
61 61 Collections.sort(listMap.get(nbbm), comp);
62 62 threadPool.execute(new RecoveryThread(listMap.get(nbbm), count));
63   - /*if(nbbm.equals("W9H-088"))
  63 + /*if(nbbm.equals("W09-164"))
64 64 new RecoveryThread(listMap.get(nbbm), count).run();*/
65 65 /*if(lineId.equals("60028"))
66 66 new RecoveryThread(listMap.get(lineId), count).run();*/
... ... @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware {
84 84 Calendar calendar = Calendar.getInstance();
85 85 int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR);
86 86  
87   - String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=207";// + dayOfYear;
  87 + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=241";// + dayOfYear;
88 88 JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource());
89 89  
90 90 List<GpsEntity> list =
... ... @@ -153,7 +153,7 @@ public class GpsDataRecovery implements ApplicationContextAware {
153 153 boolean task;
154 154 for (GpsEntity gps : list) {
155 155 try {
156   - /*if(gps.getTimestamp() >= 1500942270000L){
  156 + /*if(gps.getTimestamp() >= 1503960000000L){
157 157 System.out.println("debugger...");
158 158 }*/
159 159 //是否有任务
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -278,12 +278,14 @@ public class DayOfSchedule {
278 278 List<String> lprms = new ArrayList<>();
279 279 Set<String> lps = lpScheduleMap.keySet();
280 280 for (String lp : lps) {
281   - if (lp.indexOf(lineCode + "_") != -1)
  281 + if (lp.startsWith(lineCode + "_"))
282 282 lprms.add(lp);
283 283 }
284 284  
285   - for (String lp : lprms)
  285 + for (String lp : lprms){
  286 + logger.info("清理路牌映射 " + lp);
286 287 lpScheduleMap.removeAll(lp);
  288 + }
287 289  
288 290 logger.info(lineCode + "排班清理 " + count);
289 291 }
... ... @@ -571,7 +573,7 @@ public class DayOfSchedule {
571 573 continue;
572 574  
573 575 //出站既出场,忽略出场班次
574   - if (outConfig == 2 && temp.getBcType().equals("out")
  576 + if (outConfig == 2 && temp.getBcType().equals("out") && (temp.getBcsj()==0 || temp.getJhlcOrig().equals(0))
575 577 && (!limitPark || park.equals(temp.getQdzCode())))
576 578 continue;
577 579  
... ...
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
... ... @@ -117,8 +117,7 @@ public class SchAttrCalculator {
117 117 for(int i = 1; i < len; i ++){
118 118 curr = list.get(i);
119 119  
120   - if(prve.getZdzName().equals(curr.getQdzName())
121   - || prve.getZdzCode().equals(curr.getQdzCode())){
  120 + if(isJoin(prve, curr)){
122 121 curr.setQdzArrDatejh(prve.getZdsj());
123 122 if(StringUtils.isNotEmpty(prve.getZdsjActual()))
124 123 curr.setQdzArrDatesj(prve.getZdsjActual());
... ... @@ -126,6 +125,13 @@ public class SchAttrCalculator {
126 125 prve = curr;
127 126 }
128 127 }
  128 +
  129 + private boolean isJoin(ScheduleRealInfo prve, ScheduleRealInfo curr) {
  130 + return prve.getZdzName().equals(curr.getQdzName())//名称相等
  131 + || prve.getZdzCode().equals(curr.getQdzCode())//编码相等
  132 + || prve.getZdzName().startsWith(curr.getQdzName())//起始包括
  133 + || curr.getQdzName().startsWith(prve.getZdzName());//起始包括
  134 + }
129 135  
130 136 /**
131 137 *
... ...
src/main/java/com/bsth/data/schedule/ScheduleComparator.java
... ... @@ -3,6 +3,8 @@ package com.bsth.data.schedule;
3 3 import com.bsth.entity.realcontrol.ScheduleRealInfo;
4 4  
5 5 import java.util.Comparator;
  6 +import java.util.HashMap;
  7 +import java.util.Map;
6 8  
7 9 /**
8 10 *
... ... @@ -20,20 +22,38 @@ public class ScheduleComparator {
20 22 return s1.getFcno() - s2.getFcno();
21 23 }
22 24 }*/
  25 +
  26 + static Map<String, Integer> bcTypeOrderMap = new HashMap<>();
  27 +
  28 + static{
  29 + bcTypeOrderMap.put("out", 0);
  30 + bcTypeOrderMap.put("normal", 1);
  31 + bcTypeOrderMap.put("region", 2);
  32 + bcTypeOrderMap.put("major", 3);
  33 + bcTypeOrderMap.put("venting", 4);
  34 + bcTypeOrderMap.put("ldks", 5);
  35 + bcTypeOrderMap.put("in", 6);
  36 + }
23 37  
24 38 public static class FCSJ implements Comparator<ScheduleRealInfo>{
25 39  
26 40 @Override
27 41 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
28   - return (int) (s1.getFcsjT() - s2.getFcsjT());
  42 + int diff = (int) (s1.getFcsjT() - s2.getFcsjT());
  43 + return diff!=0?diff:typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
29 44 }
30 45 }
31 46  
  47 + private static int typeOrder(String bcType){
  48 + return bcTypeOrderMap.get(bcType)!=null?bcTypeOrderMap.get(bcType):0;
  49 + }
  50 +
32 51 public static class DFSJ implements Comparator<ScheduleRealInfo>{
33 52  
34 53 @Override
35 54 public int compare(ScheduleRealInfo s1, ScheduleRealInfo s2) {
36   - return (int) (s1.getDfsjT() - s2.getDfsjT());
  55 + int diff = (int) (s1.getDfsjT() - s2.getDfsjT());
  56 + return diff!=0?diff:typeOrder(s1.getBcType()) - typeOrder(s2.getBcType());
37 57 }
38 58 }
39 59 }
... ...
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
... ... @@ -217,6 +217,14 @@ public class ScheduleRealInfo {
217 217 /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/
218 218 private int siginCompate;
219 219  
  220 + /**
  221 + * 漂移状态
  222 + * 1: 发车漂移
  223 + * 2:到站漂移
  224 + * 3:中途漂移
  225 + */
  226 + private int driftStatus = 0;
  227 +
220 228 public boolean isDfAuto() {
221 229 return dfAuto;
222 230 }
... ... @@ -933,4 +941,12 @@ public class ScheduleRealInfo {
933 941 public void setSiginCompate(int siginCompate) {
934 942 this.siginCompate = siginCompate;
935 943 }
  944 +
  945 + public int getDriftStatus() {
  946 + return driftStatus;
  947 + }
  948 +
  949 + public void setDriftStatus(int driftStatus) {
  950 + this.driftStatus = driftStatus;
  951 + }
936 952 }
... ...
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
... ... @@ -50,25 +50,25 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
50 50 JdbcTemplate jdbcTemplate;
51 51 @Override
52 52 public PageObject<Ylxxb> Pagequery(Map<String, Object> map) {
53   -
  53 +
54 54 String rq=map.get("yyrq").toString();
55 55 String gsdm=map.get("gsdm_like").toString();
56 56 String fgsdm=map.get("fgsdm_like").toString();
57   -
58   - String sql=" select * from ("
59   - + "select *,CONCAT(nbbm,jsy) as nj "
60   - + " from bsth_c_ylxxb where yyrq='"+rq+"' "
61   - + " and gsdm ='"+gsdm+"' and jylx ='0') x where x.nj not in ("
62   - + " select CONCAT(nbbm,jsy) from bsth_c_ylb "
63   - + " where rq='"+rq+"'"
64   - + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"')"
65   - + " and x.nbbm in (select nbbm from bsth_c_ylb "
66   - + " where rq='"+rq+"'"
67   - + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"') "
68   - + " and x.nbbm not in (select nbbm from bsth_c_ylxxb"
69   - + " where yyrq='"+rq+"' and gsdm ='"+gsdm+"' AND jylx ='1')";
70   -
71   -
  57 +
  58 + String sql=" select * from ("
  59 + + "select *,CONCAT(nbbm,jsy) as nj "
  60 + + " from bsth_c_ylxxb where yyrq='"+rq+"' "
  61 + + " and gsdm ='"+gsdm+"' and jylx ='0') x where x.nj not in ("
  62 + + " select CONCAT(nbbm,jsy) from bsth_c_ylb "
  63 + + " where rq='"+rq+"'"
  64 + + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"')"
  65 + + " and x.nbbm in (select nbbm from bsth_c_ylb "
  66 + + " where rq='"+rq+"'"
  67 + + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"') "
  68 + + " and x.nbbm not in (select nbbm from bsth_c_ylxxb"
  69 + + " where yyrq='"+rq+"' and gsdm ='"+gsdm+"' AND jylx ='1')";
  70 +
  71 +
72 72 /*String sql= "select v.*,u.jsy as ldgh from "
73 73 + " ( select * from bsth_c_ylxxb x where "
74 74 + " DATE_FORMAT(x.yyrq,'%Y-%m-%d')='"+rq+"' and x.gsdm='"+gsdm+"'"
... ... @@ -83,43 +83,43 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
83 83 + " where DATE_FORMAT(rq,'%Y-%m-%d')='"+rq+"'"
84 84 + " and ssgsdm='"+gsdm+"' and fgsdm='"+fgsdm+"' ) u "
85 85 + " on v.nbbm=u.nbbm ";*/
86   -
  86 +
87 87 //根具条件查询指定日期Ylxxb的数据
88 88 // List<Ylxxb> iterator=repository.checkYlxx(rq,gsdm);
89 89 /*if(map.get("gsdm_in")!=null){
90 90 map.put("ssgsdm_in", map.get("gsdm_in"));
91 91 map.remove("gsdm_in");
92   -
  92 +
93 93 }else{
94 94 map.put("ssgsdm_like", map.get("gsdm_like"));
95 95 map.remove("gsdm_like");
96 96 }*/
97   -
  97 +
98 98 //根具条件查询指定日期Ylb的数据
99 99 // List<Ylb> ylbIterator=ylbRepository.checkYl(rq,gsdm,fgsdm);
100   - List<Ylxxb> list=jdbcTemplate.query(sql,
101   - new RowMapper<Ylxxb>(){
102   - @Override
103   - public Ylxxb mapRow(ResultSet rs, int rowNum) throws SQLException {
104   - Ylxxb s = new Ylxxb();
105   - s.setId(rs.getInt("id"));
106   - s.setYyrq(rs.getDate("yyrq"));
107   - s.setNbbm(rs.getString("nbbm"));
108   - s.setGsdm(rs.getString("gsdm"));
109   - s.setFgsdm(rs.getString("fgsdm"));
110   - s.setJsy(rs.getString("jsy"));
111   - s.setJzl(rs.getDouble("jzl"));
112   - s.setStationid(rs.getString("stationid"));
113   - s.setNylx(rs.getInt("nylx"));
114   - s.setJyggh(rs.getString("jyggh"));
115   - s.setYj(rs.getDouble("yj"));
  100 + List<Ylxxb> list=jdbcTemplate.query(sql,
  101 + new RowMapper<Ylxxb>(){
  102 + @Override
  103 + public Ylxxb mapRow(ResultSet rs, int rowNum) throws SQLException {
  104 + Ylxxb s = new Ylxxb();
  105 + s.setId(rs.getInt("id"));
  106 + s.setYyrq(rs.getDate("yyrq"));
  107 + s.setNbbm(rs.getString("nbbm"));
  108 + s.setGsdm(rs.getString("gsdm"));
  109 + s.setFgsdm(rs.getString("fgsdm"));
  110 + s.setJsy(rs.getString("jsy"));
  111 + s.setJzl(rs.getDouble("jzl"));
  112 + s.setStationid(rs.getString("stationid"));
  113 + s.setNylx(rs.getInt("nylx"));
  114 + s.setJyggh(rs.getString("jyggh"));
  115 + s.setYj(rs.getDouble("yj"));
116 116 // s.setLdgh(rs.getString("ldgh"));
117   - s.setBz(rs.getString("bz"));
118   - return s;
119   - }
120   - });
121   -
122   -
  117 + s.setBz(rs.getString("bz"));
  118 + return s;
  119 + }
  120 + });
  121 +
  122 +
123 123 List<Ylb> listylb=ylbRepository.obtainYl(rq, gsdm, fgsdm, "", "", "nbbm");
124 124 for (int i = 0; i < list.size(); i++) {
125 125 String ldgh="";
... ... @@ -129,11 +129,11 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
129 129 if(ldgh.equals(""))
130 130 ldgh +=ylb.getJsy();
131 131 else
132   - ldgh += ","+ylb.getJsy();
  132 + ldgh += ","+ylb.getJsy();
133 133 }
134 134 }
135 135 list.get(i).setLdgh(ldgh);
136   -
  136 +
137 137 }
138 138 //正式使用用下面代码
139 139 // for (int i = 0; i < iterator.size(); i++) {
... ... @@ -154,16 +154,16 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
154 154 // list.add(y1);
155 155 // }
156 156 // }
157   -
158   -
159   -
  157 +
  158 +
  159 +
160 160 PageHelper pageHelper = new PageHelper(list.size(), map);
161 161 pageHelper.getMap();
162 162 PageObject<Ylxxb> pageObject = pageHelper.getPageObject();
163 163 pageObject.setDataList(list);
164 164 return pageObject;
165 165 }
166   - @Transactional
  166 + @Transactional
167 167 @Override
168 168 public Map<String, Object> checkJsy(Map<String, Object> map) throws Exception{
169 169 Map<String, Object> newMap=new HashMap<String,Object>();
... ... @@ -188,7 +188,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
188 188 repository.save(ylxxb);
189 189 }
190 190 }
191   - newMap.put("status", ResponseCode.SUCCESS);
  191 + newMap.put("status", ResponseCode.SUCCESS);
192 192 }catch(Exception e){
193 193 newMap.put("status", ResponseCode.ERROR);
194 194 logger.error("save erro.", e);
... ... @@ -235,6 +235,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl&lt;Ylxxb,Integer&gt; implements
235 235 return list;
236 236 }
237 237  
  238 +
238 239 @Transactional
239 240 @Override
240 241 public Map<String, Object> checkNbbm(Map<String, Object> map) throws Exception{
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -4077,8 +4077,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4077 4077 Long zdsjActual_=Long.parseLong(zdsjActual_s[0])*60+Long.parseLong(zdsjActual_s[1]);
4078 4078 if((zdsj_-zdsjActual_)>0){
4079 4079 zdsjk =String.valueOf(zdsj_-zdsjActual_);
4080   - }
4081   - if(((zdsj_-zdsjActual_)<0)){
  4080 + }else{
4082 4081 zdsjm =String.valueOf(zdsjActual_-zdsj_);
4083 4082 }
4084 4083 }
... ... @@ -4105,8 +4104,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4105 4104 Long fcsjActural_=Long.parseLong(fcsjActural_s[0])*60+Long.parseLong(fcsjActural_s[1]);
4106 4105 if((zdsj_-fcsjActural_)>0){
4107 4106 fcsjk =String.valueOf(zdsj_-fcsjActural_);
4108   - }
4109   - if((zdsj_-fcsjActural_)<0){
  4107 + }else{
4110 4108 fcsjm =String.valueOf(fcsjActural_-zdsj_);
4111 4109 }
4112 4110 }
... ... @@ -4671,8 +4669,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4671 4669 mr.setSjyygl(rs.getDouble("sjyygl"));
4672 4670 mr.setSjksgl(rs.getDouble("sjksgl"));
4673 4671 mr.setZgl(rs.getDouble("zyygl"));
4674   - mr.setZddfgl(rs.getDouble("sddfgl"));
4675   - mr.setSddfgl(rs.getDouble("zddfgl"));
  4672 + mr.setZddfgl(rs.getDouble("zddfgl"));
  4673 + mr.setSddfgl(rs.getDouble("sddfgl"));
4676 4674 mr.setWqwxhgl(rs.getDouble("wqwxhgl"));
4677 4675 mr.setBfwxhgl(rs.getDouble("bfwxhgl"));
4678 4676 mr.setPygl(rs.getDouble("pygl"));
... ... @@ -4765,8 +4763,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4765 4763 sReport.setSjyybc(rs.getInt("sjyybc"));
4766 4764 sReport.setSjksbc(rs.getInt("sjksbc"));
4767 4765 sReport.setZbc(rs.getInt("zyybc"));
4768   - sReport.setZddfbc(rs.getInt("sddfbc"));
4769   - sReport.setSddfbc(rs.getInt("zddfbc"));
  4766 + sReport.setZddfbc(rs.getInt("zddfbc"));
  4767 + sReport.setSddfbc(rs.getInt("sddfbc"));
4770 4768 sReport.setWqwxhbc(rs.getInt("wqwxhbc"));
4771 4769 sReport.setBfwxhbc(rs.getInt("bfwxhbc"));
4772 4770 sReport.setPybc(rs.getInt("pybc"));
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -43,17 +43,17 @@ import javax.persistence.criteria.CriteriaBuilder.In;
43 43  
44 44 @Service
45 45 public class ReportServiceImpl implements ReportService{
46   -
  46 +
47 47 private static long zgf1 = 6 * 60 + 31,
48 48 zgf2 = 8 * 60 + 30,
49   - wgf1 = 16 * 60 + 1,
  49 + wgf1 = 16 * 60 + 1,
50 50 wgf2 = 18 * 60;
51   -
  51 +
52 52 private Logger logger = LoggerFactory.getLogger(this.getClass());
53   -
  53 +
54 54 @Autowired
55 55 JdbcTemplate jdbcTemplate;
56   -
  56 +
57 57 @Autowired
58 58 ScheduleRealInfoRepository scheduleRealInfoRepository;
59 59 @Autowired
... ... @@ -64,24 +64,24 @@ public class ReportServiceImpl implements ReportService{
64 64 LineRepository lineRepository;
65 65 @Autowired
66 66 StationRouteRepository stationRouteRepository;
67   -
  67 +
68 68 @Override
69 69 public List<ScheduleRealInfo> queryListBczx(String line, String date,String clzbh) {
70 70 // TODO Auto-generated method stub
71 71 List<ScheduleRealInfo> list=scheduleRealInfoRepository.findByDate2(line,date,clzbh);
72   -
  72 +
73 73 // jdbcTemplate.query("select * from bsth_c_s_sp_info_real where line=?1 "
74   -// + "and DATE_FORMAT(schedule_date,'%Y-%m-%d')=?2 and cl_zbl=?3",
75   -// new Object[]{line,date,clzbh},
76   -// new RowMapper(){
77   -// @Override
78   -// public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
79   -// ScheduleRealInfo s = new ScheduleRealInfo();
  74 +// + "and DATE_FORMAT(schedule_date,'%Y-%m-%d')=?2 and cl_zbl=?3",
  75 +// new Object[]{line,date,clzbh},
  76 +// new RowMapper(){
  77 +// @Override
  78 +// public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
  79 +// ScheduleRealInfo s = new ScheduleRealInfo();
80 80 //// s.
81   -// return s;
82   -// }
83   -// });
84   -
  81 +// return s;
  82 +// }
  83 +// });
  84 +
85 85 return list;
86 86 }
87 87 @Override
... ... @@ -96,7 +96,7 @@ public class ReportServiceImpl implements ReportService{
96 96 Long date2=simpleDateFormat.parse(date+" "+sjdd+":00").getTime();
97 97 Date dates=simpleDateFormat.parse(date+" 00:00:00");
98 98 List<ArrivalInfo> lists=load(line,sbbb,date1,date2,dates);
99   -
  99 +
100 100 for(int i=0;i<lists.size();i++){
101 101 ArrivalInfo t1=lists.get(i);
102 102 if(t1.getInOut()==0){
... ... @@ -109,53 +109,53 @@ public class ReportServiceImpl implements ReportService{
109 109 }
110 110 list.add(t1);
111 111 }
112   -
  112 +
113 113 }
114   -
115   -
  114 +
  115 +
116 116 } catch (ParseException e) {
117 117 // TODO Auto-generated catch block
118 118 e.printStackTrace();
119 119 }
120   -
  120 +
121 121 return list;
122 122 }
123 123  
124   -
  124 +
125 125 public List<ArrivalInfo> load(String line,String sbbb,Long date1,Long date2,Date dates){
126 126 List<ArrivalInfo> list = null;
127   - Calendar cal = Calendar.getInstance();
128   - cal.setTime(dates);
129   - //周数,表分区字段
130   - int weeks_year = cal.get(Calendar.WEEK_OF_YEAR);
131   -
132   - Connection conn = null;
133   - PreparedStatement ps = null;
134   - ResultSet rs = null;
135   -
136   - String sql = "select * from bsth_c_arrival_info where device_id=? AND line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts";
137   - try{
138   - conn = DBUtils_MS.getConnection();
139   - ps = conn.prepareStatement(sql);
140   - ps.setString(1, sbbb);
141   - ps.setString(2,line);
142   - ps.setInt(3, weeks_year);
143   - ps.setLong(4, date1);
144   - ps.setLong(5, date2);
145   - rs = ps.executeQuery();
146   -
147   - list = resultSet2Set(rs);
148   - }catch(Exception e){
149   - logger.error("", e);
150   - }finally {
151   - DBUtils_MS.close(rs, ps, conn);
152   - }
  127 + Calendar cal = Calendar.getInstance();
  128 + cal.setTime(dates);
  129 + //周数,表分区字段
  130 + int weeks_year = cal.get(Calendar.WEEK_OF_YEAR);
  131 +
  132 + Connection conn = null;
  133 + PreparedStatement ps = null;
  134 + ResultSet rs = null;
  135 +
  136 + String sql = "select * from bsth_c_arrival_info where device_id=? AND line_id=? AND weeks_year=? AND ts > ? AND ts <=? order by ts";
  137 + try{
  138 + conn = DBUtils_MS.getConnection();
  139 + ps = conn.prepareStatement(sql);
  140 + ps.setString(1, sbbb);
  141 + ps.setString(2,line);
  142 + ps.setInt(3, weeks_year);
  143 + ps.setLong(4, date1);
  144 + ps.setLong(5, date2);
  145 + rs = ps.executeQuery();
  146 +
  147 + list = resultSet2Set(rs);
  148 + }catch(Exception e){
  149 + logger.error("", e);
  150 + }finally {
  151 + DBUtils_MS.close(rs, ps, conn);
  152 + }
153 153 return list;
154 154 }
155   -
  155 +
156 156 public List<ArrivalInfo> resultSet2Set(ResultSet rs) throws SQLException{
157 157 List<ArrivalInfo> list = new ArrayList<>();
158   -
  158 +
159 159 ArrivalInfo arr;
160 160 while(rs.next()){
161 161 arr = new ArrivalInfo();
... ... @@ -167,7 +167,7 @@ public class ReportServiceImpl implements ReportService{
167 167 logger.warn("未注册的设备号," + arr.getDeviceId());
168 168 continue;
169 169 }
170   -
  170 +
171 171 arr.setTs(rs.getLong("ts"));
172 172 arr.setLineCode(rs.getString("line_id"));
173 173 arr.setUpDown(rs.getInt("up_down"));
... ... @@ -177,7 +177,7 @@ public class ReportServiceImpl implements ReportService{
177 177 arr.setCreateDate(rs.getLong("create_timestamp"));
178 178 arr.setWeeksYear(rs.getInt("weeks_year"));
179 179 arr.setEnable(true);
180   -
  180 +
181 181 list.add(arr);
182 182 }
183 183 return list;
... ... @@ -185,76 +185,76 @@ public class ReportServiceImpl implements ReportService{
185 185 @Override
186 186 public List<ArrivalInfo> queryListClzd(String line, String zd, String zdlx, String fcsj, String ddsj) {
187 187 // TODO Auto-generated method stub
188   - List<ArrivalInfo> list=new ArrayList<ArrivalInfo>();
189   - try {
190   - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
191   - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
192   - Long date1=simpleDateFormat.parse(fcsj+":00").getTime();
193   - Long date2=simpleDateFormat.parse(ddsj+":00").getTime();
194   - Date dates1=simpleDateFormat.parse(fcsj+":00");
195   - Date dates2=simpleDateFormat.parse(ddsj+":00");
196   - List<ArrivalInfo> lists=load2(line,date1,date2,dates1,dates2,zd,zdlx);
197   -
198   - for(int i=0;i<lists.size();i++){
199   - ArrivalInfo t1=lists.get(i);
200   - if(t1.getInOut()==0){
201   - t1.setJzsj(sdf.format(new Date(t1.getTs())));
202   - for(int j=0;j<lists.size();j++){
203   - ArrivalInfo t2=lists.get(j);
204   - if(t2.getInOut()==1 && t2.getDeviceId().equals(t1.getDeviceId())
205   - && t2.getStopNo().equals(t1.getStopNo())
206   - && t2.getTs()>t1.getTs()){
207   - t1.setCzsj(sdf.format(new Date(t2.getTs())));
208   - break;
209   - }
210   - }
211   - list.add(t1);
  188 + List<ArrivalInfo> list=new ArrayList<ArrivalInfo>();
  189 + try {
  190 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  191 + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
  192 + Long date1=simpleDateFormat.parse(fcsj+":00").getTime();
  193 + Long date2=simpleDateFormat.parse(ddsj+":00").getTime();
  194 + Date dates1=simpleDateFormat.parse(fcsj+":00");
  195 + Date dates2=simpleDateFormat.parse(ddsj+":00");
  196 + List<ArrivalInfo> lists=load2(line,date1,date2,dates1,dates2,zd,zdlx);
  197 +
  198 + for(int i=0;i<lists.size();i++){
  199 + ArrivalInfo t1=lists.get(i);
  200 + if(t1.getInOut()==0){
  201 + t1.setJzsj(sdf.format(new Date(t1.getTs())));
  202 + for(int j=0;j<lists.size();j++){
  203 + ArrivalInfo t2=lists.get(j);
  204 + if(t2.getInOut()==1 && t2.getDeviceId().equals(t1.getDeviceId())
  205 + && t2.getStopNo().equals(t1.getStopNo())
  206 + && t2.getTs()>t1.getTs()){
  207 + t1.setCzsj(sdf.format(new Date(t2.getTs())));
  208 + break;
212 209 }
213   -
214 210 }
215   -
216   -
217   - } catch (ParseException e) {
218   - // TODO Auto-generated catch block
219   - e.printStackTrace();
  211 + list.add(t1);
220 212 }
221   -
222   - return list;
  213 +
  214 + }
  215 +
  216 +
  217 + } catch (ParseException e) {
  218 + // TODO Auto-generated catch block
  219 + e.printStackTrace();
  220 + }
  221 +
  222 + return list;
223 223 }
224   -
225   -
  224 +
  225 +
226 226 public List<ArrivalInfo> load2(String line,Long date1,Long date2,Date dates1,Date dates2,String zd,String zdlx){
227 227 List<ArrivalInfo> list = null;
228   - Calendar cal = Calendar.getInstance();
229   - cal.setTime(dates1);
230   - //周数,表分区字段
231   - int weeks_year1 = cal.get(Calendar.WEEK_OF_YEAR);
232   - cal.setTime(dates2);
233   - int weeks_year2 = cal.get(Calendar.WEEK_OF_YEAR);
234   - Connection conn = null;
235   - PreparedStatement ps = null;
236   - ResultSet rs = null;
237   -
238   - String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year>=? "
239   - + " AND weeks_year<=? AND ts > ? AND ts <=? AND up_down=? AND stop_no like ? order by ts";
240   - try{
241   - conn = DBUtils_MS.getConnection();
242   - ps = conn.prepareStatement(sql);
243   - ps.setString(1, line);
244   - ps.setInt(2, weeks_year1);
245   - ps.setInt(3, weeks_year2);
246   - ps.setLong(4, date1);
247   - ps.setLong(5, date2);
248   - ps.setString(6, zdlx);
249   - ps.setString(7, "%"+zd+"%");
250   - rs = ps.executeQuery();
251   -
252   - list = resultSet2Set(rs);
253   - }catch(Exception e){
254   - logger.error("", e);
255   - }finally {
256   - DBUtils_MS.close(rs, ps, conn);
257   - }
  228 + Calendar cal = Calendar.getInstance();
  229 + cal.setTime(dates1);
  230 + //周数,表分区字段
  231 + int weeks_year1 = cal.get(Calendar.WEEK_OF_YEAR);
  232 + cal.setTime(dates2);
  233 + int weeks_year2 = cal.get(Calendar.WEEK_OF_YEAR);
  234 + Connection conn = null;
  235 + PreparedStatement ps = null;
  236 + ResultSet rs = null;
  237 +
  238 + String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year>=? "
  239 + + " AND weeks_year<=? AND ts > ? AND ts <=? AND up_down=? AND stop_no like ? order by ts";
  240 + try{
  241 + conn = DBUtils_MS.getConnection();
  242 + ps = conn.prepareStatement(sql);
  243 + ps.setString(1, line);
  244 + ps.setInt(2, weeks_year1);
  245 + ps.setInt(3, weeks_year2);
  246 + ps.setLong(4, date1);
  247 + ps.setLong(5, date2);
  248 + ps.setString(6, zdlx);
  249 + ps.setString(7, "%"+zd+"%");
  250 + rs = ps.executeQuery();
  251 +
  252 + list = resultSet2Set(rs);
  253 + }catch(Exception e){
  254 + logger.error("", e);
  255 + }finally {
  256 + DBUtils_MS.close(rs, ps, conn);
  257 + }
258 258 return list;
259 259 }
260 260 @Override
... ... @@ -285,14 +285,14 @@ public class ReportServiceImpl implements ReportService{
285 285 String sqlPc=" select count(*) from bsth_c_cars where id in("
286 286 + " select cl from bsth_c_s_ccinfo where xl in ( "
287 287 + " select id from bsth_c_line where line_code='"+line+"' )"
288   - + " group by equipment_code ) ";
289   -
  288 + + " group by equipment_code ) ";
  289 +
290 290 Map<String, Object> map=new HashMap<String,Object>();
291   -
  291 +
292 292 /*List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc,
293 293 new RowMapper<Map<String, Object>>(){
294 294 @Override
295   - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  295 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
296 296 Map<String, Object> m=new HashMap<String,Object>();
297 297 m.put("zbh", rs.getString("cl_zbh"));
298 298 return m;
... ... @@ -300,61 +300,61 @@ public class ReportServiceImpl implements ReportService{
300 300 });*/
301 301 //配车
302 302 int pcs=jdbcTemplate.queryForObject(sqlPc, Integer.class);
303   -
  303 +
304 304 String sqlPlan=" SELECT jhlc,bc_type,fcsj FROM bsth_c_s_ttinfo_detail "
305 305 +" where ttinfo ='"+ttinfo+"' ";
306   -
  306 +
307 307 //班次
308 308 int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60;
309 309 int qcBc=0,qjBc=0,zqcBc=0,zqjBc=0,wqcBc=0,wqjBc=0;
310 310 double zlc = 0 , yylc = 0,kslc=0;
311 311 //查询班次
312   - List<Map<String, Object>> listPlan= jdbcTemplate.query(sqlPlan,
  312 + List<Map<String, Object>> listPlan= jdbcTemplate.query(sqlPlan,
313 313 new RowMapper<Map<String, Object>>(){
314   - @Override
315   - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
316   - Map<String, Object> m2=new HashMap<String,Object>();
317   - m2.put("jhlc", rs.getDouble("jhlc"));
318   - m2.put("bcType", rs.getString("bc_type"));
319   - m2.put("fcsj", rs.getString("fcsj"));
320   - return m2;
321   - }
322   - });
323   -
  314 + @Override
  315 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  316 + Map<String, Object> m2=new HashMap<String,Object>();
  317 + m2.put("jhlc", rs.getDouble("jhlc"));
  318 + m2.put("bcType", rs.getString("bc_type"));
  319 + m2.put("fcsj", rs.getString("fcsj"));
  320 + return m2;
  321 + }
  322 + });
  323 +
324 324 for (int i = 0; i < listPlan.size(); i++) {
325 325 Map<String, Object> m=listPlan.get(i);
326   - double jhlc=Double.parseDouble(m.get("jhlc").toString());
  326 + double jhlc=Double.parseDouble(m.get("jhlc").toString());
327 327 String bcType=m.get("bcType").toString();
328 328 String fcsjs[]=m.get("fcsj").toString().split(":");
329   -
  329 +
330 330 zlc +=jhlc;
331 331 if(bcType.equals("in") || bcType.equals("out")){
332 332 kslc+=jhlc;
333 333 }
334 334 else if(bcType.equals("region")){
335 335 qjBc++;
336   - if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
  336 + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
337 337 && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
338 338 zqjBc++;
339   - }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
340   - && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
  339 + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
  340 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
341 341 wqjBc++;
342 342 }
343   -
  343 +
344 344 yylc+=jhlc;
345 345 }else{
346 346 qcBc ++;
347   - if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
  347 + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
348 348 && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
349 349 zqcBc++;
350   - }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
351   - && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
  350 + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
  351 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
352 352 wqcBc++;
353 353 }
354 354 yylc +=jhlc;
355 355 }
356 356 }
357   -
  357 +
358 358 map.put("pcs", pcs);
359 359 map.put("qcbc", qcBc);
360 360 map.put("qjbc", qjBc);
... ... @@ -373,39 +373,39 @@ public class ReportServiceImpl implements ReportService{
373 373 DecimalFormat df = new DecimalFormat("#0.00");
374 374 // TODO Auto-generated method stub
375 375 //最早营运时间 区分夜宵线
376   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
377   - + " id = ("
378   - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'"
379   - + ")";
380   - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  376 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  377 + + " id = ("
  378 + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'"
  379 + + ")";
  380 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
381 381 String[] minSjs = minfcsj.split(":");
382 382 int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
383 383 //查询时间里程
384 384 String sqlPc=" (SELECT jhlc,fcsj,bc_type,lp,2 as xh, ists FROM bsth_c_s_ttinfo_detail "
385   - + " where ttinfo ='"+ttinfo+"' and fcsj <='"+minfcsj+"' ) "
386   - + " union "
387   - + " (SELECT jhlc,fcsj,bc_type,lp,1 as xh, ists FROM bsth_c_s_ttinfo_detail "
388   - + " where ttinfo ='"+ttinfo+"' and fcsj > '"+minfcsj+"') order by lp,xh,fcsj";
389   -
  385 + + " where ttinfo ='"+ttinfo+"' and fcsj <='"+minfcsj+"' ) "
  386 + + " union "
  387 + + " (SELECT jhlc,fcsj,bc_type,lp,1 as xh, ists FROM bsth_c_s_ttinfo_detail "
  388 + + " where ttinfo ='"+ttinfo+"' and fcsj > '"+minfcsj+"') order by lp,xh,fcsj";
  389 +
390 390 Map<String, Object> map=new HashMap<String,Object>();
391 391 List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
392   - new RowMapper<Map<String, Object>>(){
393   - @Override
394   - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
395   - Map<String, Object> m=new HashMap<String,Object>();
396   - m.put("fcsj", rs.getString("fcsj"));
397   - m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc"));
398   - m.put("bcType", rs.getString("bc_type"));
399   - m.put("lp", rs.getString("lp"));
400   - m.put("ists", rs.getObject("ists")==null?"0":rs.getString("ists"));
401   - return m;
402   - }
403   - });
  392 + new RowMapper<Map<String, Object>>(){
  393 + @Override
  394 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  395 + Map<String, Object> m=new HashMap<String,Object>();
  396 + m.put("fcsj", rs.getString("fcsj"));
  397 + m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc"));
  398 + m.put("bcType", rs.getString("bc_type"));
  399 + m.put("lp", rs.getString("lp"));
  400 + m.put("ists", rs.getObject("ists")==null?"0":rs.getString("ists"));
  401 + return m;
  402 + }
  403 + });
404 404 int yysj=0 ;
405 405 double yycs=0 ,yygl=0;
406 406 String lp ="0";
407 407 int sj=0;
408   -
  408 +
409 409 for(int i=0;i<list.size();i++){
410 410 Map<String, Object> m=list.get(i);
411 411 String time=m.get("fcsj").toString();
... ... @@ -421,7 +421,7 @@ public class ReportServiceImpl implements ReportService{
421 421 }
422 422 }else{
423 423 yygl += Double.parseDouble(m.get("yygl").toString());
424   -
  424 +
425 425 if(sj==0){
426 426 sj=(Integer.parseInt(times[0])+24)*60+Integer.parseInt(times[1]);
427 427 }else{
... ... @@ -439,7 +439,7 @@ public class ReportServiceImpl implements ReportService{
439 439 }
440 440 }else{
441 441 yygl += Double.parseDouble(m.get("yygl").toString());
442   -
  442 +
443 443 if(sj==0){
444 444 sj=Integer.parseInt(times[0])*60+Integer.parseInt(times[1]);
445 445 }else{
... ... @@ -456,7 +456,7 @@ public class ReportServiceImpl implements ReportService{
456 456 sj=0;
457 457 }
458 458 lp=m.get("lp").toString();
459   -
  459 +
460 460 }
461 461 if(m.containsKey("ists") && m.get("ists").equals("1")){
462 462 sj = 0;
... ... @@ -467,105 +467,105 @@ public class ReportServiceImpl implements ReportService{
467 467 }
468 468 int hh=yysj/60;
469 469 int mm=yysj%60;
470   -
  470 +
471 471 map.put("yysj", hh+":"+mm);
472 472 map.put("yycs", df.format(yycs)+"公里/小时");
473 473 // map.put(key, value)
474 474 return map;
475 475 }
476   -
  476 +
477 477 public static void main(String[] args) {
478 478 System.out.println(609360/60);
479 479 System.out.println(609360%60);
480 480 }
481   -/* @Override
482   - public List<Map<String, Object>> tbodyTime3(String line, String ttinfo) {
483   - // TODO Auto-generated method stub
484   - List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
485   -
  481 + /* @Override
  482 + public List<Map<String, Object>> tbodyTime3(String line, String ttinfo) {
  483 + // TODO Auto-generated method stub
  484 + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
486 485  
487 486  
488   - String sqlZd="select a.qdz_name,COUNT(a.cl_zbh) as cls,'zqc' AS lx from ("
489   - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"' "
490   - + " and bc_type ='normal'"
491   - + " and ((fcsj >'06:31' and fcsj<'08:30') or ( fcsj>'6:31' and fcsj<'8:30'))"
492   - + " group by cl_zbh,qdz_name) a group by a.qdz_name"
493   - + " union "
494   - + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'wqc' AS lx from ("
495   - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"
496   - + " and bc_type ='normal' "
497   - + " and fcsj >'16:01' and fcsj<'18:00' group by cl_zbh,qdz_name "
498   - + " ) a group by a.qdz_name "
499   - + " union "
500   - + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'zqj' AS lx from ("
501   - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"
502   - + " and bc_type ='region' "
503   - + " and ((fcsj >'06:31' and fcsj<'08:30') or ( fcsj>'6:31' and fcsj<'8:30'))"
504   - + " group by cl_zbh,qdz_name) a group by a.qdz_name"
505   - + " union "
506   - + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'wqj' AS lx from ("
507   - + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"
508   - + " and bc_type ='region' and fcsj >'16:01' and fcsj<'18:00'"
509   - + " group by cl_zbh,qdz_name) a group by a.qdz_name";
510   - List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd,
511   - new RowMapper<Map<String, Object>>(){
512   - @Override
513   - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
514   - Map<String, Object> m=new HashMap<String,Object>();
515   - m.put("zdm", rs.getString("qdz_name"));
516   - m.put("cls", rs.getString("cls"));
517   - m.put("lx", rs.getString("lx"));
518   - return m;
519   - }
520   - });
521   - int a=0;
522   - int b=0;
523   - int c=0;
524   - int d=0;
525   - for(int i=0;i<lists.size();i++){
526   - boolean fage=true;
527   - Map<String, Object> newMap= new HashMap<String, Object>();
528   - list.add(newMap);
529   - Map<String, Object> maps=lists.get(i);
530   - if(maps.get("lx").equals("zqc")){
531   - list.get(a).put("zqcZm", maps.get("zdm"));
532   - list.get(a).put("zqcCls", maps.get("cls"));
533   - a++;
534   - fage=false;
535   - }else if(maps.get("lx").equals("wqc")){
536   - list.get(b).put("wqcZm", maps.get("zdm"));
537   - list.get(b).put("wqcCls", maps.get("cls"));
538   - b++;
539   - fage=false;
540   - }else if(maps.get("lx").equals("zqj")){
541   - list.get(c).put("zqjZm", maps.get("zdm"));
542   - list.get(c).put("zqjCls", maps.get("cls"));
543   - c++;
544   - fage=false;
545   - }else if(maps.get("lx").equals("wqj")){
546   - list.get(d).put("wqjZm", maps.get("zdm"));
547   - list.get(d).put("wqjCls", maps.get("cls"));
548   - d++;
549   - fage=false;
550   - }
551   - if(fage){
552   - break;
553   - }
554   - }
555   - boolean status=true;
556   - while (status) {
557   - for (int i = 0; i < list.size(); i++) {
558   - if(list.get(i).isEmpty()){
559   - list.remove(i);
560   - status=true;
561   - }else{
562   - status=false;
563   - }
564   - }
565   -
566   - }
567   - return list;
568   - }*/
  487 +
  488 + String sqlZd="select a.qdz_name,COUNT(a.cl_zbh) as cls,'zqc' AS lx from ("
  489 + + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"' "
  490 + + " and bc_type ='normal'"
  491 + + " and ((fcsj >'06:31' and fcsj<'08:30') or ( fcsj>'6:31' and fcsj<'8:30'))"
  492 + + " group by cl_zbh,qdz_name) a group by a.qdz_name"
  493 + + " union "
  494 + + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'wqc' AS lx from ("
  495 + + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"
  496 + + " and bc_type ='normal' "
  497 + + " and fcsj >'16:01' and fcsj<'18:00' group by cl_zbh,qdz_name "
  498 + + " ) a group by a.qdz_name "
  499 + + " union "
  500 + + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'zqj' AS lx from ("
  501 + + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"
  502 + + " and bc_type ='region' "
  503 + + " and ((fcsj >'06:31' and fcsj<'08:30') or ( fcsj>'6:31' and fcsj<'8:30'))"
  504 + + " group by cl_zbh,qdz_name) a group by a.qdz_name"
  505 + + " union "
  506 + + " select a.qdz_name,COUNT(a.cl_zbh) as cls,'wqj' AS lx from ("
  507 + + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"
  508 + + " and bc_type ='region' and fcsj >'16:01' and fcsj<'18:00'"
  509 + + " group by cl_zbh,qdz_name) a group by a.qdz_name";
  510 + List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd,
  511 + new RowMapper<Map<String, Object>>(){
  512 + @Override
  513 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  514 + Map<String, Object> m=new HashMap<String,Object>();
  515 + m.put("zdm", rs.getString("qdz_name"));
  516 + m.put("cls", rs.getString("cls"));
  517 + m.put("lx", rs.getString("lx"));
  518 + return m;
  519 + }
  520 + });
  521 + int a=0;
  522 + int b=0;
  523 + int c=0;
  524 + int d=0;
  525 + for(int i=0;i<lists.size();i++){
  526 + boolean fage=true;
  527 + Map<String, Object> newMap= new HashMap<String, Object>();
  528 + list.add(newMap);
  529 + Map<String, Object> maps=lists.get(i);
  530 + if(maps.get("lx").equals("zqc")){
  531 + list.get(a).put("zqcZm", maps.get("zdm"));
  532 + list.get(a).put("zqcCls", maps.get("cls"));
  533 + a++;
  534 + fage=false;
  535 + }else if(maps.get("lx").equals("wqc")){
  536 + list.get(b).put("wqcZm", maps.get("zdm"));
  537 + list.get(b).put("wqcCls", maps.get("cls"));
  538 + b++;
  539 + fage=false;
  540 + }else if(maps.get("lx").equals("zqj")){
  541 + list.get(c).put("zqjZm", maps.get("zdm"));
  542 + list.get(c).put("zqjCls", maps.get("cls"));
  543 + c++;
  544 + fage=false;
  545 + }else if(maps.get("lx").equals("wqj")){
  546 + list.get(d).put("wqjZm", maps.get("zdm"));
  547 + list.get(d).put("wqjCls", maps.get("cls"));
  548 + d++;
  549 + fage=false;
  550 + }
  551 + if(fage){
  552 + break;
  553 + }
  554 + }
  555 + boolean status=true;
  556 + while (status) {
  557 + for (int i = 0; i < list.size(); i++) {
  558 + if(list.get(i).isEmpty()){
  559 + list.remove(i);
  560 + status=true;
  561 + }else{
  562 + status=false;
  563 + }
  564 + }
  565 +
  566 + }
  567 + return list;
  568 + }*/
569 569 @Override
570 570 public List<Map<String, Object>> tbodyTime3(String line, String ttinfo) {
571 571 // TODO Auto-generated method stub
... ... @@ -595,39 +595,39 @@ public class ReportServiceImpl implements ReportService{
595 595 + " select cl_zbh,qdz_name from bsth_c_s_sp_info where tt_info ='"+ttinfo+"'"
596 596 + " and bc_type ='region' and fcsj >'16:01' and fcsj<'18:00'"
597 597 + " group by cl_zbh,qdz_name) a group by a.qdz_name";*/
598   -
599   - String sqlCl="SELECT cl_zbh,qdz_name,bc_type,fcsj,bcsj FROM"
600   - + " bsth_c_s_sp_info WHERE tt_info = '"+ttinfo+"' "
601   - + " AND (bc_type = 'normal' or bc_type='region') order by qdz_name";
602   -
603   - List<Map<String, Object>> listj= jdbcTemplate.query(sqlCl,
604   - new RowMapper<Map<String, Object>>(){
605   - @Override
606   - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
607   - Map<String, Object> m=new HashMap<String,Object>();
608   - m.put("cl_zbh", rs.getString("cl_zbh"));
609   - m.put("qdz_name", rs.getString("qdz_name"));
610   - m.put("bcType", rs.getString("bc_type"));
611   - m.put("fcsj", rs.getString("fcsj"));
612   - m.put("bcsj", rs.getString("bcsj"));
613   - return m;
614   - }
615   - });
616   -
617   - String sqlZd="select qdz_name ,bc_type from bsth_c_s_sp_info WHERE tt_info = '"+ttinfo+"' "
618   - + " AND (bc_type = 'normal' or bc_type='region') group by qdz_name ,bc_type "
619   - + " order by qdz_name";
  598 +
  599 + String sqlCl="SELECT cl_zbh,qdz_name,bc_type,fcsj,bcsj FROM"
  600 + + " bsth_c_s_sp_info WHERE tt_info = '"+ttinfo+"' "
  601 + + " AND (bc_type = 'normal' or bc_type='region') order by qdz_name";
  602 +
  603 + List<Map<String, Object>> listj= jdbcTemplate.query(sqlCl,
  604 + new RowMapper<Map<String, Object>>(){
  605 + @Override
  606 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  607 + Map<String, Object> m=new HashMap<String,Object>();
  608 + m.put("cl_zbh", rs.getString("cl_zbh"));
  609 + m.put("qdz_name", rs.getString("qdz_name"));
  610 + m.put("bcType", rs.getString("bc_type"));
  611 + m.put("fcsj", rs.getString("fcsj"));
  612 + m.put("bcsj", rs.getString("bcsj"));
  613 + return m;
  614 + }
  615 + });
  616 +
  617 + String sqlZd="select qdz_name ,bc_type from bsth_c_s_sp_info WHERE tt_info = '"+ttinfo+"' "
  618 + + " AND (bc_type = 'normal' or bc_type='region') group by qdz_name ,bc_type "
  619 + + " order by qdz_name";
620 620 List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd,
621   - new RowMapper<Map<String, Object>>(){
622   - @Override
623   - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
624   - Map<String, Object> m=new HashMap<String,Object>();
625   - m.put("zdm", rs.getString("qdz_name"));
626   - m.put("bcType", rs.getString("bc_type"));
627   - return m;
628   - }
629   - });
630   -
  621 + new RowMapper<Map<String, Object>>(){
  622 + @Override
  623 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  624 + Map<String, Object> m=new HashMap<String,Object>();
  625 + m.put("zdm", rs.getString("qdz_name"));
  626 + m.put("bcType", rs.getString("bc_type"));
  627 + return m;
  628 + }
  629 + });
  630 +
631 631 for (int i = 0; i < lists.size(); i++) {
632 632 Map<String, Object> z=new HashMap<String,Object>();
633 633 Map<String, Object> w=new HashMap<String,Object>();
... ... @@ -636,7 +636,7 @@ public class ReportServiceImpl implements ReportService{
636 636 int wbcs=0;
637 637 if(p.get("bcType").toString().equals("normal")){
638 638 for (int j = 0; j < listj.size(); j++) {
639   - if(listj.get(j).get("qdz_name").toString().equals(p.get("zdm").toString()) &&
  639 + if(listj.get(j).get("qdz_name").toString().equals(p.get("zdm").toString()) &&
640 640 listj.get(j).get("bcType").toString().equals("normal")){
641 641 String time=listj.get(j).get("fcsj").toString();
642 642 long bcsj= Long.parseLong(listj.get(j).get("bcsj").toString());
... ... @@ -644,15 +644,15 @@ public class ReportServiceImpl implements ReportService{
644 644 String[] fcsjStr = time.split(":");
645 645 long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
646 646 long ddsj=fcsj+bcsj;
647   - if((fcsj>=zgf1 && fcsj<=zgf2) || (ddsj>=zgf1&&ddsj<=zgf2)
  647 + if((fcsj>=zgf1 && fcsj<=zgf2) || (ddsj>=zgf1&&ddsj<=zgf2)
648 648 || (fcsj<zgf1&&ddsj>zgf2)){
649 649 if(p.get("z"+clZbh)==null){
650 650 zbcs++;
651 651 p.put("z"+clZbh, clZbh);
652 652 }
653 653 }
654   -
655   - if((fcsj>=wgf1 && fcsj<=wgf2) || (ddsj>=wgf1&&ddsj<=wgf2)
  654 +
  655 + if((fcsj>=wgf1 && fcsj<=wgf2) || (ddsj>=wgf1&&ddsj<=wgf2)
656 656 || (fcsj<wgf1&&ddsj>wgf2)){
657 657 if(p.get("w"+clZbh)==null){
658 658 wbcs++;
... ... @@ -660,26 +660,26 @@ public class ReportServiceImpl implements ReportService{
660 660 }
661 661 }
662 662 }
663   -
  663 +
664 664 }
665 665 if(zbcs>0){
666   - z.put("zdm", p.get("zdm"));
667   - z.put("cls", zbcs);
668   - z.put("lx", "zqc");
669   - list_s.add(z);
  666 + z.put("zdm", p.get("zdm"));
  667 + z.put("cls", zbcs);
  668 + z.put("lx", "zqc");
  669 + list_s.add(z);
670 670 }
671 671 if(wbcs>0){
672 672 w.put("zdm", p.get("zdm"));
673   - w.put("cls", zbcs);
674   - w.put("lx", "wqc");
675   - list_s.add(w);
  673 + w.put("cls", zbcs);
  674 + w.put("lx", "wqc");
  675 + list_s.add(w);
676 676 }
677   -
  677 +
678 678 }
679   -
  679 +
680 680 if(p.get("bcType").equals("region")){
681 681 for (int j = 0; j < listj.size(); j++) {
682   - if(listj.get(j).get("qdz_name").toString().equals(p.get("zdm").toString()) &&
  682 + if(listj.get(j).get("qdz_name").toString().equals(p.get("zdm").toString()) &&
683 683 listj.get(j).get("bcType").toString().equals("region")){
684 684 String time=listj.get(j).get("fcsj").toString();
685 685 long bcsj= Long.parseLong(listj.get(j).get("bcsj").toString());
... ... @@ -687,15 +687,15 @@ public class ReportServiceImpl implements ReportService{
687 687 String[] fcsjStr = time.split(":");
688 688 long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
689 689 long ddsj=fcsj+bcsj;
690   - if((fcsj>=zgf1 && fcsj<=zgf2) || (ddsj>=zgf1&&ddsj<=zgf2)
  690 + if((fcsj>=zgf1 && fcsj<=zgf2) || (ddsj>=zgf1&&ddsj<=zgf2)
691 691 || (fcsj<zgf1&&ddsj>zgf2)){
692 692 if(p.get("z"+clZbh)==null){
693 693 zbcs++;
694 694 p.put("z"+clZbh, clZbh);
695 695 }
696 696 }
697   -
698   - if((fcsj>=wgf1 && fcsj<=wgf2) || (ddsj>=wgf1&&ddsj<=wgf2)
  697 +
  698 + if((fcsj>=wgf1 && fcsj<=wgf2) || (ddsj>=wgf1&&ddsj<=wgf2)
699 699 || (fcsj<wgf1&&ddsj>wgf2)){
700 700 if(p.get("w"+clZbh)==null){
701 701 wbcs++;
... ... @@ -703,22 +703,22 @@ public class ReportServiceImpl implements ReportService{
703 703 }
704 704 }
705 705 }
706   -
  706 +
707 707 }
708 708 if(zbcs>0){
709   - z.put("zdm", p.get("zdm"));
710   - z.put("cls", zbcs);
711   - z.put("lx", "zqj");
712   - list_s.add(z);
  709 + z.put("zdm", p.get("zdm"));
  710 + z.put("cls", zbcs);
  711 + z.put("lx", "zqj");
  712 + list_s.add(z);
713 713 }
714 714 if(wbcs>0){
715   - w.put("zdm", p.get("zdm"));
716   - w.put("cls", zbcs);
717   - w.put("lx", "wqj");
718   - list_s.add(w);
  715 + w.put("zdm", p.get("zdm"));
  716 + w.put("cls", zbcs);
  717 + w.put("lx", "wqj");
  718 + list_s.add(w);
719 719 }
720 720 }
721   -
  721 +
722 722 }
723 723 int a=0;
724 724 int b=0;
... ... @@ -764,47 +764,47 @@ public class ReportServiceImpl implements ReportService{
764 764 status=false;
765 765 }
766 766 }
767   -
  767 +
768 768 }
769 769 return list;
770 770 }
771   -
  771 +
772 772 @Override
773 773 public List<Map<String, Object>> tbodyTime4(String line, String ttinfo) {
774 774 List<Map<String, Object>> list =new ArrayList<>();
775 775 // TODO Auto-generated method stub
776 776 //最早营运时间 区分夜宵线
777   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
778   - + " id = ("
779   - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'"
780   - + ")";
781   - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
782   -
  777 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  778 + + " id = ("
  779 + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'"
  780 + + ")";
  781 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  782 +
783 783 //查询全程
784 784 String sqlqc="select t.* from ( "
785   - + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
786   - + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
787   - + " and fcsj <='"+minfcsj+"') "
788   - + " union "
789   - + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
790   - + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
791   - + " and fcsj > '"+minfcsj+"') "
792   - + "order by xl_dir,xh,fcsj ) t ";
  785 + + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
  786 + + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
  787 + + " and fcsj <='"+minfcsj+"') "
  788 + + " union "
  789 + + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
  790 + + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
  791 + + " and fcsj > '"+minfcsj+"') "
  792 + + "order by xl_dir,xh,fcsj ) t ";
793 793 List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc,
794   - new RowMapper<Map<String, String>>(){
795   - @Override
796   - public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException {
797   - Map<String, String> m=new HashMap<String,String>();
798   - m.put("qdz_name", rs.getString("qdz_name"));
799   - m.put("bcType", rs.getString("bc_type"));
800   - m.put("fcsj", rs.getString("fcsj"));
801   - m.put("xl", rs.getString("xl_dir"));
802   - m.put("xh", rs.getString("xh"));
803   - return m;
804   - }
805   -
806   - });
807   -
  794 + new RowMapper<Map<String, String>>(){
  795 + @Override
  796 + public Map<String, String> mapRow(ResultSet rs, int rowNum) throws SQLException {
  797 + Map<String, String> m=new HashMap<String,String>();
  798 + m.put("qdz_name", rs.getString("qdz_name"));
  799 + m.put("bcType", rs.getString("bc_type"));
  800 + m.put("fcsj", rs.getString("fcsj"));
  801 + m.put("xl", rs.getString("xl_dir"));
  802 + m.put("xh", rs.getString("xh"));
  803 + return m;
  804 + }
  805 +
  806 + });
  807 +
808 808 List<List<Map<String, String>>> mapList = new ArrayList<List<Map<String,String>>>();
809 809 mapList.add(new ArrayList<Map<String, String>>());
810 810 mapList.add(new ArrayList<Map<String, String>>());
... ... @@ -816,7 +816,7 @@ public class ReportServiceImpl implements ReportService{
816 816 mapList.get(1).add(m);
817 817 }
818 818 }
819   -
  819 +
820 820 for(int i = 0; i < mapList.size(); i++){
821 821 List<Map<String, String>> l = mapList.get(i);
822 822 Map<String, Object> tempMap = new HashMap<String, Object>();
... ... @@ -852,33 +852,33 @@ public class ReportServiceImpl implements ReportService{
852 852 if(sxqdz.length()!=0 || xxqdz.length()!=0)
853 853 list.add(tempMap);
854 854 }
855   -
  855 +
856 856 return list;
857 857 }
858 858 @Override
859 859 public List<Map<String, Object>> tbodyTime5(String line, String ttinfo) {
860 860 // TODO Auto-generated method stub
861 861 //最早营运时间 区分夜宵线
862   - String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'";
863   - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
864   - String[] minSjs = minfcsj.split(":");
865   - int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
866   - //查询时间里程
867   - String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,2 as xh FROM "
868   - + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
869   - + " fcsj <='"+minfcsj+"' and bc_type!='ldks'"
870   - + " and bc_type !='region') "
871   - + " union "
872   - + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,1 as xh FROM "
873   - + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
874   - + " fcsj > '"+minfcsj+"' and bc_type!='ldks' "
875   - + " and bc_type !='region') "
876   - + " order by xh, lp,fcsj";
877   - Map<String, Object> map=new HashMap<String,Object>();
878   - List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
879   - new RowMapper<Map<String, Object>>(){
  862 + String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'";
  863 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  864 + String[] minSjs = minfcsj.split(":");
  865 + int minSj=Integer.parseInt(minSjs[0])*60+Integer.parseInt(minSjs[1]);
  866 + //查询时间里程
  867 + String sqlPc=" (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,2 as xh FROM "
  868 + + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
  869 + + " fcsj <='"+minfcsj+"' and bc_type!='ldks'"
  870 + + " and bc_type !='region') "
  871 + + " union "
  872 + + " (SELECT jhlc,fcsj,bcsj,bc_type,lp,xl_dir,ists,1 as xh FROM "
  873 + + " bsth_c_s_ttinfo_detail where ttinfo ='"+ttinfo+"' and "
  874 + + " fcsj > '"+minfcsj+"' and bc_type!='ldks' "
  875 + + " and bc_type !='region') "
  876 + + " order by xh, lp,fcsj";
  877 + Map<String, Object> map=new HashMap<String,Object>();
  878 + List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
  879 + new RowMapper<Map<String, Object>>(){
880 880 @Override
881   - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  881 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
882 882 Map<String, Object> m=new HashMap<String,Object>();
883 883 m.put("fcsj", rs.getString("fcsj"));
884 884 m.put("yygl", rs.getString("jhlc")==null?"0":rs.getString("jhlc"));
... ... @@ -891,11 +891,11 @@ public class ReportServiceImpl implements ReportService{
891 891 if(rs.getString("xh").equals("2")){
892 892 m.put("fcsj", (Integer.valueOf(split[0]) + 24) + ":"+split[1]);
893 893 }
894   -
  894 +
895 895 return m;
896 896 }
897 897 });
898   - List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>();
  898 + List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>();
899 899 int yysxZq=0,yyxxZq=0,tzsxZq=0,tzxxZq=0,minZqcj=0,maxZqcj=0,sxcountZqbc=0,xxcountZqbc=0; //早前
900 900 int yysxZgf=0,yyxxZgf=0,tzsxZgf=0,tzxxZgf=0,minZgfcj=0,maxZgfcj=0,sxcountZgfbc=0,xxcountZgfbc=0;//早高峰
901 901 int yysxZw=0,yyxxZw=0,tzsxZw=0,tzxxZw=0,minZwcj=0,maxZwcj=0,sxcountZwbc=0,xxcountZwbc=0;//中午
... ... @@ -906,7 +906,7 @@ public class ReportServiceImpl implements ReportService{
906 906 List<Integer> zwFcsj0=new ArrayList<Integer>();
907 907 List<Integer> wgfFcsj0=new ArrayList<Integer>();
908 908 List<Integer> whFcsj0=new ArrayList<Integer>();
909   -
  909 +
910 910 List<Integer> zqFcsj1=new ArrayList<Integer>();
911 911 List<Integer> zgfFcsj1=new ArrayList<Integer>();
912 912 List<Integer> zwFcsj1=new ArrayList<Integer>();
... ... @@ -944,141 +944,141 @@ public class ReportServiceImpl implements ReportService{
944 944 ists=false;
945 945 }else{
946 946 // if(xlDir==0){
947   - //上行数据
948   - if(fcsjT>= minSj && fcsjT <= 6*60+30){
949   - //早高峰前
950   - if(xlDir==0){
951   - yysxZq +=bcsj;
952   - sxcountZqbc ++;
953   - zqFcsj0.add(fcsjT);
  947 + //上行数据
  948 + if(fcsjT>= minSj && fcsjT <= 6*60+30){
  949 + //早高峰前
  950 + if(xlDir==0){
  951 + yysxZq +=bcsj;
  952 + sxcountZqbc ++;
  953 + zqFcsj0.add(fcsjT);
  954 + }else{
  955 + yyxxZq +=bcsj;
  956 + xxcountZqbc ++;
  957 + zqFcsj1.add(fcsjT);
  958 + }
  959 + if(ists){
  960 + if(lpname.equals(m.get("lp").toString())){
  961 + if(dir==0)
  962 + tzsxZq +=fcsjT-temp;
  963 + else
  964 + tzxxZq +=fcsjT-temp;
  965 + }
  966 + }
  967 + temp = fcsjT+bcsj;
  968 +
  969 + }else if(fcsjT > 6*60+30 && fcsjT <= 8*60+30){
  970 + //早高峰
  971 + if(xlDir==0){
  972 + yysxZgf +=bcsj;
  973 + sxcountZgfbc ++;
  974 + zgfFcsj0.add(fcsjT);
  975 + }else{
  976 + yyxxZgf +=bcsj;
  977 + xxcountZgfbc ++;
  978 + zgfFcsj1.add(fcsjT);
  979 + }
  980 +
  981 + if(ists){
  982 + if(lpname.equals(m.get("lp").toString())){
  983 + if(dir==0){
  984 + if(fcsjT_>= minSj && fcsjT_ <= 6*60+30)
  985 + tzsxZq +=fcsjT-temp;
  986 + else
  987 + tzsxZgf +=fcsjT-temp;
954 988 }else{
955   - yyxxZq +=bcsj;
956   - xxcountZqbc ++;
957   - zqFcsj1.add(fcsjT);
958   - }
959   - if(ists){
960   - if(lpname.equals(m.get("lp").toString())){
961   - if(dir==0)
962   - tzsxZq +=fcsjT-temp;
963   - else
964   - tzxxZq +=fcsjT-temp;
965   - }
966   - }
967   - temp = fcsjT+bcsj;
968   -
969   - }else if(fcsjT > 6*60+30 && fcsjT <= 8*60+30){
970   - //早高峰
971   - if(xlDir==0){
972   - yysxZgf +=bcsj;
973   - sxcountZgfbc ++;
974   - zgfFcsj0.add(fcsjT);
975   - }else{
976   - yyxxZgf +=bcsj;
977   - xxcountZgfbc ++;
978   - zgfFcsj1.add(fcsjT);
979   - }
980   -
981   - if(ists){
982   - if(lpname.equals(m.get("lp").toString())){
983   - if(dir==0){
984   - if(fcsjT_>= minSj && fcsjT_ <= 6*60+30)
985   - tzsxZq +=fcsjT-temp;
986   - else
987   - tzsxZgf +=fcsjT-temp;
988   - }else{
989   - if(fcsjT_>= minSj && fcsjT_ <= 6*60+30)
990   - tzxxZq +=fcsjT-temp;
991   - else
992   - tzxxZgf +=fcsjT-temp;
993   - }
994   - }
  989 + if(fcsjT_>= minSj && fcsjT_ <= 6*60+30)
  990 + tzxxZq +=fcsjT-temp;
  991 + else
  992 + tzxxZgf +=fcsjT-temp;
995 993 }
996   - temp =fcsjT+bcsj;
997   -
998   - }else if(fcsjT > 8*60+30 && fcsjT <= 16*60){
999   - //中午
1000   - if(xlDir==0){
1001   - yysxZw +=bcsj;
1002   - sxcountZwbc ++;
1003   - zwFcsj0.add(fcsjT);
  994 + }
  995 + }
  996 + temp =fcsjT+bcsj;
  997 +
  998 + }else if(fcsjT > 8*60+30 && fcsjT <= 16*60){
  999 + //中午
  1000 + if(xlDir==0){
  1001 + yysxZw +=bcsj;
  1002 + sxcountZwbc ++;
  1003 + zwFcsj0.add(fcsjT);
  1004 + }else{
  1005 + yyxxZw +=bcsj;
  1006 + xxcountZwbc ++;
  1007 + zwFcsj1.add(fcsjT);
  1008 + }
  1009 + if(ists){
  1010 + if(lpname.equals(m.get("lp").toString())){
  1011 + if(dir==0){
  1012 + if(fcsjT_ > 6*60+30 && fcsjT_ <= 8*60+30)
  1013 + tzsxZgf +=fcsjT-temp;
  1014 + else
  1015 + tzsxZw +=fcsjT-temp;
1004 1016 }else{
1005   - yyxxZw +=bcsj;
1006   - xxcountZwbc ++;
1007   - zwFcsj1.add(fcsjT);
1008   - }
1009   - if(ists){
1010   - if(lpname.equals(m.get("lp").toString())){
1011   - if(dir==0){
1012   - if(fcsjT_ > 6*60+30 && fcsjT_ <= 8*60+30)
1013   - tzsxZgf +=fcsjT-temp;
1014   - else
1015   - tzsxZw +=fcsjT-temp;
1016   - }else{
1017   - if(fcsjT_ > 6*60+30 && fcsjT_ <= 8*60+30)
1018   - tzxxZgf +=fcsjT-temp;
1019   - else
1020   - tzxxZw +=fcsjT-temp;
1021   - }
1022   - }
  1017 + if(fcsjT_ > 6*60+30 && fcsjT_ <= 8*60+30)
  1018 + tzxxZgf +=fcsjT-temp;
  1019 + else
  1020 + tzxxZw +=fcsjT-temp;
1023 1021 }
1024   - temp =fcsjT+bcsj;
1025   - }else if(fcsjT > 16*60 && fcsjT <= 18*60){
1026   - //晚高峰
1027   - if(xlDir==0){
1028   - yysxWgf +=bcsj;
1029   - sxcountWgfbc ++;
1030   - wgfFcsj0.add(fcsjT);
  1022 + }
  1023 + }
  1024 + temp =fcsjT+bcsj;
  1025 + }else if(fcsjT > 16*60 && fcsjT <= 18*60){
  1026 + //晚高峰
  1027 + if(xlDir==0){
  1028 + yysxWgf +=bcsj;
  1029 + sxcountWgfbc ++;
  1030 + wgfFcsj0.add(fcsjT);
  1031 + }else{
  1032 + yyxxWgf +=bcsj;
  1033 + xxcountWgfbc ++;
  1034 + wgfFcsj1.add(fcsjT);
  1035 + }
  1036 +
  1037 + if(ists){
  1038 + if(lpname.equals(m.get("lp").toString())){
  1039 + if(dir==0){
  1040 + if(fcsjT_ > 8*60+30 && fcsjT_ <= 16*60)
  1041 + tzsxZw +=fcsjT-temp;
  1042 + else
  1043 + tzsxWgf +=fcsjT-temp;
1031 1044 }else{
1032   - yyxxWgf +=bcsj;
1033   - xxcountWgfbc ++;
1034   - wgfFcsj1.add(fcsjT);
1035   - }
1036   -
1037   - if(ists){
1038   - if(lpname.equals(m.get("lp").toString())){
1039   - if(dir==0){
1040   - if(fcsjT_ > 8*60+30 && fcsjT_ <= 16*60)
1041   - tzsxZw +=fcsjT-temp;
1042   - else
1043   - tzsxWgf +=fcsjT-temp;
1044   - }else{
1045   - if(fcsjT_ > 8*60+30 && fcsjT_ <= 16*60)
1046   - tzxxZw +=fcsjT-temp;
1047   - else
1048   - tzxxWgf +=fcsjT-temp;
1049   - }
1050   - }
  1045 + if(fcsjT_ > 8*60+30 && fcsjT_ <= 16*60)
  1046 + tzxxZw +=fcsjT-temp;
  1047 + else
  1048 + tzxxWgf +=fcsjT-temp;
1051 1049 }
1052   - temp =fcsjT+bcsj;
1053   - }else{
1054   - //晚高峰后
1055   - if(xlDir==0){
1056   - yysxWh +=bcsj;
1057   - sxcountWhbc ++;
1058   - whFcsj0.add(fcsjT);
  1050 + }
  1051 + }
  1052 + temp =fcsjT+bcsj;
  1053 + }else{
  1054 + //晚高峰后
  1055 + if(xlDir==0){
  1056 + yysxWh +=bcsj;
  1057 + sxcountWhbc ++;
  1058 + whFcsj0.add(fcsjT);
  1059 + }else{
  1060 + yyxxWh +=bcsj;
  1061 + xxcountWhbc ++;
  1062 + whFcsj1.add(fcsjT);
  1063 + }
  1064 + if(ists){
  1065 + if(lpname.equals(m.get("lp").toString())){
  1066 + if(dir==0){
  1067 + if(fcsjT_ > 16*60 && fcsjT_ <= 18*60)
  1068 + tzsxWgf +=fcsjT-temp;
  1069 + else
  1070 + tzsxWh +=fcsjT-temp;
1059 1071 }else{
1060   - yyxxWh +=bcsj;
1061   - xxcountWhbc ++;
1062   - whFcsj1.add(fcsjT);
1063   - }
1064   - if(ists){
1065   - if(lpname.equals(m.get("lp").toString())){
1066   - if(dir==0){
1067   - if(fcsjT_ > 16*60 && fcsjT_ <= 18*60)
1068   - tzsxWgf +=fcsjT-temp;
1069   - else
1070   - tzsxWh +=fcsjT-temp;
1071   - }else{
1072   - if(fcsjT_ > 16*60 && fcsjT_ <= 18*60)
1073   - tzxxWgf +=fcsjT-temp;
1074   - else
1075   - tzxxWh +=fcsjT-temp;
1076   - }
1077   - }
  1072 + if(fcsjT_ > 16*60 && fcsjT_ <= 18*60)
  1073 + tzxxWgf +=fcsjT-temp;
  1074 + else
  1075 + tzxxWh +=fcsjT-temp;
1078 1076 }
1079   - temp =fcsjT+bcsj;
1080 1077 }
1081   -
  1078 + }
  1079 + temp =fcsjT+bcsj;
  1080 + }
  1081 +
1082 1082 /*}else{
1083 1083 //下行数据
1084 1084 if(fcsjT>= minSj && fcsjT <= 6*60+30){
... ... @@ -1151,19 +1151,19 @@ public class ReportServiceImpl implements ReportService{
1151 1151 }
1152 1152 // }
1153 1153 }*/
1154   - lpname=m.get("lp").toString();
1155   - fcsjT_=fcsjT;
1156   - dir =xlDir;
1157   - if(m.get("ists").toString().trim().equals("1")){
1158   - ists=false;
1159   - }else{
1160   - ists = true;
1161   - }
1162   - }
  1154 + lpname=m.get("lp").toString();
  1155 + fcsjT_=fcsjT;
  1156 + dir =xlDir;
  1157 + if(m.get("ists").toString().trim().equals("1")){
  1158 + ists=false;
  1159 + }else{
  1160 + ists = true;
  1161 + }
  1162 + }
1163 1163 }
1164   -
  1164 +
1165 1165 }
1166   -
  1166 +
1167 1167 //---------------------------------------早前
1168 1168 List<Integer> cjs = new ArrayList<Integer>();
1169 1169 Collections.sort(zqFcsj0);
... ... @@ -1175,7 +1175,7 @@ public class ReportServiceImpl implements ReportService{
1175 1175 cjs.add(zqFcsj0.get(i)-fcsjs);
1176 1176 fcsjs=zqFcsj0.get(i);
1177 1177 }
1178   -
  1178 +
1179 1179 }
1180 1180 Collections.sort(zqFcsj1);
1181 1181 int fcsjx=0;
... ... @@ -1186,7 +1186,7 @@ public class ReportServiceImpl implements ReportService{
1186 1186 cjs.add(zqFcsj1.get(i)-fcsjx);
1187 1187 fcsjx =zqFcsj1.get(i);
1188 1188 }
1189   -
  1189 +
1190 1190 }
1191 1191 Collections.sort(cjs);
1192 1192 for(int i : cjs){
... ... @@ -1199,7 +1199,7 @@ public class ReportServiceImpl implements ReportService{
1199 1199 sxtszq=Arith.div(tzsxZq, sxcountZqbc, 1);
1200 1200 sxsjzq=Arith.div(yysxZq, sxcountZqbc,1);
1201 1201 }
1202   -
  1202 +
1203 1203 double xxtszq=0.0;
1204 1204 double xxsjzq=0.0;
1205 1205 if(xxcountZqbc>0){
... ... @@ -1215,13 +1215,13 @@ public class ReportServiceImpl implements ReportService{
1215 1215 tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
1216 1216 tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
1217 1217 newList.add(tempMap);
1218   -
  1218 +
1219 1219 //----------------------------------早高峰
1220 1220 cjs = new ArrayList<Integer>();
1221 1221 zcj =0;
1222   -
  1222 +
1223 1223 Collections.sort(zgfFcsj0);
1224   - fcsjs=0;
  1224 + fcsjs=0;
1225 1225 for (int i = 0; i < zgfFcsj0.size(); i++) {
1226 1226 if(i==0){
1227 1227 fcsjs =zgfFcsj0.get(i);
... ... @@ -1229,10 +1229,10 @@ public class ReportServiceImpl implements ReportService{
1229 1229 cjs.add(zgfFcsj0.get(i)-fcsjs);
1230 1230 fcsjs=zgfFcsj0.get(i);
1231 1231 }
1232   -
  1232 +
1233 1233 }
1234 1234 Collections.sort(zgfFcsj1);
1235   - fcsjx=0;
  1235 + fcsjx=0;
1236 1236 for (int i = 0; i < zgfFcsj1.size(); i++) {
1237 1237 if(i==0){
1238 1238 fcsjx =zgfFcsj1.get(i);
... ... @@ -1240,7 +1240,7 @@ public class ReportServiceImpl implements ReportService{
1240 1240 cjs.add(zgfFcsj1.get(i)-fcsjx);
1241 1241 fcsjx =zgfFcsj1.get(i);
1242 1242 }
1243   -
  1243 +
1244 1244 }
1245 1245 Collections.sort(cjs);
1246 1246 for(int i : cjs){
... ... @@ -1252,15 +1252,15 @@ public class ReportServiceImpl implements ReportService{
1252 1252 sxtszgf=Arith.div(tzsxZgf, sxcountZgfbc, 1);
1253 1253 sxsjzgf =Arith.div(yysxZgf, sxcountZgfbc, 1);
1254 1254 }
1255   -
  1255 +
1256 1256 double xxtszgf=0.0;
1257 1257 double xxsjzgf=0.0;
1258 1258 if(xxcountZgfbc>0){
1259 1259 xxtszgf=Arith.div(tzxxZgf, xxcountZgfbc, 1);
1260 1260 xxsjzgf=Arith.div(yyxxZgf, xxcountZgfbc,1);
1261 1261 }
1262   -
1263   -
  1262 +
  1263 +
1264 1264 tempMap = new HashMap<String, Object>();
1265 1265 tempMap.put("sjd", "6:31——8:30");
1266 1266 tempMap.put("sxsj", sxsjzgf);
... ... @@ -1274,9 +1274,9 @@ public class ReportServiceImpl implements ReportService{
1274 1274 //----------------------------------------------中午
1275 1275 cjs = new ArrayList<Integer>();
1276 1276 zcj =0;
1277   -
  1277 +
1278 1278 Collections.sort(zwFcsj0);
1279   - fcsjs=0;
  1279 + fcsjs=0;
1280 1280 for (int i = 0; i < zwFcsj0.size(); i++) {
1281 1281 if(i==0){
1282 1282 fcsjs =zwFcsj0.get(i);
... ... @@ -1284,10 +1284,10 @@ public class ReportServiceImpl implements ReportService{
1284 1284 cjs.add(zwFcsj0.get(i)-fcsjs);
1285 1285 fcsjs=zwFcsj0.get(i);
1286 1286 }
1287   -
  1287 +
1288 1288 }
1289 1289 Collections.sort(zwFcsj1);
1290   - fcsjx=0;
  1290 + fcsjx=0;
1291 1291 for (int i = 0; i < zwFcsj1.size(); i++) {
1292 1292 if(i==0){
1293 1293 fcsjx =zwFcsj1.get(i);
... ... @@ -1295,7 +1295,7 @@ public class ReportServiceImpl implements ReportService{
1295 1295 cjs.add(zwFcsj1.get(i)-fcsjx);
1296 1296 fcsjx =zwFcsj1.get(i);
1297 1297 }
1298   -
  1298 +
1299 1299 }
1300 1300 Collections.sort(cjs);
1301 1301 for(int i : cjs){
... ... @@ -1307,7 +1307,7 @@ public class ReportServiceImpl implements ReportService{
1307 1307 sxtzsjzw=Arith.div(tzsxZw, sxcountZwbc, 1);
1308 1308 sxsjsjzw=Arith.div(yysxZw, sxcountZwbc,1);
1309 1309 }
1310   -
  1310 +
1311 1311 double xxtzsjzw=0.0;
1312 1312 double xxsjsjzw=0.0;
1313 1313 if(xxcountZwbc>0){
... ... @@ -1327,9 +1327,9 @@ public class ReportServiceImpl implements ReportService{
1327 1327 //-------------------------------------------------晚高峰
1328 1328 cjs = new ArrayList<Integer>();
1329 1329 zcj =0;
1330   -
  1330 +
1331 1331 Collections.sort(wgfFcsj0);
1332   - fcsjs=0;
  1332 + fcsjs=0;
1333 1333 for (int i = 0; i < wgfFcsj0.size(); i++) {
1334 1334 if(i==0){
1335 1335 fcsjs =wgfFcsj0.get(i);
... ... @@ -1337,10 +1337,10 @@ public class ReportServiceImpl implements ReportService{
1337 1337 cjs.add(wgfFcsj0.get(i)-fcsjs);
1338 1338 fcsjs=wgfFcsj0.get(i);
1339 1339 }
1340   -
  1340 +
1341 1341 }
1342 1342 Collections.sort(wgfFcsj1);
1343   - fcsjx=0;
  1343 + fcsjx=0;
1344 1344 for (int i = 0; i < wgfFcsj1.size(); i++) {
1345 1345 if(i==0){
1346 1346 fcsjx =wgfFcsj1.get(i);
... ... @@ -1348,27 +1348,27 @@ public class ReportServiceImpl implements ReportService{
1348 1348 cjs.add(wgfFcsj1.get(i)-fcsjx);
1349 1349 fcsjx =wgfFcsj1.get(i);
1350 1350 }
1351   -
  1351 +
1352 1352 }
1353 1353 Collections.sort(cjs);
1354 1354 for(int i : cjs){
1355 1355 zcj += i;
1356 1356 }
1357   -
  1357 +
1358 1358 double sxtzsjwgf=0.0;
1359 1359 double sxsjsjwgf=0.0;
1360 1360 if(sxcountWgfbc>0){
1361 1361 sxtzsjwgf=Arith.div(tzsxWgf, sxcountWgfbc, 1);
1362 1362 sxsjsjwgf=Arith.div(yysxWgf, sxcountWgfbc,1);
1363 1363 }
1364   -
  1364 +
1365 1365 double xxtzsjwgf=0.0;
1366 1366 double xxsjsjwgf=0.0;
1367 1367 if(xxcountWgfbc>0){
1368 1368 xxtzsjwgf=Arith.div(tzxxWgf, xxcountWgfbc, 1);
1369 1369 xxsjsjwgf=Arith.div(yyxxWgf, xxcountWgfbc,1);
1370 1370 }
1371   -
  1371 +
1372 1372 tempMap = new HashMap<String, Object>();
1373 1373 tempMap.put("sjd", "16:01——18:00");
1374 1374 tempMap.put("sxsj", sxsjsjwgf);
... ... @@ -1379,13 +1379,13 @@ public class ReportServiceImpl implements ReportService{
1379 1379 tempMap.put("cjqj", cjs.size()>0?cjs.get(0)+"——"+cjs.get(cjs.size()-1):"——");
1380 1380 tempMap.put("pjcj", cjs.size()>0?zcj/cjs.size():"/");
1381 1381 newList.add(tempMap);
1382   -
  1382 +
1383 1383 //----------------------------------晚后
1384 1384 cjs = new ArrayList<Integer>();
1385 1385 zcj =0;
1386   -
  1386 +
1387 1387 Collections.sort(whFcsj0);
1388   - fcsjs=0;
  1388 + fcsjs=0;
1389 1389 for (int i = 0; i < whFcsj0.size(); i++) {
1390 1390 if(i==0){
1391 1391 fcsjs =whFcsj0.get(i);
... ... @@ -1393,10 +1393,10 @@ public class ReportServiceImpl implements ReportService{
1393 1393 cjs.add(whFcsj0.get(i)-fcsjs);
1394 1394 fcsjs=whFcsj0.get(i);
1395 1395 }
1396   -
  1396 +
1397 1397 }
1398 1398 Collections.sort(whFcsj1);
1399   - fcsjx=0;
  1399 + fcsjx=0;
1400 1400 for (int i = 0; i < whFcsj1.size(); i++) {
1401 1401 if(i==0){
1402 1402 fcsjx =whFcsj1.get(i);
... ... @@ -1404,7 +1404,7 @@ public class ReportServiceImpl implements ReportService{
1404 1404 cjs.add(whFcsj1.get(i)-fcsjx);
1405 1405 fcsjx =whFcsj1.get(i);
1406 1406 }
1407   -
  1407 +
1408 1408 }
1409 1409 Collections.sort(cjs);
1410 1410 for(int i : cjs){
... ... @@ -1416,7 +1416,7 @@ public class ReportServiceImpl implements ReportService{
1416 1416 sxtzsjwh=Arith.div(tzsxWh,sxcountWhbc,1);
1417 1417 sxsjsjwh=Arith.div(yysxWh, sxcountWhbc,1);
1418 1418 }
1419   -
  1419 +
1420 1420 double xxtzsjwh=0.0;
1421 1421 double xxsjsjwh=0.0;
1422 1422 if(xxcountWhbc>0){
... ... @@ -1458,7 +1458,7 @@ public class ReportServiceImpl implements ReportService{
1458 1458 keyMap.get("18:01——(末)").add(ttMap);
1459 1459 }
1460 1460 }
1461   -
  1461 +
1462 1462 for(String key : keyMap.keySet()){
1463 1463 Map<String, Object> tempMap = new HashMap<String, Object>();
1464 1464 List<Map<String, Object>> list2 = keyMap.get(key);
... ... @@ -1477,7 +1477,7 @@ public class ReportServiceImpl implements ReportService{
1477 1477 }else{
1478 1478 String[] split = m.get("fcsj").toString().split(":");
1479 1479 int fcsj = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
1480   -
  1480 +
1481 1481 int xlDir = Integer.valueOf(m.get("dir").toString());
1482 1482 int bcsj = Integer.valueOf(m.get("bcsj").toString());
1483 1483 if(temp >= fcsj){
... ... @@ -1498,17 +1498,17 @@ public class ReportServiceImpl implements ReportService{
1498 1498 }
1499 1499 }
1500 1500 lpname=m.get("lp").toString();
1501   -
  1501 +
1502 1502 }
1503 1503 sxtsbc++;
1504 1504 }
1505   -
  1505 +
1506 1506 } else {
1507   -
  1507 +
1508 1508 fcsj_x.add(fcsj);
1509 1509 xxsj += bcsj;
1510 1510 xxbc ++;
1511   -
  1511 +
1512 1512 if(!ists){
1513 1513 if(lpname.equals("")){
1514 1514 lpname=m.get("lp").toString();
... ... @@ -1522,7 +1522,7 @@ public class ReportServiceImpl implements ReportService{
1522 1522 }
1523 1523 xxtsbc++;
1524 1524 }
1525   -
  1525 +
1526 1526 }
1527 1527 if(temp < fcsj){
1528 1528 cjs.add(fcsj - temp);
... ... @@ -1544,7 +1544,7 @@ public class ReportServiceImpl implements ReportService{
1544 1544 cjs.add(fcsj_s.get(i)-fcsjs);
1545 1545 fcsjs=fcsj_s.get(i);
1546 1546 }
1547   -
  1547 +
1548 1548 }
1549 1549 Collections.sort(fcsj_x);
1550 1550 int fcsjx=0;
... ... @@ -1555,7 +1555,7 @@ public class ReportServiceImpl implements ReportService{
1555 1555 cjs.add(fcsj_x.get(i)-fcsjx);
1556 1556 fcsjx =fcsj_x.get(i);
1557 1557 }
1558   -
  1558 +
1559 1559 }
1560 1560 Collections.sort(cjs);
1561 1561 for(int i : cjs){
... ... @@ -1577,7 +1577,7 @@ public class ReportServiceImpl implements ReportService{
1577 1577 newList.add(maps.get("8:31——16:00"));
1578 1578 newList.add(maps.get("16:01——18:00"));
1579 1579 newList.add(maps.get("18:01——(末)"));*/
1580   -
  1580 +
1581 1581 return newList;
1582 1582 }
1583 1583 @Override
... ... @@ -1593,27 +1593,27 @@ public class ReportServiceImpl implements ReportService{
1593 1593 sql += " and cl.line_code = '"+line+"'";
1594 1594 }
1595 1595 sql += " order by tt.create_date desc";
1596   -
  1596 +
1597 1597 list = jdbcTemplate.query(sql,
1598 1598 new RowMapper<Map<String, Object>>(){
1599   - @Override
1600   - public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
1601   - Map<String, Object> map = new HashMap<String, Object>();
1602   - map.put("id", rs.getString("id"));
1603   - map.put("name", rs.getString("name"));
1604   - return map;
1605   - }
1606   - });
  1599 + @Override
  1600 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  1601 + Map<String, Object> map = new HashMap<String, Object>();
  1602 + map.put("id", rs.getString("id"));
  1603 + map.put("name", rs.getString("name"));
  1604 + return map;
  1605 + }
  1606 + });
1607 1607 }catch (Exception e) {
1608 1608 // TODO Auto-generated catch block
1609 1609 e.printStackTrace();
1610 1610 }
1611 1611 return list;
1612 1612 }
1613   -
  1613 +
1614 1614 private List<ScheduleRealInfo> getListSinfo(Map<String, Object> map){
1615 1615 List<ScheduleRealInfo> list =new ArrayList<ScheduleRealInfo>();
1616   -
  1616 +
1617 1617 String sql="select DISTINCT a.* from (select * from bsth_c_s_sp_info_real where 1=1 ";
1618 1618 if(map.get("date")!=null){
1619 1619 sql += " and schedule_date_str='"+map.get("date").toString()+"'";
... ... @@ -1622,70 +1622,70 @@ public class ReportServiceImpl implements ReportService{
1622 1622 if(map.get("line").toString()!=""){
1623 1623 sql += " and xl_bm='"+map.get("line").toString()+"'";
1624 1624 }
1625   -
  1625 +
1626 1626 }
1627 1627 if(map.get("bcType")!=null){
1628 1628 if(map.get("bcType").toString().equals("inout")){
1629 1629 sql += " and bc_type in ('in','out')";
1630 1630 }
1631   -
  1631 +
1632 1632 if(map.get("bcType").toString().equals("normal")){
1633 1633 sql += " and bc_type not in ('in','out')";
1634 1634 }
1635 1635 }
1636   -
  1636 +
1637 1637 sql += " )a left join bsth_c_s_child_task b on a.id=b.schedule";
1638 1638 list= jdbcTemplate.query(sql,
1639   - new RowMapper<ScheduleRealInfo>(){
1640   - @Override
1641   - public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
1642   - ScheduleRealInfo m=new ScheduleRealInfo();
1643   - m.setId(rs.getLong("id"));
  1639 + new RowMapper<ScheduleRealInfo>(){
  1640 + @Override
  1641 + public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  1642 + ScheduleRealInfo m=new ScheduleRealInfo();
  1643 + m.setId(rs.getLong("id"));
1644 1644 // m.setBcs();
1645 1645 // m.setBcsj();
1646   - m.setClZbh(rs.getString("cl_zbh"));
1647   - m.setFcsj(rs.getString("fcsj"));
1648   - m.setFcsjActual(rs.getString("fcsj_actual"));
1649   - m.setjGh(rs.getString("j_gh"));
1650   - m.setjName(rs.getString("j_name"));
1651   - m.setJhlc(rs.getDouble("jhlc"));
1652   - m.setLpName(rs.getString("lp_name"));
1653   - m.setQdzCode(rs.getString("qdz_code"));
1654   - m.setQdzName(rs.getString("qdz_name"));
1655   - m.setRealExecDate(rs.getString("real_exec_date"));
1656   - m.setRealMileage(rs.getDouble("real_mileage"));
1657   - m.setRemarks(rs.getString("remarks"));
1658   - m.setsGh(rs.getString("s_gh"));
1659   - m.setsName(rs.getString("s_name"));
1660   - m.setScheduleDate(rs.getDate("schedule_date"));
1661   - m.setScheduleDateStr(rs.getString("schedule_date_str"));
1662   - m.setSflj(rs.getBoolean("sflj"));
1663   - m.setSpId(rs.getLong("sp_id"));
1664   - m.setStatus(rs.getInt("status"));
1665   - m.setXlBm(rs.getString("xl_bm"));
1666   - m.setXlDir(rs.getString("xl_dir"));
1667   - m.setXlName(rs.getString("xl_name"));
1668   - m.setZdsj(rs.getString("zdsj"));
1669   - m.setZdsjActual(rs.getString("zdsj_actual"));
1670   - m.setZdzCode(rs.getString("zdz_code"));
1671   - m.setZdzName(rs.getString("zdz_name"));
1672   - m.setCcno(rs.getInt("ccno"));
1673   - m.setDfAuto(rs.getBoolean("df_auto"));
1674   - m.setFgsBm(rs.getString("fgs_bm"));
1675   - m.setFgsName(rs.getString("fgs_name"));
1676   - m.setGsBm(rs.getString("gs_bm"));
1677   - m.setGsName(rs.getString("gs_name"));
1678   - m.setOnline(rs.getBoolean("online"));
1679   - m.setAdjustExps(rs.getString("adjust_exps"));
1680   - m.setReissue(rs.getBoolean("reissue"));
1681   - m.setJhlcOrig(rs.getDouble("jhlc_orig"));
1682   - return m;
1683   - }
1684   - });
1685   -
  1646 + m.setClZbh(rs.getString("cl_zbh"));
  1647 + m.setFcsj(rs.getString("fcsj"));
  1648 + m.setFcsjActual(rs.getString("fcsj_actual"));
  1649 + m.setjGh(rs.getString("j_gh"));
  1650 + m.setjName(rs.getString("j_name"));
  1651 + m.setJhlc(rs.getDouble("jhlc"));
  1652 + m.setLpName(rs.getString("lp_name"));
  1653 + m.setQdzCode(rs.getString("qdz_code"));
  1654 + m.setQdzName(rs.getString("qdz_name"));
  1655 + m.setRealExecDate(rs.getString("real_exec_date"));
  1656 + m.setRealMileage(rs.getDouble("real_mileage"));
  1657 + m.setRemarks(rs.getString("remarks"));
  1658 + m.setsGh(rs.getString("s_gh"));
  1659 + m.setsName(rs.getString("s_name"));
  1660 + m.setScheduleDate(rs.getDate("schedule_date"));
  1661 + m.setScheduleDateStr(rs.getString("schedule_date_str"));
  1662 + m.setSflj(rs.getBoolean("sflj"));
  1663 + m.setSpId(rs.getLong("sp_id"));
  1664 + m.setStatus(rs.getInt("status"));
  1665 + m.setXlBm(rs.getString("xl_bm"));
  1666 + m.setXlDir(rs.getString("xl_dir"));
  1667 + m.setXlName(rs.getString("xl_name"));
  1668 + m.setZdsj(rs.getString("zdsj"));
  1669 + m.setZdsjActual(rs.getString("zdsj_actual"));
  1670 + m.setZdzCode(rs.getString("zdz_code"));
  1671 + m.setZdzName(rs.getString("zdz_name"));
  1672 + m.setCcno(rs.getInt("ccno"));
  1673 + m.setDfAuto(rs.getBoolean("df_auto"));
  1674 + m.setFgsBm(rs.getString("fgs_bm"));
  1675 + m.setFgsName(rs.getString("fgs_name"));
  1676 + m.setGsBm(rs.getString("gs_bm"));
  1677 + m.setGsName(rs.getString("gs_name"));
  1678 + m.setOnline(rs.getBoolean("online"));
  1679 + m.setAdjustExps(rs.getString("adjust_exps"));
  1680 + m.setReissue(rs.getBoolean("reissue"));
  1681 + m.setJhlcOrig(rs.getDouble("jhlc_orig"));
  1682 + return m;
  1683 + }
  1684 + });
  1685 +
1686 1686 return list;
1687 1687 }
1688   -
  1688 +
1689 1689 @Override
1690 1690 public List<Map<String, Object>> jobFwqk(Map<String, Object> map) {
1691 1691 // TODO Auto-generated method stub
... ... @@ -1697,7 +1697,7 @@ public class ReportServiceImpl implements ReportService{
1697 1697 List<ScheduleRealInfo> sList=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
1698 1698 for (int i = 0; i < sList.size(); i++) {
1699 1699 ScheduleRealInfo scheduleRealInfo = sList.get(i);
1700   - if (!(scheduleRealInfo.getBcType().equals("in")
  1700 + if (!(scheduleRealInfo.getBcType().equals("in")
1701 1701 || scheduleRealInfo.getBcType().equals("out")
1702 1702 ||scheduleRealInfo.getBcType().equals("ldks"))) {
1703 1703 Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
... ... @@ -1755,43 +1755,43 @@ public class ReportServiceImpl implements ReportService{
1755 1755 }
1756 1756 }
1757 1757 }else{*/
1758   - while (it.hasNext()) {
1759   - ChildTaskPlan childTaskPlan = it.next();
1760   - if (childTaskPlan.isDestroy()) {
1761   - String destroyReason = "";
1762   - if ( childTaskPlan.getDestroyReason() == null) {
1763   - destroyReason = "其他";
1764   - }else if(childTaskPlan.getDestroyReason().equals("")){
1765   - destroyReason = "其他";
1766   - } else {
1767   - destroyReason = childTaskPlan.getDestroyReason();
1768   - }
1769   - Map<String, Object> newMap = new HashMap<String, Object>();
1770   - newMap.put("nr", destroyReason);
1771   - newMap.put("lp", scheduleRealInfo.getLpName());
1772   - newMap.put("nbbm", scheduleRealInfo.getClZbh());
1773   - newMap.put("jgh", scheduleRealInfo.getjGh());
1774   - newMap.put("dz", childTaskPlan.getStartStationName());
1775   - newMap.put("sj", childTaskPlan.getStartDate());
1776   - newMap.put("gzf", " ");
1777   - newMap.put("lbbc", 0);
1778   - newMap.put("lblc", childTaskPlan.getMileage());
1779   - newMap.put("jyqp", childTaskPlan.getRemarks());
1780   - list.add(newMap);
1781   -
  1758 + while (it.hasNext()) {
  1759 + ChildTaskPlan childTaskPlan = it.next();
  1760 + if (childTaskPlan.isDestroy()) {
  1761 + String destroyReason = "";
  1762 + if ( childTaskPlan.getDestroyReason() == null) {
  1763 + destroyReason = "其他";
  1764 + }else if(childTaskPlan.getDestroyReason().equals("")){
  1765 + destroyReason = "其他";
  1766 + } else {
  1767 + destroyReason = childTaskPlan.getDestroyReason();
1782 1768 }
  1769 + Map<String, Object> newMap = new HashMap<String, Object>();
  1770 + newMap.put("nr", destroyReason);
  1771 + newMap.put("lp", scheduleRealInfo.getLpName());
  1772 + newMap.put("nbbm", scheduleRealInfo.getClZbh());
  1773 + newMap.put("jgh", scheduleRealInfo.getjGh());
  1774 + newMap.put("dz", childTaskPlan.getStartStationName());
  1775 + newMap.put("sj", childTaskPlan.getStartDate());
  1776 + newMap.put("gzf", " ");
  1777 + newMap.put("lbbc", 0);
  1778 + newMap.put("lblc", childTaskPlan.getMileage());
  1779 + newMap.put("jyqp", childTaskPlan.getRemarks());
  1780 + list.add(newMap);
  1781 +
1783 1782 }
  1783 + }
1784 1784 // }
1785   -
  1785 +
1786 1786 }
1787 1787 }
1788 1788 }
1789   - List<Map<String, Object>> listNew=new ArrayList<Map<String,Object>>();
  1789 + List<Map<String, Object>> listNew=new ArrayList<Map<String,Object>>();
1790 1790 for (int i = 0; i < lblxs.length; i++) {
1791   - String lx=lblxs[i];
1792   - double lblc=0.0;
1793   - int lbbc=0;
1794   - for (int j = 0; j < list.size(); j++) {
  1791 + String lx=lblxs[i];
  1792 + double lblc=0.0;
  1793 + int lbbc=0;
  1794 + for (int j = 0; j < list.size(); j++) {
1795 1795 Map<String, Object> m1=list.get(j);
1796 1796 if(lx.equals(m1.get("nr").toString())){
1797 1797 m1.put("lx", 0);
... ... @@ -1800,1434 +1800,1434 @@ public class ReportServiceImpl implements ReportService{
1800 1800 lbbc += Integer.parseInt(m1.get("lbbc").toString());
1801 1801 }
1802 1802 }
1803   - if(lblc>0){
1804   - Map<String, Object> newMap = new HashMap<String, Object>();
1805   - newMap.put("lx", 1);
1806   - newMap.put("nr", lx);
1807   - newMap.put("lp", "小计");
1808   - newMap.put("nbbm", "少驶班次");
1809   - newMap.put("jgh", lbbc);
1810   - newMap.put("lbbc", "少驶公里");
1811   - newMap.put("lblc", lblc);
1812   - newMap.put("dz", " ");
1813   - newMap.put("sj", " ");
1814   - newMap.put("gzf", " ");
1815   - newMap.put("jyqp"," ");
1816   - listNew.add(newMap);
1817   - }
1818   -
1819   -
  1803 + if(lblc>0){
  1804 + Map<String, Object> newMap = new HashMap<String, Object>();
  1805 + newMap.put("lx", 1);
  1806 + newMap.put("nr", lx);
  1807 + newMap.put("lp", "小计");
  1808 + newMap.put("nbbm", "少驶班次");
  1809 + newMap.put("jgh", lbbc);
  1810 + newMap.put("lbbc", "少驶公里");
  1811 + newMap.put("lblc", lblc);
  1812 + newMap.put("dz", " ");
  1813 + newMap.put("sj", " ");
  1814 + newMap.put("gzf", " ");
  1815 + newMap.put("jyqp"," ");
  1816 + listNew.add(newMap);
  1817 + }
  1818 +
  1819 +
1820 1820 }
1821 1821 Collections.sort(listNew, new ComparableJob());
1822 1822 return listNew;
1823 1823 }
1824   -
1825   - //统计临加班次详细信息
1826   - @Override
1827   - public List<Map<String, Object>> jobLjqk(Map<String, Object> map) {
1828   - // TODO Auto-generated method stub
1829   - String line=map.get("line").toString();
1830   - String date=map.get("date").toString();
1831   - map.put("bcType", "normal");
1832   - List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
1833   - List<ScheduleRealInfo> sList=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
1834   - for (int i = 0; i < sList.size(); i++) {
1835   - ScheduleRealInfo scheduleRealInfo=sList.get(i);
1836   - if (!(scheduleRealInfo.getBcType().equals("in")
1837   - || scheduleRealInfo.getBcType().equals("out")
1838   - || scheduleRealInfo.getBcType().equals("ldks"))) {
  1824 +
  1825 + //统计临加班次详细信息
  1826 + @Override
  1827 + public List<Map<String, Object>> jobLjqk(Map<String, Object> map) {
  1828 + // TODO Auto-generated method stub
  1829 + String line=map.get("line").toString();
  1830 + String date=map.get("date").toString();
  1831 + map.put("bcType", "normal");
  1832 + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
  1833 + List<ScheduleRealInfo> sList=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
  1834 + for (int i = 0; i < sList.size(); i++) {
  1835 + ScheduleRealInfo scheduleRealInfo=sList.get(i);
  1836 + if (!(scheduleRealInfo.getBcType().equals("in")
  1837 + || scheduleRealInfo.getBcType().equals("out")
  1838 + || scheduleRealInfo.getBcType().equals("ldks"))) {
1839 1839 // Set<ChildTaskPlan> childTaskPlans = scheduleRealInfo.getcTasks();
1840 1840 // if(childTaskPlans.isEmpty()){
1841   - if(scheduleRealInfo.isSflj()){
1842   - Map<String, Object> newMap=new HashMap<String,Object>();
1843   - newMap.put("lp", scheduleRealInfo.getLpName());
1844   - newMap.put("nbbm", scheduleRealInfo.getClZbh());
1845   - newMap.put("jgh", scheduleRealInfo.getjGh());
1846   - newMap.put("dz", scheduleRealInfo.getQdzName());
1847   - newMap.put("sj", scheduleRealInfo.getFcsj());
1848   - newMap.put("ljlc", scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
1849   - newMap.put("jyqp", scheduleRealInfo.getRealMileage()==null?"":scheduleRealInfo.getRealMileage());
1850   - list.add(newMap);
1851   - }
  1841 + if(scheduleRealInfo.isSflj()){
  1842 + Map<String, Object> newMap=new HashMap<String,Object>();
  1843 + newMap.put("lp", scheduleRealInfo.getLpName());
  1844 + newMap.put("nbbm", scheduleRealInfo.getClZbh());
  1845 + newMap.put("jgh", scheduleRealInfo.getjGh());
  1846 + newMap.put("dz", scheduleRealInfo.getQdzName());
  1847 + newMap.put("sj", scheduleRealInfo.getFcsj());
  1848 + newMap.put("ljlc", scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
  1849 + newMap.put("jyqp", scheduleRealInfo.getRealMileage()==null?"":scheduleRealInfo.getRealMileage());
  1850 + list.add(newMap);
  1851 + }
1852 1852 // }else{
1853 1853 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
1854 1854 // while (it.hasNext()) {
1855 1855 // ChildTaskPlan childTaskPlan = it.next();
1856 1856 // if (childTaskPlan.isDestroy()) {
1857   -// }
  1857 +// }
1858 1858 // }
1859 1859 // }
  1860 + }
  1861 + }
  1862 + return list;
  1863 + }
  1864 +
  1865 + public static double culateCJLC2(List<ScheduleRealInfo> list, String item) {
  1866 + // TODO Auto-generated method stub
  1867 + double sum = 0;
  1868 + Set<ChildTaskPlan> cts;
  1869 + for(ScheduleRealInfo sch : list){
  1870 + if (sch.isSflj())
  1871 + continue;
  1872 + cts = sch.getcTasks();
  1873 + //有子任务
  1874 + if (cts != null && cts.size() > 0) {
  1875 + for(ChildTaskPlan c : cts){
  1876 + if(c.isDestroy() && c.getDestroyReason().equals(item))
  1877 + sum = Arith.add(sum, c.getMileage());
1860 1878 }
1861 1879 }
1862   - return list;
1863   - }
1864   -
1865   - public static double culateCJLC2(List<ScheduleRealInfo> list, String item) {
1866   - // TODO Auto-generated method stub
1867   - double sum = 0;
1868   - Set<ChildTaskPlan> cts;
1869   - for(ScheduleRealInfo sch : list){
1870   - if (sch.isSflj())
1871   - continue;
1872   - cts = sch.getcTasks();
1873   - //有子任务
1874   - if (cts != null && cts.size() > 0) {
1875   - for(ChildTaskPlan c : cts){
1876   - if(c.isDestroy() && c.getDestroyReason().equals(item))
1877   - sum = Arith.add(sum, c.getMileage());
1878   - }
1879   - }
1880 1880 // else if(isInOut(sch))
1881 1881 // continue;
1882   - //主任务烂班
1883   - else if(sch.getStatus() == -1){
1884   - if(sch.getAdjustExps().equals(item) ||
1885   - (StringUtils.isEmpty(sch.getAdjustExps()) && item.equals("其他"))){
1886   - sum = Arith.add(sum, sch.getJhlcOrig());
1887   - }
1888   - }
1889   - else if(item.equals("其他")){
1890   - double diff = Arith.sub(sch.getJhlcOrig(), sch.getJhlc());
1891   - if(diff > 0){
1892   - sum = Arith.add(sum, diff);
1893   - }
1894   - }
1895   - }
1896   - return sum;
1897   -
1898   - }
1899   - @Override
1900   - public Map<String, Object> jobHzxx(Map<String, Object> map) {
1901   - // TODO Auto-generated method stub
1902   - String line="";
1903   - if(map.get("line")!=null){
1904   - line=map.get("line").toString();
1905   - }
1906   - String date="";
1907   - if(map.get("date")!=null){
1908   - date=map.get("date").toString();
1909   - }
1910   -
1911   - List<ScheduleRealInfo> sList=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
1912   - Map<String, Object> newMap=new HashMap<String,Object>();
1913   - newMap.put("jhbc", culateService.culateJhbc(sList,""));
1914   - newMap.put("jhgl", culateService.culateJhgl(sList));
1915   - newMap.put("sjbc", culateService.culateSjbc(sList,""));
1916   - newMap.put("sjgl", culateService.culateSjgl(sList));
1917   - newMap.put("lbgl", culateService.culateLbgl(sList));
1918   - newMap.put("lbbc", culateService.culateLbbc(sList));
1919   - newMap.put("ljgl", culateService.culateLjgl(sList));
1920   - newMap.put("ljbc", culateService.culateLjbc(sList,""));
1921   - newMap.put("ksgl", culateService.culateKsgl(sList));
1922   - return newMap;
1923   - }
1924   - @Override
1925   - public List<Map<String, Object>> lineList() {
1926   - // TODO Auto-generated method stub
1927   - List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
1928   - Iterator<Line> iterator = lineRepository.findAll().iterator();
1929   - Line line;
1930   - while (iterator.hasNext()) {
1931   - line = iterator.next();
1932   - Map<String, Object> map=new HashMap<String,Object>();
1933   - map.put("gsbm", line.getCompany());
1934   - map.put("fgsbm", line.getBrancheCompany());
1935   - map.put("xlbm", line.getLineCode());
1936   - map.put("xlname", line.getName());
1937   - list.add(map);
1938   - }
1939   - return list;
1940   - }
1941   - @Override
1942   - public List<Map<String, String>> carList(Map<String, Object> maps) {
1943   - // TODO Auto-generated method stub
1944   - // 转大写
1945   - String nbbm =maps.get("nbbm").toString().toUpperCase();
1946   - String gsbm="";
1947   -
1948   - if(maps.get("gsbm")!=null)
1949   - gsbm= maps.get("gsbm").toString().trim();
1950   -// String fgsbm=maps.get("fgsbm").toString().trim();
1951   - String xlbm=maps.get("xlbm").toString().trim();
1952   - List<Map<String, String>> list = new ArrayList<Map<String, String>>();
1953   - Map<String, String> map;
1954   - Set<String> allSet = BasicData.nbbm2CompanyCodeMap.keySet();
1955   -
1956   - Line line;
1957   - for (String k : allSet) {
1958   - if (k.indexOf(nbbm) != -1) {
1959   - // 所属线路
1960   - boolean fage=true;
1961   - map = new HashMap<>();
1962   - line = BasicData.nbbm2LineMap.get(k);
1963   - String clgsdm= BasicData.nbbm2CompanyCodeMap.get(k);
1964   -
1965   - map.put("id", k);
1966   - map.put("text", k);
1967   - if (null != line) {
1968   - map.put("lineName", line.getName());
1969   - map.put("lineCode", line.getLineCode());
1970   - }
1971   -
1972   - if(!xlbm.equals("")){
1973   - if(null!=line){
1974   - if(!line.getLineCode().equals(xlbm)){
1975   - fage=false;
1976   - }
1977   - }
1978   -
1979   - }
1980   -
1981   - if(!gsbm.equals("")){
1982   - if(!clgsdm.equals(gsbm)){
1983   - fage=false;
1984   - }
1985   - }
1986   -
1987   - if(fage){
1988   - list.add(map);
1989   - }
1990   -
1991   - }
1992   -
1993   - if (list.size() > 20)
1994   - break;
1995   - }
1996   - return list;
1997   - }
1998   -
1999   -
2000   - @Override
2001   - public List<Map<String, String>> userList(Map<String, Object> maps) {
2002   - // TODO Auto-generated method stub
2003   - // 转大写
2004   - String jsy =maps.get("jsy").toString().toUpperCase();
2005   - String gsbm="";
2006   - if(maps.get("gsbm")!=null)
2007   - gsbm=maps.get("gsbm").toString().trim();
  1882 + //主任务烂班
  1883 + else if(sch.getStatus() == -1){
  1884 + if(sch.getAdjustExps().equals(item) ||
  1885 + (StringUtils.isEmpty(sch.getAdjustExps()) && item.equals("其他"))){
  1886 + sum = Arith.add(sum, sch.getJhlcOrig());
  1887 + }
  1888 + }
  1889 + else if(item.equals("其他")){
  1890 + double diff = Arith.sub(sch.getJhlcOrig(), sch.getJhlc());
  1891 + if(diff > 0){
  1892 + sum = Arith.add(sum, diff);
  1893 + }
  1894 + }
  1895 + }
  1896 + return sum;
  1897 +
  1898 + }
  1899 + @Override
  1900 + public Map<String, Object> jobHzxx(Map<String, Object> map) {
  1901 + // TODO Auto-generated method stub
  1902 + String line="";
  1903 + if(map.get("line")!=null){
  1904 + line=map.get("line").toString();
  1905 + }
  1906 + String date="";
  1907 + if(map.get("date")!=null){
  1908 + date=map.get("date").toString();
  1909 + }
  1910 +
  1911 + List<ScheduleRealInfo> sList=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
  1912 + Map<String, Object> newMap=new HashMap<String,Object>();
  1913 + newMap.put("jhbc", culateService.culateJhbc(sList,""));
  1914 + newMap.put("jhgl", culateService.culateJhgl(sList));
  1915 + newMap.put("sjbc", culateService.culateSjbc(sList,""));
  1916 + newMap.put("sjgl", culateService.culateSjgl(sList));
  1917 + newMap.put("lbgl", culateService.culateLbgl(sList));
  1918 + newMap.put("lbbc", culateService.culateLbbc(sList));
  1919 + newMap.put("ljgl", culateService.culateLjgl(sList));
  1920 + newMap.put("ljbc", culateService.culateLjbc(sList,""));
  1921 + newMap.put("ksgl", culateService.culateKsgl(sList));
  1922 + return newMap;
  1923 + }
  1924 + @Override
  1925 + public List<Map<String, Object>> lineList() {
  1926 + // TODO Auto-generated method stub
  1927 + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
  1928 + Iterator<Line> iterator = lineRepository.findAll().iterator();
  1929 + Line line;
  1930 + while (iterator.hasNext()) {
  1931 + line = iterator.next();
  1932 + Map<String, Object> map=new HashMap<String,Object>();
  1933 + map.put("gsbm", line.getCompany());
  1934 + map.put("fgsbm", line.getBrancheCompany());
  1935 + map.put("xlbm", line.getLineCode());
  1936 + map.put("xlname", line.getName());
  1937 + list.add(map);
  1938 + }
  1939 + return list;
  1940 + }
  1941 + @Override
  1942 + public List<Map<String, String>> carList(Map<String, Object> maps) {
  1943 + // TODO Auto-generated method stub
  1944 + // 转大写
  1945 + String nbbm =maps.get("nbbm").toString().toUpperCase();
  1946 + String gsbm="";
  1947 +
  1948 + if(maps.get("gsbm")!=null)
  1949 + gsbm= maps.get("gsbm").toString().trim();
2008 1950 // String fgsbm=maps.get("fgsbm").toString().trim();
2009   - List<Map<String, String>> list = new ArrayList<Map<String, String>>();
2010   - Map<String, String> map;
2011   -// Set<String> allSet = BasicData.nbbm2CompanyCodeMap.keySet();
2012   - Set<String> allJsy = BasicData.perMap.keySet();
2013   -
2014   - Personnel per;
2015   - for (String k : allJsy) {
2016   - if (k.indexOf(jsy) != -1) {
2017   - map = new HashMap<>();
2018   - // 通过人员查找公司
2019   - per = BasicData.perMap.get(k);
2020   - String rygsdm="";
2021   - if(null != per){
2022   - if(per.getCompanyCode()!=null){
2023   - rygsdm = per.getCompanyCode();
2024   - }
2025   - String jboCode=per.getJobCode().substring(per.getJobCode().indexOf("-")+1);
2026   - map.put("id", jboCode);
2027   - map.put("text", jboCode+"/"+per.getPersonnelName());
2028   - if(!gsbm.equals("")){
2029   - if(rygsdm.equals(gsbm)){
2030   - list.add(map);
2031   - }
2032   - }
2033   - }
2034   - }
2035   -
2036   - if (list.size() > 20)
2037   - break;
2038   - }
2039   - return list;
2040   - }
2041   -
2042   - public List<ArrivalInfo> load4(String line, String date, int zd,String minfcsj){
2043   - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2044   - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
2045   - Long date1=0L;
2046   - Long date2=0L;
2047   - Calendar cal = Calendar.getInstance();
2048   - List<ArrivalInfo> list=null;
2049   - try {
2050   - Date dates1 = simpleDateFormat.parse(date+" "+minfcsj+":01");
2051   - String d1=date+" "+minfcsj+":01";
2052   -// Date dates2=simpleDateFormat.parse(date+" 23:59:59");
2053   - date1=dates1.getTime();
2054   -// date2=dates2.getTime();
2055   - cal.setTime(dates1);
2056   - int weeks_year1 = cal.get(Calendar.WEEK_OF_YEAR);
2057   - cal.add(cal.DATE,1);//把日期往后增加一天.整数往后推,负数往前移动
2058   - int weeks_year2 = cal.get(Calendar.WEEK_OF_YEAR);
2059   - Date dates2=cal.getTime();
2060   - String d2=simpleDateFormat.format(dates2);
2061   - String sql="select *,UNIX_TIMESTAMP(times) as ts from bsth_c_arrival_info where times >= '"+d1 +"'and "
2062   - + " times <='"+d2+"' and line_id = '"+line+"' and up_down = '"+zd+"'"
2063   - + " order by device_id,times";
2064   -
2065   - list =jdbcTemplate.query(sql, new RowMapper<ArrivalInfo>() {
2066   - @Override
2067   - public ArrivalInfo mapRow(ResultSet arg0, int arg1) throws SQLException {
2068   - ArrivalInfo ai=new ArrivalInfo();
2069   - ai.setInOut(arg0.getInt("in_out"));
2070   - ai.setDeviceId(arg0.getString("device_id"));
2071   - ai.setStopNo(arg0.getString("stop_no"));
2072   - ai.setDates(arg0.getDate("times"));
2073   - ai.setTs(arg0.getLong("ts")*1000);
2074   - return ai;
  1951 + String xlbm=maps.get("xlbm").toString().trim();
  1952 + List<Map<String, String>> list = new ArrayList<Map<String, String>>();
  1953 + Map<String, String> map;
  1954 + Set<String> allSet = BasicData.nbbm2CompanyCodeMap.keySet();
  1955 +
  1956 + Line line;
  1957 + for (String k : allSet) {
  1958 + if (k.indexOf(nbbm) != -1) {
  1959 + // 所属线路
  1960 + boolean fage=true;
  1961 + map = new HashMap<>();
  1962 + line = BasicData.nbbm2LineMap.get(k);
  1963 + String clgsdm= BasicData.nbbm2CompanyCodeMap.get(k);
  1964 +
  1965 + map.put("id", k);
  1966 + map.put("text", k);
  1967 + if (null != line) {
  1968 + map.put("lineName", line.getName());
  1969 + map.put("lineCode", line.getLineCode());
  1970 + }
  1971 +
  1972 + if(!xlbm.equals("")){
  1973 + if(null!=line){
  1974 + if(!line.getLineCode().equals(xlbm)){
  1975 + fage=false;
2075 1976 }
2076   - });
  1977 + }
2077 1978  
2078   - } catch (ParseException e1) {
2079   - // TODO Auto-generated catch block
2080   - e1.printStackTrace();
2081   - }
2082   - return list;
2083   -
2084   - }
2085   -
2086   - public List<ArrivalInfo> load3(String line, String date, int zd){
2087   - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2088   - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
2089   - Long date1=0L;
2090   - Long date2=0L;
2091   - Calendar cal = Calendar.getInstance();
2092   - try {
2093   - Date dates1 = simpleDateFormat.parse(date+" 00:00:01");
2094   - Date dates2=simpleDateFormat.parse(date+" 23:59:59");
2095   - date1=dates1.getTime();
2096   - date2=dates2.getTime();
2097   - cal.setTime(dates1);
2098   - } catch (ParseException e1) {
2099   - // TODO Auto-generated catch block
2100   - e1.printStackTrace();
  1979 + }
  1980 +
  1981 + if(!gsbm.equals("")){
  1982 + if(!clgsdm.equals(gsbm)){
  1983 + fage=false;
2101 1984 }
2102   - //周数,表分区字段
2103   - int weeks_year1 = cal.get(Calendar.WEEK_OF_YEAR);
2104   - List<ArrivalInfo> list = null;
2105   - Connection conn = null;
2106   - PreparedStatement ps = null;
2107   - ResultSet rs = null;
2108   -
2109   - String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? "
2110   - + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts";
2111   - try{
2112   - conn = DBUtils_MS.getConnection();
2113   - ps = conn.prepareStatement(sql);
2114   - ps.setString(1, line);
2115   - ps.setInt(2, weeks_year1);
2116   - ps.setLong(3, date1);
2117   - ps.setLong(4, date2);
2118   - ps.setInt(5, zd);
2119   - rs = ps.executeQuery();
2120   -
2121   - list = resultSet2Set(rs);
2122   - }catch(Exception e){
2123   - logger.error("", e);
2124   - }finally {
2125   - DBUtils_MS.close(rs, ps, conn);
2126 1985 }
2127   - return list;
  1986 +
  1987 + if(fage){
  1988 + list.add(map);
  1989 + }
  1990 +
  1991 + }
  1992 +
  1993 + if (list.size() > 20)
  1994 + break;
2128 1995 }
2129   -
2130   - //根据排班查到离站
2131   - @Override
2132   - public List<Map<String, Object>> queryInOutStrtion(String line, String date, int zd,String lzsj) {
2133   - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2134   - //查询线路所有的站点
2135   - List<ArrivalInfo> arrInfoList=this.load3(line, date, zd);
2136   - List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd);
2137   - List<Map<String, Object>> inoutList=new ArrayList<Map<String,Object>>();
2138   - //保存的所以的站点信息
2139   - Map<String, Object> map1=new HashMap<String,Object>();
2140   - map1.put("bc", "");
2141   - map1.put("nbbm", "");
2142   -
2143   - //所有的班次信息(实际排班排序)
2144   - List<ScheduleRealInfo> realList= scheduleRealInfoRepository.scheduleByDateAndLineInOut(line, date,zd+"");
2145   - for (int i = 0; i < listStation.size(); i++) {
2146   - map1.put(listStation.get(i).getStationCode()+"in"
2147   - , listStation.get(i).getStationName());
2148   - map1.put(listStation.get(i).getStationCode()+"out"
2149   - , (i+1));
2150   - }
2151   - inoutList.add(map1);
2152   -
2153   - for (int i = 0; i < realList.size(); i++) {
2154   - ScheduleRealInfo sinfo=realList.get(i);
2155   - String devuceId=BasicData.deviceId2NbbmMap.inverse().get(sinfo.getClZbh());
2156   - String sjfcsj=sinfo.getRealExecDate()+" "+sinfo.getFcsjActual()+":00";
2157   - String sjddsj=sinfo.getRealExecDate()+" "+sinfo.getZdsjActual()+":59";
2158   -
2159   - try {
2160   - Date dates1 = simpleDateFormat.parse(sjfcsj);
2161   - Date dates2=simpleDateFormat.parse(sjddsj);
2162   - Long date1=dates1.getTime();
2163   - Long date2=dates2.getTime();
2164   - List<ArrivalInfo> arrList=new ArrayList<ArrivalInfo>();
2165   - for (int j = 0; j < arrInfoList.size(); j++) {
2166   - ArrivalInfo a=arrInfoList.get(j);
2167   - if(a.getDeviceId().equals(devuceId) && a.getTs()>=date1 && a.getTs()<=date2){
2168   - arrList.add(a);
2169   - }
  1996 + return list;
  1997 + }
  1998 +
  1999 +
  2000 + @Override
  2001 + public List<Map<String, String>> userList(Map<String, Object> maps) {
  2002 + // TODO Auto-generated method stub
  2003 + // 转大写
  2004 + String jsy =maps.get("jsy").toString().toUpperCase();
  2005 + String gsbm="";
  2006 + if(maps.get("gsbm")!=null)
  2007 + gsbm=maps.get("gsbm").toString().trim();
  2008 +// String fgsbm=maps.get("fgsbm").toString().trim();
  2009 + List<Map<String, String>> list = new ArrayList<Map<String, String>>();
  2010 + Map<String, String> map;
  2011 +// Set<String> allSet = BasicData.nbbm2CompanyCodeMap.keySet();
  2012 + Set<String> allJsy = BasicData.perMap.keySet();
  2013 +
  2014 + Personnel per;
  2015 + for (String k : allJsy) {
  2016 + if (k.indexOf(jsy) != -1) {
  2017 + map = new HashMap<>();
  2018 + // 通过人员查找公司
  2019 + per = BasicData.perMap.get(k);
  2020 + String rygsdm="";
  2021 + if(null != per){
  2022 + if(per.getCompanyCode()!=null){
  2023 + rygsdm = per.getCompanyCode();
2170 2024 }
2171   -
2172   - Map<String, Object> map2=new HashMap<String,Object>();
2173   - map2.put("bc", (i+1));
2174   - map2.put("nbbm", sinfo.getClZbh());
2175   -
2176   - for (int j = 0; j < listStation.size(); j++) {
2177   - StationRoute s=listStation.get(j);
2178   - List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>();
2179   - for (int j2 = 0; j2 < arrList.size(); j2++) {
2180   - ArrivalInfo a=arrList.get(j2);
2181   - if(s.getStationCode().equals(a.getStopNo())){
2182   - arrivalList.add(a);
2183   - }
  2025 + String jboCode=per.getJobCode().substring(per.getJobCode().indexOf("-")+1);
  2026 + map.put("id", jboCode);
  2027 + map.put("text", jboCode+"/"+per.getPersonnelName());
  2028 + if(!gsbm.equals("")){
  2029 + if(rygsdm.equals(gsbm)){
  2030 + list.add(map);
2184 2031 }
2185   - Map<String, String> m=this.strInOut(arrivalList,lzsj);
2186   -
2187   - map2.put(s.getStationCode()+"in", m.get("in"));
2188   - map2.put(s.getStationCode()+"out", m.get("out"));
2189   - map2.put(s.getStationCode(), m.get("type"));
2190 2032 }
2191   - inoutList.add(map2);
2192   - } catch (ParseException e) {
2193   - // TODO Auto-generated catch block
2194   - e.printStackTrace();
2195 2033 }
2196 2034 }
2197   - return inoutList;
  2035 +
  2036 + if (list.size() > 20)
  2037 + break;
2198 2038 }
2199   -
2200   - //根据GPS查到离站
2201   - @Override
2202   - public List<Map<String, Object>> queryInOutStrtions(String line, String date, int zd,String lzsj) {
2203   - SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2204   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
2205   - + " id = ("
2206   - + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'"
2207   - + ")";
2208   - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
2209   - List<ArrivalInfo> arrInfoList=this.load4(line, date, zd,minfcsj);
2210   -
2211   - //查询线路所有的站点
2212   - List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd);
2213   - List<Map<String, Object>> inoutList=new ArrayList<Map<String,Object>>();
2214   - //保存的所以的站点信息
2215   - Map<String, Object> map1=new HashMap<String,Object>();
2216   - map1.put("bc", "");
2217   - map1.put("nbbm", "");
2218   -
2219   - for (int i = 0; i < listStation.size(); i++) {
2220   - map1.put(listStation.get(i).getStationCode()+"in"
2221   - , listStation.get(i).getStationName());
2222   - map1.put(listStation.get(i).getStationCode()+"out"
2223   - , (i+1));
2224   - }
2225   - inoutList.add(map1);
2226   -
2227   - /*for (int j = 0; j < listStation.size(); j++) {
2228   - map2=new HashMap<String,Object>();
2229   - StationRoute s=listStation.get(j);
2230   - List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>();
2231   - for (int j2 = 0; j2 < arrInfoList.size(); j2++) {
2232   - ArrivalInfo a=arrivalList.get(j2);
2233   - if(s.getStationCode().equals(a.getStopNo())){
2234   - arrivalList.add(a);
  2039 + return list;
  2040 + }
  2041 +
  2042 + public List<ArrivalInfo> load4(String line, String date, int zd,String minfcsj){
  2043 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  2044 + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
  2045 + Long date1=0L;
  2046 + Long date2=0L;
  2047 + Calendar cal = Calendar.getInstance();
  2048 + List<ArrivalInfo> list=null;
  2049 + try {
  2050 + Date dates1 = simpleDateFormat.parse(date+" "+minfcsj+":01");
  2051 + String d1=date+" "+minfcsj+":01";
  2052 +// Date dates2=simpleDateFormat.parse(date+" 23:59:59");
  2053 + date1=dates1.getTime();
  2054 +// date2=dates2.getTime();
  2055 + cal.setTime(dates1);
  2056 + int weeks_year1 = cal.get(Calendar.WEEK_OF_YEAR);
  2057 + cal.add(cal.DATE,1);//把日期往后增加一天.整数往后推,负数往前移动
  2058 + int weeks_year2 = cal.get(Calendar.WEEK_OF_YEAR);
  2059 + Date dates2=cal.getTime();
  2060 + String d2=simpleDateFormat.format(dates2);
  2061 + String sql="select *,UNIX_TIMESTAMP(times) as ts from bsth_c_arrival_info where times >= '"+d1 +"'and "
  2062 + + " times <='"+d2+"' and line_id = '"+line+"' and up_down = '"+zd+"'"
  2063 + + " order by device_id,times";
  2064 +
  2065 + list =jdbcTemplate.query(sql, new RowMapper<ArrivalInfo>() {
  2066 + @Override
  2067 + public ArrivalInfo mapRow(ResultSet arg0, int arg1) throws SQLException {
  2068 + ArrivalInfo ai=new ArrivalInfo();
  2069 + ai.setInOut(arg0.getInt("in_out"));
  2070 + ai.setDeviceId(arg0.getString("device_id"));
  2071 + ai.setStopNo(arg0.getString("stop_no"));
  2072 + ai.setDates(arg0.getDate("times"));
  2073 + ai.setTs(arg0.getLong("ts")*1000);
  2074 + return ai;
  2075 + }
  2076 + });
  2077 +
  2078 + } catch (ParseException e1) {
  2079 + // TODO Auto-generated catch block
  2080 + e1.printStackTrace();
  2081 + }
  2082 + return list;
  2083 +
  2084 + }
  2085 +
  2086 + public List<ArrivalInfo> load3(String line, String date, int zd){
  2087 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  2088 + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
  2089 + Long date1=0L;
  2090 + Long date2=0L;
  2091 + Calendar cal = Calendar.getInstance();
  2092 + try {
  2093 + Date dates1 = simpleDateFormat.parse(date+" 00:00:01");
  2094 + Date dates2=simpleDateFormat.parse(date+" 23:59:59");
  2095 + date1=dates1.getTime();
  2096 + date2=dates2.getTime();
  2097 + cal.setTime(dates1);
  2098 + } catch (ParseException e1) {
  2099 + // TODO Auto-generated catch block
  2100 + e1.printStackTrace();
  2101 + }
  2102 + //周数,表分区字段
  2103 + int weeks_year1 = cal.get(Calendar.WEEK_OF_YEAR);
  2104 + List<ArrivalInfo> list = null;
  2105 + Connection conn = null;
  2106 + PreparedStatement ps = null;
  2107 + ResultSet rs = null;
  2108 +
  2109 + String sql = "select * from bsth_c_arrival_info where line_id=? AND weeks_year=? "
  2110 + + " AND ts >= ? AND ts <=? AND up_down=? order by device_id,ts";
  2111 + try{
  2112 + conn = DBUtils_MS.getConnection();
  2113 + ps = conn.prepareStatement(sql);
  2114 + ps.setString(1, line);
  2115 + ps.setInt(2, weeks_year1);
  2116 + ps.setLong(3, date1);
  2117 + ps.setLong(4, date2);
  2118 + ps.setInt(5, zd);
  2119 + rs = ps.executeQuery();
  2120 +
  2121 + list = resultSet2Set(rs);
  2122 + }catch(Exception e){
  2123 + logger.error("", e);
  2124 + }finally {
  2125 + DBUtils_MS.close(rs, ps, conn);
  2126 + }
  2127 + return list;
  2128 + }
  2129 +
  2130 + //根据排班查到离站
  2131 + @Override
  2132 + public List<Map<String, Object>> queryInOutStrtion(String line, String date, int zd,String lzsj) {
  2133 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  2134 + //查询线路所有的站点
  2135 + List<ArrivalInfo> arrInfoList=this.load3(line, date, zd);
  2136 + List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd);
  2137 + List<Map<String, Object>> inoutList=new ArrayList<Map<String,Object>>();
  2138 + //保存的所以的站点信息
  2139 + Map<String, Object> map1=new HashMap<String,Object>();
  2140 + map1.put("bc", "");
  2141 + map1.put("nbbm", "");
  2142 +
  2143 + //所有的班次信息(实际排班排序)
  2144 + List<ScheduleRealInfo> realList= scheduleRealInfoRepository.scheduleByDateAndLineInOut(line, date,zd+"");
  2145 + for (int i = 0; i < listStation.size(); i++) {
  2146 + map1.put(listStation.get(i).getStationCode()+"in"
  2147 + , listStation.get(i).getStationName());
  2148 + map1.put(listStation.get(i).getStationCode()+"out"
  2149 + , (i+1));
  2150 + }
  2151 + inoutList.add(map1);
  2152 +
  2153 + for (int i = 0; i < realList.size(); i++) {
  2154 + ScheduleRealInfo sinfo=realList.get(i);
  2155 + String devuceId=BasicData.deviceId2NbbmMap.inverse().get(sinfo.getClZbh());
  2156 + String sjfcsj=sinfo.getRealExecDate()+" "+sinfo.getFcsjActual()+":00";
  2157 + String sjddsj=sinfo.getRealExecDate()+" "+sinfo.getZdsjActual()+":59";
  2158 +
  2159 + try {
  2160 + Date dates1 = simpleDateFormat.parse(sjfcsj);
  2161 + Date dates2=simpleDateFormat.parse(sjddsj);
  2162 + Long date1=dates1.getTime();
  2163 + Long date2=dates2.getTime();
  2164 + List<ArrivalInfo> arrList=new ArrayList<ArrivalInfo>();
  2165 + for (int j = 0; j < arrInfoList.size(); j++) {
  2166 + ArrivalInfo a=arrInfoList.get(j);
  2167 + if(a.getDeviceId().equals(devuceId) && a.getTs()>=date1 && a.getTs()<=date2){
  2168 + arrList.add(a);
  2169 + }
  2170 + }
  2171 +
  2172 + Map<String, Object> map2=new HashMap<String,Object>();
  2173 + map2.put("bc", (i+1));
  2174 + map2.put("nbbm", sinfo.getClZbh());
  2175 +
  2176 + for (int j = 0; j < listStation.size(); j++) {
  2177 + StationRoute s=listStation.get(j);
  2178 + List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>();
  2179 + for (int j2 = 0; j2 < arrList.size(); j2++) {
  2180 + ArrivalInfo a=arrList.get(j2);
  2181 + if(s.getStationCode().equals(a.getStopNo())){
  2182 + arrivalList.add(a);
  2183 + }
  2184 + }
  2185 + Map<String, String> m=this.strInOut(arrivalList,lzsj);
  2186 +
  2187 + map2.put(s.getStationCode()+"in", m.get("in"));
  2188 + map2.put(s.getStationCode()+"out", m.get("out"));
  2189 + map2.put(s.getStationCode(), m.get("type"));
  2190 + }
  2191 + inoutList.add(map2);
  2192 + } catch (ParseException e) {
  2193 + // TODO Auto-generated catch block
  2194 + e.printStackTrace();
  2195 + }
  2196 + }
  2197 + return inoutList;
  2198 + }
  2199 +
  2200 + //根据GPS查到离站
  2201 + @Override
  2202 + public List<Map<String, Object>> queryInOutStrtions(String line, String date, int zd,String lzsj) {
  2203 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  2204 + String sqlMinYysj="select start_opt from bsth_c_line_config where "
  2205 + + " id = ("
  2206 + + "select max(id) from bsth_c_line_config where line ='"+BasicData.lineId2CodeMap.inverse().get(line) +"'"
  2207 + + ")";
  2208 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  2209 + List<ArrivalInfo> arrInfoList=this.load4(line, date, zd,minfcsj);
  2210 +
  2211 + //查询线路所有的站点
  2212 + List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd);
  2213 + List<Map<String, Object>> inoutList=new ArrayList<Map<String,Object>>();
  2214 + //保存的所以的站点信息
  2215 + Map<String, Object> map1=new HashMap<String,Object>();
  2216 + map1.put("bc", "");
  2217 + map1.put("nbbm", "");
  2218 +
  2219 + for (int i = 0; i < listStation.size(); i++) {
  2220 + map1.put(listStation.get(i).getStationCode()+"in"
  2221 + , listStation.get(i).getStationName());
  2222 + map1.put(listStation.get(i).getStationCode()+"out"
  2223 + , (i+1));
  2224 + }
  2225 + inoutList.add(map1);
  2226 +
  2227 + /*for (int j = 0; j < listStation.size(); j++) {
  2228 + map2=new HashMap<String,Object>();
  2229 + StationRoute s=listStation.get(j);
  2230 + List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>();
  2231 + for (int j2 = 0; j2 < arrInfoList.size(); j2++) {
  2232 + ArrivalInfo a=arrivalList.get(j2);
  2233 + if(s.getStationCode().equals(a.getStopNo())){
  2234 + arrivalList.add(a);
2235 2235 }
2236 2236 }
2237 2237 Map<String, String> m=this.strInOut(arrivalList,lzsj);
2238   -
  2238 +
2239 2239 map2.put(s.getStationCode()+"in", m.get("in"));
2240 2240 map2.put(s.getStationCode()+"out", m.get("out"));
2241 2241 map2.put(s.getStationCode(), m.get("type"));
2242 2242 }*/
2243   - List<String> list_nbbm=new ArrayList<String>();
2244   - Map<String, Object> m=new HashMap<String,Object>();
2245   - for (int i = 0; i < arrInfoList.size(); i++) {
2246   - arrInfoList.get(i).setRoute(-1);
2247   - for (int j = 0; j < listStation.size(); j++) {
2248   - if(arrInfoList.get(i).getStopNo().equals(listStation.get(j).getStationCode())){
2249   - arrInfoList.get(i).setRoute(listStation.get(j).getStationRouteCode());
2250   -
2251   - }
2252   - }
2253   - if(m.get(arrInfoList.get(i).getDeviceId())==null){
2254   - m.put(arrInfoList.get(i).getDeviceId(), arrInfoList.get(i).getDeviceId());
2255   - list_nbbm.add(arrInfoList.get(i).getDeviceId());
  2243 + List<String> list_nbbm=new ArrayList<String>();
  2244 + Map<String, Object> m=new HashMap<String,Object>();
  2245 + for (int i = 0; i < arrInfoList.size(); i++) {
  2246 + arrInfoList.get(i).setRoute(-1);
  2247 + for (int j = 0; j < listStation.size(); j++) {
  2248 + if(arrInfoList.get(i).getStopNo().equals(listStation.get(j).getStationCode())){
  2249 + arrInfoList.get(i).setRoute(listStation.get(j).getStationRouteCode());
  2250 +
2256 2251 }
2257 2252 }
  2253 + if(m.get(arrInfoList.get(i).getDeviceId())==null){
  2254 + m.put(arrInfoList.get(i).getDeviceId(), arrInfoList.get(i).getDeviceId());
  2255 + list_nbbm.add(arrInfoList.get(i).getDeviceId());
  2256 + }
  2257 + }
2258 2258  
2259   - Map<String, Object> map2=new HashMap<String, Object>();
2260   - for (int i = 0; i < list_nbbm.size(); i++) {
2261   - String nbbm=list_nbbm.get(i);
2262   -
2263   - int zdbm =0;
2264   - int inout=-1;
2265   - List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>();
2266   - for (int j = 0; j < arrInfoList.size(); j++) {
2267   - ArrivalInfo aif=arrInfoList.get(j);
2268   -
2269   - if(aif.getDeviceId().equals(nbbm)){
2270   - map2.put("nbbm", BasicData.deviceId2NbbmMap.get(nbbm));
2271   - if(aif.getRoute()>-1){
2272   - if(((inout==aif.getInOut() && zdbm==aif.getRoute()) || !(zdbm ==aif.getRoute()))){
2273   - if(aif.getRoute()<=zdbm ){
2274   - inoutList.add(map2);
2275   - map2=new HashMap<String, Object>();
2276   - arrivalList=new ArrayList<ArrivalInfo>();
2277   - }
  2259 + Map<String, Object> map2=new HashMap<String, Object>();
  2260 + for (int i = 0; i < list_nbbm.size(); i++) {
  2261 + String nbbm=list_nbbm.get(i);
  2262 +
  2263 + int zdbm =0;
  2264 + int inout=-1;
  2265 + List<ArrivalInfo> arrivalList=new ArrayList<ArrivalInfo>();
  2266 + for (int j = 0; j < arrInfoList.size(); j++) {
  2267 + ArrivalInfo aif=arrInfoList.get(j);
  2268 +
  2269 + if(aif.getDeviceId().equals(nbbm)){
  2270 + map2.put("nbbm", BasicData.deviceId2NbbmMap.get(nbbm));
  2271 + if(aif.getRoute()>-1){
  2272 + if(((inout==aif.getInOut() && zdbm==aif.getRoute()) || !(zdbm ==aif.getRoute()))){
  2273 + if(aif.getRoute()<=zdbm ){
  2274 + inoutList.add(map2);
  2275 + map2=new HashMap<String, Object>();
  2276 + arrivalList=new ArrayList<ArrivalInfo>();
2278 2277 }
2279   - arrivalList.add(aif);
  2278 + }
  2279 + arrivalList.add(aif);
2280 2280 // if(!(zdbm ==aif.getRoute())){
2281   - Map<String, String> m_=this.strInOut(arrivalList,lzsj);
2282   - map2.put(aif.getStopNo()+"in", m_.get("in"));
2283   - map2.put(aif.getStopNo()+"out", m_.get("out"));
2284   - map2.put(aif.getStopNo(), m_.get("type"));
  2281 + Map<String, String> m_=this.strInOut(arrivalList,lzsj);
  2282 + map2.put(aif.getStopNo()+"in", m_.get("in"));
  2283 + map2.put(aif.getStopNo()+"out", m_.get("out"));
  2284 + map2.put(aif.getStopNo(), m_.get("type"));
2285 2285 // arrivalList=new ArrayList<ArrivalInfo>();
2286 2286 // }
2287   - zdbm =aif.getRoute();
2288   - inout=aif.getInOut();
2289   -
2290   - }
2291   -
  2287 + zdbm =aif.getRoute();
  2288 + inout=aif.getInOut();
  2289 +
2292 2290 }
2293   -
  2291 +
2294 2292 }
  2293 +
2295 2294 }
2296   -
2297   - return inoutList;
2298 2295 }
2299   -
2300   - public Map<String, String> strInOut(List<ArrivalInfo> lists,String lzsj){
2301   - String inout="";
2302   - SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
2303   - Long in=0L;
2304   - Long out=0L;
2305   - for(int i=0;i<lists.size();i++){
2306   - ArrivalInfo t1=lists.get(i);
2307   - if(t1.getInOut()==0){
2308   - in=t1.getTs();
2309   - t1.setJzsj(sdf.format(new Date(t1.getTs())));
2310   - for(int j=0;j<lists.size();j++){
2311   - ArrivalInfo t2=lists.get(j);
2312   - if(t2.getInOut()==1 && t2.getDeviceId().equals(t1.getDeviceId())
2313   - && t2.getStopNo().equals(t1.getStopNo())
2314   - && t2.getTs()>t1.getTs()){
2315   - t1.setCzsj(sdf.format(new Date(t2.getTs())));
2316   - out =t2.getTs();
2317   - break;
2318   - }else{
2319   - t1.setCzsj("");
2320   - out =0l;
2321   - }
  2296 +
  2297 + return inoutList;
  2298 + }
  2299 +
  2300 + public Map<String, String> strInOut(List<ArrivalInfo> lists,String lzsj){
  2301 + String inout="";
  2302 + SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
  2303 + Long in=0L;
  2304 + Long out=0L;
  2305 + for(int i=0;i<lists.size();i++){
  2306 + ArrivalInfo t1=lists.get(i);
  2307 + if(t1.getInOut()==0){
  2308 + in=t1.getTs();
  2309 + t1.setJzsj(sdf.format(new Date(t1.getTs())));
  2310 + for(int j=0;j<lists.size();j++){
  2311 + ArrivalInfo t2=lists.get(j);
  2312 + if(t2.getInOut()==1 && t2.getDeviceId().equals(t1.getDeviceId())
  2313 + && t2.getStopNo().equals(t1.getStopNo())
  2314 + && t2.getTs()>t1.getTs()){
  2315 + t1.setCzsj(sdf.format(new Date(t2.getTs())));
  2316 + out =t2.getTs();
  2317 + break;
  2318 + }else{
  2319 + t1.setCzsj("");
  2320 + out =0l;
2322 2321 }
2323   -
2324   - }else{
2325   - out =t1.getTs();
2326   - t1.setCzsj(sdf.format(new Date(t1.getTs())));
2327   - for(int j=0;j<lists.size();j++){
2328   - ArrivalInfo t2=lists.get(j);
2329   - if(t2.getInOut()==0 && t2.getDeviceId().equals(t1.getDeviceId())
2330   - && t2.getStopNo().equals(t1.getStopNo())
2331   - && t2.getTs()>t1.getTs()){
2332   - in =t2.getTs();
2333   - t1.setJzsj(sdf.format(new Date(t2.getTs())));
2334   - break;
2335   - }
  2322 + }
  2323 +
  2324 + }else{
  2325 + out =t1.getTs();
  2326 + t1.setCzsj(sdf.format(new Date(t1.getTs())));
  2327 + for(int j=0;j<lists.size();j++){
  2328 + ArrivalInfo t2=lists.get(j);
  2329 + if(t2.getInOut()==0 && t2.getDeviceId().equals(t1.getDeviceId())
  2330 + && t2.getStopNo().equals(t1.getStopNo())
  2331 + && t2.getTs()>t1.getTs()){
  2332 + in =t2.getTs();
  2333 + t1.setJzsj(sdf.format(new Date(t2.getTs())));
  2334 + break;
2336 2335 }
2337 2336 }
2338 2337 }
2339   -
2340   - Map<String, String> map=new HashMap<String,String>();
2341   - if(in>0 ){
2342   - map.put("in",sdf.format(new Date(in)));
2343   -
  2338 + }
  2339 +
  2340 + Map<String, String> map=new HashMap<String,String>();
  2341 + if(in>0 ){
  2342 + map.put("in",sdf.format(new Date(in)));
  2343 +
  2344 + }else{
  2345 + map.put("in", "");
  2346 + }
  2347 + if(out>0){
  2348 + map.put("out", sdf.format(new Date(out)));
  2349 + }else{
  2350 + map.put("out", "");
  2351 + }
  2352 + Long sj=1000000000L;
  2353 + if(!lzsj.trim().equals("")){
  2354 + sj =Long.parseLong(lzsj);
  2355 + }
  2356 + if(in>0 && out >0){
  2357 + if((out-in)/1000>sj){
  2358 + map.put("type", "y");
2344 2359 }else{
2345   - map.put("in", "");
  2360 + map.put("type", "n");
  2361 + }
  2362 + }
  2363 + return map;
  2364 + }
  2365 + @Override
  2366 + public List<StationRoute> queryStrinon(String line, int zd) {
  2367 + // TODO Auto-generated method stub
  2368 + List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd);
  2369 + return listStation;
  2370 + }
  2371 + @Override
  2372 + public List<Map<String, Object>> countByList(Map<String, Object> map) {
  2373 + // TODO Auto-generated method stub
  2374 +
  2375 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  2376 + String gsdm="";
  2377 + if(map.get("gsdm")!=null){
  2378 + gsdm=map.get("gsdm").toString();
  2379 + }
  2380 + String fgsdm="";
  2381 + if(map.get("fgsdm")!=null){
  2382 + fgsdm=map.get("fgsdm").toString();
  2383 + }
  2384 + String line="";
  2385 + if(map.get("line")!=null){
  2386 + line=map.get("line").toString();
  2387 + }
  2388 + String date="";
  2389 + if(map.get("date")!=null){
  2390 + date=map.get("date").toString();
  2391 + }
  2392 + String date2="";
  2393 + if(map.get("date2")!=null){
  2394 + date2=map.get("date2").toString();
  2395 + }
  2396 + String xlName="";
  2397 + if(map.get("xlName")!=null){
  2398 + xlName=map.get("xlName").toString();
  2399 + }
  2400 + String type="";
  2401 + if(map.get("type")!=null){
  2402 + type=map.get("type").toString();
  2403 + }
  2404 + //所有班次信息
  2405 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  2406 + line =line.trim();
  2407 + if(line.equals("")){
  2408 + //查询所有线路
  2409 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
  2410 + }else{
  2411 + //查询单条线路
  2412 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
  2413 + }
  2414 +
  2415 + String sql="select r.xl_bm"
  2416 + + " from bsth_c_s_sp_info_real r where"
  2417 + + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
  2418 +
  2419 +
  2420 + if(line.equals("")){
  2421 + sql +="and r.gs_bm='"+gsdm+"' "
  2422 + + " and r.fgs_bm='"+fgsdm+"'";
  2423 + }else{
  2424 + sql += " and r.xl_bm = '"+line+"'";
  2425 + }
  2426 + sql += " group by r.xl_bm";
  2427 +
  2428 + List<String> listLine=jdbcTemplate.query(sql, new RowMapper<String>() {
  2429 + @Override
  2430 + public String mapRow(ResultSet arg0, int arg1) throws SQLException {
  2431 + String ve = arg0.getString("xl_bm");
  2432 + return ve;
2346 2433 }
2347   - if(out>0){
2348   - map.put("out", sdf.format(new Date(out)));
  2434 + });
  2435 + for (int i = 0; i < listLine.size(); i++) {
  2436 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
  2437 + String lineStr=listLine.get(i);
  2438 + for (int j = 0; j < list.size(); j++) {
  2439 + ScheduleRealInfo s=list.get(j);
  2440 + if(s.getXlBm().equals(lineStr)){
  2441 + lists.add(s);
  2442 + }
  2443 + }
  2444 +
  2445 + //计算线路的各项公里
  2446 + if(lists.size()>0){
  2447 + Map<String, Object> newMap=staticTj(lists,"z");
  2448 + lMap.add(newMap);
  2449 + }
  2450 + }
  2451 + if(list.size()>0){
  2452 + Map<String, Object> newMap=staticTj(list,"f");
  2453 + lMap.add(newMap);
  2454 + }
  2455 + if(type.equals("export")){
  2456 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  2457 + Map<String, Object> m = new HashMap<String, Object>();
  2458 + m.put("date", date);
  2459 + m.put("date1", date2);
  2460 + String by=map.get("by").toString();
  2461 + String xls="";
  2462 + if(by.equals("sj")){
  2463 + xls="countByLine.xls";
2349 2464 }else{
2350   - map.put("out", "");
  2465 + xls="countByLines.xls";
2351 2466 }
2352   - Long sj=1000000000L;
2353   - if(!lzsj.trim().equals("")){
2354   - sj =Long.parseLong(lzsj);
  2467 + ReportUtils ee = new ReportUtils();
  2468 + try {
  2469 + listI.add(lMap.iterator());
  2470 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  2471 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  2472 + path + "export/线路公里统计表.xls");
  2473 + } catch (Exception e) {
  2474 + // TODO: handle exception
  2475 + e.printStackTrace();
2355 2476 }
2356   - if(in>0 && out >0){
2357   - if((out-in)/1000>sj){
2358   - map.put("type", "y");
2359   - }else{
2360   - map.put("type", "n");
  2477 + }
  2478 + return lMap;
  2479 + }
  2480 +
  2481 +
  2482 + public final Map<String, Object> staticTj(List<ScheduleRealInfo> list,String status){
  2483 +
  2484 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  2485 + for(int i=0;i<list.size();i++){
  2486 + ScheduleRealInfo s=list.get(i);
  2487 + Set<ChildTaskPlan> cts = s.getcTasks();
  2488 + if(cts != null && cts.size() > 0){
  2489 + lists.add(s);
  2490 + }else{
  2491 + if(s.getZdsjActual()!=null){
  2492 + lists.add(s);
2361 2493 }
2362 2494 }
2363   - return map;
2364   - }
2365   - @Override
2366   - public List<StationRoute> queryStrinon(String line, int zd) {
2367   - // TODO Auto-generated method stub
2368   - List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd);
2369   - return listStation;
2370   - }
2371   - @Override
2372   - public List<Map<String, Object>> countByList(Map<String, Object> map) {
2373   - // TODO Auto-generated method stub
2374   -
2375   - List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
2376   - String gsdm="";
2377   - if(map.get("gsdm")!=null){
2378   - gsdm=map.get("gsdm").toString();
2379   - }
2380   - String fgsdm="";
2381   - if(map.get("fgsdm")!=null){
2382   - fgsdm=map.get("fgsdm").toString();
2383   - }
2384   - String line="";
2385   - if(map.get("line")!=null){
2386   - line=map.get("line").toString();
2387   - }
2388   - String date="";
2389   - if(map.get("date")!=null){
2390   - date=map.get("date").toString();
2391   - }
2392   - String date2="";
2393   - if(map.get("date2")!=null){
2394   - date2=map.get("date2").toString();
2395   - }
2396   - String xlName="";
2397   - if(map.get("xlName")!=null){
2398   - xlName=map.get("xlName").toString();
2399   - }
2400   - String type="";
2401   - if(map.get("type")!=null){
2402   - type=map.get("type").toString();
2403   - }
2404   - //所有班次信息
2405   - List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
2406   - line =line.trim();
2407   - if(line.equals("")){
2408   - //查询所有线路
2409   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
2410   - }else{
2411   - //查询单条线路
2412   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
2413   - }
2414   -
2415   - String sql="select r.xl_bm"
2416   - + " from bsth_c_s_sp_info_real r where"
2417   - + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
2418   -
2419   -
2420   - if(line.equals("")){
2421   - sql +="and r.gs_bm='"+gsdm+"' "
2422   - + " and r.fgs_bm='"+fgsdm+"'";
  2495 + }
  2496 + Map<String, Object> map = new HashMap<String, Object>();
  2497 + if(list.size()>0){
  2498 + if(status.equals("f")){
  2499 + map.put("xlName","合计");
  2500 + map.put("gs", "");
  2501 + map.put("fgs", "");
2423 2502 }else{
2424   - sql += " and r.xl_bm = '"+line+"'";
  2503 + map.put("xlName", list.get(0).getXlName());
  2504 + map.put("gs", list.get(0).getGsName());
  2505 + map.put("fgs", list.get(0).getFgsName());
  2506 + map.put("jGh", list.get(0).getjGh());
  2507 + map.put("sGh", list.get(0).getsGh()==null?"":list.get(0).getsGh());
  2508 + map.put("nbbm",list.get(0).getClZbh());
  2509 + map.put("line", list.get(0).getXlBm());
2425 2510 }
2426   - sql += " group by r.xl_bm";
2427   -
2428   - List<String> listLine=jdbcTemplate.query(sql, new RowMapper<String>() {
2429   - @Override
2430   - public String mapRow(ResultSet arg0, int arg1) throws SQLException {
2431   - String ve = arg0.getString("xl_bm");
2432   - return ve;
  2511 +
  2512 + double jhyygl=culateService.culateJhgl(list);//计划营运公里
  2513 + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
  2514 + map.put("jhlc", jhyygl);
  2515 + map.put("jcclc", jhjcclc);
  2516 + map.put("jhzlc", Arith.add(jhyygl, jhjcclc));//计划总里程
  2517 +
  2518 + //计划内外营运
  2519 + Map<String, Double> culateSjlcMap=culateService.culateSjlcMap(lists);
  2520 + double jhnlc=culateSjlcMap.get("jhnlc");
  2521 + double jhwlc=culateSjlcMap.get("jhwlc");
  2522 + map.put("jhnlc", jhnlc);
  2523 + map.put("jhwlc", jhwlc);
  2524 + double zyylc=Arith.add(jhnlc, jhwlc);
  2525 +
  2526 + //计划内外进出场
  2527 + Map<String, Double> culateSjJcclcMap=culateService.culateSjJcclcMap(lists);
  2528 + double jhwjcclc=culateSjJcclcMap.get("jhwlc");
  2529 + double jhnjcclc=culateSjJcclcMap.get("jhnlc");
  2530 + map.put("jhwjcclc", jhwjcclc);
  2531 + map.put("jhnjcclc", jhnjcclc);
  2532 + double zjcclc=Arith.add(jhwjcclc, jhnjcclc);
  2533 +
  2534 + //临加公里
  2535 + Map<String, Double> culateLjMile=culateService.culateLjMile(lists);
  2536 + double ljyy=culateLjMile.get("ljyy");
  2537 + double ljjcc=culateLjMile.get("ljjcc");
  2538 + double ljkfks=culateLjMile.get("ljkfks");
  2539 + map.put("ljyy", ljyy);
  2540 + map.put("ljjcc", ljjcc);
  2541 + map.put("ljkfks", ljkfks);
  2542 +
  2543 + double ljlc=Arith.add(Arith.add(ljyy, ljjcc),ljkfks);
  2544 +
  2545 + double lbss=culateService.culateSsMile(list);//烂班少驶
  2546 + map.put("lbss", lbss);
  2547 + map.put("ssgl_lz", culateService.culateSsMileXx(list, "路阻"));
  2548 + map.put("ssgl_dm", culateService.culateSsMileXx(list, "吊慢"));
  2549 + map.put("ssgl_gz", culateService.culateSsMileXx(list, "故障"));
  2550 + map.put("ssgl_jf", culateService.culateSsMileXx(list, "纠纷"));
  2551 + map.put("ssgl_zs", culateService.culateSsMileXx(list, "肇事"));
  2552 + map.put("ssgl_qr", culateService.culateSsMileXx(list, "缺人"));
  2553 + map.put("ssgl_qc", culateService.culateSsMileXx(list, "缺车"));
  2554 + map.put("ssgl_kx", culateService.culateSsMileXx(list, "客稀"));
  2555 + map.put("ssgl_qh", culateService.culateSsMileXx(list, "气候"));
  2556 + map.put("ssgl_yw", culateService.culateSsMileXx(list, "援外"));
  2557 + map.put("ssgl_other", culateService.culateSsMileXx(list, "其他"));
  2558 +
  2559 +
  2560 + double zrwjcclc=culateService.culateZrwJccLc(list, "故障");
  2561 + double zrwjcclc1=culateService.culateZrwJccLc(list, "肇事");
  2562 + double zrwjcclc2=culateService.culateZrwJccLc(list, "纠纷");
  2563 + double zrwjcclcqt=culateService.culateZrwJccLc(list, "其他");
  2564 + map.put("jhwjcclc_z", Arith.add(jhwjcclc,zrwjcclcqt));
  2565 + map.put("zrwjcclc", zrwjcclc);
  2566 + map.put("zrwjcclc1", zrwjcclc1);
  2567 + map.put("zrwjcclc2", zrwjcclc2);
  2568 + map.put("zrwjcclcqt", zrwjcclcqt);
  2569 + double zrwjcc=Arith.add(Arith.add(Arith.add(zrwjcclc, zrwjcclc1), zrwjcclc2),zrwjcclcqt);
  2570 + double kfks=Arith.add(culateService.culateKfksLc(lists),culateService.culateZrwJccLc(list, "空放"));
  2571 + map.put("kfks", kfks);
  2572 + double zlc=Arith.add(Arith.add(Arith.add(zrwjcc, ljlc),
  2573 + Arith.add(zjcclc, zyylc)),kfks);
  2574 + map.put("zlc", zlc);
  2575 + }
  2576 + return map;
  2577 + }
  2578 + @Override
  2579 + public List<Map<String, Object>> countByBusList(Map<String, Object> map) {
  2580 + // TODO Auto-generated method stub
  2581 + SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
  2582 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  2583 + List<Map<String, Object>> lMaps = new ArrayList<Map<String, Object>>();
  2584 + String gsdm="";
  2585 + if(map.get("gsdm")!=null){
  2586 + gsdm=map.get("gsdm").toString();
  2587 + }
  2588 + String fgsdm="";
  2589 + if(map.get("fgsdm")!=null){
  2590 + fgsdm=map.get("fgsdm").toString();
  2591 + }
  2592 + String line="";
  2593 + if(map.get("line")!=null){
  2594 + line=map.get("line").toString();
  2595 + }
  2596 + String date="";
  2597 + if(map.get("date")!=null){
  2598 + date=map.get("date").toString();
  2599 + }
  2600 + String date2="";
  2601 + if(map.get("date2")!=null){
  2602 + date2=map.get("date2").toString();
  2603 + }
  2604 + String xlName="";
  2605 + if(map.get("xlName")!=null){
  2606 + xlName=map.get("xlName").toString();
  2607 + }
  2608 + String zt="";
  2609 + if(map.get("zt")!=null){
  2610 + zt=map.get("zt").toString();
  2611 + }
  2612 + String type="";
  2613 + if(map.get("type")!=null){
  2614 + type=map.get("type").toString();
  2615 + }
  2616 + //所有班次信息
  2617 + List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  2618 + line =line.trim();
  2619 + if(line.equals("")){
  2620 + //查询所有线路
  2621 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
  2622 + }else{
  2623 + //查询单条线路
  2624 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
  2625 + }
  2626 + String ylbSql=" select * from bsth_c_ylb where rq BETWEEN '"+date+"' and '"+date2+"'";
  2627 + if(line.equals("")){
  2628 + ylbSql +="and ssgsdm='"+gsdm+"' "
  2629 + + " and fgsdm='"+fgsdm+"'";
  2630 + }else{
  2631 + ylbSql += " and xlbm = '"+line+"'";
  2632 + }
  2633 + List<Ylb> ylbList=ylbList(ylbSql);
  2634 + String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+date+"' and '"+date2+"'";
  2635 + if(line.equals("")){
  2636 + dlbSql +="and ssgsdm='"+gsdm+"' "
  2637 + + " and fgsdm='"+fgsdm+"'";
  2638 + }else{
  2639 + dlbSql += " and xlbm = '"+line+"'";
  2640 + }
  2641 + List<Dlb> dlbList=dlbList(dlbSql);
  2642 + String sql="select r.xl_bm,r.schedule_date_str,r.cl_zbh,r.j_gh,r.s_gh"
  2643 + + " from bsth_c_s_sp_info_real r where"
  2644 + + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
  2645 + if(line.equals("")){
  2646 + sql +="and r.gs_bm='"+gsdm+"' "
  2647 + + " and r.fgs_bm='"+fgsdm+"'";
  2648 + }else{
  2649 + sql += " and r.xl_bm = '"+line+"'";
  2650 + }
  2651 + sql += " group by r.xl_bm,r.cl_zbh,r.schedule_date_str,r.j_gh,r.s_gh";
  2652 +
  2653 + List<Map<String, Object>> listGroupBy=jdbcTemplate.query(sql, new RowMapper<Map<String, Object>>() {
  2654 + @Override
  2655 + public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
  2656 + Map<String, Object> map=new HashMap<String,Object>();
  2657 + map.put("line",arg0.getString("xl_bm"));
  2658 + map.put("date", arg0.getString("schedule_date_str"));
  2659 + map.put("nbbm", arg0.getString("cl_zbh"));
  2660 + map.put("jGh", arg0.getString("j_gh"));
  2661 + map.put("sGh", arg0.getString("s_gh"));
  2662 + return map;
  2663 + }
  2664 + });
  2665 + for (int i = 0; i < listGroupBy.size(); i++) {
  2666 + Map<String, Object> m=listGroupBy.get(i);
  2667 + String xl_bm=m.get("line")==null?"":m.get("line").toString();
  2668 + String dateStr=m.get("date")==null?"":m.get("date").toString();
  2669 + String nbbm =m.get("nbbm")==null?"":m.get("nbbm").toString();
  2670 + String jGh= m.get("jGh")==null?"":m.get("jGh").toString();
  2671 + String sGh= m.get("sGh")==null?"":m.get("sGh").toString();
  2672 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  2673 + for (int j = 0; j < list.size(); j++) {
  2674 + ScheduleRealInfo s=list.get(j);
  2675 + if(zt.equals("zbh")){
  2676 + if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh())){
  2677 + lists.add(s);
2433 2678 }
2434   - });
2435   - for (int i = 0; i < listLine.size(); i++) {
2436   - List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2437   - String lineStr=listLine.get(i);
2438   - for (int j = 0; j < list.size(); j++) {
2439   - ScheduleRealInfo s=list.get(j);
2440   - if(s.getXlBm().equals(lineStr)){
2441   - lists.add(s);
2442   - }
2443   - }
2444   -
2445   - //计算线路的各项公里
2446   - if(lists.size()>0){
2447   - Map<String, Object> newMap=staticTj(lists,"z");
2448   - lMap.add(newMap);
2449   - }
2450   - }
2451   - if(list.size()>0){
2452   - Map<String, Object> newMap=staticTj(list,"f");
2453   - lMap.add(newMap);
2454   - }
2455   - if(type.equals("export")){
2456   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
2457   - Map<String, Object> m = new HashMap<String, Object>();
2458   - m.put("date", date);
2459   - m.put("date1", date2);
2460   - String by=map.get("by").toString();
2461   - String xls="";
2462   - if(by.equals("sj")){
2463   - xls="countByLine.xls";
2464   - }else{
2465   - xls="countByLines.xls";
2466   - }
2467   - ReportUtils ee = new ReportUtils();
2468   - try {
2469   - listI.add(lMap.iterator());
2470   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2471   - ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
2472   - path + "export/线路公里统计表.xls");
2473   - } catch (Exception e) {
2474   - // TODO: handle exception
2475   - e.printStackTrace();
2476   - }
2477   - }
2478   - return lMap;
2479   - }
2480   -
2481   -
2482   - public final Map<String, Object> staticTj(List<ScheduleRealInfo> list,String status){
2483   -
2484   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
2485   - for(int i=0;i<list.size();i++){
2486   - ScheduleRealInfo s=list.get(i);
2487   - Set<ChildTaskPlan> cts = s.getcTasks();
2488   - if(cts != null && cts.size() > 0){
2489   - lists.add(s);
2490   - }else{
2491   - if(s.getZdsjActual()!=null){
2492   - lists.add(s);
2493   - }
2494   - }
2495   - }
2496   - Map<String, Object> map = new HashMap<String, Object>();
2497   - if(list.size()>0){
2498   - if(status.equals("f")){
2499   - map.put("xlName","合计");
2500   - map.put("gs", "");
2501   - map.put("fgs", "");
2502   - }else{
2503   - map.put("xlName", list.get(0).getXlName());
2504   - map.put("gs", list.get(0).getGsName());
2505   - map.put("fgs", list.get(0).getFgsName());
2506   - map.put("jGh", list.get(0).getjGh());
2507   - map.put("sGh", list.get(0).getsGh()==null?"":list.get(0).getsGh());
2508   - map.put("nbbm",list.get(0).getClZbh());
2509   - map.put("line", list.get(0).getXlBm());
2510   - }
2511   -
2512   - double jhyygl=culateService.culateJhgl(list);//计划营运公里
2513   - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
2514   - map.put("jhlc", jhyygl);
2515   - map.put("jcclc", jhjcclc);
2516   - map.put("jhzlc", Arith.add(jhyygl, jhjcclc));//计划总里程
2517   -
2518   - //计划内外营运
2519   - Map<String, Double> culateSjlcMap=culateService.culateSjlcMap(lists);
2520   - double jhnlc=culateSjlcMap.get("jhnlc");
2521   - double jhwlc=culateSjlcMap.get("jhwlc");
2522   - map.put("jhnlc", jhnlc);
2523   - map.put("jhwlc", jhwlc);
2524   - double zyylc=Arith.add(jhnlc, jhwlc);
2525   -
2526   - //计划内外进出场
2527   - Map<String, Double> culateSjJcclcMap=culateService.culateSjJcclcMap(lists);
2528   - double jhwjcclc=culateSjJcclcMap.get("jhwlc");
2529   - double jhnjcclc=culateSjJcclcMap.get("jhnlc");
2530   - map.put("jhwjcclc", jhwjcclc);
2531   - map.put("jhnjcclc", jhnjcclc);
2532   - double zjcclc=Arith.add(jhwjcclc, jhnjcclc);
2533   -
2534   - //临加公里
2535   - Map<String, Double> culateLjMile=culateService.culateLjMile(lists);
2536   - double ljyy=culateLjMile.get("ljyy");
2537   - double ljjcc=culateLjMile.get("ljjcc");
2538   - double ljkfks=culateLjMile.get("ljkfks");
2539   - map.put("ljyy", ljyy);
2540   - map.put("ljjcc", ljjcc);
2541   - map.put("ljkfks", ljkfks);
2542   -
2543   - double ljlc=Arith.add(Arith.add(ljyy, ljjcc),ljkfks);
2544   -
2545   - double lbss=culateService.culateSsMile(list);//烂班少驶
2546   - map.put("lbss", lbss);
2547   - map.put("ssgl_lz", culateService.culateSsMileXx(list, "路阻"));
2548   - map.put("ssgl_dm", culateService.culateSsMileXx(list, "吊慢"));
2549   - map.put("ssgl_gz", culateService.culateSsMileXx(list, "故障"));
2550   - map.put("ssgl_jf", culateService.culateSsMileXx(list, "纠纷"));
2551   - map.put("ssgl_zs", culateService.culateSsMileXx(list, "肇事"));
2552   - map.put("ssgl_qr", culateService.culateSsMileXx(list, "缺人"));
2553   - map.put("ssgl_qc", culateService.culateSsMileXx(list, "缺车"));
2554   - map.put("ssgl_kx", culateService.culateSsMileXx(list, "客稀"));
2555   - map.put("ssgl_qh", culateService.culateSsMileXx(list, "气候"));
2556   - map.put("ssgl_yw", culateService.culateSsMileXx(list, "援外"));
2557   - map.put("ssgl_other", culateService.culateSsMileXx(list, "其他"));
2558   -
2559   -
2560   - double zrwjcclc=culateService.culateZrwJccLc(list, "故障");
2561   - double zrwjcclc1=culateService.culateZrwJccLc(list, "肇事");
2562   - double zrwjcclc2=culateService.culateZrwJccLc(list, "纠纷");
2563   - double zrwjcclcqt=culateService.culateZrwJccLc(list, "其他");
2564   - map.put("jhwjcclc_z", Arith.add(jhwjcclc,zrwjcclcqt));
2565   - map.put("zrwjcclc", zrwjcclc);
2566   - map.put("zrwjcclc1", zrwjcclc1);
2567   - map.put("zrwjcclc2", zrwjcclc2);
2568   - map.put("zrwjcclcqt", zrwjcclcqt);
2569   - double zrwjcc=Arith.add(Arith.add(Arith.add(zrwjcclc, zrwjcclc1), zrwjcclc2),zrwjcclcqt);
2570   - double kfks=Arith.add(culateService.culateKfksLc(lists),culateService.culateZrwJccLc(list, "空放"));
2571   - map.put("kfks", kfks);
2572   - double zlc=Arith.add(Arith.add(Arith.add(zrwjcc, ljlc),
2573   - Arith.add(zjcclc, zyylc)),kfks);
2574   - map.put("zlc", zlc);
2575   - }
2576   - return map;
2577   - }
2578   - @Override
2579   - public List<Map<String, Object>> countByBusList(Map<String, Object> map) {
2580   - // TODO Auto-generated method stub
2581   - SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd");
2582   - List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
2583   - List<Map<String, Object>> lMaps = new ArrayList<Map<String, Object>>();
2584   - String gsdm="";
2585   - if(map.get("gsdm")!=null){
2586   - gsdm=map.get("gsdm").toString();
2587   - }
2588   - String fgsdm="";
2589   - if(map.get("fgsdm")!=null){
2590   - fgsdm=map.get("fgsdm").toString();
2591   - }
2592   - String line="";
2593   - if(map.get("line")!=null){
2594   - line=map.get("line").toString();
2595   - }
2596   - String date="";
2597   - if(map.get("date")!=null){
2598   - date=map.get("date").toString();
2599   - }
2600   - String date2="";
2601   - if(map.get("date2")!=null){
2602   - date2=map.get("date2").toString();
2603   - }
2604   - String xlName="";
2605   - if(map.get("xlName")!=null){
2606   - xlName=map.get("xlName").toString();
2607   - }
2608   - String zt="";
2609   - if(map.get("zt")!=null){
2610   - zt=map.get("zt").toString();
2611   - }
2612   - String type="";
2613   - if(map.get("type")!=null){
2614   - type=map.get("type").toString();
2615   - }
2616   - //所有班次信息
2617   - List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
2618   - line =line.trim();
2619   - if(line.equals("")){
2620   - //查询所有线路
2621   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
2622   - }else{
2623   - //查询单条线路
2624   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
2625   - }
2626   - String ylbSql=" select * from bsth_c_ylb where rq BETWEEN '"+date+"' and '"+date2+"'";
2627   - if(line.equals("")){
2628   - ylbSql +="and ssgsdm='"+gsdm+"' "
2629   - + " and fgsdm='"+fgsdm+"'";
2630 2679 }else{
2631   - ylbSql += " and xlbm = '"+line+"'";
  2680 + if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh())
  2681 + && dateStr.equals(s.getScheduleDateStr())
  2682 + && jGh.equals(s.getjGh()) && sGh.equals(s.getsGh())){
  2683 + lists.add(s);
  2684 + }
  2685 + }
  2686 + }
  2687 +
  2688 + if(zt.equals("zbh")){
  2689 + Map<String, Object> newMap=staticTj(lists, "");
  2690 + double yhl=0.0;
  2691 + double jzl=0.0;
  2692 + double hyl=0.0;
  2693 + double dhl=0.0;
  2694 + double cdl=0.0;
  2695 + for (int j = 0; j < ylbList.size(); j++) {
  2696 + Ylb y=ylbList.get(j);
  2697 + if(nbbm.equals(y.getNbbm()) && xl_bm.equals(y.getXlbm())){
  2698 + yhl=Arith.add(yhl, y.getYh());
  2699 + jzl=Arith.add(jzl, y.getJzl());
  2700 + hyl=Arith.add(hyl, y.getYh());
  2701 + }
  2702 +
2632 2703 }
2633   - List<Ylb> ylbList=ylbList(ylbSql);
2634   - String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+date+"' and '"+date2+"'";
2635   - if(line.equals("")){
2636   - dlbSql +="and ssgsdm='"+gsdm+"' "
2637   - + " and fgsdm='"+fgsdm+"'";
  2704 + for (int j = 0; j < dlbList.size(); j++) {
  2705 + Dlb d=dlbList.get(j);
  2706 + if(nbbm.equals(d.getNbbm())&&xl_bm.equals(d.getXlbm())){
  2707 + dhl=Arith.add(dhl, d.getHd());
  2708 + cdl=Arith.add(cdl, d.getCdl());
  2709 + }
  2710 + }
  2711 + if(date.equals(date2)){
  2712 + newMap.put("rq",date);
2638 2713 }else{
2639   - dlbSql += " and xlbm = '"+line+"'";
  2714 + newMap.put("rq",date+"至"+date2);
  2715 + }
  2716 + newMap.put("yhl", yhl);
  2717 + newMap.put("jzl", jzl);
  2718 + newMap.put("hyl", hyl);
  2719 + newMap.put("dhl", dhl);
  2720 + newMap.put("cdl", cdl);
  2721 + lMap.add(newMap);
  2722 + }else{
  2723 + Map<String, Object> newMap=staticTj(lists, "");
  2724 + double lc=Double.parseDouble(newMap.get("zlc").toString());
  2725 + double yhl=0.0;
  2726 + double jzl=0.0;
  2727 + double hyl=0.0;
  2728 + double dhl=0.0;
  2729 + double cdl=0.0;
  2730 + double zlc=0.0;
  2731 + for (int j = 0; j < ylbList.size(); j++) {
  2732 + Ylb y=ylbList.get(j);
  2733 + if(nbbm.equals(y.getNbbm()) && xl_bm.equals(y.getXlbm())
  2734 + &&dateStr.equals(sdf.format(y.getRq()))
  2735 + &&jGh.equals(y.getName())){
  2736 + yhl=Arith.add(yhl, y.getYh());
  2737 + jzl=Arith.add(jzl, y.getJzl());
  2738 + hyl=Arith.add(hyl, y.getYh());
  2739 + zlc=Arith.add(zlc, y.getZlc());
  2740 + }
  2741 +
  2742 + }
  2743 +
  2744 + for (int j = 0; j < dlbList.size(); j++) {
  2745 + Dlb d=dlbList.get(j);
  2746 + if(nbbm.equals(d.getNbbm())&&xl_bm.equals(d.getXlbm())
  2747 + &&dateStr.equals(sdf.format(d.getRq()))
  2748 + &&jGh.equals(d.getName())){
  2749 + dhl=Arith.add(dhl, d.getHd());
  2750 + cdl=Arith.add(cdl, d.getCdl());
  2751 + zlc=Arith.add(zlc, d.getZlc());
  2752 + }
2640 2753 }
2641   - List<Dlb> dlbList=dlbList(dlbSql);
2642   - String sql="select r.xl_bm,r.schedule_date_str,r.cl_zbh,r.j_gh,r.s_gh"
2643   - + " from bsth_c_s_sp_info_real r where"
2644   - + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
  2754 + double div=0.0;
  2755 + if(lc>0){
  2756 + div=Arith.div(zlc, lc,2);
  2757 + }
  2758 + newMap.put("yhl", yhl*div);
  2759 + newMap.put("jzl", jzl*div);
  2760 + newMap.put("hyl", hyl*div);
  2761 + newMap.put("dhl", dhl*div);
  2762 + newMap.put("cdl", cdl*div);
  2763 + lMaps.add(newMap);
  2764 + }
  2765 +
  2766 + }
  2767 + if(!zt.equals("zbh")){
  2768 + String sqls="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh"
  2769 + + " from bsth_c_s_sp_info_real r where"
  2770 + + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
2645 2771 if(line.equals("")){
2646   - sql +="and r.gs_bm='"+gsdm+"' "
  2772 + sqls +="and r.gs_bm='"+gsdm+"' "
2647 2773 + " and r.fgs_bm='"+fgsdm+"'";
2648 2774 }else{
2649   - sql += " and r.xl_bm = '"+line+"'";
  2775 + sqls += " and r.xl_bm = '"+line+"'";
2650 2776 }
2651   - sql += " group by r.xl_bm,r.cl_zbh,r.schedule_date_str,r.j_gh,r.s_gh";
2652   -
2653   - List<Map<String, Object>> listGroupBy=jdbcTemplate.query(sql, new RowMapper<Map<String, Object>>() {
  2777 + sqls += " group by r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh";
  2778 +
  2779 + List<Map<String, Object>> listGroupBys=jdbcTemplate.query(sqls, new RowMapper<Map<String, Object>>() {
2654 2780 @Override
2655 2781 public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
2656 2782 Map<String, Object> map=new HashMap<String,Object>();
2657 2783 map.put("line",arg0.getString("xl_bm"));
2658   - map.put("date", arg0.getString("schedule_date_str"));
2659 2784 map.put("nbbm", arg0.getString("cl_zbh"));
2660 2785 map.put("jGh", arg0.getString("j_gh"));
2661 2786 map.put("sGh", arg0.getString("s_gh"));
2662 2787 return map;
2663 2788 }
2664 2789 });
2665   - for (int i = 0; i < listGroupBy.size(); i++) {
2666   - Map<String, Object> m=listGroupBy.get(i);
2667   - String xl_bm=m.get("line")==null?"":m.get("line").toString();
2668   - String dateStr=m.get("date")==null?"":m.get("date").toString();
2669   - String nbbm =m.get("nbbm")==null?"":m.get("nbbm").toString();
2670   - String jGh= m.get("jGh")==null?"":m.get("jGh").toString();
2671   - String sGh= m.get("sGh")==null?"":m.get("sGh").toString();
2672   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
2673   - for (int j = 0; j < list.size(); j++) {
2674   - ScheduleRealInfo s=list.get(j);
2675   - if(zt.equals("zbh")){
2676   - if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh())){
2677   - lists.add(s);
2678   - }
2679   - }else{
2680   - if(xl_bm.equals(s.getXlBm()) && nbbm.equals(s.getClZbh())
2681   - && dateStr.equals(s.getScheduleDateStr())
2682   - && jGh.equals(s.getjGh()) && sGh.equals(s.getsGh())){
2683   - lists.add(s);
2684   - }
2685   - }
  2790 + lMap=lists(listGroupBys, lMaps, gsdm, fgsdm, date, date2);
  2791 +
  2792 + }
  2793 + if(type.equals("export")){
  2794 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  2795 + Map<String, Object> m = new HashMap<String, Object>();
  2796 + m.put("date", date);
  2797 + m.put("date1", date2);
  2798 + String xls="";
  2799 + String by=map.get("by").toString();
  2800 +
  2801 +
  2802 + if(zt.equals("zbh")){
  2803 + if(by.equals("sj")){
  2804 + xls="countByBus1.xls";
  2805 + }else{
  2806 + xls="countByBus1s.xls";
2686 2807 }
2687   -
2688   - if(zt.equals("zbh")){
2689   - Map<String, Object> newMap=staticTj(lists, "");
2690   - double yhl=0.0;
2691   - double jzl=0.0;
2692   - double hyl=0.0;
2693   - double dhl=0.0;
2694   - double cdl=0.0;
2695   - for (int j = 0; j < ylbList.size(); j++) {
2696   - Ylb y=ylbList.get(j);
2697   - if(nbbm.equals(y.getNbbm()) && xl_bm.equals(y.getXlbm())){
2698   - yhl=Arith.add(yhl, y.getYh());
2699   - jzl=Arith.add(jzl, y.getJzl());
2700   - hyl=Arith.add(hyl, y.getYh());
2701   - }
2702   -
2703   - }
2704   - for (int j = 0; j < dlbList.size(); j++) {
2705   - Dlb d=dlbList.get(j);
2706   - if(nbbm.equals(d.getNbbm())&&xl_bm.equals(d.getXlbm())){
2707   - dhl=Arith.add(dhl, d.getHd());
2708   - cdl=Arith.add(cdl, d.getCdl());
2709   - }
2710   - }
2711   - if(date.equals(date2)){
2712   - newMap.put("rq",date);
2713   - }else{
2714   - newMap.put("rq",date+"至"+date2);
2715   - }
2716   - newMap.put("yhl", yhl);
2717   - newMap.put("jzl", jzl);
2718   - newMap.put("hyl", hyl);
2719   - newMap.put("dhl", dhl);
2720   - newMap.put("cdl", cdl);
2721   - lMap.add(newMap);
  2808 + }else{
  2809 +
  2810 + if(by.equals("sj")){
  2811 + xls="countByBus2.xls";
2722 2812 }else{
2723   - Map<String, Object> newMap=staticTj(lists, "");
2724   - double lc=Double.parseDouble(newMap.get("zlc").toString());
2725   - double yhl=0.0;
2726   - double jzl=0.0;
2727   - double hyl=0.0;
2728   - double dhl=0.0;
2729   - double cdl=0.0;
2730   - double zlc=0.0;
2731   - for (int j = 0; j < ylbList.size(); j++) {
2732   - Ylb y=ylbList.get(j);
2733   - if(nbbm.equals(y.getNbbm()) && xl_bm.equals(y.getXlbm())
2734   - &&dateStr.equals(sdf.format(y.getRq()))
2735   - &&jGh.equals(y.getName())){
2736   - yhl=Arith.add(yhl, y.getYh());
2737   - jzl=Arith.add(jzl, y.getJzl());
2738   - hyl=Arith.add(hyl, y.getYh());
2739   - zlc=Arith.add(zlc, y.getZlc());
2740   - }
2741   -
2742   - }
2743   -
2744   - for (int j = 0; j < dlbList.size(); j++) {
2745   - Dlb d=dlbList.get(j);
2746   - if(nbbm.equals(d.getNbbm())&&xl_bm.equals(d.getXlbm())
2747   - &&dateStr.equals(sdf.format(d.getRq()))
2748   - &&jGh.equals(d.getName())){
2749   - dhl=Arith.add(dhl, d.getHd());
2750   - cdl=Arith.add(cdl, d.getCdl());
2751   - zlc=Arith.add(zlc, d.getZlc());
2752   - }
2753   - }
2754   - double div=0.0;
2755   - if(lc>0){
2756   - div=Arith.div(zlc, lc,2);
2757   - }
2758   - newMap.put("yhl", yhl*div);
2759   - newMap.put("jzl", jzl*div);
2760   - newMap.put("hyl", hyl*div);
2761   - newMap.put("dhl", dhl*div);
2762   - newMap.put("cdl", cdl*div);
2763   - lMaps.add(newMap);
  2813 + xls="countByBus2s.xls";
2764 2814 }
2765   -
2766   - }
2767   - if(!zt.equals("zbh")){
2768   - String sqls="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh"
2769   - + " from bsth_c_s_sp_info_real r where"
2770   - + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
2771   - if(line.equals("")){
2772   - sqls +="and r.gs_bm='"+gsdm+"' "
2773   - + " and r.fgs_bm='"+fgsdm+"'";
2774   - }else{
2775   - sqls += " and r.xl_bm = '"+line+"'";
2776   - }
2777   - sqls += " group by r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh";
2778   -
2779   - List<Map<String, Object>> listGroupBys=jdbcTemplate.query(sqls, new RowMapper<Map<String, Object>>() {
2780   - @Override
2781   - public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
2782   - Map<String, Object> map=new HashMap<String,Object>();
2783   - map.put("line",arg0.getString("xl_bm"));
2784   - map.put("nbbm", arg0.getString("cl_zbh"));
2785   - map.put("jGh", arg0.getString("j_gh"));
2786   - map.put("sGh", arg0.getString("s_gh"));
2787   - return map;
2788   - }
2789   - });
2790   - lMap=lists(listGroupBys, lMaps, gsdm, fgsdm, date, date2);
2791   -
2792   - }
2793   - if(type.equals("export")){
2794   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
2795   - Map<String, Object> m = new HashMap<String, Object>();
2796   - m.put("date", date);
2797   - m.put("date1", date2);
2798   - String xls="";
2799   - String by=map.get("by").toString();
2800   -
2801   -
2802   - if(zt.equals("zbh")){
2803   - if(by.equals("sj")){
2804   - xls="countByBus1.xls";
2805   - }else{
2806   - xls="countByBus1s.xls";
2807   - }
2808   - }else{
2809   -
2810   - if(by.equals("sj")){
2811   - xls="countByBus2.xls";
2812   - }else{
2813   - xls="countByBus2s.xls";
2814   - }
2815   - }
2816   - ReportUtils ee = new ReportUtils();
2817   - try {
2818   - listI.add(lMap.iterator());
2819   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2820   - ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
2821   - path + "export/路单数据统计表.xls");
2822   - } catch (Exception e) {
2823   - // TODO: handle exception
2824   - e.printStackTrace();
2825   - }
2826   - }
2827   -
2828   - return lMap;
2829   - }
2830   -
2831   - public final List<Ylb> ylbList(String sql){
2832   - List<Ylb> ylbList= jdbcTemplate.query(sql, new RowMapper<Ylb>() {
2833   - @Override
2834   - public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException {
2835   - Ylb y = new Ylb();
2836   - y.setRq(arg0.getDate("rq"));
2837   - y.setXlbm(arg0.getString("xlbm"));
2838   - y.setNbbm(arg0.getString("nbbm"));
2839   - y.setJzl(arg0.getDouble("jzl"));
2840   - y.setYh(arg0.getDouble("yh"));
2841   - y.setSh(arg0.getDouble("sh"));
2842   - return y;
2843   - }
2844   - });
2845   - return ylbList;
2846   - }
2847   -
2848   - public final List<Dlb> dlbList(String sql){
2849   - List<Dlb> dlbList= jdbcTemplate.query(sql, new RowMapper<Dlb>() {
2850   - @Override
2851   - public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException {
2852   - Dlb y = new Dlb();
2853   - y.setRq(arg0.getDate("rq"));
2854   - y.setXlbm(arg0.getString("xlbm"));
2855   - y.setNbbm(arg0.getString("nbbm"));
2856   - y.setCdl(arg0.getDouble("cdl"));
2857   - y.setHd(arg0.getDouble("hd"));
2858   - y.setSh(arg0.getDouble("sh"));
2859   - return y;
2860   - }
2861   - });
2862   - return dlbList;
2863   - }
2864   -
2865   - public final List<Map<String, Object>> lists(List<Map<String, Object>> listGb,
2866   - List<Map<String, Object>> listLc,
2867   - String gsdm,String fgsdm,
2868   - String date,String date2){
2869   - List<Map<String, Object>> lMap=new ArrayList<Map<String,Object>>();
2870   - for (int i = 0; i < listGb.size(); i++) {
2871   - Map<String, Object> m=listGb.get(i);
2872   - String xl_bm=m.get("line")==null?"":m.get("line").toString();
2873   - String nbbm =m.get("nbbm")==null?"":m.get("nbbm").toString();
2874   - String jGh= m.get("jGh")==null?"":m.get("jGh").toString();
2875   - String sGh= m.get("sGh")==null?"":m.get("sGh").toString();
2876   - double jhzlc = 0.0,jhlc= 0.0,jcclc= 0.0,zlc= 0.0,jhnlc= 0.0,jhwlc= 0.0,
2877   - jhnjcclc= 0.0,jhwjcclc= 0.0,jhwjcclc_z=0.0,zrwjcclc= 0.0,zrwjcclc1= 0.0,zrwjcclc2= 0.0,
2878   - zrwjcclcqt=0.0,lbss= 0.0,ssgl_lz= 0.0,
2879   - ssgl_dm= 0.0,ssgl_gz= 0.0,ssgl_jf= 0.0,ssgl_zs= 0.0,ssgl_qr= 0.0,ssgl_qc= 0.0,
2880   - ssgl_kx= 0.0,ssgl_qh= 0.0,ssgl_yw= 0.0,ssgl_other= 0.0,ljyy=0.0,ljjcc=0.0,
  2815 + }
  2816 + ReportUtils ee = new ReportUtils();
  2817 + try {
  2818 + listI.add(lMap.iterator());
  2819 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  2820 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  2821 + path + "export/路单数据统计表.xls");
  2822 + } catch (Exception e) {
  2823 + // TODO: handle exception
  2824 + e.printStackTrace();
  2825 + }
  2826 + }
  2827 +
  2828 + return lMap;
  2829 + }
  2830 +
  2831 + public final List<Ylb> ylbList(String sql){
  2832 + List<Ylb> ylbList= jdbcTemplate.query(sql, new RowMapper<Ylb>() {
  2833 + @Override
  2834 + public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException {
  2835 + Ylb y = new Ylb();
  2836 + y.setRq(arg0.getDate("rq"));
  2837 + y.setXlbm(arg0.getString("xlbm"));
  2838 + y.setNbbm(arg0.getString("nbbm"));
  2839 + y.setJzl(arg0.getDouble("jzl"));
  2840 + y.setYh(arg0.getDouble("yh"));
  2841 + y.setSh(arg0.getDouble("sh"));
  2842 + return y;
  2843 + }
  2844 + });
  2845 + return ylbList;
  2846 + }
  2847 +
  2848 + public final List<Dlb> dlbList(String sql){
  2849 + List<Dlb> dlbList= jdbcTemplate.query(sql, new RowMapper<Dlb>() {
  2850 + @Override
  2851 + public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException {
  2852 + Dlb y = new Dlb();
  2853 + y.setRq(arg0.getDate("rq"));
  2854 + y.setXlbm(arg0.getString("xlbm"));
  2855 + y.setNbbm(arg0.getString("nbbm"));
  2856 + y.setCdl(arg0.getDouble("cdl"));
  2857 + y.setHd(arg0.getDouble("hd"));
  2858 + y.setSh(arg0.getDouble("sh"));
  2859 + return y;
  2860 + }
  2861 + });
  2862 + return dlbList;
  2863 + }
  2864 +
  2865 + public final List<Map<String, Object>> lists(List<Map<String, Object>> listGb,
  2866 + List<Map<String, Object>> listLc,
  2867 + String gsdm,String fgsdm,
  2868 + String date,String date2){
  2869 + List<Map<String, Object>> lMap=new ArrayList<Map<String,Object>>();
  2870 + for (int i = 0; i < listGb.size(); i++) {
  2871 + Map<String, Object> m=listGb.get(i);
  2872 + String xl_bm=m.get("line")==null?"":m.get("line").toString();
  2873 + String nbbm =m.get("nbbm")==null?"":m.get("nbbm").toString();
  2874 + String jGh= m.get("jGh")==null?"":m.get("jGh").toString();
  2875 + String sGh= m.get("sGh")==null?"":m.get("sGh").toString();
  2876 + double jhzlc = 0.0,jhlc= 0.0,jcclc= 0.0,zlc= 0.0,jhnlc= 0.0,jhwlc= 0.0,
  2877 + jhnjcclc= 0.0,jhwjcclc= 0.0,jhwjcclc_z=0.0,zrwjcclc= 0.0,zrwjcclc1= 0.0,zrwjcclc2= 0.0,
  2878 + zrwjcclcqt=0.0,lbss= 0.0,ssgl_lz= 0.0,
  2879 + ssgl_dm= 0.0,ssgl_gz= 0.0,ssgl_jf= 0.0,ssgl_zs= 0.0,ssgl_qr= 0.0,ssgl_qc= 0.0,
  2880 + ssgl_kx= 0.0,ssgl_qh= 0.0,ssgl_yw= 0.0,ssgl_other= 0.0,ljyy=0.0,ljjcc=0.0,
2881 2881 kfks=0.0,yhl=0.0,jzl=0.0,hyl=0.0,dhl=0.0,cdl=0.0;
2882   -
2883   - for (int j = 0; j < listLc.size(); j++) {
2884   - Map<String, Object> map=listLc.get(j);
2885   - if(xl_bm.equals(map.get("line").toString())
2886   - && nbbm.equals(map.get("nbbm").toString())
2887   - && sGh.equals(map.get("sGh")==null?"":map.get("sGh").toString())
2888   - && jGh.equals(map.get("jGh").toString())){
2889   - jhzlc=Arith.add(jhzlc, map.get("jhzlc"));
2890   - jhlc =Arith.add(jhlc, map.get("jhlc"));
2891   - jcclc=Arith.add(jcclc, map.get("jcclc"));
2892   - zlc=Arith.add(zlc, map.get("zlc"));
2893   - jhnlc=Arith.add(jhnlc, map.get("jhnlc"));
2894   - jhwlc=Arith.add(jhwlc, map.get("jhwlc"));
2895   - jhnjcclc=Arith.add(jhnjcclc, map.get("jhnjcclc"));
2896   - jhwjcclc=Arith.add(jhwjcclc, map.get("jhwjcclc"));
2897   - jhwjcclc_z=Arith.add(jhwjcclc_z, map.get("jhwjcclc_z"));
2898   - zrwjcclc=Arith.add(zrwjcclc, map.get("zrwjcclc"));
2899   - zrwjcclc1=Arith.add(zrwjcclc1, map.get("zrwjcclc1"));
2900   - zrwjcclc2=Arith.add(zrwjcclc2, map.get("zrwjcclc2"));
2901   - zrwjcclcqt=Arith.add(zrwjcclcqt, map.get("zrwjcclcqt"));
2902   - lbss=Arith.add(lbss, map.get("lbss"));
2903   - ssgl_lz=Arith.add(ssgl_lz, map.get("ssgl_lz"));
2904   - ssgl_dm=Arith.add(ssgl_dm, map.get("ssgl_dm"));
2905   - ssgl_gz=Arith.add(ssgl_gz, map.get("ssgl_gz"));
2906   - ssgl_jf=Arith.add(ssgl_jf, map.get("ssgl_jf"));
2907   - ssgl_zs=Arith.add(ssgl_zs, map.get("ssgl_zs"));
2908   - ssgl_qr=Arith.add(ssgl_qr, map.get("ssgl_qr"));
2909   - ssgl_qc=Arith.add(ssgl_qc, map.get("ssgl_qc"));
2910   - ssgl_kx=Arith.add(ssgl_kx, map.get("ssgl_kx"));
2911   - ssgl_qh=Arith.add(ssgl_qh, map.get("ssgl_qh"));
2912   - ssgl_yw=Arith.add(ssgl_yw, map.get("ssgl_yw"));
2913   - ssgl_other=Arith.add(ssgl_other, map.get("ssgl_other"));
2914   - kfks=Arith.add(kfks, map.get("kfks"));
2915   - ljyy=Arith.add(ljyy, map.get("ljyy"));
2916   - ljjcc=Arith.add(ljjcc, map.get("ljjcc"));
2917   - yhl=Arith.add(yhl, map.get("yhl"));
2918   - jzl=Arith.add(jzl, map.get("jzl"));
2919   - hyl=Arith.add(hyl, map.get("hyl"));
2920   - dhl=Arith.add(dhl, map.get("dhl"));
2921   - cdl=Arith.add(cdl, map.get("cdl"));
2922   -
2923   -
2924   - }
2925   - }
2926   -
2927   - Map<String, Object> newMap=new HashMap<String,Object>();
2928   - if(date.equals(date2)){
2929   - newMap.put("rq", date);
2930   - }else{
2931   - newMap.put("rq", date+"至"+date2);
2932   - }
2933   - newMap.put("fgs", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
2934   - newMap.put("xlName", BasicData.lineCode2NameMap.get(xl_bm));
2935   - newMap.put("jGh", jGh);
2936   - newMap.put("jName", jGh);
2937   - newMap.put("sGh",sGh);
2938   - newMap.put("sName", sGh);
2939   - newMap.put("nbbm", nbbm);
2940   - newMap.put("jhzlc", jhzlc);
2941   - newMap.put("jhlc", jhlc);
2942   - newMap.put("jcclc", jcclc);
2943   - newMap.put("zlc", zlc);
2944   - newMap.put("jhnlc", jhnlc);
2945   - newMap.put("jhwlc", jhwlc);
2946   - newMap.put("jhnjcclc", jhnjcclc);
2947   - newMap.put("jhwjcclc", jhwjcclc);
2948   - newMap.put("jhwjcclc_z", jhwjcclc_z);
2949   - newMap.put("zrwjcclc", zrwjcclc);
2950   - newMap.put("zrwjcclc1", zrwjcclc1);
2951   - newMap.put("zrwjcclc2", zrwjcclc2);
2952   - newMap.put("zrwjcclcqt", zrwjcclcqt);
2953   - newMap.put("lbss", lbss);
2954   - newMap.put("ssgl_lz", ssgl_lz);
2955   - newMap.put("ssgl_dm",ssgl_dm);
2956   - newMap.put("ssgl_gz", ssgl_gz);
2957   - newMap.put("ssgl_jf", ssgl_jf);
2958   - newMap.put("ssgl_zs", ssgl_zs);
2959   - newMap.put("ssgl_qr", ssgl_qr);
2960   - newMap.put("ssgl_qc", ssgl_qc);
2961   - newMap.put("ssgl_kx", ssgl_kx);
2962   - newMap.put("ssgl_qh", ssgl_qh);
2963   - newMap.put("ssgl_yw", ssgl_yw);
2964   - newMap.put("ssgl_other", ssgl_other);
2965   - newMap.put("kfks", kfks);
2966   - newMap.put("ljyy", ljyy);
2967   - newMap.put("ljjcc", ljjcc);
2968   - newMap.put("yhl", yhl);
2969   - newMap.put("jzl", jzl);
2970   - newMap.put("hyl", hyl);
2971   - newMap.put("dhl", dhl);
2972   - newMap.put("cdl", cdl);
2973   - lMap.add(newMap);
2974   - }
2975   - return lMap;
2976   - }
2977   - @Override
2978   - public List<Map<String, Object>> countDjg(Map<String, Object> map) {
2979   - // TODO Auto-generated method stub
2980   - List<Map<String, Object>> lMap=new ArrayList<Map<String,Object>>();
2981   - String line=map.get("line").toString().trim();
2982   - String date=map.get("date").toString();
2983   - String gsbm=map.get("gsbm").toString();
2984   - String fgsbm=map.get("fgsbm").toString();
2985   - String type=map.get("type").toString();
2986   - List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
2987   - if(line.equals("")){
2988   - list=scheduleRealInfoRepository.scheduleByDateAndLineByGs(gsbm, fgsbm, date);
2989   -
2990   - }else{
2991   - list=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  2882 +
  2883 + for (int j = 0; j < listLc.size(); j++) {
  2884 + Map<String, Object> map=listLc.get(j);
  2885 + if(xl_bm.equals(map.get("line").toString())
  2886 + && nbbm.equals(map.get("nbbm").toString())
  2887 + && sGh.equals(map.get("sGh")==null?"":map.get("sGh").toString())
  2888 + && jGh.equals(map.get("jGh").toString())){
  2889 + jhzlc=Arith.add(jhzlc, map.get("jhzlc"));
  2890 + jhlc =Arith.add(jhlc, map.get("jhlc"));
  2891 + jcclc=Arith.add(jcclc, map.get("jcclc"));
  2892 + zlc=Arith.add(zlc, map.get("zlc"));
  2893 + jhnlc=Arith.add(jhnlc, map.get("jhnlc"));
  2894 + jhwlc=Arith.add(jhwlc, map.get("jhwlc"));
  2895 + jhnjcclc=Arith.add(jhnjcclc, map.get("jhnjcclc"));
  2896 + jhwjcclc=Arith.add(jhwjcclc, map.get("jhwjcclc"));
  2897 + jhwjcclc_z=Arith.add(jhwjcclc_z, map.get("jhwjcclc_z"));
  2898 + zrwjcclc=Arith.add(zrwjcclc, map.get("zrwjcclc"));
  2899 + zrwjcclc1=Arith.add(zrwjcclc1, map.get("zrwjcclc1"));
  2900 + zrwjcclc2=Arith.add(zrwjcclc2, map.get("zrwjcclc2"));
  2901 + zrwjcclcqt=Arith.add(zrwjcclcqt, map.get("zrwjcclcqt"));
  2902 + lbss=Arith.add(lbss, map.get("lbss"));
  2903 + ssgl_lz=Arith.add(ssgl_lz, map.get("ssgl_lz"));
  2904 + ssgl_dm=Arith.add(ssgl_dm, map.get("ssgl_dm"));
  2905 + ssgl_gz=Arith.add(ssgl_gz, map.get("ssgl_gz"));
  2906 + ssgl_jf=Arith.add(ssgl_jf, map.get("ssgl_jf"));
  2907 + ssgl_zs=Arith.add(ssgl_zs, map.get("ssgl_zs"));
  2908 + ssgl_qr=Arith.add(ssgl_qr, map.get("ssgl_qr"));
  2909 + ssgl_qc=Arith.add(ssgl_qc, map.get("ssgl_qc"));
  2910 + ssgl_kx=Arith.add(ssgl_kx, map.get("ssgl_kx"));
  2911 + ssgl_qh=Arith.add(ssgl_qh, map.get("ssgl_qh"));
  2912 + ssgl_yw=Arith.add(ssgl_yw, map.get("ssgl_yw"));
  2913 + ssgl_other=Arith.add(ssgl_other, map.get("ssgl_other"));
  2914 + kfks=Arith.add(kfks, map.get("kfks"));
  2915 + ljyy=Arith.add(ljyy, map.get("ljyy"));
  2916 + ljjcc=Arith.add(ljjcc, map.get("ljjcc"));
  2917 + yhl=Arith.add(yhl, map.get("yhl"));
  2918 + jzl=Arith.add(jzl, map.get("jzl"));
  2919 + hyl=Arith.add(hyl, map.get("hyl"));
  2920 + dhl=Arith.add(dhl, map.get("dhl"));
  2921 + cdl=Arith.add(cdl, map.get("cdl"));
  2922 +
  2923 +
  2924 + }
2992 2925 }
2993   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2926 +
  2927 + Map<String, Object> newMap=new HashMap<String,Object>();
  2928 + if(date.equals(date2)){
  2929 + newMap.put("rq", date);
  2930 + }else{
  2931 + newMap.put("rq", date+"至"+date2);
  2932 + }
  2933 + newMap.put("fgs", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  2934 + newMap.put("xlName", BasicData.lineCode2NameMap.get(xl_bm));
  2935 + newMap.put("jGh", jGh);
  2936 + newMap.put("jName", jGh);
  2937 + newMap.put("sGh",sGh);
  2938 + newMap.put("sName", sGh);
  2939 + newMap.put("nbbm", nbbm);
  2940 + newMap.put("jhzlc", jhzlc);
  2941 + newMap.put("jhlc", jhlc);
  2942 + newMap.put("jcclc", jcclc);
  2943 + newMap.put("zlc", zlc);
  2944 + newMap.put("jhnlc", jhnlc);
  2945 + newMap.put("jhwlc", jhwlc);
  2946 + newMap.put("jhnjcclc", jhnjcclc);
  2947 + newMap.put("jhwjcclc", jhwjcclc);
  2948 + newMap.put("jhwjcclc_z", jhwjcclc_z);
  2949 + newMap.put("zrwjcclc", zrwjcclc);
  2950 + newMap.put("zrwjcclc1", zrwjcclc1);
  2951 + newMap.put("zrwjcclc2", zrwjcclc2);
  2952 + newMap.put("zrwjcclcqt", zrwjcclcqt);
  2953 + newMap.put("lbss", lbss);
  2954 + newMap.put("ssgl_lz", ssgl_lz);
  2955 + newMap.put("ssgl_dm",ssgl_dm);
  2956 + newMap.put("ssgl_gz", ssgl_gz);
  2957 + newMap.put("ssgl_jf", ssgl_jf);
  2958 + newMap.put("ssgl_zs", ssgl_zs);
  2959 + newMap.put("ssgl_qr", ssgl_qr);
  2960 + newMap.put("ssgl_qc", ssgl_qc);
  2961 + newMap.put("ssgl_kx", ssgl_kx);
  2962 + newMap.put("ssgl_qh", ssgl_qh);
  2963 + newMap.put("ssgl_yw", ssgl_yw);
  2964 + newMap.put("ssgl_other", ssgl_other);
  2965 + newMap.put("kfks", kfks);
  2966 + newMap.put("ljyy", ljyy);
  2967 + newMap.put("ljjcc", ljjcc);
  2968 + newMap.put("yhl", yhl);
  2969 + newMap.put("jzl", jzl);
  2970 + newMap.put("hyl", hyl);
  2971 + newMap.put("dhl", dhl);
  2972 + newMap.put("cdl", cdl);
  2973 + lMap.add(newMap);
  2974 + }
  2975 + return lMap;
  2976 + }
  2977 + @Override
  2978 + public List<Map<String, Object>> countDjg(Map<String, Object> map) {
  2979 + // TODO Auto-generated method stub
  2980 + List<Map<String, Object>> lMap=new ArrayList<Map<String,Object>>();
  2981 + String line=map.get("line").toString().trim();
  2982 + String date=map.get("date").toString();
  2983 + String gsbm=map.get("gsbm").toString();
  2984 + String fgsbm=map.get("fgsbm").toString();
  2985 + String type=map.get("type").toString();
  2986 + List<ScheduleRealInfo> list=new ArrayList<ScheduleRealInfo>();
  2987 + if(line.equals("")){
  2988 + list=scheduleRealInfoRepository.scheduleByDateAndLineByGs(gsbm, fgsbm, date);
  2989 +
  2990 + }else{
  2991 + list=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  2992 + }
  2993 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
2994 2994 // Collections.sort(listInfo,new ComparableAcuals());
2995   - //查询所有线路
2996   - String xlSql="select line_code,spac_grade from bsth_c_line ";
2997   - if(line.equals("")){
2998   - xlSql +=" where company ='"+gsbm+"'";
2999   - }else{
3000   - xlSql +=" where line_code ='"+line+"'";
3001   - }
3002   -
3003   - List<Map<String, Object>> xlList=jdbcTemplate.query(xlSql, new RowMapper<Map<String, Object>>() {
3004   - @Override
3005   - public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
3006   - Map<String, Object> map=new HashMap<String,Object>();
3007   - map.put("line",arg0.getString("line_code"));
3008   - map.put("grade", arg0.getString("spac_grade"));
3009   - return map;
3010   - }
3011   - });
3012   - //查询大间隔时间
3013   - String djgSql="select * from bsth_c_interval";
3014   - List<Interval> djgList=jdbcTemplate.query(djgSql, new RowMapper<Interval>() {
3015   - @Override
3016   - public Interval mapRow(ResultSet arg0, int arg1) throws SQLException {
3017   - Interval m=new Interval();
3018   - m.setLevel(arg0.getString("level"));
3019   - m.setPeak(arg0.getInt("peak"));
3020   - m.setTrough(arg0.getInt("trough"));
3021   - return m;
  2995 + //查询所有线路
  2996 + String xlSql="select line_code,spac_grade from bsth_c_line ";
  2997 + if(line.equals("")){
  2998 + xlSql +=" where company ='"+gsbm+"'";
  2999 + }else{
  3000 + xlSql +=" where line_code ='"+line+"'";
  3001 + }
  3002 +
  3003 + List<Map<String, Object>> xlList=jdbcTemplate.query(xlSql, new RowMapper<Map<String, Object>>() {
  3004 + @Override
  3005 + public Map<String, Object> mapRow(ResultSet arg0, int arg1) throws SQLException {
  3006 + Map<String, Object> map=new HashMap<String,Object>();
  3007 + map.put("line",arg0.getString("line_code"));
  3008 + map.put("grade", arg0.getString("spac_grade"));
  3009 + return map;
  3010 + }
  3011 + });
  3012 + //查询大间隔时间
  3013 + String djgSql="select * from bsth_c_interval";
  3014 + List<Interval> djgList=jdbcTemplate.query(djgSql, new RowMapper<Interval>() {
  3015 + @Override
  3016 + public Interval mapRow(ResultSet arg0, int arg1) throws SQLException {
  3017 + Interval m=new Interval();
  3018 + m.setLevel(arg0.getString("level"));
  3019 + m.setPeak(arg0.getInt("peak"));
  3020 + m.setTrough(arg0.getInt("trough"));
  3021 + return m;
  3022 + }
  3023 + });
  3024 +
  3025 + for (int i = 0; i < xlList.size(); i++) {
  3026 + String lineCode=xlList.get(i).get("line").toString();
  3027 + String grade =xlList.get(i).get("grade")==null?"1":xlList.get(i).get("grade").toString();
  3028 + int peak=0;
  3029 + int trough=0;
  3030 + for (int j = 0; j < djgList.size(); j++) {
  3031 + Interval il=djgList.get(j);
  3032 + if(il.getLevel().equals(grade)){
  3033 + peak=il.getPeak();
  3034 + trough=il.getTrough();
  3035 + continue;
3022 3036 }
3023   - });
3024   -
3025   - for (int i = 0; i < xlList.size(); i++) {
3026   - String lineCode=xlList.get(i).get("line").toString();
3027   - String grade =xlList.get(i).get("grade")==null?"1":xlList.get(i).get("grade").toString();
3028   - int peak=0;
3029   - int trough=0;
3030   - for (int j = 0; j < djgList.size(); j++) {
3031   - Interval il=djgList.get(j);
3032   - if(il.getLevel().equals(grade)){
3033   - peak=il.getPeak();
3034   - trough=il.getTrough();
3035   - continue;
3036   - }
3037   - }
3038   - List<ScheduleRealInfo> list_=new ArrayList<ScheduleRealInfo>();
3039   - List<ScheduleRealInfo> listInfo=new ArrayList<ScheduleRealInfo>();
3040   - for (int j = 0; j < list.size(); j++) {
3041   - ScheduleRealInfo sinfo=list.get(j);
3042   - try {
3043   - if(sinfo.getXlBm().equals(lineCode)){
3044   - list_.add(sinfo);
3045   - ScheduleRealInfo s=checkBc(sinfo);
3046   - String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual();
3047   - if(!fcsj.equals("")){
3048   - Long fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime();
3049   - s.setFcsjActualTime(fcsjAcual);
3050   - s.setFcsjActual(fcsj);
3051   - listInfo.add(s);
3052   - }
3053   -
  3037 + }
  3038 + List<ScheduleRealInfo> list_=new ArrayList<ScheduleRealInfo>();
  3039 + List<ScheduleRealInfo> listInfo=new ArrayList<ScheduleRealInfo>();
  3040 + for (int j = 0; j < list.size(); j++) {
  3041 + ScheduleRealInfo sinfo=list.get(j);
  3042 + try {
  3043 + if(sinfo.getXlBm().equals(lineCode)){
  3044 + list_.add(sinfo);
  3045 + ScheduleRealInfo s=checkBc(sinfo);
  3046 + String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual();
  3047 + if(!fcsj.equals("")){
  3048 + Long fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime();
  3049 + s.setFcsjActualTime(fcsjAcual);
  3050 + s.setFcsjActual(fcsj);
  3051 + listInfo.add(s);
3054 3052 }
3055   - } catch (ParseException e) {
3056   - // TODO Auto-generated catch block
3057   - e.printStackTrace();
  3053 +
3058 3054 }
3059   - }
3060   -
3061   - if(listInfo.size()>0){
3062   - int sjbcs=culateService.culateSjbc(list_, "")+culateService.culateLjbc(list_, "");
3063   - Map<String, Object> m=listDjg(gsbm,fgsbm,lineCode,sjbcs,peak,trough,listInfo,grade);
3064   - lMap.add(m);
3065   - }
3066   -
3067   - }
3068   - if(type.equals("export")){
3069   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
3070   - Map<String, Object> m = new HashMap<String, Object>();
3071   - m.put("date", date);
3072   - ReportUtils ee = new ReportUtils();
3073   - try {
3074   - listI.add(lMap.iterator());
3075   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
3076   - ee.excelReplace(listI, new Object[]{m}, path + "mould/countInterval.xls",
3077   - path + "export/大间隔统计表.xls");
3078   - } catch (Exception e) {
3079   - // TODO: handle exception
3080   - e.printStackTrace();
3081   - }
3082   - }
3083   - return lMap;
3084   - }
3085   -
3086   - public ScheduleRealInfo checkBc(ScheduleRealInfo s){
3087   - //如果班次有子任务 且 子任务中有属于营运的。把该子任务的发车时间设置成班次的发车时间
3088   - String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual();
3089   - if(fcsj.equals("")){
3090   - Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
3091   - if(!childTaskPlans.isEmpty()){
3092   - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
3093   - Collections.sort(listit, new ComparableChild());
3094   - for (int i = 0; i < listit.size(); i++) {
3095   - ChildTaskPlan c=listit.get(i);
3096   - if(!c.isDestroy()){
3097   - if(c.getMileageType().equals("service")){
3098   - s.setFcsjActual(c.getStartDate());
3099   - break;
3100   - }
3101   -
3102   - }
3103   - }
  3055 + } catch (ParseException e) {
  3056 + // TODO Auto-generated catch block
  3057 + e.printStackTrace();
3104 3058 }
3105 3059 }
3106   - return s;
3107   - }
3108   -
3109   - public Map<String, Object> listDjg(String gsdm,String fgsdm,String line,int sjbcs,int peak,int trough,List<ScheduleRealInfo> listInfo,String grade){
3110   - DecimalFormat df = new DecimalFormat("#0.00");
3111   - Collections.sort(listInfo,new ComparableAcuals());
3112   - List<ScheduleRealInfo> listInfo0=new ArrayList<ScheduleRealInfo>();
3113   - List<ScheduleRealInfo> listInfo1=new ArrayList<ScheduleRealInfo>();
3114   - for (int i = 0; i < listInfo.size(); i++) {
3115   - ScheduleRealInfo s=listInfo.get(i);
3116   - if(s.getXlDir().equals("0")){
3117   - listInfo0.add(s);
3118   - }else{
3119   - listInfo0.add(s);
3120   - }
3121   -
3122   - }
3123   - Map<String, Object> map=new HashMap<String, Object>();
3124   - map.put("line", line);
3125   - map.put("xlName", BasicData.lineCode2NameMap.get(line));
3126   - map.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
3127   - map.put("bcs", sjbcs);
3128   - map.put("djgde", grade);
3129   - int djgcs=0;
3130   - List<Map<String, Object>> mapList=new ArrayList<Map<String, Object>>();
3131   - for (int i = 0; i < listInfo0.size(); i++) {
3132   - ScheduleRealInfo s=listInfo.get(i);
3133   - Long fcsjTime=s.getFcsjActualTime();
3134   - String time=s.getFcsjActual();
3135   - String[] fcsjStr = time.split(":");
3136   - long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
3137   - if(i<listInfo.size()-1){
3138   - Long djg=0l;
3139   - Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
3140   - if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){
3141   - djg = (long) (peak*60*1000);
3142   - if(fscjNext-fcsjTime>djg){
3143   - djgcs ++;
3144   - Map<String, Object> m=new HashMap<String,Object>();
3145   - m.put("xlName", BasicData.lineCode2NameMap.get(line));
3146   - m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
3147   - m.put("djgde", grade);
3148   - m.put("qJh", s.getFcsj());
3149   - m.put("qSj", time);
3150   - m.put("hJh", listInfo.get(i+1).getFcsj());
3151   - m.put("hSj", listInfo.get(i+1).getFcsjActual());
3152   - m.put("djgsj", peak);
3153   - m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
3154   - mapList.add(m);
3155   - }
3156   - }else{
3157   - djg = (long) (trough*60*1000);
3158   - if(fscjNext-fcsjTime>djg){
3159   - djgcs ++;
3160   - Map<String, Object> m=new HashMap<String,Object>();
3161   - m.put("xlName", BasicData.lineCode2NameMap.get(line));
3162   - m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
3163   - m.put("djgde", grade);
3164   - m.put("qJh", s.getFcsj());
3165   - m.put("qSj", time);
3166   - m.put("hJh", listInfo.get(i+1).getFcsj());
3167   - m.put("hSj", listInfo.get(i+1).getFcsjActual());
3168   - m.put("djgsj", trough);
3169   - m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
3170   - mapList.add(m);
  3060 +
  3061 + if(listInfo.size()>0){
  3062 + int sjbcs=culateService.culateSjbc(list_, "")+culateService.culateLjbc(list_, "");
  3063 + Map<String, Object> m=listDjg(gsbm,fgsbm,lineCode,sjbcs,peak,trough,listInfo,grade);
  3064 + lMap.add(m);
  3065 + }
  3066 +
  3067 + }
  3068 + if(type.equals("export")){
  3069 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  3070 + Map<String, Object> m = new HashMap<String, Object>();
  3071 + m.put("date", date);
  3072 + ReportUtils ee = new ReportUtils();
  3073 + try {
  3074 + listI.add(lMap.iterator());
  3075 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  3076 + ee.excelReplace(listI, new Object[]{m}, path + "mould/countInterval.xls",
  3077 + path + "export/大间隔统计表.xls");
  3078 + } catch (Exception e) {
  3079 + // TODO: handle exception
  3080 + e.printStackTrace();
  3081 + }
  3082 + }
  3083 + return lMap;
  3084 + }
  3085 +
  3086 + public ScheduleRealInfo checkBc(ScheduleRealInfo s){
  3087 + //如果班次有子任务 且 子任务中有属于营运的。把该子任务的发车时间设置成班次的发车时间
  3088 + String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual();
  3089 + if(fcsj.equals("")){
  3090 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  3091 + if(!childTaskPlans.isEmpty()){
  3092 + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  3093 + Collections.sort(listit, new ComparableChild());
  3094 + for (int i = 0; i < listit.size(); i++) {
  3095 + ChildTaskPlan c=listit.get(i);
  3096 + if(!c.isDestroy()){
  3097 + if(c.getMileageType().equals("service")){
  3098 + s.setFcsjActual(c.getStartDate());
  3099 + break;
3171 3100 }
  3101 +
3172 3102 }
3173 3103 }
3174 3104 }
3175   -
3176   - for (int i = 0; i < listInfo1.size(); i++) {
3177   - ScheduleRealInfo s=listInfo.get(i);
3178   - Long fcsjTime=s.getFcsjActualTime();
3179   - String time=s.getFcsjActual();
3180   - String[] fcsjStr = time.split(":");
3181   - long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
3182   - if(i<listInfo.size()-1){
3183   - Long djg=0l;
3184   - Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
3185   - if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){
3186   - djg = (long) (peak*60*1000);
3187   - if(fscjNext-fcsjTime>djg){
3188   - djgcs ++;
3189   - Map<String, Object> m=new HashMap<String,Object>();
3190   - m.put("xlName", BasicData.lineCode2NameMap.get(line));
3191   - m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
3192   - m.put("djgde", grade);
3193   - m.put("qJh", s.getFcsj());
3194   - m.put("qSj", time);
3195   - m.put("hJh", listInfo.get(i+1).getFcsj());
3196   - m.put("hSj", listInfo.get(i+1).getFcsjActual());
3197   - m.put("djgsj", peak);
3198   - m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
3199   - mapList.add(m);
3200   - }
3201   - }else{
3202   - djg = (long) (trough*60*1000);
3203   - if(fscjNext-fcsjTime>djg){
3204   - djgcs ++;
3205   - Map<String, Object> m=new HashMap<String,Object>();
3206   - m.put("xlName", BasicData.lineCode2NameMap.get(line));
3207   - m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
3208   - m.put("djgde", grade);
3209   - m.put("qJh", s.getFcsj());
3210   - m.put("qSj", time);
3211   - m.put("hJh", listInfo.get(i+1).getFcsj());
3212   - m.put("hSj", listInfo.get(i+1).getFcsjActual());
3213   - m.put("djgsj", trough);
3214   - m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
3215   - mapList.add(m);
3216   - }
  3105 + }
  3106 + return s;
  3107 + }
  3108 +
  3109 + public Map<String, Object> listDjg(String gsdm,String fgsdm,String line,int sjbcs,int peak,int trough,List<ScheduleRealInfo> listInfo,String grade){
  3110 + DecimalFormat df = new DecimalFormat("#0.00");
  3111 + Collections.sort(listInfo,new ComparableAcuals());
  3112 + List<ScheduleRealInfo> listInfo0=new ArrayList<ScheduleRealInfo>();
  3113 + List<ScheduleRealInfo> listInfo1=new ArrayList<ScheduleRealInfo>();
  3114 + for (int i = 0; i < listInfo.size(); i++) {
  3115 + ScheduleRealInfo s=listInfo.get(i);
  3116 + if(s.getXlDir().equals("0")){
  3117 + listInfo0.add(s);
  3118 + }else{
  3119 + listInfo0.add(s);
  3120 + }
  3121 +
  3122 + }
  3123 + Map<String, Object> map=new HashMap<String, Object>();
  3124 + map.put("line", line);
  3125 + map.put("xlName", BasicData.lineCode2NameMap.get(line));
  3126 + map.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3127 + map.put("bcs", sjbcs);
  3128 + map.put("djgde", grade);
  3129 + int djgcs=0;
  3130 + List<Map<String, Object>> mapList=new ArrayList<Map<String, Object>>();
  3131 + for (int i = 0; i < listInfo0.size(); i++) {
  3132 + ScheduleRealInfo s=listInfo.get(i);
  3133 + Long fcsjTime=s.getFcsjActualTime();
  3134 + String time=s.getFcsjActual();
  3135 + String[] fcsjStr = time.split(":");
  3136 + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
  3137 + if(i<listInfo.size()-1){
  3138 + Long djg=0l;
  3139 + Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
  3140 + if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){
  3141 + djg = (long) (peak*60*1000);
  3142 + if(fscjNext-fcsjTime>djg){
  3143 + djgcs ++;
  3144 + Map<String, Object> m=new HashMap<String,Object>();
  3145 + m.put("xlName", BasicData.lineCode2NameMap.get(line));
  3146 + m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3147 + m.put("djgde", grade);
  3148 + m.put("qJh", s.getFcsj());
  3149 + m.put("qSj", time);
  3150 + m.put("hJh", listInfo.get(i+1).getFcsj());
  3151 + m.put("hSj", listInfo.get(i+1).getFcsjActual());
  3152 + m.put("djgsj", peak);
  3153 + m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
  3154 + mapList.add(m);
  3155 + }
  3156 + }else{
  3157 + djg = (long) (trough*60*1000);
  3158 + if(fscjNext-fcsjTime>djg){
  3159 + djgcs ++;
  3160 + Map<String, Object> m=new HashMap<String,Object>();
  3161 + m.put("xlName", BasicData.lineCode2NameMap.get(line));
  3162 + m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3163 + m.put("djgde", grade);
  3164 + m.put("qJh", s.getFcsj());
  3165 + m.put("qSj", time);
  3166 + m.put("hJh", listInfo.get(i+1).getFcsj());
  3167 + m.put("hSj", listInfo.get(i+1).getFcsjActual());
  3168 + m.put("djgsj", trough);
  3169 + m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
  3170 + mapList.add(m);
3217 3171 }
3218 3172 }
3219 3173 }
3220   - double fsl=0.0;
3221   - if(sjbcs>0){
3222   - fsl=Arith.div(djgcs,sjbcs, 2)*100;
  3174 + }
  3175 +
  3176 + for (int i = 0; i < listInfo1.size(); i++) {
  3177 + ScheduleRealInfo s=listInfo.get(i);
  3178 + Long fcsjTime=s.getFcsjActualTime();
  3179 + String time=s.getFcsjActual();
  3180 + String[] fcsjStr = time.split(":");
  3181 + long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
  3182 + if(i<listInfo.size()-1){
  3183 + Long djg=0l;
  3184 + Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
  3185 + if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){
  3186 + djg = (long) (peak*60*1000);
  3187 + if(fscjNext-fcsjTime>djg){
  3188 + djgcs ++;
  3189 + Map<String, Object> m=new HashMap<String,Object>();
  3190 + m.put("xlName", BasicData.lineCode2NameMap.get(line));
  3191 + m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3192 + m.put("djgde", grade);
  3193 + m.put("qJh", s.getFcsj());
  3194 + m.put("qSj", time);
  3195 + m.put("hJh", listInfo.get(i+1).getFcsj());
  3196 + m.put("hSj", listInfo.get(i+1).getFcsjActual());
  3197 + m.put("djgsj", peak);
  3198 + m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
  3199 + mapList.add(m);
  3200 + }
  3201 + }else{
  3202 + djg = (long) (trough*60*1000);
  3203 + if(fscjNext-fcsjTime>djg){
  3204 + djgcs ++;
  3205 + Map<String, Object> m=new HashMap<String,Object>();
  3206 + m.put("xlName", BasicData.lineCode2NameMap.get(line));
  3207 + m.put("fgsname", BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm));
  3208 + m.put("djgde", grade);
  3209 + m.put("qJh", s.getFcsj());
  3210 + m.put("qSj", time);
  3211 + m.put("hJh", listInfo.get(i+1).getFcsj());
  3212 + m.put("hSj", listInfo.get(i+1).getFcsjActual());
  3213 + m.put("djgsj", trough);
  3214 + m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
  3215 + mapList.add(m);
  3216 + }
  3217 + }
3223 3218 }
3224   -
3225   - map.put("djgcs", djgcs);
3226   - map.put("fsl", df.format(fsl)+"%");
3227   - map.put("djgxx", mapList);
3228   - return map;
3229 3219 }
3230   -
  3220 + double fsl=0.0;
  3221 + if(sjbcs>0){
  3222 + fsl=Arith.div(djgcs,sjbcs, 2)*100;
  3223 + }
  3224 +
  3225 + map.put("djgcs", djgcs);
  3226 + map.put("fsl", df.format(fsl)+"%");
  3227 + map.put("djgxx", mapList);
  3228 + return map;
  3229 + }
  3230 +
3231 3231 }
3232 3232  
3233 3233 class ComparableAcuals implements Comparator<ScheduleRealInfo>{
... ... @@ -3238,4 +3238,4 @@ class ComparableAcuals implements Comparator&lt;ScheduleRealInfo&gt;{
3238 3238 return o1.getFcsjActualTime().compareTo(o2.getFcsjActualTime());
3239 3239 }
3240 3240  
3241   -}
  3241 +}
3242 3242 \ No newline at end of file
... ...
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
... ... @@ -124,7 +124,7 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
124 124 // poi读
125 125 String cellContent = PoiUtils.getStringValueFromCell(
126 126 poi_sheet.getRow(i).getCell(j)
127   - );
  127 + ).replaceAll("\\s*", "");
128 128 // jxl写
129 129 sheet1.addCell(new Label(j, i, cellContent));
130 130 }
... ...
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
... ... @@ -278,6 +278,9 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
278 278 Date start2 = new Date();
279 279 ScheduleResults_output scheduleResults_output = loopRuleOutput(schedulePlan, lpInfoResults_output);
280 280 Date end2 = new Date();
  281 +
  282 + logger.info("规则计算结果={}", scheduleResults_output.showGuideboardDesc1());
  283 +
281 284 // 3、计划输出
282 285 Date start3 = new Date();
283 286 PlanResult planResult = planResultOutput(schedulePlan, scheduleResults_output, ttInfoResults_output);
... ... @@ -433,7 +436,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
433 436 Line xl = lineRepository.findOne(schedulePlan.getXl().getId());
434 437 logger.info("<--- 排班master线路 id={}, name={}, 开始排班", xl.getId(), xl.getName());
435 438  
436   - // 2、确定主线路排班(无套跑规则
  439 + // 2、确定主线路排班(包含完全套跑路牌规则,所谓完全套跑路牌规则指整个路牌的班次都是套跑规则指定的
437 440 PlanResult planResult = schedulePlanWithOutRerun(schedulePlan);
438 441  
439 442 // 3、确定套跑规则
... ... @@ -442,6 +445,15 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
442 445 // TODO:3-1、验证排班结果
443 446 validPlanResult(planResult, schedulePlan);
444 447  
  448 + // TODO:3-2、去除完全套跑遗漏班次(以后放到规则中执行)
  449 + Iterator<SchedulePlanInfo> infoIterator = planResult.getSchedulePlanInfos().iterator();
  450 + while (infoIterator.hasNext()) {
  451 + SchedulePlanInfo schedulePlanInfo = infoIterator.next();
  452 + if (schedulePlanInfo.getCl() == null) {
  453 + infoIterator.remove();
  454 + }
  455 + }
  456 +
445 457 // 4、保存数据(jdbcTemplate 批量插入)
446 458 Date start4 = new Date();
447 459 scheduleRuleService.generateSchedulePlan(schedulePlan, planResult.getSchedulePlanInfos());
... ...
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
... ... @@ -251,7 +251,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
251 251 for (int i = 1; i < rowNums; i++) { // 从第2行开始验证数据
252 252 Row row = sheet.getRow(i);
253 253 for (int j = 1; j < colNums; j++) { // 从第2列开始
254   - String bcell_con = StringUtils.trimToEmpty(PoiUtils.getStringValueFromCell(row.getCell(j))); // trimToEmpty
  254 + String bcell_con = StringUtils.trimToEmpty(PoiUtils.getStringValueFromCell(row.getCell(j))).replaceAll("\\s*", ""); // trimToEmpty
255 255 if (StringUtils.isNotEmpty(bcell_con)) {
256 256 Matcher m1 = p1.matcher(bcell_con.trim());
257 257 Matcher m2 = p2.matcher(bcell_con.trim());
... ...
src/main/java/com/bsth/service/schedule/rules/ttinfo/TTInfo_input.java
... ... @@ -44,7 +44,7 @@ public class TTInfo_input implements Comparable&lt;TTInfo_input&gt; {
44 44 this.ttInfoId = String.valueOf(ttInfo.getId());
45 45 this.xlId = String.valueOf(ttInfo.getXl().getId());
46 46 String[] days = ttInfo.getRule_days().split(",");
47   - System.out.println(days.length);
  47 +// System.out.println(days.length);
48 48 for (int i = 0; i < 7; i++) {
49 49 if ("1".equals(days[i])) {
50 50 weekdays.add(true);
... ...
src/main/java/com/bsth/service/schedule/rules/validate/ValidRepeatBcFunction.java
... ... @@ -47,14 +47,14 @@ public class ValidRepeatBcFunction implements AccumulateFunction {
47 47  
48 48 @Override
49 49 public Serializable createContext() {
50   - System.out.println("create");
  50 +// System.out.println("create");
51 51 return new RepeatBcInfo();
52 52 }
53 53  
54 54 @Override
55 55 public void init(Serializable serializable) throws Exception {
56 56 // TODO:
57   - System.out.println("init");
  57 +// System.out.println("init");
58 58 }
59 59  
60 60 @Override
... ...
src/main/java/com/bsth/service/schedule/rules/validate/ValidWholeRerunBcFunction.java 0 → 100644
  1 +package com.bsth.service.schedule.rules.validate;
  2 +
  3 +import com.bsth.entity.schedule.SchedulePlanInfo;
  4 +import org.kie.api.runtime.rule.AccumulateFunction;
  5 +
  6 +import java.io.*;
  7 +import java.text.SimpleDateFormat;
  8 +import java.util.ArrayList;
  9 +import java.util.HashMap;
  10 +import java.util.List;
  11 +import java.util.Map;
  12 +
  13 +/**
  14 + * 验证完全套跑路牌班次正确性。
  15 + * 完全套跑路牌班次指此路牌下的所有班次由其他线路完成。
  16 + * 记录漏掉的班次,并给出警告信息。
  17 + */
  18 +public class ValidWholeRerunBcFunction implements AccumulateFunction {
  19 + @Override
  20 + public void writeExternal(ObjectOutput out) throws IOException {
  21 + }
  22 +
  23 + @Override
  24 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  25 +
  26 + }
  27 +
  28 + protected static class RerunBcInfo implements Externalizable {
  29 + /** 错误描述 */
  30 + public List<ValidateResults_output.ValidInfo> validInfoList = new ArrayList<>();
  31 + /** 内部计数Map,key:{路牌Id}_{发车时间},value:个数 */
  32 + public Map<String, Integer> lpBcFcsjCount = new HashMap<>();
  33 +
  34 + public RerunBcInfo() {
  35 + }
  36 +
  37 + @Override
  38 + public void writeExternal(ObjectOutput out) throws IOException {
  39 + out.writeObject(validInfoList);
  40 + }
  41 +
  42 + @Override
  43 + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  44 + validInfoList = (List<ValidateResults_output.ValidInfo>) in.readObject();
  45 + }
  46 + }
  47 +
  48 + @Override
  49 + public Serializable createContext() {
  50 +// System.out.println("create");
  51 + return new RerunBcInfo();
  52 + }
  53 +
  54 + @Override
  55 + public void init(Serializable serializable) throws Exception {
  56 + // TODO:
  57 +// System.out.println("init");
  58 + }
  59 +
  60 + @Override
  61 + public void accumulate(Serializable context, Object o) {
  62 + RerunBcInfo rerunBcInfo = (RerunBcInfo) context;
  63 + SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o;
  64 +
  65 + String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj();
  66 + SimpleDateFormat sf = new SimpleDateFormat("yyyy年MM月dd日");
  67 + String infoformat = "日期(%s),路牌(%s)完全套跑,班次(%s),在套跑规则中未指定";
  68 +
  69 + if (schedulePlanInfo.getCl() == null) {
  70 + rerunBcInfo.lpBcFcsjCount.put(key, 1);
  71 +
  72 + ValidateResults_output.ValidInfo validInfo = new ValidateResults_output.ValidInfo();
  73 + validInfo.setSd(schedulePlanInfo.getScheduleDate());
  74 + validInfo.setDesc(String.format(
  75 + infoformat,
  76 + sf.format(schedulePlanInfo.getScheduleDate()),
  77 + schedulePlanInfo.getLpName(),
  78 + schedulePlanInfo.getFcsj(),
  79 + 1));
  80 +
  81 + rerunBcInfo.validInfoList.add(validInfo);
  82 + }
  83 + }
  84 +
  85 + @Override
  86 + public boolean supportsReverse() {
  87 + return true;
  88 + }
  89 +
  90 + @Override
  91 + public void reverse(Serializable context, Object o) throws Exception {
  92 + RerunBcInfo rerunBcInfo = (RerunBcInfo) context;
  93 + SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o;
  94 +
  95 + String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj();
  96 + rerunBcInfo.lpBcFcsjCount.remove(key);
  97 +
  98 + if (!rerunBcInfo.validInfoList.isEmpty()) { // 全部清空
  99 + rerunBcInfo.validInfoList.clear();
  100 + }
  101 + }
  102 +
  103 + @Override
  104 + public Class<?> getResultType() {
  105 + return List.class;
  106 + }
  107 +
  108 + @Override
  109 + public Object getResult(Serializable context) throws Exception {
  110 + RerunBcInfo rerunBcInfo = (RerunBcInfo) context;
  111 + return rerunBcInfo.validInfoList;
  112 + }
  113 +}
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInput.ktr
... ... @@ -828,7 +828,7 @@
828 828 <optimizationLevel>9</optimizationLevel>
829 829 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
830 830 <jsScript_name>Script 1</jsScript_name>
831   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x53bb;&#x9664;&#x7ad9;&#x70b9;&#x540d;&#x79f0;&#x53f3;&#x4fa7;&#x591a;&#x4f59;&#x7684;&#x6570;&#x5b57;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;&#x28;&#x5c;d&#x2b;&#x24;&#x29;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;if &#x28;qdzname &#x21;&#x3d; &#x22;&#x51fa;&#x573a;&#x22; &#x26;&#x26; qdzname &#x21;&#x3d; &#x22;&#x8fdb;&#x573a;&#x22;&#x29; &#x7b;&#xa; qdzname &#x3d; qdzname &#x2b; &#x22;&#x25;&#x22;&#x3b; &#x2f;&#x2f; &#x6a21;&#x7cca;&#x5339;&#x914d;&#x6807;&#x8bc6;&#x7b26;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; sendtime&#x5904;&#x7406;&#xff0c;hhmm&#xff0c;hh&#x3a;mm&#xff0c;hh,mm&#xa;var sendtime_calcu&#x3b;&#xa;if &#x28;sendtime.length &#x3d;&#x3d; 5&#x29; &#x7b; &#x2f;&#x2f; &#x6700;&#x957f;&#x683c;&#x5f0f;&#xff0c;&#x5305;&#x62ec;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x7edf;&#x4e00;&#x628a;&#x5206;&#x9694;&#x7b26;&#x66ff;&#x6362;&#x6210;&#x5192;&#x53f7;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;3, 2&#x29;&#x3b;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; if &#x28;sendtime.indexOf&#x28;&#x22;&#x3a;&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5192;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x65e0;&#x9700;&#x4fee;&#x6539;&#xa; sendtime_calcu &#x3d; sendtime&#x3b;&#xa; &#x7d; else if &#x28;sendtime.indexOf&#x28;&#x22;,&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x9017;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d; else &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 3&#x29; &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;1, 2&#x29;&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5168;&#x90e8;&#x4fee;&#x6b63;&#x5b8c;&#x6bd5;&#x540e;&#xff0c;&#x5982;&#x679c;&#x957f;&#x5ea6;&#x4e0d;&#x662f;5&#xff0c;&#x524d;&#x9762;&#x8865;0&#xa;if &#x28;sendtime_calcu.length &#x21;&#x3d; 5&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; &#x22;0&#x22; &#x2b; sendtime_calcu&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x505c;&#x9a76;&#xa;var ists &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
  831 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x53bb;&#x9664;&#x7ad9;&#x70b9;&#x540d;&#x79f0;&#x53f3;&#x4fa7;&#x591a;&#x4f59;&#x7684;&#x6570;&#x5b57;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;&#x28;&#x5c;d&#x2b;&#x24;&#x29;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;if &#x28;qdzname &#x21;&#x3d; &#x22;&#x51fa;&#x573a;&#x22; &#x26;&#x26; qdzname &#x21;&#x3d; &#x22;&#x8fdb;&#x573a;&#x22;&#x29; &#x7b;&#xa; qdzname &#x3d; qdzname &#x2b; &#x22;&#x25;&#x22;&#x3b; &#x2f;&#x2f; &#x6a21;&#x7cca;&#x5339;&#x914d;&#x6807;&#x8bc6;&#x7b26;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; sendtime&#x5904;&#x7406;&#xff0c;hhmm&#xff0c;hh&#x3a;mm&#xff0c;hh,mm&#xa;var sendtime_calcu &#x3d; sendtime.replace&#x28;&#x2f;&#x5c;s&#x2f;g, &#x22;&#x22;&#x29;&#x3b;&#xa;if &#x28;sendtime.length &#x3d;&#x3d; 5&#x29; &#x7b; &#x2f;&#x2f; &#x6700;&#x957f;&#x683c;&#x5f0f;&#xff0c;&#x5305;&#x62ec;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x7edf;&#x4e00;&#x628a;&#x5206;&#x9694;&#x7b26;&#x66ff;&#x6362;&#x6210;&#x5192;&#x53f7;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;3, 2&#x29;&#x3b;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; if &#x28;sendtime.indexOf&#x28;&#x22;&#x3a;&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5192;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x65e0;&#x9700;&#x4fee;&#x6539;&#xa; sendtime_calcu &#x3d; sendtime&#x3b;&#xa; &#x7d; else if &#x28;sendtime.indexOf&#x28;&#x22;,&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x9017;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d; else &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 3&#x29; &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;1, 2&#x29;&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5168;&#x90e8;&#x4fee;&#x6b63;&#x5b8c;&#x6bd5;&#x540e;&#xff0c;&#x5982;&#x679c;&#x957f;&#x5ea6;&#x4e0d;&#x662f;5&#xff0c;&#x524d;&#x9762;&#x8865;0&#xa;if &#x28;sendtime_calcu.length &#x21;&#x3d; 5&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; &#x22;0&#x22; &#x2b; sendtime_calcu&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x505c;&#x9a76;&#xa;var ists &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
832 832 </jsScript> </jsScripts> <fields> <field> <name>qdzname</name>
833 833 <rename>qdzname</rename>
834 834 <type>String</type>
... ... @@ -3052,4 +3052,4 @@
3052 3052 </slave-step-copy-partition-distribution>
3053 3053 <slave_transformation>N</slave_transformation>
3054 3054  
3055   -</transformation>
  3055 +</transformation>
3056 3056 \ No newline at end of file
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInput2.ktr
... ... @@ -828,7 +828,7 @@
828 828 <optimizationLevel>9</optimizationLevel>
829 829 <jsScripts> <jsScript> <jsScript_type>0</jsScript_type>
830 830 <jsScript_name>Script 1</jsScript_name>
831   - <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x53bb;&#x9664;&#x7ad9;&#x70b9;&#x540d;&#x79f0;&#x53f3;&#x4fa7;&#x591a;&#x4f59;&#x7684;&#x6570;&#x5b57;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;&#x28;&#x5c;d&#x2b;&#x24;&#x29;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;if &#x28;qdzname &#x21;&#x3d; &#x22;&#x51fa;&#x573a;&#x22; &#x26;&#x26; qdzname &#x21;&#x3d; &#x22;&#x8fdb;&#x573a;&#x22;&#x29; &#x7b;&#xa; qdzname &#x3d; qdzname &#x2b; &#x22;&#x25;&#x22;&#x3b; &#x2f;&#x2f; &#x6a21;&#x7cca;&#x5339;&#x914d;&#x6807;&#x8bc6;&#x7b26;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; sendtime&#x5904;&#x7406;&#xff0c;hhmm&#xff0c;hh&#x3a;mm&#xff0c;hh,mm&#xa;var sendtime_calcu&#x3b;&#xa;if &#x28;sendtime.length &#x3d;&#x3d; 5&#x29; &#x7b; &#x2f;&#x2f; &#x6700;&#x957f;&#x683c;&#x5f0f;&#xff0c;&#x5305;&#x62ec;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x7edf;&#x4e00;&#x628a;&#x5206;&#x9694;&#x7b26;&#x66ff;&#x6362;&#x6210;&#x5192;&#x53f7;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;3, 2&#x29;&#x3b;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; if &#x28;sendtime.indexOf&#x28;&#x22;&#x3a;&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5192;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x65e0;&#x9700;&#x4fee;&#x6539;&#xa; sendtime_calcu &#x3d; sendtime&#x3b;&#xa; &#x7d; else if &#x28;sendtime.indexOf&#x28;&#x22;,&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x9017;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d; else &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 3&#x29; &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;1, 2&#x29;&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5168;&#x90e8;&#x4fee;&#x6b63;&#x5b8c;&#x6bd5;&#x540e;&#xff0c;&#x5982;&#x679c;&#x957f;&#x5ea6;&#x4e0d;&#x662f;5&#xff0c;&#x524d;&#x9762;&#x8865;0&#xa;if &#x28;sendtime_calcu.length &#x21;&#x3d; 5&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; &#x22;0&#x22; &#x2b; sendtime_calcu&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x505c;&#x9a76;&#xa;var ists &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
  831 + <jsScript_script>&#x2f;&#x2f;Script here&#xa;&#xa;&#x2f;&#x2f; &#x4f7f;&#x7528;&#x6b63;&#x5219;&#x8868;&#x8fbe;&#x5f0f;&#x53bb;&#x9664;&#x7ad9;&#x70b9;&#x540d;&#x79f0;&#x53f3;&#x4fa7;&#x591a;&#x4f59;&#x7684;&#x6570;&#x5b57;&#xa;qdzname &#x3d; qdzname.replace&#x28;&#x2f;&#x28;&#x5c;d&#x2b;&#x24;&#x29;&#x2f;g,&#x27;&#x27;&#x29;&#x3b;&#xa;if &#x28;qdzname &#x21;&#x3d; &#x22;&#x51fa;&#x573a;&#x22; &#x26;&#x26; qdzname &#x21;&#x3d; &#x22;&#x8fdb;&#x573a;&#x22;&#x29; &#x7b;&#xa; qdzname &#x3d; qdzname &#x2b; &#x22;&#x25;&#x22;&#x3b; &#x2f;&#x2f; &#x6a21;&#x7cca;&#x5339;&#x914d;&#x6807;&#x8bc6;&#x7b26;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; sendtime&#x5904;&#x7406;&#xff0c;hhmm&#xff0c;hh&#x3a;mm&#xff0c;hh,mm&#xa;var sendtime_calcu &#x3d; sendtime.replace&#x28;&#x2f;&#x5c;s&#x2f;g, &#x22;&#x22;&#x29;&#x3b;&#xa;if &#x28;sendtime.length &#x3d;&#x3d; 5&#x29; &#x7b; &#x2f;&#x2f; &#x6700;&#x957f;&#x683c;&#x5f0f;&#xff0c;&#x5305;&#x62ec;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x7edf;&#x4e00;&#x628a;&#x5206;&#x9694;&#x7b26;&#x66ff;&#x6362;&#x6210;&#x5192;&#x53f7;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;3, 2&#x29;&#x3b;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 4&#x29; &#x7b;&#xa; if &#x28;sendtime.indexOf&#x28;&#x22;&#x3a;&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x5192;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x65e0;&#x9700;&#x4fee;&#x6539;&#xa; sendtime_calcu &#x3d; sendtime&#x3b;&#xa; &#x7d; else if &#x28;sendtime.indexOf&#x28;&#x22;,&#x22;&#x29; &#x3e; 0&#x29; &#x7b; &#x2f;&#x2f; &#x9017;&#x53f7;&#x5206;&#x9694;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d; else &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 2&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;2, 2&#x29;&#x3b;&#xa; &#x7d;&#xa;&#x7d; else if &#x28;sendtime.length &#x3d;&#x3d; 3&#x29; &#x7b; &#x2f;&#x2f; &#x65e0;&#x5206;&#x9694;&#x7b26;&#xff0c;&#x6539;&#x6210;&#x5192;&#x53f7;&#x5206;&#x9694;&#xa; sendtime_calcu &#x3d; sendtime.substr&#x28;0, 1&#x29; &#x2b; &#x22;&#x3a;&#x22; &#x2b; sendtime.substr&#x28;1, 2&#x29;&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x5168;&#x90e8;&#x4fee;&#x6b63;&#x5b8c;&#x6bd5;&#x540e;&#xff0c;&#x5982;&#x679c;&#x957f;&#x5ea6;&#x4e0d;&#x662f;5&#xff0c;&#x524d;&#x9762;&#x8865;0&#xa;if &#x28;sendtime_calcu.length &#x21;&#x3d; 5&#x29; &#x7b;&#xa; sendtime_calcu &#x3d; &#x22;0&#x22; &#x2b; sendtime_calcu&#x3b;&#xa;&#x7d;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x5206;&#x73ed;&#xa;var isfb &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;&#x505c;&#x9a76;&#xa;var ists &#x3d; 0&#x3b;&#xa;&#xa;&#x2f;&#x2f; &#x8bbe;&#x7f6e;isCanceled&#xa;var iscanceled &#x3d; 0&#x3b;</jsScript_script>
832 832 </jsScript> </jsScripts> <fields> <field> <name>qdzname</name>
833 833 <rename>qdzname</rename>
834 834 <type>String</type>
... ... @@ -3052,4 +3052,4 @@
3052 3052 </slave-step-copy-partition-distribution>
3053 3053 <slave_transformation>N</slave_transformation>
3054 3054  
3055   -</transformation>
  3055 +</transformation>
3056 3056 \ No newline at end of file
... ...
src/main/resources/datatools/ktrs/ttinfodetailDataInputMetaData.ktr
... ... @@ -26,7 +26,7 @@
26 26 </parameter>
27 27 <parameter>
28 28 <name>injectktrfile</name>
29   - <default_value>&#x2f;Users&#x2f;xu&#x2f;resource&#x2f;project_code&#x2f;bsth_project&#x2f;bsth_control&#x2f;src&#x2f;main&#x2f;resources&#x2f;datatools&#x2f;ktrs&#x2f;ttinfodetailDataInput.ktr</default_value>
  29 + <default_value>&#x2f;Users&#x2f;xu&#x2f;resource&#x2f;project_code&#x2f;bsth_project&#x2f;bsth_control_parent&#x2f;bsth_control&#x2f;src&#x2f;main&#x2f;resources&#x2f;datatools&#x2f;ktrs&#x2f;ttinfodetailDataInput.ktr</default_value>
30 30 <description>&#x6ce8;&#x5165;&#x5143;&#x6570;&#x636e;&#x7684;ktr&#x6587;&#x4ef6;</description>
31 31 </parameter>
32 32 <parameter>
... ... @@ -422,15 +422,15 @@
422 422 <source_step>&#x589e;&#x52a0;normalize&#x5143;&#x6570;&#x636e;</source_step>
423 423 <source_field>nfieldname</source_field>
424 424 </mapping> <mapping> <target_step_name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</target_step_name>
425   - <target_attribute_key>LENGTH</target_attribute_key>
426   - <target_detail>Y</target_detail>
427   - <source_step>&#x589e;&#x52a0;excel&#x5b57;&#x6bb5;&#x5176;&#x4ed6;&#x5143;&#x6570;&#x636e;</source_step>
428   - <source_field>length</source_field>
429   - </mapping> <mapping> <target_step_name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</target_step_name>
430 425 <target_attribute_key>SHEET_NAME</target_attribute_key>
431 426 <target_detail>Y</target_detail>
432 427 <source_step>&#x83b7;&#x53d6;excel&#x6587;&#x4ef6;&#x540d;</source_step>
433 428 <source_field>sheetname_</source_field>
  429 + </mapping> <mapping> <target_step_name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</target_step_name>
  430 + <target_attribute_key>LENGTH</target_attribute_key>
  431 + <target_detail>Y</target_detail>
  432 + <source_step>&#x589e;&#x52a0;excel&#x5b57;&#x6bb5;&#x5176;&#x4ed6;&#x5143;&#x6570;&#x636e;</source_step>
  433 + <source_field>length</source_field>
434 434 </mapping> <mapping> <target_step_name>&#x589e;&#x52a0;&#x65f6;&#x523b;&#x8868;&#x540d;&#x5b57;&#xff0c;&#x7ebf;&#x8def;&#x540d;&#x5b57;&#xff0c;&#x505c;&#x8f66;&#x573a;&#x540d;&#x5b57;</target_step_name>
435 435 <target_attribute_key>NAME</target_attribute_key>
436 436 <target_detail>Y</target_detail>
... ... @@ -446,41 +446,41 @@
446 446 <target_detail>Y</target_detail>
447 447 <source_step>&#x5217;&#x62c6;&#x5206;&#x4e3a;&#x591a;&#x884c;</source_step>
448 448 <source_field>fieldName</source_field>
449   - </mapping> <mapping> <target_step_name>&#x884c;&#x8f6c;&#x5217;</target_step_name>
450   - <target_attribute_key>VALUE</target_attribute_key>
451   - <target_detail>Y</target_detail>
452   - <source_step>&#x5217;&#x62c6;&#x5206;&#x4e3a;&#x591a;&#x884c; 2</source_step>
453   - <source_field>fieldName</source_field>
454 449 </mapping> <mapping> <target_step_name>Excel&#x8f93;&#x5165;</target_step_name>
455 450 <target_attribute_key>TRIM_TYPE</target_attribute_key>
456 451 <target_detail>Y</target_detail>
457 452 <source_step>&#x5217;&#x62c6;&#x5206;&#x4e3a;&#x591a;&#x884c;</source_step>
458 453 <source_field>trim_type</source_field>
459 454 </mapping> <mapping> <target_step_name>&#x884c;&#x8f6c;&#x5217;</target_step_name>
460   - <target_attribute_key>NORMALISED</target_attribute_key>
  455 + <target_attribute_key>VALUE</target_attribute_key>
461 456 <target_detail>Y</target_detail>
462 457 <source_step>&#x5217;&#x62c6;&#x5206;&#x4e3a;&#x591a;&#x884c; 2</source_step>
463   - <source_field>value</source_field>
  458 + <source_field>fieldName</source_field>
464 459 </mapping> <mapping> <target_step_name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</target_step_name>
465 460 <target_attribute_key>REPEAT</target_attribute_key>
466 461 <target_detail>Y</target_detail>
467 462 <source_step>&#x589e;&#x52a0;excel&#x5b57;&#x6bb5;&#x5176;&#x4ed6;&#x5143;&#x6570;&#x636e;</source_step>
468 463 <source_field>repeat</source_field>
469   - </mapping> <mapping> <target_step_name>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</target_step_name>
  464 + </mapping> <mapping> <target_step_name>&#x884c;&#x8f6c;&#x5217;</target_step_name>
470 465 <target_attribute_key>NORMALISED</target_attribute_key>
471 466 <target_detail>Y</target_detail>
472   - <source_step>&#x589e;&#x52a0;normalize&#x5143;&#x6570;&#x636e;</source_step>
473   - <source_field>valuefield</source_field>
  467 + <source_step>&#x5217;&#x62c6;&#x5206;&#x4e3a;&#x591a;&#x884c; 2</source_step>
  468 + <source_field>value</source_field>
474 469 </mapping> <mapping> <target_step_name>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</target_step_name>
475   - <target_attribute_key>VALUE</target_attribute_key>
  470 + <target_attribute_key>NORMALISED</target_attribute_key>
476 471 <target_detail>Y</target_detail>
477 472 <source_step>&#x589e;&#x52a0;normalize&#x5143;&#x6570;&#x636e;</source_step>
478   - <source_field>nfieldname</source_field>
  473 + <source_field>valuefield</source_field>
479 474 </mapping> <mapping> <target_step_name>&#x65f6;&#x523b;&#x8868;&#x660e;&#x7ec6;&#x4fe1;&#x606f;Excel&#x8f93;&#x5165;</target_step_name>
480 475 <target_attribute_key>FORMAT</target_attribute_key>
481 476 <target_detail>Y</target_detail>
482 477 <source_step>&#x589e;&#x52a0;excel&#x5b57;&#x6bb5;&#x5176;&#x4ed6;&#x5143;&#x6570;&#x636e;</source_step>
483 478 <source_field>format</source_field>
  479 + </mapping> <mapping> <target_step_name>&#x73ed;&#x6b21;&#x6570;&#x636e;&#x8303;&#x5f0f;&#x5316;</target_step_name>
  480 + <target_attribute_key>VALUE</target_attribute_key>
  481 + <target_detail>Y</target_detail>
  482 + <source_step>&#x589e;&#x52a0;normalize&#x5143;&#x6570;&#x636e;</source_step>
  483 + <source_field>nfieldname</source_field>
484 484 </mapping> <mapping> <target_step_name>Excel&#x8f93;&#x5165;</target_step_name>
485 485 <target_attribute_key>PRECISION</target_attribute_key>
486 486 <target_detail>Y</target_detail>
... ... @@ -495,6 +495,48 @@
495 495 </step>
496 496  
497 497 <step>
  498 + <name>&#x505c;&#x8f66;&#x573a;&#x540d;&#x79f0;</name>
  499 + <type>DBLookup</type>
  500 + <description/>
  501 + <distribute>Y</distribute>
  502 + <custom_distribution/>
  503 + <copies>1</copies>
  504 + <partitioning>
  505 + <method>none</method>
  506 + <schema_name/>
  507 + </partitioning>
  508 + <connection>bus_control_variable</connection>
  509 + <cache>N</cache>
  510 + <cache_load_all>N</cache_load_all>
  511 + <cache_size>0</cache_size>
  512 + <lookup>
  513 + <schema/>
  514 + <table>bsth_c_car_park</table>
  515 + <orderby/>
  516 + <fail_on_multiple>N</fail_on_multiple>
  517 + <eat_row_on_failure>N</eat_row_on_failure>
  518 + <key>
  519 + <name>car_park</name>
  520 + <field>park_code</field>
  521 + <condition>&#x3d;</condition>
  522 + <name2/>
  523 + </key>
  524 + <value>
  525 + <name>park_name</name>
  526 + <rename>tccname_</rename>
  527 + <default/>
  528 + <type>String</type>
  529 + </value>
  530 + </lookup>
  531 + <cluster_schema/>
  532 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  533 + <xloc>319</xloc>
  534 + <yloc>468</yloc>
  535 + <draw>Y</draw>
  536 + </GUI>
  537 + </step>
  538 +
  539 + <step>
498 540 <name>&#x505c;&#x8f66;&#x573a;&#x540d;&#x79f0;metadata&#x5b57;&#x6bb5;</name>
499 541 <type>SelectValues</type>
500 542 <description/>
... ... @@ -527,6 +569,48 @@
527 569 </step>
528 570  
529 571 <step>
  572 + <name>&#x505c;&#x8f66;&#x573a;&#x7f16;&#x7801;</name>
  573 + <type>DBLookup</type>
  574 + <description/>
  575 + <distribute>Y</distribute>
  576 + <custom_distribution/>
  577 + <copies>1</copies>
  578 + <partitioning>
  579 + <method>none</method>
  580 + <schema_name/>
  581 + </partitioning>
  582 + <connection>bus_control_variable</connection>
  583 + <cache>N</cache>
  584 + <cache_load_all>N</cache_load_all>
  585 + <cache_size>0</cache_size>
  586 + <lookup>
  587 + <schema/>
  588 + <table>bsth_c_line_information</table>
  589 + <orderby/>
  590 + <fail_on_multiple>N</fail_on_multiple>
  591 + <eat_row_on_failure>N</eat_row_on_failure>
  592 + <key>
  593 + <name>lineinfoid_</name>
  594 + <field>id</field>
  595 + <condition>&#x3d;</condition>
  596 + <name2/>
  597 + </key>
  598 + <value>
  599 + <name>car_park</name>
  600 + <rename>car_park</rename>
  601 + <default/>
  602 + <type>String</type>
  603 + </value>
  604 + </lookup>
  605 + <cluster_schema/>
  606 + <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
  607 + <xloc>182</xloc>
  608 + <yloc>467</yloc>
  609 + <draw>Y</draw>
  610 + </GUI>
  611 + </step>
  612 +
  613 + <step>
530 614 <name>&#x5220;&#x9664;&#x4e4b;&#x524d;&#x7684;&#x660e;&#x7ec6;&#x4fe1;&#x606f;</name>
531 615 <type>ExecSQL</type>
532 616 <description/>
... ... @@ -1237,58 +1321,6 @@
1237 1321 </step>
1238 1322  
1239 1323 <step>
1240   - <name>&#x9017;&#x53f7;&#x5207;&#x5206;&#x6210;&#x5b57;&#x6bb5;&#x540d;</name>
1241   - <type>SplitFieldToRows3</type>
1242   - <description/>
1243   - <distribute>Y</distribute>
1244   - <custom_distribution/>
1245   - <copies>1</copies>
1246   - <partitioning>
1247   - <method>none</method>
1248   - <schema_name/>
1249   - </partitioning>
1250   - <splitfield>fieldnames</splitfield>
1251   - <delimiter>,</delimiter>
1252   - <newfield>fieldname</newfield>
1253   - <rownum>N</rownum>
1254   - <rownum_field/>
1255   - <resetrownumber>Y</resetrownumber>
1256   - <delimiter_is_regex>N</delimiter_is_regex>
1257   - <cluster_schema/>
1258   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1259   - <xloc>442</xloc>
1260   - <yloc>153</yloc>
1261   - <draw>Y</draw>
1262   - </GUI>
1263   - </step>
1264   -
1265   - <step>
1266   - <name>&#x9017;&#x53f7;&#x5207;&#x5206;&#x6210;&#x5b57;&#x6bb5;&#x540d; 2</name>
1267   - <type>SplitFieldToRows3</type>
1268   - <description/>
1269   - <distribute>Y</distribute>
1270   - <custom_distribution/>
1271   - <copies>1</copies>
1272   - <partitioning>
1273   - <method>none</method>
1274   - <schema_name/>
1275   - </partitioning>
1276   - <splitfield>normalizefieldnames_</splitfield>
1277   - <delimiter>,</delimiter>
1278   - <newfield>nfieldname</newfield>
1279   - <rownum>N</rownum>
1280   - <rownum_field/>
1281   - <resetrownumber>Y</resetrownumber>
1282   - <delimiter_is_regex>N</delimiter_is_regex>
1283   - <cluster_schema/>
1284   - <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1285   - <xloc>444</xloc>
1286   - <yloc>247</yloc>
1287   - <draw>Y</draw>
1288   - </GUI>
1289   - </step>
1290   -
1291   - <step>
1292 1324 <name>&#x83b7;&#x53d6;&#x7ebf;&#x8def;&#x6807;&#x51c6;id</name>
1293 1325 <type>GetVariable</type>
1294 1326 <description/>
... ... @@ -1322,8 +1354,8 @@
1322 1354 </step>
1323 1355  
1324 1356 <step>
1325   - <name>&#x505c;&#x8f66;&#x573a;&#x7f16;&#x7801;</name>
1326   - <type>DBLookup</type>
  1357 + <name>&#x9017;&#x53f7;&#x5207;&#x5206;&#x6210;&#x5b57;&#x6bb5;&#x540d;</name>
  1358 + <type>SplitFieldToRows3</type>
1327 1359 <description/>
1328 1360 <distribute>Y</distribute>
1329 1361 <custom_distribution/>
... ... @@ -1332,40 +1364,24 @@
1332 1364 <method>none</method>
1333 1365 <schema_name/>
1334 1366 </partitioning>
1335   - <connection>bus_control_variable</connection>
1336   - <cache>N</cache>
1337   - <cache_load_all>N</cache_load_all>
1338   - <cache_size>0</cache_size>
1339   - <lookup>
1340   - <schema/>
1341   - <table>bsth_c_line_information</table>
1342   - <orderby/>
1343   - <fail_on_multiple>N</fail_on_multiple>
1344   - <eat_row_on_failure>N</eat_row_on_failure>
1345   - <key>
1346   - <name>lineinfoid_</name>
1347   - <field>id</field>
1348   - <condition>&#x3d;</condition>
1349   - <name2/>
1350   - </key>
1351   - <value>
1352   - <name>car_park</name>
1353   - <rename>car_park</rename>
1354   - <default/>
1355   - <type>String</type>
1356   - </value>
1357   - </lookup>
  1367 + <splitfield>fieldnames</splitfield>
  1368 + <delimiter>,</delimiter>
  1369 + <newfield>fieldname</newfield>
  1370 + <rownum>N</rownum>
  1371 + <rownum_field/>
  1372 + <resetrownumber>Y</resetrownumber>
  1373 + <delimiter_is_regex>N</delimiter_is_regex>
1358 1374 <cluster_schema/>
1359 1375 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1360   - <xloc>182</xloc>
1361   - <yloc>467</yloc>
  1376 + <xloc>442</xloc>
  1377 + <yloc>153</yloc>
1362 1378 <draw>Y</draw>
1363 1379 </GUI>
1364 1380 </step>
1365 1381  
1366 1382 <step>
1367   - <name>&#x505c;&#x8f66;&#x573a;&#x540d;&#x79f0;</name>
1368   - <type>DBLookup</type>
  1383 + <name>&#x9017;&#x53f7;&#x5207;&#x5206;&#x6210;&#x5b57;&#x6bb5;&#x540d; 2</name>
  1384 + <type>SplitFieldToRows3</type>
1369 1385 <description/>
1370 1386 <distribute>Y</distribute>
1371 1387 <custom_distribution/>
... ... @@ -1374,33 +1390,17 @@
1374 1390 <method>none</method>
1375 1391 <schema_name/>
1376 1392 </partitioning>
1377   - <connection>bus_control_variable</connection>
1378   - <cache>N</cache>
1379   - <cache_load_all>N</cache_load_all>
1380   - <cache_size>0</cache_size>
1381   - <lookup>
1382   - <schema/>
1383   - <table>bsth_c_car_park</table>
1384   - <orderby/>
1385   - <fail_on_multiple>N</fail_on_multiple>
1386   - <eat_row_on_failure>N</eat_row_on_failure>
1387   - <key>
1388   - <name>car_park</name>
1389   - <field>park_code</field>
1390   - <condition>&#x3d;</condition>
1391   - <name2/>
1392   - </key>
1393   - <value>
1394   - <name>park_name</name>
1395   - <rename>tccname_</rename>
1396   - <default/>
1397   - <type>String</type>
1398   - </value>
1399   - </lookup>
  1393 + <splitfield>normalizefieldnames_</splitfield>
  1394 + <delimiter>,</delimiter>
  1395 + <newfield>nfieldname</newfield>
  1396 + <rownum>N</rownum>
  1397 + <rownum_field/>
  1398 + <resetrownumber>Y</resetrownumber>
  1399 + <delimiter_is_regex>N</delimiter_is_regex>
1400 1400 <cluster_schema/>
1401 1401 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
1402   - <xloc>319</xloc>
1403   - <yloc>468</yloc>
  1402 + <xloc>444</xloc>
  1403 + <yloc>247</yloc>
1404 1404 <draw>Y</draw>
1405 1405 </GUI>
1406 1406 </step>
... ...
src/main/resources/rules/functions.drl
... ... @@ -6,4 +6,5 @@ import accumulate com.bsth.service.schedule.rules.shiftloop.GidFbTimeFunction gi
6 6 import accumulate com.bsth.service.schedule.rules.shiftloop.GidFbFcnoFunction gidfbfcno;
7 7 import accumulate com.bsth.service.schedule.rules.ttinfo.LpInfoResultsFunction lpinforesult;
8 8 import accumulate com.bsth.service.schedule.rules.ttinfo.MinRuleQyrqFunction minruleqyrq;
9   -import accumulate com.bsth.service.schedule.rules.validate.ValidRepeatBcFunction vrb;
10 9 \ No newline at end of file
  10 +import accumulate com.bsth.service.schedule.rules.validate.ValidRepeatBcFunction vrb;
  11 +import accumulate com.bsth.service.schedule.rules.validate.ValidWholeRerunBcFunction vwrb;
... ...
src/main/resources/rules/ruleWrap.drl
... ... @@ -16,7 +16,8 @@ import com.bsth.service.schedule.rules.ScheduleRuleService;
16 16  
17 17 import com.bsth.entity.Line;
18 18 import com.bsth.entity.schedule.CarConfigInfo
19   -import com.bsth.entity.schedule.EmployeeConfigInfo;
  19 +import com.bsth.entity.schedule.EmployeeConfigInfo
  20 +import javax.print.attribute.standard.DateTimeAtCompleted;
20 21  
21 22 // 全局日志类(一般使用调用此规则的service类)
22 23 global Logger log;
... ... @@ -75,8 +76,11 @@ rule &quot;rw2&quot;
75 76 Line xl = new Line();
76 77 xl.setId(Integer.valueOf($xlId));
77 78 ((com.bsth.entity.schedule.rule.ScheduleRule1Flat) sw.getSrf()).setXl(xl);
78   - // id
79   - ((com.bsth.entity.schedule.rule.ScheduleRule1Flat) sw.getSrf()).setId((new Date()).getTime());
  79 + // id,使用当前日期作为原始值加上路牌id最为临时id值
  80 + DateTime dt = new DateTime(new Date());
  81 + DateTime dt2 = new DateTime(dt.year().get(), dt.monthOfYear().get(), dt.dayOfMonth().get(), 0, 0, 0);
  82 + long id = (dt2.toDate().getTime() + Long.parseLong($lpId));
  83 + ((com.bsth.entity.schedule.rule.ScheduleRule1Flat) sw.getSrf()).setId(id);
80 84 // 启用日期
81 85 ((com.bsth.entity.schedule.rule.ScheduleRule1Flat) sw.getSrf()).setQyrq($fromDate.toDate());
82 86 // 车辆配置
... ... @@ -112,6 +116,6 @@ rule &quot;rw3&quot;
112 116 when
113 117 $sri_wrap : Sri_Wrap($sri : sri, $xlId: xlId, $lpIds : lpIds)
114 118 then
115   - log.info("线路id={},lpids={}", $xlId, $lpIds);
  119 + log.info("线路id={},type={},ruleId={},lpids={}", $xlId, $sri.getsType(), $sri.getRuleId(), $lpIds);
116 120 sriList.add($sri);
117 121 end
118 122 \ No newline at end of file
... ...
src/main/resources/rules/validplan.drl
... ... @@ -49,11 +49,13 @@ rule &quot;Valid_repeat_bc&quot; // 验证是否存在重复班次
49 49 eval($sd.isBefore($ed) || $sd.isEqual($ed))
50 50 $spiList: ArrayList() from collect (SchedulePlanInfo(scheduleDate.getTime() == $sd.getMillis()))
51 51 $infos: ArrayList() from accumulate ($spi: SchedulePlanInfo() from $spiList, vrb($spi))
  52 + $infos2: ArrayList() from accumulate ($spi: SchedulePlanInfo() from $spiList, vwrb($spi))
52 53 then
53 54 // TODO:
54   - log.info("日期={},班次重复错误数={}", $sd, $infos.size());
  55 +// log.info("日期={},班次重复错误数={}", $sd, $infos.size());
55 56  
56 57 validResult.getInfos().addAll($infos);
  58 + validResult.getInfos().addAll($infos2);
57 59  
58 60 // 迭代
59 61 $lp.setStart_date($sd.plusDays(1));
... ...
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
... ... @@ -875,7 +875,7 @@ var BaseFun = function() {
875 875 //if(bcddsj < kssj)
876 876 // isLast.push(bcArray[b]);
877 877 }
878   - if(canCf.length>0) {
  878 + if(canCf.length>0 && canCf[canCf.length-1].isfb == 0) { // NEW,如果班次是分班班次,就不吃饭
879 879 console.log('countTzsj:' + countTzsj + 'length:' + canCf.length);
880 880 var fxDm = baseF.dirDmToIndex(canCf[canCf.length-1].xlDir);
881 881 if (map.cfdd == "allYes") { // NEW,如果选择的吃饭地点是所有,则使用班次的方向作为吃饭班次的方向
... ...
src/main/resources/static/pages/excep/mhspeedingList.html
... ... @@ -37,8 +37,8 @@
37 37 <th width="8%">开始时间</th>
38 38 <th width="8%">结束时间</th>
39 39 <th width="8%">持续时间</th>
40   - <th width="8%">查看轨迹</th>
41   - <th width="6%">操作</th>
  40 + <!-- <th width="8%">查看轨迹</th> -->
  41 + <th width="9%">操作</th>
42 42 </tr>
43 43 <tr role="row" class="filter">
44 44 <td></td>
... ... @@ -68,8 +68,8 @@
68 68 >=<input class="form-control" type="text" name="times" style="width:50px;display:inline!important"
69 69 onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();"/>
70 70 </td>
71   - <td>
72   - </td>
  71 + <!-- <td>
  72 + </td> -->
73 73 <td>
74 74 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
75 75 <i class="fa fa-search"></i> 搜索</button>
... ... @@ -94,7 +94,7 @@
94 94 {{each list as obj i}}
95 95 <tr>
96 96 <td style="vertical-align: middle;">
97   - <input type="checkbox" class="group-checkable icheck" data-id="{{obj.id}}">
  97 + {{(i+1)}}
98 98 </td>
99 99 <td>
100 100 {{obj.lineName}}
... ... @@ -131,9 +131,6 @@
131 131 轨迹回放
132 132 </a>
133 133 </td>
134   - <td>
135   -
136   - </td>
137 134 </tr>
138 135 {{/each}}
139 136 {{if list.length == 0}}
... ...
src/main/resources/static/pages/excep/speedingList.html
... ... @@ -36,8 +36,8 @@
36 36 <th width="10%">开始时间</th>
37 37 <th width="10%">结束时间</th>
38 38 <th width="8%">持续时间</th>
39   - <th width="8%">查看轨迹</th>
40   - <th width="6%">操作</th>
  39 + <!-- <th width="8%">查看轨迹</th> -->
  40 + <th width="8%">操作</th>
41 41 </tr>
42 42 <tr role="row" class="filter">
43 43 <td></td>
... ... @@ -70,8 +70,8 @@
70 70 >=<input class="form-control" type="text" name="times" style="width:50px;display:inline!important"
71 71 onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();"/>
72 72 </td>
73   - <td>
74   - </td>
  73 + <!-- <td>
  74 + </td> -->
75 75 <td>
76 76 <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
77 77 <i class="fa fa-search"></i> 搜索</button>
... ... @@ -96,7 +96,7 @@
96 96 {{each list as obj i}}
97 97 <tr>
98 98 <td style="vertical-align: middle;">
99   - <input type="checkbox" class="group-checkable icheck" data-id="{{obj.id}}">
  99 + {{(i+1)}}
100 100 </td>
101 101 <td>
102 102 {{obj.lineName}}
... ... @@ -130,9 +130,6 @@
130 130 查看轨迹
131 131 </a>
132 132 </td>
133   - <td>
134   -
135   - </td>
136 133 </tr>
137 134 {{/each}}
138 135 {{if list.length == 0}}
... ...
src/main/resources/static/pages/forms/statement/mileageReport.html
... ... @@ -305,7 +305,7 @@
305 305  
306 306 </tr>
307 307 {{/each}}
308   - {{if list.length == 0}}
  308 + {{if list.length == 1}}
309 309 <tr>
310 310 <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td>
311 311 </tr>
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -7,10 +7,26 @@ var gb_schedule_table = (function () {
7 7 var line2Schedule = {};
8 8 //车辆应发未发车辆数
9 9 var car_yfwf_map = {};
  10 +
  11 + var bcTypeOrderMap = {
  12 + 'out':0,
  13 + 'normal':1,
  14 + 'region':2,
  15 + 'major':3,
  16 + 'venting':4,
  17 + 'ldks':5,
  18 + 'in':6
  19 + };
  20 + var typeOrder = function (type) {
  21 + return bcTypeOrderMap[type]?bcTypeOrderMap[type]:0;
  22 + };
10 23 var schedule_sort = function (s1, s2) {
11   - return s1.fcsjT - s2.fcsjT;
  24 + var diff = s1['fcsjT'] - s2['fcsjT'];
  25 + return diff!=0?diff:typeOrder(s1['bcType'])-typeOrder(s2['bcType']);
12 26 };
13 27  
  28 +
  29 +
14 30 /**
15 31 * 检查是否存在重复班次
16 32 * @param list
... ... @@ -118,17 +134,27 @@ var gb_schedule_table = (function () {
118 134  
119 135 //计算实发时间差值
120 136 var calc_sch_real_shift = function (sch) {
121   - if (sch.fcsjActualTime) {
122   - var diff = parseInt((sch.fcsjActualTime - sch.dfsjT) / 1000 / 60);
123   - if (diff > 0)
124   - sch.fcsj_diff = '( +' + diff + ' )';
125   - else if (diff < 0)
126   - sch.fcsj_diff = '( ' + diff + ' )';
  137 + if (sch['fcsjActualTime']){
  138 + var diff = sch['fcsjActualTime'] - sch['dfsjT'], fcsj_diff;
  139 + fcsj_diff = parseInt(diff / 60000);
  140 + if(diff % 60000 != 0){
  141 + /*if(fcsj_diff > 0)
  142 + fcsj_diff ++;
  143 + else */if(fcsj_diff < 0)
  144 + fcsj_diff --;
  145 + }
  146 +
  147 + if(fcsj_diff > 0)
  148 + sch.fcsj_diff = '( +' + fcsj_diff + ' )';
  149 + else if (fcsj_diff < 0)
  150 + sch.fcsj_diff = '( ' + fcsj_diff + ' )';
127 151 else
128 152 sch.fcsj_diff = '';
129 153 }
130 154 };
131 155  
  156 +
  157 +
132 158 function arrayIsNull(array) {
133 159 return !array || array.length == 0;
134 160 }
... ...
src/main/resources/static/real_control_v2/js/main.js
... ... @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) {
169 169 function showUpdateDescription() {
170 170 //更新说明
171 171 var updateDescription = {
172   - date: '2017-08-13',
173   - text: '<h5>1、修复了 “子任务-区间调头” 当上下行里程不等时,站间距公里提示错误的问题!</h5>'
  172 + date: '2017-08-25',
  173 + text: '<h5>1、修复了一个bug,这个bug导致个别班次不显示实到时间!</h5>'
174 174 };
175 175  
176 176 var storage = window.localStorage
... ...
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_data_basic.js 0 → 100644
  1 +/* 基础数据管理模块 */
  2 +
  3 +var gb_data_basic = (function () {
  4 +
  5 + var stationRoutes, lineCode2NameAll, lineInformations, nbbm2deviceMap, device2nbbmMap, allPersonnel, svgAttrs;
  6 + var ep = EventProxy.create("stationRoutes", "lineCode2Name", "lineInformations", "nbbm2deviceId", "all_personnel", "svg_attrs"
  7 + , function (routes, code2Name, informations, nbbm2device, all_personnel, svgAttrMap) {
  8 + stationRoutes = routes;
  9 + lineCode2NameAll = code2Name;
  10 + lineInformations = informations;
  11 + nbbm2deviceMap = nbbm2device;
  12 + device2nbbmMap = gb_common.inverse(nbbm2deviceMap);
  13 + allPersonnel = all_personnel;
  14 + svgAttrs = svgAttrMap;
  15 + //gb_main_ep.emitLater('data-basic');
  16 + });
  17 +
  18 + var storage = window.localStorage;
  19 + //激活的线路
  20 + var activeLines = JSON.parse(storage.getItem('lineControlItems'));
  21 + //lineCode to line object
  22 + var codeToLine = {};
  23 + //lineCode idx string
  24 + var line_idx = (function () {
  25 + var str = '';
  26 + for (var i = 0, item; item = activeLines[i++];) {
  27 + str += (',' + item.lineCode);
  28 + codeToLine[item.lineCode] = item;
  29 + }
  30 + return str.substr(1);
  31 + })();
  32 +
  33 + //站点路由
  34 + gb_common.$get('/stationroute/multiLine', {lineIds: line_idx}, function (rs) {
  35 + var list = rs.list;//JSON.parse(rs.list);
  36 + var routeData = gb_common.groupBy(list, 'lineCode');
  37 + //排序
  38 + for (var lineCode in routeData) {
  39 + routeData[lineCode].sort(stationRouteSort);
  40 + }
  41 + ep.emit('stationRoutes', routeData);
  42 + });
  43 +
  44 + //线路标准信息
  45 + gb_common.$get('/lineInformation/line/multi', {lineCodes: line_idx}, function (rs) {
  46 + var informations = {};
  47 + $.each(rs, function () {
  48 + informations[this.line.lineCode] = this;
  49 + delete this['line'];
  50 + });
  51 + ep.emit('lineInformations', informations);
  52 + });
  53 +
  54 + //人员信息
  55 + loadAllPersonnel(function (data) {
  56 + ep.emit('all_personnel', data);
  57 + });
  58 + function loadAllPersonnel(cb) {
  59 + $.get('/personnel/all_py', function (rs) {
  60 + //转换成自动补全组件需要的数据
  61 + var data = [], code;
  62 + for(var i =0, p; p = rs[i++];){
  63 + code = p['workId'].indexOf('-')!=-1?p['workId'].split('-')[1]:p['workId'];
  64 + data.push({
  65 + value: code + '/' + p.name,
  66 + fullChars: p.fullChars.toUpperCase(),
  67 + camelChars: p.camelChars.toUpperCase()
  68 + });
  69 + }
  70 + cb && cb(data);
  71 + });
  72 + }
  73 +
  74 + var carparks = {};
  75 + //停车场数据
  76 + gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) {
  77 + rs.list.sort(function (a, b) {
  78 + return a.parkName.localeCompare(b.parkName);
  79 + });
  80 + $.each(rs.list, function () {
  81 + carparks[this.parkCode] = this;
  82 + });
  83 + });
  84 +
  85 + //车辆数据
  86 + var carsArray;
  87 + $.get('/basic/cars?t=' + Math.random(), function (rs) {
  88 + carsArray = rs;
  89 + });
  90 +
  91 + var getCarparkByCode = function (code) {
  92 + return carparks[code];
  93 + };
  94 +
  95 + //line code to name
  96 + $.get('/basic/lineCode2Name', function (rs) {
  97 + ep.emit('lineCode2Name', rs);
  98 + });
  99 +
  100 + //nbbm to device id
  101 + $.get('/basic/nbbm2deviceId', function (rs) {
  102 + ep.emit('nbbm2deviceId', rs);
  103 + });
  104 + //nbbm to 车牌号
  105 + var nbbm2PlateMap;
  106 + $.get('/basic/nbbm2PlateNo', function (rs) {
  107 + nbbm2PlateMap = rs;
  108 + });
  109 +
  110 + //模拟图属性数据
  111 + gb_common.$get('/realSchedule/svgAttr', {idx: line_idx}, function (rs) {
  112 + var data = {};
  113 + $.each(rs.list, function () {
  114 + this.hideStations = JSON.parse(this.hideStations);
  115 + this.nicknames = JSON.parse(this.nicknames);
  116 + data[this.lineCode] = this;
  117 + });
  118 + ep.emit('svg_attrs', data);
  119 + });
  120 +
  121 + //站点和停车场历时、公里对照数据
  122 + var stat_park_data;
  123 + var load_stat_park_data = function () {
  124 + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) {
  125 + stat_park_data = rs;
  126 + });
  127 + }
  128 + load_stat_park_data();
  129 +
  130 + function findLineByCodes(codeArr) {
  131 + var rs = [];
  132 + $.each(codeArr, function () {
  133 + rs.push(codeToLine[this]);
  134 + });
  135 + return rs;
  136 + }
  137 +
  138 + var findCodeByLinename = function (name) {
  139 + for (var code in lineCode2NameAll) {
  140 + if (name == lineCode2NameAll[code])
  141 + return code;
  142 + }
  143 +
  144 + return null;
  145 + };
  146 +
  147 + var getLineInformation = function (lineCode) {
  148 + return lineInformations[lineCode];
  149 + };
  150 +
  151 + var stationRouteSort = function (a, b) {
  152 + return a.stationRouteCode - b.stationRouteCode;
  153 + };
  154 +
  155 + return {
  156 + activeLines: activeLines,
  157 + line_idx: line_idx,
  158 + codeToLine: codeToLine,
  159 + nbbm2deviceMap: function () {
  160 + return nbbm2deviceMap;
  161 + },
  162 + device2nbbmMap: function () {
  163 + return device2nbbmMap;
  164 + },
  165 + getLineInformation: getLineInformation,
  166 + allInformations: function () {
  167 + return lineInformations;
  168 + },
  169 + stationRoutes: function (lineCode) {
  170 + return stationRoutes[lineCode]
  171 + },
  172 + findLineByCodes: findLineByCodes,
  173 + lineCode2NameAll: function () {
  174 + return lineCode2NameAll
  175 + },
  176 + allPersonnel: function () {
  177 + return allPersonnel;
  178 + },
  179 + findCodeByLinename: findCodeByLinename,
  180 + getCarparkByCode: getCarparkByCode,
  181 + getSvgAttr: function (lineCode) {
  182 + return svgAttrs[lineCode];
  183 + },
  184 + setSvgAttr: function (attr) {
  185 + attr.hideStations = JSON.parse(attr.hideStations);
  186 + attr.nicknames = JSON.parse(attr.nicknames);
  187 + svgAttrs[attr.lineCode] = attr;
  188 + },
  189 + //是否是环线
  190 + isLoopLine: function (lineCode) {
  191 + var data = gb_common.groupBy(stationRoutes[lineCode], 'directions');
  192 + //下行只有2个站点
  193 + var len = data[0].length;
  194 + if (len > 0 && data[1].length == 2) {
  195 + var first = data[0][0],
  196 + end = data[0][len - 1];
  197 +
  198 + /*if(first.stationName != end.stationName)
  199 + return false;*/
  200 +
  201 + var fPoint = {latitude: first.station.gLaty, longitude: first.station.gLonx}
  202 + , ePoint = {latitude: end.station.gLaty, longitude: end.station.gLonx};
  203 +
  204 + //并且上行起终点距离200米内
  205 + if (geolib.getDistance(fPoint, ePoint) < 200) {
  206 + return true;
  207 + }
  208 + }
  209 +
  210 + return false;
  211 + },
  212 + //刷新员工信息
  213 + refreshAllPersonnel: function (cb) {
  214 + loadAllPersonnel(function (data) {
  215 + allPersonnel = data;
  216 + cb && cb();
  217 + });
  218 + },
  219 + nbbm2PlateMap: function () {
  220 + return nbbm2PlateMap;
  221 + },
  222 + carsArray: function () {
  223 + return carsArray;
  224 + },
  225 + simpleParksArray: function () {
  226 + var map = {};
  227 + for(var code in carparks)
  228 + map[code] = carparks[code].parkName;
  229 + return map;
  230 + },
  231 + remarksMapps: function () {
  232 + return remarksMapps;
  233 + },
  234 + get_stat_park_data: function () {
  235 + return stat_park_data;
  236 + },
  237 + reload_stat_park_data: function () {
  238 + load_stat_park_data();
  239 + }
  240 + };
  241 +})();
... ...
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_data_gps.js 0 → 100644
  1 +/* gps 数据管理模块 */
  2 +
  3 +var gb_data_gps = (function () {
  4 +
  5 + //fixed time refresh delay
  6 + var delay = 1000 * 7;
  7 + //deviceId ——> gps
  8 + var realData = {};
  9 + //refresh after callback
  10 + var refreshEventCallbacks = [];
  11 + //register callback function
  12 + var registerCallback = function (cb) {
  13 + if (cb)
  14 + refreshEventCallbacks.push(cb);
  15 + };
  16 +
  17 + var refresh = function (cb) {
  18 + $.ajax({
  19 + url: '/gps/real/line',
  20 + data: {lineCodes: gb_data_basic.line_idx},
  21 + dataType: 'json',
  22 + success: function (rs) {
  23 + //用定时的gps来检测session断开
  24 + if(rs.status && rs.status==407){
  25 + location.href = '/login.html';
  26 + return;
  27 + }
  28 + refreshData(rs);
  29 + cb();
  30 + },
  31 + error: function (xr, t) {
  32 + notify_err('刷新GPS失败,稍后重试' + t);
  33 + cb();
  34 + }
  35 + });
  36 + };
  37 +
  38 + var refreshData = function (rs) {
  39 + var old, addArr = [],
  40 + upArr = [],
  41 + upDownChange = [];
  42 +
  43 + var schArray;
  44 + $.each(rs, function () {
  45 + old = realData[this.deviceId];
  46 + if (old) {
  47 + if (this.timestamp > old.timestamp) {
  48 + if (old.upDown != this.upDown)
  49 + upDownChange.push(this);
  50 + else
  51 + upArr.push(this);
  52 + }
  53 +
  54 + } else
  55 + addArr.push(this);
  56 +
  57 + /* //班次信息
  58 + if (this.schId) {
  59 + schArray = gb_schedule_table.findScheduleByLine(this.lineId);
  60 + if (schArray)
  61 + this.sch = schArray[this.schId];
  62 + }*/
  63 +
  64 + //时间格式化
  65 + this.dateStr = moment(this.timestamp).format('YYYY-MM-DD HH:mm:ss');
  66 + realData[this.deviceId] = this;
  67 + });
  68 +
  69 + //console.log('add array size: ' + addArr.length, 'up array size: ' + upArr.length);
  70 + //CCCallFuncN
  71 + $.each(refreshEventCallbacks, function (i, cb) {
  72 + cb(addArr, upArr, upDownChange);
  73 + });
  74 +
  75 + };
  76 +
  77 + var startFixedTime;
  78 + var fixedTimeRefresh = function () {
  79 + if (startFixedTime)
  80 + return;
  81 + startFixedTime = true;
  82 +
  83 + (function () {
  84 + var f = arguments.callee;
  85 + refresh(function () {
  86 + setTimeout(f, delay);
  87 + });
  88 + })();
  89 + };
  90 +
  91 + var gpsByLineCode = function (lineCode) {
  92 + var rs = [];
  93 + for (var device in realData) {
  94 + if (realData[device].lineId == lineCode)
  95 + rs.push(realData[device]);
  96 + }
  97 + return rs;
  98 + };
  99 +
  100 + var findOne = function (deviceId) {
  101 + return realData[deviceId];
  102 + };
  103 +
  104 + var findGpsByNbbm = function (nbbm) {
  105 + return realData[gb_data_basic.nbbm2deviceMap()[nbbm]];
  106 + };
  107 +
  108 + /**
  109 + * 设备掉线事件
  110 + */
  111 + var deviceOffline = function (gps) {
  112 + $.each(offlineCallbacks, function (i, cb) {
  113 + cb(gps);
  114 + });
  115 + };
  116 +
  117 + //注册掉线事件回调函数
  118 + var offlineCallbacks = [];
  119 + var registerOfflineCb = function (cb) {
  120 + if (cb)
  121 + offlineCallbacks.push(cb);
  122 + };
  123 +
  124 + return {
  125 + fixedTimeRefresh: fixedTimeRefresh,
  126 + registerCallback: registerCallback,
  127 + allGps: realData,
  128 + gpsByLineCode: gpsByLineCode,
  129 + findOne: findOne,
  130 + findGpsByNbbm: findGpsByNbbm,
  131 + deviceOffline: deviceOffline,
  132 + registerOfflineCb: registerOfflineCb
  133 + };
  134 +})();
... ...
src/main/resources/static/real_control_v2/mapmonitor/alone_page/alone_wrap.html 0 → 100644
  1 +<!DOCTYPE html>
  2 +<html lang="zh-cn">
  3 +
  4 +<head>
  5 + <meta charset="UTF-8">
  6 + <title>地图监控 v2.0</title>
  7 + <!-- uikit core style-->
  8 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/css/uikit.gradient.min.css" />
  9 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.gradient.min.css" />
  10 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.gradient.min.css" />
  11 + <link rel="stylesheet"
  12 + href="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.gradient.min.css" />
  13 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.gradient.min.css" />
  14 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/slidenav.gradient.min.css" />
  15 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.gradient.min.css" />
  16 +
  17 + <!-- main style -->
  18 + <link rel="stylesheet" href="/real_control_v2/css/main.css" />
  19 + <!-- north style -->
  20 + <link rel="stylesheet" href="/real_control_v2/css/north.css" />
  21 + <!-- home style -->
  22 + <link rel="stylesheet" href="/real_control_v2/css/home.css" />
  23 +
  24 + <!-- js tree -->
  25 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/jstree/default/style.css" />
  26 +
  27 + <link rel="stylesheet" href="/real_control_v2/css/modal_extend.css" />
  28 + <!-- perfect-scrollbar style -->
  29 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" />
  30 + <!-- layer 3.0.3 -->
  31 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/default/layer.css" />
  32 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/layer3.0.3/skin/moon/style.css" />
  33 +
  34 + <!-- flatpickr -->
  35 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css" >
  36 + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/themes/airbnb.css" >
  37 +
  38 + <link rel="stylesheet" href="/real_control_v2/css/ct_table.css" />
  39 +</head>
  40 +
  41 +<body>
  42 +<div class="main-container" style="height: 100%;">
  43 +</div>
  44 +
  45 +<!-- 地图相关 -->
  46 +<script src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
  47 +<script src="http://api.map.baidu.com/library/TrafficControl/1.4/src/TrafficControl_min.js"></script>
  48 +<script src="/assets/js/baidu//MarkerClusterer.js" merge="plugins"></script>
  49 +<script src="/assets/js/TransGPS.js" merge="plugins"></script>
  50 +<!-- 高德 -->
  51 +<script src="http://webapi.amap.com/maps?v=1.3&key=16cb1c5043847e09ef9edafdd77befda"></script>
  52 +<!-- jquery -->
  53 +<script src="/real_control_v2/assets/js/jquery.min.js"></script>
  54 +<!-- jquery actual -->
  55 +<script src="/real_control_v2/assets/js/jquery.actual.min.js" ></script>
  56 +<!-- moment.js 日期处理类库 -->
  57 +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script>
  58 +<script src="/real_control_v2/assets/plugins/moment/zh-cn.js"></script>
  59 +
  60 +<!-- flatpickr -->
  61 +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js"></script>
  62 +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js"></script>
  63 +
  64 +<!-- perfect-scrollbar -->
  65 +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script>
  66 +<!-- common js -->
  67 +<script src="/real_control_v2/js/common.js"></script>
  68 +<!-- art-template 模版引擎 -->
  69 +<script src="/assets/plugins/template.js" ></script>
  70 +<!-- d3 -->
  71 +<script src="/assets/js/d3.min.js"></script>
  72 +<!-- EventProxy -->
  73 +<script src="/assets/js/eventproxy.js"></script>
  74 +<!-- uikit core -->
  75 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/uikit.min.js" ></script>
  76 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/notify.min.js" ></script>
  77 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/tooltip.min.js"></script>
  78 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/autocomplete.min.js"></script>
  79 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/accordion.min.js" ></script>
  80 +<script src="/real_control_v2/assets/plugins/uikit-2.27.1/components/sticky.min.js" ></script>
  81 +
  82 +<!-- js tree -->
  83 +<script src="/real_control_v2/assets/plugins/jstree/jstree.min.js" ></script>
  84 +<!-- layer 3.0.3 -->
  85 +<script src="/real_control_v2/assets/plugins/layer3.0.3/layer.js"></script>
  86 +
  87 +<!-- 模态框扩展 -->
  88 +<script src="/real_control_v2/js/modal_extend.js" ></script>
  89 +
  90 +<script src="/real_control_v2/mapmonitor/alone_page/alone_data_basic.js" ></script>
  91 +<script src="/real_control_v2/mapmonitor/alone_page/alone_data_gps.js" ></script>
  92 +<script src="/real_control_v2/js/utils/ct_table.js" ></script>
  93 +<!-- jquery.serializejson JSON序列化插件 -->
  94 +<script src="/assets/plugins/jquery.serializejson.js" ></script>
  95 +<script>
  96 + (function () {
  97 + gb_data_gps.fixedTimeRefresh();
  98 + //嵌入地图页面
  99 + $('.main-container').load('/real_control_v2/mapmonitor/real.html', function () {
  100 + $('.map-system-msg.flex-left').remove();
  101 + });
  102 + })();
  103 +</script>
  104 +</body>
  105 +
  106 +</html>
... ...
src/main/resources/static/real_control_v2/mapmonitor/css/real.css
... ... @@ -64,7 +64,7 @@ input[type=checkbox].disabled{
64 64 position: absolute;
65 65 z-index: 2;
66 66 top: 20px;
67   - background: red;
  67 + background: white;
68 68 color: white;
69 69 padding: 7px 25px 7px 7px;
70 70 right: calc(50% - 250px);
... ... @@ -87,14 +87,17 @@ input[type=checkbox].disabled{
87 87 box-shadow: none;
88 88 }
89 89  
90   -.map-system-msg.flex-left a:before{
91   - content: '老版本地图';
  90 +.map-system-msg.flex-left a.now_map{
  91 + top: 35px;
  92 + width: 50px;
  93 +}
  94 +
  95 +.map-system-msg.flex-left a:after{
92 96 position: absolute;
93 97 width: 100%;
94 98 z-index: 2;
95 99 height: 100%;
96 100 background: #ffffff;
97   - top: 0;
98 101 left: 0;
99 102 text-align: center;
100 103 font-size: 12px;
... ... @@ -102,6 +105,26 @@ input[type=checkbox].disabled{
102 105 color: #969696;
103 106 }
104 107  
  108 +.map-system-msg.flex-left a.old_map:after{
  109 + content: '老版本地图';
  110 + top: 0;
  111 +}
  112 +
  113 +.map-system-msg.flex-left a.now_map>i{
  114 + font-size: 12px;
  115 + vertical-align: top;
  116 + color: #535151;
  117 + margin-top: -1px;
  118 +}
  119 +
  120 +.map-system-msg.flex-left a.now_map:after{
  121 + content: '单屏地图';
  122 + top: 0;
  123 + left: 20px;
  124 + text-align: left;
  125 + text-indent: 7px;
  126 +}
  127 +
105 128 .map-system-msg a:hover{
106 129 text-decoration: none;
107 130 }
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/config.js
... ... @@ -111,6 +111,8 @@ var gb_map_config = (function () {
111 111 function trafficSwitch(val) {
112 112 //修改配置项
113 113 set('traffic', this.checked);
  114 +
  115 + gb_map_imap.call('transparent_line', this.checked);
114 116 gb_map_imap.call('traffic', this.checked);
115 117 }
116 118  
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/map/platform/baidu.js
... ... @@ -57,6 +57,19 @@ var gb_map_baidu = (function(){
57 57  
58 58 //根据ID保存映射
59 59 polylines[opt.id]=_pLines;
  60 + }
  61 + ,
  62 + transparent_line: function (checked) {
  63 + for(var id in polylines){
  64 + for(var i=0,polyline;polyline=polylines[id][i++];){
  65 + if(polyline.isVisible()){
  66 + if(checked)
  67 + polyline.setStrokeOpacity(0.1);
  68 + else
  69 + polyline.setStrokeOpacity(0.6);
  70 + }
  71 + }
  72 + }
60 73 },
61 74 traffic: function (enable) {
62 75 if(enable)
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/map/platform/gaode.js
... ... @@ -92,6 +92,18 @@ var gb_map_gaode = (function() {
92 92  
93 93 polylines[opt.id]=_pLines;
94 94 },
  95 + transparent_line: function (checked) {
  96 + for(var id in polylines){
  97 + for(var i=0,polyline;polyline=polylines[id][i++];){
  98 + if(polyline.isVisible()){
  99 + if(checked)
  100 + polyline.setStrokeOpacity(0.1);
  101 + else
  102 + polyline.setStrokeOpacity(0.6);
  103 + }
  104 + }
  105 + }
  106 + },
95 107 //定位到线路中间点
96 108 centerToLine: function (opt) {
97 109 var _pLines = polylines[opt.id];
... ...
src/main/resources/static/real_control_v2/mapmonitor/real.html
... ... @@ -6,7 +6,10 @@
6 6 <link rel="stylesheet" href="/real_control_v2/assets/plugins/uikit-2.27.1/components/progress.gradient.min.css" merge="map_plugins">
7 7  
8 8 <div class="map-system-msg flex-left">
9   - <a class="z-depth-2" href="/pages/mapmonitor/alone/wrap.html" target="_blank"></a>
  9 + <a class="z-depth-2 old_map" href="/pages/mapmonitor/alone/wrap.html" target="_blank"></a>
  10 + <a class="z-depth-2 now_map" href="/real_control_v2/mapmonitor/alone_page/alone_wrap.html" target="_blank">
  11 + <i class="uk-icon-send-o"></i>
  12 + </a>
10 13 </div>
11 14  
12 15 <div id="real_map_container"></div>
... ...