Commit 35ff92e67e339dfd33bed5c680b2957ad03d3d6d

Authored by zb
2 parents c2dd7da4 e87ba568

Merge branch 'minhang' of git@192.168.168.201:panzhaov5/bsth_control.git into minhang

Showing 62 changed files with 2192 additions and 1073 deletions

Too many changes to show.

To preserve performance only 62 of 111 files are displayed.

src/main/java/com/bsth/controller/gps/GpsController.java
@@ -95,11 +95,12 @@ public class GpsController { @@ -95,11 +95,12 @@ public class GpsController {
95 95
96 /** 96 /**
97 * gps补全 97 * gps补全
  98 + * type 0 : 实时GPS 1:走补传
98 * @return 99 * @return
99 */ 100 */
100 @RequestMapping(value = "/gpsCompletion", method = RequestMethod.POST) 101 @RequestMapping(value = "/gpsCompletion", method = RequestMethod.POST)
101 - public Map<String, Object> gpsCompletion(@RequestParam long schId) {  
102 - return gpsService.gpsCompletion(schId); 102 + public Map<String, Object> gpsCompletion(@RequestParam long schId, @RequestParam int type) {
  103 + return gpsService.gpsCompletion(schId, type);
103 } 104 }
104 105
105 /** 106 /**
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON; @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON;
4 import com.alibaba.fastjson.serializer.PropertyFilter; 4 import com.alibaba.fastjson.serializer.PropertyFilter;
5 import com.bsth.common.ResponseCode; 5 import com.bsth.common.ResponseCode;
6 import com.bsth.data.BasicData; 6 import com.bsth.data.BasicData;
  7 +import com.bsth.data.Station2ParkBuffer;
7 import com.bsth.entity.Line; 8 import com.bsth.entity.Line;
  9 +import com.bsth.entity.realcontrol.StationToPark;
8 import com.google.common.base.Splitter; 10 import com.google.common.base.Splitter;
9 import com.google.common.collect.ArrayListMultimap; 11 import com.google.common.collect.ArrayListMultimap;
10 import com.google.common.collect.BiMap; 12 import com.google.common.collect.BiMap;
@@ -29,6 +31,9 @@ public class BasicDataController { @@ -29,6 +31,9 @@ public class BasicDataController {
29 BasicData basicData; 31 BasicData basicData;
30 32
31 Logger logger = LoggerFactory.getLogger(this.getClass()); 33 Logger logger = LoggerFactory.getLogger(this.getClass());
  34 +
  35 + @Autowired
  36 + Station2ParkBuffer station2ParkBuffer;
32 37
33 @RequestMapping("/cars") 38 @RequestMapping("/cars")
34 public Iterable<String> findAllNbbm(Map<String, Object> map){ 39 public Iterable<String> findAllNbbm(Map<String, Object> map){
@@ -180,4 +185,25 @@ public class BasicDataController { @@ -180,4 +185,25 @@ public class BasicDataController {
180 185
181 return rs; 186 return rs;
182 } 187 }
  188 +
  189 + /**
  190 + * 获取站点和停车场对照表
  191 + * @param idx
  192 + * @return
  193 + */
  194 + @RequestMapping("/station2ParkData")
  195 + public Map<String, Collection<StationToPark>> findStation2ParkData(@RequestParam String idx){
  196 + List<String> lines = Splitter.on(",").splitToList(idx);
  197 + ArrayListMultimap<String, StationToPark> rs = ArrayListMultimap.create();
  198 +
  199 + for(String lineCode : lines){
  200 + rs.putAll(lineCode, Station2ParkBuffer.get(lineCode));
  201 + }
  202 + return rs.asMap();
  203 + }
  204 +
  205 + @RequestMapping(value = "/deleteStation2Park", method = RequestMethod.POST)
  206 + public Map<String, Object> deleteStation2Park(@RequestParam String lineCode,@RequestParam Integer id){
  207 + return station2ParkBuffer.delete(lineCode, id);
  208 + }
183 } 209 }
src/main/java/com/bsth/controller/schedule/TrafficManageController.java
@@ -8,8 +8,6 @@ import org.springframework.web.bind.annotation.RequestMethod; @@ -8,8 +8,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
8 import org.springframework.web.bind.annotation.RequestParam; 8 import org.springframework.web.bind.annotation.RequestParam;
9 import org.springframework.web.bind.annotation.RestController; 9 import org.springframework.web.bind.annotation.RestController;
10 10
11 -import java.util.Map;  
12 -  
13 /** 11 /**
14 * 12 *
15 * @author BSTH 13 * @author BSTH
@@ -24,9 +22,9 @@ public class TrafficManageController { @@ -24,9 +22,9 @@ public class TrafficManageController {
24 22
25 23
26 @RequestMapping(value = "/setXL", method = RequestMethod.GET) 24 @RequestMapping(value = "/setXL", method = RequestMethod.GET)
27 - public String setXL(@RequestParam Map<String, Object> param) throws Exception { 25 + public String setXL(@RequestParam("ids") String ids) throws Exception {
28 try { 26 try {
29 - return trManageService.setXL(param); 27 + return trManageService.setXL(ids);
30 } catch (Exception exp) { 28 } catch (Exception exp) {
31 throw new Exception(exp.getCause()); 29 throw new Exception(exp.getCause());
32 } 30 }
src/main/java/com/bsth/data/BasicData.java
@@ -134,6 +134,9 @@ public class BasicData implements CommandLineRunner { @@ -134,6 +134,9 @@ public class BasicData implements CommandLineRunner {
134 @Autowired 134 @Autowired
135 GeoCacheData geoCacheData; 135 GeoCacheData geoCacheData;
136 136
  137 + @Autowired
  138 + Station2ParkBuffer station2ParkBuffer;
  139 +
137 140
138 @Override 141 @Override
139 public void run() { 142 public void run() {
@@ -160,6 +163,7 @@ public class BasicData implements CommandLineRunner { @@ -160,6 +163,7 @@ public class BasicData implements CommandLineRunner {
160 loadBusinessInfo(); 163 loadBusinessInfo();
161 164
162 geoCacheData.loadData(); 165 geoCacheData.loadData();
  166 + station2ParkBuffer.saveAll();
163 logger.info("加载基础数据成功!,"); 167 logger.info("加载基础数据成功!,");
164 } catch (Exception e) { 168 } catch (Exception e) {
165 logger.error("加载基础数据时出现异常,", e); 169 logger.error("加载基础数据时出现异常,", e);
src/main/java/com/bsth/data/Station2ParkBuffer.java 0 → 100644
  1 +package com.bsth.data;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.entity.realcontrol.ChildTaskPlan;
  5 +import com.bsth.entity.realcontrol.StationToPark;
  6 +import com.bsth.repository.realcontrol.StationToParkRepository;
  7 +import com.bsth.util.Arith;
  8 +import com.google.common.collect.ArrayListMultimap;
  9 +import org.joda.time.format.DateTimeFormat;
  10 +import org.joda.time.format.DateTimeFormatter;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.boot.CommandLineRunner;
  15 +import org.springframework.stereotype.Component;
  16 +
  17 +import java.util.*;
  18 +
  19 +/**
  20 + * 站到场 历时、公里 数据缓存
  21 + * Created by panzhao on 2017/7/10.
  22 + */
  23 +@Component
  24 +public class Station2ParkBuffer implements CommandLineRunner {
  25 +
  26 + @Autowired
  27 + StationToParkRepository stationToParkRepository;
  28 +
  29 + private static ArrayListMultimap listMultimap;
  30 +
  31 + private static Set<StationToPark> pstBuff;
  32 +
  33 + static Logger log = LoggerFactory.getLogger(Station2ParkBuffer.class);
  34 +
  35 + @Override
  36 + public void run(String... strings) throws Exception {
  37 + listMultimap = ArrayListMultimap.create();
  38 + pstBuff = new HashSet<>();
  39 + Iterator<StationToPark> iterator = stationToParkRepository.findAll().iterator();
  40 + StationToPark stp;
  41 + while (iterator.hasNext()) {
  42 + stp = iterator.next();
  43 + listMultimap.put(stp.getLineCode(), stp);
  44 + }
  45 + }
  46 +
  47 + public static List<StationToPark> get(String lineCode) {
  48 + return listMultimap.get(lineCode);
  49 + }
  50 +
  51 + public static StationToPark get(String lineCode, String sName, String eName) {
  52 + List<StationToPark> list = get(lineCode);
  53 + StationToPark stp = null;
  54 + for (StationToPark s : list) {
  55 + if (s.getStationName().equals(sName) && s.getParkName().equals(eName)) {
  56 + stp = s;
  57 + break;
  58 + }
  59 + }
  60 + return stp;
  61 + }
  62 +
  63 + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");
  64 +
  65 + public static void put(ChildTaskPlan ctask) {
  66 + try{
  67 + String type2 = ctask.getType2();
  68 + String lineCode = ctask.getSchedule().getXlBm(), sName, eName;
  69 +
  70 + if (type2.equals("2")) {
  71 + sName = ctask.getStartStationName();
  72 + eName = ctask.getEndStationName();
  73 + } else if (type2.equals("3")) {
  74 + eName = ctask.getStartStationName();
  75 + sName = ctask.getEndStationName();
  76 + } else
  77 + return;
  78 +
  79 + Float time = calcMinute(ctask);
  80 + Float mileage = ctask.getMileage();
  81 +
  82 + StationToPark stp = get(lineCode, sName, eName);
  83 + if (stp == null) {
  84 + stp = new StationToPark();
  85 + stp.setLineCode(lineCode);
  86 + stp.setStationName(sName);
  87 + stp.setParkName(eName);
  88 + listMultimap.put(lineCode, stp);
  89 + }
  90 +
  91 + if (type2.equals("2")) {
  92 + stp.setTime1(time);
  93 + stp.setMileage1(mileage);
  94 + } else {
  95 + stp.setTime2(time);
  96 + stp.setMileage2(mileage);
  97 + }
  98 +
  99 + pstBuff.add(stp);
  100 + }catch (Exception e){
  101 + log.error("", e);
  102 + }
  103 + }
  104 +
  105 + public static Float calcMinute(ChildTaskPlan ctask) {
  106 + long t = 0;
  107 +
  108 + try {
  109 + long st = fmtHHmm.parseMillis(ctask.getStartDate());
  110 + long et = fmtHHmm.parseMillis(ctask.getEndDate());
  111 +
  112 + t = et - st;
  113 + } catch (Exception e) {
  114 + e.printStackTrace();
  115 + }
  116 + return Float.parseFloat(String.valueOf(Arith.div(Arith.div(t, 1000), 60)));
  117 + }
  118 +
  119 + public void saveAll(){
  120 + if(pstBuff.size()==0)
  121 + return;
  122 + Set<StationToPark> pstBuffCopy = pstBuff;
  123 + pstBuff = new HashSet<>();
  124 + //持久化到数据库
  125 + stationToParkRepository.save(pstBuffCopy);
  126 + }
  127 +
  128 + public Map<String, Object> delete(String lineCode, Integer id) {
  129 + Map<String, Object> rs = new HashMap<>();
  130 + try {
  131 + List<StationToPark> list = listMultimap.get(lineCode);
  132 +
  133 + StationToPark stp = null;
  134 + for(StationToPark temp : list){
  135 + if(temp.getId().equals(id)){
  136 + stp=temp;
  137 + break;
  138 + }
  139 + }
  140 +
  141 + if(stp != null){
  142 + listMultimap.remove(lineCode, stp);
  143 + stationToParkRepository.delete(id);
  144 + rs.put("status", ResponseCode.SUCCESS);
  145 + }
  146 + else{
  147 + rs.put("status", ResponseCode.SUCCESS);
  148 + rs.put("msg", "操作失败,可能数据已经被删除!");
  149 + }
  150 +
  151 + }catch (Exception e){
  152 + rs.put("status", ResponseCode.ERROR);
  153 + rs.put("msg", e.getMessage());
  154 + log.error("", e);
  155 + }
  156 + return rs;
  157 + }
  158 +}
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
@@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware {
84 Calendar calendar = Calendar.getInstance(); 84 Calendar calendar = Calendar.getInstance();
85 int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); 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=173";// + dayOfYear; 87 + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=" + dayOfYear;
88 JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); 88 JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource());
89 89
90 List<GpsEntity> list = 90 List<GpsEntity> list =
src/main/java/com/bsth/data/pilot80/PilotReport.java
@@ -2,7 +2,6 @@ package com.bsth.data.pilot80; @@ -2,7 +2,6 @@ package com.bsth.data.pilot80;
2 2
3 import com.bsth.data.BasicData; 3 import com.bsth.data.BasicData;
4 import com.bsth.data.LineConfigData; 4 import com.bsth.data.LineConfigData;
5 -import com.bsth.data.gpsdata.GpsEntity;  
6 import com.bsth.data.gpsdata.GpsRealData; 5 import com.bsth.data.gpsdata.GpsRealData;
7 import com.bsth.data.msg_queue.DirectivePushQueue; 6 import com.bsth.data.msg_queue.DirectivePushQueue;
8 import com.bsth.data.schedule.DayOfSchedule; 7 import com.bsth.data.schedule.DayOfSchedule;
@@ -16,7 +15,6 @@ import com.bsth.repository.directive.D80Repository; @@ -16,7 +15,6 @@ import com.bsth.repository.directive.D80Repository;
16 import com.bsth.repository.directive.DC0A4Repository; 15 import com.bsth.repository.directive.DC0A4Repository;
17 import com.bsth.service.directive.DirectiveService; 16 import com.bsth.service.directive.DirectiveService;
18 import com.bsth.websocket.handler.SendUtils; 17 import com.bsth.websocket.handler.SendUtils;
19 -import com.google.common.collect.ArrayListMultimap;  
20 import org.apache.commons.lang3.StringUtils; 18 import org.apache.commons.lang3.StringUtils;
21 import org.slf4j.Logger; 19 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory; 20 import org.slf4j.LoggerFactory;
@@ -26,289 +24,278 @@ import org.springframework.stereotype.Component; @@ -26,289 +24,278 @@ import org.springframework.stereotype.Component;
26 import java.util.ArrayList; 24 import java.util.ArrayList;
27 import java.util.Collection; 25 import java.util.Collection;
28 import java.util.List; 26 import java.util.List;
  27 +import java.util.concurrent.ConcurrentHashMap;
29 28
30 /** 29 /**
31 - *  
32 - * @ClassName: PilotReport  
33 - * @Description: TODO(设备80协议上报处理)  
34 * @author PanZhao 30 * @author PanZhao
35 - * @date 2016年8月14日 下午11:37:51  
36 - * 31 + * @ClassName: PilotReport
  32 + * @Description: TODO(设备80协议上报处理)
  33 + * @date 2016年8月14日 下午11:37:51
37 */ 34 */
38 @Component 35 @Component
39 public class PilotReport { 36 public class PilotReport {
40 -  
41 - @Autowired  
42 - D80Repository d80Repository;  
43 - @Autowired  
44 - DayOfSchedule dayOfSchedule;  
45 - @Autowired  
46 - LineConfigData lineConfigData;  
47 - @Autowired  
48 - DirectiveService directiveService;  
49 - @Autowired  
50 - GpsRealData gpsRealData;  
51 - @Autowired  
52 - SendUtils sendUtils;  
53 -  
54 - @Autowired  
55 - DC0A4Repository dc0A4Repository;  
56 -  
57 - private static ArrayListMultimap<String, D80> d80MultiMap;  
58 -  
59 - Logger logger = LoggerFactory.getLogger(PilotReport.class);  
60 -  
61 - static{  
62 - d80MultiMap = ArrayListMultimap.create();  
63 - }  
64 -  
65 - public void report(D80 d80){  
66 - //入库  
67 - d80Repository.save(d80);  
68 - //入缓存  
69 - d80MultiMap.put(d80.getData().getLineId().toString(), d80);  
70 -  
71 - String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());  
72 - //处理  
73 - switch (d80.getData().getRequestCode()) {  
74 - case 0xA3:  
75 - //出场请求  
76 - ScheduleRealInfo outSch = dayOfSchedule.searchNearByBcType(nbbm, "out");  
77 - //如果有对应出场班次  
78 - if(outSch != null){  
79 - //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令  
80 - if(outSch.getJhlc() == null)  
81 - outSch = dayOfSchedule.next(outSch);  
82 -  
83 - //下发调度指令  
84 - DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统");  
85 - //directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统");  
86 - //下发线路切换指令  
87 - DirectivePushQueue.put64(outSch.getClZbh(), outSch.getXlBm(), "请出@系统");  
88 - //directiveService.lineChange(outSch.getClZbh(), outSch.getXlBm(), "请出@系统");  
89 - }else  
90 - d80.setRemarks("没有出场计划");  
91 -  
92 - break;  
93 -  
94 - case 0xA5:  
95 - //进场请求  
96 - //ScheduleRealInfo inSch = dayOfSchedule.nextByBcType(nbbm, "in");  
97 - //如果有对应出场班次  
98 - //if(inSch != null){  
99 - /*d80.setRemarks("计划进场时间:" + inSch.getDfsj());  
100 - //当前GPS位置  
101 - GpsEntity gps = gpsRealData.get(d80.getDeviceId());  
102 - if(null != gps)  
103 - d80.addRemarks("<br> 位置:" + coordHtmlStr(gps));*/  
104 - //}/*else  
105 - // d80.setRemarks("没有进场计划");*/  
106 - break;  
107 - }  
108 -  
109 - //推送到页面  
110 - sendUtils.send80ToPage(d80);  
111 - }  
112 -  
113 - public void report(DC0_A4 c0a4){  
114 - String deviceId = c0a4.getData().getDeviceId();  
115 - if(StringUtils.isNotEmpty(deviceId))  
116 - c0a4.setId(deviceId);  
117 -  
118 - //入库  
119 - dc0A4Repository.save(c0a4);  
120 - }  
121 -  
122 - /**  
123 - *  
124 - * @Title: reply  
125 - * @Description: TODO(调度员回复)  
126 - */  
127 - public void reply(D80 d80){  
128 - String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());  
129 - Short reqCode = d80.getData().getRequestCode();  
130 - //默认短语回复  
131 - //defaultReply(nbbm, reqCode, d80.getConfirmRs() == 0?true:false);  
132 -  
133 - switch (reqCode) {  
134 - case 0xA3:  
135 - //出场请求回复  
136 - applyOutReply(d80);  
137 - break;  
138 - case 0xA5:  
139 - //进场请求回复  
140 - applyInReply(d80);  
141 - break;  
142 - }  
143 - }  
144 -  
145 - /**  
146 - *  
147 - * @Title: applyOutReply  
148 - * @Description: TODO(出场请求回复)  
149 - */  
150 - public void applyOutReply(D80 d80){  
151 - //同意  
152 - if(d80.getConfirmRs() == 0){  
153 - String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());  
154 -  
155 - ScheduleRealInfo sch = dayOfSchedule.nextByBcType(nbbm, "out");  
156 - if(null == sch)  
157 - return;  
158 -  
159 - LineConfig conf = lineConfigData.get(sch.getXlBm());  
160 - if(conf.getOutConfig() == 1){  
161 - //为相关班次写入请求出场时间  
162 - sch.setFcsjActualAll(d80.getTimestamp());  
163 -  
164 - dayOfSchedule.save(sch);  
165 - //通知页面  
166 - sendUtils.refreshSch(sch);  
167 - }  
168 - }  
169 - }  
170 -  
171 - /**  
172 - *  
173 - * @Title: applyInReply  
174 - * @Description: TODO(进场请求回复)  
175 - */  
176 - public void applyInReply(D80 d80){  
177 - //同意  
178 - if(d80.getConfirmRs() == 0){  
179 - String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());  
180 -  
181 - ScheduleRealInfo sch = dayOfSchedule.nextByBcType(nbbm, "in");  
182 - if(null == sch)  
183 - return;  
184 -  
185 - LineConfig conf = lineConfigData.get(sch.getXlBm());  
186 - if(conf.getOutConfig() == 1){  
187 - //为相关班次写入进场时间  
188 - sch.setZdsjActualAll(d80.getTimestamp());  
189 -  
190 - //没有里程的进场班次  
191 - if(isEmpty(sch.getBcsj()) && isEmpty(sch.getJhlc()))  
192 - sch.setFcsjActualAll(d80.getTimestamp());  
193 -  
194 - dayOfSchedule.save(sch);  
195 - //通知页面  
196 - sendUtils.refreshSch(sch);  
197 - }  
198 - }  
199 - }  
200 -  
201 - public boolean isEmpty(Integer v){  
202 - return v == null || v.equals(0);  
203 - }  
204 -  
205 - public boolean isEmpty(Double v){  
206 - return v == null || v.equals(0);  
207 - }  
208 -  
209 - public void defaultReply(String nbbm, short requestCode, boolean agree){  
210 - Line line = BasicData.nbbm2LineMap.get(nbbm);  
211 - String lineCode = null;  
212 -  
213 - if(line != null)  
214 - lineCode = line.getLineCode();  
215 - else{  
216 - try{  
217 - lineCode = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm)).getLineId().toString();  
218 - }catch(Exception e){  
219 - logger.error("", e);  
220 - }  
221 - }  
222 -  
223 - if(null == lineCode)  
224 - return;  
225 -  
226 - LineConfig conf = lineConfigData.get(lineCode);  
227 - D80ReplyTemp temp = conf.findByCode(requestCode);  
228 -  
229 - if(null == temp)  
230 - return;  
231 -  
232 - String text;  
233 - if(agree)  
234 - text = temp.getAgreeText();  
235 - else  
236 - text = temp.getRejectText();  
237 -  
238 - directiveService.send60Phrase(nbbm, text, "系统");  
239 - }  
240 -  
241 - /**  
242 - *  
243 - * @Title: resumeOperation  
244 - * @Description: TODO(恢复营运)  
245 - */  
246 - public void resumeOperation(D80 d80){  
247 -  
248 - }  
249 -  
250 - /**  
251 - *  
252 - * @Title: applyTiaodang  
253 - * @Description: TODO(申请调档)  
254 - */  
255 - public void applyTiaodang(D80 d80){  
256 -  
257 - }  
258 -  
259 - /**  
260 - *  
261 - * @Title: unconfirmed80  
262 - * @Description: TODO(根据lineCode 获取未处理的80数据)  
263 - */  
264 - public List<D80> unconfirmed80(Integer lineCode){  
265 - List<D80> lineAll = d80MultiMap.get(lineCode.toString())  
266 - ,rs = new ArrayList<>();  
267 -  
268 - for(D80 d80 : lineAll)  
269 - if(!d80.isConfirm())  
270 - rs.add(d80);  
271 -  
272 - return rs;  
273 - }  
274 -  
275 - public D80 findById(int id){  
276 - Collection<D80> all = d80MultiMap.values();  
277 -  
278 - for(D80 d80 : all){  
279 - if(d80.getId() == id)  
280 - return d80;  
281 - }  
282 -  
283 - return null;  
284 - }  
285 -  
286 - public String coordHtmlStr(GpsEntity gps){  
287 -  
288 - return "<span class=\"nt-coord\" data-lon=\""+gps.getLon()+"\" data-lat=\""+gps.getLat()+"\"></span>";  
289 - }  
290 -  
291 - public Collection<D80> findAll(){  
292 - return d80MultiMap.values();  
293 - }  
294 -  
295 - public void clear(String lineCode){  
296 - logger.info("清除 80数据 before: " + d80MultiMap.size());  
297 - d80MultiMap.removeAll(lineCode);  
298 - logger.info("清除 80数据 after: " + d80MultiMap.size());  
299 - }  
300 -  
301 - public Collection<? extends D80> findByCar(String nbbm) {  
302 - List<D80> rs = new ArrayList<>();  
303 - String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm);  
304 - if(null == deviceId)  
305 - return rs;  
306 -  
307 - Collection<D80> all = findAll();  
308 - for(D80 d80 : all){  
309 - if(d80.getDeviceId().equals(deviceId))  
310 - rs.add(d80);  
311 - }  
312 - return rs;  
313 - } 37 +
  38 + @Autowired
  39 + D80Repository d80Repository;
  40 + @Autowired
  41 + DayOfSchedule dayOfSchedule;
  42 + @Autowired
  43 + LineConfigData lineConfigData;
  44 + @Autowired
  45 + DirectiveService directiveService;
  46 + @Autowired
  47 + GpsRealData gpsRealData;
  48 + @Autowired
  49 + SendUtils sendUtils;
  50 +
  51 + @Autowired
  52 + DC0A4Repository dc0A4Repository;
  53 +
  54 + //private static ArrayListMultimap<String, D80> d80MultiMap;
  55 +
  56 + private static ConcurrentHashMap<Integer, D80> d80Maps;
  57 +
  58 + Logger logger = LoggerFactory.getLogger(PilotReport.class);
  59 +
  60 + static {
  61 + //d80MultiMap = ArrayListMultimap.create();
  62 + d80Maps = new ConcurrentHashMap<>();
  63 + }
  64 +
  65 + public void report(D80 d80) {
  66 + if (d80 == null)
  67 + return;
  68 + try {
  69 + //入库
  70 + d80Repository.save(d80);
  71 + //入缓存
  72 + d80Maps.put(d80.getId(), d80);
  73 + //d80MultiMap.put(d80.getData().getLineId().toString(), d80);
  74 +
  75 + String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());
  76 + //处理
  77 + switch (d80.getData().getRequestCode()) {
  78 + //出场请求
  79 + case 0xA3:
  80 + ScheduleRealInfo outSch = dayOfSchedule.searchNearByBcType(nbbm, "out");
  81 + //如果有对应出场班次
  82 + if (outSch != null) {
  83 + //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令
  84 + if (outSch.getJhlc() == null)
  85 + outSch = dayOfSchedule.next(outSch);
  86 +
  87 + //下发调度指令
  88 + DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统");
  89 + //下发线路切换指令
  90 + DirectivePushQueue.put64(outSch.getClZbh(), outSch.getXlBm(), "请出@系统");
  91 + }
  92 + break;
  93 + }
  94 +
  95 + //推送到页面
  96 + sendUtils.send80ToPage(d80);
  97 + } catch (Exception e) {
  98 + logger.error("", e);
  99 + }
  100 + }
  101 +
  102 + public void report(DC0_A4 c0a4) {
  103 + String deviceId = c0a4.getData().getDeviceId();
  104 + if (StringUtils.isNotEmpty(deviceId))
  105 + c0a4.setId(deviceId);
  106 +
  107 + //入库
  108 + dc0A4Repository.save(c0a4);
  109 + }
  110 +
  111 + /**
  112 + * @Title: reply
  113 + * @Description: TODO(调度员回复)
  114 + */
  115 + public void reply(D80 d80) {
  116 + String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());
  117 + Short reqCode = d80.getData().getRequestCode();
  118 + //默认短语回复
  119 + //defaultReply(nbbm, reqCode, d80.getConfirmRs() == 0?true:false);
  120 +
  121 + switch (reqCode) {
  122 + case 0xA3:
  123 + //出场请求回复
  124 + applyOutReply(d80);
  125 + break;
  126 + case 0xA5:
  127 + //进场请求回复
  128 + applyInReply(d80);
  129 + break;
  130 + }
  131 + }
  132 +
  133 + /**
  134 + * @Title: applyOutReply
  135 + * @Description: TODO(出场请求回复)
  136 + */
  137 + public void applyOutReply(D80 d80) {
  138 + //同意
  139 + if (d80.getConfirmRs() == 0) {
  140 + String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());
  141 +
  142 + ScheduleRealInfo sch = dayOfSchedule.nextByBcType(nbbm, "out");
  143 + if (null == sch)
  144 + return;
  145 +
  146 + LineConfig conf = lineConfigData.get(sch.getXlBm());
  147 + if (conf.getOutConfig() == 1) {
  148 + //为相关班次写入请求出场时间
  149 + sch.setFcsjActualAll(d80.getTimestamp());
  150 +
  151 + dayOfSchedule.save(sch);
  152 + //通知页面
  153 + sendUtils.refreshSch(sch);
  154 + }
  155 + }
  156 + }
  157 +
  158 + /**
  159 + * @Title: applyInReply
  160 + * @Description: TODO(进场请求回复)
  161 + */
  162 + public void applyInReply(D80 d80) {
  163 + //同意
  164 + if (d80.getConfirmRs() == 0) {
  165 + String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());
  166 +
  167 + ScheduleRealInfo sch = dayOfSchedule.nextByBcType(nbbm, "in");
  168 + if (null == sch)
  169 + return;
  170 +
  171 + LineConfig conf = lineConfigData.get(sch.getXlBm());
  172 + if (conf.getOutConfig() == 1) {
  173 + //为相关班次写入进场时间
  174 + sch.setZdsjActualAll(d80.getTimestamp());
  175 +
  176 + //没有里程的进场班次
  177 + if (isEmpty(sch.getBcsj()) && isEmpty(sch.getJhlc()))
  178 + sch.setFcsjActualAll(d80.getTimestamp());
  179 +
  180 + dayOfSchedule.save(sch);
  181 + //通知页面
  182 + sendUtils.refreshSch(sch);
  183 + }
  184 + }
  185 + }
  186 +
  187 + public boolean isEmpty(Integer v) {
  188 + return v == null || v.equals(0);
  189 + }
  190 +
  191 + public boolean isEmpty(Double v) {
  192 + return v == null || v.equals(0);
  193 + }
  194 +
  195 + public void defaultReply(String nbbm, short requestCode, boolean agree) {
  196 + Line line = BasicData.nbbm2LineMap.get(nbbm);
  197 + String lineCode = null;
  198 +
  199 + if (line != null)
  200 + lineCode = line.getLineCode();
  201 + else {
  202 + try {
  203 + lineCode = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm)).getLineId().toString();
  204 + } catch (Exception e) {
  205 + logger.error("", e);
  206 + }
  207 + }
  208 +
  209 + if (null == lineCode)
  210 + return;
  211 +
  212 + LineConfig conf = lineConfigData.get(lineCode);
  213 + D80ReplyTemp temp = conf.findByCode(requestCode);
  214 +
  215 + if (null == temp)
  216 + return;
  217 +
  218 + String text;
  219 + if (agree)
  220 + text = temp.getAgreeText();
  221 + else
  222 + text = temp.getRejectText();
  223 +
  224 + directiveService.send60Phrase(nbbm, text, "系统");
  225 + }
  226 +
  227 + /**
  228 + * @Title: resumeOperation
  229 + * @Description: TODO(恢复营运)
  230 + */
  231 + public void resumeOperation(D80 d80) {
  232 +
  233 + }
  234 +
  235 + /**
  236 + * @Title: applyTiaodang
  237 + * @Description: TODO(申请调档)
  238 + */
  239 + public void applyTiaodang(D80 d80) {
  240 +
  241 + }
  242 +
  243 + /**
  244 + * @Title: unconfirmed80
  245 + * @Description: TODO(根据lineCode 获取未处理的80数据)
  246 + */
  247 + public List<D80> unconfirmed80(String lineCode) {
  248 + List<D80> lineAll = findByLine(lineCode), rs = new ArrayList<>();
  249 +
  250 + for (D80 d80 : lineAll)
  251 + if (!d80.isConfirm())
  252 + rs.add(d80);
  253 +
  254 + return rs;
  255 + }
  256 +
  257 + public List<D80> findByLine(String lineCode) {
  258 + List<D80> rs = new ArrayList<>();
  259 + for (D80 d80 : d80Maps.values()) {
  260 + if (d80 != null && d80.getData().getLineId().equals(lineCode))
  261 + rs.add(d80);
  262 + }
  263 + return rs;
  264 + }
  265 +
  266 + public D80 findById(int id) {
  267 + return d80Maps.get(id);
  268 + }
  269 +
  270 +/* public String coordHtmlStr(GpsEntity gps) {
  271 +
  272 + return "<span class=\"nt-coord\" data-lon=\"" + gps.getLon() + "\" data-lat=\"" + gps.getLat() + "\"></span>";
  273 + }*/
  274 +
  275 + public Collection<D80> findAll() {
  276 + return d80Maps.values();
  277 + }
  278 +
  279 + public void clear(String lineCode) {
  280 + logger.info("清除 80数据 before: " + d80Maps.size());
  281 + List<D80> rems = findByLine(lineCode);
  282 + for (D80 d80 : rems) {
  283 + d80Maps.remove(d80.getId());
  284 + }
  285 + logger.info("清除 80数据 after: " + d80Maps.size());
  286 + }
  287 +
  288 + public Collection<? extends D80> findByCar(String nbbm) {
  289 + List<D80> rs = new ArrayList<>();
  290 + String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  291 + if (null == deviceId)
  292 + return rs;
  293 +
  294 + Collection<D80> all = findAll();
  295 + for (D80 d80 : all) {
  296 + if (d80.getDeviceId().equals(deviceId))
  297 + rs.add(d80);
  298 + }
  299 + return rs;
  300 + }
314 } 301 }
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -944,6 +944,8 @@ public class DayOfSchedule { @@ -944,6 +944,8 @@ public class DayOfSchedule {
944 ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list); 944 ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list);
945 carExecutePlanMap.put(nbbm, sch); 945 carExecutePlanMap.put(nbbm, sch);
946 946
  947 + if(sch==null)
  948 + return;
947 try { 949 try {
948 GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); 950 GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm));
949 if(gps != null && gps.isOnline()){ 951 if(gps != null && gps.isOnline()){
src/main/java/com/bsth/data/schedule/edit_logs/ScheduleModifyLogger.java
@@ -231,4 +231,20 @@ public class ScheduleModifyLogger { @@ -231,4 +231,20 @@ public class ScheduleModifyLogger {
231 public static void put(SchEditInfo sei) { 231 public static void put(SchEditInfo sei) {
232 list.add(sei); 232 list.add(sei);
233 } 233 }
  234 +
  235 + public static void afterEdit(ScheduleRealInfo sch, String remarks, JSONArray jsonArray) {
  236 + try {
  237 + if (jsonArray == null || jsonArray.size() == 0)
  238 + return;
  239 +
  240 + SchEditInfo sei = SchEditInfo.getInstance(sch);
  241 + sei.setRemarks(remarks);
  242 + sei.setJsonArray(jsonArray.toJSONString());
  243 + sei.setType(EditType.LSBCTZ);
  244 +
  245 + put(sei);
  246 + } catch (Exception e) {
  247 + log.error("", e);
  248 + }
  249 + }
234 } 250 }
src/main/java/com/bsth/data/schedule/edit_logs/entity/EditType.java
@@ -5,5 +5,5 @@ package com.bsth.data.schedule.edit_logs.entity; @@ -5,5 +5,5 @@ package com.bsth.data.schedule.edit_logs.entity;
5 */ 5 */
6 public enum EditType { 6 public enum EditType {
7 7
8 - DFTZ,SFTZ,FCXXWT,TZRC,LPDD,ZRW,JHLB,CXLB, CXSF, CXZX 8 + DFTZ,SFTZ,FCXXWT,TZRC,LPDD,ZRW,JHLB,CXLB, CXSF, LSBCTZ, CXZX
9 } 9 }
10 \ No newline at end of file 10 \ No newline at end of file
src/main/java/com/bsth/data/schedule/edit_logs/loggers/AfterwardsLogger.java 0 → 100644
  1 +package com.bsth.data.schedule.edit_logs.loggers;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger;
  6 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +
  10 +/**
  11 + * 事后历史班次编辑
  12 + * Created by panzhao on 2017/5/19.
  13 + */
  14 +public class AfterwardsLogger {
  15 +
  16 + static Logger log = LoggerFactory.getLogger(AfterwardsLogger.class);
  17 +
  18 + private JSONArray jsonArray = new JSONArray();
  19 + private String remarks;
  20 + private ScheduleRealInfo sch;
  21 +
  22 + public void log(String title, Object old, Object now){
  23 + try {
  24 +
  25 + JSONObject jsonObject = new JSONObject();
  26 + jsonObject.put("title", title);
  27 + jsonObject.put("old", old);
  28 + jsonObject.put("now", now);
  29 +
  30 + jsonArray.add(jsonObject);
  31 + }catch (Exception e){
  32 + log.error("", e);
  33 + }
  34 + }
  35 +
  36 + public void log(String text){
  37 + try {
  38 + JSONObject jsonObject = new JSONObject();
  39 + jsonObject.put("title", text);
  40 +
  41 + jsonArray.add(jsonObject);
  42 + }catch (Exception e){
  43 + log.error("", e);
  44 + }
  45 + }
  46 +
  47 + public static AfterwardsLogger start(ScheduleRealInfo sch, String remarks){
  48 + AfterwardsLogger fLog = new AfterwardsLogger();
  49 + fLog.setSch(sch);
  50 + fLog.setRemarks(remarks);
  51 + return fLog;
  52 + }
  53 +
  54 + public void end(){
  55 + ScheduleModifyLogger.afterEdit(sch, this.remarks, jsonArray);
  56 + }
  57 +
  58 + public String getRemarks() {
  59 + return remarks;
  60 + }
  61 +
  62 + public void setRemarks(String remarks) {
  63 + this.remarks = remarks;
  64 + }
  65 +
  66 + public ScheduleRealInfo getSch() {
  67 + return sch;
  68 + }
  69 +
  70 + public void setSch(ScheduleRealInfo sch) {
  71 + this.sch = sch;
  72 + }
  73 +}
src/main/java/com/bsth/data/schedule/edit_logs/service/SchEditInfoServiceImpl.java
@@ -41,7 +41,7 @@ public class SchEditInfoServiceImpl extends BaseServiceImpl&lt;SchEditInfo, Long&gt; i @@ -41,7 +41,7 @@ public class SchEditInfoServiceImpl extends BaseServiceImpl&lt;SchEditInfo, Long&gt; i
41 for(String k : ks){ 41 for(String k : ks){
42 v =map.get(k); 42 v =map.get(k);
43 if(StringUtils.isNotEmpty(v)) 43 if(StringUtils.isNotEmpty(v))
44 - cont += " and t2." + BatchSaveUtils.propertyToField(k) + "='" + v + "'"; 44 + cont += " and " + BatchSaveUtils.propertyToField(k) + "='" + v + "'";
45 } 45 }
46 String sql = "select t1.*, t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name,t2.xl_dir,t2.real_exec_date from (select * from logger_sch_modify where rq=? and line_code=? ) t1 INNER JOIN bsth_c_s_sp_info_real t2 on t1.sch_id=t2.id where 1=1 " + cont; 46 String sql = "select t1.*, t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name,t2.xl_dir,t2.real_exec_date from (select * from logger_sch_modify where rq=? and line_code=? ) t1 INNER JOIN bsth_c_s_sp_info_real t2 on t1.sch_id=t2.id where 1=1 " + cont;
47 47
src/main/java/com/bsth/data/utils/CustomStringUtils.java 0 → 100644
  1 +package com.bsth.data.utils;
  2 +
  3 +import org.apache.commons.lang3.StringUtils;
  4 +
  5 +/**
  6 + * Created by panzhao on 2017/7/10.
  7 + */
  8 +public class CustomStringUtils {
  9 +
  10 + public static boolean equals(String s1, String s2){
  11 + if(s1 == null){
  12 + if(StringUtils.isNotEmpty(s2))
  13 + return false;
  14 + else
  15 + return true;
  16 + }
  17 + return s1.equals(s2);
  18 + }
  19 +}
src/main/java/com/bsth/entity/directive/D80.java
1 package com.bsth.entity.directive; 1 package com.bsth.entity.directive;
2 2
3 -import java.util.Date;  
4 -  
5 -import javax.persistence.CascadeType;  
6 -import javax.persistence.Embeddable;  
7 -import javax.persistence.Entity;  
8 -import javax.persistence.FetchType;  
9 -import javax.persistence.GeneratedValue;  
10 -import javax.persistence.Id;  
11 -import javax.persistence.NamedAttributeNode;  
12 -import javax.persistence.NamedEntityGraph;  
13 -import javax.persistence.NamedEntityGraphs;  
14 -import javax.persistence.OneToOne;  
15 -import javax.persistence.Table;  
16 -import javax.persistence.Transient;  
17 -  
18 import com.bsth.entity.directive.DC0.DC0Data; 3 import com.bsth.entity.directive.DC0.DC0Data;
19 4
  5 +import javax.persistence.*;
  6 +import java.util.Date;
  7 +
20 /** 8 /**
21 * 9 *
22 * @ClassName: D80 10 * @ClassName: D80
@@ -92,7 +80,7 @@ public class D80 { @@ -92,7 +80,7 @@ public class D80 {
92 /** 80 /**
93 * 线路编码 81 * 线路编码
94 */ 82 */
95 - private Integer lineId; 83 + private String lineId;
96 84
97 /** 85 /**
98 * 车辆内部编码 86 * 车辆内部编码
@@ -116,13 +104,6 @@ public class D80 { @@ -116,13 +104,6 @@ public class D80 {
116 this.requestCode = requestCode; 104 this.requestCode = requestCode;
117 } 105 }
118 106
119 - public Integer getLineId() {  
120 - return lineId;  
121 - }  
122 -  
123 - public void setLineId(Integer lineId) {  
124 - this.lineId = lineId;  
125 - }  
126 107
127 public String getNbbm() { 108 public String getNbbm() {
128 return nbbm; 109 return nbbm;
@@ -131,6 +112,14 @@ public class D80 { @@ -131,6 +112,14 @@ public class D80 {
131 public void setNbbm(String nbbm) { 112 public void setNbbm(String nbbm) {
132 this.nbbm = nbbm; 113 this.nbbm = nbbm;
133 } 114 }
  115 +
  116 + public String getLineId() {
  117 + return lineId;
  118 + }
  119 +
  120 + public void setLineId(String lineId) {
  121 + this.lineId = lineId;
  122 + }
134 } 123 }
135 124
136 @Transient 125 @Transient
src/main/java/com/bsth/entity/realcontrol/ChildTaskPlan.java
@@ -84,10 +84,25 @@ public class ChildTaskPlan { @@ -84,10 +84,25 @@ public class ChildTaskPlan {
84 private boolean destroy; 84 private boolean destroy;
85 85
86 /** 86 /**
87 - * 烂班原因 87 + * 烂班原因 -烂班时,该字段仍有值并 =reason
88 */ 88 */
89 private String destroyReason; 89 private String destroyReason;
90 90
  91 + /**
  92 + * 包括 烂班原因、进出场原因、换车原因 等
  93 + */
  94 + private String reason;
  95 +
  96 + /**
  97 + * 车辆 如果为空,继承主任务
  98 + */
  99 + private String nbbm;
  100 +
  101 + /**
  102 + * 为true 则无售票员, 否则继承主任务
  103 + */
  104 + private boolean noClerk;
  105 +
91 /** 创建日期 */ 106 /** 创建日期 */
92 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") 107 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
93 private Date createDate; 108 private Date createDate;
@@ -238,4 +253,28 @@ public class ChildTaskPlan { @@ -238,4 +253,28 @@ public class ChildTaskPlan {
238 public void setCreateDate(Date createDate) { 253 public void setCreateDate(Date createDate) {
239 this.createDate = createDate; 254 this.createDate = createDate;
240 } 255 }
  256 +
  257 + public String getReason() {
  258 + return reason;
  259 + }
  260 +
  261 + public void setReason(String reason) {
  262 + this.reason = reason;
  263 + }
  264 +
  265 + public String getNbbm() {
  266 + return nbbm;
  267 + }
  268 +
  269 + public void setNbbm(String nbbm) {
  270 + this.nbbm = nbbm;
  271 + }
  272 +
  273 + public boolean isNoClerk() {
  274 + return noClerk;
  275 + }
  276 +
  277 + public void setNoClerk(boolean noClerk) {
  278 + this.noClerk = noClerk;
  279 + }
241 } 280 }
src/main/java/com/bsth/entity/realcontrol/StationToPark.java 0 → 100644
  1 +package com.bsth.entity.realcontrol;
  2 +
  3 +import javax.persistence.Entity;
  4 +import javax.persistence.GeneratedValue;
  5 +import javax.persistence.Id;
  6 +import javax.persistence.Table;
  7 +
  8 +/**
  9 + * 站 到 场
  10 + * Created by panzhao on 2017/7/10.
  11 + */
  12 +@Entity
  13 +@Table(name = "bsth_c_station_to_park")
  14 +public class StationToPark {
  15 +
  16 + @Id
  17 + @GeneratedValue
  18 + private Integer id;
  19 +
  20 + /** 线路编码 */
  21 + private String lineCode;
  22 +
  23 + /** 站点名称 */
  24 + private String stationName;
  25 +
  26 + /** 停车场编码 */
  27 + private String parkName;
  28 +
  29 + /** 站到场时间(分钟) */
  30 + private Float time1;
  31 +
  32 + /** 站到场公里 */
  33 + private Float mileage1;
  34 +
  35 + /** 场到站时间(分钟) */
  36 + private Float time2;
  37 +
  38 + /** 场到站公里 */
  39 + private Float mileage2;
  40 +
  41 + /** 排序字段 */
  42 + private int orderNo;
  43 +
  44 + public String getLineCode() {
  45 + return lineCode;
  46 + }
  47 +
  48 + public void setLineCode(String lineCode) {
  49 + this.lineCode = lineCode;
  50 + }
  51 +
  52 + public String getStationName() {
  53 + return stationName;
  54 + }
  55 +
  56 + public void setStationName(String stationName) {
  57 + this.stationName = stationName;
  58 + }
  59 +
  60 +
  61 + public Float getTime1() {
  62 + return time1;
  63 + }
  64 +
  65 + public void setTime1(Float time1) {
  66 + this.time1 = time1;
  67 + }
  68 +
  69 + public Float getMileage1() {
  70 + return mileage1;
  71 + }
  72 +
  73 + public void setMileage1(Float mileage1) {
  74 + this.mileage1 = mileage1;
  75 + }
  76 +
  77 + public Float getTime2() {
  78 + return time2;
  79 + }
  80 +
  81 + public void setTime2(Float time2) {
  82 + this.time2 = time2;
  83 + }
  84 +
  85 + public Float getMileage2() {
  86 + return mileage2;
  87 + }
  88 +
  89 + public void setMileage2(Float mileage2) {
  90 + this.mileage2 = mileage2;
  91 + }
  92 +
  93 + public Integer getId() {
  94 + return id;
  95 + }
  96 +
  97 + public void setId(Integer id) {
  98 + this.id = id;
  99 + }
  100 +
  101 + public int getOrderNo() {
  102 + return orderNo;
  103 + }
  104 +
  105 + public void setOrderNo(int orderNo) {
  106 + this.orderNo = orderNo;
  107 + }
  108 +
  109 + public String getParkName() {
  110 + return parkName;
  111 + }
  112 +
  113 + public void setParkName(String parkName) {
  114 + this.parkName = parkName;
  115 + }
  116 +
  117 + @Override
  118 + public int hashCode() {
  119 + return ("stp_" + this.toString()).hashCode();
  120 + }
  121 +
  122 + @Override
  123 + public boolean equals(Object obj) {
  124 + return this.toString().equals(((StationToPark)obj).toString());
  125 + }
  126 +
  127 + @Override
  128 + public String toString() {
  129 + return this.lineCode + "_" + this.getStationName() + "_" + this.getParkName();
  130 + }
  131 +}
src/main/java/com/bsth/repository/LineRepository.java
@@ -39,6 +39,6 @@ public interface LineRepository extends BaseRepository&lt;Line, Integer&gt; { @@ -39,6 +39,6 @@ public interface LineRepository extends BaseRepository&lt;Line, Integer&gt; {
39 39
40 public Line findByLineCode(String string); 40 public Line findByLineCode(String string);
41 41
42 - @Query(value = " SELECT l FROM Line l where l.company like ?1 and l.brancheCompany like ?2 and l.lineCode like ?3") 42 + @Query(value = " SELECT l FROM Line l where l.company like %?1% and l.brancheCompany like %?2% and l.lineCode like ?3")
43 public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); 43 public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line);
44 } 44 }
src/main/java/com/bsth/repository/StationRepository.java
@@ -40,10 +40,17 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; { @@ -40,10 +40,17 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; {
40 /*@Query(value = "SELECT s.b_jwpoints,s.id FROM bsth_c_station s where s.station_name like ?1" 40 /*@Query(value = "SELECT s.b_jwpoints,s.id FROM bsth_c_station s where s.station_name like ?1"
41 , nativeQuery=true) 41 , nativeQuery=true)
42 List<Object[]> findStationName(String stationName);*/ 42 List<Object[]> findStationName(String stationName);*/
43 - @Query(value = " SELECT t.b_jwpoints,t.id FROM (" + 43 + /*@Query(value = " SELECT t.b_jwpoints,t.id FROM (" +
44 " SELECT b.id,b.b_jwpoints,b.station_name,a.directions FROM (" + 44 " SELECT b.id,b.b_jwpoints,b.station_name,a.directions FROM (" +
45 " SELECT s.station,s.station_name,s.directions FROM bsth_c_stationroute s where s.destroy = 0 and s.directions = ?1) a " + 45 " SELECT s.station,s.station_name,s.directions FROM bsth_c_stationroute s where s.destroy = 0 and s.directions = ?1) a " +
46 " LEFT JOIN bsth_c_station b on a.station = b. id) t where t.station_name LIKE ?2" 46 " LEFT JOIN bsth_c_station b on a.station = b. id) t where t.station_name LIKE ?2"
  47 + , nativeQuery=true)*/
  48 + @Query(value = " SELECT t.b_jwpoints,t.id FROM (" +
  49 + " SELECT b.id,b.b_jwpoints,b.station_name,a.directions FROM (" +
  50 + " SELECT s.station,s.station_name,s.directions FROM bsth_c_stationroute s where s.destroy = 0 and s.directions = ?1) a " +
  51 + " LEFT JOIN " +
  52 + " (SELECT r.id,r.b_jwpoints,r.station_name from bsth_c_station r where r.destroy = 0 and r.station_name LIKE ?2 ) " +
  53 + " b on a.station = b. id) t where t.station_name LIKE ?2 "
47 , nativeQuery=true) 54 , nativeQuery=true)
48 List<Object[]> findStationName(Integer dir , String stationName); 55 List<Object[]> findStationName(Integer dir , String stationName);
49 56
@@ -101,18 +108,24 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; { @@ -101,18 +108,24 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; {
101 "y = ?9 , " + 108 "y = ?9 , " +
102 "b_polygon_grid = ST_GeomFromText(?10) , " + 109 "b_polygon_grid = ST_GeomFromText(?10) , " +
103 "g_polygon_grid = ST_GeomFromText(?11) , " + 110 "g_polygon_grid = ST_GeomFromText(?11) , " +
104 - "destroy = ?12 , " +  
105 - "radius = ?13 , " +  
106 - "shapes_type = ?14 , " +  
107 - "versions = ?15 , " +  
108 - "descriptions = ?16 " +  
109 - " WHERE id = ?17 ", nativeQuery=true) 111 + /*"destroy = ?12 , " +*/
  112 + "radius = ?12 , " +
  113 + "shapes_type = ?13 , " +
  114 + "versions = ?14 , " +
  115 + "descriptions = ?15 " +
  116 + " WHERE id = ?16 ", nativeQuery=true)
110 public void stationUpdate(String stationCod,String stationName,String roadCoding,String dbType,String bJwpoints, 117 public void stationUpdate(String stationCod,String stationName,String roadCoding,String dbType,String bJwpoints,
  118 +
  119 + Float gLonx,Float gLaty,Float x,Float y, String bPolygonGrid,String gPolygonGrid,
  120 +
  121 + Integer radius,String shapesType, Integer versions,String descriptions,Integer stationId);
  122 +
  123 + /*public void stationUpdate(String stationCod,String stationName,String roadCoding,String dbType,String bJwpoints,
111 124
112 Float gLonx,Float gLaty,Float x,Float y, String bPolygonGrid,String gPolygonGrid, 125 Float gLonx,Float gLaty,Float x,Float y, String bPolygonGrid,String gPolygonGrid,
113 126
114 Integer destroy, Integer radius,String shapesType, Integer versions,String descriptions,Integer stationId); 127 Integer destroy, Integer radius,String shapesType, Integer versions,String descriptions,Integer stationId);
115 - 128 + */
116 129
117 @Query(value = "select st_astext(g_polygon_grid) as g_polygon_grid, shapes_type,concat(g_lonx, ' ', g_laty) as g_center_point ,radius, station_cod,station_name from bsth_c_station where station_cod=?1", nativeQuery = true) 130 @Query(value = "select st_astext(g_polygon_grid) as g_polygon_grid, shapes_type,concat(g_lonx, ' ', g_laty) as g_center_point ,radius, station_cod,station_name from bsth_c_station where station_cod=?1", nativeQuery = true)
118 public Object[][] bufferAera(String stationCode); 131 public Object[][] bufferAera(String stationCode);
src/main/java/com/bsth/repository/StationRouteRepository.java
@@ -266,7 +266,6 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int @@ -266,7 +266,6 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
266 "StationRoute s " + 266 "StationRoute s " +
267 "WHERE " + 267 "WHERE " +
268 "s.destroy = 0 " + 268 "s.destroy = 0 " +
269 - "and s.lineCode in(select lineCode from Line where inUse = 1) " +  
270 "ORDER BY " + 269 "ORDER BY " +
271 "lineCode,directions,stationRouteCode") 270 "lineCode,directions,stationRouteCode")
272 List<Map<String, String>> findAllLineWithYgc(); 271 List<Map<String, String>> findAllLineWithYgc();
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -81,7 +81,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -81,7 +81,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
81 @Query(value="select count(jName) from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and sflj != 0") 81 @Query(value="select count(jName) from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and sflj != 0")
82 int findLjbc(String jName,String clZbh,String lpName); 82 int findLjbc(String jName,String clZbh,String lpName);
83 83
84 - @Query(value="SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T'),c.inside_code FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c ON c.equipment_code = r.device_id where FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = ?2 and r.line_id = ?1 and c.inside_code like %?3%",nativeQuery=true) 84 + @Query(value="SELECT request_code,FROM_UNIXTIME(TIMESTAMP / 1000,'%Y-%m-%d %T') as TIMESTAMP ,device_id FROM bsth_v_report_80 WHERE FROM_UNIXTIME( TIMESTAMP / 1000,'%Y-%m-%d') = ?2 AND line_id = ?1 and device_id like %?3%",nativeQuery=true)
85 List<Object[]> account(String line,String date,String code); 85 List<Object[]> account(String line,String date,String code);
86 86
87 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDate >= str_to_date(?2,'%Y-%m-%d') " 87 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDate >= str_to_date(?2,'%Y-%m-%d') "
src/main/java/com/bsth/repository/realcontrol/StationToParkRepository.java 0 → 100644
  1 +package com.bsth.repository.realcontrol;
  2 +
  3 +import com.bsth.entity.realcontrol.StationToPark;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +/**
  8 + * Created by panzhao on 2017/7/10.
  9 + */
  10 +@Repository
  11 +public interface StationToParkRepository extends BaseRepository<StationToPark, Integer>{
  12 +}
src/main/java/com/bsth/service/TrafficManageService.java
@@ -24,7 +24,7 @@ public interface TrafficManageService { @@ -24,7 +24,7 @@ public interface TrafficManageService {
24 * 24 *
25 * @return 调用接口返回信息 25 * @return 调用接口返回信息
26 */ 26 */
27 - String setXL(Map<String, Object> param); 27 + String setXL(String ids);
28 28
29 /** 29 /**
30 * 上传车辆信息 30 * 上传车辆信息
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
@@ -114,10 +114,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -114,10 +114,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
114 + sch.getQdzName() + "发往" + sch.getZdzName(); 114 + sch.getQdzName() + "发往" + sch.getZdzName();
115 115
116 //下发0x01指令 调度指令(闹钟有效) 116 //下发0x01指令 调度指令(闹钟有效)
117 - long t = System.currentTimeMillis(), alarmTime;  
118 - alarmTime = sch.getDfsjT();  
119 - if (sch.getDfsjT() < t)  
120 - alarmTime = t + 1000 * 30; 117 + long t = System.currentTimeMillis() + 1000 * 30,
  118 + alarmTime = sch.getDfsjT() < t?t:sch.getDfsjT();
121 119
122 d60 = new DirectiveCreator().createD60_01(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir()) 120 d60 = new DirectiveCreator().createD60_01(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir())
123 , 0, new Date(alarmTime)); 121 , 0, new Date(alarmTime));
@@ -304,7 +302,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -304,7 +302,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
304 302
305 Map<String, List<D80>> rs = new HashMap<>(); 303 Map<String, List<D80>> rs = new HashMap<>();
306 for (String code : lineList) 304 for (String code : lineList)
307 - rs.put(code, pilotReport.unconfirmed80(Integer.parseInt(code))); 305 + rs.put(code, pilotReport.unconfirmed80(code));
308 306
309 return rs; 307 return rs;
310 } 308 }
@@ -333,17 +331,18 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -333,17 +331,18 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
333 rs.put("msg", "发送C0响应指令到车载设备失败,但该操作已经被系统记录!"); 331 rs.put("msg", "发送C0响应指令到车载设备失败,但该操作已经被系统记录!");
334 332
335 pilotReport.reply(d80); 333 pilotReport.reply(d80);
  334 +
  335 + // 通知页面
  336 + Map<String, Object> sockMap = new HashMap<>();
  337 + sockMap.put("fn", "d80Confirm");
  338 + sockMap.put("id", d80.getId());
  339 + sockMap.put("lineId", d80.getData().getLineId());
  340 + socketHandler.sendMessageToLine(d80.getData().getLineId().toString(), JSON.toJSONString(sockMap));
336 } 341 }
337 } catch (Exception e) { 342 } catch (Exception e) {
338 logger.error("80响应出现异常...", e); 343 logger.error("80响应出现异常...", e);
339 rs.put("status", ResponseCode.SUCCESS); 344 rs.put("status", ResponseCode.SUCCESS);
340 } 345 }
341 - // 通知页面  
342 - Map<String, Object> sockMap = new HashMap<>();  
343 - sockMap.put("fn", "d80Confirm");  
344 - sockMap.put("id", d80.getId());  
345 - sockMap.put("lineId", d80.getData().getLineId());  
346 - socketHandler.sendMessageToLine(d80.getData().getLineId().toString(), JSON.toJSONString(sockMap));  
347 346
348 return rs; 347 return rs;
349 } 348 }
src/main/java/com/bsth/service/gps/GpsService.java
@@ -25,7 +25,7 @@ public interface GpsService { @@ -25,7 +25,7 @@ public interface GpsService {
25 25
26 Map<String,Object> findRoadSpeed(String lineCode); 26 Map<String,Object> findRoadSpeed(String lineCode);
27 27
28 - Map<String,Object> gpsCompletion(long schId); 28 + Map<String,Object> gpsCompletion(long schId, int type);
29 29
30 Map<String,Object> history_v2(String nbbm, long st, long et); 30 Map<String,Object> history_v2(String nbbm, long st, long et);
31 31
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
@@ -447,7 +447,7 @@ public class GpsServiceImpl implements GpsService { @@ -447,7 +447,7 @@ public class GpsServiceImpl implements GpsService {
447 * @return 447 * @return
448 */ 448 */
449 @Override 449 @Override
450 - public Map<String, Object> gpsCompletion(long schId) { 450 + public Map<String, Object> gpsCompletion(long schId, int type) {
451 Map<String, Object> rs = new HashMap<>(); 451 Map<String, Object> rs = new HashMap<>();
452 452
453 try { 453 try {
@@ -481,12 +481,18 @@ public class GpsServiceImpl implements GpsService { @@ -481,12 +481,18 @@ public class GpsServiceImpl implements GpsService {
481 }); 481 });
482 Map<String, Object> fs = list.get(0); 482 Map<String, Object> fs = list.get(0);
483 //替换设备号和时间 483 //替换设备号和时间
484 - int diff = (int) (sch.getDfsjT() - Long.parseLong(fs.get("ts").toString()) - 1000 * 70); 484 + long diff = ((sch.getDfsjT() - Long.parseLong(fs.get("ts").toString())) - 1000 * 70);
485 485
486 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); 486 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh());
  487 + int serviceState;
487 for (Map<String, Object> map : list) { 488 for (Map<String, Object> map : list) {
488 map.put("device_id", deviceId); 489 map.put("device_id", deviceId);
489 map.put("ts", Long.parseLong(map.get("ts").toString()) + diff); 490 map.put("ts", Long.parseLong(map.get("ts").toString()) + diff);
  491 + if(type==1){
  492 + //走补传协议
  493 + serviceState = Integer.parseInt(map.get("service_state").toString());
  494 + map.put("service_state", serviceState |= 0x00100000);
  495 + }
490 } 496 }
491 497
492 String sqlBefore = "insert into bsth_c_template(", sqlValues = " values("; 498 String sqlBefore = "insert into bsth_c_template(", sqlValues = " values(";
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
@@ -17,17 +17,24 @@ import java.util.List; @@ -17,17 +17,24 @@ import java.util.List;
17 import java.util.Map; 17 import java.util.Map;
18 import java.util.Set; 18 import java.util.Set;
19 19
  20 +import org.apache.commons.lang3.StringEscapeUtils;
20 import org.springframework.beans.factory.annotation.Autowired; 21 import org.springframework.beans.factory.annotation.Autowired;
  22 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
21 import org.springframework.jdbc.core.JdbcTemplate; 23 import org.springframework.jdbc.core.JdbcTemplate;
22 import org.springframework.jdbc.core.RowMapper; 24 import org.springframework.jdbc.core.RowMapper;
23 import org.springframework.stereotype.Service; 25 import org.springframework.stereotype.Service;
24 26
  27 +import com.alibaba.fastjson.JSONArray;
  28 +import com.alibaba.fastjson.JSONObject;
  29 +import com.bsth.data.BasicData;
  30 +import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
25 import com.bsth.entity.realcontrol.ChildTaskPlan; 31 import com.bsth.entity.realcontrol.ChildTaskPlan;
26 import com.bsth.entity.realcontrol.ScheduleRealInfo; 32 import com.bsth.entity.realcontrol.ScheduleRealInfo;
27 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 33 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
28 import com.bsth.service.BusIntervalService; 34 import com.bsth.service.BusIntervalService;
29 import com.bsth.service.schedule.PeopleCarPlanService; 35 import com.bsth.service.schedule.PeopleCarPlanService;
30 import com.bsth.util.ReportUtils; 36 import com.bsth.util.ReportUtils;
  37 +import com.google.gson.Gson;
31 38
32 39
33 @Service 40 @Service
@@ -1838,7 +1845,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1838,7 +1845,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1838 } 1845 }
1839 try { 1846 try {
1840 1847
1841 - String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"' and fcsj_actual is not null"; 1848 + String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d')"
  1849 + + " >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'";
1842 if(line.length() != 0){ 1850 if(line.length() != 0){
1843 sql += " and xl_bm = '"+line+"'"; 1851 sql += " and xl_bm = '"+line+"'";
1844 } 1852 }
@@ -1865,6 +1873,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1865,6 +1873,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1865 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { 1873 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
1866 ScheduleRealInfo schedule = new ScheduleRealInfo(); 1874 ScheduleRealInfo schedule = new ScheduleRealInfo();
1867 schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); 1875 schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
  1876 + schedule.setXlBm(rs.getString("xl_bm"));
1868 schedule.setXlName(rs.getString("xl_name")); 1877 schedule.setXlName(rs.getString("xl_name"));
1869 schedule.setLpName(rs.getString("lp_name")); 1878 schedule.setLpName(rs.getString("lp_name"));
1870 schedule.setBcType(rs.getString("bc_type")); 1879 schedule.setBcType(rs.getString("bc_type"));
@@ -1918,7 +1927,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1918,7 +1927,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1918 for(ScheduleRealInfo schedule : list){ 1927 for(ScheduleRealInfo schedule : list){
1919 if(schedule.getXlName() == null || schedule.getXlName().trim().length() == 0) 1928 if(schedule.getXlName() == null || schedule.getXlName().trim().length() == 0)
1920 continue; 1929 continue;
1921 - String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlName(); 1930 + String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlBm();
1922 if(!keyMap.containsKey(key)) 1931 if(!keyMap.containsKey(key))
1923 keyMap.put(key, new ArrayList<ScheduleRealInfo>()); 1932 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
1924 keyMap.get(key).add(schedule); 1933 keyMap.get(key).add(schedule);
@@ -1929,8 +1938,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1929,8 +1938,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1929 int sjbc = 0, sddf = 0, zddf = 0, 1938 int sjbc = 0, sddf = 0, zddf = 0,
1930 dxtz = 0, lbtz = 0; 1939 dxtz = 0, lbtz = 0;
1931 for(ScheduleRealInfo schedule : keyMap.get(key)){ 1940 for(ScheduleRealInfo schedule : keyMap.get(key)){
  1941 + boolean flag = false;
1932 if(schedule.getFcsjActual() != null && schedule.getStatus() != -1){ 1942 if(schedule.getFcsjActual() != null && schedule.getStatus() != -1){
1933 - boolean flag = false;  
1934 sjbc++; 1943 sjbc++;
1935 if(schedule.getDfsj() != null && !schedule.getDfsj().equals(schedule.getFcsj())){ 1944 if(schedule.getDfsj() != null && !schedule.getDfsj().equals(schedule.getFcsj())){
1936 flag = true; 1945 flag = true;
@@ -1939,17 +1948,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1939,17 +1948,16 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1939 zddf++; 1948 zddf++;
1940 else 1949 else
1941 sddf++; 1950 sddf++;
1942 - }else if(!schedule.isOnline()){  
1943 - flag = true;  
1944 - schedule.setRemarks("掉线调整");  
1945 - dxtz++;  
1946 - }else if(schedule.getStatus() == 2){  
1947 - flag = true;  
1948 - lbtz++;  
1949 } 1951 }
1950 - if(flag)  
1951 - tempList.add(schedule); 1952 +
  1953 +
  1954 + }
  1955 + if(schedule.getStatus() == -1){
  1956 + flag = true;
  1957 + lbtz++;
1952 } 1958 }
  1959 + if(flag)
  1960 + tempList.add(schedule);
1953 } 1961 }
1954 tempMap.put("date", date); 1962 tempMap.put("date", date);
1955 String[] keys = key.split("/"); 1963 String[] keys = key.split("/");
@@ -1960,22 +1968,23 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1960,22 +1968,23 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1960 tempMap.put("sddf", sddf); 1968 tempMap.put("sddf", sddf);
1961 tempMap.put("zddf", zddf); 1969 tempMap.put("zddf", zddf);
1962 tempMap.put("dfhj", sddf + zddf); 1970 tempMap.put("dfhj", sddf + zddf);
1963 - tempMap.put("dxtz", dxtz); 1971 +// tempMap.put("dxtz", dxtz);
1964 tempMap.put("lbtz", lbtz); 1972 tempMap.put("lbtz", lbtz);
1965 - tempMap.put("correct", sddf + zddf + dxtz + lbtz); 1973 + tempMap.put("correct", sddf + zddf + lbtz);
1966 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); 1974 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
1967 - tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); 1975 +// tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%");
1968 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); 1976 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%");
1969 - tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");  
1970 - tempMap.put("workList", tempList); 1977 +// tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");
  1978 +// tempMap.put("workList", tempList);
1971 1979
1972 String key0 = keys[0] + "/" + keys[1]; 1980 String key0 = keys[0] + "/" + keys[1];
1973 - if(!keyMap0.containsKey(key0))  
1974 - keyMap0.put(key0, new ArrayList<Map<String, Object>>());  
1975 - keyMap0.get(key0).add(tempMap); 1981 + /*if(!keyMap0.containsKey(key0))
  1982 + keyMap0.put(key0, new ArrayList<Map<String, Object>>());*/
  1983 +// keyMap0.get(key0).add(tempMap);
  1984 + resList.add(tempMap);
1976 } 1985 }
1977 1986
1978 - for(String key : keyMap0.keySet()){ 1987 + /*for(String key : keyMap0.keySet()){
1979 Map<String, Object> tempMap = new HashMap<String, Object>(); 1988 Map<String, Object> tempMap = new HashMap<String, Object>();
1980 int sjbc = 0, sddf = 0, zddf = 0, 1989 int sjbc = 0, sddf = 0, zddf = 0,
1981 dxtz = 0, lbtz = 0; 1990 dxtz = 0, lbtz = 0;
@@ -1983,7 +1992,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1983,7 +1992,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1983 sjbc += (int)m.get("sjbc"); 1992 sjbc += (int)m.get("sjbc");
1984 sddf += (int)m.get("sddf"); 1993 sddf += (int)m.get("sddf");
1985 zddf += (int)m.get("zddf"); 1994 zddf += (int)m.get("zddf");
1986 - dxtz += (int)m.get("dxtz"); 1995 +// dxtz += (int)m.get("dxtz");
1987 lbtz += (int)m.get("lbtz"); 1996 lbtz += (int)m.get("lbtz");
1988 } 1997 }
1989 tempMap.put("date", date); 1998 tempMap.put("date", date);
@@ -1995,22 +2004,22 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1995,22 +2004,22 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1995 tempMap.put("sddf", sddf); 2004 tempMap.put("sddf", sddf);
1996 tempMap.put("zddf", zddf); 2005 tempMap.put("zddf", zddf);
1997 tempMap.put("dfhj", sddf + zddf); 2006 tempMap.put("dfhj", sddf + zddf);
1998 - tempMap.put("dxtz", dxtz); 2007 +// tempMap.put("dxtz", dxtz);
1999 tempMap.put("lbtz", lbtz); 2008 tempMap.put("lbtz", lbtz);
2000 tempMap.put("correct", sddf + zddf + dxtz + lbtz); 2009 tempMap.put("correct", sddf + zddf + dxtz + lbtz);
2001 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); 2010 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
2002 tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); 2011 tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%");
2003 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); 2012 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%");
2004 tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); 2013 tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");
2005 - tempMap.put("workList", keyMap0.get(key)); 2014 +// tempMap.put("workList", keyMap0.get(key));
2006 2015
2007 String key1 = keys[0]; 2016 String key1 = keys[0];
2008 if(!keyMap1.containsKey(key1)) 2017 if(!keyMap1.containsKey(key1))
2009 keyMap1.put(key1, new ArrayList<Map<String, Object>>()); 2018 keyMap1.put(key1, new ArrayList<Map<String, Object>>());
2010 keyMap1.get(key1).add(tempMap); 2019 keyMap1.get(key1).add(tempMap);
2011 - } 2020 + }*/
2012 2021
2013 - for(String key : keyMap1.keySet()){ 2022 + /*for(String key : keyMap1.keySet()){
2014 Map<String, Object> tempMap = new HashMap<String, Object>(); 2023 Map<String, Object> tempMap = new HashMap<String, Object>();
2015 int sjbc = 0, sddf = 0, zddf = 0, 2024 int sjbc = 0, sddf = 0, zddf = 0,
2016 dxtz = 0, lbtz = 0, lines = 0; 2025 dxtz = 0, lbtz = 0, lines = 0;
@@ -2018,7 +2027,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2018,7 +2027,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2018 sjbc += (int)m.get("sjbc"); 2027 sjbc += (int)m.get("sjbc");
2019 sddf += (int)m.get("sddf"); 2028 sddf += (int)m.get("sddf");
2020 zddf += (int)m.get("zddf"); 2029 zddf += (int)m.get("zddf");
2021 - dxtz += (int)m.get("dxtz"); 2030 +// dxtz += (int)m.get("dxtz");
2022 lbtz += (int)m.get("lbtz"); 2031 lbtz += (int)m.get("lbtz");
2023 lines += (int)m.get("lines"); 2032 lines += (int)m.get("lines");
2024 } 2033 }
@@ -2029,17 +2038,17 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2029,17 +2038,17 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2029 tempMap.put("sddf", sddf); 2038 tempMap.put("sddf", sddf);
2030 tempMap.put("zddf", zddf); 2039 tempMap.put("zddf", zddf);
2031 tempMap.put("dfhj", sddf + zddf); 2040 tempMap.put("dfhj", sddf + zddf);
2032 - tempMap.put("dxtz", dxtz); 2041 +// tempMap.put("dxtz", dxtz);
2033 tempMap.put("lbtz", lbtz); 2042 tempMap.put("lbtz", lbtz);
2034 tempMap.put("correct", sddf + zddf + dxtz + lbtz); 2043 tempMap.put("correct", sddf + zddf + dxtz + lbtz);
2035 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); 2044 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
2036 tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); 2045 tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%");
2037 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); 2046 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%");
2038 tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); 2047 tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");
2039 - tempMap.put("workList", keyMap1.get(key)); 2048 +// tempMap.put("workList", keyMap1.get(key));
2040 2049
2041 resList.add(tempMap); 2050 resList.add(tempMap);
2042 - } 2051 + }*/
2043 2052
2044 if(resList.size() != 0){ 2053 if(resList.size() != 0){
2045 Map<String, Object> tempMap = new HashMap<String, Object>(); 2054 Map<String, Object> tempMap = new HashMap<String, Object>();
@@ -2049,10 +2058,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2049,10 +2058,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2049 sjbc += (int)m.get("sjbc"); 2058 sjbc += (int)m.get("sjbc");
2050 sddf += (int)m.get("sddf"); 2059 sddf += (int)m.get("sddf");
2051 zddf += (int)m.get("zddf"); 2060 zddf += (int)m.get("zddf");
2052 - dxtz += (int)m.get("dxtz"); 2061 +// dxtz += (int)m.get("dxtz");
2053 lbtz += (int)m.get("lbtz"); 2062 lbtz += (int)m.get("lbtz");
2054 - lines += (int)m.get("lines");  
2055 - for(Map<String, Object> m0 : (List<Map<String, Object>>)m.get("workList")){ 2063 +// lines += (int)m.get("lines");
  2064 + /*for(Map<String, Object> m0 : (List<Map<String, Object>>)m.get("workList")){
2056 Map<String, Object> temp = new HashMap<String, Object>(); 2065 Map<String, Object> temp = new HashMap<String, Object>();
2057 temp.put("date", "合计"); 2066 temp.put("date", "合计");
2058 temp.put("lines", m0.get("lines")); 2067 temp.put("lines", m0.get("lines"));
@@ -2060,15 +2069,15 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2060,15 +2069,15 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2060 temp.put("sddf", m0.get("sddf")); 2069 temp.put("sddf", m0.get("sddf"));
2061 temp.put("zddf", m0.get("zddf")); 2070 temp.put("zddf", m0.get("zddf"));
2062 temp.put("dfhj", m0.get("dfhj")); 2071 temp.put("dfhj", m0.get("dfhj"));
2063 - temp.put("dxtz", m0.get("dxtz")); 2072 +// temp.put("dxtz", m0.get("dxtz"));
2064 temp.put("lbtz", m0.get("lbtz")); 2073 temp.put("lbtz", m0.get("lbtz"));
2065 temp.put("correct", m0.get("correct")); 2074 temp.put("correct", m0.get("correct"));
2066 temp.put("dfbl", m0.get("dfbl")); 2075 temp.put("dfbl", m0.get("dfbl"));
2067 temp.put("dxbl", m0.get("dxbl")); 2076 temp.put("dxbl", m0.get("dxbl"));
2068 temp.put("lbbl", m0.get("lbbl")); 2077 temp.put("lbbl", m0.get("lbbl"));
2069 temp.put("correctbl", m0.get("correctbl")); 2078 temp.put("correctbl", m0.get("correctbl"));
2070 - ((List<Map<String, Object>>)m0.get("workList")).add(temp);  
2071 - } 2079 +// ((List<Map<String, Object>>)m0.get("workList")).add(temp);
  2080 + }*/
2072 Map<String, Object> temp = new HashMap<String, Object>(); 2081 Map<String, Object> temp = new HashMap<String, Object>();
2073 temp.put("date", "合计"); 2082 temp.put("date", "合计");
2074 temp.put("lines", m.get("lines")); 2083 temp.put("lines", m.get("lines"));
@@ -2076,14 +2085,14 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2076,14 +2085,14 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2076 temp.put("sddf", m.get("sddf")); 2085 temp.put("sddf", m.get("sddf"));
2077 temp.put("zddf", m.get("zddf")); 2086 temp.put("zddf", m.get("zddf"));
2078 temp.put("dfhj", m.get("dfhj")); 2087 temp.put("dfhj", m.get("dfhj"));
2079 - temp.put("dxtz", m.get("dxtz")); 2088 +// temp.put("dxtz", m.get("dxtz"));
2080 temp.put("lbtz", m.get("lbtz")); 2089 temp.put("lbtz", m.get("lbtz"));
2081 temp.put("correct", m.get("correct")); 2090 temp.put("correct", m.get("correct"));
2082 temp.put("dfbl", m.get("dfbl")); 2091 temp.put("dfbl", m.get("dfbl"));
2083 temp.put("dxbl", m.get("dxbl")); 2092 temp.put("dxbl", m.get("dxbl"));
2084 temp.put("lbbl", m.get("lbbl")); 2093 temp.put("lbbl", m.get("lbbl"));
2085 - temp.put("correctbl", m.get("correctbl"));  
2086 - ((List<Map<String, Object>>)m.get("workList")).add(temp); 2094 +// temp.put("correctbl", m.get("correctbl"));
  2095 +// ((List<Map<String, Object>>)m.get("workList")).add(temp);
2087 } 2096 }
2088 tempMap.put("date", "合计"); 2097 tempMap.put("date", "合计");
2089 tempMap.put("lines", lines); 2098 tempMap.put("lines", lines);
@@ -2091,16 +2100,99 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2091,16 +2100,99 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2091 tempMap.put("sddf", sddf); 2100 tempMap.put("sddf", sddf);
2092 tempMap.put("zddf", zddf); 2101 tempMap.put("zddf", zddf);
2093 tempMap.put("dfhj", sddf + zddf); 2102 tempMap.put("dfhj", sddf + zddf);
2094 - tempMap.put("dxtz", dxtz); 2103 +// tempMap.put("dxtz", dxtz);
2095 tempMap.put("lbtz", lbtz); 2104 tempMap.put("lbtz", lbtz);
2096 - tempMap.put("correct", sddf + zddf + dxtz + lbtz); 2105 + tempMap.put("correct", sddf + zddf + lbtz);
2097 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); 2106 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
2098 - tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); 2107 +
2099 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); 2108 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%");
2100 - tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); 2109 +// tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");
2101 resList.add(tempMap); 2110 resList.add(tempMap);
2102 } 2111 }
2103 - 2112 + //计算掉线调整
  2113 + String sqldot = "select * from "
  2114 + + "logger_sch_modify where gsbm =? and fgsbm=? and rq BETWEEN ? and ? order by line_code,sch_id";
  2115 +
  2116 + ;
  2117 + List<SchEditInfoDto> listDot = jdbcTemplate.query(sqldot,
  2118 + new BeanPropertyRowMapper(SchEditInfoDto.class),company,subCompany,map.get("startDate").toString(),map.get("endDate").toString());
  2119 + int dxtzz=0;
  2120 + Map<String, Object> mapSchId=new HashMap<String,Object>();
  2121 + for (int i = 0; i < resList.size(); i++) {
  2122 + Map<String, Object> resMap=resList.get(i);
  2123 + String date_1=resMap.get("date").toString();
  2124 + int sjbc=Integer.parseInt(resMap.get("sjbc").toString());
  2125 + int correct=Integer.parseInt(resMap.get("correct").toString());
  2126 +
  2127 + if(date_1.equals("合计")){
  2128 + resMap.put("dxtz", dxtzz);
  2129 + resMap.put("correct",correct+dxtzz);
  2130 + if(sjbc<=0){
  2131 + resMap.put("dxbl", "0");
  2132 + resMap.put("correctbl", "0");
  2133 + }else{
  2134 + resMap.put("dxbl", df.format((double)(dxtzz)/sjbc*100) + "%");
  2135 + resMap.put("correctbl", df.format((double)(correct+dxtzz)/sjbc*100) + "%");
  2136 + }
  2137 +
  2138 +
  2139 + }else{
  2140 + String xlbm=resMap.get("line").toString();
  2141 + int dxtzf=0;
  2142 + for (int j = 0; j < listDot.size(); j++) {
  2143 + SchEditInfoDto seid=listDot.get(j);
  2144 + if(seid.getLineCode().equals(xlbm)){
  2145 + String jstype=seid.getType();
  2146 + String json="";
  2147 + if(seid.getJsonArray()!=null){
  2148 + json =seid.getJsonArray().toString();
  2149 + }
  2150 + if(!json.equals("")){
  2151 + if(jstype.equals("FCXXWT")){
  2152 + JSONArray jsonArray = JSONArray.parseArray(json);
  2153 + for (int x = 0; x < jsonArray.size(); x++) {
  2154 + Map<String, Object> jsonObject=jsonArray.getJSONObject(x);
  2155 + String title=jsonObject.get("title")==null?"":jsonObject.get("title").toString();
  2156 + if(mapSchId.get(String.valueOf(seid.getSchId()))==null){
  2157 + if(title.equals("调整实发时间") || title.equals("调整实达时间")){
  2158 + if(jsonObject.get("old")==null){
  2159 + dxtzf++;
  2160 + dxtzz++;
  2161 + mapSchId.put(String.valueOf(seid.getSchId()), seid.getSchId());
  2162 + }
  2163 + }
  2164 + }
  2165 +
  2166 + }
  2167 + }
  2168 + if(jstype.equals("SFTZ")){
  2169 + Gson gson = new Gson();
  2170 + Map<String, Object> map_js = new HashMap<String, Object>();
  2171 + map_js = gson.fromJson(json, map.getClass());
  2172 + if(mapSchId.get(String.valueOf(seid.getSchId()))==null){
  2173 + if(map_js.get("old")==null){
  2174 + dxtzf++;
  2175 + dxtzz++;
  2176 + mapSchId.put(String.valueOf(seid.getSchId()), seid.getSchId());
  2177 + }
  2178 + }
  2179 + }
  2180 + }
  2181 + }
  2182 + }
  2183 + resMap.put("dxtz", dxtzf);
  2184 + resMap.put("correct",correct+dxtzf);
  2185 + if(sjbc<=0){
  2186 + resMap.put("dxbl", "0");
  2187 + resMap.put("correctbl", "0");
  2188 + }else{
  2189 + resMap.put("dxbl", df.format((double)(dxtzf)/sjbc*100) + "%");
  2190 + resMap.put("correctbl", df.format((double)(correct+dxtzf)/sjbc*100) + "%");
  2191 + }
  2192 + resMap.put("xlname",BasicData.lineCode2NameMap.get(xlbm));
  2193 + }
  2194 + }
  2195 +
2104 return resList; 2196 return resList;
2105 } 2197 }
2106 2198
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
@@ -668,25 +668,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -668,25 +668,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
668 * @return String 668 * @return String
669 */ 669 */
670 public String newTextFileToFTP(List<Object[]> objects,Integer lineId) { 670 public String newTextFileToFTP(List<Object[]> objects,Integer lineId) {
671 -  
672 // 返回值String 671 // 返回值String
673 String stationRStr = ""; 672 String stationRStr = "";
674 -  
675 // windows下的文本文件换行符 673 // windows下的文本文件换行符
676 //String enterStr = "\r\n"; 674 //String enterStr = "\r\n";
677 -  
678 // linux/unix下的文本文件换行符 675 // linux/unix下的文本文件换行符
679 String enterStr = "\r"; 676 String enterStr = "\r";
680 - 677 + int defaultZdxh = 0;
681 if(objects.size()>0) { 678 if(objects.size()>0) {
682 -  
683 for(int i = 0; i<objects.size();i++) { 679 for(int i = 0; i<objects.size();i++) {
684 - 680 + defaultZdxh ++ ;
685 // 经度 681 // 经度
686 - String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString(); 682 + String lng = objects.get(i)[0].equals("") ? "0" : objects.get(i)[0].toString();
687 683
688 // 纬度 684 // 纬度
689 - String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString(); 685 + String lat = objects.get(i)[1].equals("") ? "0" : objects.get(i)[1].toString();
  686 +
  687 + Point point = new Point(Double.valueOf(lng), Double.valueOf(lat));
690 688
691 lat = "\t" + lat; 689 lat = "\t" + lat;
692 690
@@ -696,23 +694,32 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -696,23 +694,32 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
696 String stationMake = ""; 694 String stationMake = "";
697 695
698 if(stationMakeStr.equals("E")) { 696 if(stationMakeStr.equals("E")) {
699 -  
700 stationMake = "\t2"; 697 stationMake = "\t2";
701 -  
702 }else { 698 }else {
703 -  
704 stationMake ="\t1"; 699 stationMake ="\t1";
705 -  
706 } 700 }
707 701
708 // 站点序号 702 // 站点序号
709 - String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString(); 703 + // String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString();
  704 + String stationNo = String.valueOf(defaultZdxh);
710 705
711 stationNo = "\t" + stationNo; 706 stationNo = "\t" + stationNo;
712 707
713 // 站点编码 708 // 站点编码
714 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString(); 709 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString();
715 710
  711 + int len = stationCode.length();
  712 + if(len<8) {
  713 + int dx = 8 - len;
  714 + String addStr = "";
  715 + for(int p =0;p<dx;p++) {
  716 + addStr = addStr + "0";
  717 + }
  718 + stationCode = addStr + stationCode;
  719 + }else if(len>8){
  720 + stationCode = stationCode.substring(8);
  721 + }
  722 +
716 stationCode = "\t" +stationCode; 723 stationCode = "\t" +stationCode;
717 724
718 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; 725 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000;
@@ -732,41 +739,33 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -732,41 +739,33 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
732 739
733 // 限速 740 // 限速
734 String sleepStr = ""; 741 String sleepStr = "";
735 -  
736 // 方向 742 // 方向
737 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString()); 743 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString());
738 -  
739 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ 744 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
740 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); 745 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
741 -  
742 if(sobje.size()==1) { 746 if(sobje.size()==1) {
743 -  
744 - double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString());  
745 -  
746 - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr);  
747 - 747 + int dsleepStr = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.valueOf(sobje.get(0)[2].toString());
  748 + sleepStr = "\t" + String.valueOf(dsleepStr);
748 }else if(sobje.size()>1){ 749 }else if(sobje.size()>1){
749 -  
750 - /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */  
751 for(int j =0;j<sobje.size();j++) { 750 for(int j =0;j<sobje.size();j++) {
752 -  
753 - String sectionName = sobje.get(j)[3].toString();  
754 -  
755 - String sectionNameA[] = sectionName.split("至");  
756 -  
757 - if(stationName.equals(sectionNameA[0])){  
758 -  
759 - /*sleepStr = sobje.get(j)[2].toString();*/  
760 -  
761 - double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString());  
762 -  
763 - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt);  
764 - 751 + double dsleepStrt = sobje.get(j)[2] == null || sobje.get(j)[2].equals("") ? 60d : Double.valueOf(sobje.get(j)[2].toString());
  752 + String pointsStr = sobje.get(j)[1]==null || sobje.get(j)[1].equals("") ? null : sobje.get(j)[1].toString();
  753 + pointsStr = pointsStr.substring(11, pointsStr.length()-1);
  754 + List<Point> ps = new ArrayList<>();
  755 + String[] pArray = pointsStr.split(",");
  756 + for(int a = 0; a <pArray.length; a++) {
  757 + String[] tmepA = pArray[a].split(" ");
  758 + Point temp = new Point(Double.valueOf(tmepA[0]), Double.valueOf(tmepA[1]));
  759 + ps.add(temp);
  760 + }
  761 + if(GeoUtils.isInSection(ps, point)) {
  762 + sleepStr = "\t" + String.valueOf((int)dsleepStrt);
  763 + break;
765 } 764 }
766 -  
767 } 765 }
768 } 766 }
769 - 767 + if(sleepStr.equals(""))
  768 + sleepStr = "\t" + "60";
770 stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; 769 stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
771 } 770 }
772 771
@@ -785,9 +784,12 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -785,9 +784,12 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
785 for(int i = 0; i<objects.size();i++) { 784 for(int i = 0; i<objects.size();i++) {
786 if(Integer.valueOf(objects.get(i)[8].toString())==0) { 785 if(Integer.valueOf(objects.get(i)[8].toString())==0) {
787 // 经度 786 // 经度
788 - String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString(); 787 + String lng = objects.get(i)[0].equals("") ? "0" : objects.get(i)[0].toString();
  788 +
789 // 纬度 789 // 纬度
790 - String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString(); 790 + String lat = objects.get(i)[1].equals("") ? "0" : objects.get(i)[1].toString();
  791 +
  792 + Point point = new Point(Double.valueOf(lng), Double.valueOf(lat));
791 lat = "\t" + lat; 793 lat = "\t" + lat;
792 // 站点类型 794 // 站点类型
793 String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString(); 795 String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString();
@@ -802,6 +804,17 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -802,6 +804,17 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
802 String stationNo = "\t" + xh; 804 String stationNo = "\t" + xh;
803 // 站点编码 805 // 站点编码
804 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString(); 806 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString();
  807 + int len = stationCode.length();
  808 + if(len<8) {
  809 + int dx = 8 - len;
  810 + String addStr = "";
  811 + for(int p =0;p<dx;p++) {
  812 + addStr = addStr + "0";
  813 + }
  814 + stationCode = addStr + stationCode;
  815 + }else if(len>8){
  816 + stationCode = stationCode.substring(8);
  817 + }
805 stationCode = "\t" +stationCode; 818 stationCode = "\t" +stationCode;
806 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; 819 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000;
807 String tempDistc = String.valueOf((int) dis); 820 String tempDistc = String.valueOf((int) dis);
@@ -817,20 +830,28 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -817,20 +830,28 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
817 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ 830 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
818 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); 831 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
819 if(sobje.size()==1) { 832 if(sobje.size()==1) {
820 - double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString());  
821 - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr); 833 + int dsleepStr = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.valueOf(sobje.get(0)[2].toString());
  834 + sleepStr = "\t" + String.valueOf(dsleepStr);
822 }else if(sobje.size()>1){ 835 }else if(sobje.size()>1){
823 - /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */  
824 for(int j =0;j<sobje.size();j++) { 836 for(int j =0;j<sobje.size();j++) {
825 - String sectionName = sobje.get(j)[3].toString();  
826 - String sectionNameA[] = sectionName.split("至");  
827 - if(stationName.equals(sectionNameA[0])){  
828 - /*sleepStr = sobje.get(j)[2].toString();*/  
829 - double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString());  
830 - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt); 837 + double dsleepStrt = sobje.get(j)[2] == null || sobje.get(j)[2].equals("") ? 60d : Double.valueOf(sobje.get(j)[2].toString());
  838 + String pointsStr = sobje.get(j)[1]==null || sobje.get(j)[1].equals("") ? null : sobje.get(j)[1].toString();
  839 + pointsStr = pointsStr.substring(11, pointsStr.length()-1);
  840 + List<Point> ps = new ArrayList<>();
  841 + String[] pArray = pointsStr.split(",");
  842 + for(int a = 0; a <pArray.length; a++) {
  843 + String[] tmepA = pArray[a].split(" ");
  844 + Point temp = new Point(Double.valueOf(tmepA[0]), Double.valueOf(tmepA[1]));
  845 + ps.add(temp);
  846 + }
  847 + if(GeoUtils.isInSection(ps, point)) {
  848 + sleepStr = "\t" + String.valueOf((int)dsleepStrt);
  849 + break;
831 } 850 }
832 } 851 }
833 } 852 }
  853 + if(sleepStr.equals(""))
  854 + sleepStr = "\t" + "60";
834 xh++; 855 xh++;
835 restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; 856 restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
836 } 857 }
src/main/java/com/bsth/service/impl/StationServiceImpl.java
@@ -930,7 +930,8 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -930,7 +930,8 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
930 Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString()); 930 Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString());
931 Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString()); 931 Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString());
932 // 更新 932 // 更新
933 - repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, destroy, radius, shapesType, versions, descriptions, stationId); 933 + /*repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, destroy, radius, shapesType, versions, descriptions, stationId);*/
  934 + repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, radius, shapesType, versions, descriptions, stationId);
934 // 站点路由Id 935 // 站点路由Id
935 Integer stationRouteId = map.get("stationRouteId").equals("") ? null : Integer.parseInt(map.get("stationRouteId").toString()); 936 Integer stationRouteId = map.get("stationRouteId").equals("") ? null : Integer.parseInt(map.get("stationRouteId").toString());
936 StationRoute resultS = routeRepository.findOne(stationRouteId); 937 StationRoute resultS = routeRepository.findOne(stationRouteId);
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
@@ -16,6 +16,7 @@ import com.bsth.repository.schedule.*; @@ -16,6 +16,7 @@ import com.bsth.repository.schedule.*;
16 import com.bsth.repository.traffic.SKBUploadLoggerRepository; 16 import com.bsth.repository.traffic.SKBUploadLoggerRepository;
17 import com.bsth.security.util.SecurityUtils; 17 import com.bsth.security.util.SecurityUtils;
18 import com.bsth.service.TrafficManageService; 18 import com.bsth.service.TrafficManageService;
  19 +import com.bsth.service.traffic.YgcBasicDataService;
19 import com.bsth.util.TimeUtils; 20 import com.bsth.util.TimeUtils;
20 import com.bsth.util.db.DBUtils_MS; 21 import com.bsth.util.db.DBUtils_MS;
21 import com.bsth.webService.trafficManage.geotool.services.InternalPortType; 22 import com.bsth.webService.trafficManage.geotool.services.InternalPortType;
@@ -23,6 +24,7 @@ import com.bsth.webService.trafficManage.geotool.services.Internal; @@ -23,6 +24,7 @@ import com.bsth.webService.trafficManage.geotool.services.Internal;
23 import com.bsth.webService.trafficManage.org.tempuri.Results; 24 import com.bsth.webService.trafficManage.org.tempuri.Results;
24 import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; 25 import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator;
25 import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; 26 import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap;
  27 +import org.apache.commons.lang.StringUtils;
26 import org.apache.commons.lang.time.DateUtils; 28 import org.apache.commons.lang.time.DateUtils;
27 import org.slf4j.Logger; 29 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory; 30 import org.slf4j.LoggerFactory;
@@ -99,7 +101,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -99,7 +101,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
99 101
100 // 线路站点repository 102 // 线路站点repository
101 @Autowired 103 @Autowired
102 - private StationRepository stationRepository; 104 + private YgcBasicDataService ygcBasicDataService;
103 105
104 106
105 // 运管处接口 107 // 运管处接口
@@ -122,11 +124,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -122,11 +124,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
122 DecimalFormat format = new DecimalFormat("0.00"); 124 DecimalFormat format = new DecimalFormat("0.00");
123 125
124 // 用户名 126 // 用户名
125 - private final String userNameXl = "pudong";  
126 - // 密码  
127 - private final String passwordXl = "pudong123";  
128 -  
129 - // 用户名  
130 private final String userNameOther = "user"; 127 private final String userNameOther = "user";
131 // 密码 128 // 密码
132 private final String passwordOther = "user"; 129 private final String passwordOther = "user";
@@ -134,34 +131,25 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -134,34 +131,25 @@ public class TrafficManageServiceImpl implements TrafficManageService{
134 * 上传线路信息 131 * 上传线路信息
135 */ 132 */
136 @Override 133 @Override
137 - public String setXL(Map<String, Object> param) { 134 + public String setXL(String ids) {
138 String result = "failure"; 135 String result = "failure";
139 StringBuffer sBuffer = new StringBuffer(); 136 StringBuffer sBuffer = new StringBuffer();
  137 + String[] idArray = ids.split(",");
140 try { 138 try {
141 - Map<String,Object> map = new HashMap<String,Object>();  
142 - map.put("lineCode_eq", param.get("xl.lineCode_like")+"");  
143 - Iterator<Line> lineIterator;  
144 - Line line = null;  
145 - if(param.get("xl.lineCode_like").equals("")){  
146 - lineIterator = lineRepository.findAll().iterator();  
147 - }else { 139 + for (String id : idArray) {
  140 + Map<String,Object> map = new HashMap<>();
  141 + map.put("lineCode_eq", id);
  142 + Line line ;
148 line = lineRepository.findOne(new CustomerSpecs<Line>(map)); 143 line = lineRepository.findOne(new CustomerSpecs<Line>(map));
149 - }  
150 - List<StationRoute> upStationsList = null;// 上行站点路由集  
151 - List<StationRoute> downStationsList = null;// 下行站点路由集  
152 - List<LineInformation> lineInformationsList = null;  
153 - LineInformation lineInformation = null;  
154 - sBuffer.append("<Data>");  
155 - sBuffer.append("<RequestOrg>上海巴士拓华科技发展有限公司</RequestOrg>");  
156 - sBuffer.append("<DataList>");  
157 -// while(lineIterator.hasNext()){  
158 -// line = lineIterator.next();  
159 -// if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null  
160 -// || line.getInUse() == 0){  
161 -// continue;  
162 -// }  
163 - if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null  
164 - || line.getInUse() == 0){ 144 + if(line == null){
  145 + continue;
  146 + }
  147 + List<StationRoute> upStationsList ;// 上行站点路由集
  148 + List<StationRoute> downStationsList = null;// 下行站点路由集
  149 + sBuffer.append("<Data>");
  150 + sBuffer.append("<RequestOrg>上海巴士拓华科技发展有限公司</RequestOrg>");
  151 + sBuffer.append("<DataList>");
  152 + if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){
165 return result; 153 return result;
166 } 154 }
167 sBuffer.append("<LINE_ID>").append(line.getId()).append("</LINE_ID>"); 155 sBuffer.append("<LINE_ID>").append(line.getId()).append("</LINE_ID>");
@@ -190,32 +178,24 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -190,32 +178,24 @@ public class TrafficManageServiceImpl implements TrafficManageService{
190 packagStationPointXml(downStationsList, sBuffer, startId); 178 packagStationPointXml(downStationsList, sBuffer, startId);
191 } 179 }
192 sBuffer.append("</LinePointList>"); 180 sBuffer.append("</LinePointList>");
193 -// }  
194 - sBuffer.append("</DataList>");  
195 - sBuffer.append("</Data>");  
196 - System.out.println(sBuffer.toString());  
197 - if(sBuffer.indexOf("<XL>") != -1){  
198 - portType = new Internal().getInternalHttpSoap11Endpoint();  
199 - String portResult = portType.setXL(userNameXl, passwordXl, sBuffer.toString());  
200 - String portArray[] = portResult.split("\n");  
201 - if(portArray.length >= 4){  
202 - // 返回数据的编码  
203 - String returnCode = portArray[1].substring(portArray[1].indexOf(">")+1,portArray[1].indexOf("</"));  
204 - // 返回的信息  
205 - String returnDescription = portArray[2].substring(portArray[2].indexOf(">")+1,portArray[2].indexOf("</"));  
206 - if(returnCode.equals("1")){  
207 - result = "success";  
208 - }else{  
209 - result = returnDescription;  
210 - } 181 + sBuffer.append("</DataList>");
  182 + sBuffer.append("</Data>");
  183 + // 调用上传方法
  184 + result = ygcBasicDataService.invokeMethod("UpdateBusLineStation",sBuffer.toString());
  185 + String str = "ReturnCode";
  186 + // 解析返回值
  187 + result = result.substring(result.indexOf(str)+str.length()+1,result.lastIndexOf(str)-2);
  188 + if(result.equals("1")){
  189 + result = "success";
  190 + }else{
  191 + result = "failure";
211 } 192 }
  193 + logger.info("setXL:"+sBuffer.toString());
  194 + logger.info("setXL:"+result);
212 } 195 }
213 } catch (Exception e) { 196 } catch (Exception e) {
214 logger.error("setXL:",e); 197 logger.error("setXL:",e);
215 e.printStackTrace(); 198 e.printStackTrace();
216 - }finally{  
217 - logger.info("setXL:"+sBuffer.toString());  
218 - logger.info("setXL:"+result);  
219 } 199 }
220 return result; 200 return result;
221 } 201 }
@@ -1146,11 +1126,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -1146,11 +1126,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1146 }else{ 1126 }else{
1147 flag = 0; 1127 flag = 0;
1148 } 1128 }
1149 - result += flag;  
1150 - if(i !=ruleDayArray.length -1){  
1151 - result +=","; 1129 + if(flag > 0){
  1130 + result += flag + ",";
1152 } 1131 }
1153 } 1132 }
  1133 + // 去掉最后一个字符
  1134 + if(StringUtils.endsWith(result,",")){
  1135 + result = StringUtils.removeEnd(result,",");
  1136 + }
1154 return result; 1137 return result;
1155 } 1138 }
1156 /** 1139 /**
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
@@ -2,6 +2,7 @@ package com.bsth.service.realcontrol.impl; @@ -2,6 +2,7 @@ package com.bsth.service.realcontrol.impl;
2 2
3 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
4 import com.bsth.data.BasicData; 4 import com.bsth.data.BasicData;
  5 +import com.bsth.data.Station2ParkBuffer;
5 import com.bsth.data.schedule.DayOfSchedule; 6 import com.bsth.data.schedule.DayOfSchedule;
6 import com.bsth.entity.realcontrol.ChildTaskPlan; 7 import com.bsth.entity.realcontrol.ChildTaskPlan;
7 import com.bsth.entity.realcontrol.ScheduleRealInfo; 8 import com.bsth.entity.realcontrol.ScheduleRealInfo;
@@ -45,14 +46,21 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon @@ -45,14 +46,21 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
45 try { 46 try {
46 ScheduleRealInfo sch = dayOfSchedule.get(t.getSchedule().getId()); 47 ScheduleRealInfo sch = dayOfSchedule.get(t.getSchedule().getId());
47 //保存起终点名称 48 //保存起终点名称
48 - String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_"; 49 + //String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_";
49 if(StringUtils.isEmpty(t.getStartStationName())) 50 if(StringUtils.isEmpty(t.getStartStationName()))
50 - t.setStartStationName(BasicData.getStationNameByCode(t.getStartStation(), prefix)); 51 + t.setStartStationName(getStationName(sch.getXlBm(), t.getStartStation()));
  52 + //t.setStartStationName(BasicData.getStationNameByCode(t.getStartStation(), prefix));
51 53
52 if(StringUtils.isEmpty(t.getEndStationName())) 54 if(StringUtils.isEmpty(t.getEndStationName()))
53 - t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix)); 55 + t.setEndStationName(getStationName(sch.getXlBm(), t.getEndStation()));
  56 + //t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix));
54 if(t.getDestroyReason() == null) 57 if(t.getDestroyReason() == null)
55 t.setDestroyReason(""); 58 t.setDestroyReason("");
  59 +
  60 + //烂班说明,为兼容之前的数据结构
  61 + if(t.isDestroy() && StringUtils.isEmpty(t.getDestroyReason()))
  62 + t.setDestroyReason(t.getReason());
  63 +
56 //先持久化子任务 64 //先持久化子任务
57 rs = super.save(t); 65 rs = super.save(t);
58 //关联主任务 66 //关联主任务
@@ -60,6 +68,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon @@ -60,6 +68,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
60 dayOfSchedule.save(sch); 68 dayOfSchedule.save(sch);
61 //直接持久化 69 //直接持久化
62 //scheduleRealInfoRepository.save(sch); 70 //scheduleRealInfoRepository.save(sch);
  71 + //站到场对照
  72 + t.setSchedule(sch);
  73 + Station2ParkBuffer.put(t);
63 74
64 rs.put("status", ResponseCode.SUCCESS); 75 rs.put("status", ResponseCode.SUCCESS);
65 rs.put("t", sch); 76 rs.put("t", sch);
@@ -71,6 +82,17 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon @@ -71,6 +82,17 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
71 return rs; 82 return rs;
72 } 83 }
73 84
  85 + private String getStationName(String lineCode, String stationCode){
  86 + String name;
  87 + String prefix1 = lineCode + "_" + 0 + "_",
  88 + prefix2 = lineCode + "_" + 1 + "_";
  89 +
  90 + name = BasicData.getStationNameByCode(stationCode, prefix1);
  91 + if(StringUtils.isEmpty(name))
  92 + name = BasicData.getStationNameByCode(stationCode, prefix2);
  93 + return name;
  94 + }
  95 +
74 @Override 96 @Override
75 public Map<String, Object> delete(Long id) { 97 public Map<String, Object> delete(Long id) {
76 Map<String, Object> rs; 98 Map<String, Object> rs;
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -15,9 +15,11 @@ import com.bsth.data.schedule.SchAttrCalculator; @@ -15,9 +15,11 @@ import com.bsth.data.schedule.SchAttrCalculator;
15 import com.bsth.data.schedule.ScheduleComparator; 15 import com.bsth.data.schedule.ScheduleComparator;
16 import com.bsth.data.schedule.edit_logs.FormLogger; 16 import com.bsth.data.schedule.edit_logs.FormLogger;
17 import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger; 17 import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger;
  18 +import com.bsth.data.schedule.edit_logs.loggers.AfterwardsLogger;
18 import com.bsth.data.schedule.edit_logs.loggers.FcxxwtLogger; 19 import com.bsth.data.schedule.edit_logs.loggers.FcxxwtLogger;
19 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; 20 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
20 import com.bsth.data.schedule.late_adjust.LateAdjustHandle; 21 import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
  22 +import com.bsth.data.utils.CustomStringUtils;
21 import com.bsth.entity.Cars; 23 import com.bsth.entity.Cars;
22 import com.bsth.entity.Line; 24 import com.bsth.entity.Line;
23 import com.bsth.entity.Personnel; 25 import com.bsth.entity.Personnel;
@@ -1687,45 +1689,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1687,45 +1689,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1687 public List<Map<String, Object>> accountPx(String line, String date, 1689 public List<Map<String, Object>> accountPx(String line, String date,
1688 String code, String xlName, String px) { 1690 String code, String xlName, String px) {
1689 // List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px); 1691 // List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px);
  1692 + if(!code.trim().equals("")){
  1693 + code=BasicData.deviceId2NbbmMap.inverse().get(code);
  1694 + }
  1695 + String fgs="";
  1696 + List<Line> lineList= lineRepository.findLineBygsBm("", "", line);
  1697 + if(lineList.size()>0){
  1698 + Line l=lineList.get(0);
  1699 + fgs=BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany()+"_"+l.getCompany());
  1700 + }
1690 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); 1701 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
1691 - String sql= "SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T') as date,"  
1692 - + "c.inside_code FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c "  
1693 - + "ON c.equipment_code = r.device_id where "  
1694 - + "FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = '"+date +"'"  
1695 - + "and r.line_id = "+line+" and c.inside_code like '%"+code+"%'"  
1696 - + " order by c.inside_code "+px; 1702 + String sql= "SELECT request_code,FROM_UNIXTIME(TIMESTAMP / 1000,'%Y-%m-%d %T') as TIMESTAMP ,"
  1703 + + " device_id FROM bsth_v_report_80 WHERE "
  1704 + + " FROM_UNIXTIME( TIMESTAMP / 1000,'%Y-%m-%d') = '"+date+"' AND"
  1705 + + " line_id = '"+line+"' and device_id like '%"+code+"%'";
1697 Map<String, Object> map; 1706 Map<String, Object> map;
1698 List<Object[]> lsitObj = jdbcTemplate.query(sql, 1707 List<Object[]> lsitObj = jdbcTemplate.query(sql,
1699 new RowMapper<Object[]>() { 1708 new RowMapper<Object[]>() {
1700 @Override 1709 @Override
1701 public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException { 1710 public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException {
1702 - Object[] t = new Object[4];  
1703 - t[0]=rs.getString("company");  
1704 - t[1]=rs.getString("request_code");  
1705 - t[2]=rs.getString("date");  
1706 - t[3]=rs.getString("inside_code"); 1711 + Object[] t = new Object[3];
  1712 + t[0]=rs.getString("request_code");
  1713 + t[1]=rs.getString("TIMESTAMP");
  1714 + t[2]=rs.getString("device_id");
1707 return t; 1715 return t;
1708 } 1716 }
1709 }); 1717 });
1710 int i = 1; 1718 int i = 1;
1711 for (Object[] obj : lsitObj) { 1719 for (Object[] obj : lsitObj) {
1712 if (obj != null) { 1720 if (obj != null) {
1713 - map = new HashMap<String, Object>();  
1714 - map.put("num", i++);  
1715 - map.put("xlName", xlName);  
1716 - map.put("clZbh", obj[3]);  
1717 - map.put("company", obj[0]);  
1718 - map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[1] + "")).toUpperCase());  
1719 - map.put("requestTime", obj[2]);  
1720 - listMap.add(map); 1721 + map = new HashMap<String, Object>();
  1722 + map.put("num", i++);
  1723 + map.put("xlName", xlName);
  1724 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1725 + map.put("company",fgs);
  1726 + map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
  1727 + map.put("requestTime", obj[1]);
  1728 + listMap.add(map);
1721 } 1729 }
1722 } 1730 }
1723 - 1731 + if(listMap.size()>1){
  1732 + if(px.equals("asc")){
  1733 + Collections.sort(listMap,new AccountMap());
  1734 + }else{
  1735 + Collections.sort(listMap,new AccountMap2());
  1736 + }
  1737 + }
1724 return listMap; 1738 return listMap;
1725 } 1739 }
1726 @Override 1740 @Override
1727 public List<Map<String, Object>> account(String line, String date, 1741 public List<Map<String, Object>> account(String line, String date,
1728 String code, String xlName, String type) { 1742 String code, String xlName, String type) {
  1743 + if(!code.trim().equals("")){
  1744 + code=BasicData.deviceId2NbbmMap.inverse().get(code);
  1745 + }
  1746 + String fgs="";
  1747 + List<Line> lineList= lineRepository.findLineBygsBm("", "", line);
  1748 + if(lineList.size()>0){
  1749 + Line l=lineList.get(0);
  1750 + fgs=BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany()+"_"+l.getCompany());
  1751 + }
1729 List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code); 1752 List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code);
1730 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); 1753 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
1731 Map<String, Object> map; 1754 Map<String, Object> map;
@@ -1735,10 +1758,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1735,10 +1758,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1735 map = new HashMap<String, Object>(); 1758 map = new HashMap<String, Object>();
1736 map.put("num", i++); 1759 map.put("num", i++);
1737 map.put("xlName", xlName); 1760 map.put("xlName", xlName);
1738 - map.put("clZbh", obj[3]);  
1739 - map.put("company", obj[0]);  
1740 - map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[1] + "")).toUpperCase());  
1741 - map.put("requestTime", obj[2]); 1761 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1762 + map.put("company",fgs);
  1763 + map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
  1764 + map.put("requestTime", obj[1]);
1742 listMap.add(map); 1765 listMap.add(map);
1743 } 1766 }
1744 } 1767 }
@@ -2554,11 +2577,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2554,11 +2577,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2554 if (a == 2) { 2577 if (a == 2) {
2555 x = b + 1; 2578 x = b + 1;
2556 y = x * 2; 2579 y = x * 2;
2557 - ;  
2558 } else if (b == 1) { 2580 } else if (b == 1) {
2559 x = b + 1; 2581 x = b + 1;
2560 y = x * 2 - 1; 2582 y = x * 2 - 1;
2561 - ;  
2562 } else { 2583 } else {
2563 x = b; 2584 x = b;
2564 y = 2 * x; 2585 y = 2 * x;
@@ -3040,14 +3061,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3040,14 +3061,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3040 rs.put("status", ResponseCode.ERROR); 3061 rs.put("status", ResponseCode.ERROR);
3041 3062
3042 ScheduleRealInfo oldSch = super.findById(sch.getId()); 3063 ScheduleRealInfo oldSch = super.findById(sch.getId());
  3064 + //事后日志记录
  3065 + AfterwardsLogger aflog = AfterwardsLogger.start(oldSch, "事后调整");
3043 3066
3044 //换车 3067 //换车
3045 if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) { 3068 if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) {
3046 if (!carExist(oldSch.getGsBm(),sch.getClZbh())) { 3069 if (!carExist(oldSch.getGsBm(),sch.getClZbh())) {
3047 rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!"); 3070 rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!");
3048 return rs; 3071 return rs;
3049 - } else 3072 + } else{
  3073 + aflog.log("换车", oldSch.getClZbh(), sch.getClZbh());
3050 oldSch.setClZbh(sch.getClZbh()); 3074 oldSch.setClZbh(sch.getClZbh());
  3075 + }
3051 } 3076 }
3052 3077
3053 //换驾驶员 3078 //换驾驶员
@@ -3057,6 +3082,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3057,6 +3082,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3057 rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员"); 3082 rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员");
3058 return rs; 3083 return rs;
3059 } 3084 }
  3085 + aflog.log("换驾驶员", oldSch.getjGh()+"/"+ oldSch.getjName(), sch.getjGh()+"/"+ sch.getjName());
3060 persoChange(oldSch, sch.getjGh()); 3086 persoChange(oldSch, sch.getjGh());
3061 } 3087 }
3062 3088
@@ -3067,6 +3093,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3067,6 +3093,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3067 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员"); 3093 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员");
3068 return rs; 3094 return rs;
3069 } 3095 }
  3096 + aflog.log("换售票员", oldSch.getsGh()+"/"+ oldSch.getsName(), sch.getsGh()+"/"+ sch.getsName());
3070 persoChangeSPY(oldSch, sch.getsGh()); 3097 persoChangeSPY(oldSch, sch.getsGh());
3071 } 3098 }
3072 3099
@@ -3075,12 +3102,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3075,12 +3102,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3075 boolean dest2 = sch.getStatus() == -1; 3102 boolean dest2 = sch.getStatus() == -1;
3076 if (!dest1 && dest2) { 3103 if (!dest1 && dest2) {
3077 oldSch.destroy(); 3104 oldSch.destroy();
  3105 + aflog.log("烂班");
3078 } 3106 }
3079 else if(dest1 && !dest2){ 3107 else if(dest1 && !dest2){
3080 //撤销烂班 3108 //撤销烂班
3081 oldSch.setJhlc(oldSch.getJhlcOrig()); 3109 oldSch.setJhlc(oldSch.getJhlcOrig());
3082 oldSch.setStatus(0); 3110 oldSch.setStatus(0);
3083 oldSch.calcStatus(); 3111 oldSch.calcStatus();
  3112 + aflog.log("撤销烂班");
3084 } 3113 }
3085 3114
3086 3115
@@ -3089,6 +3118,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3089,6 +3118,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3089 */ 3118 */
3090 if (!oldSch.getJhlc().equals(sch.getJhlc())) { 3119 if (!oldSch.getJhlc().equals(sch.getJhlc())) {
3091 double jhlcNum = sch.getJhlc(); 3120 double jhlcNum = sch.getJhlc();
  3121 + aflog.log("修改班次里程", oldSch.getJhlc(), jhlcNum);
3092 //烂班 3122 //烂班
3093 if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0) 3123 if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0)
3094 oldSch.destroy(); 3124 oldSch.destroy();
@@ -3101,15 +3131,30 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3101,15 +3131,30 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3101 } 3131 }
3102 3132
3103 //待发时间 3133 //待发时间
3104 - oldSch.setDfsj(sch.getDfsj()); 3134 + if(!CustomStringUtils.equals(oldSch.getDfsj(), sch.getDfsj())){
  3135 + aflog.log("修改待发时间", oldSch.getDfsj(), sch.getDfsj());
  3136 + oldSch.setDfsj(sch.getDfsj());
  3137 + }
3105 //实发时间 3138 //实发时间
3106 - oldSch.setFcsjActual(sch.getFcsjActual()); 3139 + if(!CustomStringUtils.equals(oldSch.getFcsjActual(), sch.getFcsjActual())){
  3140 + aflog.log("修改实发时间", oldSch.getFcsjActual(), sch.getFcsjActual());
  3141 + oldSch.setFcsjActual(sch.getFcsjActual());
  3142 + }
3107 //实际终点 3143 //实际终点
3108 - oldSch.setZdsjActual(sch.getZdsjActual()); 3144 + if(!CustomStringUtils.equals(oldSch.getZdsjActual(), sch.getZdsjActual())){
  3145 + aflog.log("修改实达时间", oldSch.getZdsjActual(), sch.getZdsjActual());
  3146 + oldSch.setZdsjActual(sch.getZdsjActual());
  3147 + }
  3148 +
3109 //备注 3149 //备注
3110 - oldSch.setRemarks(sch.getRemarks()); 3150 + if(!CustomStringUtils.equals(oldSch.getRemarks(), sch.getRemarks())){
  3151 + aflog.log("修改备注", oldSch.getRemarks(), sch.getRemarks());
  3152 + oldSch.setRemarks(sch.getRemarks());
  3153 + }
3111 3154
3112 scheduleRealInfoRepository.save(oldSch); 3155 scheduleRealInfoRepository.save(oldSch);
  3156 +
  3157 + aflog.end();
3113 rs.put("status", ResponseCode.SUCCESS); 3158 rs.put("status", ResponseCode.SUCCESS);
3114 return rs; 3159 return rs;
3115 } 3160 }
@@ -3714,7 +3759,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3714,7 +3759,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3714 List<ScheduleRealInfo> list3 = this.realScheduleList(line, date); 3759 List<ScheduleRealInfo> list3 = this.realScheduleList(line, date);
3715 3760
3716 Map<String, Object> nMap=new HashMap<String, Object>(); 3761 Map<String, Object> nMap=new HashMap<String, Object>();
3717 - nMap.put("date", date); 3762 + nMap.put("date", xlName+date);
3718 nMap.put("jls", list1.get(0).get("jls")); 3763 nMap.put("jls", list1.get(0).get("jls"));
3719 nMap.put("sjgl", list1.get(0).get("sjgl")); 3764 nMap.put("sjgl", list1.get(0).get("sjgl"));
3720 for (Map<String, Object> m : list1) { 3765 for (Map<String, Object> m : list1) {
@@ -4199,4 +4244,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4199,4 +4244,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4199 } 4244 }
4200 return rs; 4245 return rs;
4201 } 4246 }
4202 -}  
4203 \ No newline at end of file 4247 \ No newline at end of file
  4248 +}
  4249 +
  4250 +class AccountMap implements Comparator<Map<String, Object>>{
  4251 + @Override
  4252 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  4253 + // TODO Auto-generated method stub
  4254 + return o1.get("clZbh").toString().compareTo(o2.get("clZbh").toString());
  4255 + }
  4256 +}
  4257 +
  4258 +class AccountMap2 implements Comparator<Map<String, Object>>{
  4259 + @Override
  4260 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  4261 + // TODO Auto-generated method stub
  4262 + return o2.get("clZbh").toString().compareTo(o1.get("clZbh").toString());
  4263 + }
  4264 +}
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
@@ -866,7 +866,9 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -866,7 +866,9 @@ public class CulateMileageServiceImpl implements CulateMileageService{
866 ChildTaskPlan childTaskPlan = it.next(); 866 ChildTaskPlan childTaskPlan = it.next();
867 if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){ 867 if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){
868 if (childTaskPlan.isDestroy()) { 868 if (childTaskPlan.isDestroy()) {
869 - zrwjcclc=Arith.add(zrwjcclc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); 869 + if(childTaskPlan.getReason().equals(item)){
  870 + zrwjcclc=Arith.add(zrwjcclc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage());
  871 + }
870 } 872 }
871 } 873 }
872 } 874 }
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
1 package com.bsth.service.report.impl; 1 package com.bsth.service.report.impl;
2 -import java.sql.Connection;  
3 -import java.sql.PreparedStatement;  
4 -import java.sql.ResultSet;  
5 -import java.sql.SQLException;  
6 -import java.text.DecimalFormat;  
7 -import java.text.ParseException;  
8 -import java.text.SimpleDateFormat;  
9 -import java.util.ArrayList;  
10 -import java.util.Calendar;  
11 -import java.util.Collections;  
12 -import java.util.Date;  
13 -import java.util.HashMap;  
14 -import java.util.Iterator;  
15 -import java.util.List;  
16 -import java.util.Map;  
17 -import java.util.Set;  
18 -  
19 -import org.apache.commons.lang.StringUtils;  
20 -import org.dbunit.dataset.DataSetException;  
21 -import org.slf4j.Logger;  
22 -import org.slf4j.LoggerFactory;  
23 -import org.springframework.beans.factory.annotation.Autowired;  
24 -import org.springframework.jdbc.core.JdbcTemplate;  
25 -import org.springframework.jdbc.core.RowMapper;  
26 -import org.springframework.scheduling.commonj.ScheduledTimerListener;  
27 -import org.springframework.stereotype.Service;  
28 -  
29 import com.bsth.data.BasicData; 2 import com.bsth.data.BasicData;
30 import com.bsth.entity.Line; 3 import com.bsth.entity.Line;
31 import com.bsth.entity.Personnel; 4 import com.bsth.entity.Personnel;
32 import com.bsth.entity.StationRoute; 5 import com.bsth.entity.StationRoute;
33 import com.bsth.entity.excep.ArrivalInfo; 6 import com.bsth.entity.excep.ArrivalInfo;
34 -import com.bsth.entity.mcy_forms.Operationservice;  
35 import com.bsth.entity.oil.Dlb; 7 import com.bsth.entity.oil.Dlb;
36 import com.bsth.entity.oil.Ylb; 8 import com.bsth.entity.oil.Ylb;
37 import com.bsth.entity.realcontrol.ChildTaskPlan; 9 import com.bsth.entity.realcontrol.ChildTaskPlan;
38 import com.bsth.entity.realcontrol.ScheduleRealInfo; 10 import com.bsth.entity.realcontrol.ScheduleRealInfo;
39 -import com.bsth.entity.schedule.SchedulePlanInfo;  
40 import com.bsth.repository.LineRepository; 11 import com.bsth.repository.LineRepository;
41 import com.bsth.repository.StationRouteRepository; 12 import com.bsth.repository.StationRouteRepository;
42 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 13 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
@@ -44,7 +15,24 @@ import com.bsth.service.report.CulateMileageService; @@ -44,7 +15,24 @@ import com.bsth.service.report.CulateMileageService;
44 import com.bsth.service.report.ReportService; 15 import com.bsth.service.report.ReportService;
45 import com.bsth.util.Arith; 16 import com.bsth.util.Arith;
46 import com.bsth.util.ComparableJob; 17 import com.bsth.util.ComparableJob;
  18 +import com.bsth.util.ReportUtils;
47 import com.bsth.util.db.DBUtils_MS; 19 import com.bsth.util.db.DBUtils_MS;
  20 +import org.apache.commons.lang.StringUtils;
  21 +import org.slf4j.Logger;
  22 +import org.slf4j.LoggerFactory;
  23 +import org.springframework.beans.factory.annotation.Autowired;
  24 +import org.springframework.jdbc.core.JdbcTemplate;
  25 +import org.springframework.jdbc.core.RowMapper;
  26 +import org.springframework.stereotype.Service;
  27 +
  28 +import java.sql.Connection;
  29 +import java.sql.PreparedStatement;
  30 +import java.sql.ResultSet;
  31 +import java.sql.SQLException;
  32 +import java.text.DecimalFormat;
  33 +import java.text.ParseException;
  34 +import java.text.SimpleDateFormat;
  35 +import java.util.*;
48 36
49 @Service 37 @Service
50 public class ReportServiceImpl implements ReportService{ 38 public class ReportServiceImpl implements ReportService{
@@ -582,15 +570,15 @@ public class ReportServiceImpl implements ReportService{ @@ -582,15 +570,15 @@ public class ReportServiceImpl implements ReportService{
582 String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); 570 String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
583 571
584 //查询全程 572 //查询全程
585 - String sqlqc="select t.*,x.station_name as qdz_name from ( "  
586 - + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir FROM bsth_c_s_ttinfo_detail " 573 + String sqlqc="select t.* from ( "
  574 + + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
587 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') " 575 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
588 + " and fcsj <='"+minfcsj+"') " 576 + " and fcsj <='"+minfcsj+"') "
589 + " union " 577 + " union "
590 - + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir FROM bsth_c_s_ttinfo_detail " 578 + + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
591 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') " 579 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
592 + " and fcsj > '"+minfcsj+"') " 580 + " and fcsj > '"+minfcsj+"') "
593 - + "order by xl_dir,xh,fcsj ) t left join bsth_c_station x on t.qdz=x.id"; 581 + + "order by xl_dir,xh,fcsj ) t ";
594 List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc, 582 List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc,
595 new RowMapper<Map<String, String>>(){ 583 new RowMapper<Map<String, String>>(){
596 @Override 584 @Override
@@ -631,12 +619,12 @@ public class ReportServiceImpl implements ReportService{ @@ -631,12 +619,12 @@ public class ReportServiceImpl implements ReportService{
631 sxbc++; 619 sxbc++;
632 upfcsj.add(m.get("fcsj")); 620 upfcsj.add(m.get("fcsj"));
633 if(sxqdz.length() == 0 && m.containsKey("qdz_name")) 621 if(sxqdz.length() == 0 && m.containsKey("qdz_name"))
634 - sxqdz = m.get("qdz_name"); 622 + sxqdz = m.get("qdz_name")==null?"":m.get("qdz_name").toString();
635 } else { 623 } else {
636 xxbc++; 624 xxbc++;
637 downfcsj.add(m.get("fcsj")); 625 downfcsj.add(m.get("fcsj"));
638 if(xxqdz.length() == 0 && m.containsKey("qdz_name")) 626 if(xxqdz.length() == 0 && m.containsKey("qdz_name"))
639 - xxqdz = m.get("qdz_name"); 627 + xxqdz = m.get("qdz_name")==null?"":m.get("qdz_name").toString();
640 } 628 }
641 } 629 }
642 if(upfcsj.size() != 0) 630 if(upfcsj.size() != 0)
@@ -1459,7 +1447,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1459,7 +1447,6 @@ public class ReportServiceImpl implements ReportService{
1459 } 1447 }
1460 //所有班次信息 1448 //所有班次信息
1461 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); 1449 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
1462 -  
1463 line =line.trim(); 1450 line =line.trim();
1464 if(line.equals("")){ 1451 if(line.equals("")){
1465 //查询所有线路 1452 //查询所有线路
@@ -1469,7 +1456,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1469,7 +1456,6 @@ public class ReportServiceImpl implements ReportService{
1469 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); 1456 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
1470 } 1457 }
1471 1458
1472 -  
1473 String sql="select r.xl_bm" 1459 String sql="select r.xl_bm"
1474 + " from bsth_c_s_sp_info_real r where" 1460 + " from bsth_c_s_sp_info_real r where"
1475 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; 1461 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
@@ -1490,7 +1476,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1490,7 +1476,6 @@ public class ReportServiceImpl implements ReportService{
1490 return ve; 1476 return ve;
1491 } 1477 }
1492 }); 1478 });
1493 -  
1494 for (int i = 0; i < listLine.size(); i++) { 1479 for (int i = 0; i < listLine.size(); i++) {
1495 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); 1480 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
1496 String lineStr=listLine.get(i); 1481 String lineStr=listLine.get(i);
@@ -1511,6 +1496,22 @@ public class ReportServiceImpl implements ReportService{ @@ -1511,6 +1496,22 @@ public class ReportServiceImpl implements ReportService{
1511 Map<String, Object> newMap=staticTj(list,"f"); 1496 Map<String, Object> newMap=staticTj(list,"f");
1512 lMap.add(newMap); 1497 lMap.add(newMap);
1513 } 1498 }
  1499 + if(type.equals("export")){
  1500 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1501 + Map<String, Object> m = new HashMap<String, Object>();
  1502 + m.put("date", date);
  1503 + m.put("date1", date2);
  1504 + ReportUtils ee = new ReportUtils();
  1505 + try {
  1506 + listI.add(lMap.iterator());
  1507 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1508 + ee.excelReplace(listI, new Object[]{m}, path + "mould/countByLine.xls",
  1509 + path + "export/线路公里统计表.xls");
  1510 + } catch (Exception e) {
  1511 + // TODO: handle exception
  1512 + e.printStackTrace();
  1513 + }
  1514 + }
1514 return lMap; 1515 return lMap;
1515 } 1516 }
1516 1517
@@ -1533,6 +1534,8 @@ public class ReportServiceImpl implements ReportService{ @@ -1533,6 +1534,8 @@ public class ReportServiceImpl implements ReportService{
1533 if(list.size()>0){ 1534 if(list.size()>0){
1534 if(status.equals("f")){ 1535 if(status.equals("f")){
1535 map.put("xlName","合计"); 1536 map.put("xlName","合计");
  1537 + map.put("gs", "");
  1538 + map.put("fgs", "");
1536 }else{ 1539 }else{
1537 map.put("xlName", list.get(0).getXlName()); 1540 map.put("xlName", list.get(0).getXlName());
1538 map.put("gs", list.get(0).getGsName()); 1541 map.put("gs", list.get(0).getGsName());
@@ -1588,13 +1591,16 @@ public class ReportServiceImpl implements ReportService{ @@ -1588,13 +1591,16 @@ public class ReportServiceImpl implements ReportService{
1588 map.put("ssgl_other", culateService.culateSsMileXx(list, "其他")); 1591 map.put("ssgl_other", culateService.culateSsMileXx(list, "其他"));
1589 1592
1590 1593
1591 - double zrwjcclc=culateService.culateZrwJccLc(list, "");  
1592 - 1594 + double zrwjcclc=culateService.culateZrwJccLc(list, "故障");
  1595 + double zrwjcclc1=culateService.culateZrwJccLc(list, "肇事");
  1596 + double zrwjcclc2=culateService.culateZrwJccLc(list, "纠纷");
1593 map.put("zrwjcclc", zrwjcclc); 1597 map.put("zrwjcclc", zrwjcclc);
1594 - 1598 + map.put("zrwjcclc1", zrwjcclc1);
  1599 + map.put("zrwjcclc2", zrwjcclc2);
  1600 + double zrwjcc=Arith.add(Arith.add(zrwjcclc, zrwjcclc1), zrwjcclc2);
1595 double kfks=culateService.culateKfksLc(lists); 1601 double kfks=culateService.culateKfksLc(lists);
1596 map.put("kfks", kfks); 1602 map.put("kfks", kfks);
1597 - double zlc=Arith.add(Arith.add(Arith.add(zrwjcclc, ljlc), 1603 + double zlc=Arith.add(Arith.add(Arith.add(zrwjcc, ljlc),
1598 Arith.add(zjcclc, zyylc)),kfks); 1604 Arith.add(zjcclc, zyylc)),kfks);
1599 1605
1600 1606
@@ -1659,7 +1665,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1659,7 +1665,6 @@ public class ReportServiceImpl implements ReportService{
1659 ylbSql += " and xlbm = '"+line+"'"; 1665 ylbSql += " and xlbm = '"+line+"'";
1660 } 1666 }
1661 List<Ylb> ylbList=ylbList(ylbSql); 1667 List<Ylb> ylbList=ylbList(ylbSql);
1662 -  
1663 String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+date+"' and '"+date2+"'"; 1668 String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+date+"' and '"+date2+"'";
1664 if(line.equals("")){ 1669 if(line.equals("")){
1665 dlbSql +="and ssgsdm='"+gsdm+"' " 1670 dlbSql +="and ssgsdm='"+gsdm+"' "
@@ -1668,7 +1673,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1668,7 +1673,6 @@ public class ReportServiceImpl implements ReportService{
1668 dlbSql += " and xlbm = '"+line+"'"; 1673 dlbSql += " and xlbm = '"+line+"'";
1669 } 1674 }
1670 List<Dlb> dlbList=dlbList(dlbSql); 1675 List<Dlb> dlbList=dlbList(dlbSql);
1671 -  
1672 String sql="select r.xl_bm,r.schedule_date_str,r.cl_zbh,r.j_gh,r.s_gh" 1676 String sql="select r.xl_bm,r.schedule_date_str,r.cl_zbh,r.j_gh,r.s_gh"
1673 + " from bsth_c_s_sp_info_real r where" 1677 + " from bsth_c_s_sp_info_real r where"
1674 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; 1678 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
@@ -1692,7 +1696,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1692,7 +1696,6 @@ public class ReportServiceImpl implements ReportService{
1692 return map; 1696 return map;
1693 } 1697 }
1694 }); 1698 });
1695 -  
1696 for (int i = 0; i < listGroupBy.size(); i++) { 1699 for (int i = 0; i < listGroupBy.size(); i++) {
1697 Map<String, Object> m=listGroupBy.get(i); 1700 Map<String, Object> m=listGroupBy.get(i);
1698 String xl_bm=m.get("line")==null?"":m.get("line").toString(); 1701 String xl_bm=m.get("line")==null?"":m.get("line").toString();
@@ -1795,7 +1798,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1795,7 +1798,6 @@ public class ReportServiceImpl implements ReportService{
1795 } 1798 }
1796 1799
1797 } 1800 }
1798 -  
1799 if(!zt.equals("zbh")){ 1801 if(!zt.equals("zbh")){
1800 String sqls="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh" 1802 String sqls="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh"
1801 + " from bsth_c_s_sp_info_real r where" 1803 + " from bsth_c_s_sp_info_real r where"
@@ -1822,6 +1824,28 @@ public class ReportServiceImpl implements ReportService{ @@ -1822,6 +1824,28 @@ public class ReportServiceImpl implements ReportService{
1822 lMap=lists(listGroupBys, lMaps, gsdm, fgsdm, date, date2); 1824 lMap=lists(listGroupBys, lMaps, gsdm, fgsdm, date, date2);
1823 1825
1824 } 1826 }
  1827 + if(type.equals("export")){
  1828 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1829 + Map<String, Object> m = new HashMap<String, Object>();
  1830 + m.put("date", date);
  1831 + m.put("date1", date2);
  1832 + String xls="";
  1833 + if(zt.equals("zbh")){
  1834 + xls="countByBus1.xls";
  1835 + }else{
  1836 + xls="countByBus2.xls";
  1837 + }
  1838 + ReportUtils ee = new ReportUtils();
  1839 + try {
  1840 + listI.add(lMap.iterator());
  1841 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1842 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  1843 + path + "export/路单数据统计表.xls");
  1844 + } catch (Exception e) {
  1845 + // TODO: handle exception
  1846 + e.printStackTrace();
  1847 + }
  1848 + }
1825 1849
1826 return lMap; 1850 return lMap;
1827 } 1851 }
@@ -1831,6 +1855,7 @@ public class ReportServiceImpl implements ReportService{ @@ -1831,6 +1855,7 @@ public class ReportServiceImpl implements ReportService{
1831 @Override 1855 @Override
1832 public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException { 1856 public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException {
1833 Ylb y = new Ylb(); 1857 Ylb y = new Ylb();
  1858 + y.setRq(arg0.getDate("rq"));
1834 y.setXlbm(arg0.getString("xlbm")); 1859 y.setXlbm(arg0.getString("xlbm"));
1835 y.setNbbm(arg0.getString("nbbm")); 1860 y.setNbbm(arg0.getString("nbbm"));
1836 y.setJzl(arg0.getDouble("jzl")); 1861 y.setJzl(arg0.getDouble("jzl"));
@@ -1847,6 +1872,7 @@ public class ReportServiceImpl implements ReportService{ @@ -1847,6 +1872,7 @@ public class ReportServiceImpl implements ReportService{
1847 @Override 1872 @Override
1848 public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException { 1873 public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException {
1849 Dlb y = new Dlb(); 1874 Dlb y = new Dlb();
  1875 + y.setRq(arg0.getDate("rq"));
1850 y.setXlbm(arg0.getString("xlbm")); 1876 y.setXlbm(arg0.getString("xlbm"));
1851 y.setNbbm(arg0.getString("nbbm")); 1877 y.setNbbm(arg0.getString("nbbm"));
1852 y.setCdl(arg0.getDouble("cdl")); 1878 y.setCdl(arg0.getDouble("cdl"));
src/main/java/com/bsth/service/traffic/YgcBasicDataService.java
@@ -9,5 +9,13 @@ public interface YgcBasicDataService { @@ -9,5 +9,13 @@ public interface YgcBasicDataService {
9 * 更新运管处基础数据 9 * 更新运管处基础数据
10 */ 10 */
11 void updateYgcBasicData(); 11 void updateYgcBasicData();
  12 +
  13 + /**
  14 + * 调用方法
  15 + * @param methodName 方法名
  16 + * @param param 参数
  17 + * @return
  18 + */
  19 + String invokeMethod(String methodName,String param);
12 } 20 }
13 21
src/main/java/com/bsth/service/traffic/impl/YgcBasicDataServiceImpl.java
@@ -7,6 +7,7 @@ import org.apache.axiom.om.*; @@ -7,6 +7,7 @@ import org.apache.axiom.om.*;
7 import org.apache.axis2.addressing.EndpointReference; 7 import org.apache.axis2.addressing.EndpointReference;
8 import org.apache.axis2.client.Options; 8 import org.apache.axis2.client.Options;
9 import org.apache.axis2.client.ServiceClient; 9 import org.apache.axis2.client.ServiceClient;
  10 +import org.apache.axis2.rpc.client.RPCServiceClient;
10 import org.apache.commons.codec.digest.DigestUtils; 11 import org.apache.commons.codec.digest.DigestUtils;
11 import org.slf4j.Logger; 12 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 13 import org.slf4j.LoggerFactory;
@@ -18,6 +19,7 @@ import org.w3c.dom.Document; @@ -18,6 +19,7 @@ import org.w3c.dom.Document;
18 import org.w3c.dom.NodeList; 19 import org.w3c.dom.NodeList;
19 20
20 import javax.activation.DataHandler; 21 import javax.activation.DataHandler;
  22 +import javax.xml.namespace.QName;
21 import javax.xml.parsers.DocumentBuilder; 23 import javax.xml.parsers.DocumentBuilder;
22 import javax.xml.parsers.DocumentBuilderFactory; 24 import javax.xml.parsers.DocumentBuilderFactory;
23 import java.io.*; 25 import java.io.*;
@@ -42,14 +44,17 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ @@ -42,14 +44,17 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
42 JdbcTemplate jdbcTemplate; 44 JdbcTemplate jdbcTemplate;
43 45
44 private static String IP = "218.242.195.76:9091"; 46 private static String IP = "218.242.195.76:9091";
45 - private static String targetEndpoint = "http://" + IP +"/ygc.TransManager.Basicdown?wsdl"; 47 + private static String downTargetEndpoint = "http://" + IP +"/ygc.TransManager.Basicdown?wsdl";
  48 + private static String upTargetEndpoint = "http://" + IP +"/ygc.TransManager.BasicUpload?wsdl";
46 private static String namespace = "http://service.shygc.com"; 49 private static String namespace = "http://service.shygc.com";
47 private static String userName = "admin"; 50 private static String userName = "admin";
48 private static String passWord = "000000"; 51 private static String passWord = "000000";
49 - private static EndpointReference targetEPR; 52 + private static EndpointReference downTargetEPR;
  53 + private static EndpointReference upTargetEPR;
50 { 54 {
51 try { 55 try {
52 - targetEPR = new EndpointReference(targetEndpoint); 56 + downTargetEPR = new EndpointReference(downTargetEndpoint);
  57 + upTargetEPR = new EndpointReference(upTargetEndpoint);
53 } catch (Exception e) { 58 } catch (Exception e) {
54 e.printStackTrace(); 59 e.printStackTrace();
55 } 60 }
@@ -102,7 +107,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ @@ -102,7 +107,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
102 ServiceClient sender = new ServiceClient(); 107 ServiceClient sender = new ServiceClient();
103 Options options = sender.getOptions(); 108 Options options = sender.getOptions();
104 options.setProperty("SO_TIMEOUT", Integer.valueOf(1800000)); 109 options.setProperty("SO_TIMEOUT", Integer.valueOf(1800000));
105 - options.setTo(targetEPR); 110 + options.setTo(downTargetEPR);
106 sender.setOptions(options); 111 sender.setOptions(options);
107 System.out.println("The data in method download: " + data); 112 System.out.println("The data in method download: " + data);
108 data.build(); 113 data.build();
@@ -280,4 +285,37 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ @@ -280,4 +285,37 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
280 flag = true; 285 flag = true;
281 return flag; 286 return flag;
282 } 287 }
  288 +
  289 + /**
  290 + * 调用方法
  291 + * @param methodName 方法名
  292 + * @param param 参数
  293 + * @return
  294 + */
  295 + public String invokeMethod(String methodName,String param){
  296 + String result = null;
  297 + try {
  298 + // 获得客户端
  299 + RPCServiceClient serviceClient = new RPCServiceClient();
  300 + // 可以在该对象中设置服务端的验证信息
  301 + Options options = serviceClient.getOptions();
  302 + options.setTo(upTargetEPR);
  303 + // 在创建QName对象时,QName类的构造方法的第一个参数表示WSDL文件的命名空间名,也就是<wsdl:definitions>元素的targetNamespace属性值
  304 + QName opAddEntry = new QName(namespace,methodName);
  305 + // 参数,如果有多个,继续往后面增加即可,不用指定参数的名称
  306 + Object[] opAddEntryArgs = new Object[] {param };
  307 + // 返回参数类型,这个和axis1有点区别
  308 + // invokeBlocking方法有三个参数,其中第一个参数的类型是QName对象,表示要调用的方法名;
  309 + // 第二个参数表示要调用的WebService方法的参数值,参数类型为Object[];
  310 + // 第三个参数表示WebService方法的返回值类型的Class对象,参数类型为Class[]。
  311 + // 当方法没有参数时,invokeBlocking方法的第二个参数值不能是null,而要使用new Object[]{}
  312 + // 如果被调用的WebService方法没有返回值,应使用RPCServiceClient类的invokeRobust方法,
  313 + // 该方法只有两个参数,它们的含义与invokeBlocking方法的前两个参数的含义相同
  314 + Class[] classes = new Class[] { String.class };
  315 + result = serviceClient.invokeBlocking(opAddEntry,opAddEntryArgs, classes)[0].toString();
  316 + }catch (Exception e){
  317 + e.printStackTrace();
  318 + }
  319 + return result;
  320 + }
283 } 321 }
src/main/resources/static/pages/base/line/add.html
@@ -228,7 +228,14 @@ @@ -228,7 +228,14 @@
228 </div> 228 </div>
229 </div> 229 </div>
230 <!-- 是否营运 END --> 230 <!-- 是否营运 END -->
231 - 231 + <!-- 权证车辆数 START -->
  232 + <div class="col-md-6">
  233 + <label class="control-label col-md-5"> 权证车辆数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  234 + <div class="col-md-4">
  235 + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数">
  236 + </div>
  237 + </div>
  238 + <!-- 权证车辆数 END -->
232 239
233 </div> 240 </div>
234 <!-- 表单分组组件 form-group END --> 241 <!-- 表单分组组件 form-group END -->
src/main/resources/static/pages/base/line/details.html
@@ -220,7 +220,14 @@ @@ -220,7 +220,14 @@
220 </div> 220 </div>
221 </div> 221 </div>
222 <!-- 是否营运 END --> 222 <!-- 是否营运 END -->
223 - 223 + <!-- 权证车辆数 START -->
  224 + <div class="col-md-6">
  225 + <label class="control-label col-md-5"> 权证车辆数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  226 + <div class="col-md-4">
  227 + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数">
  228 + </div>
  229 + </div>
  230 + <!-- 权证车辆数 END -->
224 231
225 </div> 232 </div>
226 <!-- 表单分组组件 form-group END --> 233 <!-- 表单分组组件 form-group END -->
src/main/resources/static/pages/base/line/edit.html
@@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
43 <!-- 表单内容 START --> 43 <!-- 表单内容 START -->
44 <div class="form-body"> 44 <div class="form-body">
45 <input type="hidden" name="id" id="lineId"> 45 <input type="hidden" name="id" id="lineId">
46 - 46 + <input type="hidden" name="inUse" id="inUse">
47 <!-- 表单分组组件 form-group START --> 47 <!-- 表单分组组件 form-group START -->
48 <div class="form-group"> 48 <div class="form-group">
49 <!-- 线路编码 (* 必填项) START --> 49 <!-- 线路编码 (* 必填项) START -->
@@ -229,7 +229,14 @@ @@ -229,7 +229,14 @@
229 </div> 229 </div>
230 <!-- 是否营运 END --> 230 <!-- 是否营运 END -->
231 231
232 - 232 + <!-- 权证车辆数 START -->
  233 + <div class="col-md-6">
  234 + <label class="control-label col-md-5"> 权证车辆数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  235 + <div class="col-md-4">
  236 + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数">
  237 + </div>
  238 + </div>
  239 + <!-- 权证车辆数 END -->
233 </div> 240 </div>
234 <!-- 表单分组组件 form-group END --> 241 <!-- 表单分组组件 form-group END -->
235 <!-- 表单分组组件 form-group START --> 242 <!-- 表单分组组件 form-group START -->
src/main/resources/static/pages/base/line/js/line-add-form.js
@@ -116,6 +116,7 @@ $(function(){ @@ -116,6 +116,7 @@ $(function(){
116 'carSumNumber' : {number : true,digits : true,maxlength: 8},// 车辆总数 必须输入合法的数字(负数,小数)。必须输入整数。最大长度. 116 'carSumNumber' : {number : true,digits : true,maxlength: 8},// 车辆总数 必须输入合法的数字(负数,小数)。必须输入整数。最大长度.
117 'hvacCarNumber' : {number : true,digits : true,maxlength: 8},// 空调车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。 最大长度. 117 'hvacCarNumber' : {number : true,digits : true,maxlength: 8},// 空调车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。 最大长度.
118 'ordCarNumber' : {number : true,digits : true,maxlength: 8},// 普通车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。最大长度. 118 'ordCarNumber' : {number : true,digits : true,maxlength: 8},// 普通车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。最大长度.
  119 + 'warrantCar' : {number : true,digits : true,maxlength: 8},
119 'history' : {maxlength: 200},// 线路沿革 输入长度最多是 200 的字符串(汉字算一个字符)。 120 'history' : {maxlength: 200},// 线路沿革 输入长度最多是 200 的字符串(汉字算一个字符)。
120 'descriptions' : {maxlength: 200}// 描述/说明 输入长度最多是 200 的字符串(汉字算一个字符)。 121 'descriptions' : {maxlength: 200}// 描述/说明 输入长度最多是 200 的字符串(汉字算一个字符)。
121 }, 122 },
src/main/resources/static/pages/base/line/js/line-edit-form.js
@@ -171,6 +171,7 @@ @@ -171,6 +171,7 @@
171 'carSumNumber' : {number : true,digits : true,maxlength: 8},// 车辆总数 必须输入合法的数字(负数,小数)。必须输入整数。最大长度. 171 'carSumNumber' : {number : true,digits : true,maxlength: 8},// 车辆总数 必须输入合法的数字(负数,小数)。必须输入整数。最大长度.
172 'hvacCarNumber' : {number : true,digits : true,maxlength: 8},// 空调车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。 最大长度. 172 'hvacCarNumber' : {number : true,digits : true,maxlength: 8},// 空调车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。 最大长度.
173 'ordCarNumber' : {number : true,digits : true,maxlength: 8},// 普通车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。最大长度. 173 'ordCarNumber' : {number : true,digits : true,maxlength: 8},// 普通车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。最大长度.
  174 + 'warrantCar' : {number : true,digits : true,maxlength: 8},
174 'history' : {maxlength: 200},// 线路沿革 输入长度最多是 200 的字符串(汉字算一个字符)。 175 'history' : {maxlength: 200},// 线路沿革 输入长度最多是 200 的字符串(汉字算一个字符)。
175 'descriptions' : {maxlength: 200}// 描述/说明 输入长度最多是 200 的字符串(汉字算一个字符)。 176 'descriptions' : {maxlength: 200}// 描述/说明 输入长度最多是 200 的字符串(汉字算一个字符)。
176 }, 177 },
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
@@ -382,13 +382,14 @@ var BaseFun = function() { @@ -382,13 +382,14 @@ var BaseFun = function() {
382 * 382 *
383 * 383 *
384 **/ 384 **/
385 - abstractBcByWorkTime : function(bxlpbc , map , dataMap , saa , cara , bxrcObj , dgminpcs ,deletebcNum) { 385 + abstractBcByWorkTime : function(bxlpbc , map , dataMap , saa , cara , bxrcObj , dgminpcs ,deletebcNum ,zwxeLpNum) {
386 var rsultA = new Array() , dgzjsj = baseF.getDateTime('13:00'); 386 var rsultA = new Array() , dgzjsj = baseF.getDateTime('13:00');
387 // 定义13:00 ~ 晚高峰开始以前剔除规则. 如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次. 387 // 定义13:00 ~ 晚高峰开始以前剔除规则. 如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次.
388 var xwmaxtcbcNum = parseInt(( dataMap.wgfsjd[0].st - dgzjsj) / (60000 * saa[0].zzsj.dgzzsj)); 388 var xwmaxtcbcNum = parseInt(( dataMap.wgfsjd[0].st - dgzjsj) / (60000 * saa[0].zzsj.dgzzsj));
389 // 定义早高峰结束 ~ 13:00 剔除规则.如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次. 389 // 定义早高峰结束 ~ 13:00 剔除规则.如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次.
390 var swmaxtcbcNum = parseInt(( dgzjsj - dataMap.zgfsjd[0].ed) / (60000 * saa[0].zzsj.dgzzsj)); 390 var swmaxtcbcNum = parseInt(( dgzjsj - dataMap.zgfsjd[0].ed) / (60000 * saa[0].zzsj.dgzzsj));
391 var sumGs = 0; 391 var sumGs = 0;
  392 + dgminpcs = zwxeLpNum==0 ? bxlpbc.length : dgminpcs;
392 for(var a = 0 ; a < bxlpbc.length ; a++) { 393 for(var a = 0 ; a < bxlpbc.length ; a++) {
393 // 定义该版型下对应的路牌的班次数组、班次数组长度、该路牌上是否有首末班车。 394 // 定义该版型下对应的路牌的班次数组、班次数组长度、该路牌上是否有首末班车。
394 var lpbc = bxlpbc[a].lpbc, lpbclen_ = lpbc.length; 395 var lpbc = bxlpbc[a].lpbc, lpbclen_ = lpbc.length;
@@ -396,6 +397,7 @@ var BaseFun = function() { @@ -396,6 +397,7 @@ var BaseFun = function() {
396 continue; 397 continue;
397 var isFlag = baseF.lpDownIsHaveFirstAndLastBc(lpbc , dataMap.smbcsjArr) , tcbcgzA = new Array(); 398 var isFlag = baseF.lpDownIsHaveFirstAndLastBc(lpbc , dataMap.smbcsjArr) , tcbcgzA = new Array();
398 if(bxrcObj.type == '五工二休') { 399 if(bxrcObj.type == '五工二休') {
  400 + // continue;
399 // 定义晚高峰后能剔除多少班次数. 401 // 定义晚高峰后能剔除多少班次数.
400 var wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfsjd[0].ed ) / (60000 * saa[0].zzsj.dgzzsj)); 402 var wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfsjd[0].ed ) / (60000 * saa[0].zzsj.dgzzsj));
401 if(isFlag) { 403 if(isFlag) {
@@ -409,11 +411,12 @@ var BaseFun = function() { @@ -409,11 +411,12 @@ var BaseFun = function() {
409 // 剔除不在高峰时间段内的班次. 411 // 剔除不在高峰时间段内的班次.
410 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , 'desc' , false); 412 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , 'desc' , false);
411 }else { 413 }else {
  414 + //continue;
412 // 单档 一个路牌一档劳动力 415 // 单档 一个路牌一档劳动力
413 if(bxlpbc[a].keepOff==1) { 416 if(bxlpbc[a].keepOff==1) {
414 // 如果低谷至少配车数大于零,则该班型下的路牌 存在一些 分班路牌,这里的分班 指的是 这个路牌先满足的前提条件就是 是单档。 417 // 如果低谷至少配车数大于零,则该班型下的路牌 存在一些 分班路牌,这里的分班 指的是 这个路牌先满足的前提条件就是 是单档。
415 - // 为了满足工时的要求,在低谷断开一段时间.  
416 - if(dgminpcs > 0) { 418 + // 为了满足工时的要求,在低谷断开一段时间.a <= dgminpcs
  419 + if(a <= dgminpcs) {
417 if( a % 2 == 0) { 420 if( a % 2 == 0) {
418 if(deletebcNum < swmaxtcbcNum || isFlag) { 421 if(deletebcNum < swmaxtcbcNum || isFlag) {
419 tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum}); 422 tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum});
@@ -433,10 +436,10 @@ var BaseFun = function() { @@ -433,10 +436,10 @@ var BaseFun = function() {
433 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , true); 436 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , true);
434 baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , true , a); 437 baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , true , a);
435 // 该班型下的路牌 不存在分班路牌. 438 // 该班型下的路牌 不存在分班路牌.
436 - }else if(dgminpcs == 0){ 439 + }else {
437 // 按规则剔除班次.不分班.路牌班次不会断开. 440 // 按规则剔除班次.不分班.路牌班次不会断开.
438 baseF.isdk02(lpbc , dataMap , saa , deletebcNum , false); 441 baseF.isdk02(lpbc , dataMap , saa , deletebcNum , false);
439 - //baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , false , a); 442 + baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , false , a);
440 } 443 }
441 // 双档 一个路牌两档劳动力 444 // 双档 一个路牌两档劳动力
442 }else if(bxlpbc[a].keepOff==2) { 445 }else if(bxlpbc[a].keepOff==2) {
@@ -459,8 +462,8 @@ var BaseFun = function() { @@ -459,8 +462,8 @@ var BaseFun = function() {
459 var markAfterGs = baseF.getSumWorkTime(tList , dataMap, saa); 462 var markAfterGs = baseF.getSumWorkTime(tList , dataMap, saa);
460 var gsDx = parseFloat((markAfterGs - bzgs).toFixed(2)); 463 var gsDx = parseFloat((markAfterGs - bzgs).toFixed(2));
461 lpbc.sort(function(m,n){return m.fcno-n.fcno}); 464 lpbc.sort(function(m,n){return m.fcno-n.fcno});
462 - if(isOff) {  
463 - if(gsDx > 1.5) { 465 + if(gsDx > 1.5) {
  466 + if(isOff) {
464 var hoursDx = parseFloat((gsDx - 1.5).toFixed(2)); 467 var hoursDx = parseFloat((gsDx - 1.5).toFixed(2));
465 // console.log(gsDx , hoursDx ,Math.ceil(hoursDx*60)); 468 // console.log(gsDx , hoursDx ,Math.ceil(hoursDx*60));
466 var minueDx = Math.ceil(hoursDx*60); 469 var minueDx = Math.ceil(hoursDx*60);
@@ -471,14 +474,15 @@ var BaseFun = function() { @@ -471,14 +474,15 @@ var BaseFun = function() {
471 lpbc.splice( (s+1) , bs*2); 474 lpbc.splice( (s+1) , bs*2);
472 }else { 475 }else {
473 lpbc.splice( s , bs*2); 476 lpbc.splice( s , bs*2);
  477 + lpbc[s-bs*2 +1].isfb = 1;
  478 + lpbc[s-bs*2 +1].STOPTIME = 0;
474 } 479 }
475 break; 480 break;
476 } 481 }
477 } 482 }
  483 + }else {
478 484
479 } 485 }
480 - }else {  
481 -  
482 } 486 }
483 }, 487 },
484 488
@@ -606,8 +610,10 @@ var BaseFun = function() { @@ -606,8 +610,10 @@ var BaseFun = function() {
606 // 判断是否在高峰时间范围.【true--表示在,false--表示不在】. 610 // 判断是否在高峰时间范围.【true--表示在,false--表示不在】.
607 if(!baseF.isPeakTimeScope(fcsj,dataMap) && fcsj > tcbcgzA[t].minsj && fcsj < tcbcgzA[t].maxsj) { 611 if(!baseF.isPeakTimeScope(fcsj,dataMap) && fcsj > tcbcgzA[t].minsj && fcsj < tcbcgzA[t].maxsj) {
608 if(order == 'asc') { 612 if(order == 'asc') {
609 - arr[a-1].isfb = isfb ? 1 : 0;  
610 - arr[a-1].STOPTIME = 0; 613 + if(a>0) {
  614 + arr[a-1].isfb = isfb ? 1 : 0;
  615 + arr[a-1].STOPTIME = 0;
  616 + }
611 }else if(order == 'desc') { 617 }else if(order == 'desc') {
612 var index_ = a + tcbcgzA[t].deletebcNum * 2; 618 var index_ = a + tcbcgzA[t].deletebcNum * 2;
613 arr[index_].STOPTIME = 0; 619 arr[index_].STOPTIME = 0;
@@ -636,6 +642,7 @@ var BaseFun = function() { @@ -636,6 +642,7 @@ var BaseFun = function() {
636 dgmaxtzsj = parseInt(map.dgmaxtzsj); 642 dgmaxtzsj = parseInt(map.dgmaxtzsj);
637 // 计算低谷最少配车数 (低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙. 643 // 计算低谷最少配车数 (低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙.
638 var dgminpcs = Math.round((dataMap.dgxxsjArr[0] + dataMap.dgxxsjArr[1] + dataMap.dgtzsj[0] + dataMap.dgtzsj[1]) / dgmaxfcjx); 644 var dgminpcs = Math.round((dataMap.dgxxsjArr[0] + dataMap.dgxxsjArr[1] + dataMap.dgtzsj[0] + dataMap.dgtzsj[1]) / dgmaxfcjx);
  645 + var zwxeLpNum = baseF.cuontZwxeLpNum(bxrclist);
639 // var dgminpcs = 4; 646 // var dgminpcs = 4;
640 // 定义返回数组. 647 // 定义返回数组.
641 var rs = new Array(); 648 var rs = new Array();
@@ -710,12 +717,23 @@ var BaseFun = function() { @@ -710,12 +717,23 @@ var BaseFun = function() {
710 avgMakerCarNum = parseInt(avgMakerCarNum / bxlpbc.length); 717 avgMakerCarNum = parseInt(avgMakerCarNum / bxlpbc.length);
711 // console.log(bxlpbc); 718 // console.log(bxlpbc);
712 // 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班. 719 // 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班.
713 - rs = rs.concat(baseF.abstractBcByWorkTime(bxlpbc , map , dataMap , saa , cara , bxrclist[x] , dgminpcs , avgMakerCarNum)); 720 + rs = rs.concat(baseF.abstractBcByWorkTime(bxlpbc , map , dataMap , saa , cara , bxrclist[x] , dgminpcs , avgMakerCarNum ,zwxeLpNum));
714 } 721 }
715 } 722 }
716 return rs; 723 return rs;
717 }, 724 },
718 725
  726 + cuontZwxeLpNum : function(list) {
  727 + var count = 0;
  728 + for(var c = 0 ; c<list.length;c++) {
  729 + if(list[c].type == '五工二休') {
  730 + count = list[c].fpcls;
  731 + break;
  732 + }
  733 + }
  734 + return count;
  735 + },
  736 +
719 /** 737 /**
720 * @description (TODO) 更新路牌数组的路牌名称. 738 * @description (TODO) 更新路牌数组的路牌名称.
721 * @param cara 路牌数组 739 * @param cara 路牌数组
@@ -762,7 +780,11 @@ var BaseFun = function() { @@ -762,7 +780,11 @@ var BaseFun = function() {
762 * 相同班型下的日平均工时满足 参数的日平均工时 范围在 [10分钟]内浮动. 780 * 相同班型下的日平均工时满足 参数的日平均工时 范围在 [10分钟]内浮动.
763 * 781 *
764 * 782 *
765 - * 第七步 确定吃饭时间. 783 + * 第七步 确定吃饭时间(吃时间初步定位20分钟). 一般情况下
  784 + *
  785 + * 早餐 :10:15以后到12:30之间用餐的12:30是指用餐结束时间哦.
  786 + *
  787 + * 午餐 :一般在18:00以后在19:00以前.
766 * 788 *
767 * 第八步 确定进出场、早晚例保时间. 789 * 第八步 确定进出场、早晚例保时间.
768 * 790 *
@@ -771,19 +793,17 @@ var BaseFun = function() { @@ -771,19 +793,17 @@ var BaseFun = function() {
771 BXPplaceClassesTime02 : function(saa , cara , map , seMap , dataMap) { 793 BXPplaceClassesTime02 : function(saa , cara , map , seMap , dataMap) {
772 794
773 // 第一步 根据表单中的参数得到所有路牌下的班次数[从各路牌下的第一个班次发车时间 到 营运结束时间点并且是连续的班次数]. 795 // 第一步 根据表单中的参数得到所有路牌下的班次数[从各路牌下的第一个班次发车时间 到 营运结束时间点并且是连续的班次数].
774 - var jsonArray = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap);  
775 - 796 + var allLMapBc = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap);
  797 +
776 // 第二步 纵向调整 798 // 第二步 纵向调整
777 - baseF.evenStartDepartSpace(jsonArray , dataMap); 799 + baseF.evenStartDepartSpace(allLMapBc , dataMap);
778 800
779 // 第三步 剔除首末班车以外的班次,并确认首末班车. 801 // 第三步 剔除首末班车以外的班次,并确认首末班车.
780 - var markArray = baseF.markFirstAndLastBusAlsoDietNotInRangeBc(jsonArray , dataMap);  
781 - 802 + var markArray = baseF.markFirstAndLastBusAlsoDietNotInRangeBc(allLMapBc , dataMap);
  803 + // return {'json':markArray,'bxrcgs':null};
782 // 第四步 横向调整 804 // 第四步 横向调整
783 baseF.resizeByPitStopTime(cara , markArray , dataMap); 805 baseF.resizeByPitStopTime(cara , markArray , dataMap);
784 -  
785 // return {'json':markArray,'bxrcgs':null}; 806 // return {'json':markArray,'bxrcgs':null};
786 -  
787 /** 807 /**
788 * 第五步 把班型合理的分配到各个路牌上. 808 * 第五步 把班型合理的分配到各个路牌上.
789 * 809 *
@@ -797,7 +817,132 @@ var BaseFun = function() { @@ -797,7 +817,132 @@ var BaseFun = function() {
797 baseF.bxAlloTotLp(list,cara); 817 baseF.bxAlloTotLp(list,cara);
798 // 第六步 抽车来满足工时. 818 // 第六步 抽车来满足工时.
799 var tempA = baseF.abstractCar(list , markArray , cara , saa , dataMap , map); 819 var tempA = baseF.abstractCar(list , markArray , cara , saa , dataMap , map);
800 - return {'json':baseF.addjcclcbc01(cara,tempA,dataMap,saa,map),'bxrcgs':null}; 820 + // return {'json':tempA,'bxrcgs':null};
  821 + // 第七步 确定吃饭时间.
  822 + baseF.markeEatTime(list , tempA , cara , saa , dataMap ,map);
  823 + baseF.resizeByPitStopTime(cara , tempA , dataMap);
  824 + baseF.updfcno01(tempA,0);
  825 + // return {'json':tempA,'bxrcgs':null};
  826 + // 确定进出场、早晚例保时间.并返回班次数组集合
  827 + return {'json':baseF.addInOutFieldBc(cara,tempA,dataMap,saa,map),'bxrcgs':null};
  828 + },
  829 +
  830 + markeEatTime : function(list , markArray , cara , saa , dataMap ,map) {
  831 + var cfddDm = parseInt(map.cfdd);
  832 + var mLen = markArray.length,cLen=cara.length,sLen =list.length ;
  833 + if(mLen<=0 || cLen<=0 || sLen<=0)
  834 + return false;
  835 + for(var c = 0 ; c<cLen ; c++) {
  836 + var lpNo=cara[c].lpNo,lpType;
  837 + for(var s = 0 ; s<sLen;s++ ) {
  838 + if(list[s].sslp[0].lpNo==lpNo) {
  839 + lpType = list[s].type;
  840 + break;
  841 + }
  842 + }
  843 + if(lpType=='五工二休')
  844 + continue;
  845 + var lpbcArray = new Array();
  846 + for(var m = 0 ; m < mLen; m++) {
  847 + if(markArray[m].lpNo==lpNo)
  848 + lpbcArray.push(markArray[m]);
  849 + }
  850 + lpbcArray.sort(function(a,b){return a.fcint - b.fcint});
  851 + baseF.isHaveBc(baseF.getDateTime('10:15') , baseF.getDateTime('12:15'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 0);
  852 + baseF.isHaveBc(baseF.getDateTime('18:00') , baseF.getDateTime('19:00'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 1);
  853 + }
  854 + },
  855 +
  856 + isHaveBc : function(kssj , jssj , bcArray,cfddDm , dataMap , lpObj , map, markArray , cfIndex) {
  857 + var canCf = new Array(), countTzsj = 0, isLast = new Array();
  858 + for(var b = 0 ; b<bcArray.length;b++) {
  859 + var bcddsj = baseF.getDateTime(bcArray[b].ARRIVALTIME);
  860 + if(bcddsj<=jssj) {
  861 + countTzsj += bcArray[b].STOPTIME;
  862 + canCf.push(bcArray[b]);
  863 + }
  864 + /*if(bcddsj>= kssj && bcddsj<=jssj) {
  865 + countTzsj += bcArray[b].STOPTIME;
  866 + canCf.push(bcArray[b]);
  867 + }
  868 + if(bcddsj < kssj)
  869 + isLast.push(bcArray[b]);*/
  870 + }
  871 + if(canCf.length>0) {
  872 + console.log('countTzsj:' + countTzsj + 'length:' + canCf.length);
  873 + var fxDm = baseF.dirDmToIndex(canCf[canCf.length-1].xlDir);
  874 + // console.log(countTzsj , canCf[canCf.length-1].fcsj);
  875 + if(cfddDm == fxDm && canCf.length>2) {
  876 + var tzdx = canCf[canCf.length-2].STOPTIME - dataMap.zwcArr[cfIndex];
  877 + canCf[canCf.length-2].STOPTIME = tzdx >= 0 ? tzdx : 0;
  878 + var obj = baseF.getbcObj(
  879 + baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  880 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  881 + markArray.push(obj);
  882 + if(tzdx<0) {
  883 + // canCf[canCf.length-1].STOPTIME = 0;
  884 + var fcsj = baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME);
  885 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-2].STOPTIME + dataMap.zwcArr[cfIndex]);
  886 + canCf[canCf.length-1].fcsj = baseF.getTimeStr(fcsj);
  887 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-1].bcsj);
  888 + canCf[canCf.length-1].ARRIVALTIME = baseF.getTimeStr(fcsj);
  889 + }
  890 + }else {
  891 + var obj = baseF.getbcObj(
  892 + baseF.getDateTime(canCf[canCf.length-1].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  893 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  894 + markArray.push(obj);
  895 +
  896 + }
  897 + }
  898 + /*if(canCf.length>0) {
  899 + var fxDm = baseF.dirDmToIndex(canCf[canCf.length-1].xlDir);
  900 + // console.log(countTzsj , canCf[canCf.length-1].fcsj);
  901 + if(cfddDm == fxDm && canCf.length>2) {
  902 + var tzdx = canCf[canCf.length-2].STOPTIME - dataMap.zwcArr[cfIndex];
  903 + canCf[canCf.length-2].STOPTIME = tzdx >= 0 ? tzdx : 0;
  904 + var obj = baseF.getbcObj(
  905 + baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  906 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  907 + markArray.push(obj);
  908 + if(tzdx<0) {
  909 + // canCf[canCf.length-1].STOPTIME = 0;
  910 + var fcsj = baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME);
  911 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-2].STOPTIME + dataMap.zwcArr[cfIndex]);
  912 + canCf[canCf.length-1].fcsj = baseF.getTimeStr(fcsj);
  913 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-1].bcsj);
  914 + canCf[canCf.length-1].ARRIVALTIME = baseF.getTimeStr(fcsj);
  915 + }
  916 + }else {
  917 + var obj = baseF.getbcObj(
  918 + baseF.getDateTime(canCf[canCf.length-1].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  919 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  920 + markArray.push(obj);
  921 +
  922 + }
  923 + }else if(isLast.length>0) {
  924 + var fxDm = baseF.dirDmToIndex(isLast[isLast.length-1].xlDir);
  925 + if(cfddDm ==fxDm && canCf.length>2) {
  926 + var tzdx = canCf[canCf.length-2].STOPTIME - dataMap.zwcArr[cfIndex];
  927 + canCf[canCf.length-2].STOPTIME = tzdx >= 0 ? tzdx : 0;
  928 + var obj = baseF.getbcObj(
  929 + baseF.getDateTime(isLast[isLast.length-2].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  930 + dataMap.dira[cfddDm], isLast[isLast.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  931 + markArray.push(obj);
  932 + if(tzdx<0) {
  933 + var fcsj = baseF.getDateTime(isLast[isLast.length-2].ARRIVALTIME);
  934 + fcsj.setMinutes(fcsj.getMinutes() + isLast[isLast.length-2].STOPTIME + dataMap.zwcArr[cfIndex]);
  935 + isLast[isLast.length-1].fcsj = baseF.getTimeStr(fcsj);
  936 + fcsj.setMinutes(fcsj.getMinutes() +isLast[isLast.length-1].bcsj);
  937 + isLast[isLast.length-1].ARRIVALTIME = baseF.getTimeStr(fcsj);
  938 + }
  939 + }else {
  940 + var obj = baseF.getbcObj(
  941 + baseF.getDateTime(isLast[isLast.length-1].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  942 + dataMap.dira[cfddDm], isLast[isLast.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  943 + markArray.push(obj);
  944 + }
  945 + }*/
801 }, 946 },
802 947
803 /** 948 /**
@@ -930,12 +1075,13 @@ var BaseFun = function() { @@ -930,12 +1075,13 @@ var BaseFun = function() {
930 var lLen = list.length , cLen = clzs.length; 1075 var lLen = list.length , cLen = clzs.length;
931 if(lLen<= 0 || cLen<=0 ) 1076 if(lLen<= 0 || cLen<=0 )
932 return false; 1077 return false;
933 - // 最多车次与总车次的比例.  
934 - var blnum = Math.round(cLen/list[0].fpcls); 1078 + list.sort(function(a,b){return a.fpcls-b.fpcls});
935 // 定义已经分配出去的路牌. 1079 // 定义已经分配出去的路牌.
936 var rs = new Array(); 1080 var rs = new Array();
937 // 遍历 1081 // 遍历
938 for(var r = 0 ; r < lLen ; r++) { 1082 for(var r = 0 ; r < lLen ; r++) {
  1083 + // 车次与总车次的比例.
  1084 + var blnum = Math.round(cLen/list[r].fpcls);
939 // 得到没有分配出去的路牌. 1085 // 得到没有分配出去的路牌.
940 var dxa = baseF.chaji_array(clzs,rs); 1086 var dxa = baseF.chaji_array(clzs,rs);
941 // 定义当前车次数. 1087 // 定义当前车次数.
@@ -943,29 +1089,32 @@ var BaseFun = function() { @@ -943,29 +1089,32 @@ var BaseFun = function() {
943 // 定义记录当前分割路牌的次数下标.分配到班型车次下的路牌数组. 1089 // 定义记录当前分割路牌的次数下标.分配到班型车次下的路牌数组.
944 var index = 0 , sslp = new Array(); 1090 var index = 0 , sslp = new Array();
945 // 当前车次所有占比例. 1091 // 当前车次所有占比例.
946 - var tempint = parseInt(rsnum/blnum); 1092 + //var tempint = parseInt(rsnum/blnum);
947 // 判断如果比例小1 则为当前车次数. 1093 // 判断如果比例小1 则为当前车次数.
948 - blnum = tempint <= 1 ? rsnum : blnum; 1094 + //blnum = tempint <= 1 ? rsnum : blnum;
949 // 判断当前班型车次数组下标值.如果为倒数第二个或者之前. 1095 // 判断当前班型车次数组下标值.如果为倒数第二个或者之前.
950 if(r < lLen-1) { 1096 if(r < lLen-1) {
951 // 遍历 1097 // 遍历
952 - for(var c = 0 ; c < tempint ; c++) { 1098 + for(var c = 0 ; c < rsnum ; c++) {
953 // 创建新的没有分配出去的路牌数组. 1099 // 创建新的没有分配出去的路牌数组.
954 var temp = dxa.concat(); 1100 var temp = dxa.concat();
955 // 创建切割路牌数组. 1101 // 创建切割路牌数组.
956 var tagA = new Array(); 1102 var tagA = new Array();
957 // 判断切割的下标值是否小于等于路牌数组的倒数第二个或者之前. 1103 // 判断切割的下标值是否小于等于路牌数组的倒数第二个或者之前.
958 if(index <= (dxa.length-blnum) ) { 1104 if(index <= (dxa.length-blnum) ) {
959 - tagA = temp.splice(index,blnum); 1105 + /*tagA = temp.splice(index,blnum);*/
  1106 + tagA = temp.splice(index,1);
960 }else { 1107 }else {
961 - tagA = temp.splice((dxa.length-blnum),blnum); 1108 + /*tagA = temp.splice((dxa.length-blnum),blnum);*/
  1109 + tagA = temp.splice((dxa.length-blnum),1);
962 } 1110 }
963 // 组合切割路牌数组.赋值给已分配出去的路牌. 1111 // 组合切割路牌数组.赋值给已分配出去的路牌.
964 rs = rs.concat(tagA); 1112 rs = rs.concat(tagA);
965 // 赋值给分配到班型车次下的路牌数组. 1113 // 赋值给分配到班型车次下的路牌数组.
966 sslp = sslp.concat(tagA); 1114 sslp = sslp.concat(tagA);
967 // 记录切割下标. 1115 // 记录切割下标.
968 - index = index + 1 + blnum; 1116 + index = index + blnum;
  1117 + // index = index + blnum;
969 } 1118 }
970 // 分配到班型车次下的路牌数组. 1119 // 分配到班型车次下的路牌数组.
971 list[r].sslp = sslp; 1120 list[r].sslp = sslp;
@@ -1084,6 +1233,7 @@ var BaseFun = function() { @@ -1084,6 +1233,7 @@ var BaseFun = function() {
1084 if(len_>0 && bcCount > 0) { 1233 if(len_>0 && bcCount > 0) {
1085 // 定义该时间区间内的发车间隙. 1234 // 定义该时间区间内的发车间隙.
1086 var _fcjx = parseInt(Math.ceil(zzsj/bcCount)); 1235 var _fcjx = parseInt(Math.ceil(zzsj/bcCount));
  1236 + console.log(_fcjx);
1087 if(tagboolean) { 1237 if(tagboolean) {
1088 if(_fcjx>gfmaxfcjx) 1238 if(_fcjx>gfmaxfcjx)
1089 _fcjx = 20; 1239 _fcjx = 20;
@@ -1091,7 +1241,6 @@ var BaseFun = function() { @@ -1091,7 +1241,6 @@ var BaseFun = function() {
1091 if(_fcjx>dgmaxfcjx) 1241 if(_fcjx>dgmaxfcjx)
1092 _fcjx = dgmaxfcjx; 1242 _fcjx = dgmaxfcjx;
1093 } 1243 }
1094 - // console.log(_fcjx);  
1095 // 定义修改班次的起始时间点. 1244 // 定义修改班次的起始时间点.
1096 var fcnosj = new Date(kssj); 1245 var fcnosj = new Date(kssj);
1097 for(var l = 0 ; l< len_ ; l++) { 1246 for(var l = 0 ; l< len_ ; l++) {
@@ -1154,8 +1303,10 @@ var BaseFun = function() { @@ -1154,8 +1303,10 @@ var BaseFun = function() {
1154 var sslpbcA = new Array(); 1303 var sslpbcA = new Array();
1155 for(var j =0 ; j < tLen ; j++) { 1304 for(var j =0 ; j < tLen ; j++) {
1156 // 判断当期遍历的班次是否属于当前的路牌.如果是则添加到当前的路牌班次数组集合. 1305 // 判断当期遍历的班次是否属于当前的路牌.如果是则添加到当前的路牌班次数组集合.
1157 - if(tempa[j].lpNo == cara[t].lpNo) 1306 + if(tempa[j].lpNo == cara[t].lpNo) {
  1307 + tempa[j].fcint = baseF.getDateTime(tempa[j].fcsj).getTime();
1158 sslpbcA.push(tempa[j]); 1308 sslpbcA.push(tempa[j]);
  1309 + }
1159 } 1310 }
1160 if(sslpbcA.length > 0) { 1311 if(sslpbcA.length > 0) {
1161 // 按发车时间顺序排序. 1312 // 按发车时间顺序排序.
@@ -1166,10 +1317,10 @@ var BaseFun = function() { @@ -1166,10 +1317,10 @@ var BaseFun = function() {
1166 var sgbcfcsj = baseF.getDateTime(sslpbcA[r+1].fcsj), 1317 var sgbcfcsj = baseF.getDateTime(sslpbcA[r+1].fcsj),
1167 dqbcddsj = baseF.getDateTime(sslpbcA[r].ARRIVALTIME), 1318 dqbcddsj = baseF.getDateTime(sslpbcA[r].ARRIVALTIME),
1168 dqbcfcsj = baseF.getDateTime(sslpbcA[r].fcsj); 1319 dqbcfcsj = baseF.getDateTime(sslpbcA[r].fcsj);
  1320 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  1321 + var cctag = baseF.dirDmToIndex(sslpbcA[r].xlDir); // dataMap.smbcsjArr
1169 // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.) 1322 // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.)
1170 var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000); 1323 var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000);
1171 - // 定义当前班次方向下标代码[0代表上行;1代表下行].  
1172 - var cctag = baseF.dirDmToIndex(sslpbcA[r].xlDir);  
1173 // 定义是否高峰 1324 // 定义是否高峰
1174 var flag = baseF.isPeakTimeScope(dqbcfcsj , dataMap); 1325 var flag = baseF.isPeakTimeScope(dqbcfcsj , dataMap);
1175 // 获取行驶时间. 1326 // 获取行驶时间.
@@ -1178,40 +1329,75 @@ var BaseFun = function() { @@ -1178,40 +1329,75 @@ var BaseFun = function() {
1178 baseF.dirDmToIndex(sslpbcA[r].xlDir)); 1329 baseF.dirDmToIndex(sslpbcA[r].xlDir));
1179 normmintzsj = xxsj*0.1; 1330 normmintzsj = xxsj*0.1;
1180 normmaxtzsj = xxsj*0.15; 1331 normmaxtzsj = xxsj*0.15;
  1332 + var flag = false;
1181 // 如果小于零 1333 // 如果小于零
1182 - if(dxmin <= 0 && sslpbcA[r].isfb ==0 ) { 1334 + if(dxmin < 0 && sslpbcA[r].isfb ==0) {
1183 // 根据不同时段的停站时间.重新赋值停站时间. 1335 // 根据不同时段的停站时间.重新赋值停站时间.
1184 - dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag]; 1336 + if(sslpbcA[r].bcType=='normal' && sslpbcA[r+1].bcType =='normal')
  1337 + dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  1338 + else
  1339 + dxmin = 0;
  1340 + flag = true;
  1341 + }else if(dxmin==0){
  1342 + dxmin = 0;
  1343 + flag = true;
1185 }else { 1344 }else {
1186 // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间. 1345 // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.
1187 - if(dxmin >= dgmaxtzsj && dxmin < 180) { 1346 + if(dxmin >= dgmaxtzsj && dxmin < 180 && sslpbcA[r].isfb==0) {
1188 dxmin = dgmaxtzsj; 1347 dxmin = dgmaxtzsj;
  1348 + flag = true;
1189 // 如果大于零 并且 小于等于行业标准的最小停站时间 1349 // 如果大于零 并且 小于等于行业标准的最小停站时间
1190 }else if(dxmin > 0 && dxmin <= normmintzsj ) { 1350 }else if(dxmin > 0 && dxmin <= normmintzsj ) {
1191 // dxmin = dxmin; 1351 // dxmin = dxmin;
  1352 + flag = true;
1192 // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间 1353 // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间
1193 }else if(dxmin > normmintzsj && dxmin <= normmaxtzsj ) { 1354 }else if(dxmin > normmintzsj && dxmin <= normmaxtzsj ) {
1194 // dxmin = dxmin; 1355 // dxmin = dxmin;
  1356 + flag = true;
1195 // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间 1357 // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间
1196 }else if(dxmin > normmaxtzsj && dxmin < dgmaxtzsj ) { 1358 }else if(dxmin > normmaxtzsj && dxmin < dgmaxtzsj ) {
1197 // dxmin = dxmin; 1359 // dxmin = dxmin;
  1360 + flag = true;
  1361 + }else if (dxmin >= 180){
  1362 + dxmin = 0;
  1363 + }
  1364 + }
  1365 + if(flag) {
  1366 + if(!baseF.isDirSmbc(baseF.dirDmToIndex(sslpbcA[r+1].xlDir) , sslpbcA[r+1].fcsj , dataMap)) {
  1367 + // 修改当前班次的停站时间.
  1368 + sslpbcA[r].STOPTIME = parseInt(dxmin) ;
  1369 + // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.
  1370 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);
  1371 + // 修改下一个班次的发车时间.
  1372 + sslpbcA[r+1].fcsj = baseF.getTimeStr(dqbcddsj);
  1373 + // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.
  1374 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);
  1375 + // 修改下一个班次的到达时间.
  1376 + sslpbcA[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj);
  1377 + }else {
  1378 + if(r>0) {
  1379 + // 修改当前班次的停站时间.
  1380 + sslpbcA[r].STOPTIME = parseInt(dxmin) ;
  1381 + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].STOPTIME);
  1382 + sslpbcA[r].ARRIVALTIME = baseF.getTimeStr(sgbcfcsj);
  1383 + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].bcsj);
  1384 + sslpbcA[r].fcsj = baseF.getTimeStr(sgbcfcsj);
  1385 + sslpbcA[r-1].STOPTIME = parseInt( ( sgbcfcsj - baseF.getDateTime(sslpbcA[r-1].ARRIVALTIME))/60000);
  1386 + }
1198 } 1387 }
1199 } 1388 }
1200 - // 修改当前班次的停站时间.  
1201 - sslpbcA[r].STOPTIME = parseInt(dxmin) ;  
1202 - // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.  
1203 - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);  
1204 - // 修改下一个班次的发车时间.  
1205 - sslpbcA[r+1].fcsj = baseF.getTimeStr(dqbcddsj);  
1206 - // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.  
1207 - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);  
1208 - // 修改下一个班次的到达时间.  
1209 - sslpbcA[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj);  
1210 } 1389 }
1211 } 1390 }
1212 } 1391 }
1213 }, 1392 },
1214 1393
  1394 + isDirSmbc : function(dirDm , fcsj , dataMap) {
  1395 + var falg = false;
  1396 + if(fcsj == dataMap.smbcsjArr[dirDm].kssj || fcsj == dataMap.smbcsjArr[dirDm].jssj)
  1397 + falg = true;
  1398 + return falg;
  1399 + },
  1400 +
1215 BXPplaceClassesTime01 : function(saa,cara,map,seMap,dataMap,lpNoA) { 1401 BXPplaceClassesTime01 : function(saa,cara,map,seMap,dataMap,lpNoA) {
1216 var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap); 1402 var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap);
1217 var list = baseF.splitBxRc(map.bxrc); 1403 var list = baseF.splitBxRc(map.bxrc);
@@ -1297,10 +1483,19 @@ var BaseFun = function() { @@ -1297,10 +1483,19 @@ var BaseFun = function() {
1297 dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap);*/ 1483 dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap);*/
1298 var rsjar = baseF.tzsztest(cara,jar3,dataMap); 1484 var rsjar = baseF.tzsztest(cara,jar3,dataMap);
1299 // return {'json':rsjar,'bxrcgs':bxrcgs}; 1485 // return {'json':rsjar,'bxrcgs':bxrcgs};
1300 - return {'json':baseF.addjcclcbc01(cara,rsjar,dataMap,saa,map),'bxrcgs':bxrcgs}; 1486 + return {'json':baseF.addInOutFieldBc(cara,rsjar,dataMap,saa,map),'bxrcgs':bxrcgs};
1301 }, 1487 },
1302 1488
1303 - addjcclcbc01 : function(cara,rsjar,dataMap,saa,map) { 1489 + /**
  1490 + * @description (TODO) 添加进出场班次.
  1491 + * @param cara 路牌
  1492 + * @param rsjar 班次集合数组
  1493 + * @param dataMap dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行].
  1494 + * @param saa 封装的一些 停站时间、周转时间、行驶时间、行驶里程等.
  1495 + * @param map 表单参数对象.
  1496 + *
  1497 + */
  1498 + addInOutFieldBc : function(cara,rsjar,dataMap,saa,map) {
1304 var resultJA = new Array(),bcs = 0; 1499 var resultJA = new Array(),bcs = 0;
1305 for(var m = 0 ; m < cara.length; m++) { 1500 for(var m = 0 ; m < cara.length; m++) {
1306 // 获取路牌编号. 1501 // 获取路牌编号.
@@ -1319,7 +1514,7 @@ var BaseFun = function() { @@ -1319,7 +1514,7 @@ var BaseFun = function() {
1319 lpbc_.sort(function(a,b){return a.fcno-b.fcno}); 1514 lpbc_.sort(function(a,b){return a.fcno-b.fcno});
1320 baseF.addcfbc01(lpbc_,dataMap,map); 1515 baseF.addcfbc01(lpbc_,dataMap,map);
1321 // 按照发车序号顺序排序. 1516 // 按照发车序号顺序排序.
1322 - // lpbc_.sort(function(a,b){return a.fcno-b.fcno}); 1517 + lpbc_.sort(function(a,b){return a.fcno-b.fcno});
1323 var tt = baseF.addjclbbc01(lpbc_,dataMap,saa[0].lbsj,map); 1518 var tt = baseF.addjclbbc01(lpbc_,dataMap,saa[0].lbsj,map);
1324 bcs = baseF.updfcno01(tt,bcs); 1519 bcs = baseF.updfcno01(tt,bcs);
1325 resultJA = resultJA.concat(tt); 1520 resultJA = resultJA.concat(tt);
@@ -1344,8 +1539,8 @@ var BaseFun = function() { @@ -1344,8 +1539,8 @@ var BaseFun = function() {
1344 addcfbc01 : function(lpbcar,dataMap,map) { 1539 addcfbc01 : function(lpbcar,dataMap,map) {
1345 var gs = 0 ,sicftag = true; 1540 var gs = 0 ,sicftag = true;
1346 for(var g = 0 ; g <lpbcar.length-1;g++ ) { 1541 for(var g = 0 ; g <lpbcar.length-1;g++ ) {
1347 - if( parseInt((baseF.getDateTime(lpbcar[g+1].fcsj) - baseF.getDateTime(lpbcar[g].ARRIVALTIME))/60000) > 80  
1348 - && lpbcar[g].STOPTIME==0 ) { 1542 + if( parseInt((baseF.getDateTime(lpbcar[g+1].fcsj) - baseF.getDateTime(lpbcar[g].ARRIVALTIME))/60000) > 180
  1543 + && lpbcar[g].STOPTIME==0 && lpbcar[g].bcType =='normal' ) {
1349 lpbcar[g].isfb = 1; 1544 lpbcar[g].isfb = 1;
1350 } 1545 }
1351 /*gs = gs + lpbcar[g].bcsj + lpbcar[g].STOPTIME; 1546 /*gs = gs + lpbcar[g].bcsj + lpbcar[g].STOPTIME;
@@ -1767,25 +1962,7 @@ var BaseFun = function() { @@ -1767,25 +1962,7 @@ var BaseFun = function() {
1767 dqbcfcsj,dataMap.ccsjArr[fxdm],car,dataMap.bcTypeArr.out, 1962 dqbcfcsj,dataMap.ccsjArr[fxdm],car,dataMap.bcTypeArr.out,
1768 dataMap.dira[fxdm],2,dataMap.cclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 出场班次 1963 dataMap.dira[fxdm],2,dataMap.cclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 出场班次
1769 fcno ++; 1964 fcno ++;
1770 - }/*else if(b > 0 && b < bc.length-1){  
1771 - var jcbckssj = baseF.getDateTime(bc[b].ARRIVALTIME)  
1772 - var ccbckssj = baseF.getDateTime(bc[b+1].fcsj)  
1773 - var dx = parseInt((ccbckssj - jcbckssj)/60000);  
1774 - if(bc[b].STOPTIME==0) {  
1775 - // bc[b].STOPTIME = 0;  
1776 - //console.log(bc[b].fcno);  
1777 - var fcno_ = bc[b].fcno + 2;  
1778 - stas = true;  
1779 - // console.log(bc[b],bc[b+1],b);  
1780 - result.push(baseF.getbcObj(  
1781 - jcbckssj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.in_,  
1782 - dataMap.dira[fxdm],fcno_++,dataMap.jclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 进场班次  
1783 - var ccfx = baseF.dirDmToIndex(bc[b+1].xlDir);  
1784 - result.push(baseF.getbcObj(  
1785 - ccbckssj,dataMap.ccsjArr[ccfx],car,dataMap.bcTypeArr.out,  
1786 - dataMap.dira[ccfx],fcno_++,dataMap.cclcArr[ccfx],gatps,0,dataMap.qdzArr[ccfx],null,null,0,0));// 出场班次  
1787 - }  
1788 - }*/else if(b==bc.length-1){ 1965 + }else if(b==bc.length-1){
1789 var fcno_ = dxfno + 2; 1966 var fcno_ = dxfno + 2;
1790 var qdbcddsj = baseF.getDateTime(bc[b].ARRIVALTIME); 1967 var qdbcddsj = baseF.getDateTime(bc[b].ARRIVALTIME);
1791 result.push(baseF.getbcObj( 1968 result.push(baseF.getbcObj(
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
@@ -968,7 +968,7 @@ var RelationshipGraph = function () { @@ -968,7 +968,7 @@ var RelationshipGraph = function () {
968 for(var z = 0 ;z < tza.length;z++) { 968 for(var z = 0 ;z < tza.length;z++) {
969 if(tza[z].lpNo == lpNo && tza[z].bcsj >0 ) { 969 if(tza[z].lpNo == lpNo && tza[z].bcsj >0 ) {
970 timeNum = timeNum + tza[z].bcsj + tza[z].STOPTIME; 970 timeNum = timeNum + tza[z].bcsj + tza[z].STOPTIME;
971 - if( tza[z].bcType !='bd' && tza[z].bcType !='lc' ) { 971 + if( tza[z].bcType !='bd' && tza[z].bcType !='lc' && tza[z].bcType !='cf') {
972 tempNum ++; 972 tempNum ++;
973 } 973 }
974 } 974 }
@@ -983,32 +983,6 @@ var RelationshipGraph = function () { @@ -983,32 +983,6 @@ var RelationshipGraph = function () {
983 $(textNodes[1]).text("总班次:"+(tempNum)); 983 $(textNodes[1]).text("总班次:"+(tempNum));
984 // $_this.pptjbx($("."+className).children("rect")[2],zgs*1,lpNo,$_this); 984 // $_this.pptjbx($("."+className).children("rect")[2],zgs*1,lpNo,$_this);
985 } 985 }
986 - /*for(var a=0;a<array.length;a++) {  
987 - debugger;  
988 - var tempNum = 0,timeNum = 0,lpNo = '';  
989 - for(var g = 0 ; g <gdata.length;g++) {  
990 - var temp_i = parseInt(d3.select(gdata[g]).attr('y'))-this.configuration.offsetY;  
991 - if(temp_i<array[a] && temp_i>minValue) {  
992 - var parentNodeCName = d3.select(gdata[g]).attr('id'),  
993 - // nodes = d3.selectAll('text[parent-node='+ parentNodeCName +']')[0]  
994 - $_d = d3.select(gdata[g]).data()[0];  
995 - lpNo = $_d.lpNo;  
996 - timeNum = timeNum + parseInt($_d.STOPTIME) + parseInt($_d.bcsj);  
997 - if($_d.bcType!='bd' && $_d.bcType!='lc' && $_d.bcType!='cf' && $_d.bcsj>0)  
998 - tempNum++;  
999 - }  
1000 - }  
1001 - minValue = array[a];  
1002 - var className = 'statis_container_' + array[a];  
1003 - var textNodes = $("."+className).children("text");  
1004 - var hours = parseInt(timeNum/60);  
1005 - var mimus = timeNum%60,zgs = hours + (mimus==0? "": "." + mimus);  
1006 - var zgs = parseFloat((timeNum/60).toFixed(2));  
1007 - var zgs = timeNum;  
1008 - $(textNodes[0]).text("总工时:" + zgs);  
1009 - $(textNodes[1]).text("总班次:"+(tempNum));  
1010 - $_this.pptjbx($("."+className).children("rect")[2],zgs*1,lpNo,$_this);  
1011 - }*/  
1012 } 986 }
1013 987
1014 }, { 988 }, {
@@ -3027,7 +3001,9 @@ var RelationshipGraph = function () { @@ -3027,7 +3001,9 @@ var RelationshipGraph = function () {
3027 nowDate.setMinutes(parseInt(tm.min)+d.bcsj);// 10.3.1、设置分钟. 3001 nowDate.setMinutes(parseInt(tm.min)+d.bcsj);// 10.3.1、设置分钟.
3028 // 9.1.4、修改当前班次的到达时间. 3002 // 9.1.4、修改当前班次的到达时间.
3029 d.ARRIVALTIME = BaseFun.getTimeStr(nowDate); 3003 d.ARRIVALTIME = BaseFun.getTimeStr(nowDate);
3030 - d.STOPTIME = d.isfb ==1 ? 0 : parseInt((BaseFun.getDateTime(nodeContext.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME))/ 60000); 3004 + d.STOPTIME = d.isfb == 1 ? 0 : parseInt((BaseFun.getDateTime(nodeContext.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME))/ 60000);
  3005 + // parseInt((BaseFun.getDateTime(nodeContext.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME))/ 60000)
  3006 +
3031 /** 3007 /**
3032 * 9.2、修改元素沿X轴方向的X坐标属性值. 3008 * 9.2、修改元素沿X轴方向的X坐标属性值.
3033 * 3009 *
@@ -3144,6 +3120,38 @@ var RelationshipGraph = function () { @@ -3144,6 +3120,38 @@ var RelationshipGraph = function () {
3144 } 3120 }
3145 } 3121 }
3146 }else { 3122 }else {
  3123 + var dataMap = $_GlobalGraph.configuration.dataMap;
  3124 + // 定义是否高峰
  3125 + var flag = BaseFun.isPeakTimeScope(BaseFun.getDateTime(nodeContext.lastData.fcsj) , dataMap);
  3126 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  3127 + var cctag = BaseFun.dirDmToIndex(nodeContext.lastData.xlDir);
  3128 + // 获取行驶时间.
  3129 + var xxsj = BaseFun.getByDirTravelTime(dataMap.zgfsjd , dataMap.wgfsjd , nowDate, dataMap.pcxssjArr , dataMap.gfxxsjArr , cctag);
  3130 + var normmintzsj = xxsj*0.1,normmaxtzsj = xxsj*0.15;
  3131 + // 如果小于零
  3132 + if(dxMinues <= 0 && nodeContext.lastData.isfb ==0 ) {
  3133 + // 根据不同时段的停站时间.重新赋值停站时间.
  3134 + dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  3135 + }else {
  3136 + // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.
  3137 + if(dxMinues >= dataMap.dgmaxtzsj && dxMinues < 180) {
  3138 + dxMinues = dataMap.dgmaxtzsj;
  3139 + // 如果大于零 并且 小于等于行业标准的最小停站时间
  3140 + }else if(dxMinues > 0 && dxMinues <= normmintzsj ) {
  3141 + // dxmin = dxmin;
  3142 + // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间
  3143 + }else if(dxMinues > normmintzsj && dxMinues <= normmaxtzsj ) {
  3144 + // dxmin = dxmin;
  3145 + // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间
  3146 + }else if(dxMinues > normmaxtzsj && dxMinues < dataMap.dgmaxtzsj ) {
  3147 + // dxmin = dxmin;
  3148 + }else if (dxMinues >= 180){
  3149 + dxMinues = 0;
  3150 + }
  3151 + }
  3152 + // 修改当前班次的停站时间.
  3153 + // nodeContext.lastData.STOPTIME = dxMinues;
  3154 + // d.STOPTIME = parseInt(dxmin) ;
3147 /** 3155 /**
3148 * 11.2.1、如果是正常班次 3156 * 11.2.1、如果是正常班次
3149 * 3157 *
@@ -3370,11 +3378,41 @@ var RelationshipGraph = function () { @@ -3370,11 +3378,41 @@ var RelationshipGraph = function () {
3370 } 3378 }
3371 } 3379 }
3372 }else { 3380 }else {
  3381 + var dxMinues = parseInt((BaseFun.getDateTime(d.fcsj) - BaseFun.getDateTime(_obj.lastData.ARRIVALTIME)) / 60000);
3373 /** 3382 /**
3374 * 1.5.6、修改上个元素班次与当前班次的停站时间和text元素的文本属性值. 3383 * 1.5.6、修改上个元素班次与当前班次的停站时间和text元素的文本属性值.
3375 * 3384 *
3376 **/ 3385 **/
3377 - _obj.lastData.STOPTIME = parseInt((BaseFun.getDateTime(d.fcsj) - BaseFun.getDateTime(_obj.lastData.ARRIVALTIME)) / 60000); 3386 + var dataMap = $_GlobalGraph.configuration.dataMap;
  3387 + // 定义是否高峰
  3388 + var flag = BaseFun.isPeakTimeScope(BaseFun.getDateTime(nodeContext.lastData.fcsj) , dataMap);
  3389 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  3390 + var cctag = BaseFun.dirDmToIndex(nodeContext.lastData.xlDir);
  3391 + // 获取行驶时间.
  3392 + var xxsj = BaseFun.getByDirTravelTime(dataMap.zgfsjd , dataMap.wgfsjd , nowDate, dataMap.pcxssjArr , dataMap.gfxxsjArr , cctag);
  3393 + var normmintzsj = xxsj*0.1,normmaxtzsj = xxsj*0.15;
  3394 + // 如果小于零
  3395 + if(dxMinues <= 0 && nodeContext.lastData.isfb ==0 ) {
  3396 + // 根据不同时段的停站时间.重新赋值停站时间.
  3397 + dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  3398 + }else {
  3399 + // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.
  3400 + if(dxMinues >= dataMap.dgmaxtzsj && dxMinues < 180) {
  3401 + dxMinues = dataMap.dgmaxtzsj;
  3402 + // 如果大于零 并且 小于等于行业标准的最小停站时间
  3403 + }else if(dxMinues > 0 && dxMinues <= normmintzsj ) {
  3404 + // dxmin = dxmin;
  3405 + // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间
  3406 + }else if(dxMinues > normmintzsj && dxMinues <= normmaxtzsj ) {
  3407 + // dxmin = dxmin;
  3408 + // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间
  3409 + }else if(dxMinues > normmaxtzsj && dxMinues < dataMap.dgmaxtzsj ) {
  3410 + // dxmin = dxmin;
  3411 + }else if (dxMinues >= 180){
  3412 + dxMinues = 0;
  3413 + }
  3414 + }
  3415 + _obj.lastData.STOPTIME = dxMinues;
3378 for(var t = 0 ; t < _obj.lastTextNodes.length ;t++) { 3416 for(var t = 0 ; t < _obj.lastTextNodes.length ;t++) {
3379 var nowTextNode = d3.select(_obj.lastTextNodes[t]); 3417 var nowTextNode = d3.select(_obj.lastTextNodes[t]);
3380 if(nowTextNode.attr('text-type')=='gap') 3418 if(nowTextNode.attr('text-type')=='gap')
src/main/resources/static/pages/base/timesmodel/js/gantt.js
@@ -420,7 +420,8 @@ @@ -420,7 +420,8 @@
420 * @return 返回甘特图的参数配置信息. 420 * @return 返回甘特图的参数配置信息.
421 * */ 421 * */
422 function getGraphArgus(p) { 422 function getGraphArgus(p) {
423 - var MULTIPLE = Math.round(105/parseInt(p.stopAraay[0].sxsj)) >=4 ? Math.round(90/parseInt(p.stopAraay[0].sxsj)) : Math.round(90/parseInt(p.stopAraay[0].sxsj)) *2; 423 + var bs = p.stopAraay[0].sxsj > 40 ? 4 : 2;
  424 + var MULTIPLE = Math.round(105/parseInt(p.stopAraay[0].sxsj)) >3 ? Math.round(90/parseInt(p.stopAraay[0].sxsj)) : Math.round(90/parseInt(p.stopAraay[0].sxsj)) *bs;
424 var VALUEKEYNAME = 'Worldwide Gross' , 425 var VALUEKEYNAME = 'Worldwide Gross' ,
425 DXHOURS = 24,MINUTE = 60,WIDTH = DXHOURS*MINUTE,MARGINLEFT = 380,HEIGHT = p.yAxisCarArray.length*60 + 240, 426 DXHOURS = 24,MINUTE = 60,WIDTH = DXHOURS*MINUTE,MARGINLEFT = 380,HEIGHT = p.yAxisCarArray.length*60 + 240,
426 MARGINBOTTOM = 240,OFFSETX = 90,OFFSETY = 180,OFFSETUPY = 120,OFFSETDOWNY = 60, 427 MARGINBOTTOM = 240,OFFSETX = 90,OFFSETY = 180,OFFSETUPY = 120,OFFSETDOWNY = 60,
src/main/resources/static/pages/forms/mould/countByBus1.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/countByBus2.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/countByLine.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/account.html
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
86 locale : 'zh-cn' 86 locale : 'zh-cn'
87 }); 87 });
88 88
89 - $.get('/basic/lineCode2Name',function(result){ 89 + /* $.get('/basic/lineCode2Name',function(result){
90 var data=[]; 90 var data=[];
91 91
92 for(var code in result){ 92 for(var code in result){
@@ -94,7 +94,29 @@ @@ -94,7 +94,29 @@
94 } 94 }
95 initPinYinSelect2('#line',data,''); 95 initPinYinSelect2('#line',data,'');
96 96
97 - }) 97 + }) */
  98 +
  99 + $.get('/report/lineList',function(xlList){
  100 + var data = [];
  101 +// data.push({id: " ", text: "全部线路"});
  102 + $.get('/user/companyData', function(result){
  103 + for(var i = 0; i < result.length; i++){
  104 + var companyCode = result[i].companyCode;
  105 + var children = result[i].children;
  106 + for(var j = 0; j < children.length; j++){
  107 + var code = children[j].code;
  108 + for(var k=0;k < xlList.length;k++ ){
  109 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  110 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  111 +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  112 + }
  113 + }
  114 + }
  115 + }
  116 + initPinYinSelect2('#line',data,'');
  117 +
  118 + });
  119 + });
98 //重置 120 //重置
99 $('#czcl').on('click', function () { 121 $('#czcl').on('click', function () {
100 $('#code').val('').change(); 122 $('#code').val('').change();
src/main/resources/static/pages/forms/statement/busInterval.html
@@ -217,42 +217,51 @@ @@ -217,42 +217,51 @@
217 } 217 }
218 } 218 }
219 $('#subCompany').html(options); 219 $('#subCompany').html(options);
220 - initXl();  
221 } 220 }
222 221
223 - $("#subCompany").on("change",initXl);  
224 - function initXl(){  
225 - var data=[];  
226 - data.push({id:" ", text:"全部线路"});  
227 - if(fage){  
228 - $("#line").select2("destroy").html('');  
229 - }  
230 - var fgs=$('#subCompany').val();  
231 - var gs=$('#company').val();  
232 - for(var i=0;i<xlList.length;i++){  
233 - if(gs!=""){  
234 - if(fgs!=""){  
235 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
236 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
237 - }  
238 - }else{  
239 - if(xlList[i]["gsbm"]==gs){  
240 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 222 +
  223 + var tempData = {};
  224 + $.get('/report/lineList',function(xlList){
  225 + var data = [];
  226 + data.push({id: " ", text: "全部线路"});
  227 + $.get('/user/companyData', function(result){
  228 + for(var i = 0; i < result.length; i++){
  229 + var companyCode = result[i].companyCode;
  230 + var children = result[i].children;
  231 + for(var j = 0; j < children.length; j++){
  232 + var code = children[j].code;
  233 + for(var k=0;k < xlList.length;k++ ){
  234 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  235 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  236 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  237 + }
241 } 238 }
242 } 239 }
243 } 240 }
244 - }  
245 - initPinYinSelect2('#line',data,'');  
246 - fage=true;  
247 -  
248 - $("#endDate").attr("disabled", true);  
249 - $("#endDate").val($("#startDate").val());  
250 - line = data[0].id;  
251 - statu = 0;  
252 -  
253 - updateModel();  
254 - } 241 + initPinYinSelect2('#line',data,'');
  242 + $("#endDate").attr("disabled", true);
  243 + $("#endDate").val($("#startDate").val());
  244 + line = data[0].id;
  245 + statu = 0;
  246 +
  247 + updateModel();
  248 +
  249 + });
  250 + });
255 251
  252 + $("#line").on("change", function(){
  253 + if($("#line").val() == " "){
  254 + $("#company").attr("disabled", false);
  255 + $("#subCompany").attr("disabled", false);
  256 + } else {
  257 + var temp = tempData[$("#line").val()].split(":");
  258 + $("#company").val(temp[0]);
  259 + updateCompany();
  260 + $("#subCompany").val(temp[1]);
  261 + $("#company").attr("disabled", true);
  262 + $("#subCompany").attr("disabled", true);
  263 + }
  264 + });
256 265
257 $("#query").on("click",jsDoQuery); 266 $("#query").on("click",jsDoQuery);
258 267
src/main/resources/static/pages/forms/statement/commandState.html
@@ -178,33 +178,44 @@ @@ -178,33 +178,44 @@
178 } 178 }
179 } 179 }
180 $('#subCompany').html(options); 180 $('#subCompany').html(options);
181 - initXl();  
182 } 181 }
183 182
184 - $("#subCompany").on("change",initXl);  
185 - function initXl(){  
186 - var data=[];  
187 - if(fage){  
188 - $("#line").select2("destroy").html('');  
189 - }  
190 - var fgs=$('#subCompany').val();  
191 - var gs=$('#company').val();  
192 - for(var i=0;i<xlList.length;i++){  
193 - if(gs!=""){  
194 - if(fgs!=""){  
195 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
196 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
197 - }  
198 - }else{  
199 - if(xlList[i]["gsbm"]==gs){  
200 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 183 + var tempData = {};
  184 + $.get('/report/lineList',function(xlList){
  185 + var data = [];
  186 + $.get('/user/companyData', function(result){
  187 + for(var i = 0; i < result.length; i++){
  188 + var companyCode = result[i].companyCode;
  189 + var children = result[i].children;
  190 + for(var j = 0; j < children.length; j++){
  191 + var code = children[j].code;
  192 + for(var k=0;k < xlList.length;k++ ){
  193 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  194 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  195 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  196 + }
201 } 197 }
202 } 198 }
203 } 199 }
  200 + initPinYinSelect2('#line',data,'');
  201 +
  202 + });
  203 + });
  204 +
  205 + $("#line").on("change", function(){
  206 + if($("#line").val() == " "){
  207 + $("#company").attr("disabled", false);
  208 + $("#subCompany").attr("disabled", false);
  209 + } else {
  210 + var temp = tempData[$("#line").val()].split(":");
  211 + $("#company").val(temp[0]);
  212 + updateCompany();
  213 + $("#subCompany").val(temp[1]);
  214 + $("#company").attr("disabled", true);
  215 + $("#subCompany").attr("disabled", true);
204 } 216 }
205 - initPinYinSelect2('#line',data,'');  
206 - fage=true;  
207 - } 217 + });
  218 +
208 219
209 $('#code').select2({ 220 $('#code').select2({
210 ajax: { 221 ajax: {
src/main/resources/static/pages/forms/statement/correctForm.html
@@ -112,16 +112,29 @@ @@ -112,16 +112,29 @@
112 $("#date").val(year + "-" + month + "-" + day); 112 $("#date").val(year + "-" + month + "-" + day);
113 $("#endDate").val(year + "-" + month + "-" + day); 113 $("#endDate").val(year + "-" + month + "-" + day);
114 114
115 - $.get('/basic/lineCode2Name',function(result){  
116 - var data=[];  
117 -  
118 - for(var code in result){  
119 - data.push({id: code, text: result[code]});  
120 - }  
121 - initPinYinSelect2('#line',data,'');  
122 -  
123 - })  
124 - $('#czcl').on('click', function () { 115 + $.get('/report/lineList',function(xlList){
  116 + var data = [];
  117 +// data.push({id: " ", text: "全部线路"});
  118 + $.get('/user/companyData', function(result){
  119 + for(var i = 0; i < result.length; i++){
  120 + var companyCode = result[i].companyCode;
  121 + var children = result[i].children;
  122 + for(var j = 0; j < children.length; j++){
  123 + var code = children[j].code;
  124 + for(var k=0;k < xlList.length;k++ ){
  125 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  126 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  127 +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  128 + }
  129 + }
  130 + }
  131 + }
  132 + initPinYinSelect2('#line',data,'');
  133 +
  134 + });
  135 + });
  136 +
  137 + $('#czcl').on('click', function () {
125 $('#code').val('').change(); 138 $('#code').val('').change();
126 }); 139 });
127 140
@@ -203,7 +216,7 @@ @@ -203,7 +216,7 @@
203 }); 216 });
204 217
205 var line = $("#line").val(); 218 var line = $("#line").val();
206 - var date = $("#date").val();endDate 219 + var date = $("#date").val();
207 var lpName = $("#lpName").val(); 220 var lpName = $("#lpName").val();
208 var endDate = $("#endDate").val(); 221 var endDate = $("#endDate").val();
209 var code = $("#code").val(); 222 var code = $("#code").val();
src/main/resources/static/pages/forms/statement/correctStatis.html
@@ -145,49 +145,8 @@ @@ -145,49 +145,8 @@
145 $("#times1").attr("disabled", true); 145 $("#times1").attr("disabled", true);
146 $("#times2").attr("disabled", true); 146 $("#times2").attr("disabled", true);
147 147
148 -// $.get('/basic/lineCode2Name', function(result){  
149 -// var data=[];  
150 -  
151 -// data.push({id: " ", text: "全部线路"});  
152 -// for(var code in result){  
153 -// data.push({id: code, text: result[code]});  
154 -// }  
155 -// console.log(data);  
156 -// initPinYinSelect2('#line',data,'');  
157 148
158 -// line = "";  
159 -// // updateModel();  
160 -// });  
161 -  
162 -// var obj = [];  
163 -// $.get('/user/companyData', function(result){  
164 -// obj = result;  
165 -// var options = '';  
166 -// for(var i = 0; i < obj.length; i++){  
167 -// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
168 -// }  
169 -// if(obj.length == 1){  
170 -// $('#company1').hide();  
171 -// if(obj[0].children.length == 1)  
172 -// $('#subCompany1').hide();  
173 -// }  
174 -// $('#company').html(options);  
175 -// updateCompany();  
176 -// });  
177 -// $("#company").on("change",updateCompany);  
178 -// function updateCompany(){  
179 -// var company = $('#company').val();  
180 -// var options = '';  
181 -// for(var i = 0; i < obj.length; i++){  
182 -// if(obj[i].companyCode == company){  
183 -// var children = obj[i].children;  
184 -// for(var j = 0; j < children.length; j++){  
185 -// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';  
186 -// }  
187 -// }  
188 -// }  
189 -// $('#subCompany').html(options);  
190 -// } 149 +
191 var fage=false; 150 var fage=false;
192 var xlList; 151 var xlList;
193 var obj = []; 152 var obj = [];
@@ -225,36 +184,44 @@ @@ -225,36 +184,44 @@
225 } 184 }
226 } 185 }
227 $('#subCompany').html(options); 186 $('#subCompany').html(options);
228 - initXl();  
229 } 187 }
230 188
231 - $("#subCompany").on("change",initXl);  
232 - function initXl(){  
233 - var data=[];  
234 - data.push({id:" ", text:"全部线路"});  
235 - if(fage){  
236 - $("#line").select2("destroy").html('');  
237 - }  
238 - var fgs=$('#subCompany').val();  
239 - var gs=$('#company').val();  
240 - for(var i=0;i<xlList.length;i++){  
241 - if(gs!=""){  
242 - if(fgs!=""){  
243 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
244 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
245 - }  
246 - }else{  
247 - if(xlList[i]["gsbm"]==gs){  
248 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 189 + var tempData = {};
  190 + $.get('/report/lineList',function(xlList){
  191 + var data = [];
  192 + data.push({id: " ", text: "全部线路"});
  193 + $.get('/user/companyData', function(result){
  194 + for(var i = 0; i < result.length; i++){
  195 + var companyCode = result[i].companyCode;
  196 + var children = result[i].children;
  197 + for(var j = 0; j < children.length; j++){
  198 + var code = children[j].code;
  199 + for(var k=0;k < xlList.length;k++ ){
  200 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  201 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  202 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  203 + }
249 } 204 }
250 } 205 }
251 } 206 }
  207 + initPinYinSelect2('#line',data,'');
  208 +
  209 + });
  210 + });
  211 +
  212 + $("#line").on("change", function(){
  213 + if($("#line").val() == " "){
  214 + $("#company").attr("disabled", false);
  215 + $("#subCompany").attr("disabled", false);
  216 + } else {
  217 + var temp = tempData[$("#line").val()].split(":");
  218 + $("#company").val(temp[0]);
  219 + updateCompany();
  220 + $("#subCompany").val(temp[1]);
  221 + $("#company").attr("disabled", true);
  222 + $("#subCompany").attr("disabled", true);
252 } 223 }
253 - initPinYinSelect2('#line',data,'');  
254 - fage=true;  
255 -  
256 - line = "";  
257 - } 224 + });
258 225
259 226
260 $("#query").on("click",jsDoQuery); 227 $("#query").on("click",jsDoQuery);
@@ -294,13 +261,12 @@ @@ -294,13 +261,12 @@
294 // $(".hidden").removeClass("hidden"); 261 // $(".hidden").removeClass("hidden");
295 $get('/busInterval/correctStatis', params, function(result){ 262 $get('/busInterval/correctStatis', params, function(result){
296 // 把数据填充到模版中 263 // 把数据填充到模版中
297 -// var tbodyHtml = template('list_company',{list:result, type:1});  
298 - var tbodyHtml = "";  
299 - if(result.length != 0){ 264 + var tbodyHtml = template('list_company',{list:result});;
  265 + /* if(result.length != 0){
300 tbodyHtml = template('list_company',{list:result[0].workList[0].workList, type:3}); 266 tbodyHtml = template('list_company',{list:result[0].workList[0].workList, type:3});
301 }else{ 267 }else{
302 tbodyHtml = template('list_company',{list:result, type:3}); 268 tbodyHtml = template('list_company',{list:result, type:3});
303 - } 269 + } */
304 270
305 // 把渲染好的模版html文本追加到表格中 271 // 把渲染好的模版html文本追加到表格中
306 // $('#forms').html(tbodyHtml); 272 // $('#forms').html(tbodyHtml);
@@ -314,7 +280,7 @@ @@ -314,7 +280,7 @@
314 }); 280 });
315 } 281 }
316 282
317 - $("#forms").on("click","tbody tr",function(){ 283 + /* $("#forms").on("click","tbody tr",function(){
318 if($(this).children().size() < 2){ 284 if($(this).children().size() < 2){
319 return; 285 return;
320 } 286 }
@@ -332,9 +298,9 @@ @@ -332,9 +298,9 @@
332 subCompany = g.workList; 298 subCompany = g.workList;
333 } 299 }
334 }); 300 });
335 - }); 301 + }); */
336 302
337 - $("#subinfo").on("click","tbody tr",function(){ 303 + /* $("#subinfo").on("click","tbody tr",function(){
338 if($(this).children().size() < 2){ 304 if($(this).children().size() < 2){
339 return; 305 return;
340 } 306 }
@@ -351,9 +317,9 @@ @@ -351,9 +317,9 @@
351 lines = g.workList; 317 lines = g.workList;
352 } 318 }
353 }); 319 });
354 - }); 320 + }); */
355 321
356 - $("#lineinfo").on("click","tbody tr",function(){ 322 + /* $("#lineinfo").on("click","tbody tr",function(){
357 if($(this).children().size() < 2){ 323 if($(this).children().size() < 2){
358 return; 324 return;
359 } 325 }
@@ -361,13 +327,13 @@ @@ -361,13 +327,13 @@
361 $(this).children().each(function(index){ 327 $(this).children().each(function(index){
362 params[index] = $(this).text(); 328 params[index] = $(this).text();
363 }); 329 });
364 - $.each(lines, function(i, g){ 330 + $.each(lines, function(i, g){
365 if(g.company == params[1] && g.subCompany == params[2] && g.line == params[3]){ 331 if(g.company == params[1] && g.subCompany == params[2] && g.line == params[3]){
366 var tbodyHtml = template('list_workList',{list:g.workList}); 332 var tbodyHtml = template('list_workList',{list:g.workList});
367 $("#lines").html(tbodyHtml); 333 $("#lines").html(tbodyHtml);
368 } 334 }
369 - });  
370 - }); 335 + });
  336 + }); */
371 337
372 // $("#export").on("click", function(){ 338 // $("#export").on("click", function(){
373 // $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ 339 // $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
@@ -414,9 +380,8 @@ @@ -414,9 +380,8 @@
414 <th class="hidden"></th> 380 <th class="hidden"></th>
415 <th rowspan="2" width="120px">日期</th> 381 <th rowspan="2" width="120px">日期</th>
416 <th rowspan="2">公司</th> 382 <th rowspan="2">公司</th>
417 - {{if type>1}}<th rowspan="2">分公司</th>{{/if}}  
418 - {{if type<3}}<th rowspan="2">线路条数</th>{{/if}}  
419 - {{if type==3}}<th rowspan="2">线路</th>{{/if}} 383 + <th rowspan="2">分公司</th>
  384 + <th rowspan="2">线路</th>
420 <th rowspan="2">实际营运班次</th> 385 <th rowspan="2">实际营运班次</th>
421 <th colspan="3" align="center">待发调整数</th> 386 <th colspan="3" align="center">待发调整数</th>
422 <th rowspan="2">掉线调整数</th> 387 <th rowspan="2">掉线调整数</th>
@@ -438,18 +403,15 @@ @@ -438,18 +403,15 @@
438 {{each list as obj i}} 403 {{each list as obj i}}
439 <tr> 404 <tr>
440 {{if obj.date=='合计'}} 405 {{if obj.date=='合计'}}
441 - {{if type==1}}<td colspan="2">{{obj.date}}</td>{{/if}}  
442 - {{if type==2}}<td colspan="3">{{obj.date}}</td>{{/if}}  
443 - {{if type==3}}<td colspan="4">{{obj.date}}</td>{{/if}} 406 +
  407 + <td colspan="4">{{obj.date}}</td>
444 {{/if}} 408 {{/if}}
445 {{if obj.date!='合计'}} 409 {{if obj.date!='合计'}}
446 <td>{{obj.date}}</td> 410 <td>{{obj.date}}</td>
447 -  
448 - {{/if}}  
449 - {{if obj.date!='合计'}}<td>{{obj.company}}</td>{{/if}}  
450 - {{if type>1 && obj.date!='合计'}}<td>{{obj.subCompany}}</td>{{/if}}  
451 - {{if type<3}}<td>{{obj.lines}}</td>{{/if}}  
452 - {{if type==3 && obj.date!='合计'}}<td>{{obj.line}}</td>{{/if}} 411 + <td>{{obj.company}}</td>
  412 + <td>{{obj.subCompany}}</td>
  413 + <td>{{obj.xlname}}</td>
  414 + {{/if}}
453 <td>{{obj.sjbc}}</td> 415 <td>{{obj.sjbc}}</td>
454 <td>{{obj.sddf}}</td> 416 <td>{{obj.sddf}}</td>
455 <td>{{obj.zddf}}</td> 417 <td>{{obj.zddf}}</td>
@@ -465,7 +427,7 @@ @@ -465,7 +427,7 @@
465 {{/each}} 427 {{/each}}
466 {{if list.length == 0}} 428 {{if list.length == 0}}
467 <tr> 429 <tr>
468 - <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> 430 + <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
469 </tr> 431 </tr>
470 {{/if}} 432 {{/if}}
471 </tbody> 433 </tbody>
src/main/resources/static/pages/forms/statement/daily.html
@@ -139,7 +139,7 @@ @@ -139,7 +139,7 @@
139 } 139 }
140 } 140 }
141 $('#fgsdmDaily').html(options); 141 $('#fgsdmDaily').html(options);
142 - initXl(); 142 +// initXl();
143 } 143 }
144 144
145 /* $.get('/basic/lineCode2Name',function(result){ 145 /* $.get('/basic/lineCode2Name',function(result){
@@ -152,7 +152,7 @@ @@ -152,7 +152,7 @@
152 152
153 }) */ 153 }) */
154 154
155 - $("#fgsdmDaily").on("change",initXl); 155 + /* $("#fgsdmDaily").on("change",initXl);
156 function initXl(){ 156 function initXl(){
157 var data=[]; 157 var data=[];
158 if(fage){ 158 if(fage){
@@ -175,7 +175,44 @@ @@ -175,7 +175,44 @@
175 } 175 }
176 initPinYinSelect2('#line',data,''); 176 initPinYinSelect2('#line',data,'');
177 fage=true; 177 fage=true;
178 - } 178 + } */
  179 + var tempData = {};
  180 + $.get('/report/lineList',function(xlList){
  181 + var data = [];
  182 +// data.push({id: " ", text: "全部线路"});
  183 + $.get('/user/companyData', function(result){
  184 + for(var i = 0; i < result.length; i++){
  185 + var companyCode = result[i].companyCode;
  186 + var children = result[i].children;
  187 + for(var j = 0; j < children.length; j++){
  188 + var code = children[j].code;
  189 + for(var k=0;k < xlList.length;k++ ){
  190 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  191 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  192 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  193 + }
  194 + }
  195 + }
  196 + }
  197 + initPinYinSelect2('#line',data,'');
  198 +
  199 + });
  200 + });
  201 +
  202 + $("#line").on("change", function(){
  203 + if($("#line").val() == " "){
  204 + $("#gsdmDaily").attr("disabled", false);
  205 + $("#fgsdmDaily").attr("disabled", false);
  206 + } else {
  207 + var temp = tempData[$("#line").val()].split(":");
  208 + $("#gsdmDaily").val(temp[0]);
  209 + updateCompany();
  210 + $("#fgsdmDaily").val(temp[1]);
  211 + $("#gsdmDaily").attr("disabled", true);
  212 + $("#fgsdmDaily").attr("disabled", true);
  213 + }
  214 + });
  215 +
179 216
180 var line; 217 var line;
181 var date; 218 var date;
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
@@ -176,34 +176,44 @@ @@ -176,34 +176,44 @@
176 } 176 }
177 } 177 }
178 $('#subCompany').html(options); 178 $('#subCompany').html(options);
179 - initXl();  
180 } 179 }
181 -  
182 - $("#subCompany").on("change",initXl);  
183 - function initXl(){  
184 - var data=[];  
185 - if(fage){  
186 - $("#line").select2("destroy").html('');  
187 - }  
188 - var fgs=$('#subCompany').val();  
189 - var gs=$('#company').val(); 180 +
  181 + var tempData = {};
  182 + $.get('/report/lineList',function(xlList){
  183 + var data = [];
190 data.push({id: " ", text: "全部线路"}); 184 data.push({id: " ", text: "全部线路"});
191 - for(var i=0;i<xlList.length;i++){  
192 - if(gs!=""){  
193 - if(fgs!=""){  
194 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
195 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
196 - }  
197 - }else{  
198 - if(xlList[i]["gsbm"]==gs){  
199 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 185 + $.get('/user/companyData', function(result){
  186 + for(var i = 0; i < result.length; i++){
  187 + var companyCode = result[i].companyCode;
  188 + var children = result[i].children;
  189 + for(var j = 0; j < children.length; j++){
  190 + var code = children[j].code;
  191 + for(var k=0;k < xlList.length;k++ ){
  192 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  193 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  194 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  195 + }
200 } 196 }
201 } 197 }
202 } 198 }
  199 + initPinYinSelect2('#line',data,'');
  200 +
  201 + });
  202 + });
  203 +
  204 + $("#line").on("change", function(){
  205 + if($("#line").val() == " "){
  206 + $("#company").attr("disabled", false);
  207 + $("#subCompany").attr("disabled", false);
  208 + } else {
  209 + var temp = tempData[$("#line").val()].split(":");
  210 + $("#company").val(temp[0]);
  211 + updateCompany();
  212 + $("#subCompany").val(temp[1]);
  213 + $("#company").attr("disabled", true);
  214 + $("#subCompany").attr("disabled", true);
203 } 215 }
204 - initPinYinSelect2('#line',data,'');  
205 - fage=true;  
206 - } 216 + });
207 217
208 var list; 218 var list;
209 $("#forms tbody").on("click","a",function(){ 219 $("#forms tbody").on("click","a",function(){
src/main/resources/static/pages/forms/statement/historyMessage.html
@@ -81,16 +81,29 @@ @@ -81,16 +81,29 @@
81 locale : 'zh-cn' 81 locale : 'zh-cn'
82 }); 82 });
83 83
84 - $.get('/basic/lineCode2Name',function(result){  
85 - var data=[];  
86 -  
87 - for(var code in result){  
88 - data.push({id: code, text: result[code]});  
89 - }  
90 - console.log(data);  
91 - initPinYinSelect2('#line',data,'');  
92 -  
93 - }) 84 + $.get('/report/lineList',function(xlList){
  85 + var data = [];
  86 +// data.push({id: " ", text: "全部线路"});
  87 + $.get('/user/companyData', function(result){
  88 + for(var i = 0; i < result.length; i++){
  89 + var companyCode = result[i].companyCode;
  90 + var children = result[i].children;
  91 + for(var j = 0; j < children.length; j++){
  92 + var code = children[j].code;
  93 + for(var k=0;k < xlList.length;k++ ){
  94 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  95 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  96 +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  97 + }
  98 + }
  99 + }
  100 + }
  101 + initPinYinSelect2('#line',data,'');
  102 +
  103 + });
  104 + });
  105 +
  106 +
94 $('#code').select2({ 107 $('#code').select2({
95 ajax: { 108 ajax: {
96 url: '/realSchedule/sreachVehic', 109 url: '/realSchedule/sreachVehic',
src/main/resources/static/pages/forms/statement/jobSummary.html
@@ -240,43 +240,46 @@ @@ -240,43 +240,46 @@
240 } 240 }
241 } 241 }
242 $('#fgsdmJob').html(options); 242 $('#fgsdmJob').html(options);
243 - initXl(); 243 +// initXl();
244 } 244 }
245 245
246 - $("#fgsdmJob").on("change",initXl);  
247 - function initXl(){  
248 - var data=[];  
249 - if(fage){  
250 - $("#line").select2("destroy").html('');  
251 - }  
252 - var fgs=$('#fgsdmJob').val();  
253 - var gs=$('#gsdmJob').val();  
254 - for(var i=0;i<xlList.length;i++){  
255 - if(gs!=""){  
256 - if(fgs!=""){  
257 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
258 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
259 - }  
260 - }else{  
261 - if(xlList[i]["gsbm"]==gs){  
262 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 246 + var tempData = {};
  247 + $.get('/report/lineList',function(xlList){
  248 + var data = [];
  249 +// data.push({id: " ", text: "全部线路"});
  250 + $.get('/user/companyData', function(result){
  251 + for(var i = 0; i < result.length; i++){
  252 + var companyCode = result[i].companyCode;
  253 + var children = result[i].children;
  254 + for(var j = 0; j < children.length; j++){
  255 + var code = children[j].code;
  256 + for(var k=0;k < xlList.length;k++ ){
  257 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  258 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  259 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  260 + }
263 } 261 }
264 } 262 }
265 } 263 }
266 - }  
267 - initPinYinSelect2('#line',data,'');  
268 - fage=true;  
269 - } 264 + initPinYinSelect2('#line',data,'');
  265 +
  266 + });
  267 + });
270 268
271 - /* $.get('/basic/lineCode2Name',function(result){  
272 - var data=[];  
273 -  
274 - for(var code in result){  
275 - data.push({id: code, text: result[code]}); 269 + $("#line").on("change", function(){
  270 + if($("#line").val() == " "){
  271 + $("#gsdmJob").attr("disabled", false);
  272 + $("#fgsdmJob").attr("disabled", false);
  273 + } else {
  274 + var temp = tempData[$("#line").val()].split(":");
  275 + $("#gsdmJob").val(temp[0]);
  276 + updateCompany();
  277 + $("#fgsdmJob").val(temp[1]);
  278 + $("#gsdmJob").attr("disabled", true);
  279 + $("#fgsdmJob").attr("disabled", true);
276 } 280 }
277 - initPinYinSelect2('#line',data,'');  
278 -  
279 - }) */ 281 + });
  282 +
280 283
281 jQuery.fn.rowspan = function(colIdx) { //封装的一个JQuery小插件 284 jQuery.fn.rowspan = function(colIdx) { //封装的一个JQuery小插件
282 return this.each(function(){ 285 return this.each(function(){
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
@@ -233,36 +233,44 @@ @@ -233,36 +233,44 @@
233 } 233 }
234 } 234 }
235 $('#subCompany').html(options); 235 $('#subCompany').html(options);
236 - initXl();  
237 } 236 }
238 237
239 - $("#subCompany").on("change",initXl);  
240 - function initXl(){  
241 - var data=[];  
242 - data.push({id:" ", text:"全部线路"});  
243 - if(fage){  
244 - $("#line").select2("destroy").html('');  
245 - }  
246 - var fgs=$('#subCompany').val();  
247 - var gs=$('#company').val();  
248 - for(var i=0;i<xlList.length;i++){  
249 - if(gs!=""){  
250 - if(fgs!=""){  
251 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
252 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
253 - }  
254 - }else{  
255 - if(xlList[i]["gsbm"]==gs){  
256 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 238 + var tempData = {};
  239 + $.get('/report/lineList',function(xlList){
  240 + var data = [];
  241 + data.push({id: " ", text: "全部线路"});
  242 + $.get('/user/companyData', function(result){
  243 + for(var i = 0; i < result.length; i++){
  244 + var companyCode = result[i].companyCode;
  245 + var children = result[i].children;
  246 + for(var j = 0; j < children.length; j++){
  247 + var code = children[j].code;
  248 + for(var k=0;k < xlList.length;k++ ){
  249 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  250 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  251 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  252 + }
257 } 253 }
258 } 254 }
259 } 255 }
  256 + initPinYinSelect2('#line',data,'');
  257 +
  258 + });
  259 + });
  260 +
  261 + $("#line").on("change", function(){
  262 + if($("#line").val() == " "){
  263 + $("#company").attr("disabled", false);
  264 + $("#subCompany").attr("disabled", false);
  265 + } else {
  266 + var temp = tempData[$("#line").val()].split(":");
  267 + $("#company").val(temp[0]);
  268 + updateCompany();
  269 + $("#subCompany").val(temp[1]);
  270 + $("#company").attr("disabled", true);
  271 + $("#subCompany").attr("disabled", true);
260 } 272 }
261 - initPinYinSelect2('#line',data,'');  
262 - line = data[0].id;  
263 - updateModel();  
264 - fage=true;  
265 - } 273 + });
266 274
267 var lb = 0; //标志是否有选择至少一个烂班类型 275 var lb = 0; //标志是否有选择至少一个烂班类型
268 $("#totalLb").on("change", function(){ 276 $("#totalLb").on("change", function(){
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
@@ -291,48 +291,57 @@ @@ -291,48 +291,57 @@
291 } 291 }
292 } 292 }
293 $('#subCompany').html(options); 293 $('#subCompany').html(options);
294 - initXl();  
295 } 294 }
296 295
297 - $("#subCompany").on("change",initXl);  
298 - function initXl(){  
299 - var data=[];  
300 - if(fage){  
301 - $("#line").select2("destroy").html('');  
302 - }  
303 - var fgs=$('#subCompany').val();  
304 - var gs=$('#company').val();  
305 - for(var i=0;i<xlList.length;i++){  
306 - if(gs!=""){  
307 - if(fgs!=""){  
308 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
309 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
310 - }  
311 - }else{  
312 - if(xlList[i]["gsbm"]==gs){  
313 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 296 +
  297 +
  298 + var tempData = {};
  299 + $.get('/report/lineList',function(xlList){
  300 + var data = [];
  301 + $.get('/user/companyData', function(result){
  302 + for(var i = 0; i < result.length; i++){
  303 + var companyCode = result[i].companyCode;
  304 + var children = result[i].children;
  305 + for(var j = 0; j < children.length; j++){
  306 + var code = children[j].code;
  307 + for(var k=0;k < xlList.length;k++ ){
  308 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  309 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  310 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  311 + }
314 } 312 }
315 } 313 }
316 } 314 }
317 - }  
318 - initPinYinSelect2('#line',data,'');  
319 - fage=true;  
320 -  
321 - line = data[0].id;  
322 - updateModel();  
323 -  
324 - var params = {};  
325 - params['line'] = line;  
326 - $get('/busInterval/getDir', params, function(result){  
327 - dirData = createTreeData(result);  
328 - var options = '<option value="">全部方向</option>';  
329 - $.each(dirData, function(i, g){  
330 - options += '<option value="'+g.name+'">'+g.name+'</option>'; 315 + initPinYinSelect2('#line',data,'');
  316 + line = data[0].id;
  317 + updateModel();
  318 +
  319 + var params = {};
  320 + params['line'] = line;
  321 + $get('/busInterval/getDir', params, function(result){
  322 + dirData = createTreeData(result);
  323 + var options = '<option value="">全部方向</option>';
  324 + $.each(dirData, function(i, g){
  325 + options += '<option value="'+g.name+'">'+g.name+'</option>';
  326 + });
  327 + $('#upDown').html(options);
331 }); 328 });
332 - $('#upDown').html(options);  
333 }); 329 });
334 - }  
335 - 330 + });
  331 +
  332 + $("#line").on("change", function(){
  333 + if($("#line").val() == " "){
  334 + $("#company").attr("disabled", false);
  335 + $("#subCompany").attr("disabled", false);
  336 + } else {
  337 + var temp = tempData[$("#line").val()].split(":");
  338 + $("#company").val(temp[0]);
  339 + updateCompany();
  340 + $("#subCompany").val(temp[1]);
  341 + $("#company").attr("disabled", true);
  342 + $("#subCompany").attr("disabled", true);
  343 + }
  344 + });
336 345
337 $("#query").on("click", function (){ 346 $("#query").on("click", function (){
338 jsDoQuery(); 347 jsDoQuery();
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
@@ -138,33 +138,43 @@ @@ -138,33 +138,43 @@
138 } 138 }
139 } 139 }
140 $('#subCompany').html(options); 140 $('#subCompany').html(options);
141 - initXl();  
142 } 141 }
143 -  
144 - $("#subCompany").on("change",initXl);  
145 - function initXl(){  
146 - var data=[];  
147 - if(fage){  
148 - $("#line").select2("destroy").html('');  
149 - }  
150 - var fgs=$('#subCompany').val();  
151 - var gs=$('#company').val();  
152 - for(var i=0;i<xlList.length;i++){  
153 - if(gs!=""){  
154 - if(fgs!=""){  
155 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
156 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
157 - }  
158 - }else{  
159 - if(xlList[i]["gsbm"]==gs){  
160 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 142 + var tempData = {};
  143 + $.get('/report/lineList',function(xlList){
  144 + var data = [];
  145 + $.get('/user/companyData', function(result){
  146 + for(var i = 0; i < result.length; i++){
  147 + var companyCode = result[i].companyCode;
  148 + var children = result[i].children;
  149 + for(var j = 0; j < children.length; j++){
  150 + var code = children[j].code;
  151 + for(var k=0;k < xlList.length;k++ ){
  152 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  153 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  154 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  155 + }
161 } 156 }
162 } 157 }
163 } 158 }
  159 + initPinYinSelect2('#line',data,'');
  160 +
  161 + });
  162 + });
  163 +
  164 + $("#line").on("change", function(){
  165 + if($("#line").val() == " "){
  166 + $("#company").attr("disabled", false);
  167 + $("#subCompany").attr("disabled", false);
  168 + } else {
  169 + var temp = tempData[$("#line").val()].split(":");
  170 + $("#company").val(temp[0]);
  171 + updateCompany();
  172 + $("#subCompany").val(temp[1]);
  173 + $("#company").attr("disabled", true);
  174 + $("#subCompany").attr("disabled", true);
164 } 175 }
165 - initPinYinSelect2('#line',data,'');  
166 - fage=true;  
167 - } 176 + });
  177 +
168 178
169 179
170 $("#query").on("click",jsDoQuery); 180 $("#query").on("click",jsDoQuery);
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
@@ -171,35 +171,46 @@ @@ -171,35 +171,46 @@
171 } 171 }
172 } 172 }
173 $('#subCompany').html(options); 173 $('#subCompany').html(options);
174 - initXl();  
175 } 174 }
176 175
177 - $("#subCompany").on("change",initXl);  
178 - function initXl(){  
179 - var data=[];  
180 - if(fage){  
181 - $("#line").select2("destroy").html('');  
182 - }  
183 - var fgs=$('#subCompany').val();  
184 - var gs=$('#company').val();  
185 - for(var i=0;i<xlList.length;i++){  
186 - if(gs!=""){  
187 - if(fgs!=""){  
188 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
189 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
190 - }  
191 - }else{  
192 - if(xlList[i]["gsbm"]==gs){  
193 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 176 +
  177 + var tempData = {};
  178 + $.get('/report/lineList',function(xlList){
  179 + var data = [];
  180 + $.get('/user/companyData', function(result){
  181 + for(var i = 0; i < result.length; i++){
  182 + var companyCode = result[i].companyCode;
  183 + var children = result[i].children;
  184 + for(var j = 0; j < children.length; j++){
  185 + var code = children[j].code;
  186 + for(var k=0;k < xlList.length;k++ ){
  187 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  188 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  189 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  190 + }
194 } 191 }
195 } 192 }
196 } 193 }
  194 + initPinYinSelect2('#line',data,'');
  195 + line = data[0].id;
  196 + updateModel();
  197 +
  198 + });
  199 + });
  200 +
  201 + $("#line").on("change", function(){
  202 + if($("#line").val() == " "){
  203 + $("#company").attr("disabled", false);
  204 + $("#subCompany").attr("disabled", false);
  205 + } else {
  206 + var temp = tempData[$("#line").val()].split(":");
  207 + $("#company").val(temp[0]);
  208 + updateCompany();
  209 + $("#subCompany").val(temp[1]);
  210 + $("#company").attr("disabled", true);
  211 + $("#subCompany").attr("disabled", true);
197 } 212 }
198 - initPinYinSelect2('#line',data,'');  
199 - line = data[0].id;  
200 - updateModel();  
201 - fage=true;  
202 - } 213 + });
203 214
204 215
205 $("#query").on("click", function(){ 216 $("#query").on("click", function(){
src/main/resources/static/pages/forms/statement/scheduleAnaly_sum.html
@@ -171,38 +171,45 @@ @@ -171,38 +171,45 @@
171 } 171 }
172 } 172 }
173 $('#subCompany').html(options); 173 $('#subCompany').html(options);
174 - initXl();  
175 } 174 }
176 -  
177 - $("#subCompany").on("change",initXl);  
178 - function initXl(){  
179 - var data=[];  
180 - if(fage){  
181 - $("#line").select2("destroy").html('');  
182 - }  
183 - var fgs=$('#subCompany').val();  
184 - var gs=$('#company').val();  
185 - for(var i=0;i<xlList.length;i++){  
186 - if(gs!=""){  
187 - if(fgs!=""){  
188 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
189 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
190 - }  
191 - }else{  
192 - if(xlList[i]["gsbm"]==gs){  
193 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 175 +
  176 + var tempData = {};
  177 + $.get('/report/lineList',function(xlList){
  178 + var data = [];
  179 + $.get('/user/companyData', function(result){
  180 + for(var i = 0; i < result.length; i++){
  181 + var companyCode = result[i].companyCode;
  182 + var children = result[i].children;
  183 + for(var j = 0; j < children.length; j++){
  184 + var code = children[j].code;
  185 + for(var k=0;k < xlList.length;k++ ){
  186 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  187 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  188 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  189 + }
194 } 190 }
195 } 191 }
196 } 192 }
197 - }  
198 - initPinYinSelect2('#line',data,'');  
199 - line = data[0].id;  
200 - updateModel();  
201 - initCl();  
202 -  
203 - fage=true;  
204 - } 193 + initPinYinSelect2('#line',data,'');
  194 + line = data[0].id;
  195 + updateModel();
  196 + initCl();
  197 + });
  198 + });
205 199
  200 + $("#line").on("change", function(){
  201 + if($("#line").val() == " "){
  202 + $("#company").attr("disabled", false);
  203 + $("#subCompany").attr("disabled", false);
  204 + } else {
  205 + var temp = tempData[$("#line").val()].split(":");
  206 + $("#company").val(temp[0]);
  207 + updateCompany();
  208 + $("#subCompany").val(temp[1]);
  209 + $("#company").attr("disabled", true);
  210 + $("#subCompany").attr("disabled", true);
  211 + }
  212 + });
206 213
207 $("#query").on("click", function(){ 214 $("#query").on("click", function(){
208 page = 0; 215 page = 0;
src/main/resources/static/pages/forms/statement/scheduleDaily.html
@@ -70,7 +70,7 @@ word-wrap: break-word; @@ -70,7 +70,7 @@ word-wrap: break-word;
70 <table class="table table-bordered table-hover table-checkable" id="forms"> 70 <table class="table table-bordered table-hover table-checkable" id="forms">
71 <thead> 71 <thead>
72 <tr> 72 <tr>
73 - <th colspan="40">线路调度日报</th> 73 + <th colspan="40"><lable id="xlmc"></lable>线路调度日报</th>
74 </tr> 74 </tr>
75 <tr> 75 <tr>
76 <td rowspan="3"><span >路线名</span></td> 76 <td rowspan="3"><span >路线名</span></td>
@@ -340,32 +340,46 @@ word-wrap: break-word; @@ -340,32 +340,46 @@ word-wrap: break-word;
340 } 340 }
341 } 341 }
342 $('#fgsdmDdrb').html(options); 342 $('#fgsdmDdrb').html(options);
343 - initXl();  
344 } 343 }
345 - $("#fgsdmDdrb").on("change",initXl);  
346 - function initXl(){  
347 - var data=[];  
348 - if(fage){  
349 - $("#line").select2("destroy").html('');  
350 - }  
351 - var fgs=$('#fgsdmDdrb').val();  
352 - var gs=$('#gsdmDdrb').val();  
353 - for(var i=0;i<xlList.length;i++){  
354 - if(gs!=""){  
355 - if(fgs!=""){  
356 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
357 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
358 - }  
359 - }else{  
360 - if(xlList[i]["gsbm"]==gs){  
361 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 344 +
  345 +
  346 + var tempData = {};
  347 + $.get('/report/lineList',function(xlList){
  348 + var data = [];
  349 + $.get('/user/companyData', function(result){
  350 + for(var i = 0; i < result.length; i++){
  351 + var companyCode = result[i].companyCode;
  352 + var children = result[i].children;
  353 + for(var j = 0; j < children.length; j++){
  354 + var code = children[j].code;
  355 + for(var k=0;k < xlList.length;k++ ){
  356 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  357 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  358 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  359 + }
362 } 360 }
363 } 361 }
364 } 362 }
  363 + initPinYinSelect2('#line',data,'');
  364 +
  365 + });
  366 + });
  367 +
  368 + $("#line").on("change", function(){
  369 + if($("#line").val() == " "){
  370 + $("#gsdmDdrb").attr("disabled", false);
  371 + $("#fgsdmDdrb").attr("disabled", false);
  372 + } else {
  373 + var temp = tempData[$("#line").val()].split(":");
  374 + $("#gsdmDdrb").val(temp[0]);
  375 + updateCompany();
  376 + $("#fgsdmDdrb").val(temp[1]);
  377 + $("#gsdmDdrb").attr("disabled", true);
  378 + $("#fgsdmDdrb").attr("disabled", true);
365 } 379 }
366 - initPinYinSelect2('#line',data,'');  
367 - fage=true;  
368 - } 380 + });
  381 +
  382 +
369 $('#export').attr('disabled', "true"); 383 $('#export').attr('disabled', "true");
370 384
371 var line = $("#line").val(); 385 var line = $("#line").val();
@@ -407,6 +421,7 @@ word-wrap: break-word; @@ -407,6 +421,7 @@ word-wrap: break-word;
407 layer.msg("请选择时间"); 421 layer.msg("请选择时间");
408 return; 422 return;
409 } 423 }
  424 + $("#xlmc").html(xlName);
410 $("#ddrbBody").height($(window).height()-100); 425 $("#ddrbBody").height($(window).height()-100);
411 $("c").html("全日"); 426 $("c").html("全日");
412 $("#export").removeAttr("disabled"); 427 $("#export").removeAttr("disabled");
src/main/resources/static/pages/forms/statement/statisticsDaily.html
@@ -206,33 +206,47 @@ @@ -206,33 +206,47 @@
206 } 206 }
207 } 207 }
208 $('#fgsdm').html(options); 208 $('#fgsdm').html(options);
209 - initXl(); 209 +// initXl();
210 } 210 }
211 - $("#fgsdm").on("change",initXl);  
212 - function initXl(){  
213 - var data=[]; 211 +
  212 + var tempData = {};
  213 + $.get('/report/lineList',function(xlList){
  214 + var data = [];
214 data.push({id: " ", text: "全部线路"}); 215 data.push({id: " ", text: "全部线路"});
215 - if(fage){  
216 - $("#line").select2("destroy").html('');  
217 - }  
218 - var fgs=$('#fgsdm').val();  
219 - var gs=$('#gsdm').val();  
220 - for(var i=0;i<xlList.length;i++){  
221 - if(gs!=""){  
222 - if(fgs!=""){  
223 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
224 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
225 - }  
226 - }else{  
227 - if(xlList[i]["gsbm"]==gs){  
228 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 216 + $.get('/user/companyData', function(result){
  217 + for(var i = 0; i < result.length; i++){
  218 + var companyCode = result[i].companyCode;
  219 + var children = result[i].children;
  220 + for(var j = 0; j < children.length; j++){
  221 + var code = children[j].code;
  222 + for(var k=0;k < xlList.length;k++ ){
  223 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  224 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  225 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  226 + }
229 } 227 }
230 } 228 }
231 } 229 }
  230 + initPinYinSelect2('#line',data,'');
  231 +
  232 + });
  233 + });
  234 +
  235 + $("#line").on("change", function(){
  236 + if($("#line").val() == " "){
  237 + $("#gsdm").attr("disabled", false);
  238 + $("#fgsdm").attr("disabled", false);
  239 + } else {
  240 + var temp = tempData[$("#line").val()].split(":");
  241 + $("#gsdm").val(temp[0]);
  242 + updateCompany();
  243 + $("#fgsdm").val(temp[1]);
  244 + $("#gsdm").attr("disabled", true);
  245 + $("#fgsdm").attr("disabled", true);
232 } 246 }
233 - initPinYinSelect2('#line',data,'');  
234 - fage=true;  
235 - } 247 + });
  248 +
  249 +
236 var line =""; 250 var line ="";
237 var xlName =""; 251 var xlName ="";
238 var date = ""; 252 var date = "";