Commit 68477f472e25658815aa5a42c16ed853c7bfb2de

Authored by 徐烜
2 parents 14f7a305 35ff92e6

Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang

Showing 104 changed files with 5278 additions and 1590 deletions
src/main/java/com/bsth/Application.java
... ... @@ -10,6 +10,8 @@ import org.springframework.context.annotation.Bean;
10 10 import org.springframework.context.annotation.Primary;
11 11 import org.springframework.transaction.annotation.EnableTransactionManagement;
12 12  
  13 +import java.util.Calendar;
  14 +import java.util.Date;
13 15 import java.util.concurrent.Executors;
14 16 import java.util.concurrent.ScheduledExecutorService;
15 17  
... ...
src/main/java/com/bsth/controller/gps/GpsController.java
... ... @@ -4,11 +4,15 @@ import com.bsth.data.BasicData;
4 4 import com.bsth.data.gpsdata.GpsEntity;
5 5 import com.bsth.data.gpsdata.GpsRealData;
6 6 import com.bsth.service.gps.GpsService;
  7 +import com.bsth.service.gps.entity.GpsSpeed;
7 8 import com.google.common.base.Splitter;
8 9 import org.springframework.beans.factory.annotation.Autowired;
9 10 import org.springframework.web.bind.annotation.*;
10 11  
11 12 import javax.servlet.http.HttpServletResponse;
  13 +
  14 +import java.text.ParseException;
  15 +import java.util.ArrayList;
12 16 import java.util.List;
13 17 import java.util.Map;
14 18  
... ... @@ -91,11 +95,12 @@ public class GpsController {
91 95  
92 96 /**
93 97 * gps补全
  98 + * type 0 : 实时GPS 1:走补传
94 99 * @return
95 100 */
96 101 @RequestMapping(value = "/gpsCompletion", method = RequestMethod.POST)
97   - public Map<String, Object> gpsCompletion(@RequestParam long schId) {
98   - return gpsService.gpsCompletion(schId);
  102 + public Map<String, Object> gpsCompletion(@RequestParam long schId, @RequestParam int type) {
  103 + return gpsService.gpsCompletion(schId, type);
99 104 }
100 105  
101 106 /**
... ... @@ -178,4 +183,13 @@ public class GpsController {
178 183 @RequestParam(defaultValue = "DESC") String direction){
179 184 return gpsService.safeDrivList(map , page, size, order, direction);
180 185 }
  186 +
  187 + @RequestMapping(value = "/findPosition", method = RequestMethod.GET)
  188 + public List<GpsSpeed> findPosition(@RequestParam String vehicle,@RequestParam String startdate,@RequestParam String enddate) throws ParseException {
  189 + String deviceid = BasicData.deviceId2NbbmMap.inverse().get(vehicle);
  190 + List<GpsSpeed> listGpsSpeed = new ArrayList<GpsSpeed>();
  191 + listGpsSpeed = gpsService.findPosition(deviceid,startdate,enddate);
  192 + return listGpsSpeed;
  193 + }
  194 +
181 195 }
... ...
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
... ... @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON;
4 4 import com.alibaba.fastjson.serializer.PropertyFilter;
5 5 import com.bsth.common.ResponseCode;
6 6 import com.bsth.data.BasicData;
  7 +import com.bsth.data.Station2ParkBuffer;
7 8 import com.bsth.entity.Line;
  9 +import com.bsth.entity.realcontrol.StationToPark;
8 10 import com.google.common.base.Splitter;
9 11 import com.google.common.collect.ArrayListMultimap;
10 12 import com.google.common.collect.BiMap;
... ... @@ -29,6 +31,9 @@ public class BasicDataController {
29 31 BasicData basicData;
30 32  
31 33 Logger logger = LoggerFactory.getLogger(this.getClass());
  34 +
  35 + @Autowired
  36 + Station2ParkBuffer station2ParkBuffer;
32 37  
33 38 @RequestMapping("/cars")
34 39 public Iterable<String> findAllNbbm(Map<String, Object> map){
... ... @@ -180,4 +185,25 @@ public class BasicDataController {
180 185  
181 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 import org.springframework.web.bind.annotation.RequestParam;
9 9 import org.springframework.web.bind.annotation.RestController;
10 10  
11   -import java.util.Map;
12   -
13 11 /**
14 12 *
15 13 * @author BSTH
... ... @@ -24,9 +22,9 @@ public class TrafficManageController {
24 22  
25 23  
26 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 26 try {
29   - return trManageService.setXL(param);
  27 + return trManageService.setXL(ids);
30 28 } catch (Exception exp) {
31 29 throw new Exception(exp.getCause());
32 30 }
... ...
src/main/java/com/bsth/controller/sys/IntervalController.java 0 → 100644
  1 +package com.bsth.controller.sys;
  2 +
  3 +import java.util.Map;
  4 +
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestMethod;
  8 +import org.springframework.web.bind.annotation.RequestParam;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import com.alibaba.fastjson.JSON;
  12 +import com.bsth.entity.sys.Interval;
  13 +import com.bsth.service.sys.IntervalService;
  14 +
  15 +@RestController
  16 +@RequestMapping("interval")
  17 +public class IntervalController {
  18 +
  19 + @Autowired
  20 + IntervalService intervalService;
  21 +
  22 + @RequestMapping(value = "/save", method = RequestMethod.POST)
  23 + public Map<String, Object> save(@RequestParam String array){
  24 + return intervalService.saveList(JSON.parseArray(array, Interval.class));
  25 + }
  26 +}
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -134,6 +134,9 @@ public class BasicData implements CommandLineRunner {
134 134 @Autowired
135 135 GeoCacheData geoCacheData;
136 136  
  137 + @Autowired
  138 + Station2ParkBuffer station2ParkBuffer;
  139 +
137 140  
138 141 @Override
139 142 public void run() {
... ... @@ -160,6 +163,7 @@ public class BasicData implements CommandLineRunner {
160 163 loadBusinessInfo();
161 164  
162 165 geoCacheData.loadData();
  166 + station2ParkBuffer.saveAll();
163 167 logger.info("加载基础数据成功!,");
164 168 } catch (Exception e) {
165 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 84 Calendar calendar = Calendar.getInstance();
85 85 int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR);
86 86  
87   - String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=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 88 JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource());
89 89  
90 90 List<GpsEntity> list =
... ...
src/main/java/com/bsth/data/pilot80/PilotReport.java
... ... @@ -2,7 +2,6 @@ package com.bsth.data.pilot80;
2 2  
3 3 import com.bsth.data.BasicData;
4 4 import com.bsth.data.LineConfigData;
5   -import com.bsth.data.gpsdata.GpsEntity;
6 5 import com.bsth.data.gpsdata.GpsRealData;
7 6 import com.bsth.data.msg_queue.DirectivePushQueue;
8 7 import com.bsth.data.schedule.DayOfSchedule;
... ... @@ -16,7 +15,6 @@ import com.bsth.repository.directive.D80Repository;
16 15 import com.bsth.repository.directive.DC0A4Repository;
17 16 import com.bsth.service.directive.DirectiveService;
18 17 import com.bsth.websocket.handler.SendUtils;
19   -import com.google.common.collect.ArrayListMultimap;
20 18 import org.apache.commons.lang3.StringUtils;
21 19 import org.slf4j.Logger;
22 20 import org.slf4j.LoggerFactory;
... ... @@ -26,289 +24,278 @@ import org.springframework.stereotype.Component;
26 24 import java.util.ArrayList;
27 25 import java.util.Collection;
28 26 import java.util.List;
  27 +import java.util.concurrent.ConcurrentHashMap;
29 28  
30 29 /**
31   - *
32   - * @ClassName: PilotReport
33   - * @Description: TODO(设备80协议上报处理)
34 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 35 @Component
39 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 944 ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list);
945 945 carExecutePlanMap.put(nbbm, sch);
946 946  
  947 + if(sch==null)
  948 + return;
947 949 try {
948 950 GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm));
949 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 231 public static void put(SchEditInfo sei) {
232 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 */
6 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 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 41 for(String k : ks){
42 42 v =map.get(k);
43 43 if(StringUtils.isNotEmpty(v))
44   - cont += " and t2." + BatchSaveUtils.propertyToField(k) + "='" + v + "'";
  44 + cont += " and " + BatchSaveUtils.propertyToField(k) + "='" + v + "'";
45 45 }
46 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 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 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 10 * @ClassName: 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 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 108 public String getNbbm() {
128 109 return nbbm;
... ... @@ -131,6 +112,14 @@ public class D80 {
131 112 public void setNbbm(String nbbm) {
132 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 125 @Transient
... ...
src/main/java/com/bsth/entity/excep/Speeding.java
... ... @@ -52,6 +52,33 @@ public class Speeding {
52 52 private Float lat;
53 53  
54 54 /**
  55 + * 超速结束时的经度
  56 + */
  57 + private Float endlon;
  58 +
  59 + public Float getEndlon() {
  60 + return endlon;
  61 + }
  62 +
  63 + public void setEndlon(Float endlon) {
  64 + this.endlon = endlon;
  65 + }
  66 +
  67 + public Float getEndlat() {
  68 + return endlat;
  69 + }
  70 +
  71 + public void setEndlat(Float endlat) {
  72 + this.endlat = endlat;
  73 + }
  74 +
  75 + /**
  76 + * 超速结束时的纬度
  77 + */
  78 + private Float endlat;
  79 +
  80 +
  81 + /**
55 82 * 速度
56 83 */
57 84 private Float speed;
... ...
src/main/java/com/bsth/entity/realcontrol/ChildTaskPlan.java
... ... @@ -84,10 +84,25 @@ public class ChildTaskPlan {
84 84 private boolean destroy;
85 85  
86 86 /**
87   - * 烂班原因
  87 + * 烂班原因 -烂班时,该字段仍有值并 =reason
88 88 */
89 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 107 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
93 108 private Date createDate;
... ... @@ -238,4 +253,28 @@ public class ChildTaskPlan {
238 253 public void setCreateDate(Date createDate) {
239 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/entity/sys/Interval.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.GeneratedValue;
  8 +import javax.persistence.GenerationType;
  9 +import javax.persistence.Id;
  10 +import javax.persistence.Table;
  11 +
  12 +
  13 +@Entity
  14 +@Table(name = "bsth_c_interval")
  15 +public class Interval {
  16 +
  17 + @Id
  18 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  19 + private Integer id;
  20 +
  21 + /** 大间隔等级 */
  22 + private String level;
  23 + /** 高峰*/
  24 + private Integer peak;
  25 + public Integer getPeak() {
  26 + return peak;
  27 + }
  28 +
  29 + public void setPeak(Integer peak) {
  30 + this.peak = peak;
  31 + }
  32 +
  33 + public Integer getTrough() {
  34 + return trough;
  35 + }
  36 +
  37 + public void setTrough(Integer trough) {
  38 + this.trough = trough;
  39 + }
  40 +
  41 +
  42 + public Integer getCreateBy() {
  43 + return createBy;
  44 + }
  45 +
  46 + public void setCreateBy(Integer createBy) {
  47 + this.createBy = createBy;
  48 + }
  49 +
  50 + public Date getCreateDate() {
  51 + return createDate;
  52 + }
  53 +
  54 + public void setCreateDate(Date createDate) {
  55 + this.createDate = createDate;
  56 + }
  57 +
  58 + public Integer getUpdateBy() {
  59 + return updateBy;
  60 + }
  61 +
  62 + public void setUpdateBy(Integer updateBy) {
  63 + this.updateBy = updateBy;
  64 + }
  65 +
  66 + public Date getUpdateDate() {
  67 + return updateDate;
  68 + }
  69 +
  70 + public void setUpdateDate(Date updateDate) {
  71 + this.updateDate = updateDate;
  72 + }
  73 +
  74 + /** 低谷 */
  75 + private Integer trough;
  76 +
  77 + @Column(name = "create_by")
  78 + private Integer createBy;
  79 +
  80 + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  81 + private Date createDate;
  82 +
  83 + @Column(name = "update_by")
  84 + private Integer updateBy;
  85 +
  86 + @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  87 + private Date updateDate;
  88 +
  89 + public Integer getId() {
  90 + return id;
  91 + }
  92 +
  93 + public void setId(Integer id) {
  94 + this.id = id;
  95 + }
  96 +
  97 + public String getLevel() {
  98 + return level;
  99 + }
  100 +
  101 + public void setLevel(String level) {
  102 + this.level = level;
  103 + }
  104 +
  105 +}
... ...
src/main/java/com/bsth/repository/LineRepository.java
... ... @@ -39,6 +39,6 @@ public interface LineRepository extends BaseRepository&lt;Line, Integer&gt; {
39 39  
40 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 43 public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line);
44 44 }
... ...
src/main/java/com/bsth/repository/StationRouteRepository.java
... ... @@ -266,7 +266,6 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
266 266 "StationRoute s " +
267 267 "WHERE " +
268 268 "s.destroy = 0 " +
269   - "and s.lineCode in(select lineCode from Line where inUse = 1) " +
270 269 "ORDER BY " +
271 270 "lineCode,directions,stationRouteCode")
272 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 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 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 85 List<Object[]> account(String line,String date,String code);
86 86  
87 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/repository/sys/IntervalRepository.java 0 → 100644
  1 +package com.bsth.repository.sys;
  2 +
  3 +
  4 +import org.springframework.stereotype.Repository;
  5 +import com.bsth.entity.sys.Interval;
  6 +import com.bsth.repository.BaseRepository;
  7 +
  8 +@Repository
  9 +public interface IntervalRepository extends BaseRepository<Interval, Integer> {
  10 +
  11 +}
... ...
src/main/java/com/bsth/service/TrafficManageService.java
... ... @@ -24,7 +24,7 @@ public interface TrafficManageService {
24 24 *
25 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
... ... @@ -302,7 +302,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
302 302  
303 303 Map<String, List<D80>> rs = new HashMap<>();
304 304 for (String code : lineList)
305   - rs.put(code, pilotReport.unconfirmed80(Integer.parseInt(code)));
  305 + rs.put(code, pilotReport.unconfirmed80(code));
306 306  
307 307 return rs;
308 308 }
... ...
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
... ... @@ -9,6 +9,7 @@ import java.text.SimpleDateFormat;
9 9 import java.util.ArrayList;
10 10 import java.util.Date;
11 11 import java.util.HashMap;
  12 +import java.util.Iterator;
12 13 import java.util.List;
13 14 import java.util.Map;
14 15  
... ... @@ -24,6 +25,8 @@ import com.bsth.service.excep.SpeedingService;
24 25 import com.bsth.util.EchartConver;
25 26 import com.bsth.util.PageHelper;
26 27 import com.bsth.util.PageObject;
  28 +import com.bsth.util.TransGPS;
  29 +import com.bsth.util.TransGPS.Location;
27 30 import com.bsth.util.db.DBUtils_MS;
28 31 import com.github.abel533.echarts.Option;
29 32 import com.google.gson.Gson;
... ... @@ -39,7 +42,7 @@ public class SpeedingServiceImpl implements SpeedingService {
39 42 ResultSet rs = null;
40 43 int page=Integer.parseInt(map.get("page").toString());
41 44 List<Speeding> list=new ArrayList<Speeding>();
42   - String sql="select * from bsth_c_speeding where 1=1 ";
  45 + String sql="select * from bsth_c_speeding where speed > 60 ";
43 46 Object line=map.get("line");
44 47 Object nbbm=map.get("nbbm");
45 48 Object updown=map.get("updown");
... ... @@ -83,7 +86,6 @@ public class SpeedingServiceImpl implements SpeedingService {
83 86  
84 87 }
85 88  
86   -
87 89 /*sql +=" order by id limit ?,?";*/
88 90  
89 91  
... ... @@ -104,17 +106,23 @@ public class SpeedingServiceImpl implements SpeedingService {
104 106 }
105 107  
106 108 static List<Speeding> resultSet2Set(ResultSet rs) throws SQLException{
107   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
  109 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
108 110 List<Speeding> list=new ArrayList<Speeding>();
109 111 Speeding speeding;
  112 + Float lon, lat;
  113 + Location location;
110 114 while(rs.next()){
  115 + lon = rs.getFloat("lon");
  116 + lat = rs.getFloat("lat");
  117 + location = TransGPS.LocationMake(lon, lat);
  118 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location));
111 119 speeding=new Speeding();
112 120 speeding.setId(Integer.valueOf(rs.getObject("id").toString()));
113   - speeding.setLat(Float.valueOf(rs.getObject("lat").toString()));
  121 + speeding.setLon((float)location.getLng());
  122 + speeding.setLat((float)location.getLat());
114 123 speeding.setLine(Integer.valueOf(rs.getObject("line").toString()));
115 124 //run 时注解
116 125 speeding.setLineName(BasicData.lineCode2NameMap.get(speeding.getLine().toString()));
117   - speeding.setLon(Float.valueOf(rs.getObject("lon").toString()));
118 126 speeding.setSpeed(Float.valueOf(rs.getObject("speed").toString()));
119 127 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
120 128 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp())));
... ... @@ -127,14 +135,12 @@ public class SpeedingServiceImpl implements SpeedingService {
127 135  
128 136 @Override
129 137 public PageObject<Speeding> Pagequery(Map<String, Object> map) {
130   - String sql="select count(*) record from bsth_c_speeding where 1=1 ";
  138 +/* String sql="select count(*) record from bsth_c_speeding where 1=1 ";
131 139 Object line=map.get("line");
132 140 Object nbbm=map.get("nbbm");
133 141 Object updown=map.get("updown");
134 142 Object startDate=map.get("startDate");
135 143 Object endDate=map.get("endDate");
136   - //时间转换
137   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
138 144  
139 145 if(line!=null){
140 146 sql +=" and line like'%"+line.toString().trim()+"%'";
... ... @@ -186,14 +192,17 @@ public class SpeedingServiceImpl implements SpeedingService {
186 192 e.printStackTrace();
187 193 }finally {
188 194 DBUtils_MS.close(rs, ps, conn);
189   - }
  195 + }*/
190 196  
  197 + //时间转换
  198 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
191 199 List<Speeding> list=findAll(map);
192 200 List<Speeding> listResult = new ArrayList<Speeding>();
193 201 int curPage;//页码
194 202 int pageData;//每页的记录条数
195 203 int start;//起始数据下标
196 204 int totalPage;//总页数
  205 + int totalData = 0;
197 206 if(list.size()>1){
198 207 Speeding speedingNow;//下标为i的车
199 208 Speeding speedingLast;//下标为i-1的车
... ... @@ -206,11 +215,20 @@ public class SpeedingServiceImpl implements SpeedingService {
206 215 strLast = speedingLast.getVehicle()+speedingLast.getLine()+speedingLast.getUpDown();
207 216 //同一车辆同一线路同一方向并且该记录的超速的开始时间减去上一条超速记录的结束时间小于等于10s,证明该车超速。//PS:祛除数据库中的重复发送数据
208 217 if(strNow.equals(strLast) && Math.abs(speedingNow.getTimestamp()-speedingLast.getTimestamp())<=10*1000 && (speedingNow.getTimestamp()-speedingLast.getTimestamp()!=0)){
209   - speedingLast.setEndtimestamp(speedingNow.getTimestamp());
  218 + speedingLast.setEndtimestamp(speedingNow.getTimestamp());//设置结束时间时间戳
210 219 speedingLast.setEndtimestampDate(sdf.format(new Date(speedingNow.getTimestamp())));//设置结束时间
  220 + speedingLast.setEndlon(speedingNow.getLon());//设置结束时的经度
  221 + speedingLast.setEndlat(speedingNow.getLat());//设置结束时的纬度
211 222 listResult.add(speedingLast);
212 223 }
213 224 }
  225 + Iterator<Speeding> speedIt = listResult.iterator();
  226 + while(speedIt.hasNext()){
  227 + Speeding speeding = speedIt.next();
  228 + if(speeding.getEndtimestamp()-speeding.getTimestamp()<=1000){
  229 + speedIt.remove();
  230 + }
  231 + }
214 232  
215 233 totalData = listResult.size();//总记录条数。
216 234 if(map.get("curPage") == null || map.get("curPage").equals("0")){
... ...
src/main/java/com/bsth/service/gps/GpsService.java
1 1 package com.bsth.service.gps;
2 2  
  3 +import com.bsth.data.gpsdata.GpsEntity;
3 4 import com.bsth.service.gps.entity.GpsOutbound_DTO;
  5 +import com.bsth.service.gps.entity.GpsSpeed;
4 6 import com.bsth.service.gps.entity.GpsSpeed_DTO;
5 7  
6 8 import javax.servlet.http.HttpServletResponse;
  9 +
  10 +import java.text.ParseException;
7 11 import java.util.List;
8 12 import java.util.Map;
9 13  
... ... @@ -21,7 +25,7 @@ public interface GpsService {
21 25  
22 26 Map<String,Object> findRoadSpeed(String lineCode);
23 27  
24   - Map<String,Object> gpsCompletion(long schId);
  28 + Map<String,Object> gpsCompletion(long schId, int type);
25 29  
26 30 Map<String,Object> history_v2(String nbbm, long st, long et);
27 31  
... ... @@ -38,4 +42,7 @@ public interface GpsService {
38 42 void abnormalExcel(String nbbm, long st, long et, HttpServletResponse resp);
39 43  
40 44 void arrivalExcel(String nbbm, long st, long et, HttpServletResponse resp);
  45 +
  46 + List<GpsSpeed> findPosition(String deviceid, String startdate,
  47 + String enddate) throws ParseException;
41 48 }
... ...
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
... ... @@ -45,6 +45,8 @@ import java.sql.Connection;
45 45 import java.sql.PreparedStatement;
46 46 import java.sql.ResultSet;
47 47 import java.text.DecimalFormat;
  48 +import java.text.ParseException;
  49 +import java.text.SimpleDateFormat;
48 50 import java.util.*;
49 51  
50 52 @Service
... ... @@ -445,7 +447,7 @@ public class GpsServiceImpl implements GpsService {
445 447 * @return
446 448 */
447 449 @Override
448   - public Map<String, Object> gpsCompletion(long schId) {
  450 + public Map<String, Object> gpsCompletion(long schId, int type) {
449 451 Map<String, Object> rs = new HashMap<>();
450 452  
451 453 try {
... ... @@ -479,12 +481,18 @@ public class GpsServiceImpl implements GpsService {
479 481 });
480 482 Map<String, Object> fs = list.get(0);
481 483 //替换设备号和时间
482   - 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);
483 485  
484 486 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh());
  487 + int serviceState;
485 488 for (Map<String, Object> map : list) {
486 489 map.put("device_id", deviceId);
487 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 + }
488 496 }
489 497  
490 498 String sqlBefore = "insert into bsth_c_template(", sqlValues = " values(";
... ... @@ -975,4 +983,57 @@ public class GpsServiceImpl implements GpsService {
975 983 }
976 984 return true;
977 985 }
  986 +
  987 + @Override
  988 + public List<GpsSpeed> findPosition(String deviceid, String startdate,
  989 + String enddate) throws ParseException{
  990 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  991 + Calendar c = Calendar.getInstance();
  992 + Date date = sdf.parse(startdate);
  993 + c.setTime(date);
  994 + int daysYear = c.get(Calendar.DAY_OF_YEAR);//获取当前是今年的第几天。
  995 +
  996 + long startTime = sdf.parse(startdate).getTime();
  997 + long endTime = sdf.parse(enddate).getTime();
  998 +
  999 + String sql = "select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,speed_gps from bsth_c_gps_info where days_year=? and device_id=? and ts >= ? and ts <= ?" +
  1000 + " ORDER BY TS ";
  1001 + Connection conn = null;
  1002 + PreparedStatement ps = null;
  1003 + ResultSet rs = null;
  1004 + List<GpsSpeed> listResult = new ArrayList<GpsSpeed>();
  1005 + GpsSpeed gpsSpeed = null;
  1006 + try {
  1007 + conn = DBUtils_MS.getConnection();
  1008 + ps = conn.prepareStatement(sql);
  1009 + ps.setInt(1, daysYear);
  1010 + ps.setString(2, deviceid);
  1011 + ps.setLong(3,startTime);
  1012 + ps.setLong(4,endTime);
  1013 + rs = ps.executeQuery();
  1014 + Float lon, lat;
  1015 + Location location;
  1016 + while (rs.next()) {
  1017 + gpsSpeed = new GpsSpeed();
  1018 + // to 百度坐标
  1019 + lon = rs.getFloat("LON");
  1020 + lat = rs.getFloat("LAT");
  1021 + location = TransGPS.LocationMake(lon, lat);
  1022 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location));
  1023 + gpsSpeed.setVehicle(rs.getString("device_id"));
  1024 + gpsSpeed.setLon((float)location.getLng());
  1025 + gpsSpeed.setLat((float)location.getLat());
  1026 + gpsSpeed.setSpeed(rs.getFloat("speed_gps"));
  1027 + gpsSpeed.setTimestamp(rs.getLong("TS"));
  1028 + // 上下行
  1029 + listResult.add(gpsSpeed);
  1030 + }
  1031 + } catch (Exception e) {
  1032 + e.printStackTrace();
  1033 + } finally {
  1034 + DBUtils_MS.close(rs, ps, conn);
  1035 + }
  1036 + return listResult;
  1037 +
  1038 + }
978 1039 }
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -17,17 +17,24 @@ import java.util.List;
17 17 import java.util.Map;
18 18 import java.util.Set;
19 19  
  20 +import org.apache.commons.lang3.StringEscapeUtils;
20 21 import org.springframework.beans.factory.annotation.Autowired;
  22 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
21 23 import org.springframework.jdbc.core.JdbcTemplate;
22 24 import org.springframework.jdbc.core.RowMapper;
23 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 31 import com.bsth.entity.realcontrol.ChildTaskPlan;
26 32 import com.bsth.entity.realcontrol.ScheduleRealInfo;
27 33 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
28 34 import com.bsth.service.BusIntervalService;
29 35 import com.bsth.service.schedule.PeopleCarPlanService;
30 36 import com.bsth.util.ReportUtils;
  37 +import com.google.gson.Gson;
31 38  
32 39  
33 40 @Service
... ... @@ -1838,7 +1845,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1838 1845 }
1839 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 1850 if(line.length() != 0){
1843 1851 sql += " and xl_bm = '"+line+"'";
1844 1852 }
... ... @@ -1865,6 +1873,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1865 1873 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
1866 1874 ScheduleRealInfo schedule = new ScheduleRealInfo();
1867 1875 schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
  1876 + schedule.setXlBm(rs.getString("xl_bm"));
1868 1877 schedule.setXlName(rs.getString("xl_name"));
1869 1878 schedule.setLpName(rs.getString("lp_name"));
1870 1879 schedule.setBcType(rs.getString("bc_type"));
... ... @@ -1918,7 +1927,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1918 1927 for(ScheduleRealInfo schedule : list){
1919 1928 if(schedule.getXlName() == null || schedule.getXlName().trim().length() == 0)
1920 1929 continue;
1921   - String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlName();
  1930 + String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlBm();
1922 1931 if(!keyMap.containsKey(key))
1923 1932 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
1924 1933 keyMap.get(key).add(schedule);
... ... @@ -1929,8 +1938,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1929 1938 int sjbc = 0, sddf = 0, zddf = 0,
1930 1939 dxtz = 0, lbtz = 0;
1931 1940 for(ScheduleRealInfo schedule : keyMap.get(key)){
  1941 + boolean flag = false;
1932 1942 if(schedule.getFcsjActual() != null && schedule.getStatus() != -1){
1933   - boolean flag = false;
1934 1943 sjbc++;
1935 1944 if(schedule.getDfsj() != null && !schedule.getDfsj().equals(schedule.getFcsj())){
1936 1945 flag = true;
... ... @@ -1939,17 +1948,16 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1939 1948 zddf++;
1940 1949 else
1941 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 1962 tempMap.put("date", date);
1955 1963 String[] keys = key.split("/");
... ... @@ -1960,22 +1968,23 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1960 1968 tempMap.put("sddf", sddf);
1961 1969 tempMap.put("zddf", zddf);
1962 1970 tempMap.put("dfhj", sddf + zddf);
1963   - tempMap.put("dxtz", dxtz);
  1971 +// tempMap.put("dxtz", dxtz);
1964 1972 tempMap.put("lbtz", lbtz);
1965   - tempMap.put("correct", sddf + zddf + dxtz + lbtz);
  1973 + tempMap.put("correct", sddf + zddf + lbtz);
1966 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 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 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 1988 Map<String, Object> tempMap = new HashMap<String, Object>();
1980 1989 int sjbc = 0, sddf = 0, zddf = 0,
1981 1990 dxtz = 0, lbtz = 0;
... ... @@ -1983,7 +1992,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1983 1992 sjbc += (int)m.get("sjbc");
1984 1993 sddf += (int)m.get("sddf");
1985 1994 zddf += (int)m.get("zddf");
1986   - dxtz += (int)m.get("dxtz");
  1995 +// dxtz += (int)m.get("dxtz");
1987 1996 lbtz += (int)m.get("lbtz");
1988 1997 }
1989 1998 tempMap.put("date", date);
... ... @@ -1995,22 +2004,22 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1995 2004 tempMap.put("sddf", sddf);
1996 2005 tempMap.put("zddf", zddf);
1997 2006 tempMap.put("dfhj", sddf + zddf);
1998   - tempMap.put("dxtz", dxtz);
  2007 +// tempMap.put("dxtz", dxtz);
1999 2008 tempMap.put("lbtz", lbtz);
2000 2009 tempMap.put("correct", sddf + zddf + dxtz + lbtz);
2001 2010 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
2002 2011 tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%");
2003 2012 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%");
2004 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 2016 String key1 = keys[0];
2008 2017 if(!keyMap1.containsKey(key1))
2009 2018 keyMap1.put(key1, new ArrayList<Map<String, Object>>());
2010 2019 keyMap1.get(key1).add(tempMap);
2011   - }
  2020 + }*/
2012 2021  
2013   - for(String key : keyMap1.keySet()){
  2022 + /*for(String key : keyMap1.keySet()){
2014 2023 Map<String, Object> tempMap = new HashMap<String, Object>();
2015 2024 int sjbc = 0, sddf = 0, zddf = 0,
2016 2025 dxtz = 0, lbtz = 0, lines = 0;
... ... @@ -2018,7 +2027,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2018 2027 sjbc += (int)m.get("sjbc");
2019 2028 sddf += (int)m.get("sddf");
2020 2029 zddf += (int)m.get("zddf");
2021   - dxtz += (int)m.get("dxtz");
  2030 +// dxtz += (int)m.get("dxtz");
2022 2031 lbtz += (int)m.get("lbtz");
2023 2032 lines += (int)m.get("lines");
2024 2033 }
... ... @@ -2029,17 +2038,17 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2029 2038 tempMap.put("sddf", sddf);
2030 2039 tempMap.put("zddf", zddf);
2031 2040 tempMap.put("dfhj", sddf + zddf);
2032   - tempMap.put("dxtz", dxtz);
  2041 +// tempMap.put("dxtz", dxtz);
2033 2042 tempMap.put("lbtz", lbtz);
2034 2043 tempMap.put("correct", sddf + zddf + dxtz + lbtz);
2035 2044 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
2036 2045 tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%");
2037 2046 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%");
2038 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 2050 resList.add(tempMap);
2042   - }
  2051 + }*/
2043 2052  
2044 2053 if(resList.size() != 0){
2045 2054 Map<String, Object> tempMap = new HashMap<String, Object>();
... ... @@ -2049,10 +2058,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2049 2058 sjbc += (int)m.get("sjbc");
2050 2059 sddf += (int)m.get("sddf");
2051 2060 zddf += (int)m.get("zddf");
2052   - dxtz += (int)m.get("dxtz");
  2061 +// dxtz += (int)m.get("dxtz");
2053 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 2065 Map<String, Object> temp = new HashMap<String, Object>();
2057 2066 temp.put("date", "合计");
2058 2067 temp.put("lines", m0.get("lines"));
... ... @@ -2060,15 +2069,15 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2060 2069 temp.put("sddf", m0.get("sddf"));
2061 2070 temp.put("zddf", m0.get("zddf"));
2062 2071 temp.put("dfhj", m0.get("dfhj"));
2063   - temp.put("dxtz", m0.get("dxtz"));
  2072 +// temp.put("dxtz", m0.get("dxtz"));
2064 2073 temp.put("lbtz", m0.get("lbtz"));
2065 2074 temp.put("correct", m0.get("correct"));
2066 2075 temp.put("dfbl", m0.get("dfbl"));
2067 2076 temp.put("dxbl", m0.get("dxbl"));
2068 2077 temp.put("lbbl", m0.get("lbbl"));
2069 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 2081 Map<String, Object> temp = new HashMap<String, Object>();
2073 2082 temp.put("date", "合计");
2074 2083 temp.put("lines", m.get("lines"));
... ... @@ -2076,14 +2085,14 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2076 2085 temp.put("sddf", m.get("sddf"));
2077 2086 temp.put("zddf", m.get("zddf"));
2078 2087 temp.put("dfhj", m.get("dfhj"));
2079   - temp.put("dxtz", m.get("dxtz"));
  2088 +// temp.put("dxtz", m.get("dxtz"));
2080 2089 temp.put("lbtz", m.get("lbtz"));
2081 2090 temp.put("correct", m.get("correct"));
2082 2091 temp.put("dfbl", m.get("dfbl"));
2083 2092 temp.put("dxbl", m.get("dxbl"));
2084 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 2097 tempMap.put("date", "合计");
2089 2098 tempMap.put("lines", lines);
... ... @@ -2091,16 +2100,99 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2091 2100 tempMap.put("sddf", sddf);
2092 2101 tempMap.put("zddf", zddf);
2093 2102 tempMap.put("dfhj", sddf + zddf);
2094   - tempMap.put("dxtz", dxtz);
  2103 +// tempMap.put("dxtz", dxtz);
2095 2104 tempMap.put("lbtz", lbtz);
2096   - tempMap.put("correct", sddf + zddf + dxtz + lbtz);
  2105 + tempMap.put("correct", sddf + zddf + lbtz);
2097 2106 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
2098   - tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%");
  2107 +
2099 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 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 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 668 * @return String
669 669 */
670 670 public String newTextFileToFTP(List<Object[]> objects,Integer lineId) {
671   -
672 671 // 返回值String
673 672 String stationRStr = "";
674   -
675 673 // windows下的文本文件换行符
676 674 //String enterStr = "\r\n";
677   -
678 675 // linux/unix下的文本文件换行符
679 676 String enterStr = "\r";
680   -
  677 + int defaultZdxh = 0;
681 678 if(objects.size()>0) {
682   -
683 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 689 lat = "\t" + lat;
692 690  
... ... @@ -696,23 +694,32 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
696 694 String stationMake = "";
697 695  
698 696 if(stationMakeStr.equals("E")) {
699   -
700 697 stationMake = "\t2";
701   -
702 698 }else {
703   -
704 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 706 stationNo = "\t" + stationNo;
712 707  
713 708 // 站点编码
714 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 723 stationCode = "\t" +stationCode;
717 724  
718 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 739  
733 740 // 限速
734 741 String sleepStr = "";
735   -
736 742 // 方向
737 743 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString());
738   -
739 744 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
740 745 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
741   -
742 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 749 }else if(sobje.size()>1){
749   -
750   - /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */
751 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 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 784 for(int i = 0; i<objects.size();i++) {
786 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 793 lat = "\t" + lat;
792 794 // 站点类型
793 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 804 String stationNo = "\t" + xh;
803 805 // 站点编码
804 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 818 stationCode = "\t" +stationCode;
806 819 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000;
807 820 String tempDistc = String.valueOf((int) dis);
... ... @@ -817,20 +830,28 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
817 830 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
818 831 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
819 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 835 }else if(sobje.size()>1){
823   - /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */
824 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 855 xh++;
835 856 restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
836 857 }
... ...
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
... ... @@ -16,6 +16,7 @@ import com.bsth.repository.schedule.*;
16 16 import com.bsth.repository.traffic.SKBUploadLoggerRepository;
17 17 import com.bsth.security.util.SecurityUtils;
18 18 import com.bsth.service.TrafficManageService;
  19 +import com.bsth.service.traffic.YgcBasicDataService;
19 20 import com.bsth.util.TimeUtils;
20 21 import com.bsth.util.db.DBUtils_MS;
21 22 import com.bsth.webService.trafficManage.geotool.services.InternalPortType;
... ... @@ -23,6 +24,7 @@ import com.bsth.webService.trafficManage.geotool.services.Internal;
23 24 import com.bsth.webService.trafficManage.org.tempuri.Results;
24 25 import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator;
25 26 import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap;
  27 +import org.apache.commons.lang.StringUtils;
26 28 import org.apache.commons.lang.time.DateUtils;
27 29 import org.slf4j.Logger;
28 30 import org.slf4j.LoggerFactory;
... ... @@ -99,7 +101,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
99 101  
100 102 // 线路站点repository
101 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 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 127 private final String userNameOther = "user";
131 128 // 密码
132 129 private final String passwordOther = "user";
... ... @@ -134,34 +131,25 @@ public class TrafficManageServiceImpl implements TrafficManageService{
134 131 * 上传线路信息
135 132 */
136 133 @Override
137   - public String setXL(Map<String, Object> param) {
  134 + public String setXL(String ids) {
138 135 String result = "failure";
139 136 StringBuffer sBuffer = new StringBuffer();
  137 + String[] idArray = ids.split(",");
140 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 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 153 return result;
166 154 }
167 155 sBuffer.append("<LINE_ID>").append(line.getId()).append("</LINE_ID>");
... ... @@ -190,32 +178,24 @@ public class TrafficManageServiceImpl implements TrafficManageService{
190 178 packagStationPointXml(downStationsList, sBuffer, startId);
191 179 }
192 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 196 } catch (Exception e) {
214 197 logger.error("setXL:",e);
215 198 e.printStackTrace();
216   - }finally{
217   - logger.info("setXL:"+sBuffer.toString());
218   - logger.info("setXL:"+result);
219 199 }
220 200 return result;
221 201 }
... ... @@ -1146,11 +1126,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1146 1126 }else{
1147 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 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 2  
3 3 import com.bsth.common.ResponseCode;
4 4 import com.bsth.data.BasicData;
  5 +import com.bsth.data.Station2ParkBuffer;
5 6 import com.bsth.data.schedule.DayOfSchedule;
6 7 import com.bsth.entity.realcontrol.ChildTaskPlan;
7 8 import com.bsth.entity.realcontrol.ScheduleRealInfo;
... ... @@ -45,14 +46,21 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
45 46 try {
46 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 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 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 57 if(t.getDestroyReason() == null)
55 58 t.setDestroyReason("");
  59 +
  60 + //烂班说明,为兼容之前的数据结构
  61 + if(t.isDestroy() && StringUtils.isEmpty(t.getDestroyReason()))
  62 + t.setDestroyReason(t.getReason());
  63 +
56 64 //先持久化子任务
57 65 rs = super.save(t);
58 66 //关联主任务
... ... @@ -60,6 +68,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
60 68 dayOfSchedule.save(sch);
61 69 //直接持久化
62 70 //scheduleRealInfoRepository.save(sch);
  71 + //站到场对照
  72 + t.setSchedule(sch);
  73 + Station2ParkBuffer.put(t);
63 74  
64 75 rs.put("status", ResponseCode.SUCCESS);
65 76 rs.put("t", sch);
... ... @@ -71,6 +82,17 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
71 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 96 @Override
75 97 public Map<String, Object> delete(Long id) {
76 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 15 import com.bsth.data.schedule.ScheduleComparator;
16 16 import com.bsth.data.schedule.edit_logs.FormLogger;
17 17 import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger;
  18 +import com.bsth.data.schedule.edit_logs.loggers.AfterwardsLogger;
18 19 import com.bsth.data.schedule.edit_logs.loggers.FcxxwtLogger;
19 20 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
20 21 import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
  22 +import com.bsth.data.utils.CustomStringUtils;
21 23 import com.bsth.entity.Cars;
22 24 import com.bsth.entity.Line;
23 25 import com.bsth.entity.Personnel;
... ... @@ -1687,45 +1689,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1687 1689 public List<Map<String, Object>> accountPx(String line, String date,
1688 1690 String code, String xlName, String px) {
1689 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 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 1706 Map<String, Object> map;
1698 1707 List<Object[]> lsitObj = jdbcTemplate.query(sql,
1699 1708 new RowMapper<Object[]>() {
1700 1709 @Override
1701 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 1715 return t;
1708 1716 }
1709 1717 });
1710 1718 int i = 1;
1711 1719 for (Object[] obj : lsitObj) {
1712 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 1738 return listMap;
1725 1739 }
1726 1740 @Override
1727 1741 public List<Map<String, Object>> account(String line, String date,
1728 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 1752 List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code);
1730 1753 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
1731 1754 Map<String, Object> map;
... ... @@ -1735,10 +1758,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1735 1758 map = new HashMap<String, Object>();
1736 1759 map.put("num", i++);
1737 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 1765 listMap.add(map);
1743 1766 }
1744 1767 }
... ... @@ -2554,11 +2577,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2554 2577 if (a == 2) {
2555 2578 x = b + 1;
2556 2579 y = x * 2;
2557   - ;
2558 2580 } else if (b == 1) {
2559 2581 x = b + 1;
2560 2582 y = x * 2 - 1;
2561   - ;
2562 2583 } else {
2563 2584 x = b;
2564 2585 y = 2 * x;
... ... @@ -3040,14 +3061,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3040 3061 rs.put("status", ResponseCode.ERROR);
3041 3062  
3042 3063 ScheduleRealInfo oldSch = super.findById(sch.getId());
  3064 + //事后日志记录
  3065 + AfterwardsLogger aflog = AfterwardsLogger.start(oldSch, "事后调整");
3043 3066  
3044 3067 //换车
3045 3068 if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) {
3046 3069 if (!carExist(oldSch.getGsBm(),sch.getClZbh())) {
3047 3070 rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!");
3048 3071 return rs;
3049   - } else
  3072 + } else{
  3073 + aflog.log("换车", oldSch.getClZbh(), sch.getClZbh());
3050 3074 oldSch.setClZbh(sch.getClZbh());
  3075 + }
3051 3076 }
3052 3077  
3053 3078 //换驾驶员
... ... @@ -3057,6 +3082,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3057 3082 rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员");
3058 3083 return rs;
3059 3084 }
  3085 + aflog.log("换驾驶员", oldSch.getjGh()+"/"+ oldSch.getjName(), sch.getjGh()+"/"+ sch.getjName());
3060 3086 persoChange(oldSch, sch.getjGh());
3061 3087 }
3062 3088  
... ... @@ -3067,6 +3093,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3067 3093 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员");
3068 3094 return rs;
3069 3095 }
  3096 + aflog.log("换售票员", oldSch.getsGh()+"/"+ oldSch.getsName(), sch.getsGh()+"/"+ sch.getsName());
3070 3097 persoChangeSPY(oldSch, sch.getsGh());
3071 3098 }
3072 3099  
... ... @@ -3075,12 +3102,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3075 3102 boolean dest2 = sch.getStatus() == -1;
3076 3103 if (!dest1 && dest2) {
3077 3104 oldSch.destroy();
  3105 + aflog.log("烂班");
3078 3106 }
3079 3107 else if(dest1 && !dest2){
3080 3108 //撤销烂班
3081 3109 oldSch.setJhlc(oldSch.getJhlcOrig());
3082 3110 oldSch.setStatus(0);
3083 3111 oldSch.calcStatus();
  3112 + aflog.log("撤销烂班");
3084 3113 }
3085 3114  
3086 3115  
... ... @@ -3089,6 +3118,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3089 3118 */
3090 3119 if (!oldSch.getJhlc().equals(sch.getJhlc())) {
3091 3120 double jhlcNum = sch.getJhlc();
  3121 + aflog.log("修改班次里程", oldSch.getJhlc(), jhlcNum);
3092 3122 //烂班
3093 3123 if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0)
3094 3124 oldSch.destroy();
... ... @@ -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 3155 scheduleRealInfoRepository.save(oldSch);
  3156 +
  3157 + aflog.end();
3113 3158 rs.put("status", ResponseCode.SUCCESS);
3114 3159 return rs;
3115 3160 }
... ... @@ -4199,4 +4244,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4199 4244 }
4200 4245 return rs;
4201 4246 }
4202   -}
4203 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 866 ChildTaskPlan childTaskPlan = it.next();
867 867 if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){
868 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
... ... @@ -570,15 +570,15 @@ public class ReportServiceImpl implements ReportService{
570 570 String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
571 571  
572 572 //查询全程
573   - String sqlqc="select t.*,x.station_name as qdz_name from ( "
574   - + " (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 "
575 575 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
576 576 + " and fcsj <='"+minfcsj+"') "
577 577 + " union "
578   - + " (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 "
579 579 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
580 580 + " and fcsj > '"+minfcsj+"') "
581   - + "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 ";
582 582 List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc,
583 583 new RowMapper<Map<String, String>>(){
584 584 @Override
... ... @@ -619,12 +619,12 @@ public class ReportServiceImpl implements ReportService{
619 619 sxbc++;
620 620 upfcsj.add(m.get("fcsj"));
621 621 if(sxqdz.length() == 0 && m.containsKey("qdz_name"))
622   - sxqdz = m.get("qdz_name");
  622 + sxqdz = m.get("qdz_name")==null?"":m.get("qdz_name").toString();
623 623 } else {
624 624 xxbc++;
625 625 downfcsj.add(m.get("fcsj"));
626 626 if(xxqdz.length() == 0 && m.containsKey("qdz_name"))
627   - xxqdz = m.get("qdz_name");
  627 + xxqdz = m.get("qdz_name")==null?"":m.get("qdz_name").toString();
628 628 }
629 629 }
630 630 if(upfcsj.size() != 0)
... ... @@ -1591,15 +1591,16 @@ public class ReportServiceImpl implements ReportService{
1591 1591 map.put("ssgl_other", culateService.culateSsMileXx(list, "其他"));
1592 1592  
1593 1593  
1594   - double zrwjcclc=culateService.culateZrwJccLc(list, "");
1595   -
  1594 + double zrwjcclc=culateService.culateZrwJccLc(list, "故障");
  1595 + double zrwjcclc1=culateService.culateZrwJccLc(list, "肇事");
  1596 + double zrwjcclc2=culateService.culateZrwJccLc(list, "纠纷");
1596 1597 map.put("zrwjcclc", zrwjcclc);
1597   - map.put("zrwjcclc1", 0);
1598   - map.put("zrwjcclc2", 0);
1599   -
  1598 + map.put("zrwjcclc1", zrwjcclc1);
  1599 + map.put("zrwjcclc2", zrwjcclc2);
  1600 + double zrwjcc=Arith.add(Arith.add(zrwjcclc, zrwjcclc1), zrwjcclc2);
1600 1601 double kfks=culateService.culateKfksLc(lists);
1601 1602 map.put("kfks", kfks);
1602   - double zlc=Arith.add(Arith.add(Arith.add(zrwjcclc, ljlc),
  1603 + double zlc=Arith.add(Arith.add(Arith.add(zrwjcc, ljlc),
1603 1604 Arith.add(zjcclc, zyylc)),kfks);
1604 1605  
1605 1606  
... ...
src/main/java/com/bsth/service/sys/IntervalService.java 0 → 100644
  1 +package com.bsth.service.sys;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.entity.sys.Interval;
  7 +import com.bsth.service.BaseService;
  8 +
  9 +public interface IntervalService extends BaseService<Interval, Integer> {
  10 +
  11 + Map<String, Object> saveList(List<Interval> parseArray);
  12 +
  13 +}
... ...
src/main/java/com/bsth/service/sys/impl/IntervalServiceImpl.java 0 → 100644
  1 +package com.bsth.service.sys.impl;
  2 +
  3 +import java.util.HashMap;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +
  12 +import com.bsth.common.ResponseCode;
  13 +import com.bsth.entity.sys.Interval;
  14 +import com.bsth.repository.sys.IntervalRepository;
  15 +import com.bsth.service.impl.BaseServiceImpl;
  16 +import com.bsth.service.sys.IntervalService;
  17 +
  18 +@Service
  19 +public class IntervalServiceImpl extends BaseServiceImpl<Interval, Integer> implements IntervalService {
  20 +
  21 + @Autowired
  22 + IntervalRepository intervalRepository;
  23 +
  24 + Logger logger = LoggerFactory.getLogger(this.getClass());
  25 +
  26 + @Override
  27 + public Map<String, Object> saveList(List<Interval> parseArray) {
  28 + Map<String, Object> map = new HashMap<>();
  29 + try{
  30 + intervalRepository.save(parseArray);
  31 + map.put("status", ResponseCode.SUCCESS);
  32 + }catch(Exception e){
  33 + map.put("status", ResponseCode.ERROR);
  34 + logger.error("", e);
  35 + }
  36 + return map;
  37 + }
  38 +
  39 +}
... ...
src/main/java/com/bsth/service/traffic/YgcBasicDataService.java
... ... @@ -9,5 +9,13 @@ public interface YgcBasicDataService {
9 9 * 更新运管处基础数据
10 10 */
11 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 7 import org.apache.axis2.addressing.EndpointReference;
8 8 import org.apache.axis2.client.Options;
9 9 import org.apache.axis2.client.ServiceClient;
  10 +import org.apache.axis2.rpc.client.RPCServiceClient;
10 11 import org.apache.commons.codec.digest.DigestUtils;
11 12 import org.slf4j.Logger;
12 13 import org.slf4j.LoggerFactory;
... ... @@ -18,6 +19,7 @@ import org.w3c.dom.Document;
18 19 import org.w3c.dom.NodeList;
19 20  
20 21 import javax.activation.DataHandler;
  22 +import javax.xml.namespace.QName;
21 23 import javax.xml.parsers.DocumentBuilder;
22 24 import javax.xml.parsers.DocumentBuilderFactory;
23 25 import java.io.*;
... ... @@ -42,14 +44,17 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
42 44 JdbcTemplate jdbcTemplate;
43 45  
44 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 49 private static String namespace = "http://service.shygc.com";
47 50 private static String userName = "admin";
48 51 private static String passWord = "000000";
49   - private static EndpointReference targetEPR;
  52 + private static EndpointReference downTargetEPR;
  53 + private static EndpointReference upTargetEPR;
50 54 {
51 55 try {
52   - targetEPR = new EndpointReference(targetEndpoint);
  56 + downTargetEPR = new EndpointReference(downTargetEndpoint);
  57 + upTargetEPR = new EndpointReference(upTargetEndpoint);
53 58 } catch (Exception e) {
54 59 e.printStackTrace();
55 60 }
... ... @@ -102,7 +107,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
102 107 ServiceClient sender = new ServiceClient();
103 108 Options options = sender.getOptions();
104 109 options.setProperty("SO_TIMEOUT", Integer.valueOf(1800000));
105   - options.setTo(targetEPR);
  110 + options.setTo(downTargetEPR);
106 111 sender.setOptions(options);
107 112 System.out.println("The data in method download: " + data);
108 113 data.build();
... ... @@ -280,4 +285,37 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
280 285 flag = true;
281 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/interval/list.html 0 → 100644
  1 +<!-- <link href="/pages/base/line/css/animate.css" rel="stylesheet" type="text/css" />
  2 +<link href="/pages/base/line/css/tipso.css" rel="stylesheet" type="text/css" /> -->
  3 +<!-- 片段标题 START -->
  4 +<div class="page-head">
  5 + <div class="page-title">
  6 + <h1>大间隔信息</h1>
  7 + </div>
  8 +</div>
  9 +<!-- 片段标题 END -->
  10 +
  11 +<!-- 线路信息导航栏组件 START -->
  12 +<ul class="page-breadcrumb breadcrumb">
  13 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  14 + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li>
  15 + <li><span class="active">大间隔信息</span></li>
  16 +</ul>
  17 +<!-- 线路信息导航栏组件 END -->
  18 +
  19 +<div class="row">
  20 + <div class="col-md-12">
  21 + <div class="portlet light porttlet-fit bordered">
  22 + <div class="portlet-title">
  23 + <div class="tipso-animation">
  24 + </div>
  25 + <div class="caption">
  26 + <i class="fa fa-info-circle font-dark"></i>
  27 + <span class="caption-subject font-dark sbold uppercase">线路信息</span>
  28 + </div>
  29 + <div class="actions">
  30 + <div class="btn-group btn-group-devided" data-toggle="buttons">
  31 + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加线路</a>
  32 + </div>
  33 + </div>
  34 + </div>
  35 + <div class="portlet-body">
  36 + <div class="table-container" style="margin-top: 10px">
  37 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_line">
  38 + <thead>
  39 + <tr role="row" class="heading">
  40 + <th >#</th>
  41 + <th >序号</th>
  42 + <th >大间隔ID</th>
  43 + <th >大间隔等级</th>
  44 + <th >高峰间隔时间</th>
  45 + <th >低谷间隔时间</th>
  46 + <th >操作</th>
  47 + </tr>
  48 + <tr role="row" class="filter">
  49 + <td>#</td>
  50 + <td></td>
  51 + <td></td>
  52 + <td></td>
  53 + <td></td>
  54 + <td></td>
  55 + <td>
  56 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
  57 + <i class="fa fa-search"></i> 搜索
  58 + </button>
  59 +
  60 + <button class="btn btn-sm red btn-outline filter-cancel" id="notification-trigger">
  61 + <i class="fa fa-times"></i> 重置
  62 + </button>
  63 + </td>
  64 + </tr>
  65 + </thead>
  66 + <tbody></tbody>
  67 + </table>
  68 + <div style="text-align: right;">
  69 + <ul id="pagination" class="pagination"></ul>
  70 + </div>
  71 + </div>
  72 + </div>
  73 + </div>
  74 + </div>
  75 +</div>
  76 +<script type="text/html" id="line_list_temp">
  77 + {{each list as obj i }}
  78 + <tr>
  79 + <td style="vertical-align: middle;">
  80 + <input type="checkbox" class="group-checkable icheck" value="{{obj.name}}" id="{{obj.id}}" data-id="{{obj.id}}" data-lineName="{{obj.name}}">
  81 + </td>
  82 + <td style="vertical-align: middle;">
  83 + {{(list.page*10)+(i+1)}}
  84 + </td>
  85 + <td>
  86 + {{obj.lineCode}}
  87 + </td>
  88 + <td>
  89 + {{obj.name}}
  90 + </td>
  91 + <td>
  92 + {{if obj.nature == 'lj'}}
  93 + 路救
  94 + {{else if obj.nature == 'bc'}}
  95 + 备车
  96 + {{else if obj.nature == 'dbc'}}
  97 + 定班车
  98 + {{else if obj.nature == 'yxl'}}
  99 + 夜宵路
  100 + {{else if obj.nature == 'cgxl'}}
  101 + 常规线路
  102 + {{else if obj.nature == 'gjxl'}}
  103 + 过江线路
  104 + {{else if obj.nature == 'csbs'}}
  105 + 穿梭巴士
  106 + {{else if obj.nature == 'tyxl'}}
  107 + 特约线路
  108 + {{else if obj.nature == 'qt'}}
  109 + 其他
  110 + {{else if obj.nature == 'cctxl'}}
  111 + 村村通线路
  112 + {{/if}}
  113 + </td>
  114 + <td>
  115 + {{if obj.level == '1'}}
  116 + 一级线路
  117 + {{else if obj.level == '2'}}
  118 + 二级线路
  119 + {{else if obj.level == '0'}}
  120 + 未知等级
  121 + {{/if}}
  122 + </td>
  123 + <td>
  124 + {{obj.shanghaiLinecode}}
  125 + </td>
  126 + <td>
  127 + {{if obj.destroy == 1}}
  128 + <span style="font-weight: bold; color: red; padding: 5px; background-color: #FFE4E1; margin: 5px; font-size: 9px;border-radius: 4px;">撤销</span>
  129 + {{else if obj.destroy == 0}}
  130 + <span style="font-weight: bold; color: #07824e; padding: 5px; background-color: #FFE4E1; margin: 5px; font-size: 9px;border-radius: 4px;">运营</span>
  131 + {{/if}}
  132 + </td>
  133 + <td>
  134 + <a href="/pages/base/lineinformation/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>
  135 + </td>
  136 + <td>
  137 + <a href="/pages/base/stationroute/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>
  138 + </td>
  139 + <td>
  140 + <a href="details.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a>
  141 + <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a>
  142 + </td>
  143 + </tr>
  144 + {{/each}}
  145 + {{if list.length == 0}}
  146 + <tr>
  147 + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td>
  148 + </tr>
  149 + {{/if}}
  150 +</script>
  151 +<!-- <script src="/pages/base/line/js/tipso.js"></script> -->
  152 +<!-- 线路信息片段JS模块 -->
  153 +<script src="/pages/base/line/js/line-list-table.js"></script>
0 154 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
... ... @@ -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 386 var rsultA = new Array() , dgzjsj = baseF.getDateTime('13:00');
387 387 // 定义13:00 ~ 晚高峰开始以前剔除规则. 如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次.
388 388 var xwmaxtcbcNum = parseInt(( dataMap.wgfsjd[0].st - dgzjsj) / (60000 * saa[0].zzsj.dgzzsj));
389 389 // 定义早高峰结束 ~ 13:00 剔除规则.如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次.
390 390 var swmaxtcbcNum = parseInt(( dgzjsj - dataMap.zgfsjd[0].ed) / (60000 * saa[0].zzsj.dgzzsj));
391 391 var sumGs = 0;
  392 + dgminpcs = zwxeLpNum==0 ? bxlpbc.length : dgminpcs;
392 393 for(var a = 0 ; a < bxlpbc.length ; a++) {
393 394 // 定义该版型下对应的路牌的班次数组、班次数组长度、该路牌上是否有首末班车。
394 395 var lpbc = bxlpbc[a].lpbc, lpbclen_ = lpbc.length;
... ... @@ -396,6 +397,7 @@ var BaseFun = function() {
396 397 continue;
397 398 var isFlag = baseF.lpDownIsHaveFirstAndLastBc(lpbc , dataMap.smbcsjArr) , tcbcgzA = new Array();
398 399 if(bxrcObj.type == '五工二休') {
  400 + // continue;
399 401 // 定义晚高峰后能剔除多少班次数.
400 402 var wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfsjd[0].ed ) / (60000 * saa[0].zzsj.dgzzsj));
401 403 if(isFlag) {
... ... @@ -409,11 +411,12 @@ var BaseFun = function() {
409 411 // 剔除不在高峰时间段内的班次.
410 412 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , 'desc' , false);
411 413 }else {
  414 + //continue;
412 415 // 单档 一个路牌一档劳动力
413 416 if(bxlpbc[a].keepOff==1) {
414 417 // 如果低谷至少配车数大于零,则该班型下的路牌 存在一些 分班路牌,这里的分班 指的是 这个路牌先满足的前提条件就是 是单档。
415   - // 为了满足工时的要求,在低谷断开一段时间.
416   - if(dgminpcs > 0) {
  418 + // 为了满足工时的要求,在低谷断开一段时间.a <= dgminpcs
  419 + if(a <= dgminpcs) {
417 420 if( a % 2 == 0) {
418 421 if(deletebcNum < swmaxtcbcNum || isFlag) {
419 422 tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum});
... ... @@ -433,10 +436,10 @@ var BaseFun = function() {
433 436 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , true);
434 437 baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , true , a);
435 438 // 该班型下的路牌 不存在分班路牌.
436   - }else if(dgminpcs == 0){
  439 + }else {
437 440 // 按规则剔除班次.不分班.路牌班次不会断开.
438 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 445 }else if(bxlpbc[a].keepOff==2) {
... ... @@ -607,8 +610,10 @@ var BaseFun = function() {
607 610 // 判断是否在高峰时间范围.【true--表示在,false--表示不在】.
608 611 if(!baseF.isPeakTimeScope(fcsj,dataMap) && fcsj > tcbcgzA[t].minsj && fcsj < tcbcgzA[t].maxsj) {
609 612 if(order == 'asc') {
610   - arr[a-1].isfb = isfb ? 1 : 0;
611   - arr[a-1].STOPTIME = 0;
  613 + if(a>0) {
  614 + arr[a-1].isfb = isfb ? 1 : 0;
  615 + arr[a-1].STOPTIME = 0;
  616 + }
612 617 }else if(order == 'desc') {
613 618 var index_ = a + tcbcgzA[t].deletebcNum * 2;
614 619 arr[index_].STOPTIME = 0;
... ... @@ -637,6 +642,7 @@ var BaseFun = function() {
637 642 dgmaxtzsj = parseInt(map.dgmaxtzsj);
638 643 // 计算低谷最少配车数 (低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙.
639 644 var dgminpcs = Math.round((dataMap.dgxxsjArr[0] + dataMap.dgxxsjArr[1] + dataMap.dgtzsj[0] + dataMap.dgtzsj[1]) / dgmaxfcjx);
  645 + var zwxeLpNum = baseF.cuontZwxeLpNum(bxrclist);
640 646 // var dgminpcs = 4;
641 647 // 定义返回数组.
642 648 var rs = new Array();
... ... @@ -711,12 +717,23 @@ var BaseFun = function() {
711 717 avgMakerCarNum = parseInt(avgMakerCarNum / bxlpbc.length);
712 718 // console.log(bxlpbc);
713 719 // 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班.
714   - 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));
715 721 }
716 722 }
717 723 return rs;
718 724 },
719 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 +
720 737 /**
721 738 * @description (TODO) 更新路牌数组的路牌名称.
722 739 * @param cara 路牌数组
... ... @@ -778,17 +795,15 @@ var BaseFun = function() {
778 795 // 第一步 根据表单中的参数得到所有路牌下的班次数[从各路牌下的第一个班次发车时间 到 营运结束时间点并且是连续的班次数].
779 796 var allLMapBc = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap);
780 797  
781   - // return {'json':jsonArray,'bxrcgs':null};
782   -
783 798 // 第二步 纵向调整
784 799 baseF.evenStartDepartSpace(allLMapBc , dataMap);
785 800  
786 801 // 第三步 剔除首末班车以外的班次,并确认首末班车.
787 802 var markArray = baseF.markFirstAndLastBusAlsoDietNotInRangeBc(allLMapBc , dataMap);
788   -
  803 + // return {'json':markArray,'bxrcgs':null};
789 804 // 第四步 横向调整
790 805 baseF.resizeByPitStopTime(cara , markArray , dataMap);
791   -
  806 + // return {'json':markArray,'bxrcgs':null};
792 807 /**
793 808 * 第五步 把班型合理的分配到各个路牌上.
794 809 *
... ... @@ -798,17 +813,13 @@ var BaseFun = function() {
798 813 */
799 814 // 切割班型/人次/配车数 字符串 为 数组对象.
800 815 var list = baseF.getBxRcListCollection(map.bxrc);
801   -
802 816 // 把班型分配到对应的具体路牌上.
803 817 baseF.bxAlloTotLp(list,cara);
804   -
805 818 // 第六步 抽车来满足工时.
806 819 var tempA = baseF.abstractCar(list , markArray , cara , saa , dataMap , map);
807   -
  820 + // return {'json':tempA,'bxrcgs':null};
808 821 // 第七步 确定吃饭时间.
809 822 baseF.markeEatTime(list , tempA , cara , saa , dataMap ,map);
810   -
811   -
812 823 baseF.resizeByPitStopTime(cara , tempA , dataMap);
813 824 baseF.updfcno01(tempA,0);
814 825 // return {'json':tempA,'bxrcgs':null};
... ... @@ -838,7 +849,7 @@ var BaseFun = function() {
838 849 }
839 850 lpbcArray.sort(function(a,b){return a.fcint - b.fcint});
840 851 baseF.isHaveBc(baseF.getDateTime('10:15') , baseF.getDateTime('12:15'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 0);
841   - //baseF.isHaveBc(baseF.getDateTime('18:00') , baseF.getDateTime('19:00'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 1);
  852 + baseF.isHaveBc(baseF.getDateTime('18:00') , baseF.getDateTime('19:00'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 1);
842 853 }
843 854 },
844 855  
... ... @@ -1064,12 +1075,13 @@ var BaseFun = function() {
1064 1075 var lLen = list.length , cLen = clzs.length;
1065 1076 if(lLen<= 0 || cLen<=0 )
1066 1077 return false;
1067   - // 最多车次与总车次的比例.
1068   - var blnum = Math.round(cLen/list[0].fpcls);
  1078 + list.sort(function(a,b){return a.fpcls-b.fpcls});
1069 1079 // 定义已经分配出去的路牌.
1070 1080 var rs = new Array();
1071 1081 // 遍历
1072 1082 for(var r = 0 ; r < lLen ; r++) {
  1083 + // 车次与总车次的比例.
  1084 + var blnum = Math.round(cLen/list[r].fpcls);
1073 1085 // 得到没有分配出去的路牌.
1074 1086 var dxa = baseF.chaji_array(clzs,rs);
1075 1087 // 定义当前车次数.
... ... @@ -1077,29 +1089,32 @@ var BaseFun = function() {
1077 1089 // 定义记录当前分割路牌的次数下标.分配到班型车次下的路牌数组.
1078 1090 var index = 0 , sslp = new Array();
1079 1091 // 当前车次所有占比例.
1080   - var tempint = parseInt(rsnum/blnum);
  1092 + //var tempint = parseInt(rsnum/blnum);
1081 1093 // 判断如果比例小1 则为当前车次数.
1082   - blnum = tempint <= 1 ? rsnum : blnum;
  1094 + //blnum = tempint <= 1 ? rsnum : blnum;
1083 1095 // 判断当前班型车次数组下标值.如果为倒数第二个或者之前.
1084 1096 if(r < lLen-1) {
1085 1097 // 遍历
1086   - for(var c = 0 ; c < tempint ; c++) {
  1098 + for(var c = 0 ; c < rsnum ; c++) {
1087 1099 // 创建新的没有分配出去的路牌数组.
1088 1100 var temp = dxa.concat();
1089 1101 // 创建切割路牌数组.
1090 1102 var tagA = new Array();
1091 1103 // 判断切割的下标值是否小于等于路牌数组的倒数第二个或者之前.
1092 1104 if(index <= (dxa.length-blnum) ) {
1093   - tagA = temp.splice(index,blnum);
  1105 + /*tagA = temp.splice(index,blnum);*/
  1106 + tagA = temp.splice(index,1);
1094 1107 }else {
1095   - tagA = temp.splice((dxa.length-blnum),blnum);
  1108 + /*tagA = temp.splice((dxa.length-blnum),blnum);*/
  1109 + tagA = temp.splice((dxa.length-blnum),1);
1096 1110 }
1097 1111 // 组合切割路牌数组.赋值给已分配出去的路牌.
1098 1112 rs = rs.concat(tagA);
1099 1113 // 赋值给分配到班型车次下的路牌数组.
1100 1114 sslp = sslp.concat(tagA);
1101 1115 // 记录切割下标.
1102   - index = index + 1 + blnum;
  1116 + index = index + blnum;
  1117 + // index = index + blnum;
1103 1118 }
1104 1119 // 分配到班型车次下的路牌数组.
1105 1120 list[r].sslp = sslp;
... ... @@ -1302,10 +1317,10 @@ var BaseFun = function() {
1302 1317 var sgbcfcsj = baseF.getDateTime(sslpbcA[r+1].fcsj),
1303 1318 dqbcddsj = baseF.getDateTime(sslpbcA[r].ARRIVALTIME),
1304 1319 dqbcfcsj = baseF.getDateTime(sslpbcA[r].fcsj);
  1320 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  1321 + var cctag = baseF.dirDmToIndex(sslpbcA[r].xlDir); // dataMap.smbcsjArr
1305 1322 // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.)
1306 1323 var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000);
1307   - // 定义当前班次方向下标代码[0代表上行;1代表下行].
1308   - var cctag = baseF.dirDmToIndex(sslpbcA[r].xlDir);
1309 1324 // 定义是否高峰
1310 1325 var flag = baseF.isPeakTimeScope(dqbcfcsj , dataMap);
1311 1326 // 获取行驶时间.
... ... @@ -1348,22 +1363,41 @@ var BaseFun = function() {
1348 1363 }
1349 1364 }
1350 1365 if(flag) {
1351   - // 修改当前班次的停站时间.
1352   - sslpbcA[r].STOPTIME = parseInt(dxmin) ;
1353   - // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.
1354   - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);
1355   - // 修改下一个班次的发车时间.
1356   - sslpbcA[r+1].fcsj = baseF.getTimeStr(dqbcddsj);
1357   - // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.
1358   - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);
1359   - // 修改下一个班次的到达时间.
1360   - sslpbcA[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj);
  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 + }
  1387 + }
1361 1388 }
1362 1389 }
1363 1390 }
1364 1391 }
1365 1392 },
1366 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 +
1367 1401 BXPplaceClassesTime01 : function(saa,cara,map,seMap,dataMap,lpNoA) {
1368 1402 var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap);
1369 1403 var list = baseF.splitBxRc(map.bxrc);
... ...
src/main/resources/static/pages/base/timesmodel/js/gantt.js
... ... @@ -420,7 +420,8 @@
420 420 * @return 返回甘特图的参数配置信息.
421 421 * */
422 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 425 var VALUEKEYNAME = 'Worldwide Gross' ,
425 426 DXHOURS = 24,MINUTE = 60,WIDTH = DXHOURS*MINUTE,MARGINLEFT = 380,HEIGHT = p.yAxisCarArray.length*60 + 240,
426 427 MARGINBOTTOM = 240,OFFSETX = 90,OFFSETY = 180,OFFSETUPY = 120,OFFSETDOWNY = 60,
... ...
src/main/resources/static/pages/excep/js/outboundmap-load.js
... ... @@ -8,7 +8,6 @@ $(function(){
8 8  
9 9 // 获取参数线路ID
10 10 var no = $.url().param('no');
11   - var up = $.url().param('up');
12 11 var paramArr = new Array();
13 12 paramArr = no.split(",");// 在每个逗号(,)处进行分解。
14 13 /*paramArr[0]:id
... ...
src/main/resources/static/pages/excep/js/speeding-map.js 0 → 100644
  1 +/**
  2 + * 百度地图
  3 + *
  4 + * - - - - - -》init:地图初始化
  5 + *
  6 + * - - - - - -》lineInfoPanl:从百度地图抓去站点与路段数据
  7 + *
  8 + * - - - - - -》getDistanceAndDuration:获取距离与时间
  9 + *
  10 + * - - - - - -》pointsPolygon:地图画多边行
  11 + *
  12 + * - - - - - -》pointsCircle:画圆
  13 + *
  14 + * - - - - - -》localSearchFromAdreesToPoint:根据地理名称获取百度经纬度坐标
  15 + *
  16 + * - - - - - -》drawingUpline:在地图上画出上行线路走向
  17 + *
  18 + * - - - - - -》stationsNameToPoints:站点名称获取百度坐标(手动规划)
  19 + *
  20 + * - - - - - -》getDistanceAndTotime:根据坐标点获取两点之间的时间与距离(手动规划)
  21 + *
  22 + * - - - - - -》getSectionListPlonly:根据坐标点获取两点之间的折线路段(手动规划)
  23 + */
  24 +
  25 +var SpeedingMap = function () {
  26 +
  27 + /** WorldsBMap 全局变量定义 mapBValue:地图对象;polygon:多边形;polyUpline:走向折线;circle:圆 *//*
  28 + var mapBValue = '';polygon='',polyUpline='',circle='',iseditStatus = false;*/
  29 +
  30 + var Bmap = {
  31 +
  32 + init : function() {
  33 + // 设置中心点,
  34 + var CENTER_POINT = {lng : 121.528733,lat : 31.237425};
  35 +
  36 + // 百度API Key
  37 + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
  38 +
  39 + // 初始化百度地图
  40 + mapBValue = new BMap.Map("speedingMap");
  41 +
  42 + //中心点和缩放级别
  43 + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15);
  44 +
  45 + //启用地图拖拽事件,默认启用(可不写)
  46 + mapBValue.enableDragging();
  47 +
  48 + //启用地图滚轮放大缩小
  49 + mapBValue.enableScrollWheelZoom();
  50 +
  51 + //禁用鼠标双击放大
  52 + mapBValue.disableDoubleClickZoom();
  53 +
  54 + //启用键盘上下左右键移动地图
  55 + mapBValue.enableKeyboard();
  56 +
  57 + return mapBValue;
  58 + },
  59 +
  60 + /** 获取地图对象 @return 地图对象map */
  61 + getmapBValue : function() {
  62 +
  63 + return mapBValue;
  64 +
  65 + },
  66 +
  67 + /* drawTravelRoute:function(data){
  68 + var driving = Bmap.DrivingRoute(map, {renderOptions:{map: map}})
  69 +
  70 + }*/
  71 +
  72 + }
  73 +
  74 + return Bmap;
  75 +
  76 +}();
0 77 \ No newline at end of file
... ...
src/main/resources/static/pages/excep/speedingListmh.html
... ... @@ -146,7 +146,10 @@
146 146 {{(obj.endtimestamp-obj.timestamp)/1000}}秒
147 147 </td>
148 148 <td>
149   - <a class="btn default blue-stripe btn-sm lookTrajectory" data-pjax>
  149 + <a class="btn default blue-stripe btn-sm lookTrajectory" data-vehicle ="{{obj.vehicle}}"
  150 + data-startdate="{{obj.timestampDate}}" data-enddate="{{obj.endtimestampDate}}"
  151 + data-lon="{{obj.lon}}" data-lat="{{obj.lat}}"
  152 + data-endlon="{{obj.endlon}}" data-endlat="{{obj.endlat}}" >
150 153 查看轨迹
151 154 </a>
152 155 </td>
... ... @@ -162,6 +165,8 @@
162 165 {{/if}}
163 166 </script>
164 167  
  168 +<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
  169 +
165 170 <script>
166 171 $(function(){
167 172 var page = 0, initPagination;
... ... @@ -185,7 +190,20 @@ $(function(){
185 190 var parameter = new Object();
186 191 parameter.endDate = $("input[name='endDate']")[0].value;
187 192 parameter.startDate = $("input[name='startDate']")[0].value;
188   - jsDoQuery(parameter,true);
  193 +
  194 + //搜索线路
  195 + $.get('/basic/lineCode2Name',function(result){
  196 + var data=[];
  197 + data.push({id: " ", text: "全部线路"});
  198 + for(var code in result){
  199 + data.push({id: code, text: result[code]});
  200 + }
  201 + initPinYinSelect2($('#line'),data,function(ldmcSelector) {
  202 + ldmcSelector.select2("val",data[1].id);//因为数据量太大,所以默认一条线路作为查询参数
  203 + });
  204 + parameter.line = data[1].id;
  205 + jsDoQuery(parameter,true);
  206 + });
189 207  
190 208 //时间戳转换为年月日
191 209 function timeToData(time){
... ... @@ -223,7 +241,7 @@ $(function(){
223 241 /*
224 242 * 获取数据 p: 要提交的参数, pagination: 是否重新分页
225 243 */
226   - function jsDoQuery(p, pagination){
  244 + function jsDoQuery(p, pagination){
227 245 var params = {};
228 246 if(p)
229 247 params = p;
... ... @@ -243,7 +261,27 @@ $(function(){
243 261 }
244 262 layer.close(i);
245 263 $(".lookTrajectory").click(function(){
246   - layer.alert("暂未开放此功能!");
  264 + var vehicle = $(this).data('vehicle');
  265 + var startDate = $(this).data('startdate');
  266 + var endDate = $(this).data('enddate');
  267 + var lon = $(this).data('lon');
  268 + var lat = $(this).data('lat');
  269 + var endLon = $(this).data('endlon');
  270 + var endLat = $(this).data('endlat');
  271 + var storage = window.localStorage;
  272 + storage.setItem("zbhAndDate",vehicle+","+startDate+","+endDate+","+lon+","+lat+","+endLon+","+endLat);
  273 + $.get('/pages/excep/speedingMap.html?',function (result) {
  274 + layer.open({
  275 + type: 1,
  276 + title:'<i class="uk-icon-play-circle"></i>轨迹回放',
  277 + shadeClose: true,
  278 + shade: true,
  279 + scrollbar: false,
  280 + maxmin: false, //开启最大化最小化按钮
  281 + area: ['100%', '100%'],
  282 + content:result,//内容
  283 + });
  284 + });
247 285 })
248 286 });
249 287 }
... ... @@ -307,17 +345,6 @@ $(function(){
307 345 $('tr.filter .filter-submit').click();
308 346 });
309 347 });
310   -
311   - //搜索线路
312   - $.get('/basic/lineCode2Name',function(result){
313   - var data=[];
314   - data.push({id: " ", text: "全部线路"});
315   - for(var code in result){
316   - data.push({id: code, text: result[code]});
317   - }
318   - initPinYinSelect2('#line',data,'');
319   -
320   - });
321 348  
322 349 $("#line").on("change",initXl);
323 350 function initXl(){
... ... @@ -334,6 +361,7 @@ $(&#39;#nbbm&#39;).select2({
334 361 xlbm:$('#line').val()};
335 362 },
336 363 processResults: function (data) {
  364 + console.log(data);
337 365 return {
338 366 results: data
339 367 };
... ... @@ -370,7 +398,6 @@ $(&#39;#nbbm&#39;).select2({
370 398  
371 399 //改变状态
372 400 function changeEnabled(id,enabled){
373   - debugger
374 401 $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){
375 402 jsDoQuery(null, true);
376 403 })
... ...
src/main/resources/static/pages/excep/speedingMap.html 0 → 100644
  1 +<style>
  2 + .play_back-layer .layui-layer-title{
  3 + height: 36px;
  4 + border-bottom: none;
  5 + }
  6 +</style>
  7 +
  8 +<div id="titleMap">
  9 +<button id="run" style="margin-left:10px" class="btn btn-sm green btn-outline filter-submit margin-bottom">运行</button>
  10 +</div>
  11 +<div id="speedingMap">
  12 +</div>
  13 +<style type="text/css">
  14 +
  15 +#speedingMap{
  16 + width: 100%;
  17 + border: 2px solid #fdfdfd;
  18 + height: calc(100% - 30px);
  19 + overflow: hidden;
  20 +}
  21 +</style>
  22 +<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
  23 +<script type="text/javascript" src="/pages/excep/js/speeding-map.js"></script>
  24 +<script type="text/javascript">
  25 +$(function(){
  26 + var dataArr = window.localStorage.zbhAndDate.split(",");//获取页面传递过来的车辆自编号以及超速起始时间和超速结束时间
  27 + var vehicle = dataArr[0];
  28 + var startdate = dataArr[1];
  29 + var enddate = dataArr[2];
  30 + var lon = dataArr[3];//起点经度
  31 + var lat = dataArr[4];//起点纬度
  32 + var endLon = dataArr[5];//终点经度
  33 + var endLat = dataArr[6];//终点纬度
  34 + var Points = [];
  35 + $.ajax({
  36 + type: "GET",
  37 + async:false,
  38 + url: '/gps/findPosition',
  39 + data: {vehicle:vehicle,startdate:startdate,enddate:enddate},
  40 + success: function(data){
  41 + console.log("123"+data);
  42 + $.each(data,function(i,item){
  43 + console.log(item);
  44 + if(item.lon>1 && item.lat>1){
  45 + var point = new BMap.Point(item.lon,item.lat);
  46 + Points.push(point);
  47 + }
  48 + });
  49 + }
  50 + });
  51 + setTimeout(function(){
  52 + var map = SpeedingMap.init();//创建地图
  53 + var myP1 = new BMap.Point(lon,lat); //起点
  54 + var myP2 = new BMap.Point(endLon,endLat); //终点
  55 + map.centerAndZoom(myP1,18);//地图中心点坐标
  56 + console.log(Points);
  57 + var polyline = new BMap.Polyline(Points, {strokeColor:"blue", strokeWeight:5, strokeOpacity:0.5}); //创建折线
  58 + var myIcon = new BMap.Icon("/pages/excep/img/bus.png", new BMap.Size(32, 70), {//小车图片
  59 + imageOffset: new BMap.Size(5,20) //图片的偏移量。为了是图片底部中心对准坐标点。
  60 + });
  61 + $(document).on('click', '#run', function() {
  62 + map.clearOverlays();//清空上一次的轨迹
  63 + map.addOverlay(polyline);//增加折线
  64 + var paths = Points.length;//获得有几个点
  65 + var carMk = new BMap.Marker(Points[0],{icon:myIcon});
  66 + map.addOverlay(carMk);
  67 + i=0;
  68 + function resetMkPoint(i){
  69 + carMk.setPosition(Points[i]);
  70 + if(i < paths){
  71 + setTimeout(function(){
  72 + i++;
  73 + resetMkPoint(i);
  74 + },100);
  75 + }
  76 + }
  77 + setTimeout(function(){
  78 + resetMkPoint(0);
  79 + },100)
  80 + });
  81 + });
  82 +}, 100);
  83 +</script>
  84 +
  85 +
... ...
src/main/resources/static/pages/forms/statement/account.html
... ... @@ -86,7 +86,7 @@
86 86 locale : 'zh-cn'
87 87 });
88 88  
89   - $.get('/basic/lineCode2Name',function(result){
  89 + /* $.get('/basic/lineCode2Name',function(result){
90 90 var data=[];
91 91  
92 92 for(var code in result){
... ... @@ -94,7 +94,29 @@
94 94 }
95 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 121 $('#czcl').on('click', function () {
100 122 $('#code').val('').change();
... ...
src/main/resources/static/pages/forms/statement/busInterval.html
... ... @@ -217,42 +217,51 @@
217 217 }
218 218 }
219 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 266 $("#query").on("click",jsDoQuery);
258 267  
... ...
src/main/resources/static/pages/forms/statement/commandState.html
... ... @@ -178,33 +178,44 @@
178 178 }
179 179 }
180 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 220 $('#code').select2({
210 221 ajax: {
... ...
src/main/resources/static/pages/forms/statement/correctForm.html
... ... @@ -112,16 +112,29 @@
112 112 $("#date").val(year + "-" + month + "-" + day);
113 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 138 $('#code').val('').change();
126 139 });
127 140  
... ... @@ -203,7 +216,7 @@
203 216 });
204 217  
205 218 var line = $("#line").val();
206   - var date = $("#date").val();endDate
  219 + var date = $("#date").val();
207 220 var lpName = $("#lpName").val();
208 221 var endDate = $("#endDate").val();
209 222 var code = $("#code").val();
... ...
src/main/resources/static/pages/forms/statement/correctStatis.html
... ... @@ -145,49 +145,8 @@
145 145 $("#times1").attr("disabled", true);
146 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 150 var fage=false;
192 151 var xlList;
193 152 var obj = [];
... ... @@ -225,36 +184,44 @@
225 184 }
226 185 }
227 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 227 $("#query").on("click",jsDoQuery);
... ... @@ -294,13 +261,12 @@
294 261 // $(".hidden").removeClass("hidden");
295 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 266 tbodyHtml = template('list_company',{list:result[0].workList[0].workList, type:3});
301 267 }else{
302 268 tbodyHtml = template('list_company',{list:result, type:3});
303   - }
  269 + } */
304 270  
305 271 // 把渲染好的模版html文本追加到表格中
306 272 // $('#forms').html(tbodyHtml);
... ... @@ -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 284 if($(this).children().size() < 2){
319 285 return;
320 286 }
... ... @@ -332,9 +298,9 @@
332 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 304 if($(this).children().size() < 2){
339 305 return;
340 306 }
... ... @@ -351,9 +317,9 @@
351 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 323 if($(this).children().size() < 2){
358 324 return;
359 325 }
... ... @@ -361,13 +327,13 @@
361 327 $(this).children().each(function(index){
362 328 params[index] = $(this).text();
363 329 });
364   - $.each(lines, function(i, g){
  330 + $.each(lines, function(i, g){
365 331 if(g.company == params[1] && g.subCompany == params[2] && g.line == params[3]){
366 332 var tbodyHtml = template('list_workList',{list:g.workList});
367 333 $("#lines").html(tbodyHtml);
368 334 }
369   - });
370   - });
  335 + });
  336 + }); */
371 337  
372 338 // $("#export").on("click", function(){
373 339 // $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
... ... @@ -414,9 +380,8 @@
414 380 <th class="hidden"></th>
415 381 <th rowspan="2" width="120px">日期</th>
416 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 385 <th rowspan="2">实际营运班次</th>
421 386 <th colspan="3" align="center">待发调整数</th>
422 387 <th rowspan="2">掉线调整数</th>
... ... @@ -438,18 +403,15 @@
438 403 {{each list as obj i}}
439 404 <tr>
440 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 408 {{/if}}
445 409 {{if obj.date!='合计'}}
446 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 415 <td>{{obj.sjbc}}</td>
454 416 <td>{{obj.sddf}}</td>
455 417 <td>{{obj.zddf}}</td>
... ... @@ -465,7 +427,7 @@
465 427 {{/each}}
466 428 {{if list.length == 0}}
467 429 <tr>
468   - <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td>
  430 + <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
469 431 </tr>
470 432 {{/if}}
471 433 </tbody>
... ...
src/main/resources/static/pages/forms/statement/daily.html
... ... @@ -139,7 +139,7 @@
139 139 }
140 140 }
141 141 $('#fgsdmDaily').html(options);
142   - initXl();
  142 +// initXl();
143 143 }
144 144  
145 145 /* $.get('/basic/lineCode2Name',function(result){
... ... @@ -152,7 +152,7 @@
152 152  
153 153 }) */
154 154  
155   - $("#fgsdmDaily").on("change",initXl);
  155 + /* $("#fgsdmDaily").on("change",initXl);
156 156 function initXl(){
157 157 var data=[];
158 158 if(fage){
... ... @@ -175,7 +175,44 @@
175 175 }
176 176 initPinYinSelect2('#line',data,'');
177 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 217 var line;
181 218 var date;
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
... ... @@ -176,34 +176,44 @@
176 176 }
177 177 }
178 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 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 218 var list;
209 219 $("#forms tbody").on("click","a",function(){
... ...
src/main/resources/static/pages/forms/statement/historyMessage.html
... ... @@ -81,16 +81,29 @@
81 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 107 $('#code').select2({
95 108 ajax: {
96 109 url: '/realSchedule/sreachVehic',
... ...
src/main/resources/static/pages/forms/statement/jobSummary.html
... ... @@ -240,43 +240,46 @@
240 240 }
241 241 }
242 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 284 jQuery.fn.rowspan = function(colIdx) { //封装的一个JQuery小插件
282 285 return this.each(function(){
... ...
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
... ... @@ -233,36 +233,44 @@
233 233 }
234 234 }
235 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 275 var lb = 0; //标志是否有选择至少一个烂班类型
268 276 $("#totalLb").on("change", function(){
... ...
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
... ... @@ -291,48 +291,57 @@
291 291 }
292 292 }
293 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 346 $("#query").on("click", function (){
338 347 jsDoQuery();
... ...
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
... ... @@ -138,33 +138,43 @@
138 138 }
139 139 }
140 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 180 $("#query").on("click",jsDoQuery);
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
... ... @@ -171,35 +171,46 @@
171 171 }
172 172 }
173 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 216 $("#query").on("click", function(){
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly_sum.html
... ... @@ -171,38 +171,45 @@
171 171 }
172 172 }
173 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 214 $("#query").on("click", function(){
208 215 page = 0;
... ...
src/main/resources/static/pages/forms/statement/scheduleDaily.html
... ... @@ -340,32 +340,46 @@ word-wrap: break-word;
340 340 }
341 341 }
342 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 383 $('#export').attr('disabled', "true");
370 384  
371 385 var line = $("#line").val();
... ...
src/main/resources/static/pages/forms/statement/statisticsDaily.html
... ... @@ -206,33 +206,47 @@
206 206 }
207 207 }
208 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 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 250 var line ="";
237 251 var xlName ="";
238 252 var date = "";
... ...
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
... ... @@ -235,43 +235,50 @@
235 235 }
236 236 }
237 237 $('#subCompany').html(options);
238   - initXl();
239   - }
  238 + }
240 239  
241   - $("#subCompany").on("change",initXl);
242   - function initXl(){
243   - var data=[];
244   - data.push({id:" ", text:"全部线路"});
245   - if(fage){
246   - $("#line").select2("destroy").html('');
247   - }
248   - var fgs=$('#subCompany').val();
249   - var gs=$('#company').val();
250   - for(var i=0;i<xlList.length;i++){
251   - if(gs!=""){
252   - if(fgs!=""){
253   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
254   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
255   - }
256   - }else{
257   - if(xlList[i]["gsbm"]==gs){
258   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  240 + var tempData = {};
  241 + $.get('/report/lineList',function(xlList){
  242 + var data = [];
  243 + data.push({id: " ", text: "全部线路"});
  244 + $.get('/user/companyData', function(result){
  245 + for(var i = 0; i < result.length; i++){
  246 + var companyCode = result[i].companyCode;
  247 + var children = result[i].children;
  248 + for(var j = 0; j < children.length; j++){
  249 + var code = children[j].code;
  250 + for(var k=0;k < xlList.length;k++ ){
  251 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  252 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  253 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  254 + }
259 255 }
260 256 }
261 257 }
262   - }
263   - initPinYinSelect2('#line',data,'');
264   - fage=true;
265   -
266   - $("#endDate").attr("disabled", true);
267   - $("#endDate").val($("#startDate").val());
268   - line = data[0].id;
269   - statu = 0;
270   -
271   - updateModel();
272   - updateLp("");
273   - }
  258 + initPinYinSelect2('#line',data,'');
  259 + $("#endDate").attr("disabled", true);
  260 + $("#endDate").val($("#startDate").val());
  261 + line = data[0].id;
  262 + statu = 0;
  263 +
  264 + updateModel();
  265 + updateLp("");
  266 + });
  267 + });
274 268  
  269 + $("#line").on("change", function(){
  270 + if($("#line").val() == " "){
  271 + $("#company").attr("disabled", false);
  272 + $("#subCompany").attr("disabled", false);
  273 + } else {
  274 + var temp = tempData[$("#line").val()].split(":");
  275 + $("#company").val(temp[0]);
  276 + updateCompany();
  277 + $("#subCompany").val(temp[1]);
  278 + $("#company").attr("disabled", true);
  279 + $("#subCompany").attr("disabled", true);
  280 + }
  281 + });
275 282  
276 283 $("#query").on("click", function (){
277 284 jsDoQuery();
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -158,14 +158,14 @@
158 158 }
159 159 }
160 160 $('#fgsdmXcld').html(options);
161   - initXl();
  161 +// initXl();
162 162 }
163 163  
164 164  
165 165  
166 166  
167   - $("#fgsdmXcld").on("change",initXl);
168   - function initXl(){
  167 +// $("#fgsdmXcld").on("change",initXl);
  168 + /* function initXl(){
169 169 var data=[];
170 170 if(fage){
171 171 $("#line").select2("destroy").html('');
... ... @@ -187,7 +187,44 @@
187 187 }
188 188 initPinYinSelect2('#line',data,'');
189 189 fage=true;
190   - }
  190 + } */
  191 +
  192 + var tempData = {};
  193 + $.get('/report/lineList',function(xlList){
  194 + var data = [];
  195 +// data.push({id: " ", text: "全部线路"});
  196 + $.get('/user/companyData', function(result){
  197 + for(var i = 0; i < result.length; i++){
  198 + var companyCode = result[i].companyCode;
  199 + var children = result[i].children;
  200 + for(var j = 0; j < children.length; j++){
  201 + var code = children[j].code;
  202 + for(var k=0;k < xlList.length;k++ ){
  203 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  204 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  205 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  206 + }
  207 + }
  208 + }
  209 + }
  210 + initPinYinSelect2('#line',data,'');
  211 +
  212 + });
  213 + });
  214 +
  215 + $("#line").on("change", function(){
  216 + if($("#line").val() == " "){
  217 + $("#gsdmXcld").attr("disabled", false);
  218 + $("#fgsdmXcld").attr("disabled", false);
  219 + } else {
  220 + var temp = tempData[$("#line").val()].split(":");
  221 + $("#gsdmXcld").val(temp[0]);
  222 + updateCompany();
  223 + $("#fgsdmXcld").val(temp[1]);
  224 + $("#gsdmXcld").attr("disabled", true);
  225 + $("#fgsdmXcld").attr("disabled", true);
  226 + }
  227 + });
191 228 var date = '';
192 229 var line = '';
193 230 $("#query").on("click",function(){
... ...
src/main/resources/static/pages/forms/statement/workDaily.html
... ... @@ -112,44 +112,6 @@
112 112 day = "0" + day;
113 113 $("#date").val(year + "-" + month + "-" + day);
114 114  
115   -// $.get('/basic/lineCode2Name',function(result){
116   -// var data=[];
117   -
118   -// data.push({id: " ", text: "全部线路"});
119   -// for(var code in result){
120   -// data.push({id: code, text: result[code]});
121   -// }
122   -// initPinYinSelect2('#line',data,'');
123   -// })
124   -// var obj = [];
125   -// $.get('/user/companyData', function(result){
126   -// obj = result;
127   -// var options = '';
128   -// for(var i = 0; i < obj.length; i++){
129   -// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
130   -// }
131   -// if(obj.length == 1){
132   -// $('#company1').hide();
133   -// if(obj[0].children.length == 1)
134   -// $('#subCompany1').hide();
135   -// }
136   -// $('#company').html(options);
137   -// updateCompany();
138   -// });
139   -// $("#company").on("change",updateCompany);
140   -// function updateCompany(){
141   -// var company = $('#company').val();
142   -// var options = '';
143   -// for(var i = 0; i < obj.length; i++){
144   -// if(obj[i].companyCode == company){
145   -// var children = obj[i].children;
146   -// for(var j = 0; j < children.length; j++){
147   -// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
148   -// }
149   -// }
150   -// }
151   -// $('#subCompany').html(options);
152   -// }
153 115 var fage=false;
154 116 var xlList;
155 117 var obj = [];
... ... @@ -188,34 +150,45 @@
188 150 }
189 151 }
190 152 $('#subCompany').html(options);
191   - initXl();
192 153 }
193 154  
194   - $("#subCompany").on("change",initXl);
195   - function initXl(){
196   - var data=[];
197   - if(fage){
198   - $("#line").select2("destroy").html('');
199   - }
200   - var fgs=$('#subCompany').val();
201   - var gs=$('#company').val();
  155 + var tempData = {};
  156 + $.get('/report/lineList',function(xlList){
  157 + var data = [];
202 158 data.push({id: " ", text: "全部线路"});
203   - for(var i=0;i<xlList.length;i++){
204   - if(gs!=""){
205   - if(fgs!=""){
206   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
207   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
208   - }
209   - }else{
210   - if(xlList[i]["gsbm"]==gs){
211   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  159 + $.get('/user/companyData', function(result){
  160 + for(var i = 0; i < result.length; i++){
  161 + var companyCode = result[i].companyCode;
  162 + var children = result[i].children;
  163 + for(var j = 0; j < children.length; j++){
  164 + var code = children[j].code;
  165 + for(var k=0;k < xlList.length;k++ ){
  166 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  167 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  168 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  169 + }
212 170 }
213 171 }
214 172 }
  173 + initPinYinSelect2('#line',data,'');
  174 +
  175 + });
  176 + });
  177 +
  178 + $("#line").on("change", function(){
  179 + if($("#line").val() == " "){
  180 + $("#company").attr("disabled", false);
  181 + $("#subCompany").attr("disabled", false);
  182 + } else {
  183 + var temp = tempData[$("#line").val()].split(":");
  184 + $("#company").val(temp[0]);
  185 + updateCompany();
  186 + $("#subCompany").val(temp[1]);
  187 + $("#company").attr("disabled", true);
  188 + $("#subCompany").attr("disabled", true);
215 189 }
216   - initPinYinSelect2('#line',data,'');
217   - fage=true;
218   - }
  190 + });
  191 +
219 192  
220 193  
221 194  
... ...
src/main/resources/static/pages/mforms/changetochanges/changetochange.html
... ... @@ -180,35 +180,46 @@
180 180 }
181 181 }
182 182 $('#fgsdmChange').html(options);
183   - initXl();
184 183 }
185 184  
186   - $("#fgsdmChange").on("change",initXl);
187   - function initXl(){
188   - var data=[];
189   - data.push({id: " ", text: "请选择"});
190   - if(fage){
191   - $("#line").select2("destroy").html('');
192   - }
193   - var fgs=$('#fgsdmChange').val();
194   - var gs=$('#gsdmChange').val();
195   - for(var i=0;i<xlList.length;i++){
196   - if(gs!=""){
197   - if(fgs!=""){
198   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
199   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
200   - }
201   - }else{
202   - if(xlList[i]["gsbm"]==gs){
203   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  185 +
  186 + var tempData = {};
  187 + $.get('/report/lineList',function(xlList){
  188 + var data = [];
  189 + data.push({id: " ", text: "全部线路"});
  190 + $.get('/user/companyData', function(result){
  191 + for(var i = 0; i < result.length; i++){
  192 + var companyCode = result[i].companyCode;
  193 + var children = result[i].children;
  194 + for(var j = 0; j < children.length; j++){
  195 + var code = children[j].code;
  196 + for(var k=0;k < xlList.length;k++ ){
  197 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  198 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  199 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  200 + }
204 201 }
205 202 }
206 203 }
  204 + initPinYinSelect2('#line',data,'');
  205 +
  206 + });
  207 + });
  208 +
  209 + $("#line").on("change", function(){
  210 + if($("#line").val() == " "){
  211 + $("#gsdmChange").attr("disabled", false);
  212 + $("#fgsdmChange").attr("disabled", false);
  213 + } else {
  214 + var temp = tempData[$("#line").val()].split(":");
  215 + $("#gsdmChange").val(temp[0]);
  216 + updateCompany();
  217 + $("#fgsdmChange").val(temp[1]);
  218 + $("#gsdmChange").attr("disabled", true);
  219 + $("#fgsdmChange").attr("disabled", true);
207 220 }
208   - initPinYinSelect2('#line',data,'');
209   - fage=true;
210   - }
211   -
  221 + });
  222 +
212 223 var line;
213 224 var startDate;
214 225 var endDate;
... ...
src/main/resources/static/pages/mforms/operationservices/operationservice.html
... ... @@ -153,45 +153,45 @@
153 153 }
154 154 }
155 155 $('#fgsdmOperat').html(options);
156   - initXl();
157 156 }
158 157  
159   - /* $.get('/basic/lineCode2Name',function(result){
160   - var data=[];
161   -
162   - for(var code in result){
163   - data.push({id: code, text: result[code]});
164   - }
165   - initPinYinSelect2('#line',data,'');
166   -
167   - }) */
168   -
169   - $("#fgsdmOperat").on("change",initXl);
170   - function initXl(){
171   - var data=[];
  158 + var tempData = {};
  159 + $.get('/report/lineList',function(xlList){
  160 + var data = [];
172 161 data.push({id: " ", text: "全部线路"});
173   - if(fage){
174   - $("#line").select2("destroy").html('');
175   - }
176   - var fgs=$('#fgsdmOperat').val();
177   - var gs=$('#gsdmOperat').val();
178   - for(var i=0;i<xlList.length;i++){
179   - if(gs!=""){
180   - if(fgs!=""){
181   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
182   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
183   - }
184   - }else{
185   - if(xlList[i]["gsbm"]==gs){
186   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  162 + $.get('/user/companyData', function(result){
  163 + for(var i = 0; i < result.length; i++){
  164 + var companyCode = result[i].companyCode;
  165 + var children = result[i].children;
  166 + for(var j = 0; j < children.length; j++){
  167 + var code = children[j].code;
  168 + for(var k=0;k < xlList.length;k++ ){
  169 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  170 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  171 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  172 + }
187 173 }
188 174 }
189 175 }
190   - }
191   - initPinYinSelect2('#line',data,'');
192   - fage=true;
193   - }
  176 + initPinYinSelect2('#line',data,'');
  177 +
  178 + });
  179 + });
194 180  
  181 + $("#line").on("change", function(){
  182 + if($("#line").val() == " "){
  183 + $("#gsdmOperat").attr("disabled", false);
  184 + $("#fgsdmOperat").attr("disabled", false);
  185 + } else {
  186 + var temp = tempData[$("#line").val()].split(":");
  187 + $("#gsdmOperat").val(temp[0]);
  188 + updateCompany();
  189 + $("#fgsdmOperat").val(temp[1]);
  190 + $("#gsdmOperat").attr("disabled", true);
  191 + $("#fgsdmOperat").attr("disabled", true);
  192 + }
  193 + });
  194 +
195 195  
196 196 $("#query").on(
197 197 "click",
... ...
src/main/resources/static/pages/mforms/shifdays/shifday.html
... ... @@ -152,7 +152,6 @@ $(function(){
152 152 }
153 153 }
154 154 $('#fgsdmShif').html(options);
155   - initXl();
156 155 }
157 156  
158 157  
... ... @@ -166,30 +165,43 @@ $(function(){
166 165  
167 166 // })
168 167  
169   - $("#fgsdmShif").on("change",initXl);
170   - function initXl(){
171   - var data=[];
172   - if(fage){
173   - $("#line").select2("destroy").html('');
174   - }
175   - var fgs=$('#fgsdmShif').val();
176   - var gs=$('#gsdmShif').val();
177   - for(var i=0;i<xlList.length;i++){
178   - if(gs!=""){
179   - if(fgs!=""){
180   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
181   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
182   - }
183   - }else{
184   - if(xlList[i]["gsbm"]==gs){
185   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  168 + var tempData = {};
  169 + $.get('/report/lineList',function(xlList){
  170 + var data = [];
  171 +// data.push({id: " ", text: "全部线路"});
  172 + $.get('/user/companyData', function(result){
  173 + for(var i = 0; i < result.length; i++){
  174 + var companyCode = result[i].companyCode;
  175 + var children = result[i].children;
  176 + for(var j = 0; j < children.length; j++){
  177 + var code = children[j].code;
  178 + for(var k=0;k < xlList.length;k++ ){
  179 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  180 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  181 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  182 + }
  183 + }
186 184 }
187 185 }
  186 + initPinYinSelect2('#line',data,'');
  187 +
  188 + });
  189 + });
  190 +
  191 + $("#line").on("change", function(){
  192 + if($("#line").val() == " "){
  193 + $("#gsdmShif").attr("disabled", false);
  194 + $("#fgsdmShif").attr("disabled", false);
  195 + } else {
  196 + var temp = tempData[$("#line").val()].split(":");
  197 + $("#gsdmShif").val(temp[0]);
  198 + updateCompany();
  199 + $("#fgsdmShif").val(temp[1]);
  200 + $("#gsdmShif").attr("disabled", true);
  201 + $("#fgsdmShif").attr("disabled", true);
188 202 }
189   - }
190   - initPinYinSelect2('#line',data,'');
191   - fage=true;
192   - }
  203 + });
  204 +
193 205  
194 206  
195 207 $("#query").on("click",function(){
... ...
src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
... ... @@ -150,32 +150,45 @@
150 150 }
151 151 }
152 152 $('#fgsdmManth').html(options);
153   - initXl();
154 153 }
155   - $("#fgsdmManth").on("change",initXl);
156   - function initXl(){
157   - var data=[];
158   - if(fage){
159   - $("#line").select2("destroy").html('');
160   - }
161   - var fgs=$('#fgsdmManth').val();
162   - var gs=$('#gsdmManth').val();
163   - for(var i=0;i<xlList.length;i++){
164   - if(gs!=""){
165   - if(fgs!=""){
166   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
167   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
168   - }
169   - }else{
170   - if(xlList[i]["gsbm"]==gs){
171   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  154 +
  155 +
  156 + var tempData = {};
  157 + $.get('/report/lineList',function(xlList){
  158 + var data = [];
  159 + $.get('/user/companyData', function(result){
  160 + for(var i = 0; i < result.length; i++){
  161 + var companyCode = result[i].companyCode;
  162 + var children = result[i].children;
  163 + for(var j = 0; j < children.length; j++){
  164 + var code = children[j].code;
  165 + for(var k=0;k < xlList.length;k++ ){
  166 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  167 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  168 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  169 + }
172 170 }
173 171 }
174 172 }
  173 + initPinYinSelect2('#line',data,'');
  174 +
  175 + });
  176 + });
  177 +
  178 + $("#line").on("change", function(){
  179 + if($("#line").val() == " "){
  180 + $("#gsdmManth").attr("disabled", false);
  181 + $("#fgsdmManth").attr("disabled", false);
  182 + } else {
  183 + var temp = tempData[$("#line").val()].split(":");
  184 + $("#gsdmManth").val(temp[0]);
  185 + updateCompany();
  186 + $("#fgsdmManth").val(temp[1]);
  187 + $("#gsdmManth").attr("disabled", true);
  188 + $("#fgsdmManth").attr("disabled", true);
175 189 }
176   - initPinYinSelect2('#line',data,'');
177   - fage=true;
178   - }
  190 + });
  191 +
179 192 $("#query").on("click",function(){
180 193 if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
181 194 layer.msg("请选择时间范围!");
... ...
src/main/resources/static/pages/mforms/singledatas/singledata.html
... ... @@ -134,34 +134,44 @@
134 134 }
135 135 }
136 136 $('#fgsdmSing').html(options);
137   - initXl();
138 137 }
139 138  
140   - $("#fgsdmSing").on("change",initXl);
141   - function initXl(){
142   - var data=[];
143   - data.push({id: " ", text: "请选择"});
144   - if(fage){
145   - $("#line").select2("destroy").html('');
146   - }
147   - var fgs=$('#fgsdmSing').val();
148   - var gs=$('#gsdmSing').val();
149   - for(var i=0;i<xlList.length;i++){
150   - if(gs!=""){
151   - if(fgs!=""){
152   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
153   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
154   - }
155   - }else{
156   - if(xlList[i]["gsbm"]==gs){
157   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  139 + var tempData = {};
  140 + $.get('/report/lineList',function(xlList){
  141 + var data = [];
  142 + data.push({id: " ", text: "全部线路"});
  143 + $.get('/user/companyData', function(result){
  144 + for(var i = 0; i < result.length; i++){
  145 + var companyCode = result[i].companyCode;
  146 + var children = result[i].children;
  147 + for(var j = 0; j < children.length; j++){
  148 + var code = children[j].code;
  149 + for(var k=0;k < xlList.length;k++ ){
  150 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  151 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  152 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  153 + }
158 154 }
159 155 }
160 156 }
  157 + initPinYinSelect2('#line',data,'');
  158 +
  159 + });
  160 + });
  161 +
  162 + $("#line").on("change", function(){
  163 + if($("#line").val() == " "){
  164 + $("#gsdmSing").attr("disabled", false);
  165 + $("#fgsdmSing").attr("disabled", false);
  166 + } else {
  167 + var temp = tempData[$("#line").val()].split(":");
  168 + $("#gsdmSing").val(temp[0]);
  169 + updateCompany();
  170 + $("#fgsdmSing").val(temp[1]);
  171 + $("#gsdmSing").attr("disabled", true);
  172 + $("#fgsdmSing").attr("disabled", true);
161 173 }
162   - initPinYinSelect2('#line',data,'');
163   - fage=true;
164   - }
  174 + });
165 175  
166 176  
167 177 $("#query").on("click",function(){
... ...
src/main/resources/static/pages/mforms/turnoutrates/turnoutrate.html
... ... @@ -172,34 +172,44 @@
172 172 }
173 173 }
174 174 $('#fgsdmTurn').html(options);
175   - initXl();
176 175 }
177   -
178   - $("#fgsdmTurn").on("change",initXl);
179   - function initXl(){
180   - var data=[];
181   - data.push({id:" ", text:"全部线路"});
182   - if(fage){
183   - $("#line").select2("destroy").html('');
184   - }
185   - var fgs=$('#fgsdmTurn').val();
186   - var gs=$('#gsdmTurn').val();
187   - for(var i=0;i<xlList.length;i++){
188   - if(gs!=""){
189   - if(fgs!=""){
190   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
191   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
192   - }
193   - }else{
194   - if(xlList[i]["gsbm"]==gs){
195   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  176 +
  177 + var tempData = {};
  178 + $.get('/report/lineList',function(xlList){
  179 + var data = [];
  180 + data.push({id: " ", text: "全部线路"});
  181 + $.get('/user/companyData', function(result){
  182 + for(var i = 0; i < result.length; i++){
  183 + var companyCode = result[i].companyCode;
  184 + var children = result[i].children;
  185 + for(var j = 0; j < children.length; j++){
  186 + var code = children[j].code;
  187 + for(var k=0;k < xlList.length;k++ ){
  188 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  189 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  190 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  191 + }
196 192 }
197 193 }
198 194 }
  195 + initPinYinSelect2('#line',data,'');
  196 +
  197 + });
  198 + });
  199 +
  200 + $("#line").on("change", function(){
  201 + if($("#line").val() == " "){
  202 + $("#gsdmTurn").attr("disabled", false);
  203 + $("#fgsdmTurn").attr("disabled", false);
  204 + } else {
  205 + var temp = tempData[$("#line").val()].split(":");
  206 + $("#gsdmTurn").val(temp[0]);
  207 + updateCompany();
  208 + $("#fgsdmTurn").val(temp[1]);
  209 + $("#gsdmTurn").attr("disabled", true);
  210 + $("#fgsdmTurn").attr("disabled", true);
199 211 }
200   - initPinYinSelect2('#line',data,'');
201   - fage=true;
202   - }
  212 + });
203 213  
204 214 var line;
205 215 var startDate;
... ...
src/main/resources/static/pages/mforms/vehicleloadings/vehicleloading.html
... ... @@ -127,33 +127,43 @@
127 127 }
128 128 }
129 129 $('#fgsdmVehic').html(options);
130   - initXl();
131 130 }
132 131  
133   - $("#fgsdmVehic").on("change",initXl);
134   - function initXl(){
135   - var data=[];
136   - if(fage){
137   - $("#line").select2("destroy").html('');
138   - }
139   - var fgs=$('#fgsdmVehic').val();
140   - var gs=$('#gsdmVehic').val();
141   - for(var i=0;i<xlList.length;i++){
142   - if(gs!=""){
143   - if(fgs!=""){
144   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
145   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
146   - }
147   - }else{
148   - if(xlList[i]["gsbm"]==gs){
149   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  132 + var tempData = {};
  133 + $.get('/report/lineList',function(xlList){
  134 + var data = [];
  135 + $.get('/user/companyData', function(result){
  136 + for(var i = 0; i < result.length; i++){
  137 + var companyCode = result[i].companyCode;
  138 + var children = result[i].children;
  139 + for(var j = 0; j < children.length; j++){
  140 + var code = children[j].code;
  141 + for(var k=0;k < xlList.length;k++ ){
  142 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  143 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  144 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  145 + }
150 146 }
151 147 }
152 148 }
  149 + initPinYinSelect2('#line',data,'');
  150 +
  151 + });
  152 + });
  153 +
  154 + $("#line").on("change", function(){
  155 + if($("#line").val() == " "){
  156 + $("#gsdmVehic").attr("disabled", false);
  157 + $("#fgsdmVehic").attr("disabled", false);
  158 + } else {
  159 + var temp = tempData[$("#line").val()].split(":");
  160 + $("#gsdmVehic").val(temp[0]);
  161 + updateCompany();
  162 + $("#fgsdmVehic").val(temp[1]);
  163 + $("#gsdmVehic").attr("disabled", true);
  164 + $("#fgsdmVehic").attr("disabled", true);
153 165 }
154   - initPinYinSelect2('#line',data,'');
155   - fage=true;
156   - }
  166 + });
157 167  
158 168 var line ;
159 169 var date ;
... ...
src/main/resources/static/pages/mforms/waybilldays/waybillday.html
... ... @@ -131,32 +131,46 @@
131 131 }
132 132 }
133 133 $('#fgsdmWaybillday').html(options);
134   - initXl();
  134 +// initXl();
135 135 }
136   - $("#fgsdmWaybillday").on("change",initXl);
137   - function initXl(){
138   - var data=[];
139   - if(fage){
140   - $("#line").select2("destroy").html('');
141   - }
142   - var fgs=$('#fgsdmWaybillday').val();
143   - var gs=$('#gsdmWaybillday').val();
144   - for(var i=0;i<xlList.length;i++){
145   - if(gs!=""){
146   - if(fgs!=""){
147   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
148   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
149   - }
150   - }else{
151   - if(xlList[i]["gsbm"]==gs){
152   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  136 +
  137 + var tempData = {};
  138 + $.get('/report/lineList',function(xlList){
  139 + var data = [];
  140 +// data.push({id: " ", text: "全部线路"});
  141 + $.get('/user/companyData', function(result){
  142 + for(var i = 0; i < result.length; i++){
  143 + var companyCode = result[i].companyCode;
  144 + var children = result[i].children;
  145 + for(var j = 0; j < children.length; j++){
  146 + var code = children[j].code;
  147 + for(var k=0;k < xlList.length;k++ ){
  148 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  149 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  150 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  151 + }
153 152 }
154 153 }
155 154 }
  155 + initPinYinSelect2('#line',data,'');
  156 +
  157 + });
  158 + });
  159 +
  160 + $("#line").on("change", function(){
  161 + if($("#line").val() == " "){
  162 + $("#gsdmWaybillday").attr("disabled", false);
  163 + $("#fgsdmWaybillday").attr("disabled", false);
  164 + } else {
  165 + var temp = tempData[$("#line").val()].split(":");
  166 + $("#gsdmWaybillday").val(temp[0]);
  167 + updateCompany();
  168 + $("#fgsdmWaybillday").val(temp[1]);
  169 + $("#gsdmWaybillday").attr("disabled", true);
  170 + $("#fgsdmWaybillday").attr("disabled", true);
156 171 }
157   - initPinYinSelect2('#line',data,'');
158   - fage=true;
159   - }
  172 + });
  173 +
160 174 var line;
161 175 var date;
162 176 var gsdmWaybillday;
... ...
src/main/resources/static/pages/report/countMileage/countBus/countBusMileage.html
... ... @@ -149,33 +149,46 @@
149 149 }
150 150 }
151 151 $('#fgsdm').html(options);
152   - initXl();
153 152 }
154   - $("#fgsdm").on("change",initXl);
155   - function initXl(){
156   - var data=[];
  153 +
  154 +
  155 + var tempData = {};
  156 + $.get('/report/lineList',function(xlList){
  157 + var data = [];
157 158 data.push({id: " ", text: "全部线路"});
158   - if(fage){
159   - $("#line").select2("destroy").html('');
160   - }
161   - var fgs=$('#fgsdm').val();
162   - var gs=$('#gsdm').val();
163   - for(var i=0;i<xlList.length;i++){
164   - if(gs!=""){
165   - if(fgs!=""){
166   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
167   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
168   - }
169   - }else{
170   - if(xlList[i]["gsbm"]==gs){
171   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  159 + $.get('/user/companyData', function(result){
  160 + for(var i = 0; i < result.length; i++){
  161 + var companyCode = result[i].companyCode;
  162 + var children = result[i].children;
  163 + for(var j = 0; j < children.length; j++){
  164 + var code = children[j].code;
  165 + for(var k=0;k < xlList.length;k++ ){
  166 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  167 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  168 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  169 + }
172 170 }
173 171 }
174 172 }
  173 + initPinYinSelect2('#line',data,'');
  174 +
  175 + });
  176 + });
  177 +
  178 + $("#line").on("change", function(){
  179 + if($("#line").val() == " "){
  180 + $("#gsdm").attr("disabled", false);
  181 + $("#fgsdm").attr("disabled", false);
  182 + } else {
  183 + var temp = tempData[$("#line").val()].split(":");
  184 + $("#gsdm").val(temp[0]);
  185 + updateCompany();
  186 + $("#fgsdm").val(temp[1]);
  187 + $("#gsdm").attr("disabled", true);
  188 + $("#fgsdm").attr("disabled", true);
175 189 }
176   - initPinYinSelect2('#line',data,'');
177   - fage=true;
178   - }
  190 + });
  191 +
179 192 var line ="";
180 193 var xlName ="";
181 194 var date = "";
... ... @@ -307,8 +320,8 @@
307 320 <td>{{obj.jhwjcclc}}</td>
308 321 <td>{{obj.kfks}}</td>
309 322 <td>{{obj.zrwjcclc}}</td>
310   - <td>0</td>
311   - <td>0</td>
  323 + <td>{{obj.zrwjcclc1}}</td>
  324 + <td>{{obj.zrwjcclc2}}</td>
312 325 <td>{{obj.ljyy}}</td>
313 326 <td>{{obj.ljjcc}}</td>
314 327 <td>{{obj.yhl}}</td>
... ...
src/main/resources/static/pages/report/countMileage/countLine/countLineMileage.html
... ... @@ -184,33 +184,46 @@
184 184 }
185 185 }
186 186 $('#fgsdm').html(options);
187   - initXl();
188 187 }
189   - $("#fgsdm").on("change",initXl);
190   - function initXl(){
191   - var data=[];
  188 +
  189 +
  190 + var tempData = {};
  191 + $.get('/report/lineList',function(xlList){
  192 + var data = [];
192 193 data.push({id: " ", text: "全部线路"});
193   - if(fage){
194   - $("#line").select2("destroy").html('');
195   - }
196   - var fgs=$('#fgsdm').val();
197   - var gs=$('#gsdm').val();
198   - for(var i=0;i<xlList.length;i++){
199   - if(gs!=""){
200   - if(fgs!=""){
201   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
202   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
203   - }
204   - }else{
205   - if(xlList[i]["gsbm"]==gs){
206   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  194 + $.get('/user/companyData', function(result){
  195 + for(var i = 0; i < result.length; i++){
  196 + var companyCode = result[i].companyCode;
  197 + var children = result[i].children;
  198 + for(var j = 0; j < children.length; j++){
  199 + var code = children[j].code;
  200 + for(var k=0;k < xlList.length;k++ ){
  201 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  202 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  203 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  204 + }
207 205 }
208 206 }
209 207 }
  208 + initPinYinSelect2('#line',data,'');
  209 +
  210 + });
  211 + });
  212 +
  213 + $("#line").on("change", function(){
  214 + if($("#line").val() == " "){
  215 + $("#gsdm").attr("disabled", false);
  216 + $("#fgsdm").attr("disabled", false);
  217 + } else {
  218 + var temp = tempData[$("#line").val()].split(":");
  219 + $("#gsdm").val(temp[0]);
  220 + updateCompany();
  221 + $("#fgsdm").val(temp[1]);
  222 + $("#gsdm").attr("disabled", true);
  223 + $("#fgsdm").attr("disabled", true);
210 224 }
211   - initPinYinSelect2('#line',data,'');
212   - fage=true;
213   - }
  225 + });
  226 +
214 227 var line ="";
215 228 var xlName ="";
216 229 var date = "";
... ... @@ -293,8 +306,8 @@
293 306 <td>{{obj.jhnjcclc}}</td>
294 307 <td>{{obj.jhwjcclc}}</td>
295 308 <td>{{obj.zrwjcclc}}</td>
296   - <td>0</td>
297   - <td>0</td>
  309 + <td>{{obj.zrwjcclc1}}</td>
  310 + <td>{{obj.zrwjcclc2}}</td>
298 311 <td>{{obj.lbss}}</td>
299 312 <td>{{obj.ssgl_lz}}</td>
300 313 <td>{{obj.ssgl_dm}}</td>
... ...
src/main/resources/static/pages/report/inoutstation.html
... ... @@ -238,37 +238,47 @@
238 238 }
239 239 }
240 240 $('#fgsdm').html(options);
241   - initXl();
242 241 initCl();
243 242 }
244 243  
245 244  
246 245  
247 246  
248   - $("#fgsdm").on("change",initXl);
249   - function initXl(){
250   - var data=[];
251   - if(fage){
252   - $("#line").select2("destroy").html('');
253   - }
254   - var fgs=$('#fgsdm').val();
255   - var gs=$('#gsdm').val();
256   - for(var i=0;i<xlList.length;i++){
257   - if(gs!=""){
258   - if(fgs!=""){
259   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
260   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
261   - }
262   - }else{
263   - if(xlList[i]["gsbm"]==gs){
264   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  247 + var tempData = {};
  248 + $.get('/report/lineList',function(xlList){
  249 + var data = [];
  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 + }
265 261 }
266 262 }
267 263 }
  264 + initPinYinSelect2('#line',data,'');
  265 +
  266 + });
  267 + });
  268 +
  269 + $("#line").on("change", function(){
  270 + if($("#line").val() == " "){
  271 + $("#gsdm").attr("disabled", false);
  272 + $("#fgsdm").attr("disabled", false);
  273 + } else {
  274 + var temp = tempData[$("#line").val()].split(":");
  275 + $("#gsdm").val(temp[0]);
  276 + updateCompany();
  277 + $("#fgsdm").val(temp[1]);
  278 + $("#gsdm").attr("disabled", true);
  279 + $("#fgsdm").attr("disabled", true);
268 280 }
269   - initPinYinSelect2('#line',data,'');
270   - fage=true;
271   - }
  281 + });
272 282  
273 283  
274 284 $("#query").on("click",function(){
... ...
src/main/resources/static/pages/report/message/message.html
... ... @@ -120,16 +120,25 @@
120 120 day = "0" + day;
121 121 $("#date").val(year + "-" + month + "-" + day);
122 122  
123   - $.get('/basic/lineCode2Name',function(result){
124   - var data=[];
125   -
126   - for(var code in result){
127   - data.push({id: code, text: result[code]});
128   - }
129   - console.log(data);
130   - initPinYinSelect2('#line',data,'');
131   -
132   - })
  123 + $.get('/report/lineList',function(xlList){
  124 + var data = [];
  125 + $.get('/user/companyData', function(result){
  126 + for(var i = 0; i < result.length; i++){
  127 + var companyCode = result[i].companyCode;
  128 + var children = result[i].children;
  129 + for(var j = 0; j < children.length; j++){
  130 + var code = children[j].code;
  131 + for(var k=0;k < xlList.length;k++ ){
  132 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  133 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  134 + }
  135 + }
  136 + }
  137 + }
  138 + initPinYinSelect2('#line',data,'');
  139 +
  140 + });
  141 + });
133 142 $('#code').select2({
134 143 ajax: {
135 144 url: '/realSchedule/sreachVehic',
... ...
src/main/resources/static/pages/report/oil/oilListMonth.html
... ... @@ -105,16 +105,28 @@
105 105 $("#date").val(year + "-0" + month + "-" + day);
106 106 }
107 107  
108   - $.get('/basic/lineCode2Name',function(result){
109   - var data=[];
110   -
111   - for(var code in result){
112   - data.push({id: code, text: result[code]});
113   - }
114   - console.log(data);
115   - initPinYinSelect2('#line',data,'');
116   -
117   - })
  108 + var tempData = {};
  109 + $.get('/report/lineList',function(xlList){
  110 + var data = [];
  111 + $.get('/user/companyData', function(result){
  112 + for(var i = 0; i < result.length; i++){
  113 + var companyCode = result[i].companyCode;
  114 + var children = result[i].children;
  115 + for(var j = 0; j < children.length; j++){
  116 + var code = children[j].code;
  117 + for(var k=0;k < xlList.length;k++ ){
  118 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  119 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  120 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  121 + }
  122 + }
  123 + }
  124 + }
  125 + initPinYinSelect2('#line',data,'');
  126 +
  127 + });
  128 + });
  129 +
118 130  
119 131 //查询
120 132 $("#query").on('click',function(){
... ...
src/main/resources/static/pages/report/sheet/sheetList.html
... ... @@ -170,37 +170,47 @@
170 170 }
171 171 }
172 172 $('#fgsdm').html(options);
173   - initXl();
174   - }
175   -
176   -
177   -
178   -
179   - $("#fgsdm").on("change",initXl);
180   - function initXl(){
181   - var data=[];
182   - if(fage){
183   - $("#line").select2("destroy").html('');
184   - }
185   - data.push({id: " ", text: "请选择"});
186   - var fgs=$('#fgsdm').val();
187   - var gs=$('#gsdm').val();
188   - for(var i=0;i<xlList.length;i++){
189   - if(gs!=""){
190   - if(fgs!=""){
191   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
192   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
193   - }
194   - }else{
195   - if(xlList[i]["gsbm"]==gs){
196   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  173 +
  174 + var tempData = {};
  175 + $.get('/report/lineList',function(xlList){
  176 + var data = [];
  177 + data.push({id: " ", text: "全部线路"});
  178 + $.get('/user/companyData', function(result){
  179 + for(var i = 0; i < result.length; i++){
  180 + var companyCode = result[i].companyCode;
  181 + var children = result[i].children;
  182 + for(var j = 0; j < children.length; j++){
  183 + var code = children[j].code;
  184 + for(var k=0;k < xlList.length;k++ ){
  185 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  186 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  187 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  188 + }
  189 + }
197 190 }
198 191 }
  192 + initPinYinSelect2('#line',data,'');
  193 +
  194 + });
  195 + });
  196 +
  197 + $("#line").on("change", function(){
  198 + if($("#line").val() == " "){
  199 + $("#gsdm").attr("disabled", false);
  200 + $("#fgsdm").attr("disabled", false);
  201 + } else {
  202 + var temp = tempData[$("#line").val()].split(":");
  203 + $("#gsdm").val(temp[0]);
  204 + updateCompany();
  205 + $("#fgsdm").val(temp[1]);
  206 + $("#gsdm").attr("disabled", true);
  207 + $("#fgsdm").attr("disabled", true);
199 208 }
200   - }
201   - initPinYinSelect2('#line',data,'');
202   - fage=true;
  209 + });
203 210 }
  211 +
  212 +
  213 +
204 214 //查询
205 215 $("#query").on('click',function(){
206 216 var line = $("#line").val();
... ...
src/main/resources/static/pages/report/timetable/timetable.html
... ... @@ -237,36 +237,46 @@
237 237 }
238 238 }
239 239 $('#fgsdmTime').html(options);
240   - initXl();
241 240 }
242 241  
243   - $("#fgsdmTime").on("change",initXl);
244   - function initXl(){
245   - var data=[];
246   - if(fage){
247   - $("#line").select2("destroy").html('');
248   - }
249   - var fgs=$('#fgsdmTime').val();
250   - var gs=$('#gsdmTime').val();
251   - for(var i=0;i<xlList.length;i++){
252   - if(gs!=""){
253   - if(fgs!=""){
254   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
255   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
256   - }
257   - }else{
258   - if(xlList[i]["gsbm"]==gs){
259   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  242 +
  243 +
  244 + var tempData = {};
  245 + $.get('/report/lineList',function(xlList){
  246 + var data = [];
  247 + $.get('/user/companyData', function(result){
  248 + for(var i = 0; i < result.length; i++){
  249 + var companyCode = result[i].companyCode;
  250 + var children = result[i].children;
  251 + for(var j = 0; j < children.length; j++){
  252 + var code = children[j].code;
  253 + for(var k=0;k < xlList.length;k++ ){
  254 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  255 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  256 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  257 + }
260 258 }
261 259 }
262 260 }
  261 + initPinYinSelect2('#line',data,'');
  262 + line = data[0].id;
  263 + updateTtinfo();
  264 + });
  265 + });
  266 +
  267 + $("#line").on("change", function(){
  268 + if($("#line").val() == " "){
  269 + $("#gsdmTime").attr("disabled", false);
  270 + $("#fgsdmTime").attr("disabled", false);
  271 + } else {
  272 + var temp = tempData[$("#line").val()].split(":");
  273 + $("#gsdmTime").val(temp[0]);
  274 + updateCompany();
  275 + $("#fgsdmTime").val(temp[1]);
  276 + $("#gsdmTime").attr("disabled", true);
  277 + $("#fgsdmTime").attr("disabled", true);
263 278 }
264   - initPinYinSelect2('#line',data,'');
265   - fage=true;
266   -
267   - line = data[0].id;
268   - updateTtinfo();
269   - }
  279 + });
270 280  
271 281  
272 282 var flag = 0;
... ...
src/main/resources/static/pages/trafficManage/js/lineStationUpload.js
... ... @@ -13,124 +13,46 @@
13 13 */
14 14  
15 15 (function(){
16   - /**
17   - * 取得编码-公司map
18   - * gsmap["5"] = 南汇公司
19   - * gsmap["5_3"] = 芦潮港分公司
20   - */
21   - function getBusMap(){
22   - // 取得公司信息,替换公司编码
23   - var gsmap = {};
24   - $get('/business/all', null, function(array){
25   - $.each(array, function(i, gs){
26   - var k = gs.upCode + '_' + gs.businessCode;
27   - if(gs.upCode === '88'){
28   - k = gs.businessCode;
29   - }
30   - gsmap[k] = gs.businessName;
31   - });
32   - });
33   - return gsmap;
34   - }
35   - // 填充公司下拉框选择值
36   - $get('/business/all', {upCode_eq: '88'}, function(array){
37   -
38   - // 公司下拉options属性值
39   - var options = '<option value="">请选择...</option>';
40   -
41   - // 遍历array
42   - $.each(array, function(i,d){
43   -
44   - options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
45   -
46   - });
47   -
48   - // 填充公司下拉框options,并添加公司下拉框值改变事件setbrancheCompanySelectOptions
49   - $('#companySelect').html(options).on('change', setbrancheCompanySelectOptions);
50   -
51   - });
52   -
53   - // 填充分公司下拉框选择值
54   - function setbrancheCompanySelectOptions(){
55   -
56   - // 获取公司下拉框选择值
57   - var businessCode = $('#companySelect').val();
58   -
59   - // 分公司下拉框options属性值
60   - var options = '<option value="">请选择...</option>';
61   -
62   - // 如果公司选择为空则分公司为空 ; 否则查询出所属公司下的分公司名称和相应分公司代码
63   - if(businessCode == null || businessCode ==''){
64   -
65   - // 填充分公司下拉框options
66   - $('#brancheCompanySelect').html(options);
67   -
68   - } else {
69   -
70   - // 查询出所属公司下的分公司名称和相应分公司代码
71   - $get('/business/all', {upCode_eq: businessCode}, function(array){
72   -
73   - // 遍历array
74   - $.each(array, function(i,d){
75   -
76   - options += '<option value="'+d.businessCode+'">'+d.businessName+'</option>';
77   -
78   - // 填充分公司下拉框options
79   - $('#brancheCompanySelect').html(options);
80   -
81   - });
82   - });
83   -
84   - // 填充公司下拉框options,并添加公司下拉框值改变事件setbrancheCompanySelectOptions
85   - $('#brancheCompanySelect').html(options).on('change', setLineAutocompleteOptions);
86   - }
87   - }
88   -
89   - function setLineAutocompleteOptions(){
90   - // 搜索参数集合
91   - var params = {};
92   - // 搜索字段名称
93   - var name;
94   - var items = $("ul.breadcrumb select");
95   - // 遍历items集合
96   - for(var j = 0, item; item = items[j++];){
97   - // 获取字段名称
98   - name = $(item).attr('name');
99   - if(name){
100   - // 赋取相对应的值
101   - params[name] = $(item).val();
102   - }
103   - }
104   - var lines = new Array();
105   - var gsmap = getBusMap();
106   - // 取得所有线路
107   - $get('/line/all', params, function(allLine) {
108   - // 遍历数组
109   - $.each(allLine, function(i, e) {
110   - var companyCode = e.company;
111   - e.company = gsmap[e.company];
112   - e.brancheCompany = gsmap[companyCode+"_"+e.brancheCompany];
113   - var line = '{"hex":"'+e.company+'","label":"'+e.name+'"}';
114   - var obj = jQuery.parseJSON(line);
115   - lines[i]= obj;
116   - });
117   -
118   -
119   - });
120   - // 给输入框绑定autocomplete事件
121   - $("input[name='name_eq']").autocompleter({
122   - highlightMatches: true,
123   - source: lines,
124   - template: '{{ label }} <span>({{ hex }})</span>',
125   - hint: true,
126   - empty: false,
127   - limit: 5,
128   - });
129   - }
130   -
131   -
132   - // 设置autocompleter的宽度和输入框一样
133   - $(".autocompleter").css("width",$("input[name='name_eq']").css("width"))
  16 +
  17 + $('#line').select2({
  18 + ajax: {
  19 + url: '/realSchedule/findLine',
  20 + type: 'post',
  21 + dataType: 'json',
  22 + delay: 150,
  23 + data: function(params){
  24 + return{line: params.term};
  25 + },
  26 + processResults: function (data) {
  27 + return {
  28 + results: data
  29 + };
  30 + },
  31 + cache: true
  32 + },
  33 + templateResult: function(repo){
  34 + if (repo.loading) return repo.text;
  35 + var h = '<span>'+repo.text+'</span>';
  36 + return h;
  37 + },
  38 + escapeMarkup: function (markup) { return markup; },
  39 + minimumInputLength: 1,
  40 + templateSelection: function(repo){
  41 + return repo.text;
  42 + },
  43 + language: {
  44 + noResults: function(){
  45 + return '<span style="color:red;font-size: 12px;">没有搜索到线路!</span>';
  46 + },
  47 + inputTooShort : function(e) {
  48 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入线路搜索线路</span>';
  49 + },
  50 + searching : function() {
  51 + return '<span style="color:gray;font-size: 12px;"> 正在搜索线路...</span>';
  52 + }
  53 + }
  54 + });
  55 +
134 56 // 绑定查询事件
135 57 $("#search").click(searchM);
136 58 // 绑定上传事件
... ... @@ -149,7 +71,7 @@
149 71 $("#right_div table tbody").empty();
150 72 var params = {};
151 73 // 取得输入框的值
152   - var inputs = $("ul.breadcrumb input");
  74 + var inputs = $(".param input,select");
153 75 // 遍历数组
154 76 $.each(inputs, function(i, element) {
155 77 params[$(element).attr("name")] = $(element).val();
... ... @@ -168,17 +90,36 @@
168 90  
169 91 // 上传方法
170 92 function uploadM() {
171   - var params = {};
172   - // 取得输入框的值
173   - var trs = $("#right_div tbody tr");
174   - if (trs.length == 0) {
175   - alert("请选择模板");
176   - return;
177   - }
178   - // 遍历数组
179   - $.each(trs, function(i, element) {
180   - alert($(".ttInfoId", element).html());
181   - });
  93 + // 取得输入框的值
  94 + var trs = $("#right_div tbody tr input");
  95 + if (trs.length == 0) {
  96 + alert("请选择线路");
  97 + return;
  98 + }else if(trs.length > 1){
  99 + alert("一次只能上传一条线路");
  100 + return;
  101 + }
  102 + var ids ="0,";
  103 + // 遍历数组
  104 + $.each(trs, function(i, element) {
  105 + ids +=$(element).val()+",";
  106 + });
  107 + var params = {"ids":ids};
  108 + $.ajax({
  109 + type: 'get',url: '/trmg/setXL',
  110 + data: params ,dataType:'text',
  111 + success:function(data) {
  112 + if(data == 'success'){
  113 + alert("上传成功");
  114 + }else{
  115 + alert("上传失败");
  116 + }
  117 +
  118 + }, error : function() {
  119 + alert("操作失败");
  120 + }
  121 +
  122 + });
182 123 }
183 124  
184 125 // 表格行的单击事件
... ...
src/main/resources/static/pages/trafficManage/js/timeTempletUpload.js
... ... @@ -183,29 +183,6 @@
183 183 }
184 184  
185 185 // 绑定查询事件
186   - $("#setXL").click(setXLF);
187   -
188   - function setXLF() {
189   - var params = {};
190   - // 取得输入框的值
191   - var inputs = $(".param input,select");debugger;
192   - // 遍历数组
193   - $.each(inputs, function(i, element) {
194   - params[$(element).attr("name")] = $(element).val();
195   - });
196   - $.ajax({
197   - type: 'get',url: '/trmg/setXL',
198   - data: params ,dataType:'text',
199   - success:function(data) {
200   - alert(data);
201   - }, error : function() {
202   - alert("操作失败");
203   - }
204   -
205   - });
206   - }
207   -
208   - // 绑定查询事件
209 186 $("#setCL").click(setCLF);
210 187 var params = {};
211 188 function setCLF() {
... ...
src/main/resources/static/pages/trafficManage/lineStationUpload.html
1 1 <link href="css/trafficManage.css" rel="stylesheet" type="text/css" />
2   -<link href="css/autocompleter.css" rel="stylesheet" type="text/css" />
3 2 <ul class="page-breadcrumb breadcrumb">
4 3 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
5 4 <li><span class="active">运维管理</span> <i class="fa fa-circle"></i></li>
... ... @@ -7,17 +6,16 @@
7 6 </ul>
8 7 <div class="tab_line">
9 8 <div class="col-md-12">
10   - <ul class="breadcrumb">
11   - <li>公司:</li>
12   - <li><select name="company_eq" class="form-control" id="companySelect"></select></li>
13   - <li>分公司:</li>
14   - <li><select name="brancheCompany_eq" class="form-control" id="brancheCompanySelect"></select></li>
15   - <li>线路名称:</li>
16   - <li><input type="text" class="form-control form-filter input-sm"
17   - name="name_eq" placeholder="请输入线路名称" maxlength="40" /></li>
18   - <li><a class="btn btn-circle blue" id="search">查询</a></li>
19   - <li><a class="btn btn-circle red" id="upload">上传</a></li>
20   - </ul>
  9 + <form class="form-inline" action="">
  10 + <div style="display: inline-block;" class="param">
  11 + <span class="item-label" style="width: 80px;">线路名称: </span>
  12 + <select class="form-control" name="lineCode_like" id="line" style="width: 180px;"></select>
  13 + </div>
  14 + <div class="form-group" style="display: inline-block;margin-left: 15px;">
  15 + <input class="btn btn-default" type="button" id="search" value="查询"/>
  16 + <input class="btn btn-default" type="button" id="upload" value="上传"/>
  17 + </div>
  18 + </form>
21 19 </div>
22 20 <!-- Begin: left-div -->
23 21 <div class="col-md-5 panel-wrap" style="height: 60%;">
... ... @@ -63,6 +61,7 @@
63 61 </td>
64 62 <td>
65 63 {{obj.lineCode}}
  64 + <input type="hidden" value="{{obj.lineCode}}"/>
66 65 </td>
67 66 <td class="ttInfoId">
68 67 {{obj.name}}
... ...
src/main/resources/static/real_control_v2/css/line_schedule.css
... ... @@ -691,7 +691,7 @@ label.destroy-sch small{
691 691 text-align: center;
692 692 }
693 693 .sub-task-table dl dt:nth-of-type(2), .sub-task-table dl dd:nth-of-type(2) {
694   - width: 15%;
  694 + width: 13%;
695 695 }
696 696 .sub-task-table dl dt:nth-of-type(3), .sub-task-table dl dd:nth-of-type(3) {
697 697 width: 16%;
... ... @@ -706,7 +706,7 @@ label.destroy-sch small{
706 706 width: 11%;
707 707 }
708 708 .sub-task-table dl dt:nth-of-type(7), .sub-task-table dl dd:nth-of-type(7) {
709   - width: 14%;
  709 + width: 16%;
710 710 }
711 711 .sub-task-table dl dt:nth-of-type(8), .sub-task-table dl dd:nth-of-type(8) {
712 712 width: 9%;
... ...
src/main/resources/static/real_control_v2/css/main.css
... ... @@ -1255,4 +1255,329 @@ ul.left_tabs_lg li{
1255 1255 text-indent: 12px;
1256 1256 margin-bottom: 0;
1257 1257 padding: 18px 5px;
  1258 +}
  1259 +
  1260 +.sub_task_form_v2{
  1261 + background: #f9f9f9;
  1262 + padding: 12px 15px;
  1263 + border-radius: 5px 0 5px 5px;
  1264 + border: 1px solid #dfdfdf;
  1265 + position: relative;
  1266 + margin-bottom: 20px;
  1267 +}
  1268 +
  1269 +.task_form_close_icon{
  1270 + background: #f9f9f9;
  1271 + padding: 0px 4px;
  1272 + position: absolute;
  1273 + top: -8px;
  1274 + right: -8px;
  1275 + color: #898989;
  1276 + font-size: 15px;
  1277 + border: 1px solid #dfdfdf;
  1278 + border-radius: 100%;
  1279 + border-left: none;
  1280 + border-bottom: none;
  1281 + transition: all .03s;
  1282 +}
  1283 +
  1284 +.task_form_close_icon:hover{
  1285 + border: 1px solid #ff1515;
  1286 + border-left: none;
  1287 + border-bottom: none;
  1288 + color: #e03e3e;
  1289 +}
  1290 +
  1291 +.sub_task_form_v2:hover::after{
  1292 + color: #5f5b5b;
  1293 +}
  1294 +
  1295 +.sub_task_form_v2.uk-form-horizontal .uk-form-label{
  1296 + width: 80px;
  1297 +}
  1298 +
  1299 +.sub_task_form_v2.uk-form-horizontal .uk-form-controls{
  1300 + margin-left: 85px;
  1301 +}
  1302 +
  1303 +.sub_task_form_v2.uk-form-horizontal .uk-form-controls input[type=text],
  1304 +.sub_task_form_v2.uk-form-horizontal .uk-form-controls input[type=time],
  1305 +.sub_task_form_v2.uk-form-horizontal .uk-form-controls select{
  1306 + width: 100%;
  1307 +}
  1308 +
  1309 +#add-sub-task-main-modal .uk-modal-footer{
  1310 + background: none;
  1311 + border-top: none;
  1312 +}
  1313 +
  1314 +#add-sub-task-main-modal .uk-grid+.uk-grid{
  1315 + margin-top: 12px;
  1316 +}
  1317 +
  1318 +#add-sub-task-main-modal .plus_icon_span{
  1319 + font-size: 26px;
  1320 + color: #b2b2b2;
  1321 + padding: 10px 64px;
  1322 + display: inline-block;
  1323 + border: 1px dashed grey;
  1324 + margin: 15px 0;
  1325 + border-radius: 5px;
  1326 + cursor: pointer;
  1327 +}
  1328 +
  1329 +#add-sub-task-main-modal .uk-animation-fade{
  1330 + animation-duration: .3s;
  1331 +}
  1332 +
  1333 +#add-sub-task-main-modal .forms{
  1334 + max-height: 488px;
  1335 + overflow-y: auto;
  1336 + overflow-x: hidden;
  1337 + padding: 8px 8px 0 0;
  1338 +}
  1339 +
  1340 +.add_custom_wrap .forms .sub_task_form_v2:last-child{
  1341 + margin-bottom: 0;
  1342 +}
  1343 +
  1344 +.sub_task_form_v2.destroy_form{
  1345 + background-color: #fff5f4 !important;
  1346 +}
  1347 +
  1348 +.uk-form>.half_change_car_box{
  1349 + margin: -10px 0 15px;
  1350 + padding: 3px 5px;
  1351 + display: inline-block;
  1352 + border: 1px solid #dfdddd;
  1353 + color: #918f8f;
  1354 +}
  1355 +
  1356 +.half_change_car_box input[type=checkbox]{
  1357 + vertical-align: top;
  1358 +}
  1359 +
  1360 +.uk-form>.half_change_car_box.active{
  1361 + background: #4CAF50;
  1362 + color: #fff;
  1363 +}
  1364 +
  1365 +.uk-form>.half_change_car_box.active input[type=checkbox]{
  1366 + background: #4caf50;
  1367 + border-color: #4caf50;
  1368 +}
  1369 +
  1370 +.uk-form>.half_change_car_box.active input[type=checkbox]:before{
  1371 + color: #ffffff;
  1372 +}
  1373 +
  1374 +.sub_task_form_v2.change_car{
  1375 + z-index: 99;
  1376 +}
  1377 +
  1378 +.st_range_top_form{
  1379 + padding: 0 0 15px 5px;
  1380 + border: 1px solid #c4bb76;
  1381 + background: #e5e1c1;
  1382 + margin-bottom: 15px;
  1383 + box-shadow: 0px 4px 3px 0 rgba(142, 138, 138, 0.2), 0px 4px 5px 0 rgba(157, 156, 156, 0.19);
  1384 +}
  1385 +
  1386 +.st_range_top_form .uk-form-row{
  1387 + margin-top: 20px;
  1388 +}
  1389 +
  1390 +.uk-form-horizontal.st_range_top_form .uk-form-label{
  1391 + width: 80px;
  1392 +}
  1393 +
  1394 +.uk-form-horizontal.st_range_top_form .uk-form-controls{
  1395 + margin-left: 84px;
  1396 +}
  1397 +
  1398 +.uk-form-horizontal.st_range_top_form .uk-form-controls select{
  1399 + width: calc(100% - 2px);
  1400 +}
  1401 +
  1402 +.sub_task_form_v2.service_st_form{
  1403 + background: #f4faff;
  1404 +}
  1405 +
  1406 +.uk-modal .uk-form.fv-form.sub_task_form_v2{
  1407 + margin-bottom: 20px !important;
  1408 +}
  1409 +
  1410 +.sub_task_table_wrap .ct_table>.ct_table_body{
  1411 + border-bottom: none;
  1412 +}
  1413 +
  1414 +.add_range_wrap>.err_panel{
  1415 + font-size: 16px;
  1416 + color: #a44a4a;
  1417 + font-family: 微软雅黑;
  1418 +}
  1419 +
  1420 +#schedule-lp_change-modal .ct_table dl{
  1421 + height: 35px;
  1422 +}
  1423 +
  1424 +#schedule-lp_change-modal .ct_table dl dd, #schedule-lp_change-modal .ct_table dl dt{
  1425 + line-height: 35px;
  1426 +}
  1427 +
  1428 +/*
  1429 +.sub_task_form_v2.repeat_main:before{
  1430 + content: '复';
  1431 + position: absolute;
  1432 + top: -10px;
  1433 + font-size: 12px;
  1434 + color: #2196F3;
  1435 + background: #ffffff;
  1436 + padding: 0 3px;
  1437 + font-weight: 600;
  1438 +}*/
  1439 +
  1440 +.sub_task_form_v2:before{
  1441 + position: absolute;
  1442 + top: -7px;
  1443 + font-size: 12px;
  1444 + padding: 0 3px;
  1445 + font-weight: 600;
  1446 + line-height: 14px;
  1447 +}
  1448 +
  1449 +.sub_task_form_v2.destroy_form:before{
  1450 + content: '烂班' !important;
  1451 + color: #f14235 !important;
  1452 + background: #ffffff !important;
  1453 +}
  1454 +
  1455 +.sub_task_form_v2.service_form:before{
  1456 + content: '营运';
  1457 + color: #2196F3;
  1458 + background: #ffffff;
  1459 +}
  1460 +
  1461 +.sub_task_form_v2.empty_form:before{
  1462 + content: '空驶';
  1463 + color: #928f92;
  1464 + background: #ffffff;
  1465 +}
  1466 +
  1467 +.sub_task_form_v2.service_form{
  1468 + background: #f4faff;
  1469 +}
  1470 +
  1471 +/*.sub_task_form_v2.repeat_main.destroy_form:before{
  1472 + color: #F44336;
  1473 +}
  1474 +
  1475 +.sub_task_form_v2.repeat_main{
  1476 + background: #f4faff;
  1477 +}*/
  1478 +.footer_tools{
  1479 + position: absolute;
  1480 + left: 235px;
  1481 + bottom: 19px;
  1482 +}
  1483 +
  1484 +.footer_mileage_count{
  1485 + border: 1px solid #f2f2f2;
  1486 + padding: 5px;
  1487 + box-shadow: 0px 2px 5px 0 rgba(0, 0, 0, 0.2), 0px 2px 7px 0 rgba(0, 0, 0, 0.19);
  1488 + display: inline-block;
  1489 +}
  1490 +
  1491 +.footer_mileage_count>span{
  1492 + padding: 2px 5px;
  1493 +}
  1494 +
  1495 +.footer_mileage_count>span.service_sum{
  1496 + color: #2196F3;
  1497 +}
  1498 +
  1499 +.footer_mileage_count>span.empty_sum{
  1500 + color: #636363;
  1501 +}
  1502 +
  1503 +.footer_mileage_count>span.destroy_sum{
  1504 + color: #f5574b;
  1505 +}
  1506 +
  1507 +.station_to_park_link{
  1508 + display: inline-block;
  1509 + margin-left: 15px;
  1510 + vertical-align: bottom;
  1511 + font-size: 12px;
  1512 +}
  1513 +
  1514 +.station_to_park_link>a{
  1515 + color: #607D8B;
  1516 +}
  1517 +
  1518 +#station_to_park-modal.ct-form-modal form input[type=text],
  1519 +#station_to_park-modal.ct-form-modal form select{
  1520 + width: auto;
  1521 +}
  1522 +
  1523 +.s_2_park_form_wrap{
  1524 + background: #fafafa;
  1525 + border: 1px solid #e5e5e5;
  1526 + padding: 7px 16px;
  1527 + margin: 15px 0;
  1528 + position: relative;
  1529 +}
  1530 +
  1531 +.s_2_park_form_wrap .ct_close{
  1532 + position: absolute;
  1533 + top: -12px;
  1534 + padding: 0 4px;
  1535 + right: -8px;
  1536 + color: #939393;
  1537 + border: 1px solid #f7dfdf;
  1538 + border-radius: 25px;
  1539 + cursor: pointer;
  1540 +}
  1541 +
  1542 +.s_2_park_form_wrap .ct_close:hover{
  1543 + background: #e5e5e5;
  1544 + color: #fd6e6e;
  1545 +}
  1546 +
  1547 +.s_2_park_form_wrap label{
  1548 + color: #666;
  1549 + font-size: 13px;
  1550 +}
  1551 +
  1552 +#station_to_park-modal.ct-form-modal form input[readonly]{
  1553 + background: #fafafa;
  1554 +}
  1555 +
  1556 +.s_2_park_form_wrap .bottom_label{
  1557 + margin-top: 25px;
  1558 + display: block;
  1559 +}
  1560 +
  1561 +.s_2_park_form_wrap .bottom_label_2{
  1562 + margin-top: 4px;
  1563 + display: block;
  1564 +}
  1565 +
  1566 +.ct_describe{
  1567 + font-size: 12px;
  1568 + color: #909090;
  1569 + font-family: FontAwesome;
  1570 +}
  1571 +
  1572 +.ct_describe:before{
  1573 + content: "\f059";
  1574 + margin-right: 3px;
  1575 +}
  1576 +
  1577 +#add-sub-task-main-modal abbr{
  1578 + display: inline-block;
  1579 + font-size: 12px;
  1580 + margin-left: 25px;
  1581 + vertical-align: bottom;
  1582 + color: #929292;
1258 1583 }
1259 1584 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/css/north.css
... ... @@ -481,4 +481,13 @@
481 481 .ct-badge.ct-badge-TZRC:hover{
482 482 background: #97a50f;
483 483 color: #fff;
  484 +}
  485 +
  486 +.ct-badge.ct-badge-LSBCTZ {
  487 + color: red;
  488 +}
  489 +
  490 +.ct-badge.ct-badge-LSBCTZ:hover{
  491 + background: red;
  492 + color: #fff;
484 493 }
485 494 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
... ... @@ -3,7 +3,7 @@
3 3 <a href="" class="uk-modal-close uk-close"></a>
4 4 <div class="uk-modal-header">
5 5 <h2>临加/子任务</h2></div>
6   - <div class="uk-panel uk-panel-box uk-panel-box-primary">
  6 + <div class="uk-panel uk-panel-box uk-panel-box-primary" style="padding: 12px;">
7 7 <form class="uk-form uk-form-horizontal search-form">
8 8 <div class="uk-grid">
9 9 <div class="uk-width-1-3">
... ... @@ -51,13 +51,13 @@
51 51 </div>
52 52 </div>
53 53  
54   - <div class="uk-panel uk-panel-box uk-panel-box-secondary" style="padding-bottom: 0;">
  54 + <div class="uk-panel uk-panel-box uk-panel-box-secondary" style="padding-bottom: 0;box-shadow: 0px -2px 4px 0 rgba(214, 214, 214, 0.2), 0px -2px 3px 0 rgba(123, 122, 122, 0.19);">
55 55 <h3 class="uk-panel-title" id="childTaskTitle">
56 56 子任务列表
57 57 <a id="addChildTaskBtn" data-uk-tooltip title="添加子任务"><i
58 58 class="uk-icon-plus"></i> </a>
59 59 </h3>
60   - <div class="ct_table_wrap ct_table_no_border sub_task_table_wrap" style="height: 142px;">
  60 + <div class="ct_table_wrap ct_table_no_border sub_task_table_wrap" style="height: 147px;">
61 61 <div class="ct_table sub-task-table">
62 62 <div class="ct_table_head">
63 63 <dl>
... ... @@ -126,7 +126,12 @@
126 126 {{each list as task i}}
127 127 <dl data-id="{{task.id}}">
128 128 <dd>{{i+1}}</dd>
129   - <dd><span class="nt-dictionary" data-group="ChildTaskType">{{task.type2}}</span></dd>
  129 + <dd>
  130 + <span class="nt-dictionary" data-group="ChildTaskType">{{task.type2}}</span>
  131 + {{if task.noClerk}}
  132 + (无售)
  133 + {{/if}}
  134 + </dd>
130 135 <dd>{{task.startStationName}}</dd>
131 136 <dd>{{task.endStationName}}</dd>
132 137 <dd>{{task.startDate}}</dd>
... ... @@ -137,9 +142,12 @@
137 142 {{if task.destroy}}
138 143 <small style="color:red;">烂班</small>
139 144 {{/if}}
  145 + {{if task.nbbm!=null}},{{task.nbbm}}{{/if}}
140 146 )
141 147 </dd>
142   - <dd title="{{task.remarks}}">{{task.remarks}}</dd>
  148 + <dd title="{{task.remarks}}">
  149 + {{task.remarks}}
  150 + </dd>
143 151 </dl>
144 152 {{/each}}
145 153 </script>
... ... @@ -328,8 +336,6 @@
328 336 }, modal_opts);
329 337 };
330 338  
331   - $('#addChildTaskBtn').on('click', add_sub_task_other);
332   -
333 339 //回场子任务
334 340 var add_sub_task_in = function () {
335 341 var sch = getActiveSch();
... ... @@ -408,6 +414,18 @@
408 414 }, modal_opts);
409 415 };
410 416  
  417 + var add_sub_task = function () {
  418 + var sch = getActiveSch();
  419 + if (!sch)
  420 + return notify_err('无法获取到主任务信息!');
  421 +
  422 + open_modal(folder + '/sub_task_v2/main.html', {
  423 + sch: sch
  424 + }, modal_opts);
  425 + };
  426 +
  427 + $('#addChildTaskBtn').on('click', add_sub_task);
  428 +
411 429 var callbackHandler = {
412 430 add_temp_sch: add_temp_sch,
413 431 remove_sch: remove_sch,
... ... @@ -416,7 +434,9 @@
416 434 remove_sub_task: remove_sub_task,
417 435 add_sub_task_out: add_sub_task_out,
418 436 add_sub_task_range_turn: add_sub_task_range_turn,
419   - add_oil: add_oil
  437 + add_oil: add_oil,
  438 +
  439 + add_sub_task: add_sub_task
420 440 };
421 441  
422 442 //右键菜单
... ... @@ -431,7 +451,7 @@
431 451 name: "临加班次"
432 452 },
433 453 "add_sub_task": {
434   - name: "添加子任务",
  454 + name: "添加子任务"/*,
435 455 items: {
436 456 'add_oil':{
437 457 name: '空驶进出场'
... ... @@ -448,7 +468,7 @@
448 468 'add_sub_task_other': {
449 469 name: '自定义'
450 470 }
451   - }
  471 + }*/
452 472 },
453 473 'remove_sch': {
454 474 name: '删除'
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lp_change.html
1   -<div class="uk-modal ct_move_modal" id="schedule-lp_change-modal">
  1 +<div class="uk-modal" id="schedule-lp_change-modal">
2 2 <div class="uk-modal-dialog" style="width: 1240px;">
3 3 <a href="" class="uk-modal-close uk-close"></a>
4 4 <div class="uk-modal-header">
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_custom.html 0 → 100644
  1 +<div class="add_custom_wrap">
  2 + <div class="forms"></div>
  3 + <span class="plus_icon_span">
  4 + <i class="uk-icon-plus"></i>
  5 + </span>
  6 + <form class="uk-form remarks_form">
  7 + <div class="uk-grid">
  8 + <div class="uk-width-1-1">
  9 + <div class="uk-form-row ct-stacked">
  10 + <div class="uk-form-controls" style="margin-top: 5px;">
  11 + <textarea id="form-s-t" rows="4" name="remarks" data-fv-stringlength="true" style="width: 100%;"
  12 + data-fv-stringlength-max="50" placeholder="备注,不超过50个字符"></textarea>
  13 + </div>
  14 + </div>
  15 + </div>
  16 + </div>
  17 + </form>
  18 + <div class="uk-modal-footer uk-text-right" style="margin-top: 5px;">
  19 + <button type="button" class="uk-button uk-modal-close">取消</button>
  20 + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;保存</button>
  21 + </div>
  22 +
  23 + <script>
  24 + (function () {
  25 + var wrap = '#add-sub-task-main-modal .add_custom_wrap',
  26 + sch, fs=[];
  27 +
  28 + $(wrap).on('init', function (e, data) {
  29 + e.stopPropagation();
  30 + sch = data.sch;
  31 + $('.plus_icon_span', wrap).trigger('click');
  32 + });
  33 +
  34 + //plsu icon
  35 + $('.plus_icon_span', wrap).on('click', addTaskForm);
  36 +
  37 + var bcTypeMap = {'in': 2, 'out': 3, 'normal': 1};
  38 + function addTaskForm() {
  39 + var htmlStr = template('sub-task-v2-form-temp', {sch: sch})
  40 + var f = $(htmlStr);
  41 + $('.forms', wrap).append(f);
  42 + //字典转换
  43 + dictionaryUtils.transformDom($('.nt-dictionary', f));
  44 +
  45 + //班次类型切换
  46 + if(bcTypeMap[sch.bcType])
  47 + $('[name=type2]', f).val(bcTypeMap[sch.bcType])
  48 + $('[name=type2]', f).trigger('change');
  49 +
  50 + //滚动条到底
  51 + $('.forms', wrap).scrollTop($('.forms', wrap)[0].scrollHeight);
  52 +
  53 + //起点站trigger change
  54 + $('[name=startStation]',f).trigger('change');
  55 +
  56 + f.prev('.sub_task_form_v2').find('[name=endDate]').trigger('input');
  57 +
  58 + f.formValidation({
  59 + framework: 'uikit',
  60 + locale: 'zh_CN'
  61 + }).on('add_reason_field', function () {
  62 + $(this).formValidation('addField', 'reason');
  63 + });
  64 + }
  65 +
  66 + //提交
  67 + $('button[type=submit]', wrap).on('click', function () {
  68 + $(this).addClass('disabled').attr('disabled','disabled');
  69 + dataArray = [];
  70 + $('form.sub_task_form_v2', wrap).data('valid', false)
  71 + .formValidation('validate');
  72 + });
  73 +
  74 + var dataArray = [];
  75 + $(wrap).on('success.form.fv', 'form.sub_task_form_v2', function (e) {
  76 + e.preventDefault();
  77 +
  78 + dataArray.push($.extend($(this).serializeJSON(), gb_common.getDisabledVal(this)
  79 + , {remarks: $('#form-s-t',wrap).val(), 'schedule.id': sch.id}));
  80 + $(this).data('valid', true);
  81 +
  82 + if(allValidSuccess()){
  83 + var i = 0, rst;
  84 + (function () {
  85 + var f = arguments.callee;
  86 + if(i >= dataArray.length){
  87 + //完成后更新前端数据
  88 + gb_schedule_table.updateSchedule(rst);
  89 + UIkit.modal('#add-sub-task-main-modal').hide();
  90 + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch});
  91 + gb_data_basic.reload_stat_park_data();
  92 + return;
  93 + }
  94 + var data = dataArray[i];
  95 + //里程为0的不保存
  96 + if(data.mileage==0){
  97 + i++;
  98 + f();
  99 + }
  100 + else{
  101 + //营运子任务不写备注
  102 + if(data.mileageType == 'service' && !data.destroy)
  103 + data.remarks = '';
  104 + gb_common.$post('/childTask', data, function (rs) {
  105 + notify_succ('子任务添加成功');
  106 + rst = rs.t;
  107 + i++;
  108 + f();
  109 + });
  110 + }
  111 + })();
  112 + }
  113 + });
  114 + //校验不过
  115 + $(wrap).on('err.field.fv','form.sub_task_form_v2', function () {
  116 + $('button[type=submit]', wrap).removeClass('disabled').removeAttr('disabled');
  117 + });
  118 +
  119 + function allValidSuccess() {
  120 + var flag = true;
  121 + $('form.sub_task_form_v2', wrap).each(function (i, f) {
  122 + if(!$(f).data('valid')){
  123 + flag = false;
  124 + return false;
  125 + }
  126 + });
  127 + return flag;
  128 + }
  129 +
  130 + function $f(name, f) {
  131 + return $('[name=' + name + ']', f);
  132 + }
  133 + })();
  134 + </script>
  135 +</div>
0 136 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_in_out.html 0 → 100644
  1 +<div class="add_inOut_wrap">
  2 + <div class="forms"></div>
  3 + <form class="uk-form remarks_form">
  4 + <div class="uk-grid">
  5 + <div class="uk-width-1-1">
  6 + <div class="uk-form-row ct-stacked">
  7 + <div class="uk-form-controls" style="margin-top: 5px;">
  8 + <textarea id="form-s-t" rows="4" name="remarks" data-fv-stringlength="true" style="width: 100%;"
  9 + data-fv-stringlength-max="50" placeholder="备注,不超过50个字符"></textarea>
  10 + </div>
  11 + </div>
  12 + </div>
  13 + </div>
  14 + </form>
  15 + <div class="uk-modal-footer uk-text-right" style="margin-top: 5px;">
  16 + <button type="button" class="uk-button uk-modal-close">取消</button>
  17 + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;保存</button>
  18 + </div>
  19 +
  20 + <script>
  21 + (function () {
  22 + var wrap = '#add-sub-task-main-modal .add_inOut_wrap',
  23 + sch, sf, inf, outf, destroyf;
  24 +
  25 + $(wrap).on('init', function (e, data) {
  26 + e.stopPropagation();
  27 + sch = data.sch;
  28 +
  29 + //线路上
  30 + sf = addTaskForm();
  31 + //进场
  32 + inf = addTaskForm();
  33 + //出场
  34 + outf = addTaskForm();
  35 +
  36 + setTimeout(function () {
  37 + //复主任务
  38 + repeat_main(sf);
  39 + //进场子任务
  40 + repeat_In(inf);
  41 + //出场子任务
  42 + repeat_Out(outf);
  43 +
  44 + //进场终点改变事件
  45 + $f('endStation', inf).on('change', function () {
  46 + $f('startStation',outf).val($(this).val()).trigger('change');
  47 + });
  48 +
  49 + }, 500);
  50 +
  51 + //营运终点改变事件
  52 + $f('endStation', sf).on('change', changeServiceEnd);
  53 + //进场公里改变
  54 + $f('mileage',inf).on('input', function () {
  55 + $f('mileage',outf).val($(this).val());
  56 + });
  57 + //$f('startStation', inf).on('change', changeServiceEnd);
  58 + });
  59 +
  60 + function addTaskForm() {
  61 + var htmlStr = template('sub-task-v2-form-temp', {sch: sch});
  62 + var f = $(htmlStr);
  63 + $('.forms', wrap).append(f);
  64 + //字典转换
  65 + dictionaryUtils.transformDom($('.nt-dictionary', f));
  66 +
  67 + //班次类型切换
  68 + $('select[name=type2]', f).trigger('change');
  69 +
  70 + //滚动条到底
  71 + $('.forms', wrap).scrollTop($('.forms', wrap)[0].scrollHeight);
  72 +
  73 + f.formValidation({
  74 + framework: 'uikit',
  75 + locale: 'zh_CN'
  76 + }).on('add_reason_field', function () {
  77 + $(this).formValidation('addField', 'reason');
  78 + });
  79 + return f;
  80 + }
  81 +
  82 + /**
  83 + * 复主任务
  84 + * @param f
  85 + */
  86 + function repeat_main(f) {
  87 + f.addClass('repeat_main');
  88 + $f('type2', f).html('<option value="1">线路上站点间</option>');
  89 + $f('mileage', f).val(sch.jhlc).trigger('input');
  90 + $f('mileageType', f).val('service').attr('disabled', 'disabled');
  91 + //主任务是烂班
  92 + if (sch.status == -1) {
  93 + $f('destroy', f)[0].checked = true;
  94 + $f('reason', f).val(sch.adjustExps);
  95 + $('.destroy_reason_wrap', f).show();
  96 + $f('mileage', f).val(sch.jhlcOrig);
  97 + $('input,select', f).attr('disabled', 'disabled');
  98 + f.addClass('destroy_form');
  99 + }
  100 + else if (sch.status == 2) {
  101 + $f('destroy', f).parents('label').remove();
  102 + $f('endDate', f).val(sch.zdsjActual);
  103 + $('input,select', f).attr('disabled', 'disabled');
  104 + }
  105 + }
  106 +
  107 + function repeat_In(f) {
  108 + $f('type2', f).html('<option value="2">进场</option>').trigger('change');
  109 + if (sch.status != -1)
  110 + $f('startStation', f).val(sch.zdzCode);//主任务终点进场
  111 +
  112 + //起点改变
  113 + $f('startStation', f).on('change', function () {
  114 + $f('endStation', outf).val($(this).val());//.trigger('change');
  115 + }).trigger('change');
  116 + }
  117 +
  118 + function repeat_Out(f) {
  119 + $f('type2', f).html('<option value="3">出场</option>').trigger('change');
  120 +
  121 + var code;
  122 + if (sch.status != -1)
  123 + code=sch.zdzCode;
  124 + else
  125 + code=sch.qdzCode;
  126 + $f('endStation', f).val(code).trigger('change'); //出场到主任务终点
  127 + $f('startDate', f).val($f('endDate', inf).val()).trigger('input');//开始时间
  128 +
  129 + //烂班原因
  130 + if(sch.status == -1 &&
  131 + gb_common.inOutExps.indexOf(sch.adjustExps)!=-1){
  132 + $f('reason',inf).val(sch.adjustExps);
  133 + $f('reason',outf).val(sch.adjustExps).trigger('change');
  134 + }
  135 + }
  136 +
  137 + function $f(name, f) {
  138 + return $('[name=' + name + ']', f);
  139 + }
  140 +
  141 + /**
  142 + * 切换营运终点
  143 + */
  144 + function changeServiceEnd() {
  145 + var eCode = $(this).val();
  146 + if(half_form){
  147 + half_form.remove();
  148 + changeCarBox.remove();
  149 + }
  150 + if(eCode==sch.qdzCode || eCode==sch.zdzCode){
  151 + $f('startStation',inf).val(eCode).trigger('change');
  152 + $f('type2',outf).trigger('change');
  153 + return;
  154 + }
  155 +
  156 + //进场起点
  157 + $f('startStation',inf).val(eCode);//.trigger('change');
  158 + //终点trigger change 出发重计算
  159 + $f('endStation',inf).trigger('change');
  160 +
  161 + //中途进场
  162 + showHalfPanel(eCode);
  163 + }
  164 +
  165 + var half_form, changeCarBox;
  166 + function showHalfPanel(station) {
  167 + half_form = $(template('sub-task-v2-form-temp', {sch: sch}));
  168 + half_form.addClass('repeat_main destroy_form');
  169 + //字典转换
  170 + dictionaryUtils.transformDom($('.nt-dictionary', half_form));
  171 + sf.after(half_form);
  172 +
  173 +
  174 + //班次类型切换
  175 + $f('type2', half_form).trigger('change');
  176 + //设置起点
  177 + $f('startStation',half_form).val(station).trigger('change');
  178 + //烂班
  179 + $f('destroy',half_form)[0].checked=true;
  180 + $f('mileageType',half_form).attr('disabled','disabled');
  181 + $f('type2',half_form).html('<option value="1">线路上站点间</option>');
  182 + $('.destroy_reason_wrap',half_form).show();
  183 + half_form.attr('destroy', true);
  184 +
  185 + setTimeout(function () {
  186 + //烂班开始时间
  187 + $f('startDate',half_form).val($f('endDate',sf).val()).trigger('input');
  188 + }, 300);
  189 +
  190 + //换车营运
  191 + var se = $f('startStation',half_form)[0],
  192 + sname = se.options[se.options.selectedIndex].text;
  193 + changeCarBox = $('<form class="uk-form"><label class="half_change_car_box"><input type="checkbox"> 换车出场至【'+sname+'】继续营运</label></form>');
  194 + half_form.after(changeCarBox);
  195 +
  196 + //删除
  197 + $('.task_form_close_icon', half_form).on('click', function () {
  198 + changeCarBox.remove();
  199 + $f('type2',outf).trigger('change');
  200 + });
  201 +
  202 + //校验
  203 + half_form.formValidation({
  204 + framework: 'uikit',
  205 + locale: 'zh_CN'
  206 + }).on('add_reason_field', function () {
  207 + $(this).formValidation('addField', 'reason');
  208 + });
  209 + }
  210 +
  211 + $(wrap).on('click', '.half_change_car_box>input[type=checkbox]', function () {
  212 + var box=$(this).parents('.half_change_car_box');
  213 + if(this.checked){
  214 + box.addClass('active');
  215 + enableChangeCar();
  216 + }
  217 + else{
  218 + box.removeClass('active');
  219 + disabledChangeCar();
  220 + }
  221 + });
  222 +
  223 + /**
  224 + * 换车出场
  225 + */
  226 + function enableChangeCar() {
  227 + var htmlStr = template('st-v2-domains-changecar-form-temp', {inOutExps: gb_common.inOutExps});
  228 + $('.domains', half_form).html(htmlStr);
  229 + $('.domains', outf).html(htmlStr);
  230 + half_form.css('z-index', 99).formValidation('addField', 'reason').formValidation('addField', 'nbbm');
  231 + outf.trigger('add_reason_field');
  232 +
  233 + //车辆 autocomplete
  234 + var data = gb_data_basic.carsArray();
  235 + gb_common.carAutocomplete($('.autocomplete-cars', half_form), data);
  236 +
  237 + //同步车辆编码
  238 + $f('nbbm', half_form).on('input change', function () {
  239 + $f('nbbm', outf).val($(this).val());
  240 + });
  241 +
  242 + half_form.removeClass('destroy_form');
  243 +
  244 + //出场终点
  245 + $f('endStation',outf).val($f('endStation',sf).val()).trigger('change');
  246 + //出发合计公里重新计算
  247 + $f('mileage', half_form).trigger('input');
  248 + }
  249 +
  250 + function disabledChangeCar() {
  251 + $f('type2',outf).trigger('change');
  252 + $f('endStation',sf).trigger('change');
  253 + }
  254 +
  255 +
  256 + //提交
  257 + $('button[type=submit]', wrap).on('click', function () {
  258 + $(this).addClass('disabled').attr('disabled','disabled');
  259 + dataArray = [];
  260 + $('form.sub_task_form_v2', wrap).data('valid', false)
  261 + .formValidation('validate');
  262 + });
  263 +
  264 + var dataArray = [];
  265 + $(wrap).on('success.form.fv', 'form.sub_task_form_v2', function (e) {
  266 + e.preventDefault();
  267 +
  268 + dataArray.push($.extend($(this).serializeJSON(), gb_common.getDisabledVal(this)
  269 + , {remarks: $('#form-s-t',wrap).val(), 'schedule.id': sch.id}));
  270 + $(this).data('valid', true);
  271 +
  272 + if(allValidSuccess()){
  273 + var i = 0, rst;
  274 + (function () {
  275 + var f = arguments.callee;
  276 + if(i >= dataArray.length){
  277 + //完成后更新前端数据
  278 + gb_schedule_table.updateSchedule(rst);
  279 + UIkit.modal('#add-sub-task-main-modal').hide();
  280 + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch});
  281 + gb_data_basic.reload_stat_park_data();
  282 + return;
  283 + }
  284 + var data = dataArray[i];
  285 + //里程为0的不保存
  286 + if(data.mileage==0){
  287 + i++;
  288 + f();
  289 + }
  290 + else{
  291 + //营运子任务不写备注
  292 + if(data.mileageType == 'service' && !data.destroy)
  293 + data.remarks = '';
  294 + gb_common.$post('/childTask', data, function (rs) {
  295 + notify_succ('子任务添加成功');
  296 + rst = rs.t;
  297 + i++;
  298 + f();
  299 + });
  300 + }
  301 + })();
  302 + }
  303 + });
  304 + //校验不过
  305 + $(wrap).on('err.field.fv','form.sub_task_form_v2', function () {
  306 + $('button[type=submit]', wrap).removeClass('disabled').removeAttr('disabled');
  307 + });
  308 +
  309 + function allValidSuccess() {
  310 + var flag = true;
  311 + $('form.sub_task_form_v2', wrap).each(function (i, f) {
  312 + if(!$(f).data('valid')){
  313 + flag = false;
  314 + return false;
  315 + }
  316 + });
  317 + return flag;
  318 + }
  319 + })();
  320 + </script>
  321 +</div>
0 322 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/add_range_turn.html 0 → 100644
  1 +<div class="add_range_wrap">
  2 + <div>
  3 + <form class="uk-form uk-form-horizontal st_range_top_form">
  4 + <div class="uk-grid">
  5 + <div class="uk-width-1-3">
  6 + <div class="uk-form-row" style="padding-left: 10px;">
  7 + <label class="uk-form-label">调头站点</label>
  8 + <div class="uk-form-controls">
  9 + <select id="turnStationSelect">
  10 + <option value="">请选择...</option>
  11 + </select>
  12 + </div>
  13 + </div>
  14 + </div>
  15 + <div class="uk-width-1-3">
  16 + <div class="uk-form-row">
  17 + <label class="uk-form-label">调头原因</label>
  18 + <div class="uk-form-controls">
  19 + <select id="turnReason" style="width: calc(100% - 13px);">
  20 + <option value="">请选择...</option>
  21 + </select>
  22 + </div>
  23 + </div>
  24 + </div>
  25 + <div class="uk-width-1-3" style="padding: 28px 0 0 28px;">
  26 + <label id="emptyTurnCbox"></label>
  27 + </div>
  28 + </div>
  29 + </form>
  30 + </div>
  31 +
  32 + <div class="forms"></div>
  33 + <form class="uk-form remarks_form">
  34 + <div class="uk-grid">
  35 + <div class="uk-width-1-1">
  36 + <div class="uk-form-row ct-stacked">
  37 + <div class="uk-form-controls" style="margin-top: 5px;">
  38 + <textarea id="form-s-t" rows="4" name="remarks" data-fv-stringlength="true" style="width: 100%;"
  39 + data-fv-stringlength-max="50" placeholder="备注,不超过50个字符"></textarea>
  40 + </div>
  41 + </div>
  42 + </div>
  43 + </div>
  44 + </form>
  45 + <div class="uk-modal-footer uk-text-right" style="margin-top: 5px;">
  46 + <button type="button" class="uk-button uk-modal-close">取消</button>
  47 + <button type="submit" class="uk-button uk-button-primary"><i class="uk-icon-check"></i> &nbsp;保存</button>
  48 + </div>
  49 +
  50 + <script>
  51 + (function () {
  52 + var wrap = '#add-sub-task-main-modal .add_range_wrap',
  53 + sch, nextSch, stationRoutes, f1, f2, df1, df2, topf = $('.st_range_top_form', wrap);
  54 +
  55 + $(wrap).on('init', function (e, data) {
  56 + e.stopPropagation();
  57 + sch = data.sch;
  58 + nextSch = gb_schedule_table.getNextNormalSch(sch);
  59 + if(!nextSch || nextSch.bcType!='normal'){
  60 + $(wrap).html('<div class="err_panel">无法做区间调头,原因是没有找到返程班次!</div>');
  61 + return;
  62 + }
  63 +
  64 + //站点路由
  65 + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) {
  66 + return a.stationRouteCode - b.stationRouteCode;
  67 + }), 'directions');
  68 + //第一段营运
  69 + f1 = addTaskForm();
  70 + $f('startStation', f1).trigger('change');
  71 +
  72 + disabled_form(f1);
  73 + $('.domains', f1).empty();
  74 + //top form 站点select
  75 + $('#turnStationSelect', topf).append($f('startStation', f1).html()).on('change', changeTurnStation);
  76 + //top form 原因select
  77 + var opts = '';
  78 + $.each(gb_common.adjustExps, function () {
  79 + opts += '<option value="' + this + '">' + this + '</option>';
  80 + });
  81 + $('#turnReason', topf).append(opts).on('change', changeTurnReason);
  82 + //调头空驶
  83 + $('#emptyTurnCbox',topf).html('<input type="checkbox"> 调头空驶回 ' + sch.qdzName);
  84 + $('#emptyTurnCbox input',topf).on('click', emptyTurn);
  85 + });
  86 +
  87 +
  88 + function addTaskForm() {
  89 + var htmlStr = template('sub-task-v2-form-temp', {sch: sch});
  90 + var f = $(htmlStr);
  91 + $('.forms', wrap).append(f);
  92 + //字典转换
  93 + dictionaryUtils.transformDom($('.nt-dictionary', f));
  94 +
  95 + //班次类型切换
  96 + $('select[name=type2]', f).trigger('change');
  97 +
  98 + //滚动条到底
  99 + //$('.forms', wrap).scrollTop($('.forms', wrap)[0].scrollHeight);
  100 +
  101 + f.formValidation({
  102 + framework: 'uikit',
  103 + locale: 'zh_CN'
  104 + }).on('add_reason_field', function () {
  105 + $(this).formValidation('addField', 'reason');
  106 + });
  107 + return f;
  108 + }
  109 +
  110 + function disabled_form(f) {
  111 + //$('input,select',f).attr('disabled', 'disabled');
  112 + $f('type2', f).attr('disabled', 'disabled');
  113 + $f('startStation', f).attr('disabled', 'disabled');
  114 + $f('endStation', f).attr('disabled', 'disabled');
  115 + $f('mileageType', f).attr('disabled', 'disabled');
  116 + $f('destroy', f).attr('disabled', 'disabled');
  117 + return f;
  118 + }
  119 +
  120 + function $f(name, f) {
  121 + return $('[name=' + name + ']', f);
  122 + }
  123 +
  124 +
  125 + /**
  126 + * 切换调头站点
  127 + */
  128 + function changeTurnStation() {
  129 + f1.nextAll('.sub_task_form_v2').remove();
  130 + //掉头站点编码
  131 + var eCode = $('#turnStationSelect', topf).val();
  132 + if(!eCode){
  133 + //$('.footer_mileage_count', '#add-sub-task-main-modal').trigger('refresh');
  134 + $f('endStation', f1).val(sch.zdzCode).trigger('change');
  135 + $('#emptyTurnCbox input')[0].checked=false;
  136 + return;
  137 + }
  138 +
  139 + //烂班1
  140 + df1 = destroyForm(disabled_form(addTaskForm()));
  141 + //烂班2
  142 + df2 = destroyForm(disabled_form(addTaskForm()));
  143 + //营运2
  144 + f2 = disabled_form(addTaskForm());
  145 + $('.domains', f2).empty();
  146 +
  147 +
  148 + //营运1终点
  149 + $f('endStation', f1).val(eCode).trigger('change');
  150 + //烂班1起点
  151 + $f('startStation', df1).val(eCode).trigger('change');
  152 + //烂班2
  153 + $f('startStation', df2).val(sch.zdzCode);
  154 + $f('endStation', df2).val(eCode);
  155 + $f('mileage', df2).val($f('mileage', df1).val()).trigger('input');
  156 + $('[sch_id_inp]', df2).val(nextSch.id);
  157 + //营运2
  158 + $f('startStation', f2).val(eCode);
  159 + $f('endStation', f2).val(sch.qdzCode);
  160 + $f('startDate',f2).val($f('endDate',f1).val());
  161 + $f('mileage', f2).val($f('mileage', f1).val()).trigger('input');
  162 + $('[sch_id_inp]', f2).val(nextSch.id);
  163 +
  164 + //set css
  165 + //setCss();
  166 + //reason
  167 + changeTurnReason();
  168 + }
  169 +
  170 + /**
  171 + * 切换调头原因
  172 + */
  173 + function changeTurnReason() {
  174 + var reason = $('#turnReason',topf).val();
  175 + if(reason){
  176 + $('.sub_task_form_v2 [name=reason]', wrap).val(reason).trigger('change');
  177 + //var reInput=$('.remarks_form [name=remarks]', wrap);
  178 + //reInput.val(reInput.val() + reason + ',');
  179 + }
  180 + }
  181 +
  182 + function destroyForm(f) {
  183 + $f('destroy', f)[0].checked = true;
  184 + $('.destroy_reason_wrap', f).show();
  185 + f.addClass('destroy_form');
  186 + f.attr('destroy', true);
  187 + return f;
  188 + }
  189 +
  190 + /*function setCss() {
  191 + $('.sub_task_form_v2', wrap).each(function () {
  192 + if($(this).hasClass('destroy_form'))
  193 + return true;
  194 +
  195 + if($f('mileageType', this).val()=='service')
  196 + $(this).addClass('service_st_form');
  197 + else
  198 + $(this).removeClass('service_st_form');
  199 + });
  200 + }*/
  201 +
  202 + /**
  203 + * 空驶调头
  204 + */
  205 + function emptyTurn() {
  206 + if($('#turnStationSelect', topf).val()==''){
  207 + notify_err('你必须先选择调头站点!');
  208 + this.checked=false;
  209 + return;
  210 + }
  211 + if(this.checked){
  212 + //烂班2 烂全程
  213 + $f('startStation', df2).val(sch.zdzCode);
  214 + $f('endStation', df2).val(sch.qdzCode);
  215 + $f('mileage', df2).val(nextSch.jhlcOrig);
  216 + $f('startDate', df2).val(nextSch.dfsj);
  217 + $f('endDate', df2).val(nextSch.zdsj);
  218 + //营运2 变空驶
  219 + //f2.removeClass('service_st_form');
  220 + $f('mileageType',f2).val('empty').trigger('change');
  221 + }
  222 + else{
  223 + changeTurnStation();
  224 + }
  225 +
  226 + //$f('mileage', df2).trigger('input');
  227 + }
  228 +
  229 + //提交
  230 + $('button[type=submit]', wrap).on('click', function () {
  231 + $(this).addClass('disabled').attr('disabled','disabled');
  232 + dataArray = [];
  233 + $('form.sub_task_form_v2', wrap).data('valid', false)
  234 + .formValidation('validate');
  235 + });
  236 +
  237 + var dataArray = [];
  238 + $(wrap).on('success.form.fv', 'form.sub_task_form_v2', function (e) {
  239 + e.preventDefault();
  240 +
  241 + dataArray.push($.extend($(this).serializeJSON(), gb_common.getDisabledVal(this)
  242 + , {remarks: $('#form-s-t',wrap).val()}));
  243 + $(this).data('valid', true);
  244 +
  245 + if (allValidSuccess()) {
  246 + var i = 0;
  247 + (function () {
  248 + var f = arguments.callee;
  249 + if (i >= dataArray.length) {
  250 + /**
  251 + * 为班次添加备注
  252 + */
  253 + //var remarks = '调头' + $('[name=endDate]', csf).val() + ' 因 ' + $.trim($('#turnReason', modal).val()) + '在' + $('[name=endStation] option:selected', csf).text() + '调头';
  254 + //gb_schedule_table.addRemarks([sch, nextSch], gb_common.trim(remarks, 'g'));
  255 + UIkit.modal('#add-sub-task-main-modal').hide();
  256 + $('#schedule-lj_zrw-modal .main-schedule-table').trigger('refresh', {sch: sch});
  257 + gb_data_basic.reload_stat_park_data();
  258 + return;
  259 + }
  260 + var data = dataArray[i];
  261 + //营运子任务不写备注
  262 + if(data.mileageType == 'service' && !data.destroy)
  263 + data.remarks = '';
  264 + gb_common.$post('/childTask', data, function (rs) {
  265 + notify_succ('子任务添加成功');
  266 + gb_schedule_table.updateSchedule(rs.t);
  267 + i++;
  268 + f();
  269 + });
  270 + })();
  271 + }
  272 + });
  273 + //校验不过
  274 + $(wrap).on('err.field.fv','form.sub_task_form_v2', function () {
  275 + $('button[type=submit]', wrap).removeClass('disabled').removeAttr('disabled');
  276 + });
  277 +
  278 + function allValidSuccess() {
  279 + var flag = true;
  280 + $('form.sub_task_form_v2', wrap).each(function (i, f) {
  281 + if(!$(f).data('valid')){
  282 + flag = false;
  283 + return false;
  284 + }
  285 + });
  286 + return flag;
  287 + }
  288 + })();
  289 + </script>
  290 +</div>
0 291 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/sub_task_v2/main.html 0 → 100644
  1 +<div class="uk-modal ct_move_modal" id="add-sub-task-main-modal">
  2 + <div class="uk-modal-dialog" style="width: 1100px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div class="uk-modal-header">
  5 + <h2>添加子任务</h2></div>
  6 +
  7 + <div class="uk-grid uk-grid-small">
  8 + <div class="uk-width-2-10">
  9 + <ul data-uk-switcher="{connect:'#tempScheduleContent',swiping:false}" class="uk-nav uk-nav-side left_tabs_lg">
  10 + <li name="normal"><a>1、子任务</a></li>
  11 + <li name="in_out"><a>2、进出场</a></li>
  12 + <li name="range_turn"><a>3、区间调头</a></li>
  13 + </ul>
  14 + </div>
  15 + <div class="uk-width-8-10">
  16 + <ul id="tempScheduleContent" class="uk-switcher">
  17 + <li class="tab_cont normalCont"></li>
  18 + <li class="tab_cont inOutCont"></li>
  19 + <li class="tab_cont rangeTurnCont"></li>
  20 + </ul>
  21 + </div>
  22 + </div>
  23 +
  24 + <div class="footer_tools">
  25 + <!-- 底部公里统计栏 -->
  26 + <div class="footer_mileage_count">
  27 + 合计&nbsp;&nbsp;
  28 + <span class="service_sum"></span>
  29 + <span class="destroy_sum"></span>
  30 + <span class="empty_sum"></span>
  31 + </div>
  32 + <!-- 站到场 链接 -->
  33 + <div class="station_to_park_link">
  34 + <a>站 <i class="uk-icon-exchange"></i> 场</a>
  35 + </div>
  36 +
  37 + <abbr title="系统基础信息录入的停车场,必须绘制闭合多边形地理位置,才会纳入选项">缺少停车场选项?</abbr>
  38 + </div>
  39 + </div>
  40 +
  41 + <script id="sub-task-v2-form-temp" type="text/html">
  42 + <form class="uk-form uk-form-horizontal uk-animation-fade sub_task_form_v2">
  43 + <span class="task_form_close_icon">
  44 + <i class="uk-icon-times"></i>
  45 + </span>
  46 + <input type="hidden" value="{{sch.id}}" name="schedule.id" sch_id_inp>
  47 + <input type="hidden" value="正常" name="type1">
  48 + <div class="uk-grid">
  49 + <div class="uk-width-1-3">
  50 + <div class="uk-form-row">
  51 + <label class="uk-form-label">班次类型</label>
  52 + <div class="uk-form-controls">
  53 + <select class="form-control nt-dictionary" data-code="-100" name="type2"
  54 + data-group=ChildTaskType></select>
  55 + </div>
  56 + </div>
  57 + </div>
  58 + <div class="uk-width-1-3">
  59 + <div class="uk-form-row">
  60 + <label class="uk-form-label">起点 </label>
  61 + <div class="uk-form-controls">
  62 + <select name="startStation" ></select>
  63 + </div>
  64 + </div>
  65 + </div>
  66 + <div class="uk-width-1-3">
  67 + <div class="uk-form-row">
  68 + <label class="uk-form-label">终点</label>
  69 + <div class="uk-form-controls">
  70 + <select name="endStation" ></select>
  71 + </div>
  72 + </div>
  73 + </div>
  74 + </div>
  75 +
  76 + <div class="uk-grid">
  77 + <div class="uk-width-1-3">
  78 + <div class="uk-form-row">
  79 + <label class="uk-form-label">开始时间</label>
  80 + <div class="uk-form-controls">
  81 + <input name="startDate" value="{{sch.fcsjActual==null?sch.dfsj:sch.fcsjActual}}" type="time"
  82 + required>
  83 + </div>
  84 + </div>
  85 + </div>
  86 + <div class="uk-width-1-3">
  87 + <div class="uk-form-row">
  88 + <label class="uk-form-label">结束时间</label>
  89 + <div class="uk-form-controls">
  90 + <input name="endDate" type="time" required>
  91 + </div>
  92 + </div>
  93 + </div>
  94 + <div class="uk-width-1-3">
  95 + <div class="uk-form-row">
  96 + <label class="uk-form-label">公里数</label>
  97 + <div class="uk-form-controls">
  98 + <input class="form-control" name="mileage" max=222 data-fv-lessthan-inclusive="false"
  99 + required>
  100 + </div>
  101 + </div>
  102 + </div>
  103 + </div>
  104 +
  105 + <div class="uk-grid">
  106 + <div class="uk-width-2-3 domains"></div>
  107 + <div class="uk-width-1-3">
  108 + <div class="uk-form-row">
  109 + <label class="uk-form-label">里程类型</label>
  110 + <div class="uk-form-controls">
  111 + <select class="form-control nt-dictionary" required name="mileageType"
  112 + data-group="MileageType"></select>
  113 + </div>
  114 + </div>
  115 + </div>
  116 + </div>
  117 + </form>
  118 + </script>
  119 +
  120 + <script id="st-v2-domains-changecar-form-temp" type="text/html">
  121 + <div class="uk-grid">
  122 + <div class="uk-width-1-2">
  123 + <div class="uk-form-row">
  124 + <label class="uk-form-label">车辆编码</label>
  125 + <div class="uk-form-controls">
  126 + <div class="uk-autocomplete autocomplete-cars">
  127 + <input type="text" name="nbbm" placeholder="车辆自编号" required>
  128 + </div>
  129 + </div>
  130 + </div>
  131 + </div>
  132 + <div class="uk-width-1-2 destroy_reason_wrap">
  133 + <div class="uk-form-row">
  134 + <label class="uk-form-label">换车原因</label>
  135 + <div class="uk-form-controls">
  136 + <select class="form-control" name="reason" required>
  137 + <option value="">请选择...</option>
  138 + {{each inOutExps as exp i}}
  139 + <option value="{{exp}}">{{exp}}</option>
  140 + {{/each}}
  141 + </select>
  142 + </div>
  143 + </div>
  144 + </div>
  145 + </div>
  146 + </script>
  147 +
  148 + <script id="st-v2-domains-inout-form-temp" type="text/html">
  149 + <div class="uk-grid">
  150 + <div class="uk-width-1-2">
  151 + <div class="uk-form-row" style="padding-top: 5px;">
  152 + <label class="uk-form-label"></label>
  153 + <div class="uk-form-controls">
  154 + <label data-uk-tooltip title="如是无人售票线路,忽略这个选项">
  155 + <input type="checkbox" value=1 name="noClerk" class="i-cbox"> 无售票员
  156 + </label>
  157 + </div>
  158 + </div>
  159 + </div>
  160 + <div class="uk-width-1-2 destroy_reason_wrap">
  161 + <div class="uk-form-row">
  162 + <label class="uk-form-label">进出场原因</label>
  163 + <div class="uk-form-controls">
  164 + <select class="form-control" name="reason" required>
  165 + <option value="">请选择...</option>
  166 + {{each inOutExps as exp i}}
  167 + <option value="{{exp}}">{{exp}}</option>
  168 + {{/each}}
  169 + </select>
  170 + </div>
  171 + </div>
  172 + </div>
  173 + </div>
  174 + </script>
  175 +
  176 + <script id="st-v2-domains-service-form-temp" type="text/html">
  177 + <div class="uk-grid">
  178 + <div class="uk-width-1-2">
  179 + <div class="uk-form-row" style="padding-top: 5px;">
  180 + <label class="uk-form-label"></label>
  181 + <div class="uk-form-controls">
  182 + <label>
  183 + <input type="checkbox" value=1 name="destroy" class="i-cbox"> 是否烂班
  184 + </label>
  185 + </div>
  186 + </div>
  187 + </div>
  188 + <div class="uk-width-1-2 destroy_reason_wrap" style="display: none;">
  189 + <div class="uk-form-row">
  190 + <label class="uk-form-label">烂班原因</label>
  191 + <div class="uk-form-controls">
  192 + <select class="form-control" name="reason" required>
  193 + <option value="">请选择...</option>
  194 + {{each adjustExps as exp i}}
  195 + <option value="{{exp}}">{{exp}}</option>
  196 + {{/each}}
  197 + </select>
  198 + </div>
  199 + </div>
  200 + </div>
  201 + </div>
  202 + </script>
  203 + <script>
  204 + (function () {
  205 + var modal = '#add-sub-task-main-modal', sch,
  206 + stationRoutes,
  207 + parks,
  208 + information,
  209 + st_park_data;
  210 +
  211 + $(modal).on('init', function (e, data) {
  212 + e.stopPropagation();
  213 + sch = data.sch;
  214 +
  215 + //站到场数据
  216 + st_park_data = gb_data_basic.get_stat_park_data()[sch.xlBm];
  217 + //站点路由
  218 + stationRoutes = gb_common.groupBy(gb_data_basic.stationRoutes(sch.xlBm).sort(function (a, b) {
  219 + return a.stationRouteCode - b.stationRouteCode;
  220 + }), 'directions');
  221 + //停车场
  222 + parks = gb_data_basic.simpleParksArray();
  223 + //线路标准
  224 + information = gb_data_basic.getLineInformation(sch.xlBm);
  225 + //停车场排序,常用的放前面
  226 + parks = sort_parks(parks, information, st_park_data);
  227 +
  228 + var st_doms = gb_schedule_context_menu.get_st_doms();
  229 + //普通
  230 + $('.normalCont', modal).html(st_doms.custom_dom);
  231 + $('.add_custom_wrap', modal).trigger('init', data);
  232 +
  233 + //进出场班次
  234 + if(sch.bcType=='in'||sch.bcType=='out'){
  235 + $('.left_tabs_lg li[name=in_out]').remove();
  236 + $('.left_tabs_lg li[name=range_turn]').remove();
  237 + }
  238 + else{
  239 + //进出场
  240 + $('.inOutCont', modal).html(st_doms.inout_dom);
  241 + $('.add_inOut_wrap', modal).trigger('init', data);
  242 + //区间调头
  243 + $('.rangeTurnCont', modal).html(st_doms.range_dom);
  244 + $('.add_range_wrap', modal).trigger('init', data);
  245 + }
  246 + });
  247 +
  248 + //班次类型切换事件
  249 + $(modal).on('change', 'select[name=type2]', reCalcInputs_type);
  250 + //烂班选项点击事件
  251 + $(modal).on('change', 'input[name=destroy]', destroyClick);
  252 + //起终点站切换事件
  253 + $(modal).on('change', 'select[name=startStation],select[name=endStation]', reCalcInputs_station);
  254 + //开始时间改变
  255 + $(modal).on('input', 'input[name=startDate]', reCalcEndTime);
  256 + //公里数改变
  257 + $(modal).on('input', 'input[name=mileage]', reCalcMileageCount);
  258 + //终点时间改变
  259 + $(modal).on('input', 'input[name=endDate]', reCalcNext_s_time);
  260 + //进出场原因切换
  261 + $(modal).on('change', 'select[name=reason]', reSynchroReason);
  262 + //里程类型改变
  263 + $(modal).on('change', 'select[name=mileageType]', changeMileageType);
  264 + //关闭
  265 + $(modal).on('click', '.task_form_close_icon', closeTaskForm);
  266 +
  267 + //公里合计footer
  268 + var re_count;
  269 + $('.footer_mileage_count', modal).on('refresh', function () {
  270 + if(re_count)
  271 + return;
  272 + re_count = true;
  273 + var that=this;
  274 + setTimeout(function () {
  275 + var fs = $('#tempScheduleContent li.uk-active form.sub_task_form_v2', modal);
  276 + var s=0,e=0,d=0,mileage;
  277 + $.each(fs, function () {
  278 + mileage = parseFloat($f('mileage',this).val());
  279 + if($(this).hasClass('destroy_form'))
  280 + d = gb_common.accAdd(d, mileage);
  281 + else if($(this).hasClass('service_form'))
  282 + s = gb_common.accAdd(s, mileage);
  283 + else if($(this).hasClass('empty_form'))
  284 + e = gb_common.accAdd(e, mileage);
  285 + });
  286 +
  287 + $('span',that).hide();
  288 + if(s>0)
  289 + $('span.service_sum',that).html('营运: ' + s).show();
  290 + if(e>0)
  291 + $('span.empty_sum',that).html('空驶: ' + e).show();
  292 + if(d>0)
  293 + $('span.destroy_sum',that).html('烂班: ' + d).show();
  294 + re_count=false;
  295 + }, 200);
  296 + });
  297 +
  298 + /**
  299 + * 根据班次类型切换起终点下拉框
  300 + */
  301 + function reCalcInputs_type() {
  302 + var f = $(this).parents('.sub_task_form_v2');
  303 +
  304 + var routes = stationRoutes[sch.xlDir]
  305 + , lastCode = routes[routes.length - 1].stationCode
  306 + , opts = '', park_opts = '';
  307 + //station options
  308 + $.each(routes, function () {
  309 + opts += '<option value="' + this.stationCode + '">' + this.stationName + '</option>'
  310 + });
  311 + //park options
  312 + for(var i=0,p;p=parks[i++];)
  313 + park_opts += '<option value="' + p.code + '">' + p.name + '</option>';
  314 + /*for (var code in parks)
  315 + park_opts += '<option value="' + code + '">' + parks[code] + '</option>';*/
  316 +
  317 + var qdz = $f('startStation', f), zdz = $f('endStation', f), mType = $f('mileageType', f);
  318 + var domainsTemp;
  319 + switch ($(this).val()) {
  320 + case '3'://出场
  321 + qdz.html(park_opts).val(information.carPark);
  322 + zdz.html(opts).trigger('change');
  323 + mType.val('empty').attr('disabled', 'disabled').trigger('change');
  324 + domainsTemp = 'st-v2-domains-inout-form-temp';
  325 + /*//如果上一个form是进场
  326 + try {
  327 + var prev_f = f.prev('.sub_task_form_v2');
  328 + if ($f('type2', prev_f).val() == 2)
  329 + zdz.val($f('startStation', prev_f).val());
  330 + } catch (e) {
  331 + console.log(e);
  332 + }*/
  333 + break;
  334 + case '2'://进场
  335 + qdz.html(opts)
  336 + zdz.html(park_opts).val(information.carPark).trigger('change');
  337 + mType.val('empty').attr('disabled', 'disabled').trigger('change');
  338 + domainsTemp = 'st-v2-domains-inout-form-temp';
  339 + break;
  340 + default:
  341 + qdz.html(opts);
  342 + zdz.html(opts).val(lastCode).trigger('change');
  343 + mType.val('service').removeAttr('disabled').trigger('change');
  344 + domainsTemp = 'st-v2-domains-service-form-temp';
  345 + }
  346 +
  347 + //可变选项区域
  348 + $('.domains', f).html(template(domainsTemp, {
  349 + adjustExps: gb_common.adjustExps,
  350 + inOutExps: gb_common.inOutExps
  351 + }));
  352 +
  353 + //校验reason
  354 + f.trigger('add_reason_field');
  355 + //qdz.trigger('change');
  356 + //zdz.trigger('change');
  357 + }
  358 +
  359 + /**
  360 + * 根据站位站距计算公里和时间
  361 + */
  362 + function reCalcInputs_station() {
  363 + var f = $(this).parents('.sub_task_form_v2')
  364 + , type2 = $f('type2', f).val()//班次类型
  365 + , qdzCode = $f('startStation', f).val()//起点站
  366 + , zdzCode = $f('endStation', f).val()//终点站
  367 + , startDate = $f('startDate', f).val();//开始时间
  368 + var mileage, time, upDown;
  369 + switch (type2) {
  370 + case '2':
  371 + upDown = inout_updown(qdzCode, sch);
  372 + break;
  373 + case '3':
  374 + upDown = inout_updown(zdzCode, sch);
  375 + break;
  376 + default:
  377 + upDown = sch.xlDir
  378 + }
  379 +
  380 + //从站到场里获取数据
  381 + var stp = search_st_park(f);
  382 + if(stp){
  383 + mileage=type2==2?stp['mileage1']:stp['mileage2'];
  384 + time=type2==2?stp['time1']:stp['time2'];
  385 + }
  386 + else{
  387 + if(upDown==-1)
  388 + return;
  389 + switch (upDown + '_' + type2) {
  390 + case '0_3'://上行出场
  391 + mileage = information.upOutMileage;
  392 + time = information.upOutTimer;
  393 + break;
  394 + case '1_3'://下行出场
  395 + mileage = information.downOutMileage;
  396 + time = information.downOutTimer;
  397 + break;
  398 + case '0_2'://上行进场
  399 + mileage = information.upInMileage;
  400 + time = information.upInTimer;
  401 + break;
  402 + case '1_2'://下行进场
  403 + mileage = information.downInMileage;
  404 + time = information.downInTimer;
  405 + break;
  406 + default:
  407 + //线路上站点间
  408 + mileage = calcMileageByRoutes(stationRoutes[upDown], qdzCode, zdzCode);
  409 + time = gb_common.mul(gb_common.accDiv(sch.bcsj, sch.jhlcOrig), mileage);
  410 + }
  411 + }
  412 +
  413 + $f('mileage', f).val(mileage);
  414 + var et = moment(startDate, 'HH:mm').add(time, 'minutes');
  415 + $f('endDate', f).val(et.format('HH:mm'));
  416 +
  417 + if (type2 != 1) {
  418 + reCalcEndTime.call(this);
  419 + }
  420 + reCalcMileageCount();
  421 + }
  422 +
  423 + /**
  424 + * 计算结束时间
  425 + */
  426 + function reCalcEndTime() {
  427 + var f = $(this).parents('.sub_task_form_v2')
  428 + , startDate = $f('startDate', f).val()//开始时间
  429 + , mileage = $f('mileage', f).val()//公里
  430 + , type2 = $f('type2', f).val();//班次类型
  431 + if (!startDate || !mileage)
  432 + return;
  433 +
  434 + var time;
  435 + //从站到场里获取数据
  436 + var stp = search_st_park(f);
  437 + if(stp){
  438 + mileage=type2==2?stp['mileage1']:stp['mileage2'];
  439 + time=type2==2?stp['time1']:stp['time2'];
  440 + }
  441 + else{
  442 + if (type2 == 1) {
  443 + time = gb_common.mul(gb_common.accDiv(sch.bcsj, sch.jhlcOrig), mileage);
  444 + }
  445 + else if (type2 == 2) {
  446 + //进场
  447 + var qdzCode = $f('startStation', f).val(),
  448 + updown = inout_updown(qdzCode, sch);
  449 +
  450 + if (updown == -1)
  451 + return;
  452 + time = updown == 0 ? information.upInTimer : information.downInTimer;
  453 + }
  454 + else if (type2 == 3) {
  455 + //出场
  456 + var zdzCode = $f('endStation', f).val(),
  457 + updown = inout_updown(zdzCode, sch);
  458 +
  459 + if (updown == -1)
  460 + return;
  461 + time = updown == 0 ? information.upOutTimer : information.downOutTimer;
  462 + }
  463 + }
  464 +
  465 + var et = moment(startDate, 'HH:mm').add(time, 'minutes');
  466 + $f('endDate', f).val(et.format('HH:mm')).trigger('input');
  467 + }
  468 +
  469 + /**
  470 + * 将结束时间写入下一个表单的开始时间
  471 + */
  472 + function reCalcNext_s_time() {
  473 + var f = $(this).parents('.sub_task_form_v2'),
  474 + et = $f('endDate', f).val();
  475 +
  476 + var nf = gb_common.next_elem('sub_task_form_v2', f);
  477 +
  478 + if (f.attr('destroy'))
  479 + et = $f('startDate', f).val();
  480 +
  481 + if (nf.length > 0) {
  482 + $f('startDate', nf).val(et).trigger('input');
  483 + }
  484 + }
  485 +
  486 + /**
  487 + * 切换原因
  488 + */
  489 + function reSynchroReason() {
  490 + var f = $(this).parents('.sub_task_form_v2'),
  491 + reason = $(this).val();
  492 +
  493 + var nf = gb_common.next_elem('sub_task_form_v2', f),
  494 + nInput = $f('reason', nf);
  495 +
  496 + if (nf.length > 0 && nInput.length > 0) {
  497 + nInput.val(reason).trigger('change');
  498 + }
  499 + else {
  500 + var cont = f.parents('li.tab_cont'),
  501 + remInput = $('.remarks_form [name=remarks]', cont);
  502 +
  503 + if(remInput.val()==reason + ',')
  504 + return;
  505 + remInput.val(remInput.val() + reason + ',');
  506 + }
  507 + }
  508 +
  509 + function calcMileageByRoutes(routes, s, e) {
  510 + var code, flag, mileage = 0;
  511 + $.each(routes, function () {
  512 + code = this['stationCode'];
  513 + if (flag) {
  514 + if (!this.distances)
  515 + this.distances = 0;
  516 + mileage = gb_common.accAdd(mileage, this.distances);
  517 + }
  518 + if (code == s)
  519 + flag = true;
  520 + if (code == e)
  521 + return false;
  522 + });
  523 + return mileage;
  524 + }
  525 +
  526 + function destroyClick() {
  527 + var f = $(this).parents('.sub_task_form_v2');
  528 + if (this.checked) {
  529 + $('.destroy_reason_wrap', f).show();
  530 + f.attr('destroy', true).addClass('destroy_form');
  531 + }
  532 + else {
  533 + $('.destroy_reason_wrap', f).hide();
  534 + f.removeAttr('destroy').removeClass('destroy_form');
  535 + }
  536 + reCalcMileageCount();
  537 + }
  538 +
  539 + function changeMileageType() {
  540 + var f = $(this).parents('.sub_task_form_v2'),
  541 + mileageType = $(this).val();
  542 + if (mileageType) {
  543 + f.removeClass('service_form empty_form').addClass(mileageType + '_form');
  544 + reCalcMileageCount();
  545 + }
  546 + }
  547 +
  548 + function $f(name, f) {
  549 + return $('[name=' + name + ']', f);
  550 + }
  551 +
  552 + function closeTaskForm() {
  553 + $(this).parents('.sub_task_form_v2').remove();
  554 + reCalcMileageCount();
  555 + }
  556 +
  557 + /**
  558 + * 进出场上下行
  559 + * @param qdzCode
  560 + * @param sch
  561 + */
  562 + function inout_updown(station, sch) {
  563 + if (station == sch.qdzCode)
  564 + return sch.xlDir;
  565 + else if (station == sch.zdzCode)
  566 + return sch.xlDir == 0 ? 1 : 0;
  567 + else
  568 + return -1;
  569 + }
  570 +
  571 + function search_st_park(f) {
  572 + if(!st_park_data)
  573 + return;
  574 + var stp;
  575 + var qdSelect=$f('startStation', f)[0],zdSelect=$f('endStation', f)[0];
  576 +
  577 + var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text,
  578 + zdzName=zdSelect.options[zdSelect.options.selectedIndex].text,
  579 + type2 = $f('type2', f).val();
  580 +
  581 + if(type2!=2 && type2!=3)
  582 + return;
  583 +
  584 + $.each(st_park_data, function () {
  585 + if((type2==2 && this.stationName==qdzName && this.parkName==zdzName)
  586 + || (type2==3 && this.stationName==zdzName && this.parkName==qdzName)){
  587 + stp = this;
  588 + return false;
  589 + }
  590 + });
  591 +
  592 + return stp;
  593 + }
  594 +
  595 + $('.left_tabs_lg', modal).on('show.uk.switcher', reCalcMileageCount);
  596 +
  597 + function reCalcMileageCount() {
  598 + $('.footer_mileage_count', modal).trigger('refresh');
  599 + var f = $(this).parents('.sub_task_form_v2');
  600 + if($f('type2',f).val()==1)
  601 + reCalcEndTime.call(this);
  602 + }
  603 +
  604 +
  605 + var folder = '/real_control_v2/fragments/line_schedule/context_menu';
  606 + /**
  607 + * 弹出站 到 场对照表
  608 + */
  609 + $('.station_to_park_link', modal).on('click', function () {
  610 + open_modal(folder + '/utils/station_to_park.html', {
  611 + sch: sch
  612 + }, {center: false, bgclose: false, modal: false});
  613 + });
  614 +
  615 + /**
  616 + * 停车场排序
  617 + * @param parks 停车场 code 2 name
  618 + * @param information 线路标准
  619 + * @param st_park_data 站到场
  620 + */
  621 + function sort_parks(parks, information, st_park_data) {
  622 + var array = [], names=[];
  623 + for(var code in parks){
  624 + array.push({code: code, name: parks[code]});
  625 + }
  626 +
  627 + if(st_park_data && st_park_data.length > 0){
  628 + $.each(st_park_data, function () {
  629 + names.push(this.parkName);
  630 + });
  631 + }
  632 +
  633 + //debugger
  634 + array.sort(function (a, b) {
  635 + if(a.code==information.carPark)
  636 + return -1;
  637 + if(b.code==information.carPark)
  638 + return 1;
  639 +
  640 + var ai = names.indexOf(a.name),
  641 + bi = names.indexOf(b.name);
  642 +
  643 + if(ai!=-1 && bi==-1)
  644 + return -1;
  645 + else if(ai==-1 && bi!=-1)
  646 + return 1;
  647 + else
  648 + return a.name.localeCompare(b.name);
  649 + });
  650 +
  651 + /*var rs = {};
  652 + $.each(array, function () {
  653 + rs[this.code]=this.name;
  654 + });*/
  655 +
  656 + return array;
  657 + }
  658 + })();
  659 + </script>
  660 +</div>
0 661 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/tzrc.html
... ... @@ -54,8 +54,7 @@
54 54 </div>
55 55 <div class="uk-width-1-2">
56 56 <div class="uk-form-row">
57   - <label class="uk-form-label">驾驶员 <i class="uk-icon-question-circle" data-uk-tooltip
58   - title="如果有驾驶员未提示,请至后台“基础信息 -人员信息”里纠正该员工的“工种”类别 "></i></label>
  57 + <label class="uk-form-label">驾驶员 </label>
59 58 <div class="uk-form-controls">
60 59 <div class="uk-autocomplete uk-form jsy-autocom">
61 60 <input type="text" value="" name="jsy" required>
... ... @@ -192,7 +191,10 @@
192 191 //});
193 192  
194 193 //submit
195   - var f = $('form.tzrc_form', modal).formValidation(gb_form_validation_opts);
  194 + var f = $('form.tzrc_form', modal).formValidation({
  195 + framework: 'uikit',
  196 + locale: 'zh_CN'
  197 + });
196 198 f.on('success.form.fv', function (e) {
197 199 e.preventDefault();
198 200 var param = $(this).serializeJSON();
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/utils/station_to_park.html 0 → 100644
  1 +<div class="uk-modal ct-form-modal" id="station_to_park-modal">
  2 + <div class="uk-modal-dialog" style="width: 780px;">
  3 + <a href="" class="uk-modal-close uk-close"></a>
  4 + <div class="uk-modal-header">
  5 + <h2>站到场历时、公里对照表</h2></div>
  6 +
  7 + <div class="ct_lists">
  8 + </div>
  9 +
  10 + <div class="ct_describe" >从历史的子任务、临加里采集进出场历时和公里</div>
  11 + </div>
  12 +
  13 + <script id="station_park_list-temp" type="text/html">
  14 + {{each list as obj i}}
  15 + {{if obj.mileage1 != obj.mileage2}}
  16 + <div class="s_2_park_form_wrap" data-id="{{obj.id}}">
  17 + <span class="ct_close"><i class="uk-icon-times"></i></span>
  18 + <form class="uk-form">
  19 + {{if obj.time1!=null && obj.mileage1!=null}}
  20 + <div class="uk-grid">
  21 + <div class="uk-width-1-4">
  22 + <label class="">起点:</label>
  23 + <input type="text" value="{{obj.stationName}}" class="uk-width-1-1" readonly>
  24 + </div>
  25 + <div class="uk-width-1-4">
  26 + <label>终点:</label>
  27 + <input type="text" value="{{obj.parkName}}" class="uk-width-1-1" readonly>
  28 + </div>
  29 + <div class="uk-width-2-4 uk-grid">
  30 + <div class="uk-width-1-3">
  31 + <label>历时:</label>
  32 + <input type="text" value="{{obj.time1}}" class="uk-width-1-1" readonly>
  33 + </div>
  34 + <div class="uk-width-1-3">
  35 + <label>公里:</label>
  36 + <input type="text" value="{{obj.mileage1}}" class="uk-width-1-1" readonly>
  37 + </div>
  38 + <div class="uk-width-1-3">
  39 + <label class="bottom_label">进场</label>
  40 + </div>
  41 + </div>
  42 + </div>
  43 + {{/if}}
  44 + {{if obj.time2!=null && obj.mileage2!=null}}
  45 + <div class="uk-grid">
  46 + <div class="uk-width-1-4">
  47 + <input type="text" value="{{obj.parkName}}" class="uk-width-1-1" readonly>
  48 + </div>
  49 + <div class="uk-width-1-4">
  50 + <input type="text" value="{{obj.stationName}}" class="uk-width-1-1" readonly>
  51 + </div>
  52 + <div class="uk-width-2-4 uk-grid">
  53 + <div class="uk-width-1-3">
  54 + <input type="text" value="{{obj.time2}}" class="uk-width-1-1" readonly>
  55 + </div>
  56 + <div class="uk-width-1-3">
  57 + <input type="text" value="{{obj.mileage2}}" class="uk-width-1-1" readonly>
  58 + </div>
  59 + <div class="uk-width-1-3">
  60 + <label class="bottom_label_2">出场</label>
  61 + </div>
  62 + </div>
  63 + </div>
  64 + {{/if}}
  65 + </form>
  66 + </div>
  67 + {{else}}
  68 + <div class="s_2_park_form_wrap" data-id="{{obj.id}}">
  69 + <span class="ct_close"><i class="uk-icon-times"></i></span>
  70 + <form class="uk-form">
  71 + <div class="uk-grid">
  72 + <div class="uk-width-1-4">
  73 + <label class="">起点:</label>
  74 + <input type="text" value="{{obj.stationName}}" class="uk-width-1-1" readonly>
  75 + </div>
  76 + <div class="uk-width-1-4">
  77 + <label>终点:</label>
  78 + <input type="text" value="{{obj.parkName}}" class="uk-width-1-1" readonly>
  79 + </div>
  80 + <div class="uk-width-2-4 uk-grid">
  81 + <div class="uk-width-1-3">
  82 + <label>历时:</label>
  83 + <input type="text" value="{{obj.time1}}" class="uk-width-1-1" readonly>
  84 + </div>
  85 + <div class="uk-width-1-3">
  86 + <label>公里:</label>
  87 + <input type="text" value="{{obj.mileage1}}" class="uk-width-1-1" readonly>
  88 + </div>
  89 + <div class="uk-width-1-3">
  90 + <label class="bottom_label"><input type="checkbox" disabled checked> 进=出 </label>
  91 + </div>
  92 + </div>
  93 + </div>
  94 + </form>
  95 + </div>
  96 + {{/if}}
  97 + {{/each}}
  98 + </script>
  99 +
  100 + <script>
  101 + (function () {
  102 + var modal = '#station_to_park-modal', sch;
  103 +
  104 + $(modal).on('init', function (e, data) {
  105 + e.stopPropagation();
  106 + sch = data.sch;
  107 +
  108 + var list = gb_data_basic.get_stat_park_data()[sch.xlBm];
  109 + if(!list)
  110 + return;
  111 + list.sort(function (a, b) {
  112 + return a.stationName.localeCompare(b.stationName);
  113 + });
  114 +
  115 + var htmlStr = template('station_park_list-temp', {list: list});
  116 + $('.ct_lists', modal).html(htmlStr);
  117 + });
  118 +
  119 + $(modal).on('click', '.s_2_park_form_wrap>.ct_close', function () {
  120 + var wrap=$(this).parent(),
  121 + id=wrap.data('id');
  122 +
  123 + gb_common.$post('/basic/deleteStation2Park', {lineCode: sch.xlBm, id: id}, function () {
  124 + gb_data_basic.reload_stat_park_data();
  125 + wrap.remove();
  126 + });
  127 + });
  128 + })();
  129 + </script>
  130 +</div>
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/sch_edit_info/list.html
... ... @@ -35,6 +35,22 @@
35 35 <div class="uk-autocomplete uk-form autocomplete-jsy">
36 36 <input type="text" name="jGh" placeholder="驾驶员">
37 37 </div>
  38 + &nbsp;
  39 + <span class="horizontal-field">修正类型</span>
  40 + <select name="type">
  41 + <option value="">全部</option>
  42 + <option value="DFTZ">待发调整</option>
  43 + <option value="SFTZ">实发调整</option>
  44 + <option value="FCXXWT">发车信息微调</option>
  45 + <option value="TZRC">调整人车</option>
  46 + <option value="JHLB">计划烂班</option>
  47 + <option value="CXLB">撤销烂班</option>
  48 + <option value="CXSF">撤销实发</option>
  49 + <option value="CXZX">撤销执行</option>
  50 + <option value="LPDD">路牌对调</option>
  51 + <option value="ZRW">添加子任务</option>
  52 + <option value="LSBCTZ">历史班次调整</option>
  53 + </select>
38 54 <button class="uk-button">检索</button>
39 55  
40 56 <label style="float: right;font-size: 12px;color: #989797;">
... ... @@ -122,6 +138,19 @@
122 138 </div>
123 139 </script>
124 140  
  141 + <!-- 历史班次调整 tip -->
  142 + <script id="edit-info-tip-lsbctz-temp" type="text/html">
  143 + <div class="edit-info-tip">
  144 + {{each jsonArray as obj i}}
  145 + <p class="text">{{obj.title}} 由 {{obj.old==null?'无':obj.old}} 调整为 {{obj.now}}</p>
  146 + {{/each}}
  147 + <p class="sub_text">调整人:{{user}} 调整时间:{{ts_str}}</p>
  148 + {{if remarks!=null && remarks != ''}}
  149 + <p class="sub_text">备注:{{remarks}}</p>
  150 + {{/if}}
  151 + </div>
  152 + </script>
  153 +
125 154 <!-- 撤销实发tip -->
126 155 <script id="edit-info-tip-cxsf-temp" type="text/html">
127 156 <div class="edit-info-tip">
... ... @@ -248,6 +277,7 @@
248 277 $.each(rs.list, function () {
249 278 this.jsonArray = JSON.parse(this.jsonArray);
250 279 etInfos[this.id] = this;
  280 + this['ts_str'] = moment(this.ts).format('YYYY-MM-DD HH:mm');
251 281  
252 282 nbbmArray.push({value: this.clZbh});
253 283 jsyArray.push({value: this.jGh+'/'+this.jName,
... ... @@ -365,7 +395,7 @@
365 395 return gb_common.get_vals(rs);
366 396 }
367 397  
368   - var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班', 'CXZX': '撤销执行', 'CXSF': '撤销实发', 'SFTZ': '实发调整', 'TZRC': '调整人车'};
  398 + var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班', 'CXZX': '撤销执行', 'CXSF': '撤销实发', 'SFTZ': '实发调整', 'TZRC': '调整人车', 'LSBCTZ':'历史班次调整'};
369 399 function subData(data){
370 400 return {
371 401 id: data.id,
... ... @@ -535,6 +565,26 @@
535 565 });
536 566  
537 567  
  568 + //发车信息微调tip
  569 + $(modal).on('mouseenter', '.ct-badge.ct-badge-LSBCTZ', function() {
  570 + $(this).qtip({
  571 + show: _opts.show,
  572 + content: {
  573 + title: '发车信息微调',
  574 + text: function() {
  575 + var obj = etInfos[$(this).data('id')];
  576 + return template('edit-info-tip-lsbctz-temp', obj);
  577 + }
  578 + },
  579 + position: _opts.position,
  580 + style: {
  581 + classes: 'qtip-blue qtip-rounded qtip-shadow sch-badge-tip'
  582 + },
  583 + hide: _opts.hide,
  584 + events: _opts.events
  585 + });
  586 + });
  587 +
538 588 function sortFun(a, b) {
539 589 return (a.realExecDate + a.fcsj).localeCompare(b.realExecDate + b.fcsj);
540 590 }
... ...
src/main/resources/static/real_control_v2/js/common.js
... ... @@ -21,6 +21,9 @@ var gb_common = (function () {
21 21 0x12: '报警'
22 22 };
23 23  
  24 + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他'];
  25 + var inOutExps = ['故障', '肇事', '纠纷', '其他'];
  26 +
24 27 var groupBy = function (list, field) {
25 28 var rs = {},
26 29 key;
... ... @@ -324,6 +327,17 @@ var gb_common = (function () {
324 327 return e = Math.pow(10, Math.max(c, d)), (mul(a, e) + mul(b, e)) / e;
325 328 };
326 329  
  330 + function accDiv(arg1,arg2){
  331 + var t1=0,t2=0,r1,r2;
  332 + try{t1=arg1.toString().split(".")[1].length}catch(e){}
  333 + try{t2=arg2.toString().split(".")[1].length}catch(e){}
  334 + with(Math){
  335 + r1=Number(arg1.toString().replace(".",""))
  336 + r2=Number(arg2.toString().replace(".",""))
  337 + return (r1/r2)*pow(10,t2-t1);
  338 + }
  339 + }
  340 +
327 341 function mul(a, b) {
328 342 var c = 0,
329 343 d = a.toString(),
... ... @@ -372,6 +386,26 @@ var gb_common = (function () {
372 386 return rs;
373 387 };
374 388  
  389 + var next_elem = function (clazz, e) {
  390 + var ne = e.next();
  391 + if(ne.length==0)
  392 + return [];
  393 + else if(ne.hasClass(clazz))
  394 + return ne;
  395 + else
  396 + return next_elem(clazz, ne);
  397 + };
  398 +
  399 + var getDisabledVal = function (f) {
  400 + var rs = {};
  401 + $('input,select', f).each(function () {
  402 + if($(this).attr('disabled')){
  403 + rs[$(this).attr('name')]=$(this).val();
  404 + }
  405 + });
  406 + return rs;
  407 + };
  408 +
375 409 return {
376 410 reqCode80: reqCode80,
377 411 groupBy: groupBy,
... ... @@ -395,7 +429,13 @@ var gb_common = (function () {
395 429 trim: trim,
396 430 remarksAutocomplete: remarksAutocomplete,
397 431 flatpickrDateTimeConfig: flatpickrDateTimeConfig,
398   - inverse: inverse
  432 + inverse: inverse,
  433 + accDiv: accDiv,
  434 + mul: mul,
  435 + adjustExps: adjustExps,
  436 + inOutExps: inOutExps,
  437 + next_elem: next_elem,
  438 + getDisabledVal: getDisabledVal
399 439  
400 440 //whichTransitionEvent:whichTransitionEvent
401 441 };
... ...
src/main/resources/static/real_control_v2/js/data/data_basic.js
... ... @@ -75,6 +75,9 @@ var gb_data_basic = (function () {
75 75 var carparks = {};
76 76 //停车场数据
77 77 gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) {
  78 + rs.list.sort(function (a, b) {
  79 + return a.parkName.localeCompare(b.parkName);
  80 + });
78 81 $.each(rs.list, function () {
79 82 carparks[this.parkCode] = this;
80 83 });
... ... @@ -116,6 +119,15 @@ var gb_data_basic = (function () {
116 119 ep.emit('svg_attrs', data);
117 120 });
118 121  
  122 + //站点和停车场历时、公里对照数据
  123 + var stat_park_data;
  124 + var load_stat_park_data = function () {
  125 + $.get('/basic/station2ParkData?t='+Math.random(), {idx: line_idx}, function (rs) {
  126 + stat_park_data = rs;
  127 + });
  128 + }
  129 + load_stat_park_data();
  130 +
119 131 function findLineByCodes(codeArr) {
120 132 var rs = [];
121 133 $.each(codeArr, function () {
... ... @@ -239,6 +251,12 @@ var gb_data_basic = (function () {
239 251 },
240 252 remarksMapps: function () {
241 253 return remarksMapps;
  254 + },
  255 + get_stat_park_data: function () {
  256 + return stat_park_data;
  257 + },
  258 + reload_stat_park_data: function () {
  259 + load_stat_park_data();
242 260 }
243 261 };
244 262 })();
... ...
src/main/resources/static/real_control_v2/js/forms/form_embed.js
... ... @@ -61,7 +61,7 @@ var gb_embed_form_hanlde = (function () {
61 61  
62 62 }
63 63 });
64   - }
  64 + };
65 65  
66 66  
67 67 return {
... ...
src/main/resources/static/real_control_v2/js/line_schedule/context_menu.js
... ... @@ -7,7 +7,23 @@ var gb_schedule_context_menu = (function () {
7 7 bgclose: false
8 8 },
9 9 folder = '/real_control_v2/fragments/line_schedule/context_menu';
  10 +
  11 + //提前缓存子任务的片段页面
  12 + var st_doms={};
  13 + $.get(folder + '/sub_task_v2/add_custom.html', function (dom) {
  14 + st_doms.custom_dom=dom;
  15 + });
  16 + $.get(folder + '/sub_task_v2/add_in_out.html', function (dom) {
  17 + st_doms.inout_dom=dom;
  18 + });
  19 + $.get(folder + '/sub_task_v2/add_range_turn.html', function (dom) {
  20 + st_doms.range_dom=dom;
  21 + });
  22 +
10 23 var callbackHandler = {
  24 + get_st_doms: function () {
  25 + return st_doms;
  26 + },
11 27 dftz: function (sch) {
12 28 open_modal(folder + '/dftz.html', {
13 29 sch: sch
... ... @@ -234,6 +250,11 @@ var gb_schedule_context_menu = (function () {
234 250 open_modal(folder + '/add_temp_sch.html', {
235 251 sch: sch
236 252 }, modal_opts);
  253 + },
  254 + add_sub_task: function (sch) {
  255 + open_modal(folder + '/sub_task_v2/main.html', {
  256 + sch: sch
  257 + }, modal_opts);
237 258 }
238 259 };
239 260  
... ... @@ -274,7 +295,7 @@ var gb_schedule_context_menu = (function () {
274 295 },
275 296 'lj_zrw': {
276 297 name: '临加/子任务'
277   - },
  298 + }/*,
278 299 'shortcut': {
279 300 name: '...',
280 301 items: {
... ... @@ -294,6 +315,13 @@ var gb_schedule_context_menu = (function () {
294 315 name: '(子任务)区间调头'
295 316 }
296 317 }
  318 + }*/,
  319 + 'sep3': '---------',
  320 + 'add_temp_sch': {
  321 + name: '添加临加班次'
  322 + },
  323 + 'add_sub_task': {
  324 + name: '添加子任务'
297 325 },
298 326 'sep4': '---------',
299 327 'tzrc': {
... ... @@ -305,7 +333,7 @@ var gb_schedule_context_menu = (function () {
305 333 'wdtz': {
306 334 name: '误点调整'
307 335 },
308   - 'sep3': '---------',
  336 + 'sep4': '---------',
309 337 'lp_change': {
310 338 name: '路牌对调'
311 339 }
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -557,6 +557,20 @@ var gb_schedule_table = (function () {
557 557 }
558 558 };
559 559  
  560 + /* 下一个班次普通班次 */
  561 + var getNextNormalSch = function (sch) {
  562 +
  563 + var array = gb_common.get_vals(line2Schedule[sch.xlBm]).filter(function (a) {
  564 + return a.clZbh == sch.clZbh && a.bcType=='normal';
  565 + }).sort(schedule_sort);
  566 +
  567 + for (var i = 0; i < array.length; i++) {
  568 + if (array[i].id == sch.id) {
  569 + return i < array.length ? array[i + 1] : null;
  570 + }
  571 + }
  572 + };
  573 +
560 574 /** 添加备注信息 */
561 575 var addRemarks = function (list, remarks) {
562 576 //if(!list || list)
... ... @@ -630,6 +644,7 @@ var gb_schedule_table = (function () {
630 644 reLoadAndRefresh: reLoadAndRefresh,
631 645 showLateBadge: showLateBadge,
632 646 cancelLateBadge: cancelLateBadge,
633   - refreshAll: refreshAll
  647 + refreshAll: refreshAll,
  648 + getNextNormalSch: getNextNormalSch
634 649 };
635 650 })();
... ...
src/main/resources/static/real_control_v2/js/main.js
... ... @@ -169,8 +169,8 @@ var disabled_submit_btn = function (form) {
169 169 function showUpdateDescription() {
170 170 //更新说明
171 171 var updateDescription = {
172   - date: '2017-06-22',
173   - text: '<h5>优化了轨迹回放,可放大缩小窗口、可拖动进度条、手动呼出线路配车...</h5>'
  172 + date: '2017-07-05',
  173 + text: '<h5>稍微调整了添加子任务的界面</h5><h5>1、现在进出场子任务也必须选择进场原因</h5><h5>2、现在进出场子任务可以勾选 “无售票员” 如果是无人售票线路,请忽略这个选项</h5><h5>3、现在做中途进场子任务时,可以勾选“换车出场至中途站继续营运”</h5>'
174 174 };
175 175  
176 176 var storage = window.localStorage
... ...
src/main/resources/static/real_control_v2/sch_manage/sch_imitate.html
... ... @@ -379,15 +379,33 @@
379 379 }
380 380 alt_confirm('确定班次信息? ' + sch.xlName + '、起点 ' + sch.qdzName + ' , 终点 ' + sch.zdzName + ' 、待发 ' + sch.dfsj, function () {
381 381 $('.shade-loading').show();
382   - gb_common.$post('/gps/gpsCompletion', {schId: schId}, function (rs) {
  382 + gb_common.$post('/gps/gpsCompletion', {schId: schId, type: 0}, function (rs) {
383 383 $('.shade-loading').hide();
384 384 $('.search-form').trigger('submit');
385 385 });
386 386 }, '我确定是这个班次');
387 387 };
388 388  
  389 + var gps_imitate_after = function (schId) {
  390 + var sch = schArray[schId];
  391 + if(sch.reissue){
  392 + UIkit.notify("<i class='uk-icon-times'></i> 你不能对一个班次重复操作!", {
  393 + status: 'danger'
  394 + });
  395 + return;
  396 + }
  397 + alt_confirm('确定补传班次信息? ' + sch.xlName + '、起点 ' + sch.qdzName + ' , 终点 ' + sch.zdzName + ' 、待发 ' + sch.dfsj, function () {
  398 + $('.shade-loading').show();
  399 + gb_common.$post('/gps/gpsCompletion', {schId: schId, type: 1}, function (rs) {
  400 + $('.shade-loading').hide();
  401 + $('.search-form').trigger('submit');
  402 + });
  403 + }, '我确定补传这个班次');
  404 + }
  405 +
389 406 var callbackHandler = {
390   - gps_imitate: gps_imitate
  407 + gps_imitate: gps_imitate,
  408 + gps_imitate_after: gps_imitate_after
391 409 }
392 410  
393 411 $.contextMenu({
... ... @@ -399,7 +417,11 @@
399 417 },
400 418 items: {
401 419 'gps_imitate': {
402   - name: '模拟轨迹'
  420 + name: '模拟轨迹(事前)'
  421 +
  422 + },
  423 + 'gps_imitate_after':{
  424 + name: '模拟轨迹(事后补传)'
403 425 }
404 426 }
405 427 });
... ...