Commit 5e8f8ffa67765ac81f709aa4883b73dbaf161ebc

Authored by zb
2 parents c2dd7da4 e87ba568

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

into minhang
Showing 115 changed files with 6442 additions and 1768 deletions
src/main/java/com/bsth/controller/gps/GpsController.java
@@ -3,8 +3,10 @@ package com.bsth.controller.gps; @@ -3,8 +3,10 @@ package com.bsth.controller.gps;
3 import com.bsth.data.BasicData; 3 import com.bsth.data.BasicData;
4 import com.bsth.data.gpsdata.GpsEntity; 4 import com.bsth.data.gpsdata.GpsEntity;
5 import com.bsth.data.gpsdata.GpsRealData; 5 import com.bsth.data.gpsdata.GpsRealData;
  6 +import com.bsth.entity.excep.Speeding;
6 import com.bsth.service.gps.GpsService; 7 import com.bsth.service.gps.GpsService;
7 import com.bsth.service.gps.entity.GpsSpeed; 8 import com.bsth.service.gps.entity.GpsSpeed;
  9 +import com.bsth.util.PageObject;
8 import com.google.common.base.Splitter; 10 import com.google.common.base.Splitter;
9 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
10 import org.springframework.web.bind.annotation.*; 12 import org.springframework.web.bind.annotation.*;
@@ -95,11 +97,12 @@ public class GpsController { @@ -95,11 +97,12 @@ public class GpsController {
95 97
96 /** 98 /**
97 * gps补全 99 * gps补全
  100 + * type 0 : 实时GPS 1:走补传
98 * @return 101 * @return
99 */ 102 */
100 @RequestMapping(value = "/gpsCompletion", method = RequestMethod.POST) 103 @RequestMapping(value = "/gpsCompletion", method = RequestMethod.POST)
101 - public Map<String, Object> gpsCompletion(@RequestParam long schId) {  
102 - return gpsService.gpsCompletion(schId); 104 + public Map<String, Object> gpsCompletion(@RequestParam long schId, @RequestParam int type) {
  105 + return gpsService.gpsCompletion(schId, type);
103 } 106 }
104 107
105 /** 108 /**
@@ -191,4 +194,13 @@ public class GpsController { @@ -191,4 +194,13 @@ public class GpsController {
191 return listGpsSpeed; 194 return listGpsSpeed;
192 } 195 }
193 196
  197 + @RequestMapping(value = "/pagequery",method = RequestMethod.GET)
  198 + public PageObject<GpsSpeed> pagequery(@RequestParam Map<String, Object> map){
  199 + PageObject<GpsSpeed> pageObject = null;
  200 + map.put("curPage", map.get("page").toString());
  201 + map.put("pageData","10");
  202 + pageObject=gpsService.Pagequery(map);
  203 + return pageObject;
  204 + }
  205 +
194 } 206 }
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON; @@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON;
4 import com.alibaba.fastjson.serializer.PropertyFilter; 4 import com.alibaba.fastjson.serializer.PropertyFilter;
5 import com.bsth.common.ResponseCode; 5 import com.bsth.common.ResponseCode;
6 import com.bsth.data.BasicData; 6 import com.bsth.data.BasicData;
  7 +import com.bsth.data.Station2ParkBuffer;
7 import com.bsth.entity.Line; 8 import com.bsth.entity.Line;
  9 +import com.bsth.entity.realcontrol.StationToPark;
8 import com.google.common.base.Splitter; 10 import com.google.common.base.Splitter;
9 import com.google.common.collect.ArrayListMultimap; 11 import com.google.common.collect.ArrayListMultimap;
10 import com.google.common.collect.BiMap; 12 import com.google.common.collect.BiMap;
@@ -29,6 +31,9 @@ public class BasicDataController { @@ -29,6 +31,9 @@ public class BasicDataController {
29 BasicData basicData; 31 BasicData basicData;
30 32
31 Logger logger = LoggerFactory.getLogger(this.getClass()); 33 Logger logger = LoggerFactory.getLogger(this.getClass());
  34 +
  35 + @Autowired
  36 + Station2ParkBuffer station2ParkBuffer;
32 37
33 @RequestMapping("/cars") 38 @RequestMapping("/cars")
34 public Iterable<String> findAllNbbm(Map<String, Object> map){ 39 public Iterable<String> findAllNbbm(Map<String, Object> map){
@@ -180,4 +185,25 @@ public class BasicDataController { @@ -180,4 +185,25 @@ public class BasicDataController {
180 185
181 return rs; 186 return rs;
182 } 187 }
  188 +
  189 + /**
  190 + * 获取站点和停车场对照表
  191 + * @param idx
  192 + * @return
  193 + */
  194 + @RequestMapping("/station2ParkData")
  195 + public Map<String, Collection<StationToPark>> findStation2ParkData(@RequestParam String idx){
  196 + List<String> lines = Splitter.on(",").splitToList(idx);
  197 + ArrayListMultimap<String, StationToPark> rs = ArrayListMultimap.create();
  198 +
  199 + for(String lineCode : lines){
  200 + rs.putAll(lineCode, Station2ParkBuffer.get(lineCode));
  201 + }
  202 + return rs.asMap();
  203 + }
  204 +
  205 + @RequestMapping(value = "/deleteStation2Park", method = RequestMethod.POST)
  206 + public Map<String, Object> deleteStation2Park(@RequestParam String lineCode,@RequestParam Integer id){
  207 + return station2ParkBuffer.delete(lineCode, id);
  208 + }
183 } 209 }
src/main/java/com/bsth/controller/schedule/TrafficManageController.java
@@ -8,8 +8,6 @@ import org.springframework.web.bind.annotation.RequestMethod; @@ -8,8 +8,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
8 import org.springframework.web.bind.annotation.RequestParam; 8 import org.springframework.web.bind.annotation.RequestParam;
9 import org.springframework.web.bind.annotation.RestController; 9 import org.springframework.web.bind.annotation.RestController;
10 10
11 -import java.util.Map;  
12 -  
13 /** 11 /**
14 * 12 *
15 * @author BSTH 13 * @author BSTH
@@ -24,9 +22,9 @@ public class TrafficManageController { @@ -24,9 +22,9 @@ public class TrafficManageController {
24 22
25 23
26 @RequestMapping(value = "/setXL", method = RequestMethod.GET) 24 @RequestMapping(value = "/setXL", method = RequestMethod.GET)
27 - public String setXL(@RequestParam Map<String, Object> param) throws Exception { 25 + public String setXL(@RequestParam("ids") String ids) throws Exception {
28 try { 26 try {
29 - return trManageService.setXL(param); 27 + return trManageService.setXL(ids);
30 } catch (Exception exp) { 28 } catch (Exception exp) {
31 throw new Exception(exp.getCause()); 29 throw new Exception(exp.getCause());
32 } 30 }
src/main/java/com/bsth/data/BasicData.java
@@ -134,6 +134,9 @@ public class BasicData implements CommandLineRunner { @@ -134,6 +134,9 @@ public class BasicData implements CommandLineRunner {
134 @Autowired 134 @Autowired
135 GeoCacheData geoCacheData; 135 GeoCacheData geoCacheData;
136 136
  137 + @Autowired
  138 + Station2ParkBuffer station2ParkBuffer;
  139 +
137 140
138 @Override 141 @Override
139 public void run() { 142 public void run() {
@@ -160,6 +163,7 @@ public class BasicData implements CommandLineRunner { @@ -160,6 +163,7 @@ public class BasicData implements CommandLineRunner {
160 loadBusinessInfo(); 163 loadBusinessInfo();
161 164
162 geoCacheData.loadData(); 165 geoCacheData.loadData();
  166 + station2ParkBuffer.saveAll();
163 logger.info("加载基础数据成功!,"); 167 logger.info("加载基础数据成功!,");
164 } catch (Exception e) { 168 } catch (Exception e) {
165 logger.error("加载基础数据时出现异常,", e); 169 logger.error("加载基础数据时出现异常,", e);
src/main/java/com/bsth/data/Station2ParkBuffer.java 0 → 100644
  1 +package com.bsth.data;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.entity.realcontrol.ChildTaskPlan;
  5 +import com.bsth.entity.realcontrol.StationToPark;
  6 +import com.bsth.repository.realcontrol.StationToParkRepository;
  7 +import com.bsth.util.Arith;
  8 +import com.google.common.collect.ArrayListMultimap;
  9 +import org.joda.time.format.DateTimeFormat;
  10 +import org.joda.time.format.DateTimeFormatter;
  11 +import org.slf4j.Logger;
  12 +import org.slf4j.LoggerFactory;
  13 +import org.springframework.beans.factory.annotation.Autowired;
  14 +import org.springframework.boot.CommandLineRunner;
  15 +import org.springframework.stereotype.Component;
  16 +
  17 +import java.util.*;
  18 +
  19 +/**
  20 + * 站到场 历时、公里 数据缓存
  21 + * Created by panzhao on 2017/7/10.
  22 + */
  23 +@Component
  24 +public class Station2ParkBuffer implements CommandLineRunner {
  25 +
  26 + @Autowired
  27 + StationToParkRepository stationToParkRepository;
  28 +
  29 + private static ArrayListMultimap listMultimap;
  30 +
  31 + private static Set<StationToPark> pstBuff;
  32 +
  33 + static Logger log = LoggerFactory.getLogger(Station2ParkBuffer.class);
  34 +
  35 + @Override
  36 + public void run(String... strings) throws Exception {
  37 + listMultimap = ArrayListMultimap.create();
  38 + pstBuff = new HashSet<>();
  39 + Iterator<StationToPark> iterator = stationToParkRepository.findAll().iterator();
  40 + StationToPark stp;
  41 + while (iterator.hasNext()) {
  42 + stp = iterator.next();
  43 + listMultimap.put(stp.getLineCode(), stp);
  44 + }
  45 + }
  46 +
  47 + public static List<StationToPark> get(String lineCode) {
  48 + return listMultimap.get(lineCode);
  49 + }
  50 +
  51 + public static StationToPark get(String lineCode, String sName, String eName) {
  52 + List<StationToPark> list = get(lineCode);
  53 + StationToPark stp = null;
  54 + for (StationToPark s : list) {
  55 + if (s.getStationName().equals(sName) && s.getParkName().equals(eName)) {
  56 + stp = s;
  57 + break;
  58 + }
  59 + }
  60 + return stp;
  61 + }
  62 +
  63 + private static DateTimeFormatter fmtHHmm = DateTimeFormat.forPattern("HH:mm");
  64 +
  65 + public static void put(ChildTaskPlan ctask) {
  66 + try{
  67 + String type2 = ctask.getType2();
  68 + String lineCode = ctask.getSchedule().getXlBm(), sName, eName;
  69 +
  70 + if (type2.equals("2")) {
  71 + sName = ctask.getStartStationName();
  72 + eName = ctask.getEndStationName();
  73 + } else if (type2.equals("3")) {
  74 + eName = ctask.getStartStationName();
  75 + sName = ctask.getEndStationName();
  76 + } else
  77 + return;
  78 +
  79 + Float time = calcMinute(ctask);
  80 + Float mileage = ctask.getMileage();
  81 +
  82 + StationToPark stp = get(lineCode, sName, eName);
  83 + if (stp == null) {
  84 + stp = new StationToPark();
  85 + stp.setLineCode(lineCode);
  86 + stp.setStationName(sName);
  87 + stp.setParkName(eName);
  88 + listMultimap.put(lineCode, stp);
  89 + }
  90 +
  91 + if (type2.equals("2")) {
  92 + stp.setTime1(time);
  93 + stp.setMileage1(mileage);
  94 + } else {
  95 + stp.setTime2(time);
  96 + stp.setMileage2(mileage);
  97 + }
  98 +
  99 + pstBuff.add(stp);
  100 + }catch (Exception e){
  101 + log.error("", e);
  102 + }
  103 + }
  104 +
  105 + public static Float calcMinute(ChildTaskPlan ctask) {
  106 + long t = 0;
  107 +
  108 + try {
  109 + long st = fmtHHmm.parseMillis(ctask.getStartDate());
  110 + long et = fmtHHmm.parseMillis(ctask.getEndDate());
  111 +
  112 + t = et - st;
  113 + } catch (Exception e) {
  114 + e.printStackTrace();
  115 + }
  116 + return Float.parseFloat(String.valueOf(Arith.div(Arith.div(t, 1000), 60)));
  117 + }
  118 +
  119 + public void saveAll(){
  120 + if(pstBuff.size()==0)
  121 + return;
  122 + Set<StationToPark> pstBuffCopy = pstBuff;
  123 + pstBuff = new HashSet<>();
  124 + //持久化到数据库
  125 + stationToParkRepository.save(pstBuffCopy);
  126 + }
  127 +
  128 + public Map<String, Object> delete(String lineCode, Integer id) {
  129 + Map<String, Object> rs = new HashMap<>();
  130 + try {
  131 + List<StationToPark> list = listMultimap.get(lineCode);
  132 +
  133 + StationToPark stp = null;
  134 + for(StationToPark temp : list){
  135 + if(temp.getId().equals(id)){
  136 + stp=temp;
  137 + break;
  138 + }
  139 + }
  140 +
  141 + if(stp != null){
  142 + listMultimap.remove(lineCode, stp);
  143 + stationToParkRepository.delete(id);
  144 + rs.put("status", ResponseCode.SUCCESS);
  145 + }
  146 + else{
  147 + rs.put("status", ResponseCode.SUCCESS);
  148 + rs.put("msg", "操作失败,可能数据已经被删除!");
  149 + }
  150 +
  151 + }catch (Exception e){
  152 + rs.put("status", ResponseCode.ERROR);
  153 + rs.put("msg", e.getMessage());
  154 + log.error("", e);
  155 + }
  156 + return rs;
  157 + }
  158 +}
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
@@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware {
84 Calendar calendar = Calendar.getInstance(); 84 Calendar calendar = Calendar.getInstance();
85 int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); 85 int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR);
86 86
87 - String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=173";// + dayOfYear; 87 + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=" + dayOfYear;
88 JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); 88 JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource());
89 89
90 List<GpsEntity> list = 90 List<GpsEntity> list =
src/main/java/com/bsth/data/pilot80/PilotReport.java
@@ -2,7 +2,6 @@ package com.bsth.data.pilot80; @@ -2,7 +2,6 @@ package com.bsth.data.pilot80;
2 2
3 import com.bsth.data.BasicData; 3 import com.bsth.data.BasicData;
4 import com.bsth.data.LineConfigData; 4 import com.bsth.data.LineConfigData;
5 -import com.bsth.data.gpsdata.GpsEntity;  
6 import com.bsth.data.gpsdata.GpsRealData; 5 import com.bsth.data.gpsdata.GpsRealData;
7 import com.bsth.data.msg_queue.DirectivePushQueue; 6 import com.bsth.data.msg_queue.DirectivePushQueue;
8 import com.bsth.data.schedule.DayOfSchedule; 7 import com.bsth.data.schedule.DayOfSchedule;
@@ -16,7 +15,6 @@ import com.bsth.repository.directive.D80Repository; @@ -16,7 +15,6 @@ import com.bsth.repository.directive.D80Repository;
16 import com.bsth.repository.directive.DC0A4Repository; 15 import com.bsth.repository.directive.DC0A4Repository;
17 import com.bsth.service.directive.DirectiveService; 16 import com.bsth.service.directive.DirectiveService;
18 import com.bsth.websocket.handler.SendUtils; 17 import com.bsth.websocket.handler.SendUtils;
19 -import com.google.common.collect.ArrayListMultimap;  
20 import org.apache.commons.lang3.StringUtils; 18 import org.apache.commons.lang3.StringUtils;
21 import org.slf4j.Logger; 19 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory; 20 import org.slf4j.LoggerFactory;
@@ -26,289 +24,278 @@ import org.springframework.stereotype.Component; @@ -26,289 +24,278 @@ import org.springframework.stereotype.Component;
26 import java.util.ArrayList; 24 import java.util.ArrayList;
27 import java.util.Collection; 25 import java.util.Collection;
28 import java.util.List; 26 import java.util.List;
  27 +import java.util.concurrent.ConcurrentHashMap;
29 28
30 /** 29 /**
31 - *  
32 - * @ClassName: PilotReport  
33 - * @Description: TODO(设备80协议上报处理)  
34 * @author PanZhao 30 * @author PanZhao
35 - * @date 2016年8月14日 下午11:37:51  
36 - * 31 + * @ClassName: PilotReport
  32 + * @Description: TODO(设备80协议上报处理)
  33 + * @date 2016年8月14日 下午11:37:51
37 */ 34 */
38 @Component 35 @Component
39 public class PilotReport { 36 public class PilotReport {
40 -  
41 - @Autowired  
42 - D80Repository d80Repository;  
43 - @Autowired  
44 - DayOfSchedule dayOfSchedule;  
45 - @Autowired  
46 - LineConfigData lineConfigData;  
47 - @Autowired  
48 - DirectiveService directiveService;  
49 - @Autowired  
50 - GpsRealData gpsRealData;  
51 - @Autowired  
52 - SendUtils sendUtils;  
53 -  
54 - @Autowired  
55 - DC0A4Repository dc0A4Repository;  
56 -  
57 - private static ArrayListMultimap<String, D80> d80MultiMap;  
58 -  
59 - Logger logger = LoggerFactory.getLogger(PilotReport.class);  
60 -  
61 - static{  
62 - d80MultiMap = ArrayListMultimap.create();  
63 - }  
64 -  
65 - public void report(D80 d80){  
66 - //入库  
67 - d80Repository.save(d80);  
68 - //入缓存  
69 - d80MultiMap.put(d80.getData().getLineId().toString(), d80);  
70 -  
71 - String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());  
72 - //处理  
73 - switch (d80.getData().getRequestCode()) {  
74 - case 0xA3:  
75 - //出场请求  
76 - ScheduleRealInfo outSch = dayOfSchedule.searchNearByBcType(nbbm, "out");  
77 - //如果有对应出场班次  
78 - if(outSch != null){  
79 - //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令  
80 - if(outSch.getJhlc() == null)  
81 - outSch = dayOfSchedule.next(outSch);  
82 -  
83 - //下发调度指令  
84 - DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统");  
85 - //directiveService.send60Dispatch(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统");  
86 - //下发线路切换指令  
87 - DirectivePushQueue.put64(outSch.getClZbh(), outSch.getXlBm(), "请出@系统");  
88 - //directiveService.lineChange(outSch.getClZbh(), outSch.getXlBm(), "请出@系统");  
89 - }else  
90 - d80.setRemarks("没有出场计划");  
91 -  
92 - break;  
93 -  
94 - case 0xA5:  
95 - //进场请求  
96 - //ScheduleRealInfo inSch = dayOfSchedule.nextByBcType(nbbm, "in");  
97 - //如果有对应出场班次  
98 - //if(inSch != null){  
99 - /*d80.setRemarks("计划进场时间:" + inSch.getDfsj());  
100 - //当前GPS位置  
101 - GpsEntity gps = gpsRealData.get(d80.getDeviceId());  
102 - if(null != gps)  
103 - d80.addRemarks("<br> 位置:" + coordHtmlStr(gps));*/  
104 - //}/*else  
105 - // d80.setRemarks("没有进场计划");*/  
106 - break;  
107 - }  
108 -  
109 - //推送到页面  
110 - sendUtils.send80ToPage(d80);  
111 - }  
112 -  
113 - public void report(DC0_A4 c0a4){  
114 - String deviceId = c0a4.getData().getDeviceId();  
115 - if(StringUtils.isNotEmpty(deviceId))  
116 - c0a4.setId(deviceId);  
117 -  
118 - //入库  
119 - dc0A4Repository.save(c0a4);  
120 - }  
121 -  
122 - /**  
123 - *  
124 - * @Title: reply  
125 - * @Description: TODO(调度员回复)  
126 - */  
127 - public void reply(D80 d80){  
128 - String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());  
129 - Short reqCode = d80.getData().getRequestCode();  
130 - //默认短语回复  
131 - //defaultReply(nbbm, reqCode, d80.getConfirmRs() == 0?true:false);  
132 -  
133 - switch (reqCode) {  
134 - case 0xA3:  
135 - //出场请求回复  
136 - applyOutReply(d80);  
137 - break;  
138 - case 0xA5:  
139 - //进场请求回复  
140 - applyInReply(d80);  
141 - break;  
142 - }  
143 - }  
144 -  
145 - /**  
146 - *  
147 - * @Title: applyOutReply  
148 - * @Description: TODO(出场请求回复)  
149 - */  
150 - public void applyOutReply(D80 d80){  
151 - //同意  
152 - if(d80.getConfirmRs() == 0){  
153 - String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());  
154 -  
155 - ScheduleRealInfo sch = dayOfSchedule.nextByBcType(nbbm, "out");  
156 - if(null == sch)  
157 - return;  
158 -  
159 - LineConfig conf = lineConfigData.get(sch.getXlBm());  
160 - if(conf.getOutConfig() == 1){  
161 - //为相关班次写入请求出场时间  
162 - sch.setFcsjActualAll(d80.getTimestamp());  
163 -  
164 - dayOfSchedule.save(sch);  
165 - //通知页面  
166 - sendUtils.refreshSch(sch);  
167 - }  
168 - }  
169 - }  
170 -  
171 - /**  
172 - *  
173 - * @Title: applyInReply  
174 - * @Description: TODO(进场请求回复)  
175 - */  
176 - public void applyInReply(D80 d80){  
177 - //同意  
178 - if(d80.getConfirmRs() == 0){  
179 - String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());  
180 -  
181 - ScheduleRealInfo sch = dayOfSchedule.nextByBcType(nbbm, "in");  
182 - if(null == sch)  
183 - return;  
184 -  
185 - LineConfig conf = lineConfigData.get(sch.getXlBm());  
186 - if(conf.getOutConfig() == 1){  
187 - //为相关班次写入进场时间  
188 - sch.setZdsjActualAll(d80.getTimestamp());  
189 -  
190 - //没有里程的进场班次  
191 - if(isEmpty(sch.getBcsj()) && isEmpty(sch.getJhlc()))  
192 - sch.setFcsjActualAll(d80.getTimestamp());  
193 -  
194 - dayOfSchedule.save(sch);  
195 - //通知页面  
196 - sendUtils.refreshSch(sch);  
197 - }  
198 - }  
199 - }  
200 -  
201 - public boolean isEmpty(Integer v){  
202 - return v == null || v.equals(0);  
203 - }  
204 -  
205 - public boolean isEmpty(Double v){  
206 - return v == null || v.equals(0);  
207 - }  
208 -  
209 - public void defaultReply(String nbbm, short requestCode, boolean agree){  
210 - Line line = BasicData.nbbm2LineMap.get(nbbm);  
211 - String lineCode = null;  
212 -  
213 - if(line != null)  
214 - lineCode = line.getLineCode();  
215 - else{  
216 - try{  
217 - lineCode = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm)).getLineId().toString();  
218 - }catch(Exception e){  
219 - logger.error("", e);  
220 - }  
221 - }  
222 -  
223 - if(null == lineCode)  
224 - return;  
225 -  
226 - LineConfig conf = lineConfigData.get(lineCode);  
227 - D80ReplyTemp temp = conf.findByCode(requestCode);  
228 -  
229 - if(null == temp)  
230 - return;  
231 -  
232 - String text;  
233 - if(agree)  
234 - text = temp.getAgreeText();  
235 - else  
236 - text = temp.getRejectText();  
237 -  
238 - directiveService.send60Phrase(nbbm, text, "系统");  
239 - }  
240 -  
241 - /**  
242 - *  
243 - * @Title: resumeOperation  
244 - * @Description: TODO(恢复营运)  
245 - */  
246 - public void resumeOperation(D80 d80){  
247 -  
248 - }  
249 -  
250 - /**  
251 - *  
252 - * @Title: applyTiaodang  
253 - * @Description: TODO(申请调档)  
254 - */  
255 - public void applyTiaodang(D80 d80){  
256 -  
257 - }  
258 -  
259 - /**  
260 - *  
261 - * @Title: unconfirmed80  
262 - * @Description: TODO(根据lineCode 获取未处理的80数据)  
263 - */  
264 - public List<D80> unconfirmed80(Integer lineCode){  
265 - List<D80> lineAll = d80MultiMap.get(lineCode.toString())  
266 - ,rs = new ArrayList<>();  
267 -  
268 - for(D80 d80 : lineAll)  
269 - if(!d80.isConfirm())  
270 - rs.add(d80);  
271 -  
272 - return rs;  
273 - }  
274 -  
275 - public D80 findById(int id){  
276 - Collection<D80> all = d80MultiMap.values();  
277 -  
278 - for(D80 d80 : all){  
279 - if(d80.getId() == id)  
280 - return d80;  
281 - }  
282 -  
283 - return null;  
284 - }  
285 -  
286 - public String coordHtmlStr(GpsEntity gps){  
287 -  
288 - return "<span class=\"nt-coord\" data-lon=\""+gps.getLon()+"\" data-lat=\""+gps.getLat()+"\"></span>";  
289 - }  
290 -  
291 - public Collection<D80> findAll(){  
292 - return d80MultiMap.values();  
293 - }  
294 -  
295 - public void clear(String lineCode){  
296 - logger.info("清除 80数据 before: " + d80MultiMap.size());  
297 - d80MultiMap.removeAll(lineCode);  
298 - logger.info("清除 80数据 after: " + d80MultiMap.size());  
299 - }  
300 -  
301 - public Collection<? extends D80> findByCar(String nbbm) {  
302 - List<D80> rs = new ArrayList<>();  
303 - String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm);  
304 - if(null == deviceId)  
305 - return rs;  
306 -  
307 - Collection<D80> all = findAll();  
308 - for(D80 d80 : all){  
309 - if(d80.getDeviceId().equals(deviceId))  
310 - rs.add(d80);  
311 - }  
312 - return rs;  
313 - } 37 +
  38 + @Autowired
  39 + D80Repository d80Repository;
  40 + @Autowired
  41 + DayOfSchedule dayOfSchedule;
  42 + @Autowired
  43 + LineConfigData lineConfigData;
  44 + @Autowired
  45 + DirectiveService directiveService;
  46 + @Autowired
  47 + GpsRealData gpsRealData;
  48 + @Autowired
  49 + SendUtils sendUtils;
  50 +
  51 + @Autowired
  52 + DC0A4Repository dc0A4Repository;
  53 +
  54 + //private static ArrayListMultimap<String, D80> d80MultiMap;
  55 +
  56 + private static ConcurrentHashMap<Integer, D80> d80Maps;
  57 +
  58 + Logger logger = LoggerFactory.getLogger(PilotReport.class);
  59 +
  60 + static {
  61 + //d80MultiMap = ArrayListMultimap.create();
  62 + d80Maps = new ConcurrentHashMap<>();
  63 + }
  64 +
  65 + public void report(D80 d80) {
  66 + if (d80 == null)
  67 + return;
  68 + try {
  69 + //入库
  70 + d80Repository.save(d80);
  71 + //入缓存
  72 + d80Maps.put(d80.getId(), d80);
  73 + //d80MultiMap.put(d80.getData().getLineId().toString(), d80);
  74 +
  75 + String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());
  76 + //处理
  77 + switch (d80.getData().getRequestCode()) {
  78 + //出场请求
  79 + case 0xA3:
  80 + ScheduleRealInfo outSch = dayOfSchedule.searchNearByBcType(nbbm, "out");
  81 + //如果有对应出场班次
  82 + if (outSch != null) {
  83 + //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令
  84 + if (outSch.getJhlc() == null)
  85 + outSch = dayOfSchedule.next(outSch);
  86 +
  87 + //下发调度指令
  88 + DirectivePushQueue.put6002(outSch, dayOfSchedule.doneSum(nbbm), "请出@系统");
  89 + //下发线路切换指令
  90 + DirectivePushQueue.put64(outSch.getClZbh(), outSch.getXlBm(), "请出@系统");
  91 + }
  92 + break;
  93 + }
  94 +
  95 + //推送到页面
  96 + sendUtils.send80ToPage(d80);
  97 + } catch (Exception e) {
  98 + logger.error("", e);
  99 + }
  100 + }
  101 +
  102 + public void report(DC0_A4 c0a4) {
  103 + String deviceId = c0a4.getData().getDeviceId();
  104 + if (StringUtils.isNotEmpty(deviceId))
  105 + c0a4.setId(deviceId);
  106 +
  107 + //入库
  108 + dc0A4Repository.save(c0a4);
  109 + }
  110 +
  111 + /**
  112 + * @Title: reply
  113 + * @Description: TODO(调度员回复)
  114 + */
  115 + public void reply(D80 d80) {
  116 + String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());
  117 + Short reqCode = d80.getData().getRequestCode();
  118 + //默认短语回复
  119 + //defaultReply(nbbm, reqCode, d80.getConfirmRs() == 0?true:false);
  120 +
  121 + switch (reqCode) {
  122 + case 0xA3:
  123 + //出场请求回复
  124 + applyOutReply(d80);
  125 + break;
  126 + case 0xA5:
  127 + //进场请求回复
  128 + applyInReply(d80);
  129 + break;
  130 + }
  131 + }
  132 +
  133 + /**
  134 + * @Title: applyOutReply
  135 + * @Description: TODO(出场请求回复)
  136 + */
  137 + public void applyOutReply(D80 d80) {
  138 + //同意
  139 + if (d80.getConfirmRs() == 0) {
  140 + String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());
  141 +
  142 + ScheduleRealInfo sch = dayOfSchedule.nextByBcType(nbbm, "out");
  143 + if (null == sch)
  144 + return;
  145 +
  146 + LineConfig conf = lineConfigData.get(sch.getXlBm());
  147 + if (conf.getOutConfig() == 1) {
  148 + //为相关班次写入请求出场时间
  149 + sch.setFcsjActualAll(d80.getTimestamp());
  150 +
  151 + dayOfSchedule.save(sch);
  152 + //通知页面
  153 + sendUtils.refreshSch(sch);
  154 + }
  155 + }
  156 + }
  157 +
  158 + /**
  159 + * @Title: applyInReply
  160 + * @Description: TODO(进场请求回复)
  161 + */
  162 + public void applyInReply(D80 d80) {
  163 + //同意
  164 + if (d80.getConfirmRs() == 0) {
  165 + String nbbm = BasicData.deviceId2NbbmMap.get(d80.getDeviceId());
  166 +
  167 + ScheduleRealInfo sch = dayOfSchedule.nextByBcType(nbbm, "in");
  168 + if (null == sch)
  169 + return;
  170 +
  171 + LineConfig conf = lineConfigData.get(sch.getXlBm());
  172 + if (conf.getOutConfig() == 1) {
  173 + //为相关班次写入进场时间
  174 + sch.setZdsjActualAll(d80.getTimestamp());
  175 +
  176 + //没有里程的进场班次
  177 + if (isEmpty(sch.getBcsj()) && isEmpty(sch.getJhlc()))
  178 + sch.setFcsjActualAll(d80.getTimestamp());
  179 +
  180 + dayOfSchedule.save(sch);
  181 + //通知页面
  182 + sendUtils.refreshSch(sch);
  183 + }
  184 + }
  185 + }
  186 +
  187 + public boolean isEmpty(Integer v) {
  188 + return v == null || v.equals(0);
  189 + }
  190 +
  191 + public boolean isEmpty(Double v) {
  192 + return v == null || v.equals(0);
  193 + }
  194 +
  195 + public void defaultReply(String nbbm, short requestCode, boolean agree) {
  196 + Line line = BasicData.nbbm2LineMap.get(nbbm);
  197 + String lineCode = null;
  198 +
  199 + if (line != null)
  200 + lineCode = line.getLineCode();
  201 + else {
  202 + try {
  203 + lineCode = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm)).getLineId().toString();
  204 + } catch (Exception e) {
  205 + logger.error("", e);
  206 + }
  207 + }
  208 +
  209 + if (null == lineCode)
  210 + return;
  211 +
  212 + LineConfig conf = lineConfigData.get(lineCode);
  213 + D80ReplyTemp temp = conf.findByCode(requestCode);
  214 +
  215 + if (null == temp)
  216 + return;
  217 +
  218 + String text;
  219 + if (agree)
  220 + text = temp.getAgreeText();
  221 + else
  222 + text = temp.getRejectText();
  223 +
  224 + directiveService.send60Phrase(nbbm, text, "系统");
  225 + }
  226 +
  227 + /**
  228 + * @Title: resumeOperation
  229 + * @Description: TODO(恢复营运)
  230 + */
  231 + public void resumeOperation(D80 d80) {
  232 +
  233 + }
  234 +
  235 + /**
  236 + * @Title: applyTiaodang
  237 + * @Description: TODO(申请调档)
  238 + */
  239 + public void applyTiaodang(D80 d80) {
  240 +
  241 + }
  242 +
  243 + /**
  244 + * @Title: unconfirmed80
  245 + * @Description: TODO(根据lineCode 获取未处理的80数据)
  246 + */
  247 + public List<D80> unconfirmed80(String lineCode) {
  248 + List<D80> lineAll = findByLine(lineCode), rs = new ArrayList<>();
  249 +
  250 + for (D80 d80 : lineAll)
  251 + if (!d80.isConfirm())
  252 + rs.add(d80);
  253 +
  254 + return rs;
  255 + }
  256 +
  257 + public List<D80> findByLine(String lineCode) {
  258 + List<D80> rs = new ArrayList<>();
  259 + for (D80 d80 : d80Maps.values()) {
  260 + if (d80 != null && d80.getData().getLineId().equals(lineCode))
  261 + rs.add(d80);
  262 + }
  263 + return rs;
  264 + }
  265 +
  266 + public D80 findById(int id) {
  267 + return d80Maps.get(id);
  268 + }
  269 +
  270 +/* public String coordHtmlStr(GpsEntity gps) {
  271 +
  272 + return "<span class=\"nt-coord\" data-lon=\"" + gps.getLon() + "\" data-lat=\"" + gps.getLat() + "\"></span>";
  273 + }*/
  274 +
  275 + public Collection<D80> findAll() {
  276 + return d80Maps.values();
  277 + }
  278 +
  279 + public void clear(String lineCode) {
  280 + logger.info("清除 80数据 before: " + d80Maps.size());
  281 + List<D80> rems = findByLine(lineCode);
  282 + for (D80 d80 : rems) {
  283 + d80Maps.remove(d80.getId());
  284 + }
  285 + logger.info("清除 80数据 after: " + d80Maps.size());
  286 + }
  287 +
  288 + public Collection<? extends D80> findByCar(String nbbm) {
  289 + List<D80> rs = new ArrayList<>();
  290 + String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  291 + if (null == deviceId)
  292 + return rs;
  293 +
  294 + Collection<D80> all = findAll();
  295 + for (D80 d80 : all) {
  296 + if (d80.getDeviceId().equals(deviceId))
  297 + rs.add(d80);
  298 + }
  299 + return rs;
  300 + }
314 } 301 }
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -944,6 +944,8 @@ public class DayOfSchedule { @@ -944,6 +944,8 @@ public class DayOfSchedule {
944 ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list); 944 ScheduleRealInfo sch = schAttrCalculator.calcCurrentExecSch(list);
945 carExecutePlanMap.put(nbbm, sch); 945 carExecutePlanMap.put(nbbm, sch);
946 946
  947 + if(sch==null)
  948 + return;
947 try { 949 try {
948 GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm)); 950 GpsEntity gps = gpsRealData.get(BasicData.deviceId2NbbmMap.inverse().get(nbbm));
949 if(gps != null && gps.isOnline()){ 951 if(gps != null && gps.isOnline()){
src/main/java/com/bsth/data/schedule/edit_logs/ScheduleModifyLogger.java
@@ -231,4 +231,20 @@ public class ScheduleModifyLogger { @@ -231,4 +231,20 @@ public class ScheduleModifyLogger {
231 public static void put(SchEditInfo sei) { 231 public static void put(SchEditInfo sei) {
232 list.add(sei); 232 list.add(sei);
233 } 233 }
  234 +
  235 + public static void afterEdit(ScheduleRealInfo sch, String remarks, JSONArray jsonArray) {
  236 + try {
  237 + if (jsonArray == null || jsonArray.size() == 0)
  238 + return;
  239 +
  240 + SchEditInfo sei = SchEditInfo.getInstance(sch);
  241 + sei.setRemarks(remarks);
  242 + sei.setJsonArray(jsonArray.toJSONString());
  243 + sei.setType(EditType.LSBCTZ);
  244 +
  245 + put(sei);
  246 + } catch (Exception e) {
  247 + log.error("", e);
  248 + }
  249 + }
234 } 250 }
src/main/java/com/bsth/data/schedule/edit_logs/entity/EditType.java
@@ -5,5 +5,5 @@ package com.bsth.data.schedule.edit_logs.entity; @@ -5,5 +5,5 @@ package com.bsth.data.schedule.edit_logs.entity;
5 */ 5 */
6 public enum EditType { 6 public enum EditType {
7 7
8 - DFTZ,SFTZ,FCXXWT,TZRC,LPDD,ZRW,JHLB,CXLB, CXSF, CXZX 8 + DFTZ,SFTZ,FCXXWT,TZRC,LPDD,ZRW,JHLB,CXLB, CXSF, LSBCTZ, CXZX
9 } 9 }
10 \ No newline at end of file 10 \ No newline at end of file
src/main/java/com/bsth/data/schedule/edit_logs/loggers/AfterwardsLogger.java 0 → 100644
  1 +package com.bsth.data.schedule.edit_logs.loggers;
  2 +
  3 +import com.alibaba.fastjson.JSONArray;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger;
  6 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +
  10 +/**
  11 + * 事后历史班次编辑
  12 + * Created by panzhao on 2017/5/19.
  13 + */
  14 +public class AfterwardsLogger {
  15 +
  16 + static Logger log = LoggerFactory.getLogger(AfterwardsLogger.class);
  17 +
  18 + private JSONArray jsonArray = new JSONArray();
  19 + private String remarks;
  20 + private ScheduleRealInfo sch;
  21 +
  22 + public void log(String title, Object old, Object now){
  23 + try {
  24 +
  25 + JSONObject jsonObject = new JSONObject();
  26 + jsonObject.put("title", title);
  27 + jsonObject.put("old", old);
  28 + jsonObject.put("now", now);
  29 +
  30 + jsonArray.add(jsonObject);
  31 + }catch (Exception e){
  32 + log.error("", e);
  33 + }
  34 + }
  35 +
  36 + public void log(String text){
  37 + try {
  38 + JSONObject jsonObject = new JSONObject();
  39 + jsonObject.put("title", text);
  40 +
  41 + jsonArray.add(jsonObject);
  42 + }catch (Exception e){
  43 + log.error("", e);
  44 + }
  45 + }
  46 +
  47 + public static AfterwardsLogger start(ScheduleRealInfo sch, String remarks){
  48 + AfterwardsLogger fLog = new AfterwardsLogger();
  49 + fLog.setSch(sch);
  50 + fLog.setRemarks(remarks);
  51 + return fLog;
  52 + }
  53 +
  54 + public void end(){
  55 + ScheduleModifyLogger.afterEdit(sch, this.remarks, jsonArray);
  56 + }
  57 +
  58 + public String getRemarks() {
  59 + return remarks;
  60 + }
  61 +
  62 + public void setRemarks(String remarks) {
  63 + this.remarks = remarks;
  64 + }
  65 +
  66 + public ScheduleRealInfo getSch() {
  67 + return sch;
  68 + }
  69 +
  70 + public void setSch(ScheduleRealInfo sch) {
  71 + this.sch = sch;
  72 + }
  73 +}
src/main/java/com/bsth/data/schedule/edit_logs/service/SchEditInfoServiceImpl.java
@@ -41,7 +41,7 @@ public class SchEditInfoServiceImpl extends BaseServiceImpl&lt;SchEditInfo, Long&gt; i @@ -41,7 +41,7 @@ public class SchEditInfoServiceImpl extends BaseServiceImpl&lt;SchEditInfo, Long&gt; i
41 for(String k : ks){ 41 for(String k : ks){
42 v =map.get(k); 42 v =map.get(k);
43 if(StringUtils.isNotEmpty(v)) 43 if(StringUtils.isNotEmpty(v))
44 - cont += " and t2." + BatchSaveUtils.propertyToField(k) + "='" + v + "'"; 44 + cont += " and " + BatchSaveUtils.propertyToField(k) + "='" + v + "'";
45 } 45 }
46 String sql = "select t1.*, t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name,t2.xl_dir,t2.real_exec_date from (select * from logger_sch_modify where rq=? and line_code=? ) t1 INNER JOIN bsth_c_s_sp_info_real t2 on t1.sch_id=t2.id where 1=1 " + cont; 46 String sql = "select t1.*, t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name,t2.xl_dir,t2.real_exec_date from (select * from logger_sch_modify where rq=? and line_code=? ) t1 INNER JOIN bsth_c_s_sp_info_real t2 on t1.sch_id=t2.id where 1=1 " + cont;
47 47
src/main/java/com/bsth/data/utils/CustomStringUtils.java 0 → 100644
  1 +package com.bsth.data.utils;
  2 +
  3 +import org.apache.commons.lang3.StringUtils;
  4 +
  5 +/**
  6 + * Created by panzhao on 2017/7/10.
  7 + */
  8 +public class CustomStringUtils {
  9 +
  10 + public static boolean equals(String s1, String s2){
  11 + if(s1 == null){
  12 + if(StringUtils.isNotEmpty(s2))
  13 + return false;
  14 + else
  15 + return true;
  16 + }
  17 + return s1.equals(s2);
  18 + }
  19 +}
src/main/java/com/bsth/entity/directive/D80.java
1 package com.bsth.entity.directive; 1 package com.bsth.entity.directive;
2 2
3 -import java.util.Date;  
4 -  
5 -import javax.persistence.CascadeType;  
6 -import javax.persistence.Embeddable;  
7 -import javax.persistence.Entity;  
8 -import javax.persistence.FetchType;  
9 -import javax.persistence.GeneratedValue;  
10 -import javax.persistence.Id;  
11 -import javax.persistence.NamedAttributeNode;  
12 -import javax.persistence.NamedEntityGraph;  
13 -import javax.persistence.NamedEntityGraphs;  
14 -import javax.persistence.OneToOne;  
15 -import javax.persistence.Table;  
16 -import javax.persistence.Transient;  
17 -  
18 import com.bsth.entity.directive.DC0.DC0Data; 3 import com.bsth.entity.directive.DC0.DC0Data;
19 4
  5 +import javax.persistence.*;
  6 +import java.util.Date;
  7 +
20 /** 8 /**
21 * 9 *
22 * @ClassName: D80 10 * @ClassName: D80
@@ -92,7 +80,7 @@ public class D80 { @@ -92,7 +80,7 @@ public class D80 {
92 /** 80 /**
93 * 线路编码 81 * 线路编码
94 */ 82 */
95 - private Integer lineId; 83 + private String lineId;
96 84
97 /** 85 /**
98 * 车辆内部编码 86 * 车辆内部编码
@@ -116,13 +104,6 @@ public class D80 { @@ -116,13 +104,6 @@ public class D80 {
116 this.requestCode = requestCode; 104 this.requestCode = requestCode;
117 } 105 }
118 106
119 - public Integer getLineId() {  
120 - return lineId;  
121 - }  
122 -  
123 - public void setLineId(Integer lineId) {  
124 - this.lineId = lineId;  
125 - }  
126 107
127 public String getNbbm() { 108 public String getNbbm() {
128 return nbbm; 109 return nbbm;
@@ -131,6 +112,14 @@ public class D80 { @@ -131,6 +112,14 @@ public class D80 {
131 public void setNbbm(String nbbm) { 112 public void setNbbm(String nbbm) {
132 this.nbbm = nbbm; 113 this.nbbm = nbbm;
133 } 114 }
  115 +
  116 + public String getLineId() {
  117 + return lineId;
  118 + }
  119 +
  120 + public void setLineId(String lineId) {
  121 + this.lineId = lineId;
  122 + }
134 } 123 }
135 124
136 @Transient 125 @Transient
src/main/java/com/bsth/entity/realcontrol/ChildTaskPlan.java
@@ -84,10 +84,25 @@ public class ChildTaskPlan { @@ -84,10 +84,25 @@ public class ChildTaskPlan {
84 private boolean destroy; 84 private boolean destroy;
85 85
86 /** 86 /**
87 - * 烂班原因 87 + * 烂班原因 -烂班时,该字段仍有值并 =reason
88 */ 88 */
89 private String destroyReason; 89 private String destroyReason;
90 90
  91 + /**
  92 + * 包括 烂班原因、进出场原因、换车原因 等
  93 + */
  94 + private String reason;
  95 +
  96 + /**
  97 + * 车辆 如果为空,继承主任务
  98 + */
  99 + private String nbbm;
  100 +
  101 + /**
  102 + * 为true 则无售票员, 否则继承主任务
  103 + */
  104 + private boolean noClerk;
  105 +
91 /** 创建日期 */ 106 /** 创建日期 */
92 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") 107 @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
93 private Date createDate; 108 private Date createDate;
@@ -238,4 +253,28 @@ public class ChildTaskPlan { @@ -238,4 +253,28 @@ public class ChildTaskPlan {
238 public void setCreateDate(Date createDate) { 253 public void setCreateDate(Date createDate) {
239 this.createDate = createDate; 254 this.createDate = createDate;
240 } 255 }
  256 +
  257 + public String getReason() {
  258 + return reason;
  259 + }
  260 +
  261 + public void setReason(String reason) {
  262 + this.reason = reason;
  263 + }
  264 +
  265 + public String getNbbm() {
  266 + return nbbm;
  267 + }
  268 +
  269 + public void setNbbm(String nbbm) {
  270 + this.nbbm = nbbm;
  271 + }
  272 +
  273 + public boolean isNoClerk() {
  274 + return noClerk;
  275 + }
  276 +
  277 + public void setNoClerk(boolean noClerk) {
  278 + this.noClerk = noClerk;
  279 + }
241 } 280 }
src/main/java/com/bsth/entity/realcontrol/StationToPark.java 0 → 100644
  1 +package com.bsth.entity.realcontrol;
  2 +
  3 +import javax.persistence.Entity;
  4 +import javax.persistence.GeneratedValue;
  5 +import javax.persistence.Id;
  6 +import javax.persistence.Table;
  7 +
  8 +/**
  9 + * 站 到 场
  10 + * Created by panzhao on 2017/7/10.
  11 + */
  12 +@Entity
  13 +@Table(name = "bsth_c_station_to_park")
  14 +public class StationToPark {
  15 +
  16 + @Id
  17 + @GeneratedValue
  18 + private Integer id;
  19 +
  20 + /** 线路编码 */
  21 + private String lineCode;
  22 +
  23 + /** 站点名称 */
  24 + private String stationName;
  25 +
  26 + /** 停车场编码 */
  27 + private String parkName;
  28 +
  29 + /** 站到场时间(分钟) */
  30 + private Float time1;
  31 +
  32 + /** 站到场公里 */
  33 + private Float mileage1;
  34 +
  35 + /** 场到站时间(分钟) */
  36 + private Float time2;
  37 +
  38 + /** 场到站公里 */
  39 + private Float mileage2;
  40 +
  41 + /** 排序字段 */
  42 + private int orderNo;
  43 +
  44 + public String getLineCode() {
  45 + return lineCode;
  46 + }
  47 +
  48 + public void setLineCode(String lineCode) {
  49 + this.lineCode = lineCode;
  50 + }
  51 +
  52 + public String getStationName() {
  53 + return stationName;
  54 + }
  55 +
  56 + public void setStationName(String stationName) {
  57 + this.stationName = stationName;
  58 + }
  59 +
  60 +
  61 + public Float getTime1() {
  62 + return time1;
  63 + }
  64 +
  65 + public void setTime1(Float time1) {
  66 + this.time1 = time1;
  67 + }
  68 +
  69 + public Float getMileage1() {
  70 + return mileage1;
  71 + }
  72 +
  73 + public void setMileage1(Float mileage1) {
  74 + this.mileage1 = mileage1;
  75 + }
  76 +
  77 + public Float getTime2() {
  78 + return time2;
  79 + }
  80 +
  81 + public void setTime2(Float time2) {
  82 + this.time2 = time2;
  83 + }
  84 +
  85 + public Float getMileage2() {
  86 + return mileage2;
  87 + }
  88 +
  89 + public void setMileage2(Float mileage2) {
  90 + this.mileage2 = mileage2;
  91 + }
  92 +
  93 + public Integer getId() {
  94 + return id;
  95 + }
  96 +
  97 + public void setId(Integer id) {
  98 + this.id = id;
  99 + }
  100 +
  101 + public int getOrderNo() {
  102 + return orderNo;
  103 + }
  104 +
  105 + public void setOrderNo(int orderNo) {
  106 + this.orderNo = orderNo;
  107 + }
  108 +
  109 + public String getParkName() {
  110 + return parkName;
  111 + }
  112 +
  113 + public void setParkName(String parkName) {
  114 + this.parkName = parkName;
  115 + }
  116 +
  117 + @Override
  118 + public int hashCode() {
  119 + return ("stp_" + this.toString()).hashCode();
  120 + }
  121 +
  122 + @Override
  123 + public boolean equals(Object obj) {
  124 + return this.toString().equals(((StationToPark)obj).toString());
  125 + }
  126 +
  127 + @Override
  128 + public String toString() {
  129 + return this.lineCode + "_" + this.getStationName() + "_" + this.getParkName();
  130 + }
  131 +}
src/main/java/com/bsth/repository/LineRepository.java
@@ -39,6 +39,6 @@ public interface LineRepository extends BaseRepository&lt;Line, Integer&gt; { @@ -39,6 +39,6 @@ public interface LineRepository extends BaseRepository&lt;Line, Integer&gt; {
39 39
40 public Line findByLineCode(String string); 40 public Line findByLineCode(String string);
41 41
42 - @Query(value = " SELECT l FROM Line l where l.company like ?1 and l.brancheCompany like ?2 and l.lineCode like ?3") 42 + @Query(value = " SELECT l FROM Line l where l.company like %?1% and l.brancheCompany like %?2% and l.lineCode like ?3")
43 public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); 43 public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line);
44 } 44 }
src/main/java/com/bsth/repository/StationRepository.java
@@ -40,10 +40,17 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; { @@ -40,10 +40,17 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; {
40 /*@Query(value = "SELECT s.b_jwpoints,s.id FROM bsth_c_station s where s.station_name like ?1" 40 /*@Query(value = "SELECT s.b_jwpoints,s.id FROM bsth_c_station s where s.station_name like ?1"
41 , nativeQuery=true) 41 , nativeQuery=true)
42 List<Object[]> findStationName(String stationName);*/ 42 List<Object[]> findStationName(String stationName);*/
43 - @Query(value = " SELECT t.b_jwpoints,t.id FROM (" + 43 + /*@Query(value = " SELECT t.b_jwpoints,t.id FROM (" +
44 " SELECT b.id,b.b_jwpoints,b.station_name,a.directions FROM (" + 44 " SELECT b.id,b.b_jwpoints,b.station_name,a.directions FROM (" +
45 " SELECT s.station,s.station_name,s.directions FROM bsth_c_stationroute s where s.destroy = 0 and s.directions = ?1) a " + 45 " SELECT s.station,s.station_name,s.directions FROM bsth_c_stationroute s where s.destroy = 0 and s.directions = ?1) a " +
46 " LEFT JOIN bsth_c_station b on a.station = b. id) t where t.station_name LIKE ?2" 46 " LEFT JOIN bsth_c_station b on a.station = b. id) t where t.station_name LIKE ?2"
  47 + , nativeQuery=true)*/
  48 + @Query(value = " SELECT t.b_jwpoints,t.id FROM (" +
  49 + " SELECT b.id,b.b_jwpoints,b.station_name,a.directions FROM (" +
  50 + " SELECT s.station,s.station_name,s.directions FROM bsth_c_stationroute s where s.destroy = 0 and s.directions = ?1) a " +
  51 + " LEFT JOIN " +
  52 + " (SELECT r.id,r.b_jwpoints,r.station_name from bsth_c_station r where r.destroy = 0 and r.station_name LIKE ?2 ) " +
  53 + " b on a.station = b. id) t where t.station_name LIKE ?2 "
47 , nativeQuery=true) 54 , nativeQuery=true)
48 List<Object[]> findStationName(Integer dir , String stationName); 55 List<Object[]> findStationName(Integer dir , String stationName);
49 56
@@ -101,18 +108,24 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; { @@ -101,18 +108,24 @@ public interface StationRepository extends BaseRepository&lt;Station, Integer&gt; {
101 "y = ?9 , " + 108 "y = ?9 , " +
102 "b_polygon_grid = ST_GeomFromText(?10) , " + 109 "b_polygon_grid = ST_GeomFromText(?10) , " +
103 "g_polygon_grid = ST_GeomFromText(?11) , " + 110 "g_polygon_grid = ST_GeomFromText(?11) , " +
104 - "destroy = ?12 , " +  
105 - "radius = ?13 , " +  
106 - "shapes_type = ?14 , " +  
107 - "versions = ?15 , " +  
108 - "descriptions = ?16 " +  
109 - " WHERE id = ?17 ", nativeQuery=true) 111 + /*"destroy = ?12 , " +*/
  112 + "radius = ?12 , " +
  113 + "shapes_type = ?13 , " +
  114 + "versions = ?14 , " +
  115 + "descriptions = ?15 " +
  116 + " WHERE id = ?16 ", nativeQuery=true)
110 public void stationUpdate(String stationCod,String stationName,String roadCoding,String dbType,String bJwpoints, 117 public void stationUpdate(String stationCod,String stationName,String roadCoding,String dbType,String bJwpoints,
  118 +
  119 + Float gLonx,Float gLaty,Float x,Float y, String bPolygonGrid,String gPolygonGrid,
  120 +
  121 + Integer radius,String shapesType, Integer versions,String descriptions,Integer stationId);
  122 +
  123 + /*public void stationUpdate(String stationCod,String stationName,String roadCoding,String dbType,String bJwpoints,
111 124
112 Float gLonx,Float gLaty,Float x,Float y, String bPolygonGrid,String gPolygonGrid, 125 Float gLonx,Float gLaty,Float x,Float y, String bPolygonGrid,String gPolygonGrid,
113 126
114 Integer destroy, Integer radius,String shapesType, Integer versions,String descriptions,Integer stationId); 127 Integer destroy, Integer radius,String shapesType, Integer versions,String descriptions,Integer stationId);
115 - 128 + */
116 129
117 @Query(value = "select st_astext(g_polygon_grid) as g_polygon_grid, shapes_type,concat(g_lonx, ' ', g_laty) as g_center_point ,radius, station_cod,station_name from bsth_c_station where station_cod=?1", nativeQuery = true) 130 @Query(value = "select st_astext(g_polygon_grid) as g_polygon_grid, shapes_type,concat(g_lonx, ' ', g_laty) as g_center_point ,radius, station_cod,station_name from bsth_c_station where station_cod=?1", nativeQuery = true)
118 public Object[][] bufferAera(String stationCode); 131 public Object[][] bufferAera(String stationCode);
src/main/java/com/bsth/repository/StationRouteRepository.java
@@ -266,7 +266,6 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int @@ -266,7 +266,6 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
266 "StationRoute s " + 266 "StationRoute s " +
267 "WHERE " + 267 "WHERE " +
268 "s.destroy = 0 " + 268 "s.destroy = 0 " +
269 - "and s.lineCode in(select lineCode from Line where inUse = 1) " +  
270 "ORDER BY " + 269 "ORDER BY " +
271 "lineCode,directions,stationRouteCode") 270 "lineCode,directions,stationRouteCode")
272 List<Map<String, String>> findAllLineWithYgc(); 271 List<Map<String, String>> findAllLineWithYgc();
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -81,7 +81,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -81,7 +81,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
81 @Query(value="select count(jName) from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and sflj != 0") 81 @Query(value="select count(jName) from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and sflj != 0")
82 int findLjbc(String jName,String clZbh,String lpName); 82 int findLjbc(String jName,String clZbh,String lpName);
83 83
84 - @Query(value="SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T'),c.inside_code FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c ON c.equipment_code = r.device_id where FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = ?2 and r.line_id = ?1 and c.inside_code like %?3%",nativeQuery=true) 84 + @Query(value="SELECT request_code,FROM_UNIXTIME(TIMESTAMP / 1000,'%Y-%m-%d %T') as TIMESTAMP ,device_id FROM bsth_v_report_80 WHERE FROM_UNIXTIME( TIMESTAMP / 1000,'%Y-%m-%d') = ?2 AND line_id = ?1 and device_id like %?3%",nativeQuery=true)
85 List<Object[]> account(String line,String date,String code); 85 List<Object[]> account(String line,String date,String code);
86 86
87 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDate >= str_to_date(?2,'%Y-%m-%d') " 87 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and s.scheduleDate >= str_to_date(?2,'%Y-%m-%d') "
src/main/java/com/bsth/repository/realcontrol/StationToParkRepository.java 0 → 100644
  1 +package com.bsth.repository.realcontrol;
  2 +
  3 +import com.bsth.entity.realcontrol.StationToPark;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +/**
  8 + * Created by panzhao on 2017/7/10.
  9 + */
  10 +@Repository
  11 +public interface StationToParkRepository extends BaseRepository<StationToPark, Integer>{
  12 +}
src/main/java/com/bsth/service/TrafficManageService.java
@@ -24,7 +24,7 @@ public interface TrafficManageService { @@ -24,7 +24,7 @@ public interface TrafficManageService {
24 * 24 *
25 * @return 调用接口返回信息 25 * @return 调用接口返回信息
26 */ 26 */
27 - String setXL(Map<String, Object> param); 27 + String setXL(String ids);
28 28
29 /** 29 /**
30 * 上传车辆信息 30 * 上传车辆信息
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
@@ -114,10 +114,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -114,10 +114,8 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
114 + sch.getQdzName() + "发往" + sch.getZdzName(); 114 + sch.getQdzName() + "发往" + sch.getZdzName();
115 115
116 //下发0x01指令 调度指令(闹钟有效) 116 //下发0x01指令 调度指令(闹钟有效)
117 - long t = System.currentTimeMillis(), alarmTime;  
118 - alarmTime = sch.getDfsjT();  
119 - if (sch.getDfsjT() < t)  
120 - alarmTime = t + 1000 * 30; 117 + long t = System.currentTimeMillis() + 1000 * 30,
  118 + alarmTime = sch.getDfsjT() < t?t:sch.getDfsjT();
121 119
122 d60 = new DirectiveCreator().createD60_01(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir()) 120 d60 = new DirectiveCreator().createD60_01(sch.getClZbh(), text, Integer.parseInt(sch.getXlDir())
123 , 0, new Date(alarmTime)); 121 , 0, new Date(alarmTime));
@@ -304,7 +302,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -304,7 +302,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
304 302
305 Map<String, List<D80>> rs = new HashMap<>(); 303 Map<String, List<D80>> rs = new HashMap<>();
306 for (String code : lineList) 304 for (String code : lineList)
307 - rs.put(code, pilotReport.unconfirmed80(Integer.parseInt(code))); 305 + rs.put(code, pilotReport.unconfirmed80(code));
308 306
309 return rs; 307 return rs;
310 } 308 }
@@ -333,17 +331,18 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -333,17 +331,18 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
333 rs.put("msg", "发送C0响应指令到车载设备失败,但该操作已经被系统记录!"); 331 rs.put("msg", "发送C0响应指令到车载设备失败,但该操作已经被系统记录!");
334 332
335 pilotReport.reply(d80); 333 pilotReport.reply(d80);
  334 +
  335 + // 通知页面
  336 + Map<String, Object> sockMap = new HashMap<>();
  337 + sockMap.put("fn", "d80Confirm");
  338 + sockMap.put("id", d80.getId());
  339 + sockMap.put("lineId", d80.getData().getLineId());
  340 + socketHandler.sendMessageToLine(d80.getData().getLineId().toString(), JSON.toJSONString(sockMap));
336 } 341 }
337 } catch (Exception e) { 342 } catch (Exception e) {
338 logger.error("80响应出现异常...", e); 343 logger.error("80响应出现异常...", e);
339 rs.put("status", ResponseCode.SUCCESS); 344 rs.put("status", ResponseCode.SUCCESS);
340 } 345 }
341 - // 通知页面  
342 - Map<String, Object> sockMap = new HashMap<>();  
343 - sockMap.put("fn", "d80Confirm");  
344 - sockMap.put("id", d80.getId());  
345 - sockMap.put("lineId", d80.getData().getLineId());  
346 - socketHandler.sendMessageToLine(d80.getData().getLineId().toString(), JSON.toJSONString(sockMap));  
347 346
348 return rs; 347 return rs;
349 } 348 }
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
@@ -14,13 +14,11 @@ import java.util.List; @@ -14,13 +14,11 @@ import java.util.List;
14 import java.util.Map; 14 import java.util.Map;
15 15
16 import org.springframework.jdbc.core.JdbcTemplate; 16 import org.springframework.jdbc.core.JdbcTemplate;
17 -import org.springframework.jdbc.core.RowMapper;  
18 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
19 import org.springframework.beans.factory.annotation.Autowired; 18 import org.springframework.beans.factory.annotation.Autowired;
20 19
21 import com.bsth.data.BasicData; 20 import com.bsth.data.BasicData;
22 import com.bsth.entity.excep.Speeding; 21 import com.bsth.entity.excep.Speeding;
23 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
24 import com.bsth.service.excep.SpeedingService; 22 import com.bsth.service.excep.SpeedingService;
25 import com.bsth.util.EchartConver; 23 import com.bsth.util.EchartConver;
26 import com.bsth.util.PageHelper; 24 import com.bsth.util.PageHelper;
@@ -42,7 +40,7 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -42,7 +40,7 @@ public class SpeedingServiceImpl implements SpeedingService {
42 ResultSet rs = null; 40 ResultSet rs = null;
43 int page=Integer.parseInt(map.get("page").toString()); 41 int page=Integer.parseInt(map.get("page").toString());
44 List<Speeding> list=new ArrayList<Speeding>(); 42 List<Speeding> list=new ArrayList<Speeding>();
45 - String sql="select * from bsth_c_speeding where speed > 60 "; 43 + String sql="select * from bsth_c_speeding where 1=1 ";
46 Object line=map.get("line"); 44 Object line=map.get("line");
47 Object nbbm=map.get("nbbm"); 45 Object nbbm=map.get("nbbm");
48 Object updown=map.get("updown"); 46 Object updown=map.get("updown");
@@ -204,22 +202,40 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -204,22 +202,40 @@ public class SpeedingServiceImpl implements SpeedingService {
204 int totalPage;//总页数 202 int totalPage;//总页数
205 int totalData = 0; 203 int totalData = 0;
206 if(list.size()>1){ 204 if(list.size()>1){
207 - Speeding speedingNow;//下标为i的车  
208 - Speeding speedingLast;//下标为i-1的车 205 + Speeding speedingNow;//下标为i的车辆行驶记录
  206 + Speeding speedingLast;//下标为i-1的车辆行驶记录
  207 + Speeding spped = null;//整合后的车辆行驶记录
209 String strNow; 208 String strNow;
210 String strLast; 209 String strLast;
  210 + boolean Flag = false;//判断是否有连续超速记录,默认没有
211 for(int i = 1;i<list.size();i++){ 211 for(int i = 1;i<list.size();i++){
212 speedingNow = list.get(i); 212 speedingNow = list.get(i);
213 speedingLast = list.get(i-1); 213 speedingLast = list.get(i-1);
214 - strNow = speedingNow.getVehicle()+speedingNow.getLine()+speedingNow.getUpDown();//同一车辆同一线路同一方向 214 + strNow = speedingNow.getVehicle()+speedingNow.getLine()+speedingNow.getUpDown();
215 strLast = speedingLast.getVehicle()+speedingLast.getLine()+speedingLast.getUpDown(); 215 strLast = speedingLast.getVehicle()+speedingLast.getLine()+speedingLast.getUpDown();
216 - //同一车辆同一线路同一方向并且该记录的超速的开始时间减去上一条超速记录的结束时间小于等于10s,证明该车超速。//PS:祛除数据库中的重复发送数据  
217 - if(strNow.equals(strLast) && Math.abs(speedingNow.getTimestamp()-speedingLast.getTimestamp())<=10*1000 && (speedingNow.getTimestamp()-speedingLast.getTimestamp()!=0)){  
218 - speedingLast.setEndtimestamp(speedingNow.getTimestamp());//设置结束时间时间戳  
219 - speedingLast.setEndtimestampDate(sdf.format(new Date(speedingNow.getTimestamp())));//设置结束时间  
220 - speedingLast.setEndlon(speedingNow.getLon());//设置结束时的经度  
221 - speedingLast.setEndlat(speedingNow.getLat());//设置结束时的纬度  
222 - listResult.add(speedingLast); 216 + if(speedingNow.getSpeed()>60 && speedingLast.getSpeed()>60 && strNow.equals(strLast)){//如果两条连续的记录都是超速且属于同一辆车。
  217 + if(Flag==false){//
  218 + spped = new Speeding();
  219 + spped.setId(speedingLast.getId());//设置连续超速记录Id
  220 + spped.setLine(speedingLast.getLine());//设置连续超速记录线路
  221 + spped.setLineName(speedingLast.getLineName());//设置连续超速记录线路名称
  222 + spped.setVehicle(speedingLast.getVehicle());//设置连续超速记录的车辆编号
  223 + spped.setUpDown(speedingLast.getUpDown());//设置上下行
  224 + spped.setLon(speedingLast.getLon());//设置开始时经度
  225 + spped.setLat(speedingLast.getLat());//设置开始时纬度
  226 + spped.setTimestamp(speedingLast.getTimestamp());//设置连续超速记录的开始时间
  227 + spped.setTimestampDate(speedingLast.getTimestampDate());//设置连续超速记录的开始时间戳
  228 + }
  229 + spped.setEndtimestamp(speedingNow.getTimestamp());//设置结束时间戳
  230 + spped.setEndtimestampDate(sdf.format(new Date(speedingNow.getTimestamp())));//设置结束时间
  231 + spped.setEndlon(speedingNow.getLon());//设置结束时的经度
  232 + spped.setEndlat(speedingNow.getLat());//设置结束时的纬度
  233 + Flag = true;
  234 + }else{
  235 + if(Flag){//如果上一条记录超速。
  236 + listResult.add(spped);
  237 + Flag = false;
  238 + }
223 } 239 }
224 } 240 }
225 Iterator<Speeding> speedIt = listResult.iterator(); 241 Iterator<Speeding> speedIt = listResult.iterator();
src/main/java/com/bsth/service/gps/GpsService.java
@@ -4,6 +4,7 @@ import com.bsth.data.gpsdata.GpsEntity; @@ -4,6 +4,7 @@ import com.bsth.data.gpsdata.GpsEntity;
4 import com.bsth.service.gps.entity.GpsOutbound_DTO; 4 import com.bsth.service.gps.entity.GpsOutbound_DTO;
5 import com.bsth.service.gps.entity.GpsSpeed; 5 import com.bsth.service.gps.entity.GpsSpeed;
6 import com.bsth.service.gps.entity.GpsSpeed_DTO; 6 import com.bsth.service.gps.entity.GpsSpeed_DTO;
  7 +import com.bsth.util.PageObject;
7 8
8 import javax.servlet.http.HttpServletResponse; 9 import javax.servlet.http.HttpServletResponse;
9 10
@@ -25,7 +26,7 @@ public interface GpsService { @@ -25,7 +26,7 @@ public interface GpsService {
25 26
26 Map<String,Object> findRoadSpeed(String lineCode); 27 Map<String,Object> findRoadSpeed(String lineCode);
27 28
28 - Map<String,Object> gpsCompletion(long schId); 29 + Map<String,Object> gpsCompletion(long schId, int type);
29 30
30 Map<String,Object> history_v2(String nbbm, long st, long et); 31 Map<String,Object> history_v2(String nbbm, long st, long et);
31 32
@@ -45,4 +46,6 @@ public interface GpsService { @@ -45,4 +46,6 @@ public interface GpsService {
45 46
46 List<GpsSpeed> findPosition(String deviceid, String startdate, 47 List<GpsSpeed> findPosition(String deviceid, String startdate,
47 String enddate) throws ParseException; 48 String enddate) throws ParseException;
  49 +
  50 + PageObject<GpsSpeed> Pagequery(Map<String, Object> map);
48 } 51 }
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
@@ -16,6 +16,8 @@ import com.bsth.repository.StationRepository; @@ -16,6 +16,8 @@ import com.bsth.repository.StationRepository;
16 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 16 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
17 import com.bsth.service.gps.entity.*; 17 import com.bsth.service.gps.entity.*;
18 import com.bsth.util.DateUtils; 18 import com.bsth.util.DateUtils;
  19 +import com.bsth.util.PageHelper;
  20 +import com.bsth.util.PageObject;
19 import com.bsth.util.TransGPS; 21 import com.bsth.util.TransGPS;
20 import com.bsth.util.TransGPS.Location; 22 import com.bsth.util.TransGPS.Location;
21 import com.bsth.util.db.DBUtils_MS; 23 import com.bsth.util.db.DBUtils_MS;
@@ -44,6 +46,7 @@ import java.net.URLEncoder; @@ -44,6 +46,7 @@ import java.net.URLEncoder;
44 import java.sql.Connection; 46 import java.sql.Connection;
45 import java.sql.PreparedStatement; 47 import java.sql.PreparedStatement;
46 import java.sql.ResultSet; 48 import java.sql.ResultSet;
  49 +import java.sql.SQLException;
47 import java.text.DecimalFormat; 50 import java.text.DecimalFormat;
48 import java.text.ParseException; 51 import java.text.ParseException;
49 import java.text.SimpleDateFormat; 52 import java.text.SimpleDateFormat;
@@ -447,7 +450,7 @@ public class GpsServiceImpl implements GpsService { @@ -447,7 +450,7 @@ public class GpsServiceImpl implements GpsService {
447 * @return 450 * @return
448 */ 451 */
449 @Override 452 @Override
450 - public Map<String, Object> gpsCompletion(long schId) { 453 + public Map<String, Object> gpsCompletion(long schId, int type) {
451 Map<String, Object> rs = new HashMap<>(); 454 Map<String, Object> rs = new HashMap<>();
452 455
453 try { 456 try {
@@ -481,12 +484,18 @@ public class GpsServiceImpl implements GpsService { @@ -481,12 +484,18 @@ public class GpsServiceImpl implements GpsService {
481 }); 484 });
482 Map<String, Object> fs = list.get(0); 485 Map<String, Object> fs = list.get(0);
483 //替换设备号和时间 486 //替换设备号和时间
484 - int diff = (int) (sch.getDfsjT() - Long.parseLong(fs.get("ts").toString()) - 1000 * 70); 487 + long diff = ((sch.getDfsjT() - Long.parseLong(fs.get("ts").toString())) - 1000 * 70);
485 488
486 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); 489 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh());
  490 + int serviceState;
487 for (Map<String, Object> map : list) { 491 for (Map<String, Object> map : list) {
488 map.put("device_id", deviceId); 492 map.put("device_id", deviceId);
489 map.put("ts", Long.parseLong(map.get("ts").toString()) + diff); 493 map.put("ts", Long.parseLong(map.get("ts").toString()) + diff);
  494 + if(type==1){
  495 + //走补传协议
  496 + serviceState = Integer.parseInt(map.get("service_state").toString());
  497 + map.put("service_state", serviceState |= 0x00100000);
  498 + }
490 } 499 }
491 500
492 String sqlBefore = "insert into bsth_c_template(", sqlValues = " values("; 501 String sqlBefore = "insert into bsth_c_template(", sqlValues = " values(";
@@ -800,7 +809,7 @@ public class GpsServiceImpl implements GpsService { @@ -800,7 +809,7 @@ public class GpsServiceImpl implements GpsService {
800 @Override 809 @Override
801 public List<GpsSpeed_DTO> speeds(String nbbm, long st, long et) { 810 public List<GpsSpeed_DTO> speeds(String nbbm, long st, long et) {
802 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm); 811 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(nbbm);
803 - String sql = "select vehicle, line, up_down, lon, lat, speed,timestamp from bsth_c_speeding where vehicle=? and timestamp>? and timestamp<?"; 812 + String sql = "select vehicle, line, up_down, lon, lat, speed,timestamp from bsth_c_GpsSpeed where vehicle=? and timestamp>? and timestamp<?";
804 813
805 return GpsSpeed_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st * 1000, et * 1000)); 814 return GpsSpeed_DTO.create(new JdbcTemplate(DBUtils_MS.getDataSource()).queryForList(sql, deviceId, st * 1000, et * 1000));
806 } 815 }
@@ -1030,4 +1039,182 @@ public class GpsServiceImpl implements GpsService { @@ -1030,4 +1039,182 @@ public class GpsServiceImpl implements GpsService {
1030 return listResult; 1039 return listResult;
1031 1040
1032 } 1041 }
  1042 +
  1043 + @Override
  1044 + public PageObject<GpsSpeed> Pagequery(Map<String, Object> map) {
  1045 +
  1046 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  1047 + List<GpsSpeed> list=findAll(map);
  1048 + List<GpsSpeed> listResult = new ArrayList<GpsSpeed>();
  1049 + int curPage;//页码
  1050 + int pageData;//每页的记录条数
  1051 + int start;//起始数据下标
  1052 + int totalPage;//总页数
  1053 + int totalData = 0;
  1054 + if(list.size()>1){
  1055 + GpsSpeed GpsSpeedNow;//下标为i的车辆行驶记录
  1056 + GpsSpeed GpsSpeedLast;//下标为i-1的车辆行驶记录
  1057 + GpsSpeed spped = null;//整合后的车辆行驶记录
  1058 + String strNow;
  1059 + String strLast;
  1060 + boolean Flag = false;//判断是否有连续超速记录,默认没有
  1061 + for(int i = 1;i<list.size();i++){
  1062 + GpsSpeedNow = list.get(i);
  1063 + GpsSpeedLast = list.get(i-1);
  1064 + strNow = GpsSpeedNow.getVehicle()+GpsSpeedNow.getLine()+GpsSpeedNow.getUp_down();
  1065 + strLast = GpsSpeedLast.getVehicle()+GpsSpeedLast.getLine()+GpsSpeedLast.getUp_down();
  1066 + if(GpsSpeedNow.getSpeed()>60 && GpsSpeedLast.getSpeed()>60 && strNow.equals(strLast)){//如果两条连续的记录都是超速且属于同一辆车。
  1067 + if(Flag==false){//
  1068 + spped = new GpsSpeed();
  1069 + spped.setLine(GpsSpeedLast.getLine());//设置连续超速记录线路
  1070 + spped.setLineName(GpsSpeedLast.getLineName());//设置连续超速记录线路名称
  1071 + spped.setVehicle(GpsSpeedLast.getVehicle());//设置连续超速记录的车辆编号
  1072 + spped.setUp_down(GpsSpeedLast.getUp_down());//设置上下行
  1073 + spped.setLon(GpsSpeedLast.getLon());//设置开始时经度
  1074 + spped.setLat(GpsSpeedLast.getLat());//设置开始时纬度
  1075 + spped.setTimestamp(GpsSpeedLast.getTimestamp());//设置连续超速记录的开始时间
  1076 + spped.setTimestampDate(GpsSpeedLast.getTimestampDate());//设置连续超速记录的开始时间戳
  1077 + }
  1078 + spped.setEndtimestamp(GpsSpeedNow.getTimestamp());//设置结束时间戳
  1079 + spped.setEndtimestampDate(sdf.format(new Date(GpsSpeedNow.getTimestamp())));//设置结束时间
  1080 + spped.setEndlon(GpsSpeedNow.getLon());//设置结束时的经度
  1081 + spped.setEndlat(GpsSpeedNow.getLat());//设置结束时的纬度
  1082 + Flag = true;
  1083 + }else{
  1084 + if(Flag){//如果上一条记录超速。
  1085 + listResult.add(spped);
  1086 + Flag = false;
  1087 + }
  1088 + }
  1089 + }
  1090 + Iterator<GpsSpeed> speedIt = listResult.iterator();
  1091 + while(speedIt.hasNext()){
  1092 + GpsSpeed GpsSpeed = speedIt.next();
  1093 + if(GpsSpeed.getEndtimestamp()-GpsSpeed.getTimestamp()<=1000){
  1094 + speedIt.remove();
  1095 + }
  1096 + }
  1097 +
  1098 + totalData = listResult.size();//总记录条数。
  1099 + if(map.get("curPage") == null || map.get("curPage").equals("0")){
  1100 + curPage = 0;
  1101 + }else{
  1102 + curPage = Integer.parseInt((String) map.get("curPage"));
  1103 + }
  1104 + pageData = Integer.parseInt((String) map.get("pageData"));//每页的记录条数
  1105 + start = (curPage - 0) * pageData; //起始记录下标。
  1106 + totalPage = totalData % pageData == 0 ? totalData / pageData : totalData / pageData +1;//总页数
  1107 + if(curPage == totalPage-1){//如果当前页等于总页数。
  1108 + listResult = listResult.subList(start, totalData);
  1109 + }else{
  1110 + listResult = listResult.subList(start, start+pageData);
  1111 + }
  1112 + }else{
  1113 + curPage = 1;
  1114 + pageData = Integer.parseInt((String) map.get("pageData"));//每页的记录条数
  1115 + totalPage =1;
  1116 + }
  1117 + Map<String,Object> paramMap = new HashMap<String,Object>();
  1118 + paramMap.put("totalPage", totalPage);
  1119 + paramMap.put("curPage", curPage);
  1120 + paramMap.put("pageData", pageData);
  1121 + PageHelper pageHelper = new PageHelper(totalData, paramMap);
  1122 + pageHelper.getMap();
  1123 + PageObject<GpsSpeed> pageObject = pageHelper.getPageObject();
  1124 + pageObject.setDataList(listResult);
  1125 + return pageObject;
  1126 + }
  1127 +
  1128 + static List<GpsSpeed> findAll(Map<String, Object> map) {
  1129 + Connection conn = null;
  1130 + PreparedStatement ps = null;
  1131 + ResultSet rs = null;
  1132 + int page=Integer.parseInt(map.get("page").toString());
  1133 + List<GpsSpeed> list=new ArrayList<GpsSpeed>();
  1134 + String sql="select * from bsth_c_gps_info where 1=1 ";
  1135 + Object line=map.get("line");
  1136 + Object nbbm=map.get("nbbm");
  1137 + Object updown=map.get("updown");
  1138 + Object startDate=map.get("startDate");
  1139 + Object endDate=map.get("endDate");
  1140 +
  1141 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  1142 + if(line!=null){
  1143 + sql +=" and line_id like'%"+line.toString().trim()+"%'";
  1144 + }
  1145 +
  1146 + if(nbbm!=null){
  1147 + nbbm=BasicData.deviceId2NbbmMap.inverse().get(nbbm);
  1148 + if(nbbm!=null)
  1149 + sql +=" and vehicle like '%"+nbbm.toString()+"%'";
  1150 + }
  1151 +
  1152 + if(updown!=null){
  1153 + sql +="and industry_code like '%"+updown.toString()+"%'";
  1154 + }
  1155 + if(startDate!=null){
  1156 + if (startDate.toString().length()>0) {
  1157 + try {
  1158 + Long t1=sdf.parse(startDate.toString()+" 00:00:00").getTime();
  1159 + sql += " and ts >="+t1;
  1160 + } catch (ParseException e) {
  1161 + e.printStackTrace();
  1162 + }
  1163 + }
  1164 +
  1165 + }
  1166 + if(endDate!=null){
  1167 + if (endDate.toString().length()>0) {
  1168 + try {
  1169 + Long t2=sdf.parse(endDate.toString()+" 23:59:59").getTime();
  1170 + sql += " and ts <="+t2;
  1171 + } catch (ParseException e) {
  1172 + e.printStackTrace();
  1173 + }
  1174 + }
  1175 +
  1176 + }
  1177 +
  1178 + try {
  1179 + conn = DBUtils_MS.getConnection();
  1180 + ps = conn.prepareStatement(sql);
  1181 + rs = ps.executeQuery();
  1182 + list = resultSet2Set(rs);
  1183 + } catch (SQLException e) {
  1184 + e.printStackTrace();
  1185 + }finally {
  1186 + DBUtils_MS.close(rs, ps, conn);
  1187 + }
  1188 +
  1189 + return list;
  1190 + }
  1191 +
  1192 + static List<GpsSpeed> resultSet2Set(ResultSet rs) throws SQLException{
  1193 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  1194 + List<GpsSpeed> list=new ArrayList<GpsSpeed>();
  1195 + GpsSpeed GpsSpeed;
  1196 + Float lon, lat;
  1197 + Location location;
  1198 + while(rs.next()){
  1199 + lon = rs.getFloat("lon");
  1200 + lat = rs.getFloat("lat");
  1201 + location = TransGPS.LocationMake(lon, lat);
  1202 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location));
  1203 + GpsSpeed=new GpsSpeed();
  1204 + GpsSpeed.setLon((float)location.getLng());
  1205 + GpsSpeed.setLat((float)location.getLat());
  1206 + GpsSpeed.setLine(rs.getObject("line_id").toString());
  1207 + //run 时注解
  1208 + GpsSpeed.setLineName(BasicData.lineCode2NameMap.get(GpsSpeed.getLine().toString()));
  1209 + GpsSpeed.setSpeed(Float.valueOf(rs.getObject("speed_gps").toString()));
  1210 + GpsSpeed.setTimestamp((Long.valueOf(rs.getObject("ts").toString())));
  1211 + GpsSpeed.setTimestampDate(sdf.format(new Date(GpsSpeed.getTimestamp())));
  1212 + GpsSpeed.setUp_down(((Integer.valueOf(rs.getObject("service_state").toString())) & 0x10000000)==0?0:1);
  1213 + GpsSpeed.setVehicle(BasicData.deviceId2NbbmMap.get(rs.getObject("device_id").toString()));
  1214 + list.add(GpsSpeed);
  1215 + }
  1216 + return list;
  1217 + }
  1218 +
1033 } 1219 }
  1220 +
src/main/java/com/bsth/service/gps/entity/GpsSpeed.java
1 package com.bsth.service.gps.entity; 1 package com.bsth.service.gps.entity;
2 2
  3 +import javax.persistence.Transient;
  4 +
3 /** 5 /**
4 * 超速异常 -ms数据库格式 6 * 超速异常 -ms数据库格式
5 * Created by panzhao on 2017/4/7. 7 * Created by panzhao on 2017/4/7.
@@ -15,11 +17,59 @@ public class GpsSpeed { @@ -15,11 +17,59 @@ public class GpsSpeed {
15 private float lon; 17 private float lon;
16 18
17 private float lat; 19 private float lat;
  20 +
  21 + private String lineName;
  22 +
  23 + /**
  24 + * 超速结束时的纬度
  25 + */
  26 + @Transient
  27 + private Float endlat;
  28 +
  29 + /**
  30 + * 超速结束时的经度
  31 + */
  32 + @Transient
  33 + private Float endlon;
18 34
19 private float speed; 35 private float speed;
20 - 36 +
21 private long timestamp; 37 private long timestamp;
22 - 38 +
  39 + @Transient
  40 + private String timestampDate;
  41 +
  42 + public String getTimestampDate() {
  43 + return timestampDate;
  44 + }
  45 +
  46 + public void setTimestampDate(String timestampDate) {
  47 + this.timestampDate = timestampDate;
  48 + }
  49 +
  50 + public Long getEndtimestamp() {
  51 + return endtimestamp;
  52 + }
  53 +
  54 + public void setEndtimestamp(Long endtimestamp) {
  55 + this.endtimestamp = endtimestamp;
  56 + }
  57 +
  58 + public String getEndtimestampDate() {
  59 + return endtimestampDate;
  60 + }
  61 +
  62 + public void setEndtimestampDate(String endtimestampDate) {
  63 + this.endtimestampDate = endtimestampDate;
  64 + }
  65 +
  66 + //结束时间,单位:秒/s
  67 + @Transient
  68 + private Long endtimestamp;
  69 +
  70 + @Transient
  71 + private String endtimestampDate;
  72 +
23 public String getVehicle() { 73 public String getVehicle() {
24 return vehicle; 74 return vehicle;
25 } 75 }
@@ -75,4 +125,28 @@ public class GpsSpeed { @@ -75,4 +125,28 @@ public class GpsSpeed {
75 public void setTimestamp(long timestamp) { 125 public void setTimestamp(long timestamp) {
76 this.timestamp = timestamp; 126 this.timestamp = timestamp;
77 } 127 }
  128 +
  129 + public Float getEndlon() {
  130 + return endlon;
  131 + }
  132 +
  133 + public void setEndlon(Float endlon) {
  134 + this.endlon = endlon;
  135 + }
  136 +
  137 + public Float getEndlat() {
  138 + return endlat;
  139 + }
  140 +
  141 + public void setEndlat(Float endlat) {
  142 + this.endlat = endlat;
  143 + }
  144 +
  145 + public String getLineName() {
  146 + return lineName;
  147 + }
  148 +
  149 + public void setLineName(String lineName) {
  150 + this.lineName = lineName;
  151 + }
78 } 152 }
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
@@ -17,17 +17,24 @@ import java.util.List; @@ -17,17 +17,24 @@ import java.util.List;
17 import java.util.Map; 17 import java.util.Map;
18 import java.util.Set; 18 import java.util.Set;
19 19
  20 +import org.apache.commons.lang3.StringEscapeUtils;
20 import org.springframework.beans.factory.annotation.Autowired; 21 import org.springframework.beans.factory.annotation.Autowired;
  22 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
21 import org.springframework.jdbc.core.JdbcTemplate; 23 import org.springframework.jdbc.core.JdbcTemplate;
22 import org.springframework.jdbc.core.RowMapper; 24 import org.springframework.jdbc.core.RowMapper;
23 import org.springframework.stereotype.Service; 25 import org.springframework.stereotype.Service;
24 26
  27 +import com.alibaba.fastjson.JSONArray;
  28 +import com.alibaba.fastjson.JSONObject;
  29 +import com.bsth.data.BasicData;
  30 +import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
25 import com.bsth.entity.realcontrol.ChildTaskPlan; 31 import com.bsth.entity.realcontrol.ChildTaskPlan;
26 import com.bsth.entity.realcontrol.ScheduleRealInfo; 32 import com.bsth.entity.realcontrol.ScheduleRealInfo;
27 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 33 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
28 import com.bsth.service.BusIntervalService; 34 import com.bsth.service.BusIntervalService;
29 import com.bsth.service.schedule.PeopleCarPlanService; 35 import com.bsth.service.schedule.PeopleCarPlanService;
30 import com.bsth.util.ReportUtils; 36 import com.bsth.util.ReportUtils;
  37 +import com.google.gson.Gson;
31 38
32 39
33 @Service 40 @Service
@@ -1838,7 +1845,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1838,7 +1845,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1838 } 1845 }
1839 try { 1846 try {
1840 1847
1841 - String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d') >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"' and fcsj_actual is not null"; 1848 + String sql = "select * from bsth_c_s_sp_info_real where DATE_FORMAT(schedule_date,'%Y-%m-%d')"
  1849 + + " >= '"+startDate+"' and DATE_FORMAT(schedule_date,'%Y-%m-%d') <= '"+endDate+"'";
1842 if(line.length() != 0){ 1850 if(line.length() != 0){
1843 sql += " and xl_bm = '"+line+"'"; 1851 sql += " and xl_bm = '"+line+"'";
1844 } 1852 }
@@ -1865,6 +1873,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1865,6 +1873,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1865 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { 1873 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
1866 ScheduleRealInfo schedule = new ScheduleRealInfo(); 1874 ScheduleRealInfo schedule = new ScheduleRealInfo();
1867 schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); 1875 schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
  1876 + schedule.setXlBm(rs.getString("xl_bm"));
1868 schedule.setXlName(rs.getString("xl_name")); 1877 schedule.setXlName(rs.getString("xl_name"));
1869 schedule.setLpName(rs.getString("lp_name")); 1878 schedule.setLpName(rs.getString("lp_name"));
1870 schedule.setBcType(rs.getString("bc_type")); 1879 schedule.setBcType(rs.getString("bc_type"));
@@ -1918,7 +1927,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1918,7 +1927,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1918 for(ScheduleRealInfo schedule : list){ 1927 for(ScheduleRealInfo schedule : list){
1919 if(schedule.getXlName() == null || schedule.getXlName().trim().length() == 0) 1928 if(schedule.getXlName() == null || schedule.getXlName().trim().length() == 0)
1920 continue; 1929 continue;
1921 - String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlName(); 1930 + String key = schedule.getGsName() + "/" + schedule.getFgsName() + "/" + schedule.getXlBm();
1922 if(!keyMap.containsKey(key)) 1931 if(!keyMap.containsKey(key))
1923 keyMap.put(key, new ArrayList<ScheduleRealInfo>()); 1932 keyMap.put(key, new ArrayList<ScheduleRealInfo>());
1924 keyMap.get(key).add(schedule); 1933 keyMap.get(key).add(schedule);
@@ -1929,8 +1938,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1929,8 +1938,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1929 int sjbc = 0, sddf = 0, zddf = 0, 1938 int sjbc = 0, sddf = 0, zddf = 0,
1930 dxtz = 0, lbtz = 0; 1939 dxtz = 0, lbtz = 0;
1931 for(ScheduleRealInfo schedule : keyMap.get(key)){ 1940 for(ScheduleRealInfo schedule : keyMap.get(key)){
  1941 + boolean flag = false;
1932 if(schedule.getFcsjActual() != null && schedule.getStatus() != -1){ 1942 if(schedule.getFcsjActual() != null && schedule.getStatus() != -1){
1933 - boolean flag = false;  
1934 sjbc++; 1943 sjbc++;
1935 if(schedule.getDfsj() != null && !schedule.getDfsj().equals(schedule.getFcsj())){ 1944 if(schedule.getDfsj() != null && !schedule.getDfsj().equals(schedule.getFcsj())){
1936 flag = true; 1945 flag = true;
@@ -1939,17 +1948,16 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1939,17 +1948,16 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1939 zddf++; 1948 zddf++;
1940 else 1949 else
1941 sddf++; 1950 sddf++;
1942 - }else if(!schedule.isOnline()){  
1943 - flag = true;  
1944 - schedule.setRemarks("掉线调整");  
1945 - dxtz++;  
1946 - }else if(schedule.getStatus() == 2){  
1947 - flag = true;  
1948 - lbtz++;  
1949 } 1951 }
1950 - if(flag)  
1951 - tempList.add(schedule); 1952 +
  1953 +
  1954 + }
  1955 + if(schedule.getStatus() == -1){
  1956 + flag = true;
  1957 + lbtz++;
1952 } 1958 }
  1959 + if(flag)
  1960 + tempList.add(schedule);
1953 } 1961 }
1954 tempMap.put("date", date); 1962 tempMap.put("date", date);
1955 String[] keys = key.split("/"); 1963 String[] keys = key.split("/");
@@ -1960,22 +1968,23 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1960,22 +1968,23 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1960 tempMap.put("sddf", sddf); 1968 tempMap.put("sddf", sddf);
1961 tempMap.put("zddf", zddf); 1969 tempMap.put("zddf", zddf);
1962 tempMap.put("dfhj", sddf + zddf); 1970 tempMap.put("dfhj", sddf + zddf);
1963 - tempMap.put("dxtz", dxtz); 1971 +// tempMap.put("dxtz", dxtz);
1964 tempMap.put("lbtz", lbtz); 1972 tempMap.put("lbtz", lbtz);
1965 - tempMap.put("correct", sddf + zddf + dxtz + lbtz); 1973 + tempMap.put("correct", sddf + zddf + lbtz);
1966 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); 1974 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
1967 - tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); 1975 +// tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%");
1968 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); 1976 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%");
1969 - tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");  
1970 - tempMap.put("workList", tempList); 1977 +// tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");
  1978 +// tempMap.put("workList", tempList);
1971 1979
1972 String key0 = keys[0] + "/" + keys[1]; 1980 String key0 = keys[0] + "/" + keys[1];
1973 - if(!keyMap0.containsKey(key0))  
1974 - keyMap0.put(key0, new ArrayList<Map<String, Object>>());  
1975 - keyMap0.get(key0).add(tempMap); 1981 + /*if(!keyMap0.containsKey(key0))
  1982 + keyMap0.put(key0, new ArrayList<Map<String, Object>>());*/
  1983 +// keyMap0.get(key0).add(tempMap);
  1984 + resList.add(tempMap);
1976 } 1985 }
1977 1986
1978 - for(String key : keyMap0.keySet()){ 1987 + /*for(String key : keyMap0.keySet()){
1979 Map<String, Object> tempMap = new HashMap<String, Object>(); 1988 Map<String, Object> tempMap = new HashMap<String, Object>();
1980 int sjbc = 0, sddf = 0, zddf = 0, 1989 int sjbc = 0, sddf = 0, zddf = 0,
1981 dxtz = 0, lbtz = 0; 1990 dxtz = 0, lbtz = 0;
@@ -1983,7 +1992,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1983,7 +1992,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1983 sjbc += (int)m.get("sjbc"); 1992 sjbc += (int)m.get("sjbc");
1984 sddf += (int)m.get("sddf"); 1993 sddf += (int)m.get("sddf");
1985 zddf += (int)m.get("zddf"); 1994 zddf += (int)m.get("zddf");
1986 - dxtz += (int)m.get("dxtz"); 1995 +// dxtz += (int)m.get("dxtz");
1987 lbtz += (int)m.get("lbtz"); 1996 lbtz += (int)m.get("lbtz");
1988 } 1997 }
1989 tempMap.put("date", date); 1998 tempMap.put("date", date);
@@ -1995,22 +2004,22 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1995,22 +2004,22 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1995 tempMap.put("sddf", sddf); 2004 tempMap.put("sddf", sddf);
1996 tempMap.put("zddf", zddf); 2005 tempMap.put("zddf", zddf);
1997 tempMap.put("dfhj", sddf + zddf); 2006 tempMap.put("dfhj", sddf + zddf);
1998 - tempMap.put("dxtz", dxtz); 2007 +// tempMap.put("dxtz", dxtz);
1999 tempMap.put("lbtz", lbtz); 2008 tempMap.put("lbtz", lbtz);
2000 tempMap.put("correct", sddf + zddf + dxtz + lbtz); 2009 tempMap.put("correct", sddf + zddf + dxtz + lbtz);
2001 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); 2010 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
2002 tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); 2011 tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%");
2003 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); 2012 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%");
2004 tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); 2013 tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");
2005 - tempMap.put("workList", keyMap0.get(key)); 2014 +// tempMap.put("workList", keyMap0.get(key));
2006 2015
2007 String key1 = keys[0]; 2016 String key1 = keys[0];
2008 if(!keyMap1.containsKey(key1)) 2017 if(!keyMap1.containsKey(key1))
2009 keyMap1.put(key1, new ArrayList<Map<String, Object>>()); 2018 keyMap1.put(key1, new ArrayList<Map<String, Object>>());
2010 keyMap1.get(key1).add(tempMap); 2019 keyMap1.get(key1).add(tempMap);
2011 - } 2020 + }*/
2012 2021
2013 - for(String key : keyMap1.keySet()){ 2022 + /*for(String key : keyMap1.keySet()){
2014 Map<String, Object> tempMap = new HashMap<String, Object>(); 2023 Map<String, Object> tempMap = new HashMap<String, Object>();
2015 int sjbc = 0, sddf = 0, zddf = 0, 2024 int sjbc = 0, sddf = 0, zddf = 0,
2016 dxtz = 0, lbtz = 0, lines = 0; 2025 dxtz = 0, lbtz = 0, lines = 0;
@@ -2018,7 +2027,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2018,7 +2027,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2018 sjbc += (int)m.get("sjbc"); 2027 sjbc += (int)m.get("sjbc");
2019 sddf += (int)m.get("sddf"); 2028 sddf += (int)m.get("sddf");
2020 zddf += (int)m.get("zddf"); 2029 zddf += (int)m.get("zddf");
2021 - dxtz += (int)m.get("dxtz"); 2030 +// dxtz += (int)m.get("dxtz");
2022 lbtz += (int)m.get("lbtz"); 2031 lbtz += (int)m.get("lbtz");
2023 lines += (int)m.get("lines"); 2032 lines += (int)m.get("lines");
2024 } 2033 }
@@ -2029,17 +2038,17 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2029,17 +2038,17 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2029 tempMap.put("sddf", sddf); 2038 tempMap.put("sddf", sddf);
2030 tempMap.put("zddf", zddf); 2039 tempMap.put("zddf", zddf);
2031 tempMap.put("dfhj", sddf + zddf); 2040 tempMap.put("dfhj", sddf + zddf);
2032 - tempMap.put("dxtz", dxtz); 2041 +// tempMap.put("dxtz", dxtz);
2033 tempMap.put("lbtz", lbtz); 2042 tempMap.put("lbtz", lbtz);
2034 tempMap.put("correct", sddf + zddf + dxtz + lbtz); 2043 tempMap.put("correct", sddf + zddf + dxtz + lbtz);
2035 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); 2044 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
2036 tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); 2045 tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%");
2037 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); 2046 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%");
2038 tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); 2047 tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");
2039 - tempMap.put("workList", keyMap1.get(key)); 2048 +// tempMap.put("workList", keyMap1.get(key));
2040 2049
2041 resList.add(tempMap); 2050 resList.add(tempMap);
2042 - } 2051 + }*/
2043 2052
2044 if(resList.size() != 0){ 2053 if(resList.size() != 0){
2045 Map<String, Object> tempMap = new HashMap<String, Object>(); 2054 Map<String, Object> tempMap = new HashMap<String, Object>();
@@ -2049,10 +2058,10 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2049,10 +2058,10 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2049 sjbc += (int)m.get("sjbc"); 2058 sjbc += (int)m.get("sjbc");
2050 sddf += (int)m.get("sddf"); 2059 sddf += (int)m.get("sddf");
2051 zddf += (int)m.get("zddf"); 2060 zddf += (int)m.get("zddf");
2052 - dxtz += (int)m.get("dxtz"); 2061 +// dxtz += (int)m.get("dxtz");
2053 lbtz += (int)m.get("lbtz"); 2062 lbtz += (int)m.get("lbtz");
2054 - lines += (int)m.get("lines");  
2055 - for(Map<String, Object> m0 : (List<Map<String, Object>>)m.get("workList")){ 2063 +// lines += (int)m.get("lines");
  2064 + /*for(Map<String, Object> m0 : (List<Map<String, Object>>)m.get("workList")){
2056 Map<String, Object> temp = new HashMap<String, Object>(); 2065 Map<String, Object> temp = new HashMap<String, Object>();
2057 temp.put("date", "合计"); 2066 temp.put("date", "合计");
2058 temp.put("lines", m0.get("lines")); 2067 temp.put("lines", m0.get("lines"));
@@ -2060,15 +2069,15 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2060,15 +2069,15 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2060 temp.put("sddf", m0.get("sddf")); 2069 temp.put("sddf", m0.get("sddf"));
2061 temp.put("zddf", m0.get("zddf")); 2070 temp.put("zddf", m0.get("zddf"));
2062 temp.put("dfhj", m0.get("dfhj")); 2071 temp.put("dfhj", m0.get("dfhj"));
2063 - temp.put("dxtz", m0.get("dxtz")); 2072 +// temp.put("dxtz", m0.get("dxtz"));
2064 temp.put("lbtz", m0.get("lbtz")); 2073 temp.put("lbtz", m0.get("lbtz"));
2065 temp.put("correct", m0.get("correct")); 2074 temp.put("correct", m0.get("correct"));
2066 temp.put("dfbl", m0.get("dfbl")); 2075 temp.put("dfbl", m0.get("dfbl"));
2067 temp.put("dxbl", m0.get("dxbl")); 2076 temp.put("dxbl", m0.get("dxbl"));
2068 temp.put("lbbl", m0.get("lbbl")); 2077 temp.put("lbbl", m0.get("lbbl"));
2069 temp.put("correctbl", m0.get("correctbl")); 2078 temp.put("correctbl", m0.get("correctbl"));
2070 - ((List<Map<String, Object>>)m0.get("workList")).add(temp);  
2071 - } 2079 +// ((List<Map<String, Object>>)m0.get("workList")).add(temp);
  2080 + }*/
2072 Map<String, Object> temp = new HashMap<String, Object>(); 2081 Map<String, Object> temp = new HashMap<String, Object>();
2073 temp.put("date", "合计"); 2082 temp.put("date", "合计");
2074 temp.put("lines", m.get("lines")); 2083 temp.put("lines", m.get("lines"));
@@ -2076,14 +2085,14 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2076,14 +2085,14 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2076 temp.put("sddf", m.get("sddf")); 2085 temp.put("sddf", m.get("sddf"));
2077 temp.put("zddf", m.get("zddf")); 2086 temp.put("zddf", m.get("zddf"));
2078 temp.put("dfhj", m.get("dfhj")); 2087 temp.put("dfhj", m.get("dfhj"));
2079 - temp.put("dxtz", m.get("dxtz")); 2088 +// temp.put("dxtz", m.get("dxtz"));
2080 temp.put("lbtz", m.get("lbtz")); 2089 temp.put("lbtz", m.get("lbtz"));
2081 temp.put("correct", m.get("correct")); 2090 temp.put("correct", m.get("correct"));
2082 temp.put("dfbl", m.get("dfbl")); 2091 temp.put("dfbl", m.get("dfbl"));
2083 temp.put("dxbl", m.get("dxbl")); 2092 temp.put("dxbl", m.get("dxbl"));
2084 temp.put("lbbl", m.get("lbbl")); 2093 temp.put("lbbl", m.get("lbbl"));
2085 - temp.put("correctbl", m.get("correctbl"));  
2086 - ((List<Map<String, Object>>)m.get("workList")).add(temp); 2094 +// temp.put("correctbl", m.get("correctbl"));
  2095 +// ((List<Map<String, Object>>)m.get("workList")).add(temp);
2087 } 2096 }
2088 tempMap.put("date", "合计"); 2097 tempMap.put("date", "合计");
2089 tempMap.put("lines", lines); 2098 tempMap.put("lines", lines);
@@ -2091,16 +2100,99 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -2091,16 +2100,99 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2091 tempMap.put("sddf", sddf); 2100 tempMap.put("sddf", sddf);
2092 tempMap.put("zddf", zddf); 2101 tempMap.put("zddf", zddf);
2093 tempMap.put("dfhj", sddf + zddf); 2102 tempMap.put("dfhj", sddf + zddf);
2094 - tempMap.put("dxtz", dxtz); 2103 +// tempMap.put("dxtz", dxtz);
2095 tempMap.put("lbtz", lbtz); 2104 tempMap.put("lbtz", lbtz);
2096 - tempMap.put("correct", sddf + zddf + dxtz + lbtz); 2105 + tempMap.put("correct", sddf + zddf + lbtz);
2097 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%"); 2106 tempMap.put("dfbl", df.format((double)(sddf + zddf)/sjbc*100) + "%");
2098 - tempMap.put("dxbl", df.format((double)(dxtz)/sjbc*100) + "%"); 2107 +
2099 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%"); 2108 tempMap.put("lbbl", df.format((double)(lbtz)/sjbc*100) + "%");
2100 - tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%"); 2109 +// tempMap.put("correctbl", df.format((double)(sddf + zddf + dxtz + lbtz)/sjbc*100) + "%");
2101 resList.add(tempMap); 2110 resList.add(tempMap);
2102 } 2111 }
2103 - 2112 + //计算掉线调整
  2113 + String sqldot = "select * from "
  2114 + + "logger_sch_modify where gsbm =? and fgsbm=? and rq BETWEEN ? and ? order by line_code,sch_id";
  2115 +
  2116 + ;
  2117 + List<SchEditInfoDto> listDot = jdbcTemplate.query(sqldot,
  2118 + new BeanPropertyRowMapper(SchEditInfoDto.class),company,subCompany,map.get("startDate").toString(),map.get("endDate").toString());
  2119 + int dxtzz=0;
  2120 + Map<String, Object> mapSchId=new HashMap<String,Object>();
  2121 + for (int i = 0; i < resList.size(); i++) {
  2122 + Map<String, Object> resMap=resList.get(i);
  2123 + String date_1=resMap.get("date").toString();
  2124 + int sjbc=Integer.parseInt(resMap.get("sjbc").toString());
  2125 + int correct=Integer.parseInt(resMap.get("correct").toString());
  2126 +
  2127 + if(date_1.equals("合计")){
  2128 + resMap.put("dxtz", dxtzz);
  2129 + resMap.put("correct",correct+dxtzz);
  2130 + if(sjbc<=0){
  2131 + resMap.put("dxbl", "0");
  2132 + resMap.put("correctbl", "0");
  2133 + }else{
  2134 + resMap.put("dxbl", df.format((double)(dxtzz)/sjbc*100) + "%");
  2135 + resMap.put("correctbl", df.format((double)(correct+dxtzz)/sjbc*100) + "%");
  2136 + }
  2137 +
  2138 +
  2139 + }else{
  2140 + String xlbm=resMap.get("line").toString();
  2141 + int dxtzf=0;
  2142 + for (int j = 0; j < listDot.size(); j++) {
  2143 + SchEditInfoDto seid=listDot.get(j);
  2144 + if(seid.getLineCode().equals(xlbm)){
  2145 + String jstype=seid.getType();
  2146 + String json="";
  2147 + if(seid.getJsonArray()!=null){
  2148 + json =seid.getJsonArray().toString();
  2149 + }
  2150 + if(!json.equals("")){
  2151 + if(jstype.equals("FCXXWT")){
  2152 + JSONArray jsonArray = JSONArray.parseArray(json);
  2153 + for (int x = 0; x < jsonArray.size(); x++) {
  2154 + Map<String, Object> jsonObject=jsonArray.getJSONObject(x);
  2155 + String title=jsonObject.get("title")==null?"":jsonObject.get("title").toString();
  2156 + if(mapSchId.get(String.valueOf(seid.getSchId()))==null){
  2157 + if(title.equals("调整实发时间") || title.equals("调整实达时间")){
  2158 + if(jsonObject.get("old")==null){
  2159 + dxtzf++;
  2160 + dxtzz++;
  2161 + mapSchId.put(String.valueOf(seid.getSchId()), seid.getSchId());
  2162 + }
  2163 + }
  2164 + }
  2165 +
  2166 + }
  2167 + }
  2168 + if(jstype.equals("SFTZ")){
  2169 + Gson gson = new Gson();
  2170 + Map<String, Object> map_js = new HashMap<String, Object>();
  2171 + map_js = gson.fromJson(json, map.getClass());
  2172 + if(mapSchId.get(String.valueOf(seid.getSchId()))==null){
  2173 + if(map_js.get("old")==null){
  2174 + dxtzf++;
  2175 + dxtzz++;
  2176 + mapSchId.put(String.valueOf(seid.getSchId()), seid.getSchId());
  2177 + }
  2178 + }
  2179 + }
  2180 + }
  2181 + }
  2182 + }
  2183 + resMap.put("dxtz", dxtzf);
  2184 + resMap.put("correct",correct+dxtzf);
  2185 + if(sjbc<=0){
  2186 + resMap.put("dxbl", "0");
  2187 + resMap.put("correctbl", "0");
  2188 + }else{
  2189 + resMap.put("dxbl", df.format((double)(dxtzf)/sjbc*100) + "%");
  2190 + resMap.put("correctbl", df.format((double)(correct+dxtzf)/sjbc*100) + "%");
  2191 + }
  2192 + resMap.put("xlname",BasicData.lineCode2NameMap.get(xlbm));
  2193 + }
  2194 + }
  2195 +
2104 return resList; 2196 return resList;
2105 } 2197 }
2106 2198
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
@@ -668,25 +668,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -668,25 +668,23 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
668 * @return String 668 * @return String
669 */ 669 */
670 public String newTextFileToFTP(List<Object[]> objects,Integer lineId) { 670 public String newTextFileToFTP(List<Object[]> objects,Integer lineId) {
671 -  
672 // 返回值String 671 // 返回值String
673 String stationRStr = ""; 672 String stationRStr = "";
674 -  
675 // windows下的文本文件换行符 673 // windows下的文本文件换行符
676 //String enterStr = "\r\n"; 674 //String enterStr = "\r\n";
677 -  
678 // linux/unix下的文本文件换行符 675 // linux/unix下的文本文件换行符
679 String enterStr = "\r"; 676 String enterStr = "\r";
680 - 677 + int defaultZdxh = 0;
681 if(objects.size()>0) { 678 if(objects.size()>0) {
682 -  
683 for(int i = 0; i<objects.size();i++) { 679 for(int i = 0; i<objects.size();i++) {
684 - 680 + defaultZdxh ++ ;
685 // 经度 681 // 经度
686 - String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString(); 682 + String lng = objects.get(i)[0].equals("") ? "0" : objects.get(i)[0].toString();
687 683
688 // 纬度 684 // 纬度
689 - String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString(); 685 + String lat = objects.get(i)[1].equals("") ? "0" : objects.get(i)[1].toString();
  686 +
  687 + Point point = new Point(Double.valueOf(lng), Double.valueOf(lat));
690 688
691 lat = "\t" + lat; 689 lat = "\t" + lat;
692 690
@@ -696,23 +694,32 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -696,23 +694,32 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
696 String stationMake = ""; 694 String stationMake = "";
697 695
698 if(stationMakeStr.equals("E")) { 696 if(stationMakeStr.equals("E")) {
699 -  
700 stationMake = "\t2"; 697 stationMake = "\t2";
701 -  
702 }else { 698 }else {
703 -  
704 stationMake ="\t1"; 699 stationMake ="\t1";
705 -  
706 } 700 }
707 701
708 // 站点序号 702 // 站点序号
709 - String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString(); 703 + // String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString();
  704 + String stationNo = String.valueOf(defaultZdxh);
710 705
711 stationNo = "\t" + stationNo; 706 stationNo = "\t" + stationNo;
712 707
713 // 站点编码 708 // 站点编码
714 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString(); 709 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString();
715 710
  711 + int len = stationCode.length();
  712 + if(len<8) {
  713 + int dx = 8 - len;
  714 + String addStr = "";
  715 + for(int p =0;p<dx;p++) {
  716 + addStr = addStr + "0";
  717 + }
  718 + stationCode = addStr + stationCode;
  719 + }else if(len>8){
  720 + stationCode = stationCode.substring(8);
  721 + }
  722 +
716 stationCode = "\t" +stationCode; 723 stationCode = "\t" +stationCode;
717 724
718 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; 725 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000;
@@ -732,41 +739,33 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -732,41 +739,33 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
732 739
733 // 限速 740 // 限速
734 String sleepStr = ""; 741 String sleepStr = "";
735 -  
736 // 方向 742 // 方向
737 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString()); 743 int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString());
738 -  
739 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ 744 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
740 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); 745 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
741 -  
742 if(sobje.size()==1) { 746 if(sobje.size()==1) {
743 -  
744 - double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString());  
745 -  
746 - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr);  
747 - 747 + int dsleepStr = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.valueOf(sobje.get(0)[2].toString());
  748 + sleepStr = "\t" + String.valueOf(dsleepStr);
748 }else if(sobje.size()>1){ 749 }else if(sobje.size()>1){
749 -  
750 - /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */  
751 for(int j =0;j<sobje.size();j++) { 750 for(int j =0;j<sobje.size();j++) {
752 -  
753 - String sectionName = sobje.get(j)[3].toString();  
754 -  
755 - String sectionNameA[] = sectionName.split("至");  
756 -  
757 - if(stationName.equals(sectionNameA[0])){  
758 -  
759 - /*sleepStr = sobje.get(j)[2].toString();*/  
760 -  
761 - double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString());  
762 -  
763 - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt);  
764 - 751 + double dsleepStrt = sobje.get(j)[2] == null || sobje.get(j)[2].equals("") ? 60d : Double.valueOf(sobje.get(j)[2].toString());
  752 + String pointsStr = sobje.get(j)[1]==null || sobje.get(j)[1].equals("") ? null : sobje.get(j)[1].toString();
  753 + pointsStr = pointsStr.substring(11, pointsStr.length()-1);
  754 + List<Point> ps = new ArrayList<>();
  755 + String[] pArray = pointsStr.split(",");
  756 + for(int a = 0; a <pArray.length; a++) {
  757 + String[] tmepA = pArray[a].split(" ");
  758 + Point temp = new Point(Double.valueOf(tmepA[0]), Double.valueOf(tmepA[1]));
  759 + ps.add(temp);
  760 + }
  761 + if(GeoUtils.isInSection(ps, point)) {
  762 + sleepStr = "\t" + String.valueOf((int)dsleepStrt);
  763 + break;
765 } 764 }
766 -  
767 } 765 }
768 } 766 }
769 - 767 + if(sleepStr.equals(""))
  768 + sleepStr = "\t" + "60";
770 stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; 769 stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
771 } 770 }
772 771
@@ -785,9 +784,12 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -785,9 +784,12 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
785 for(int i = 0; i<objects.size();i++) { 784 for(int i = 0; i<objects.size();i++) {
786 if(Integer.valueOf(objects.get(i)[8].toString())==0) { 785 if(Integer.valueOf(objects.get(i)[8].toString())==0) {
787 // 经度 786 // 经度
788 - String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString(); 787 + String lng = objects.get(i)[0].equals("") ? "0" : objects.get(i)[0].toString();
  788 +
789 // 纬度 789 // 纬度
790 - String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString(); 790 + String lat = objects.get(i)[1].equals("") ? "0" : objects.get(i)[1].toString();
  791 +
  792 + Point point = new Point(Double.valueOf(lng), Double.valueOf(lat));
791 lat = "\t" + lat; 793 lat = "\t" + lat;
792 // 站点类型 794 // 站点类型
793 String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString(); 795 String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString();
@@ -802,6 +804,17 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -802,6 +804,17 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
802 String stationNo = "\t" + xh; 804 String stationNo = "\t" + xh;
803 // 站点编码 805 // 站点编码
804 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString(); 806 String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString();
  807 + int len = stationCode.length();
  808 + if(len<8) {
  809 + int dx = 8 - len;
  810 + String addStr = "";
  811 + for(int p =0;p<dx;p++) {
  812 + addStr = addStr + "0";
  813 + }
  814 + stationCode = addStr + stationCode;
  815 + }else if(len>8){
  816 + stationCode = stationCode.substring(8);
  817 + }
805 stationCode = "\t" +stationCode; 818 stationCode = "\t" +stationCode;
806 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000; 819 double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000;
807 String tempDistc = String.valueOf((int) dis); 820 String tempDistc = String.valueOf((int) dis);
@@ -817,20 +830,28 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ @@ -817,20 +830,28 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
817 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */ 830 /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
818 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions); 831 List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
819 if(sobje.size()==1) { 832 if(sobje.size()==1) {
820 - double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString());  
821 - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr); 833 + int dsleepStr = sobje.get(0)[2] == null || sobje.get(0)[2].equals("") ? 60 : Integer.valueOf(sobje.get(0)[2].toString());
  834 + sleepStr = "\t" + String.valueOf(dsleepStr);
822 }else if(sobje.size()>1){ 835 }else if(sobje.size()>1){
823 - /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */  
824 for(int j =0;j<sobje.size();j++) { 836 for(int j =0;j<sobje.size();j++) {
825 - String sectionName = sobje.get(j)[3].toString();  
826 - String sectionNameA[] = sectionName.split("至");  
827 - if(stationName.equals(sectionNameA[0])){  
828 - /*sleepStr = sobje.get(j)[2].toString();*/  
829 - double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString());  
830 - sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt); 837 + double dsleepStrt = sobje.get(j)[2] == null || sobje.get(j)[2].equals("") ? 60d : Double.valueOf(sobje.get(j)[2].toString());
  838 + String pointsStr = sobje.get(j)[1]==null || sobje.get(j)[1].equals("") ? null : sobje.get(j)[1].toString();
  839 + pointsStr = pointsStr.substring(11, pointsStr.length()-1);
  840 + List<Point> ps = new ArrayList<>();
  841 + String[] pArray = pointsStr.split(",");
  842 + for(int a = 0; a <pArray.length; a++) {
  843 + String[] tmepA = pArray[a].split(" ");
  844 + Point temp = new Point(Double.valueOf(tmepA[0]), Double.valueOf(tmepA[1]));
  845 + ps.add(temp);
  846 + }
  847 + if(GeoUtils.isInSection(ps, point)) {
  848 + sleepStr = "\t" + String.valueOf((int)dsleepStrt);
  849 + break;
831 } 850 }
832 } 851 }
833 } 852 }
  853 + if(sleepStr.equals(""))
  854 + sleepStr = "\t" + "60";
834 xh++; 855 xh++;
835 restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr; 856 restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
836 } 857 }
src/main/java/com/bsth/service/impl/StationServiceImpl.java
@@ -930,7 +930,8 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem @@ -930,7 +930,8 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
930 Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString()); 930 Float x = map.get("x").equals("") ? null : Float.parseFloat(map.get("x").toString());
931 Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString()); 931 Float y = map.get("y").equals("") ? null : Float.parseFloat(map.get("y").toString());
932 // 更新 932 // 更新
933 - repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, destroy, radius, shapesType, versions, descriptions, stationId); 933 + /*repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, destroy, radius, shapesType, versions, descriptions, stationId);*/
  934 + repository.stationUpdate(stationCod, zdmc, roadCoding, dbType, bJwpoints, gLonx, gLaty, x, y, bPloygonGrid, gPloygonGrid, radius, shapesType, versions, descriptions, stationId);
934 // 站点路由Id 935 // 站点路由Id
935 Integer stationRouteId = map.get("stationRouteId").equals("") ? null : Integer.parseInt(map.get("stationRouteId").toString()); 936 Integer stationRouteId = map.get("stationRouteId").equals("") ? null : Integer.parseInt(map.get("stationRouteId").toString());
936 StationRoute resultS = routeRepository.findOne(stationRouteId); 937 StationRoute resultS = routeRepository.findOne(stationRouteId);
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
@@ -16,6 +16,7 @@ import com.bsth.repository.schedule.*; @@ -16,6 +16,7 @@ import com.bsth.repository.schedule.*;
16 import com.bsth.repository.traffic.SKBUploadLoggerRepository; 16 import com.bsth.repository.traffic.SKBUploadLoggerRepository;
17 import com.bsth.security.util.SecurityUtils; 17 import com.bsth.security.util.SecurityUtils;
18 import com.bsth.service.TrafficManageService; 18 import com.bsth.service.TrafficManageService;
  19 +import com.bsth.service.traffic.YgcBasicDataService;
19 import com.bsth.util.TimeUtils; 20 import com.bsth.util.TimeUtils;
20 import com.bsth.util.db.DBUtils_MS; 21 import com.bsth.util.db.DBUtils_MS;
21 import com.bsth.webService.trafficManage.geotool.services.InternalPortType; 22 import com.bsth.webService.trafficManage.geotool.services.InternalPortType;
@@ -23,6 +24,7 @@ import com.bsth.webService.trafficManage.geotool.services.Internal; @@ -23,6 +24,7 @@ import com.bsth.webService.trafficManage.geotool.services.Internal;
23 import com.bsth.webService.trafficManage.org.tempuri.Results; 24 import com.bsth.webService.trafficManage.org.tempuri.Results;
24 import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; 25 import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator;
25 import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; 26 import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap;
  27 +import org.apache.commons.lang.StringUtils;
26 import org.apache.commons.lang.time.DateUtils; 28 import org.apache.commons.lang.time.DateUtils;
27 import org.slf4j.Logger; 29 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory; 30 import org.slf4j.LoggerFactory;
@@ -99,7 +101,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -99,7 +101,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
99 101
100 // 线路站点repository 102 // 线路站点repository
101 @Autowired 103 @Autowired
102 - private StationRepository stationRepository; 104 + private YgcBasicDataService ygcBasicDataService;
103 105
104 106
105 // 运管处接口 107 // 运管处接口
@@ -122,11 +124,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -122,11 +124,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
122 DecimalFormat format = new DecimalFormat("0.00"); 124 DecimalFormat format = new DecimalFormat("0.00");
123 125
124 // 用户名 126 // 用户名
125 - private final String userNameXl = "pudong";  
126 - // 密码  
127 - private final String passwordXl = "pudong123";  
128 -  
129 - // 用户名  
130 private final String userNameOther = "user"; 127 private final String userNameOther = "user";
131 // 密码 128 // 密码
132 private final String passwordOther = "user"; 129 private final String passwordOther = "user";
@@ -134,34 +131,25 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -134,34 +131,25 @@ public class TrafficManageServiceImpl implements TrafficManageService{
134 * 上传线路信息 131 * 上传线路信息
135 */ 132 */
136 @Override 133 @Override
137 - public String setXL(Map<String, Object> param) { 134 + public String setXL(String ids) {
138 String result = "failure"; 135 String result = "failure";
139 StringBuffer sBuffer = new StringBuffer(); 136 StringBuffer sBuffer = new StringBuffer();
  137 + String[] idArray = ids.split(",");
140 try { 138 try {
141 - Map<String,Object> map = new HashMap<String,Object>();  
142 - map.put("lineCode_eq", param.get("xl.lineCode_like")+"");  
143 - Iterator<Line> lineIterator;  
144 - Line line = null;  
145 - if(param.get("xl.lineCode_like").equals("")){  
146 - lineIterator = lineRepository.findAll().iterator();  
147 - }else { 139 + for (String id : idArray) {
  140 + Map<String,Object> map = new HashMap<>();
  141 + map.put("lineCode_eq", id);
  142 + Line line ;
148 line = lineRepository.findOne(new CustomerSpecs<Line>(map)); 143 line = lineRepository.findOne(new CustomerSpecs<Line>(map));
149 - }  
150 - List<StationRoute> upStationsList = null;// 上行站点路由集  
151 - List<StationRoute> downStationsList = null;// 下行站点路由集  
152 - List<LineInformation> lineInformationsList = null;  
153 - LineInformation lineInformation = null;  
154 - sBuffer.append("<Data>");  
155 - sBuffer.append("<RequestOrg>上海巴士拓华科技发展有限公司</RequestOrg>");  
156 - sBuffer.append("<DataList>");  
157 -// while(lineIterator.hasNext()){  
158 -// line = lineIterator.next();  
159 -// if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null  
160 -// || line.getInUse() == 0){  
161 -// continue;  
162 -// }  
163 - if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null  
164 - || line.getInUse() == 0){ 144 + if(line == null){
  145 + continue;
  146 + }
  147 + List<StationRoute> upStationsList ;// 上行站点路由集
  148 + List<StationRoute> downStationsList = null;// 下行站点路由集
  149 + sBuffer.append("<Data>");
  150 + sBuffer.append("<RequestOrg>上海巴士拓华科技发展有限公司</RequestOrg>");
  151 + sBuffer.append("<DataList>");
  152 + if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){
165 return result; 153 return result;
166 } 154 }
167 sBuffer.append("<LINE_ID>").append(line.getId()).append("</LINE_ID>"); 155 sBuffer.append("<LINE_ID>").append(line.getId()).append("</LINE_ID>");
@@ -190,32 +178,24 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -190,32 +178,24 @@ public class TrafficManageServiceImpl implements TrafficManageService{
190 packagStationPointXml(downStationsList, sBuffer, startId); 178 packagStationPointXml(downStationsList, sBuffer, startId);
191 } 179 }
192 sBuffer.append("</LinePointList>"); 180 sBuffer.append("</LinePointList>");
193 -// }  
194 - sBuffer.append("</DataList>");  
195 - sBuffer.append("</Data>");  
196 - System.out.println(sBuffer.toString());  
197 - if(sBuffer.indexOf("<XL>") != -1){  
198 - portType = new Internal().getInternalHttpSoap11Endpoint();  
199 - String portResult = portType.setXL(userNameXl, passwordXl, sBuffer.toString());  
200 - String portArray[] = portResult.split("\n");  
201 - if(portArray.length >= 4){  
202 - // 返回数据的编码  
203 - String returnCode = portArray[1].substring(portArray[1].indexOf(">")+1,portArray[1].indexOf("</"));  
204 - // 返回的信息  
205 - String returnDescription = portArray[2].substring(portArray[2].indexOf(">")+1,portArray[2].indexOf("</"));  
206 - if(returnCode.equals("1")){  
207 - result = "success";  
208 - }else{  
209 - result = returnDescription;  
210 - } 181 + sBuffer.append("</DataList>");
  182 + sBuffer.append("</Data>");
  183 + // 调用上传方法
  184 + result = ygcBasicDataService.invokeMethod("UpdateBusLineStation",sBuffer.toString());
  185 + String str = "ReturnCode";
  186 + // 解析返回值
  187 + result = result.substring(result.indexOf(str)+str.length()+1,result.lastIndexOf(str)-2);
  188 + if(result.equals("1")){
  189 + result = "success";
  190 + }else{
  191 + result = "failure";
211 } 192 }
  193 + logger.info("setXL:"+sBuffer.toString());
  194 + logger.info("setXL:"+result);
212 } 195 }
213 } catch (Exception e) { 196 } catch (Exception e) {
214 logger.error("setXL:",e); 197 logger.error("setXL:",e);
215 e.printStackTrace(); 198 e.printStackTrace();
216 - }finally{  
217 - logger.info("setXL:"+sBuffer.toString());  
218 - logger.info("setXL:"+result);  
219 } 199 }
220 return result; 200 return result;
221 } 201 }
@@ -1146,11 +1126,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -1146,11 +1126,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1146 }else{ 1126 }else{
1147 flag = 0; 1127 flag = 0;
1148 } 1128 }
1149 - result += flag;  
1150 - if(i !=ruleDayArray.length -1){  
1151 - result +=","; 1129 + if(flag > 0){
  1130 + result += flag + ",";
1152 } 1131 }
1153 } 1132 }
  1133 + // 去掉最后一个字符
  1134 + if(StringUtils.endsWith(result,",")){
  1135 + result = StringUtils.removeEnd(result,",");
  1136 + }
1154 return result; 1137 return result;
1155 } 1138 }
1156 /** 1139 /**
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
@@ -2,6 +2,7 @@ package com.bsth.service.realcontrol.impl; @@ -2,6 +2,7 @@ package com.bsth.service.realcontrol.impl;
2 2
3 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
4 import com.bsth.data.BasicData; 4 import com.bsth.data.BasicData;
  5 +import com.bsth.data.Station2ParkBuffer;
5 import com.bsth.data.schedule.DayOfSchedule; 6 import com.bsth.data.schedule.DayOfSchedule;
6 import com.bsth.entity.realcontrol.ChildTaskPlan; 7 import com.bsth.entity.realcontrol.ChildTaskPlan;
7 import com.bsth.entity.realcontrol.ScheduleRealInfo; 8 import com.bsth.entity.realcontrol.ScheduleRealInfo;
@@ -45,14 +46,21 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon @@ -45,14 +46,21 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
45 try { 46 try {
46 ScheduleRealInfo sch = dayOfSchedule.get(t.getSchedule().getId()); 47 ScheduleRealInfo sch = dayOfSchedule.get(t.getSchedule().getId());
47 //保存起终点名称 48 //保存起终点名称
48 - String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_"; 49 + //String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_";
49 if(StringUtils.isEmpty(t.getStartStationName())) 50 if(StringUtils.isEmpty(t.getStartStationName()))
50 - t.setStartStationName(BasicData.getStationNameByCode(t.getStartStation(), prefix)); 51 + t.setStartStationName(getStationName(sch.getXlBm(), t.getStartStation()));
  52 + //t.setStartStationName(BasicData.getStationNameByCode(t.getStartStation(), prefix));
51 53
52 if(StringUtils.isEmpty(t.getEndStationName())) 54 if(StringUtils.isEmpty(t.getEndStationName()))
53 - t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix)); 55 + t.setEndStationName(getStationName(sch.getXlBm(), t.getEndStation()));
  56 + //t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix));
54 if(t.getDestroyReason() == null) 57 if(t.getDestroyReason() == null)
55 t.setDestroyReason(""); 58 t.setDestroyReason("");
  59 +
  60 + //烂班说明,为兼容之前的数据结构
  61 + if(t.isDestroy() && StringUtils.isEmpty(t.getDestroyReason()))
  62 + t.setDestroyReason(t.getReason());
  63 +
56 //先持久化子任务 64 //先持久化子任务
57 rs = super.save(t); 65 rs = super.save(t);
58 //关联主任务 66 //关联主任务
@@ -60,6 +68,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon @@ -60,6 +68,9 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
60 dayOfSchedule.save(sch); 68 dayOfSchedule.save(sch);
61 //直接持久化 69 //直接持久化
62 //scheduleRealInfoRepository.save(sch); 70 //scheduleRealInfoRepository.save(sch);
  71 + //站到场对照
  72 + t.setSchedule(sch);
  73 + Station2ParkBuffer.put(t);
63 74
64 rs.put("status", ResponseCode.SUCCESS); 75 rs.put("status", ResponseCode.SUCCESS);
65 rs.put("t", sch); 76 rs.put("t", sch);
@@ -71,6 +82,17 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon @@ -71,6 +82,17 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
71 return rs; 82 return rs;
72 } 83 }
73 84
  85 + private String getStationName(String lineCode, String stationCode){
  86 + String name;
  87 + String prefix1 = lineCode + "_" + 0 + "_",
  88 + prefix2 = lineCode + "_" + 1 + "_";
  89 +
  90 + name = BasicData.getStationNameByCode(stationCode, prefix1);
  91 + if(StringUtils.isEmpty(name))
  92 + name = BasicData.getStationNameByCode(stationCode, prefix2);
  93 + return name;
  94 + }
  95 +
74 @Override 96 @Override
75 public Map<String, Object> delete(Long id) { 97 public Map<String, Object> delete(Long id) {
76 Map<String, Object> rs; 98 Map<String, Object> rs;
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -15,9 +15,11 @@ import com.bsth.data.schedule.SchAttrCalculator; @@ -15,9 +15,11 @@ import com.bsth.data.schedule.SchAttrCalculator;
15 import com.bsth.data.schedule.ScheduleComparator; 15 import com.bsth.data.schedule.ScheduleComparator;
16 import com.bsth.data.schedule.edit_logs.FormLogger; 16 import com.bsth.data.schedule.edit_logs.FormLogger;
17 import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger; 17 import com.bsth.data.schedule.edit_logs.ScheduleModifyLogger;
  18 +import com.bsth.data.schedule.edit_logs.loggers.AfterwardsLogger;
18 import com.bsth.data.schedule.edit_logs.loggers.FcxxwtLogger; 19 import com.bsth.data.schedule.edit_logs.loggers.FcxxwtLogger;
19 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto; 20 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
20 import com.bsth.data.schedule.late_adjust.LateAdjustHandle; 21 import com.bsth.data.schedule.late_adjust.LateAdjustHandle;
  22 +import com.bsth.data.utils.CustomStringUtils;
21 import com.bsth.entity.Cars; 23 import com.bsth.entity.Cars;
22 import com.bsth.entity.Line; 24 import com.bsth.entity.Line;
23 import com.bsth.entity.Personnel; 25 import com.bsth.entity.Personnel;
@@ -1687,45 +1689,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1687,45 +1689,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1687 public List<Map<String, Object>> accountPx(String line, String date, 1689 public List<Map<String, Object>> accountPx(String line, String date,
1688 String code, String xlName, String px) { 1690 String code, String xlName, String px) {
1689 // List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px); 1691 // List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px);
  1692 + if(!code.trim().equals("")){
  1693 + code=BasicData.deviceId2NbbmMap.inverse().get(code);
  1694 + }
  1695 + String fgs="";
  1696 + List<Line> lineList= lineRepository.findLineBygsBm("", "", line);
  1697 + if(lineList.size()>0){
  1698 + Line l=lineList.get(0);
  1699 + fgs=BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany()+"_"+l.getCompany());
  1700 + }
1690 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); 1701 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
1691 - String sql= "SELECT c.company,r.request_code,FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d %T') as date,"  
1692 - + "c.inside_code FROM bsth_v_report_80 r LEFT JOIN bsth_c_cars c "  
1693 - + "ON c.equipment_code = r.device_id where "  
1694 - + "FROM_UNIXTIME(r.timestamp/1000,'%Y-%m-%d') = '"+date +"'"  
1695 - + "and r.line_id = "+line+" and c.inside_code like '%"+code+"%'"  
1696 - + " order by c.inside_code "+px; 1702 + String sql= "SELECT request_code,FROM_UNIXTIME(TIMESTAMP / 1000,'%Y-%m-%d %T') as TIMESTAMP ,"
  1703 + + " device_id FROM bsth_v_report_80 WHERE "
  1704 + + " FROM_UNIXTIME( TIMESTAMP / 1000,'%Y-%m-%d') = '"+date+"' AND"
  1705 + + " line_id = '"+line+"' and device_id like '%"+code+"%'";
1697 Map<String, Object> map; 1706 Map<String, Object> map;
1698 List<Object[]> lsitObj = jdbcTemplate.query(sql, 1707 List<Object[]> lsitObj = jdbcTemplate.query(sql,
1699 new RowMapper<Object[]>() { 1708 new RowMapper<Object[]>() {
1700 @Override 1709 @Override
1701 public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException { 1710 public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException {
1702 - Object[] t = new Object[4];  
1703 - t[0]=rs.getString("company");  
1704 - t[1]=rs.getString("request_code");  
1705 - t[2]=rs.getString("date");  
1706 - t[3]=rs.getString("inside_code"); 1711 + Object[] t = new Object[3];
  1712 + t[0]=rs.getString("request_code");
  1713 + t[1]=rs.getString("TIMESTAMP");
  1714 + t[2]=rs.getString("device_id");
1707 return t; 1715 return t;
1708 } 1716 }
1709 }); 1717 });
1710 int i = 1; 1718 int i = 1;
1711 for (Object[] obj : lsitObj) { 1719 for (Object[] obj : lsitObj) {
1712 if (obj != null) { 1720 if (obj != null) {
1713 - map = new HashMap<String, Object>();  
1714 - map.put("num", i++);  
1715 - map.put("xlName", xlName);  
1716 - map.put("clZbh", obj[3]);  
1717 - map.put("company", obj[0]);  
1718 - map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[1] + "")).toUpperCase());  
1719 - map.put("requestTime", obj[2]);  
1720 - listMap.add(map); 1721 + map = new HashMap<String, Object>();
  1722 + map.put("num", i++);
  1723 + map.put("xlName", xlName);
  1724 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1725 + map.put("company",fgs);
  1726 + map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
  1727 + map.put("requestTime", obj[1]);
  1728 + listMap.add(map);
1721 } 1729 }
1722 } 1730 }
1723 - 1731 + if(listMap.size()>1){
  1732 + if(px.equals("asc")){
  1733 + Collections.sort(listMap,new AccountMap());
  1734 + }else{
  1735 + Collections.sort(listMap,new AccountMap2());
  1736 + }
  1737 + }
1724 return listMap; 1738 return listMap;
1725 } 1739 }
1726 @Override 1740 @Override
1727 public List<Map<String, Object>> account(String line, String date, 1741 public List<Map<String, Object>> account(String line, String date,
1728 String code, String xlName, String type) { 1742 String code, String xlName, String type) {
  1743 + if(!code.trim().equals("")){
  1744 + code=BasicData.deviceId2NbbmMap.inverse().get(code);
  1745 + }
  1746 + String fgs="";
  1747 + List<Line> lineList= lineRepository.findLineBygsBm("", "", line);
  1748 + if(lineList.size()>0){
  1749 + Line l=lineList.get(0);
  1750 + fgs=BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany()+"_"+l.getCompany());
  1751 + }
1729 List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code); 1752 List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code);
1730 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); 1753 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
1731 Map<String, Object> map; 1754 Map<String, Object> map;
@@ -1735,10 +1758,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1735,10 +1758,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1735 map = new HashMap<String, Object>(); 1758 map = new HashMap<String, Object>();
1736 map.put("num", i++); 1759 map.put("num", i++);
1737 map.put("xlName", xlName); 1760 map.put("xlName", xlName);
1738 - map.put("clZbh", obj[3]);  
1739 - map.put("company", obj[0]);  
1740 - map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[1] + "")).toUpperCase());  
1741 - map.put("requestTime", obj[2]); 1761 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  1762 + map.put("company",fgs);
  1763 + map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
  1764 + map.put("requestTime", obj[1]);
1742 listMap.add(map); 1765 listMap.add(map);
1743 } 1766 }
1744 } 1767 }
@@ -2554,11 +2577,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2554,11 +2577,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2554 if (a == 2) { 2577 if (a == 2) {
2555 x = b + 1; 2578 x = b + 1;
2556 y = x * 2; 2579 y = x * 2;
2557 - ;  
2558 } else if (b == 1) { 2580 } else if (b == 1) {
2559 x = b + 1; 2581 x = b + 1;
2560 y = x * 2 - 1; 2582 y = x * 2 - 1;
2561 - ;  
2562 } else { 2583 } else {
2563 x = b; 2584 x = b;
2564 y = 2 * x; 2585 y = 2 * x;
@@ -3040,14 +3061,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3040,14 +3061,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3040 rs.put("status", ResponseCode.ERROR); 3061 rs.put("status", ResponseCode.ERROR);
3041 3062
3042 ScheduleRealInfo oldSch = super.findById(sch.getId()); 3063 ScheduleRealInfo oldSch = super.findById(sch.getId());
  3064 + //事后日志记录
  3065 + AfterwardsLogger aflog = AfterwardsLogger.start(oldSch, "事后调整");
3043 3066
3044 //换车 3067 //换车
3045 if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) { 3068 if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) {
3046 if (!carExist(oldSch.getGsBm(),sch.getClZbh())) { 3069 if (!carExist(oldSch.getGsBm(),sch.getClZbh())) {
3047 rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!"); 3070 rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!");
3048 return rs; 3071 return rs;
3049 - } else 3072 + } else{
  3073 + aflog.log("换车", oldSch.getClZbh(), sch.getClZbh());
3050 oldSch.setClZbh(sch.getClZbh()); 3074 oldSch.setClZbh(sch.getClZbh());
  3075 + }
3051 } 3076 }
3052 3077
3053 //换驾驶员 3078 //换驾驶员
@@ -3057,6 +3082,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3057,6 +3082,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3057 rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员"); 3082 rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员");
3058 return rs; 3083 return rs;
3059 } 3084 }
  3085 + aflog.log("换驾驶员", oldSch.getjGh()+"/"+ oldSch.getjName(), sch.getjGh()+"/"+ sch.getjName());
3060 persoChange(oldSch, sch.getjGh()); 3086 persoChange(oldSch, sch.getjGh());
3061 } 3087 }
3062 3088
@@ -3067,6 +3093,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3067,6 +3093,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3067 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员"); 3093 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员");
3068 return rs; 3094 return rs;
3069 } 3095 }
  3096 + aflog.log("换售票员", oldSch.getsGh()+"/"+ oldSch.getsName(), sch.getsGh()+"/"+ sch.getsName());
3070 persoChangeSPY(oldSch, sch.getsGh()); 3097 persoChangeSPY(oldSch, sch.getsGh());
3071 } 3098 }
3072 3099
@@ -3075,12 +3102,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3075,12 +3102,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3075 boolean dest2 = sch.getStatus() == -1; 3102 boolean dest2 = sch.getStatus() == -1;
3076 if (!dest1 && dest2) { 3103 if (!dest1 && dest2) {
3077 oldSch.destroy(); 3104 oldSch.destroy();
  3105 + aflog.log("烂班");
3078 } 3106 }
3079 else if(dest1 && !dest2){ 3107 else if(dest1 && !dest2){
3080 //撤销烂班 3108 //撤销烂班
3081 oldSch.setJhlc(oldSch.getJhlcOrig()); 3109 oldSch.setJhlc(oldSch.getJhlcOrig());
3082 oldSch.setStatus(0); 3110 oldSch.setStatus(0);
3083 oldSch.calcStatus(); 3111 oldSch.calcStatus();
  3112 + aflog.log("撤销烂班");
3084 } 3113 }
3085 3114
3086 3115
@@ -3089,6 +3118,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3089,6 +3118,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3089 */ 3118 */
3090 if (!oldSch.getJhlc().equals(sch.getJhlc())) { 3119 if (!oldSch.getJhlc().equals(sch.getJhlc())) {
3091 double jhlcNum = sch.getJhlc(); 3120 double jhlcNum = sch.getJhlc();
  3121 + aflog.log("修改班次里程", oldSch.getJhlc(), jhlcNum);
3092 //烂班 3122 //烂班
3093 if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0) 3123 if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0)
3094 oldSch.destroy(); 3124 oldSch.destroy();
@@ -3101,15 +3131,30 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3101,15 +3131,30 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3101 } 3131 }
3102 3132
3103 //待发时间 3133 //待发时间
3104 - oldSch.setDfsj(sch.getDfsj()); 3134 + if(!CustomStringUtils.equals(oldSch.getDfsj(), sch.getDfsj())){
  3135 + aflog.log("修改待发时间", oldSch.getDfsj(), sch.getDfsj());
  3136 + oldSch.setDfsj(sch.getDfsj());
  3137 + }
3105 //实发时间 3138 //实发时间
3106 - oldSch.setFcsjActual(sch.getFcsjActual()); 3139 + if(!CustomStringUtils.equals(oldSch.getFcsjActual(), sch.getFcsjActual())){
  3140 + aflog.log("修改实发时间", oldSch.getFcsjActual(), sch.getFcsjActual());
  3141 + oldSch.setFcsjActual(sch.getFcsjActual());
  3142 + }
3107 //实际终点 3143 //实际终点
3108 - oldSch.setZdsjActual(sch.getZdsjActual()); 3144 + if(!CustomStringUtils.equals(oldSch.getZdsjActual(), sch.getZdsjActual())){
  3145 + aflog.log("修改实达时间", oldSch.getZdsjActual(), sch.getZdsjActual());
  3146 + oldSch.setZdsjActual(sch.getZdsjActual());
  3147 + }
  3148 +
3109 //备注 3149 //备注
3110 - oldSch.setRemarks(sch.getRemarks()); 3150 + if(!CustomStringUtils.equals(oldSch.getRemarks(), sch.getRemarks())){
  3151 + aflog.log("修改备注", oldSch.getRemarks(), sch.getRemarks());
  3152 + oldSch.setRemarks(sch.getRemarks());
  3153 + }
3111 3154
3112 scheduleRealInfoRepository.save(oldSch); 3155 scheduleRealInfoRepository.save(oldSch);
  3156 +
  3157 + aflog.end();
3113 rs.put("status", ResponseCode.SUCCESS); 3158 rs.put("status", ResponseCode.SUCCESS);
3114 return rs; 3159 return rs;
3115 } 3160 }
@@ -3714,7 +3759,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3714,7 +3759,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3714 List<ScheduleRealInfo> list3 = this.realScheduleList(line, date); 3759 List<ScheduleRealInfo> list3 = this.realScheduleList(line, date);
3715 3760
3716 Map<String, Object> nMap=new HashMap<String, Object>(); 3761 Map<String, Object> nMap=new HashMap<String, Object>();
3717 - nMap.put("date", date); 3762 + nMap.put("date", xlName+date);
3718 nMap.put("jls", list1.get(0).get("jls")); 3763 nMap.put("jls", list1.get(0).get("jls"));
3719 nMap.put("sjgl", list1.get(0).get("sjgl")); 3764 nMap.put("sjgl", list1.get(0).get("sjgl"));
3720 for (Map<String, Object> m : list1) { 3765 for (Map<String, Object> m : list1) {
@@ -4199,4 +4244,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4199,4 +4244,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4199 } 4244 }
4200 return rs; 4245 return rs;
4201 } 4246 }
4202 -}  
4203 \ No newline at end of file 4247 \ No newline at end of file
  4248 +}
  4249 +
  4250 +class AccountMap implements Comparator<Map<String, Object>>{
  4251 + @Override
  4252 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  4253 + // TODO Auto-generated method stub
  4254 + return o1.get("clZbh").toString().compareTo(o2.get("clZbh").toString());
  4255 + }
  4256 +}
  4257 +
  4258 +class AccountMap2 implements Comparator<Map<String, Object>>{
  4259 + @Override
  4260 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  4261 + // TODO Auto-generated method stub
  4262 + return o2.get("clZbh").toString().compareTo(o1.get("clZbh").toString());
  4263 + }
  4264 +}
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
@@ -866,7 +866,9 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -866,7 +866,9 @@ public class CulateMileageServiceImpl implements CulateMileageService{
866 ChildTaskPlan childTaskPlan = it.next(); 866 ChildTaskPlan childTaskPlan = it.next();
867 if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){ 867 if(childTaskPlan.getType2().equals("2")||childTaskPlan.getType2().equals("3")){
868 if (childTaskPlan.isDestroy()) { 868 if (childTaskPlan.isDestroy()) {
869 - zrwjcclc=Arith.add(zrwjcclc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage()); 869 + if(childTaskPlan.getReason().equals(item)){
  870 + zrwjcclc=Arith.add(zrwjcclc,childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage());
  871 + }
870 } 872 }
871 } 873 }
872 } 874 }
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
1 package com.bsth.service.report.impl; 1 package com.bsth.service.report.impl;
2 -import java.sql.Connection;  
3 -import java.sql.PreparedStatement;  
4 -import java.sql.ResultSet;  
5 -import java.sql.SQLException;  
6 -import java.text.DecimalFormat;  
7 -import java.text.ParseException;  
8 -import java.text.SimpleDateFormat;  
9 -import java.util.ArrayList;  
10 -import java.util.Calendar;  
11 -import java.util.Collections;  
12 -import java.util.Date;  
13 -import java.util.HashMap;  
14 -import java.util.Iterator;  
15 -import java.util.List;  
16 -import java.util.Map;  
17 -import java.util.Set;  
18 -  
19 -import org.apache.commons.lang.StringUtils;  
20 -import org.dbunit.dataset.DataSetException;  
21 -import org.slf4j.Logger;  
22 -import org.slf4j.LoggerFactory;  
23 -import org.springframework.beans.factory.annotation.Autowired;  
24 -import org.springframework.jdbc.core.JdbcTemplate;  
25 -import org.springframework.jdbc.core.RowMapper;  
26 -import org.springframework.scheduling.commonj.ScheduledTimerListener;  
27 -import org.springframework.stereotype.Service;  
28 -  
29 import com.bsth.data.BasicData; 2 import com.bsth.data.BasicData;
30 import com.bsth.entity.Line; 3 import com.bsth.entity.Line;
31 import com.bsth.entity.Personnel; 4 import com.bsth.entity.Personnel;
32 import com.bsth.entity.StationRoute; 5 import com.bsth.entity.StationRoute;
33 import com.bsth.entity.excep.ArrivalInfo; 6 import com.bsth.entity.excep.ArrivalInfo;
34 -import com.bsth.entity.mcy_forms.Operationservice;  
35 import com.bsth.entity.oil.Dlb; 7 import com.bsth.entity.oil.Dlb;
36 import com.bsth.entity.oil.Ylb; 8 import com.bsth.entity.oil.Ylb;
37 import com.bsth.entity.realcontrol.ChildTaskPlan; 9 import com.bsth.entity.realcontrol.ChildTaskPlan;
38 import com.bsth.entity.realcontrol.ScheduleRealInfo; 10 import com.bsth.entity.realcontrol.ScheduleRealInfo;
39 -import com.bsth.entity.schedule.SchedulePlanInfo;  
40 import com.bsth.repository.LineRepository; 11 import com.bsth.repository.LineRepository;
41 import com.bsth.repository.StationRouteRepository; 12 import com.bsth.repository.StationRouteRepository;
42 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 13 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
@@ -44,7 +15,24 @@ import com.bsth.service.report.CulateMileageService; @@ -44,7 +15,24 @@ import com.bsth.service.report.CulateMileageService;
44 import com.bsth.service.report.ReportService; 15 import com.bsth.service.report.ReportService;
45 import com.bsth.util.Arith; 16 import com.bsth.util.Arith;
46 import com.bsth.util.ComparableJob; 17 import com.bsth.util.ComparableJob;
  18 +import com.bsth.util.ReportUtils;
47 import com.bsth.util.db.DBUtils_MS; 19 import com.bsth.util.db.DBUtils_MS;
  20 +import org.apache.commons.lang.StringUtils;
  21 +import org.slf4j.Logger;
  22 +import org.slf4j.LoggerFactory;
  23 +import org.springframework.beans.factory.annotation.Autowired;
  24 +import org.springframework.jdbc.core.JdbcTemplate;
  25 +import org.springframework.jdbc.core.RowMapper;
  26 +import org.springframework.stereotype.Service;
  27 +
  28 +import java.sql.Connection;
  29 +import java.sql.PreparedStatement;
  30 +import java.sql.ResultSet;
  31 +import java.sql.SQLException;
  32 +import java.text.DecimalFormat;
  33 +import java.text.ParseException;
  34 +import java.text.SimpleDateFormat;
  35 +import java.util.*;
48 36
49 @Service 37 @Service
50 public class ReportServiceImpl implements ReportService{ 38 public class ReportServiceImpl implements ReportService{
@@ -582,15 +570,15 @@ public class ReportServiceImpl implements ReportService{ @@ -582,15 +570,15 @@ public class ReportServiceImpl implements ReportService{
582 String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); 570 String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
583 571
584 //查询全程 572 //查询全程
585 - String sqlqc="select t.*,x.station_name as qdz_name from ( "  
586 - + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir FROM bsth_c_s_ttinfo_detail " 573 + String sqlqc="select t.* from ( "
  574 + + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
587 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') " 575 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
588 + " and fcsj <='"+minfcsj+"') " 576 + " and fcsj <='"+minfcsj+"') "
589 + " union " 577 + " union "
590 - + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir FROM bsth_c_s_ttinfo_detail " 578 + + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
591 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') " 579 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
592 + " and fcsj > '"+minfcsj+"') " 580 + " and fcsj > '"+minfcsj+"') "
593 - + "order by xl_dir,xh,fcsj ) t left join bsth_c_station x on t.qdz=x.id"; 581 + + "order by xl_dir,xh,fcsj ) t ";
594 List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc, 582 List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc,
595 new RowMapper<Map<String, String>>(){ 583 new RowMapper<Map<String, String>>(){
596 @Override 584 @Override
@@ -631,12 +619,12 @@ public class ReportServiceImpl implements ReportService{ @@ -631,12 +619,12 @@ public class ReportServiceImpl implements ReportService{
631 sxbc++; 619 sxbc++;
632 upfcsj.add(m.get("fcsj")); 620 upfcsj.add(m.get("fcsj"));
633 if(sxqdz.length() == 0 && m.containsKey("qdz_name")) 621 if(sxqdz.length() == 0 && m.containsKey("qdz_name"))
634 - sxqdz = m.get("qdz_name"); 622 + sxqdz = m.get("qdz_name")==null?"":m.get("qdz_name").toString();
635 } else { 623 } else {
636 xxbc++; 624 xxbc++;
637 downfcsj.add(m.get("fcsj")); 625 downfcsj.add(m.get("fcsj"));
638 if(xxqdz.length() == 0 && m.containsKey("qdz_name")) 626 if(xxqdz.length() == 0 && m.containsKey("qdz_name"))
639 - xxqdz = m.get("qdz_name"); 627 + xxqdz = m.get("qdz_name")==null?"":m.get("qdz_name").toString();
640 } 628 }
641 } 629 }
642 if(upfcsj.size() != 0) 630 if(upfcsj.size() != 0)
@@ -1459,7 +1447,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1459,7 +1447,6 @@ public class ReportServiceImpl implements ReportService{
1459 } 1447 }
1460 //所有班次信息 1448 //所有班次信息
1461 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); 1449 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
1462 -  
1463 line =line.trim(); 1450 line =line.trim();
1464 if(line.equals("")){ 1451 if(line.equals("")){
1465 //查询所有线路 1452 //查询所有线路
@@ -1469,7 +1456,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1469,7 +1456,6 @@ public class ReportServiceImpl implements ReportService{
1469 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); 1456 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
1470 } 1457 }
1471 1458
1472 -  
1473 String sql="select r.xl_bm" 1459 String sql="select r.xl_bm"
1474 + " from bsth_c_s_sp_info_real r where" 1460 + " from bsth_c_s_sp_info_real r where"
1475 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; 1461 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
@@ -1490,7 +1476,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1490,7 +1476,6 @@ public class ReportServiceImpl implements ReportService{
1490 return ve; 1476 return ve;
1491 } 1477 }
1492 }); 1478 });
1493 -  
1494 for (int i = 0; i < listLine.size(); i++) { 1479 for (int i = 0; i < listLine.size(); i++) {
1495 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); 1480 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
1496 String lineStr=listLine.get(i); 1481 String lineStr=listLine.get(i);
@@ -1511,6 +1496,22 @@ public class ReportServiceImpl implements ReportService{ @@ -1511,6 +1496,22 @@ public class ReportServiceImpl implements ReportService{
1511 Map<String, Object> newMap=staticTj(list,"f"); 1496 Map<String, Object> newMap=staticTj(list,"f");
1512 lMap.add(newMap); 1497 lMap.add(newMap);
1513 } 1498 }
  1499 + if(type.equals("export")){
  1500 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1501 + Map<String, Object> m = new HashMap<String, Object>();
  1502 + m.put("date", date);
  1503 + m.put("date1", date2);
  1504 + ReportUtils ee = new ReportUtils();
  1505 + try {
  1506 + listI.add(lMap.iterator());
  1507 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1508 + ee.excelReplace(listI, new Object[]{m}, path + "mould/countByLine.xls",
  1509 + path + "export/线路公里统计表.xls");
  1510 + } catch (Exception e) {
  1511 + // TODO: handle exception
  1512 + e.printStackTrace();
  1513 + }
  1514 + }
1514 return lMap; 1515 return lMap;
1515 } 1516 }
1516 1517
@@ -1533,6 +1534,8 @@ public class ReportServiceImpl implements ReportService{ @@ -1533,6 +1534,8 @@ public class ReportServiceImpl implements ReportService{
1533 if(list.size()>0){ 1534 if(list.size()>0){
1534 if(status.equals("f")){ 1535 if(status.equals("f")){
1535 map.put("xlName","合计"); 1536 map.put("xlName","合计");
  1537 + map.put("gs", "");
  1538 + map.put("fgs", "");
1536 }else{ 1539 }else{
1537 map.put("xlName", list.get(0).getXlName()); 1540 map.put("xlName", list.get(0).getXlName());
1538 map.put("gs", list.get(0).getGsName()); 1541 map.put("gs", list.get(0).getGsName());
@@ -1588,13 +1591,16 @@ public class ReportServiceImpl implements ReportService{ @@ -1588,13 +1591,16 @@ public class ReportServiceImpl implements ReportService{
1588 map.put("ssgl_other", culateService.culateSsMileXx(list, "其他")); 1591 map.put("ssgl_other", culateService.culateSsMileXx(list, "其他"));
1589 1592
1590 1593
1591 - double zrwjcclc=culateService.culateZrwJccLc(list, "");  
1592 - 1594 + double zrwjcclc=culateService.culateZrwJccLc(list, "故障");
  1595 + double zrwjcclc1=culateService.culateZrwJccLc(list, "肇事");
  1596 + double zrwjcclc2=culateService.culateZrwJccLc(list, "纠纷");
1593 map.put("zrwjcclc", zrwjcclc); 1597 map.put("zrwjcclc", zrwjcclc);
1594 - 1598 + map.put("zrwjcclc1", zrwjcclc1);
  1599 + map.put("zrwjcclc2", zrwjcclc2);
  1600 + double zrwjcc=Arith.add(Arith.add(zrwjcclc, zrwjcclc1), zrwjcclc2);
1595 double kfks=culateService.culateKfksLc(lists); 1601 double kfks=culateService.culateKfksLc(lists);
1596 map.put("kfks", kfks); 1602 map.put("kfks", kfks);
1597 - double zlc=Arith.add(Arith.add(Arith.add(zrwjcclc, ljlc), 1603 + double zlc=Arith.add(Arith.add(Arith.add(zrwjcc, ljlc),
1598 Arith.add(zjcclc, zyylc)),kfks); 1604 Arith.add(zjcclc, zyylc)),kfks);
1599 1605
1600 1606
@@ -1659,7 +1665,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1659,7 +1665,6 @@ public class ReportServiceImpl implements ReportService{
1659 ylbSql += " and xlbm = '"+line+"'"; 1665 ylbSql += " and xlbm = '"+line+"'";
1660 } 1666 }
1661 List<Ylb> ylbList=ylbList(ylbSql); 1667 List<Ylb> ylbList=ylbList(ylbSql);
1662 -  
1663 String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+date+"' and '"+date2+"'"; 1668 String dlbSql=" select * from bsth_c_dlb where rq BETWEEN '"+date+"' and '"+date2+"'";
1664 if(line.equals("")){ 1669 if(line.equals("")){
1665 dlbSql +="and ssgsdm='"+gsdm+"' " 1670 dlbSql +="and ssgsdm='"+gsdm+"' "
@@ -1668,7 +1673,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1668,7 +1673,6 @@ public class ReportServiceImpl implements ReportService{
1668 dlbSql += " and xlbm = '"+line+"'"; 1673 dlbSql += " and xlbm = '"+line+"'";
1669 } 1674 }
1670 List<Dlb> dlbList=dlbList(dlbSql); 1675 List<Dlb> dlbList=dlbList(dlbSql);
1671 -  
1672 String sql="select r.xl_bm,r.schedule_date_str,r.cl_zbh,r.j_gh,r.s_gh" 1676 String sql="select r.xl_bm,r.schedule_date_str,r.cl_zbh,r.j_gh,r.s_gh"
1673 + " from bsth_c_s_sp_info_real r where" 1677 + " from bsth_c_s_sp_info_real r where"
1674 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'"; 1678 + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";
@@ -1692,7 +1696,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1692,7 +1696,6 @@ public class ReportServiceImpl implements ReportService{
1692 return map; 1696 return map;
1693 } 1697 }
1694 }); 1698 });
1695 -  
1696 for (int i = 0; i < listGroupBy.size(); i++) { 1699 for (int i = 0; i < listGroupBy.size(); i++) {
1697 Map<String, Object> m=listGroupBy.get(i); 1700 Map<String, Object> m=listGroupBy.get(i);
1698 String xl_bm=m.get("line")==null?"":m.get("line").toString(); 1701 String xl_bm=m.get("line")==null?"":m.get("line").toString();
@@ -1795,7 +1798,6 @@ public class ReportServiceImpl implements ReportService{ @@ -1795,7 +1798,6 @@ public class ReportServiceImpl implements ReportService{
1795 } 1798 }
1796 1799
1797 } 1800 }
1798 -  
1799 if(!zt.equals("zbh")){ 1801 if(!zt.equals("zbh")){
1800 String sqls="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh" 1802 String sqls="select r.xl_bm,r.cl_zbh,r.j_gh,r.s_gh"
1801 + " from bsth_c_s_sp_info_real r where" 1803 + " from bsth_c_s_sp_info_real r where"
@@ -1822,6 +1824,28 @@ public class ReportServiceImpl implements ReportService{ @@ -1822,6 +1824,28 @@ public class ReportServiceImpl implements ReportService{
1822 lMap=lists(listGroupBys, lMaps, gsdm, fgsdm, date, date2); 1824 lMap=lists(listGroupBys, lMaps, gsdm, fgsdm, date, date2);
1823 1825
1824 } 1826 }
  1827 + if(type.equals("export")){
  1828 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1829 + Map<String, Object> m = new HashMap<String, Object>();
  1830 + m.put("date", date);
  1831 + m.put("date1", date2);
  1832 + String xls="";
  1833 + if(zt.equals("zbh")){
  1834 + xls="countByBus1.xls";
  1835 + }else{
  1836 + xls="countByBus2.xls";
  1837 + }
  1838 + ReportUtils ee = new ReportUtils();
  1839 + try {
  1840 + listI.add(lMap.iterator());
  1841 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1842 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  1843 + path + "export/路单数据统计表.xls");
  1844 + } catch (Exception e) {
  1845 + // TODO: handle exception
  1846 + e.printStackTrace();
  1847 + }
  1848 + }
1825 1849
1826 return lMap; 1850 return lMap;
1827 } 1851 }
@@ -1831,6 +1855,7 @@ public class ReportServiceImpl implements ReportService{ @@ -1831,6 +1855,7 @@ public class ReportServiceImpl implements ReportService{
1831 @Override 1855 @Override
1832 public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException { 1856 public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException {
1833 Ylb y = new Ylb(); 1857 Ylb y = new Ylb();
  1858 + y.setRq(arg0.getDate("rq"));
1834 y.setXlbm(arg0.getString("xlbm")); 1859 y.setXlbm(arg0.getString("xlbm"));
1835 y.setNbbm(arg0.getString("nbbm")); 1860 y.setNbbm(arg0.getString("nbbm"));
1836 y.setJzl(arg0.getDouble("jzl")); 1861 y.setJzl(arg0.getDouble("jzl"));
@@ -1847,6 +1872,7 @@ public class ReportServiceImpl implements ReportService{ @@ -1847,6 +1872,7 @@ public class ReportServiceImpl implements ReportService{
1847 @Override 1872 @Override
1848 public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException { 1873 public Dlb mapRow(ResultSet arg0, int arg1) throws SQLException {
1849 Dlb y = new Dlb(); 1874 Dlb y = new Dlb();
  1875 + y.setRq(arg0.getDate("rq"));
1850 y.setXlbm(arg0.getString("xlbm")); 1876 y.setXlbm(arg0.getString("xlbm"));
1851 y.setNbbm(arg0.getString("nbbm")); 1877 y.setNbbm(arg0.getString("nbbm"));
1852 y.setCdl(arg0.getDouble("cdl")); 1878 y.setCdl(arg0.getDouble("cdl"));
src/main/java/com/bsth/service/traffic/YgcBasicDataService.java
@@ -9,5 +9,13 @@ public interface YgcBasicDataService { @@ -9,5 +9,13 @@ public interface YgcBasicDataService {
9 * 更新运管处基础数据 9 * 更新运管处基础数据
10 */ 10 */
11 void updateYgcBasicData(); 11 void updateYgcBasicData();
  12 +
  13 + /**
  14 + * 调用方法
  15 + * @param methodName 方法名
  16 + * @param param 参数
  17 + * @return
  18 + */
  19 + String invokeMethod(String methodName,String param);
12 } 20 }
13 21
src/main/java/com/bsth/service/traffic/impl/YgcBasicDataServiceImpl.java
@@ -7,6 +7,7 @@ import org.apache.axiom.om.*; @@ -7,6 +7,7 @@ import org.apache.axiom.om.*;
7 import org.apache.axis2.addressing.EndpointReference; 7 import org.apache.axis2.addressing.EndpointReference;
8 import org.apache.axis2.client.Options; 8 import org.apache.axis2.client.Options;
9 import org.apache.axis2.client.ServiceClient; 9 import org.apache.axis2.client.ServiceClient;
  10 +import org.apache.axis2.rpc.client.RPCServiceClient;
10 import org.apache.commons.codec.digest.DigestUtils; 11 import org.apache.commons.codec.digest.DigestUtils;
11 import org.slf4j.Logger; 12 import org.slf4j.Logger;
12 import org.slf4j.LoggerFactory; 13 import org.slf4j.LoggerFactory;
@@ -18,6 +19,7 @@ import org.w3c.dom.Document; @@ -18,6 +19,7 @@ import org.w3c.dom.Document;
18 import org.w3c.dom.NodeList; 19 import org.w3c.dom.NodeList;
19 20
20 import javax.activation.DataHandler; 21 import javax.activation.DataHandler;
  22 +import javax.xml.namespace.QName;
21 import javax.xml.parsers.DocumentBuilder; 23 import javax.xml.parsers.DocumentBuilder;
22 import javax.xml.parsers.DocumentBuilderFactory; 24 import javax.xml.parsers.DocumentBuilderFactory;
23 import java.io.*; 25 import java.io.*;
@@ -42,14 +44,17 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ @@ -42,14 +44,17 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
42 JdbcTemplate jdbcTemplate; 44 JdbcTemplate jdbcTemplate;
43 45
44 private static String IP = "218.242.195.76:9091"; 46 private static String IP = "218.242.195.76:9091";
45 - private static String targetEndpoint = "http://" + IP +"/ygc.TransManager.Basicdown?wsdl"; 47 + private static String downTargetEndpoint = "http://" + IP +"/ygc.TransManager.Basicdown?wsdl";
  48 + private static String upTargetEndpoint = "http://" + IP +"/ygc.TransManager.BasicUpload?wsdl";
46 private static String namespace = "http://service.shygc.com"; 49 private static String namespace = "http://service.shygc.com";
47 private static String userName = "admin"; 50 private static String userName = "admin";
48 private static String passWord = "000000"; 51 private static String passWord = "000000";
49 - private static EndpointReference targetEPR; 52 + private static EndpointReference downTargetEPR;
  53 + private static EndpointReference upTargetEPR;
50 { 54 {
51 try { 55 try {
52 - targetEPR = new EndpointReference(targetEndpoint); 56 + downTargetEPR = new EndpointReference(downTargetEndpoint);
  57 + upTargetEPR = new EndpointReference(upTargetEndpoint);
53 } catch (Exception e) { 58 } catch (Exception e) {
54 e.printStackTrace(); 59 e.printStackTrace();
55 } 60 }
@@ -102,7 +107,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ @@ -102,7 +107,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
102 ServiceClient sender = new ServiceClient(); 107 ServiceClient sender = new ServiceClient();
103 Options options = sender.getOptions(); 108 Options options = sender.getOptions();
104 options.setProperty("SO_TIMEOUT", Integer.valueOf(1800000)); 109 options.setProperty("SO_TIMEOUT", Integer.valueOf(1800000));
105 - options.setTo(targetEPR); 110 + options.setTo(downTargetEPR);
106 sender.setOptions(options); 111 sender.setOptions(options);
107 System.out.println("The data in method download: " + data); 112 System.out.println("The data in method download: " + data);
108 data.build(); 113 data.build();
@@ -280,4 +285,37 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ @@ -280,4 +285,37 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{
280 flag = true; 285 flag = true;
281 return flag; 286 return flag;
282 } 287 }
  288 +
  289 + /**
  290 + * 调用方法
  291 + * @param methodName 方法名
  292 + * @param param 参数
  293 + * @return
  294 + */
  295 + public String invokeMethod(String methodName,String param){
  296 + String result = null;
  297 + try {
  298 + // 获得客户端
  299 + RPCServiceClient serviceClient = new RPCServiceClient();
  300 + // 可以在该对象中设置服务端的验证信息
  301 + Options options = serviceClient.getOptions();
  302 + options.setTo(upTargetEPR);
  303 + // 在创建QName对象时,QName类的构造方法的第一个参数表示WSDL文件的命名空间名,也就是<wsdl:definitions>元素的targetNamespace属性值
  304 + QName opAddEntry = new QName(namespace,methodName);
  305 + // 参数,如果有多个,继续往后面增加即可,不用指定参数的名称
  306 + Object[] opAddEntryArgs = new Object[] {param };
  307 + // 返回参数类型,这个和axis1有点区别
  308 + // invokeBlocking方法有三个参数,其中第一个参数的类型是QName对象,表示要调用的方法名;
  309 + // 第二个参数表示要调用的WebService方法的参数值,参数类型为Object[];
  310 + // 第三个参数表示WebService方法的返回值类型的Class对象,参数类型为Class[]。
  311 + // 当方法没有参数时,invokeBlocking方法的第二个参数值不能是null,而要使用new Object[]{}
  312 + // 如果被调用的WebService方法没有返回值,应使用RPCServiceClient类的invokeRobust方法,
  313 + // 该方法只有两个参数,它们的含义与invokeBlocking方法的前两个参数的含义相同
  314 + Class[] classes = new Class[] { String.class };
  315 + result = serviceClient.invokeBlocking(opAddEntry,opAddEntryArgs, classes)[0].toString();
  316 + }catch (Exception e){
  317 + e.printStackTrace();
  318 + }
  319 + return result;
  320 + }
283 } 321 }
src/main/resources/static/pages/base/line/add.html
@@ -228,7 +228,14 @@ @@ -228,7 +228,14 @@
228 </div> 228 </div>
229 </div> 229 </div>
230 <!-- 是否营运 END --> 230 <!-- 是否营运 END -->
231 - 231 + <!-- 权证车辆数 START -->
  232 + <div class="col-md-6">
  233 + <label class="control-label col-md-5"> 权证车辆数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  234 + <div class="col-md-4">
  235 + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数">
  236 + </div>
  237 + </div>
  238 + <!-- 权证车辆数 END -->
232 239
233 </div> 240 </div>
234 <!-- 表单分组组件 form-group END --> 241 <!-- 表单分组组件 form-group END -->
src/main/resources/static/pages/base/line/details.html
@@ -220,7 +220,14 @@ @@ -220,7 +220,14 @@
220 </div> 220 </div>
221 </div> 221 </div>
222 <!-- 是否营运 END --> 222 <!-- 是否营运 END -->
223 - 223 + <!-- 权证车辆数 START -->
  224 + <div class="col-md-6">
  225 + <label class="control-label col-md-5"> 权证车辆数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  226 + <div class="col-md-4">
  227 + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数">
  228 + </div>
  229 + </div>
  230 + <!-- 权证车辆数 END -->
224 231
225 </div> 232 </div>
226 <!-- 表单分组组件 form-group END --> 233 <!-- 表单分组组件 form-group END -->
src/main/resources/static/pages/base/line/edit.html
@@ -43,7 +43,7 @@ @@ -43,7 +43,7 @@
43 <!-- 表单内容 START --> 43 <!-- 表单内容 START -->
44 <div class="form-body"> 44 <div class="form-body">
45 <input type="hidden" name="id" id="lineId"> 45 <input type="hidden" name="id" id="lineId">
46 - 46 + <input type="hidden" name="inUse" id="inUse">
47 <!-- 表单分组组件 form-group START --> 47 <!-- 表单分组组件 form-group START -->
48 <div class="form-group"> 48 <div class="form-group">
49 <!-- 线路编码 (* 必填项) START --> 49 <!-- 线路编码 (* 必填项) START -->
@@ -229,7 +229,14 @@ @@ -229,7 +229,14 @@
229 </div> 229 </div>
230 <!-- 是否营运 END --> 230 <!-- 是否营运 END -->
231 231
232 - 232 + <!-- 权证车辆数 START -->
  233 + <div class="col-md-6">
  234 + <label class="control-label col-md-5"> 权证车辆数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </label>
  235 + <div class="col-md-4">
  236 + <input type="text" class="form-control" name="warrantCar" id="warrantCarInput" placeholder="权证车辆数">
  237 + </div>
  238 + </div>
  239 + <!-- 权证车辆数 END -->
233 </div> 240 </div>
234 <!-- 表单分组组件 form-group END --> 241 <!-- 表单分组组件 form-group END -->
235 <!-- 表单分组组件 form-group START --> 242 <!-- 表单分组组件 form-group START -->
src/main/resources/static/pages/base/line/js/line-add-form.js
@@ -116,6 +116,7 @@ $(function(){ @@ -116,6 +116,7 @@ $(function(){
116 'carSumNumber' : {number : true,digits : true,maxlength: 8},// 车辆总数 必须输入合法的数字(负数,小数)。必须输入整数。最大长度. 116 'carSumNumber' : {number : true,digits : true,maxlength: 8},// 车辆总数 必须输入合法的数字(负数,小数)。必须输入整数。最大长度.
117 'hvacCarNumber' : {number : true,digits : true,maxlength: 8},// 空调车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。 最大长度. 117 'hvacCarNumber' : {number : true,digits : true,maxlength: 8},// 空调车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。 最大长度.
118 'ordCarNumber' : {number : true,digits : true,maxlength: 8},// 普通车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。最大长度. 118 'ordCarNumber' : {number : true,digits : true,maxlength: 8},// 普通车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。最大长度.
  119 + 'warrantCar' : {number : true,digits : true,maxlength: 8},
119 'history' : {maxlength: 200},// 线路沿革 输入长度最多是 200 的字符串(汉字算一个字符)。 120 'history' : {maxlength: 200},// 线路沿革 输入长度最多是 200 的字符串(汉字算一个字符)。
120 'descriptions' : {maxlength: 200}// 描述/说明 输入长度最多是 200 的字符串(汉字算一个字符)。 121 'descriptions' : {maxlength: 200}// 描述/说明 输入长度最多是 200 的字符串(汉字算一个字符)。
121 }, 122 },
src/main/resources/static/pages/base/line/js/line-edit-form.js
@@ -171,6 +171,7 @@ @@ -171,6 +171,7 @@
171 'carSumNumber' : {number : true,digits : true,maxlength: 8},// 车辆总数 必须输入合法的数字(负数,小数)。必须输入整数。最大长度. 171 'carSumNumber' : {number : true,digits : true,maxlength: 8},// 车辆总数 必须输入合法的数字(负数,小数)。必须输入整数。最大长度.
172 'hvacCarNumber' : {number : true,digits : true,maxlength: 8},// 空调车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。 最大长度. 172 'hvacCarNumber' : {number : true,digits : true,maxlength: 8},// 空调车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。 最大长度.
173 'ordCarNumber' : {number : true,digits : true,maxlength: 8},// 普通车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。最大长度. 173 'ordCarNumber' : {number : true,digits : true,maxlength: 8},// 普通车辆数 必须输入合法的数字(负数,小数)。 必须输入整数。最大长度.
  174 + 'warrantCar' : {number : true,digits : true,maxlength: 8},
174 'history' : {maxlength: 200},// 线路沿革 输入长度最多是 200 的字符串(汉字算一个字符)。 175 'history' : {maxlength: 200},// 线路沿革 输入长度最多是 200 的字符串(汉字算一个字符)。
175 'descriptions' : {maxlength: 200}// 描述/说明 输入长度最多是 200 的字符串(汉字算一个字符)。 176 'descriptions' : {maxlength: 200}// 描述/说明 输入长度最多是 200 的字符串(汉字算一个字符)。
176 }, 177 },
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
@@ -382,13 +382,14 @@ var BaseFun = function() { @@ -382,13 +382,14 @@ var BaseFun = function() {
382 * 382 *
383 * 383 *
384 **/ 384 **/
385 - abstractBcByWorkTime : function(bxlpbc , map , dataMap , saa , cara , bxrcObj , dgminpcs ,deletebcNum) { 385 + abstractBcByWorkTime : function(bxlpbc , map , dataMap , saa , cara , bxrcObj , dgminpcs ,deletebcNum ,zwxeLpNum) {
386 var rsultA = new Array() , dgzjsj = baseF.getDateTime('13:00'); 386 var rsultA = new Array() , dgzjsj = baseF.getDateTime('13:00');
387 // 定义13:00 ~ 晚高峰开始以前剔除规则. 如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次. 387 // 定义13:00 ~ 晚高峰开始以前剔除规则. 如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次.
388 var xwmaxtcbcNum = parseInt(( dataMap.wgfsjd[0].st - dgzjsj) / (60000 * saa[0].zzsj.dgzzsj)); 388 var xwmaxtcbcNum = parseInt(( dataMap.wgfsjd[0].st - dgzjsj) / (60000 * saa[0].zzsj.dgzzsj));
389 // 定义早高峰结束 ~ 13:00 剔除规则.如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次. 389 // 定义早高峰结束 ~ 13:00 剔除规则.如果剔除的班次数不够,则去晚高峰之后剔除剩下的班次.
390 var swmaxtcbcNum = parseInt(( dgzjsj - dataMap.zgfsjd[0].ed) / (60000 * saa[0].zzsj.dgzzsj)); 390 var swmaxtcbcNum = parseInt(( dgzjsj - dataMap.zgfsjd[0].ed) / (60000 * saa[0].zzsj.dgzzsj));
391 var sumGs = 0; 391 var sumGs = 0;
  392 + dgminpcs = zwxeLpNum==0 ? bxlpbc.length : dgminpcs;
392 for(var a = 0 ; a < bxlpbc.length ; a++) { 393 for(var a = 0 ; a < bxlpbc.length ; a++) {
393 // 定义该版型下对应的路牌的班次数组、班次数组长度、该路牌上是否有首末班车。 394 // 定义该版型下对应的路牌的班次数组、班次数组长度、该路牌上是否有首末班车。
394 var lpbc = bxlpbc[a].lpbc, lpbclen_ = lpbc.length; 395 var lpbc = bxlpbc[a].lpbc, lpbclen_ = lpbc.length;
@@ -396,6 +397,7 @@ var BaseFun = function() { @@ -396,6 +397,7 @@ var BaseFun = function() {
396 continue; 397 continue;
397 var isFlag = baseF.lpDownIsHaveFirstAndLastBc(lpbc , dataMap.smbcsjArr) , tcbcgzA = new Array(); 398 var isFlag = baseF.lpDownIsHaveFirstAndLastBc(lpbc , dataMap.smbcsjArr) , tcbcgzA = new Array();
398 if(bxrcObj.type == '五工二休') { 399 if(bxrcObj.type == '五工二休') {
  400 + // continue;
399 // 定义晚高峰后能剔除多少班次数. 401 // 定义晚高峰后能剔除多少班次数.
400 var wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfsjd[0].ed ) / (60000 * saa[0].zzsj.dgzzsj)); 402 var wgfhtcbcNum = parseInt(( dataMap.wgfzhsjd[0].ed - dataMap.wgfsjd[0].ed ) / (60000 * saa[0].zzsj.dgzzsj));
401 if(isFlag) { 403 if(isFlag) {
@@ -409,11 +411,12 @@ var BaseFun = function() { @@ -409,11 +411,12 @@ var BaseFun = function() {
409 // 剔除不在高峰时间段内的班次. 411 // 剔除不在高峰时间段内的班次.
410 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , 'desc' , false); 412 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , 'desc' , false);
411 }else { 413 }else {
  414 + //continue;
412 // 单档 一个路牌一档劳动力 415 // 单档 一个路牌一档劳动力
413 if(bxlpbc[a].keepOff==1) { 416 if(bxlpbc[a].keepOff==1) {
414 // 如果低谷至少配车数大于零,则该班型下的路牌 存在一些 分班路牌,这里的分班 指的是 这个路牌先满足的前提条件就是 是单档。 417 // 如果低谷至少配车数大于零,则该班型下的路牌 存在一些 分班路牌,这里的分班 指的是 这个路牌先满足的前提条件就是 是单档。
415 - // 为了满足工时的要求,在低谷断开一段时间.  
416 - if(dgminpcs > 0) { 418 + // 为了满足工时的要求,在低谷断开一段时间.a <= dgminpcs
  419 + if(a <= dgminpcs) {
417 if( a % 2 == 0) { 420 if( a % 2 == 0) {
418 if(deletebcNum < swmaxtcbcNum || isFlag) { 421 if(deletebcNum < swmaxtcbcNum || isFlag) {
419 tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum}); 422 tcbcgzA.push({'minsj': dataMap.zgfsjd[0].ed , 'maxsj' : dgzjsj , 'order' : 'asc' , 'deletebcNum' : deletebcNum});
@@ -433,10 +436,10 @@ var BaseFun = function() { @@ -433,10 +436,10 @@ var BaseFun = function() {
433 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , true); 436 baseF.spliceBc02(lpbc , tcbcgzA , dataMap , true);
434 baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , true , a); 437 baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , true , a);
435 // 该班型下的路牌 不存在分班路牌. 438 // 该班型下的路牌 不存在分班路牌.
436 - }else if(dgminpcs == 0){ 439 + }else {
437 // 按规则剔除班次.不分班.路牌班次不会断开. 440 // 按规则剔除班次.不分班.路牌班次不会断开.
438 baseF.isdk02(lpbc , dataMap , saa , deletebcNum , false); 441 baseF.isdk02(lpbc , dataMap , saa , deletebcNum , false);
439 - //baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , false , a); 442 + baseF.affimBzGs(lpbc , bxlpbc[a].bzgs, dataMap, saa , false , a);
440 } 443 }
441 // 双档 一个路牌两档劳动力 444 // 双档 一个路牌两档劳动力
442 }else if(bxlpbc[a].keepOff==2) { 445 }else if(bxlpbc[a].keepOff==2) {
@@ -459,8 +462,8 @@ var BaseFun = function() { @@ -459,8 +462,8 @@ var BaseFun = function() {
459 var markAfterGs = baseF.getSumWorkTime(tList , dataMap, saa); 462 var markAfterGs = baseF.getSumWorkTime(tList , dataMap, saa);
460 var gsDx = parseFloat((markAfterGs - bzgs).toFixed(2)); 463 var gsDx = parseFloat((markAfterGs - bzgs).toFixed(2));
461 lpbc.sort(function(m,n){return m.fcno-n.fcno}); 464 lpbc.sort(function(m,n){return m.fcno-n.fcno});
462 - if(isOff) {  
463 - if(gsDx > 1.5) { 465 + if(gsDx > 1.5) {
  466 + if(isOff) {
464 var hoursDx = parseFloat((gsDx - 1.5).toFixed(2)); 467 var hoursDx = parseFloat((gsDx - 1.5).toFixed(2));
465 // console.log(gsDx , hoursDx ,Math.ceil(hoursDx*60)); 468 // console.log(gsDx , hoursDx ,Math.ceil(hoursDx*60));
466 var minueDx = Math.ceil(hoursDx*60); 469 var minueDx = Math.ceil(hoursDx*60);
@@ -471,14 +474,15 @@ var BaseFun = function() { @@ -471,14 +474,15 @@ var BaseFun = function() {
471 lpbc.splice( (s+1) , bs*2); 474 lpbc.splice( (s+1) , bs*2);
472 }else { 475 }else {
473 lpbc.splice( s , bs*2); 476 lpbc.splice( s , bs*2);
  477 + lpbc[s-bs*2 +1].isfb = 1;
  478 + lpbc[s-bs*2 +1].STOPTIME = 0;
474 } 479 }
475 break; 480 break;
476 } 481 }
477 } 482 }
  483 + }else {
478 484
479 } 485 }
480 - }else {  
481 -  
482 } 486 }
483 }, 487 },
484 488
@@ -606,8 +610,10 @@ var BaseFun = function() { @@ -606,8 +610,10 @@ var BaseFun = function() {
606 // 判断是否在高峰时间范围.【true--表示在,false--表示不在】. 610 // 判断是否在高峰时间范围.【true--表示在,false--表示不在】.
607 if(!baseF.isPeakTimeScope(fcsj,dataMap) && fcsj > tcbcgzA[t].minsj && fcsj < tcbcgzA[t].maxsj) { 611 if(!baseF.isPeakTimeScope(fcsj,dataMap) && fcsj > tcbcgzA[t].minsj && fcsj < tcbcgzA[t].maxsj) {
608 if(order == 'asc') { 612 if(order == 'asc') {
609 - arr[a-1].isfb = isfb ? 1 : 0;  
610 - arr[a-1].STOPTIME = 0; 613 + if(a>0) {
  614 + arr[a-1].isfb = isfb ? 1 : 0;
  615 + arr[a-1].STOPTIME = 0;
  616 + }
611 }else if(order == 'desc') { 617 }else if(order == 'desc') {
612 var index_ = a + tcbcgzA[t].deletebcNum * 2; 618 var index_ = a + tcbcgzA[t].deletebcNum * 2;
613 arr[index_].STOPTIME = 0; 619 arr[index_].STOPTIME = 0;
@@ -636,6 +642,7 @@ var BaseFun = function() { @@ -636,6 +642,7 @@ var BaseFun = function() {
636 dgmaxtzsj = parseInt(map.dgmaxtzsj); 642 dgmaxtzsj = parseInt(map.dgmaxtzsj);
637 // 计算低谷最少配车数 (低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙. 643 // 计算低谷最少配车数 (低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙.
638 var dgminpcs = Math.round((dataMap.dgxxsjArr[0] + dataMap.dgxxsjArr[1] + dataMap.dgtzsj[0] + dataMap.dgtzsj[1]) / dgmaxfcjx); 644 var dgminpcs = Math.round((dataMap.dgxxsjArr[0] + dataMap.dgxxsjArr[1] + dataMap.dgtzsj[0] + dataMap.dgtzsj[1]) / dgmaxfcjx);
  645 + var zwxeLpNum = baseF.cuontZwxeLpNum(bxrclist);
639 // var dgminpcs = 4; 646 // var dgminpcs = 4;
640 // 定义返回数组. 647 // 定义返回数组.
641 var rs = new Array(); 648 var rs = new Array();
@@ -710,12 +717,23 @@ var BaseFun = function() { @@ -710,12 +717,23 @@ var BaseFun = function() {
710 avgMakerCarNum = parseInt(avgMakerCarNum / bxlpbc.length); 717 avgMakerCarNum = parseInt(avgMakerCarNum / bxlpbc.length);
711 // console.log(bxlpbc); 718 // console.log(bxlpbc);
712 // 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班. 719 // 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班.
713 - rs = rs.concat(baseF.abstractBcByWorkTime(bxlpbc , map , dataMap , saa , cara , bxrclist[x] , dgminpcs , avgMakerCarNum)); 720 + rs = rs.concat(baseF.abstractBcByWorkTime(bxlpbc , map , dataMap , saa , cara , bxrclist[x] , dgminpcs , avgMakerCarNum ,zwxeLpNum));
714 } 721 }
715 } 722 }
716 return rs; 723 return rs;
717 }, 724 },
718 725
  726 + cuontZwxeLpNum : function(list) {
  727 + var count = 0;
  728 + for(var c = 0 ; c<list.length;c++) {
  729 + if(list[c].type == '五工二休') {
  730 + count = list[c].fpcls;
  731 + break;
  732 + }
  733 + }
  734 + return count;
  735 + },
  736 +
719 /** 737 /**
720 * @description (TODO) 更新路牌数组的路牌名称. 738 * @description (TODO) 更新路牌数组的路牌名称.
721 * @param cara 路牌数组 739 * @param cara 路牌数组
@@ -762,7 +780,11 @@ var BaseFun = function() { @@ -762,7 +780,11 @@ var BaseFun = function() {
762 * 相同班型下的日平均工时满足 参数的日平均工时 范围在 [10分钟]内浮动. 780 * 相同班型下的日平均工时满足 参数的日平均工时 范围在 [10分钟]内浮动.
763 * 781 *
764 * 782 *
765 - * 第七步 确定吃饭时间. 783 + * 第七步 确定吃饭时间(吃时间初步定位20分钟). 一般情况下
  784 + *
  785 + * 早餐 :10:15以后到12:30之间用餐的12:30是指用餐结束时间哦.
  786 + *
  787 + * 午餐 :一般在18:00以后在19:00以前.
766 * 788 *
767 * 第八步 确定进出场、早晚例保时间. 789 * 第八步 确定进出场、早晚例保时间.
768 * 790 *
@@ -771,19 +793,17 @@ var BaseFun = function() { @@ -771,19 +793,17 @@ var BaseFun = function() {
771 BXPplaceClassesTime02 : function(saa , cara , map , seMap , dataMap) { 793 BXPplaceClassesTime02 : function(saa , cara , map , seMap , dataMap) {
772 794
773 // 第一步 根据表单中的参数得到所有路牌下的班次数[从各路牌下的第一个班次发车时间 到 营运结束时间点并且是连续的班次数]. 795 // 第一步 根据表单中的参数得到所有路牌下的班次数[从各路牌下的第一个班次发车时间 到 营运结束时间点并且是连续的班次数].
774 - var jsonArray = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap);  
775 - 796 + var allLMapBc = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap);
  797 +
776 // 第二步 纵向调整 798 // 第二步 纵向调整
777 - baseF.evenStartDepartSpace(jsonArray , dataMap); 799 + baseF.evenStartDepartSpace(allLMapBc , dataMap);
778 800
779 // 第三步 剔除首末班车以外的班次,并确认首末班车. 801 // 第三步 剔除首末班车以外的班次,并确认首末班车.
780 - var markArray = baseF.markFirstAndLastBusAlsoDietNotInRangeBc(jsonArray , dataMap);  
781 - 802 + var markArray = baseF.markFirstAndLastBusAlsoDietNotInRangeBc(allLMapBc , dataMap);
  803 + // return {'json':markArray,'bxrcgs':null};
782 // 第四步 横向调整 804 // 第四步 横向调整
783 baseF.resizeByPitStopTime(cara , markArray , dataMap); 805 baseF.resizeByPitStopTime(cara , markArray , dataMap);
784 -  
785 // return {'json':markArray,'bxrcgs':null}; 806 // return {'json':markArray,'bxrcgs':null};
786 -  
787 /** 807 /**
788 * 第五步 把班型合理的分配到各个路牌上. 808 * 第五步 把班型合理的分配到各个路牌上.
789 * 809 *
@@ -797,7 +817,132 @@ var BaseFun = function() { @@ -797,7 +817,132 @@ var BaseFun = function() {
797 baseF.bxAlloTotLp(list,cara); 817 baseF.bxAlloTotLp(list,cara);
798 // 第六步 抽车来满足工时. 818 // 第六步 抽车来满足工时.
799 var tempA = baseF.abstractCar(list , markArray , cara , saa , dataMap , map); 819 var tempA = baseF.abstractCar(list , markArray , cara , saa , dataMap , map);
800 - return {'json':baseF.addjcclcbc01(cara,tempA,dataMap,saa,map),'bxrcgs':null}; 820 + // return {'json':tempA,'bxrcgs':null};
  821 + // 第七步 确定吃饭时间.
  822 + baseF.markeEatTime(list , tempA , cara , saa , dataMap ,map);
  823 + baseF.resizeByPitStopTime(cara , tempA , dataMap);
  824 + baseF.updfcno01(tempA,0);
  825 + // return {'json':tempA,'bxrcgs':null};
  826 + // 确定进出场、早晚例保时间.并返回班次数组集合
  827 + return {'json':baseF.addInOutFieldBc(cara,tempA,dataMap,saa,map),'bxrcgs':null};
  828 + },
  829 +
  830 + markeEatTime : function(list , markArray , cara , saa , dataMap ,map) {
  831 + var cfddDm = parseInt(map.cfdd);
  832 + var mLen = markArray.length,cLen=cara.length,sLen =list.length ;
  833 + if(mLen<=0 || cLen<=0 || sLen<=0)
  834 + return false;
  835 + for(var c = 0 ; c<cLen ; c++) {
  836 + var lpNo=cara[c].lpNo,lpType;
  837 + for(var s = 0 ; s<sLen;s++ ) {
  838 + if(list[s].sslp[0].lpNo==lpNo) {
  839 + lpType = list[s].type;
  840 + break;
  841 + }
  842 + }
  843 + if(lpType=='五工二休')
  844 + continue;
  845 + var lpbcArray = new Array();
  846 + for(var m = 0 ; m < mLen; m++) {
  847 + if(markArray[m].lpNo==lpNo)
  848 + lpbcArray.push(markArray[m]);
  849 + }
  850 + lpbcArray.sort(function(a,b){return a.fcint - b.fcint});
  851 + baseF.isHaveBc(baseF.getDateTime('10:15') , baseF.getDateTime('12:15'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 0);
  852 + baseF.isHaveBc(baseF.getDateTime('18:00') , baseF.getDateTime('19:00'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 1);
  853 + }
  854 + },
  855 +
  856 + isHaveBc : function(kssj , jssj , bcArray,cfddDm , dataMap , lpObj , map, markArray , cfIndex) {
  857 + var canCf = new Array(), countTzsj = 0, isLast = new Array();
  858 + for(var b = 0 ; b<bcArray.length;b++) {
  859 + var bcddsj = baseF.getDateTime(bcArray[b].ARRIVALTIME);
  860 + if(bcddsj<=jssj) {
  861 + countTzsj += bcArray[b].STOPTIME;
  862 + canCf.push(bcArray[b]);
  863 + }
  864 + /*if(bcddsj>= kssj && bcddsj<=jssj) {
  865 + countTzsj += bcArray[b].STOPTIME;
  866 + canCf.push(bcArray[b]);
  867 + }
  868 + if(bcddsj < kssj)
  869 + isLast.push(bcArray[b]);*/
  870 + }
  871 + if(canCf.length>0) {
  872 + console.log('countTzsj:' + countTzsj + 'length:' + canCf.length);
  873 + var fxDm = baseF.dirDmToIndex(canCf[canCf.length-1].xlDir);
  874 + // console.log(countTzsj , canCf[canCf.length-1].fcsj);
  875 + if(cfddDm == fxDm && canCf.length>2) {
  876 + var tzdx = canCf[canCf.length-2].STOPTIME - dataMap.zwcArr[cfIndex];
  877 + canCf[canCf.length-2].STOPTIME = tzdx >= 0 ? tzdx : 0;
  878 + var obj = baseF.getbcObj(
  879 + baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  880 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  881 + markArray.push(obj);
  882 + if(tzdx<0) {
  883 + // canCf[canCf.length-1].STOPTIME = 0;
  884 + var fcsj = baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME);
  885 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-2].STOPTIME + dataMap.zwcArr[cfIndex]);
  886 + canCf[canCf.length-1].fcsj = baseF.getTimeStr(fcsj);
  887 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-1].bcsj);
  888 + canCf[canCf.length-1].ARRIVALTIME = baseF.getTimeStr(fcsj);
  889 + }
  890 + }else {
  891 + var obj = baseF.getbcObj(
  892 + baseF.getDateTime(canCf[canCf.length-1].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  893 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  894 + markArray.push(obj);
  895 +
  896 + }
  897 + }
  898 + /*if(canCf.length>0) {
  899 + var fxDm = baseF.dirDmToIndex(canCf[canCf.length-1].xlDir);
  900 + // console.log(countTzsj , canCf[canCf.length-1].fcsj);
  901 + if(cfddDm == fxDm && canCf.length>2) {
  902 + var tzdx = canCf[canCf.length-2].STOPTIME - dataMap.zwcArr[cfIndex];
  903 + canCf[canCf.length-2].STOPTIME = tzdx >= 0 ? tzdx : 0;
  904 + var obj = baseF.getbcObj(
  905 + baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  906 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  907 + markArray.push(obj);
  908 + if(tzdx<0) {
  909 + // canCf[canCf.length-1].STOPTIME = 0;
  910 + var fcsj = baseF.getDateTime(canCf[canCf.length-2].ARRIVALTIME);
  911 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-2].STOPTIME + dataMap.zwcArr[cfIndex]);
  912 + canCf[canCf.length-1].fcsj = baseF.getTimeStr(fcsj);
  913 + fcsj.setMinutes(fcsj.getMinutes() + canCf[canCf.length-1].bcsj);
  914 + canCf[canCf.length-1].ARRIVALTIME = baseF.getTimeStr(fcsj);
  915 + }
  916 + }else {
  917 + var obj = baseF.getbcObj(
  918 + baseF.getDateTime(canCf[canCf.length-1].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  919 + dataMap.dira[cfddDm], canCf[canCf.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  920 + markArray.push(obj);
  921 +
  922 + }
  923 + }else if(isLast.length>0) {
  924 + var fxDm = baseF.dirDmToIndex(isLast[isLast.length-1].xlDir);
  925 + if(cfddDm ==fxDm && canCf.length>2) {
  926 + var tzdx = canCf[canCf.length-2].STOPTIME - dataMap.zwcArr[cfIndex];
  927 + canCf[canCf.length-2].STOPTIME = tzdx >= 0 ? tzdx : 0;
  928 + var obj = baseF.getbcObj(
  929 + baseF.getDateTime(isLast[isLast.length-2].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  930 + dataMap.dira[cfddDm], isLast[isLast.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  931 + markArray.push(obj);
  932 + if(tzdx<0) {
  933 + var fcsj = baseF.getDateTime(isLast[isLast.length-2].ARRIVALTIME);
  934 + fcsj.setMinutes(fcsj.getMinutes() + isLast[isLast.length-2].STOPTIME + dataMap.zwcArr[cfIndex]);
  935 + isLast[isLast.length-1].fcsj = baseF.getTimeStr(fcsj);
  936 + fcsj.setMinutes(fcsj.getMinutes() +isLast[isLast.length-1].bcsj);
  937 + isLast[isLast.length-1].ARRIVALTIME = baseF.getTimeStr(fcsj);
  938 + }
  939 + }else {
  940 + var obj = baseF.getbcObj(
  941 + baseF.getDateTime(isLast[isLast.length-1].ARRIVALTIME),dataMap.zwcArr[cfIndex],lpObj,dataMap.bcTypeArr.cf,
  942 + dataMap.dira[cfddDm], isLast[isLast.length-1].fcno+1 , 0 , map , 0 , null , null , null , 0 , 0);
  943 + markArray.push(obj);
  944 + }
  945 + }*/
801 }, 946 },
802 947
803 /** 948 /**
@@ -930,12 +1075,13 @@ var BaseFun = function() { @@ -930,12 +1075,13 @@ var BaseFun = function() {
930 var lLen = list.length , cLen = clzs.length; 1075 var lLen = list.length , cLen = clzs.length;
931 if(lLen<= 0 || cLen<=0 ) 1076 if(lLen<= 0 || cLen<=0 )
932 return false; 1077 return false;
933 - // 最多车次与总车次的比例.  
934 - var blnum = Math.round(cLen/list[0].fpcls); 1078 + list.sort(function(a,b){return a.fpcls-b.fpcls});
935 // 定义已经分配出去的路牌. 1079 // 定义已经分配出去的路牌.
936 var rs = new Array(); 1080 var rs = new Array();
937 // 遍历 1081 // 遍历
938 for(var r = 0 ; r < lLen ; r++) { 1082 for(var r = 0 ; r < lLen ; r++) {
  1083 + // 车次与总车次的比例.
  1084 + var blnum = Math.round(cLen/list[r].fpcls);
939 // 得到没有分配出去的路牌. 1085 // 得到没有分配出去的路牌.
940 var dxa = baseF.chaji_array(clzs,rs); 1086 var dxa = baseF.chaji_array(clzs,rs);
941 // 定义当前车次数. 1087 // 定义当前车次数.
@@ -943,29 +1089,32 @@ var BaseFun = function() { @@ -943,29 +1089,32 @@ var BaseFun = function() {
943 // 定义记录当前分割路牌的次数下标.分配到班型车次下的路牌数组. 1089 // 定义记录当前分割路牌的次数下标.分配到班型车次下的路牌数组.
944 var index = 0 , sslp = new Array(); 1090 var index = 0 , sslp = new Array();
945 // 当前车次所有占比例. 1091 // 当前车次所有占比例.
946 - var tempint = parseInt(rsnum/blnum); 1092 + //var tempint = parseInt(rsnum/blnum);
947 // 判断如果比例小1 则为当前车次数. 1093 // 判断如果比例小1 则为当前车次数.
948 - blnum = tempint <= 1 ? rsnum : blnum; 1094 + //blnum = tempint <= 1 ? rsnum : blnum;
949 // 判断当前班型车次数组下标值.如果为倒数第二个或者之前. 1095 // 判断当前班型车次数组下标值.如果为倒数第二个或者之前.
950 if(r < lLen-1) { 1096 if(r < lLen-1) {
951 // 遍历 1097 // 遍历
952 - for(var c = 0 ; c < tempint ; c++) { 1098 + for(var c = 0 ; c < rsnum ; c++) {
953 // 创建新的没有分配出去的路牌数组. 1099 // 创建新的没有分配出去的路牌数组.
954 var temp = dxa.concat(); 1100 var temp = dxa.concat();
955 // 创建切割路牌数组. 1101 // 创建切割路牌数组.
956 var tagA = new Array(); 1102 var tagA = new Array();
957 // 判断切割的下标值是否小于等于路牌数组的倒数第二个或者之前. 1103 // 判断切割的下标值是否小于等于路牌数组的倒数第二个或者之前.
958 if(index <= (dxa.length-blnum) ) { 1104 if(index <= (dxa.length-blnum) ) {
959 - tagA = temp.splice(index,blnum); 1105 + /*tagA = temp.splice(index,blnum);*/
  1106 + tagA = temp.splice(index,1);
960 }else { 1107 }else {
961 - tagA = temp.splice((dxa.length-blnum),blnum); 1108 + /*tagA = temp.splice((dxa.length-blnum),blnum);*/
  1109 + tagA = temp.splice((dxa.length-blnum),1);
962 } 1110 }
963 // 组合切割路牌数组.赋值给已分配出去的路牌. 1111 // 组合切割路牌数组.赋值给已分配出去的路牌.
964 rs = rs.concat(tagA); 1112 rs = rs.concat(tagA);
965 // 赋值给分配到班型车次下的路牌数组. 1113 // 赋值给分配到班型车次下的路牌数组.
966 sslp = sslp.concat(tagA); 1114 sslp = sslp.concat(tagA);
967 // 记录切割下标. 1115 // 记录切割下标.
968 - index = index + 1 + blnum; 1116 + index = index + blnum;
  1117 + // index = index + blnum;
969 } 1118 }
970 // 分配到班型车次下的路牌数组. 1119 // 分配到班型车次下的路牌数组.
971 list[r].sslp = sslp; 1120 list[r].sslp = sslp;
@@ -1084,6 +1233,7 @@ var BaseFun = function() { @@ -1084,6 +1233,7 @@ var BaseFun = function() {
1084 if(len_>0 && bcCount > 0) { 1233 if(len_>0 && bcCount > 0) {
1085 // 定义该时间区间内的发车间隙. 1234 // 定义该时间区间内的发车间隙.
1086 var _fcjx = parseInt(Math.ceil(zzsj/bcCount)); 1235 var _fcjx = parseInt(Math.ceil(zzsj/bcCount));
  1236 + console.log(_fcjx);
1087 if(tagboolean) { 1237 if(tagboolean) {
1088 if(_fcjx>gfmaxfcjx) 1238 if(_fcjx>gfmaxfcjx)
1089 _fcjx = 20; 1239 _fcjx = 20;
@@ -1091,7 +1241,6 @@ var BaseFun = function() { @@ -1091,7 +1241,6 @@ var BaseFun = function() {
1091 if(_fcjx>dgmaxfcjx) 1241 if(_fcjx>dgmaxfcjx)
1092 _fcjx = dgmaxfcjx; 1242 _fcjx = dgmaxfcjx;
1093 } 1243 }
1094 - // console.log(_fcjx);  
1095 // 定义修改班次的起始时间点. 1244 // 定义修改班次的起始时间点.
1096 var fcnosj = new Date(kssj); 1245 var fcnosj = new Date(kssj);
1097 for(var l = 0 ; l< len_ ; l++) { 1246 for(var l = 0 ; l< len_ ; l++) {
@@ -1154,8 +1303,10 @@ var BaseFun = function() { @@ -1154,8 +1303,10 @@ var BaseFun = function() {
1154 var sslpbcA = new Array(); 1303 var sslpbcA = new Array();
1155 for(var j =0 ; j < tLen ; j++) { 1304 for(var j =0 ; j < tLen ; j++) {
1156 // 判断当期遍历的班次是否属于当前的路牌.如果是则添加到当前的路牌班次数组集合. 1305 // 判断当期遍历的班次是否属于当前的路牌.如果是则添加到当前的路牌班次数组集合.
1157 - if(tempa[j].lpNo == cara[t].lpNo) 1306 + if(tempa[j].lpNo == cara[t].lpNo) {
  1307 + tempa[j].fcint = baseF.getDateTime(tempa[j].fcsj).getTime();
1158 sslpbcA.push(tempa[j]); 1308 sslpbcA.push(tempa[j]);
  1309 + }
1159 } 1310 }
1160 if(sslpbcA.length > 0) { 1311 if(sslpbcA.length > 0) {
1161 // 按发车时间顺序排序. 1312 // 按发车时间顺序排序.
@@ -1166,10 +1317,10 @@ var BaseFun = function() { @@ -1166,10 +1317,10 @@ var BaseFun = function() {
1166 var sgbcfcsj = baseF.getDateTime(sslpbcA[r+1].fcsj), 1317 var sgbcfcsj = baseF.getDateTime(sslpbcA[r+1].fcsj),
1167 dqbcddsj = baseF.getDateTime(sslpbcA[r].ARRIVALTIME), 1318 dqbcddsj = baseF.getDateTime(sslpbcA[r].ARRIVALTIME),
1168 dqbcfcsj = baseF.getDateTime(sslpbcA[r].fcsj); 1319 dqbcfcsj = baseF.getDateTime(sslpbcA[r].fcsj);
  1320 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  1321 + var cctag = baseF.dirDmToIndex(sslpbcA[r].xlDir); // dataMap.smbcsjArr
1169 // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.) 1322 // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.)
1170 var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000); 1323 var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000);
1171 - // 定义当前班次方向下标代码[0代表上行;1代表下行].  
1172 - var cctag = baseF.dirDmToIndex(sslpbcA[r].xlDir);  
1173 // 定义是否高峰 1324 // 定义是否高峰
1174 var flag = baseF.isPeakTimeScope(dqbcfcsj , dataMap); 1325 var flag = baseF.isPeakTimeScope(dqbcfcsj , dataMap);
1175 // 获取行驶时间. 1326 // 获取行驶时间.
@@ -1178,40 +1329,75 @@ var BaseFun = function() { @@ -1178,40 +1329,75 @@ var BaseFun = function() {
1178 baseF.dirDmToIndex(sslpbcA[r].xlDir)); 1329 baseF.dirDmToIndex(sslpbcA[r].xlDir));
1179 normmintzsj = xxsj*0.1; 1330 normmintzsj = xxsj*0.1;
1180 normmaxtzsj = xxsj*0.15; 1331 normmaxtzsj = xxsj*0.15;
  1332 + var flag = false;
1181 // 如果小于零 1333 // 如果小于零
1182 - if(dxmin <= 0 && sslpbcA[r].isfb ==0 ) { 1334 + if(dxmin < 0 && sslpbcA[r].isfb ==0) {
1183 // 根据不同时段的停站时间.重新赋值停站时间. 1335 // 根据不同时段的停站时间.重新赋值停站时间.
1184 - dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag]; 1336 + if(sslpbcA[r].bcType=='normal' && sslpbcA[r+1].bcType =='normal')
  1337 + dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  1338 + else
  1339 + dxmin = 0;
  1340 + flag = true;
  1341 + }else if(dxmin==0){
  1342 + dxmin = 0;
  1343 + flag = true;
1185 }else { 1344 }else {
1186 // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间. 1345 // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.
1187 - if(dxmin >= dgmaxtzsj && dxmin < 180) { 1346 + if(dxmin >= dgmaxtzsj && dxmin < 180 && sslpbcA[r].isfb==0) {
1188 dxmin = dgmaxtzsj; 1347 dxmin = dgmaxtzsj;
  1348 + flag = true;
1189 // 如果大于零 并且 小于等于行业标准的最小停站时间 1349 // 如果大于零 并且 小于等于行业标准的最小停站时间
1190 }else if(dxmin > 0 && dxmin <= normmintzsj ) { 1350 }else if(dxmin > 0 && dxmin <= normmintzsj ) {
1191 // dxmin = dxmin; 1351 // dxmin = dxmin;
  1352 + flag = true;
1192 // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间 1353 // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间
1193 }else if(dxmin > normmintzsj && dxmin <= normmaxtzsj ) { 1354 }else if(dxmin > normmintzsj && dxmin <= normmaxtzsj ) {
1194 // dxmin = dxmin; 1355 // dxmin = dxmin;
  1356 + flag = true;
1195 // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间 1357 // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间
1196 }else if(dxmin > normmaxtzsj && dxmin < dgmaxtzsj ) { 1358 }else if(dxmin > normmaxtzsj && dxmin < dgmaxtzsj ) {
1197 // dxmin = dxmin; 1359 // dxmin = dxmin;
  1360 + flag = true;
  1361 + }else if (dxmin >= 180){
  1362 + dxmin = 0;
  1363 + }
  1364 + }
  1365 + if(flag) {
  1366 + if(!baseF.isDirSmbc(baseF.dirDmToIndex(sslpbcA[r+1].xlDir) , sslpbcA[r+1].fcsj , dataMap)) {
  1367 + // 修改当前班次的停站时间.
  1368 + sslpbcA[r].STOPTIME = parseInt(dxmin) ;
  1369 + // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.
  1370 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);
  1371 + // 修改下一个班次的发车时间.
  1372 + sslpbcA[r+1].fcsj = baseF.getTimeStr(dqbcddsj);
  1373 + // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.
  1374 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);
  1375 + // 修改下一个班次的到达时间.
  1376 + sslpbcA[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj);
  1377 + }else {
  1378 + if(r>0) {
  1379 + // 修改当前班次的停站时间.
  1380 + sslpbcA[r].STOPTIME = parseInt(dxmin) ;
  1381 + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].STOPTIME);
  1382 + sslpbcA[r].ARRIVALTIME = baseF.getTimeStr(sgbcfcsj);
  1383 + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].bcsj);
  1384 + sslpbcA[r].fcsj = baseF.getTimeStr(sgbcfcsj);
  1385 + sslpbcA[r-1].STOPTIME = parseInt( ( sgbcfcsj - baseF.getDateTime(sslpbcA[r-1].ARRIVALTIME))/60000);
  1386 + }
1198 } 1387 }
1199 } 1388 }
1200 - // 修改当前班次的停站时间.  
1201 - sslpbcA[r].STOPTIME = parseInt(dxmin) ;  
1202 - // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.  
1203 - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);  
1204 - // 修改下一个班次的发车时间.  
1205 - sslpbcA[r+1].fcsj = baseF.getTimeStr(dqbcddsj);  
1206 - // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.  
1207 - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);  
1208 - // 修改下一个班次的到达时间.  
1209 - sslpbcA[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj);  
1210 } 1389 }
1211 } 1390 }
1212 } 1391 }
1213 }, 1392 },
1214 1393
  1394 + isDirSmbc : function(dirDm , fcsj , dataMap) {
  1395 + var falg = false;
  1396 + if(fcsj == dataMap.smbcsjArr[dirDm].kssj || fcsj == dataMap.smbcsjArr[dirDm].jssj)
  1397 + falg = true;
  1398 + return falg;
  1399 + },
  1400 +
1215 BXPplaceClassesTime01 : function(saa,cara,map,seMap,dataMap,lpNoA) { 1401 BXPplaceClassesTime01 : function(saa,cara,map,seMap,dataMap,lpNoA) {
1216 var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap); 1402 var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap);
1217 var list = baseF.splitBxRc(map.bxrc); 1403 var list = baseF.splitBxRc(map.bxrc);
@@ -1297,10 +1483,19 @@ var BaseFun = function() { @@ -1297,10 +1483,19 @@ var BaseFun = function() {
1297 dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap);*/ 1483 dataMap.smbcsjArr,dataMap.ccsjArr,dataMap.cclcArr,dataMap.qdzArr,saa[0].lbsj,dataMap);*/
1298 var rsjar = baseF.tzsztest(cara,jar3,dataMap); 1484 var rsjar = baseF.tzsztest(cara,jar3,dataMap);
1299 // return {'json':rsjar,'bxrcgs':bxrcgs}; 1485 // return {'json':rsjar,'bxrcgs':bxrcgs};
1300 - return {'json':baseF.addjcclcbc01(cara,rsjar,dataMap,saa,map),'bxrcgs':bxrcgs}; 1486 + return {'json':baseF.addInOutFieldBc(cara,rsjar,dataMap,saa,map),'bxrcgs':bxrcgs};
1301 }, 1487 },
1302 1488
1303 - addjcclcbc01 : function(cara,rsjar,dataMap,saa,map) { 1489 + /**
  1490 + * @description (TODO) 添加进出场班次.
  1491 + * @param cara 路牌
  1492 + * @param rsjar 班次集合数组
  1493 + * @param dataMap dataMap 封装的 以上、下行方向成对存在的 一些参数数组 [下标0 -- 代表上行 ; 下标1 -- 代表下行].
  1494 + * @param saa 封装的一些 停站时间、周转时间、行驶时间、行驶里程等.
  1495 + * @param map 表单参数对象.
  1496 + *
  1497 + */
  1498 + addInOutFieldBc : function(cara,rsjar,dataMap,saa,map) {
1304 var resultJA = new Array(),bcs = 0; 1499 var resultJA = new Array(),bcs = 0;
1305 for(var m = 0 ; m < cara.length; m++) { 1500 for(var m = 0 ; m < cara.length; m++) {
1306 // 获取路牌编号. 1501 // 获取路牌编号.
@@ -1319,7 +1514,7 @@ var BaseFun = function() { @@ -1319,7 +1514,7 @@ var BaseFun = function() {
1319 lpbc_.sort(function(a,b){return a.fcno-b.fcno}); 1514 lpbc_.sort(function(a,b){return a.fcno-b.fcno});
1320 baseF.addcfbc01(lpbc_,dataMap,map); 1515 baseF.addcfbc01(lpbc_,dataMap,map);
1321 // 按照发车序号顺序排序. 1516 // 按照发车序号顺序排序.
1322 - // lpbc_.sort(function(a,b){return a.fcno-b.fcno}); 1517 + lpbc_.sort(function(a,b){return a.fcno-b.fcno});
1323 var tt = baseF.addjclbbc01(lpbc_,dataMap,saa[0].lbsj,map); 1518 var tt = baseF.addjclbbc01(lpbc_,dataMap,saa[0].lbsj,map);
1324 bcs = baseF.updfcno01(tt,bcs); 1519 bcs = baseF.updfcno01(tt,bcs);
1325 resultJA = resultJA.concat(tt); 1520 resultJA = resultJA.concat(tt);
@@ -1344,8 +1539,8 @@ var BaseFun = function() { @@ -1344,8 +1539,8 @@ var BaseFun = function() {
1344 addcfbc01 : function(lpbcar,dataMap,map) { 1539 addcfbc01 : function(lpbcar,dataMap,map) {
1345 var gs = 0 ,sicftag = true; 1540 var gs = 0 ,sicftag = true;
1346 for(var g = 0 ; g <lpbcar.length-1;g++ ) { 1541 for(var g = 0 ; g <lpbcar.length-1;g++ ) {
1347 - if( parseInt((baseF.getDateTime(lpbcar[g+1].fcsj) - baseF.getDateTime(lpbcar[g].ARRIVALTIME))/60000) > 80  
1348 - && lpbcar[g].STOPTIME==0 ) { 1542 + if( parseInt((baseF.getDateTime(lpbcar[g+1].fcsj) - baseF.getDateTime(lpbcar[g].ARRIVALTIME))/60000) > 180
  1543 + && lpbcar[g].STOPTIME==0 && lpbcar[g].bcType =='normal' ) {
1349 lpbcar[g].isfb = 1; 1544 lpbcar[g].isfb = 1;
1350 } 1545 }
1351 /*gs = gs + lpbcar[g].bcsj + lpbcar[g].STOPTIME; 1546 /*gs = gs + lpbcar[g].bcsj + lpbcar[g].STOPTIME;
@@ -1767,25 +1962,7 @@ var BaseFun = function() { @@ -1767,25 +1962,7 @@ var BaseFun = function() {
1767 dqbcfcsj,dataMap.ccsjArr[fxdm],car,dataMap.bcTypeArr.out, 1962 dqbcfcsj,dataMap.ccsjArr[fxdm],car,dataMap.bcTypeArr.out,
1768 dataMap.dira[fxdm],2,dataMap.cclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 出场班次 1963 dataMap.dira[fxdm],2,dataMap.cclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 出场班次
1769 fcno ++; 1964 fcno ++;
1770 - }/*else if(b > 0 && b < bc.length-1){  
1771 - var jcbckssj = baseF.getDateTime(bc[b].ARRIVALTIME)  
1772 - var ccbckssj = baseF.getDateTime(bc[b+1].fcsj)  
1773 - var dx = parseInt((ccbckssj - jcbckssj)/60000);  
1774 - if(bc[b].STOPTIME==0) {  
1775 - // bc[b].STOPTIME = 0;  
1776 - //console.log(bc[b].fcno);  
1777 - var fcno_ = bc[b].fcno + 2;  
1778 - stas = true;  
1779 - // console.log(bc[b],bc[b+1],b);  
1780 - result.push(baseF.getbcObj(  
1781 - jcbckssj,dataMap.jcsjArr[fxdm],car,dataMap.bcTypeArr.in_,  
1782 - dataMap.dira[fxdm],fcno_++,dataMap.jclcArr[fxdm],gatps,0,dataMap.qdzArr[fxdm],null,null,0,0));// 进场班次  
1783 - var ccfx = baseF.dirDmToIndex(bc[b+1].xlDir);  
1784 - result.push(baseF.getbcObj(  
1785 - ccbckssj,dataMap.ccsjArr[ccfx],car,dataMap.bcTypeArr.out,  
1786 - dataMap.dira[ccfx],fcno_++,dataMap.cclcArr[ccfx],gatps,0,dataMap.qdzArr[ccfx],null,null,0,0));// 出场班次  
1787 - }  
1788 - }*/else if(b==bc.length-1){ 1965 + }else if(b==bc.length-1){
1789 var fcno_ = dxfno + 2; 1966 var fcno_ = dxfno + 2;
1790 var qdbcddsj = baseF.getDateTime(bc[b].ARRIVALTIME); 1967 var qdbcddsj = baseF.getDateTime(bc[b].ARRIVALTIME);
1791 result.push(baseF.getbcObj( 1968 result.push(baseF.getbcObj(
src/main/resources/static/pages/base/timesmodel/js/d3.relationshipgraph.js
@@ -968,7 +968,7 @@ var RelationshipGraph = function () { @@ -968,7 +968,7 @@ var RelationshipGraph = function () {
968 for(var z = 0 ;z < tza.length;z++) { 968 for(var z = 0 ;z < tza.length;z++) {
969 if(tza[z].lpNo == lpNo && tza[z].bcsj >0 ) { 969 if(tza[z].lpNo == lpNo && tza[z].bcsj >0 ) {
970 timeNum = timeNum + tza[z].bcsj + tza[z].STOPTIME; 970 timeNum = timeNum + tza[z].bcsj + tza[z].STOPTIME;
971 - if( tza[z].bcType !='bd' && tza[z].bcType !='lc' ) { 971 + if( tza[z].bcType !='bd' && tza[z].bcType !='lc' && tza[z].bcType !='cf') {
972 tempNum ++; 972 tempNum ++;
973 } 973 }
974 } 974 }
@@ -983,32 +983,6 @@ var RelationshipGraph = function () { @@ -983,32 +983,6 @@ var RelationshipGraph = function () {
983 $(textNodes[1]).text("总班次:"+(tempNum)); 983 $(textNodes[1]).text("总班次:"+(tempNum));
984 // $_this.pptjbx($("."+className).children("rect")[2],zgs*1,lpNo,$_this); 984 // $_this.pptjbx($("."+className).children("rect")[2],zgs*1,lpNo,$_this);
985 } 985 }
986 - /*for(var a=0;a<array.length;a++) {  
987 - debugger;  
988 - var tempNum = 0,timeNum = 0,lpNo = '';  
989 - for(var g = 0 ; g <gdata.length;g++) {  
990 - var temp_i = parseInt(d3.select(gdata[g]).attr('y'))-this.configuration.offsetY;  
991 - if(temp_i<array[a] && temp_i>minValue) {  
992 - var parentNodeCName = d3.select(gdata[g]).attr('id'),  
993 - // nodes = d3.selectAll('text[parent-node='+ parentNodeCName +']')[0]  
994 - $_d = d3.select(gdata[g]).data()[0];  
995 - lpNo = $_d.lpNo;  
996 - timeNum = timeNum + parseInt($_d.STOPTIME) + parseInt($_d.bcsj);  
997 - if($_d.bcType!='bd' && $_d.bcType!='lc' && $_d.bcType!='cf' && $_d.bcsj>0)  
998 - tempNum++;  
999 - }  
1000 - }  
1001 - minValue = array[a];  
1002 - var className = 'statis_container_' + array[a];  
1003 - var textNodes = $("."+className).children("text");  
1004 - var hours = parseInt(timeNum/60);  
1005 - var mimus = timeNum%60,zgs = hours + (mimus==0? "": "." + mimus);  
1006 - var zgs = parseFloat((timeNum/60).toFixed(2));  
1007 - var zgs = timeNum;  
1008 - $(textNodes[0]).text("总工时:" + zgs);  
1009 - $(textNodes[1]).text("总班次:"+(tempNum));  
1010 - $_this.pptjbx($("."+className).children("rect")[2],zgs*1,lpNo,$_this);  
1011 - }*/  
1012 } 986 }
1013 987
1014 }, { 988 }, {
@@ -3027,7 +3001,9 @@ var RelationshipGraph = function () { @@ -3027,7 +3001,9 @@ var RelationshipGraph = function () {
3027 nowDate.setMinutes(parseInt(tm.min)+d.bcsj);// 10.3.1、设置分钟. 3001 nowDate.setMinutes(parseInt(tm.min)+d.bcsj);// 10.3.1、设置分钟.
3028 // 9.1.4、修改当前班次的到达时间. 3002 // 9.1.4、修改当前班次的到达时间.
3029 d.ARRIVALTIME = BaseFun.getTimeStr(nowDate); 3003 d.ARRIVALTIME = BaseFun.getTimeStr(nowDate);
3030 - d.STOPTIME = d.isfb ==1 ? 0 : parseInt((BaseFun.getDateTime(nodeContext.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME))/ 60000); 3004 + d.STOPTIME = d.isfb == 1 ? 0 : parseInt((BaseFun.getDateTime(nodeContext.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME))/ 60000);
  3005 + // parseInt((BaseFun.getDateTime(nodeContext.nextData.fcsj) - BaseFun.getDateTime(d.ARRIVALTIME))/ 60000)
  3006 +
3031 /** 3007 /**
3032 * 9.2、修改元素沿X轴方向的X坐标属性值. 3008 * 9.2、修改元素沿X轴方向的X坐标属性值.
3033 * 3009 *
@@ -3144,6 +3120,38 @@ var RelationshipGraph = function () { @@ -3144,6 +3120,38 @@ var RelationshipGraph = function () {
3144 } 3120 }
3145 } 3121 }
3146 }else { 3122 }else {
  3123 + var dataMap = $_GlobalGraph.configuration.dataMap;
  3124 + // 定义是否高峰
  3125 + var flag = BaseFun.isPeakTimeScope(BaseFun.getDateTime(nodeContext.lastData.fcsj) , dataMap);
  3126 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  3127 + var cctag = BaseFun.dirDmToIndex(nodeContext.lastData.xlDir);
  3128 + // 获取行驶时间.
  3129 + var xxsj = BaseFun.getByDirTravelTime(dataMap.zgfsjd , dataMap.wgfsjd , nowDate, dataMap.pcxssjArr , dataMap.gfxxsjArr , cctag);
  3130 + var normmintzsj = xxsj*0.1,normmaxtzsj = xxsj*0.15;
  3131 + // 如果小于零
  3132 + if(dxMinues <= 0 && nodeContext.lastData.isfb ==0 ) {
  3133 + // 根据不同时段的停站时间.重新赋值停站时间.
  3134 + dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  3135 + }else {
  3136 + // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.
  3137 + if(dxMinues >= dataMap.dgmaxtzsj && dxMinues < 180) {
  3138 + dxMinues = dataMap.dgmaxtzsj;
  3139 + // 如果大于零 并且 小于等于行业标准的最小停站时间
  3140 + }else if(dxMinues > 0 && dxMinues <= normmintzsj ) {
  3141 + // dxmin = dxmin;
  3142 + // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间
  3143 + }else if(dxMinues > normmintzsj && dxMinues <= normmaxtzsj ) {
  3144 + // dxmin = dxmin;
  3145 + // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间
  3146 + }else if(dxMinues > normmaxtzsj && dxMinues < dataMap.dgmaxtzsj ) {
  3147 + // dxmin = dxmin;
  3148 + }else if (dxMinues >= 180){
  3149 + dxMinues = 0;
  3150 + }
  3151 + }
  3152 + // 修改当前班次的停站时间.
  3153 + // nodeContext.lastData.STOPTIME = dxMinues;
  3154 + // d.STOPTIME = parseInt(dxmin) ;
3147 /** 3155 /**
3148 * 11.2.1、如果是正常班次 3156 * 11.2.1、如果是正常班次
3149 * 3157 *
@@ -3370,11 +3378,41 @@ var RelationshipGraph = function () { @@ -3370,11 +3378,41 @@ var RelationshipGraph = function () {
3370 } 3378 }
3371 } 3379 }
3372 }else { 3380 }else {
  3381 + var dxMinues = parseInt((BaseFun.getDateTime(d.fcsj) - BaseFun.getDateTime(_obj.lastData.ARRIVALTIME)) / 60000);
3373 /** 3382 /**
3374 * 1.5.6、修改上个元素班次与当前班次的停站时间和text元素的文本属性值. 3383 * 1.5.6、修改上个元素班次与当前班次的停站时间和text元素的文本属性值.
3375 * 3384 *
3376 **/ 3385 **/
3377 - _obj.lastData.STOPTIME = parseInt((BaseFun.getDateTime(d.fcsj) - BaseFun.getDateTime(_obj.lastData.ARRIVALTIME)) / 60000); 3386 + var dataMap = $_GlobalGraph.configuration.dataMap;
  3387 + // 定义是否高峰
  3388 + var flag = BaseFun.isPeakTimeScope(BaseFun.getDateTime(nodeContext.lastData.fcsj) , dataMap);
  3389 + // 定义当前班次方向下标代码[0代表上行;1代表下行].
  3390 + var cctag = BaseFun.dirDmToIndex(nodeContext.lastData.xlDir);
  3391 + // 获取行驶时间.
  3392 + var xxsj = BaseFun.getByDirTravelTime(dataMap.zgfsjd , dataMap.wgfsjd , nowDate, dataMap.pcxssjArr , dataMap.gfxxsjArr , cctag);
  3393 + var normmintzsj = xxsj*0.1,normmaxtzsj = xxsj*0.15;
  3394 + // 如果小于零
  3395 + if(dxMinues <= 0 && nodeContext.lastData.isfb ==0 ) {
  3396 + // 根据不同时段的停站时间.重新赋值停站时间.
  3397 + dxmin = flag ? dataMap.gftzsj[cctag] : dataMap.dgtzsj[cctag];
  3398 + }else {
  3399 + // 如果 大于等于低谷最大停站时间 并且 小于等于三小时.则把低谷最大停站时间 作为 停站时间.
  3400 + if(dxMinues >= dataMap.dgmaxtzsj && dxMinues < 180) {
  3401 + dxMinues = dataMap.dgmaxtzsj;
  3402 + // 如果大于零 并且 小于等于行业标准的最小停站时间
  3403 + }else if(dxMinues > 0 && dxMinues <= normmintzsj ) {
  3404 + // dxmin = dxmin;
  3405 + // 如果大于行业标准的最小停站时间 并且 小于等于行业标准的最大停站时间
  3406 + }else if(dxMinues > normmintzsj && dxMinues <= normmaxtzsj ) {
  3407 + // dxmin = dxmin;
  3408 + // 如果大于行业标准的最大停站时间 并且 小于低谷最大停站时间
  3409 + }else if(dxMinues > normmaxtzsj && dxMinues < dataMap.dgmaxtzsj ) {
  3410 + // dxmin = dxmin;
  3411 + }else if (dxMinues >= 180){
  3412 + dxMinues = 0;
  3413 + }
  3414 + }
  3415 + _obj.lastData.STOPTIME = dxMinues;
3378 for(var t = 0 ; t < _obj.lastTextNodes.length ;t++) { 3416 for(var t = 0 ; t < _obj.lastTextNodes.length ;t++) {
3379 var nowTextNode = d3.select(_obj.lastTextNodes[t]); 3417 var nowTextNode = d3.select(_obj.lastTextNodes[t]);
3380 if(nowTextNode.attr('text-type')=='gap') 3418 if(nowTextNode.attr('text-type')=='gap')
src/main/resources/static/pages/base/timesmodel/js/gantt.js
@@ -420,7 +420,8 @@ @@ -420,7 +420,8 @@
420 * @return 返回甘特图的参数配置信息. 420 * @return 返回甘特图的参数配置信息.
421 * */ 421 * */
422 function getGraphArgus(p) { 422 function getGraphArgus(p) {
423 - var MULTIPLE = Math.round(105/parseInt(p.stopAraay[0].sxsj)) >=4 ? Math.round(90/parseInt(p.stopAraay[0].sxsj)) : Math.round(90/parseInt(p.stopAraay[0].sxsj)) *2; 423 + var bs = p.stopAraay[0].sxsj > 40 ? 4 : 2;
  424 + var MULTIPLE = Math.round(105/parseInt(p.stopAraay[0].sxsj)) >3 ? Math.round(90/parseInt(p.stopAraay[0].sxsj)) : Math.round(90/parseInt(p.stopAraay[0].sxsj)) *bs;
424 var VALUEKEYNAME = 'Worldwide Gross' , 425 var VALUEKEYNAME = 'Worldwide Gross' ,
425 DXHOURS = 24,MINUTE = 60,WIDTH = DXHOURS*MINUTE,MARGINLEFT = 380,HEIGHT = p.yAxisCarArray.length*60 + 240, 426 DXHOURS = 24,MINUTE = 60,WIDTH = DXHOURS*MINUTE,MARGINLEFT = 380,HEIGHT = p.yAxisCarArray.length*60 + 240,
426 MARGINBOTTOM = 240,OFFSETX = 90,OFFSETY = 180,OFFSETUPY = 120,OFFSETDOWNY = 60, 427 MARGINBOTTOM = 240,OFFSETX = 90,OFFSETY = 180,OFFSETUPY = 120,OFFSETDOWNY = 60,
src/main/resources/static/pages/excep/speedingListmh.html
@@ -128,9 +128,9 @@ @@ -128,9 +128,9 @@
128 {{obj.vehicle}} 128 {{obj.vehicle}}
129 </td> 129 </td>
130 <td> 130 <td>
131 - {{if obj.upDown==0}} 131 + {{if obj.up_down==0}}
132 上行 132 上行
133 - {{else if obj.upDown==1}} 133 + {{else if obj.up_down==1}}
134 下行 134 下行
135 {{else}} 135 {{else}}
136 无效 136 无效
@@ -249,7 +249,7 @@ $(function(){ @@ -249,7 +249,7 @@ $(function(){
249 params['order'] = 'lastLoginDate'; 249 params['order'] = 'lastLoginDate';
250 params['page'] = page; 250 params['page'] = page;
251 var i = layer.load(2); 251 var i = layer.load(2);
252 - $get('/speeding/pagequery' ,params, function(data){ 252 + $get('/gps/pagequery' ,params, function(data){
253 var bodyHtm = template('speeding_list_temp', {list: data.dataList}); 253 var bodyHtm = template('speeding_list_temp', {list: data.dataList});
254 $('#datatable_speeding tbody').html(bodyHtm) 254 $('#datatable_speeding tbody').html(bodyHtm)
255 .find('.icheck').iCheck(icheckOptions) 255 .find('.icheck').iCheck(icheckOptions)
src/main/resources/static/pages/excep/speedingMap.html
@@ -19,7 +19,6 @@ @@ -19,7 +19,6 @@
19 overflow: hidden; 19 overflow: hidden;
20 } 20 }
21 </style> 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> 22 <script type="text/javascript" src="/pages/excep/js/speeding-map.js"></script>
24 <script type="text/javascript"> 23 <script type="text/javascript">
25 $(function(){ 24 $(function(){
@@ -31,55 +30,71 @@ $(function(){ @@ -31,55 +30,71 @@ $(function(){
31 var lat = dataArr[4];//起点纬度 30 var lat = dataArr[4];//起点纬度
32 var endLon = dataArr[5];//终点经度 31 var endLon = dataArr[5];//终点经度
33 var endLat = dataArr[6];//终点纬度 32 var endLat = dataArr[6];//终点纬度
34 - var Points = []; 33 + var pointObj;//坐标和速度组成的对象
  34 + var Points = [];//坐标和速度对象的集合
  35 + var coordinateArr = [];//坐标点数组
35 $.ajax({ 36 $.ajax({
36 type: "GET", 37 type: "GET",
37 async:false, 38 async:false,
38 url: '/gps/findPosition', 39 url: '/gps/findPosition',
39 data: {vehicle:vehicle,startdate:startdate,enddate:enddate}, 40 data: {vehicle:vehicle,startdate:startdate,enddate:enddate},
40 success: function(data){ 41 success: function(data){
41 - console.log("123"+data);  
42 $.each(data,function(i,item){ 42 $.each(data,function(i,item){
43 - console.log(item);  
44 if(item.lon>1 && item.lat>1){ 43 if(item.lon>1 && item.lat>1){
45 - var point = new BMap.Point(item.lon,item.lat);  
46 - Points.push(point); 44 + pointObj = new Object();
  45 + pointObj.coordinate = new BMap.Point(item.lon,item.lat);
  46 + pointObj.speed = item.speed;
  47 + Points.push(pointObj);
47 } 48 }
48 }); 49 });
49 } 50 }
50 - }); 51 + });
51 setTimeout(function(){ 52 setTimeout(function(){
52 var map = SpeedingMap.init();//创建地图 53 var map = SpeedingMap.init();//创建地图
53 var myP1 = new BMap.Point(lon,lat); //起点 54 var myP1 = new BMap.Point(lon,lat); //起点
54 var myP2 = new BMap.Point(endLon,endLat); //终点 55 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}); //创建折线 56 + var centerLon = (parseFloat(lon)+parseFloat(endLon))/2;
  57 + var centerLat = (parseFloat(lat)+parseFloat(endLat))/2;
  58 + map.centerAndZoom(new BMap.Point(centerLon,centerLat),18);//地图中心点坐标
  59 +
  60 + for(i in Points){
  61 + coordinateArr.push(Points[i].coordinate);
  62 + }
  63 + var polyline = new BMap.Polyline(coordinateArr, {strokeColor:"blue", strokeWeight:5, strokeOpacity:0.5});//创建折线
58 var myIcon = new BMap.Icon("/pages/excep/img/bus.png", new BMap.Size(32, 70), {//小车图片 64 var myIcon = new BMap.Icon("/pages/excep/img/bus.png", new BMap.Size(32, 70), {//小车图片
59 imageOffset: new BMap.Size(5,20) //图片的偏移量。为了是图片底部中心对准坐标点。 65 imageOffset: new BMap.Size(5,20) //图片的偏移量。为了是图片底部中心对准坐标点。
60 }); 66 });
  67 +
61 $(document).on('click', '#run', function() { 68 $(document).on('click', '#run', function() {
62 map.clearOverlays();//清空上一次的轨迹 69 map.clearOverlays();//清空上一次的轨迹
63 map.addOverlay(polyline);//增加折线 70 map.addOverlay(polyline);//增加折线
64 - var paths = Points.length;//获得有几个点  
65 - var carMk = new BMap.Marker(Points[0],{icon:myIcon}); 71 + var paths = coordinateArr.length;//获得有几个点
  72 + var carMk = new BMap.Marker(coordinateArr[0],{icon:myIcon});
66 map.addOverlay(carMk); 73 map.addOverlay(carMk);
  74 + var sContent ="车辆即时速度:"+Points[0].speed;
  75 + var infoWindow = new BMap.InfoWindow(sContent);// 创建信息窗口对象
  76 + map.openInfoWindow(infoWindow,coordinateArr[0]); //开启信息窗口
67 i=0; 77 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 - } 78 +
  79 + setTimeout(function(){
  80 + resetMkPoint(0);
  81 + },500);
  82 +
  83 + function resetMkPoint(i){
  84 + carMk.setPosition(coordinateArr[i]);
  85 + sContent ="车辆即时速度是:"+Points[i].speed;
  86 + infoWindow = new BMap.InfoWindow(sContent);// 创建信息窗口对象
  87 + map.openInfoWindow(infoWindow,coordinateArr[i]); //开启信息窗口
  88 + if(i < paths-1){
  89 + setTimeout(function(){
  90 + i++;
  91 + resetMkPoint(i);
  92 + },500);
76 } 93 }
77 - setTimeout(function(){  
78 - resetMkPoint(0);  
79 - },100)  
80 - }); 94 + };
81 }); 95 });
82 -}, 100); 96 +}, 500);
  97 + });
83 </script> 98 </script>
84 99
85 100
src/main/resources/static/pages/forms/mould/countByBus1.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/countByBus2.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/countByLine.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/account.html
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
86 locale : 'zh-cn' 86 locale : 'zh-cn'
87 }); 87 });
88 88
89 - $.get('/basic/lineCode2Name',function(result){ 89 + /* $.get('/basic/lineCode2Name',function(result){
90 var data=[]; 90 var data=[];
91 91
92 for(var code in result){ 92 for(var code in result){
@@ -94,7 +94,29 @@ @@ -94,7 +94,29 @@
94 } 94 }
95 initPinYinSelect2('#line',data,''); 95 initPinYinSelect2('#line',data,'');
96 96
97 - }) 97 + }) */
  98 +
  99 + $.get('/report/lineList',function(xlList){
  100 + var data = [];
  101 +// data.push({id: " ", text: "全部线路"});
  102 + $.get('/user/companyData', function(result){
  103 + for(var i = 0; i < result.length; i++){
  104 + var companyCode = result[i].companyCode;
  105 + var children = result[i].children;
  106 + for(var j = 0; j < children.length; j++){
  107 + var code = children[j].code;
  108 + for(var k=0;k < xlList.length;k++ ){
  109 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  110 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  111 +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  112 + }
  113 + }
  114 + }
  115 + }
  116 + initPinYinSelect2('#line',data,'');
  117 +
  118 + });
  119 + });
98 //重置 120 //重置
99 $('#czcl').on('click', function () { 121 $('#czcl').on('click', function () {
100 $('#code').val('').change(); 122 $('#code').val('').change();
src/main/resources/static/pages/forms/statement/busInterval.html
@@ -217,42 +217,51 @@ @@ -217,42 +217,51 @@
217 } 217 }
218 } 218 }
219 $('#subCompany').html(options); 219 $('#subCompany').html(options);
220 - initXl();  
221 } 220 }
222 221
223 - $("#subCompany").on("change",initXl);  
224 - function initXl(){  
225 - var data=[];  
226 - data.push({id:" ", text:"全部线路"});  
227 - if(fage){  
228 - $("#line").select2("destroy").html('');  
229 - }  
230 - var fgs=$('#subCompany').val();  
231 - var gs=$('#company').val();  
232 - for(var i=0;i<xlList.length;i++){  
233 - if(gs!=""){  
234 - if(fgs!=""){  
235 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
236 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
237 - }  
238 - }else{  
239 - if(xlList[i]["gsbm"]==gs){  
240 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 222 +
  223 + var tempData = {};
  224 + $.get('/report/lineList',function(xlList){
  225 + var data = [];
  226 + data.push({id: " ", text: "全部线路"});
  227 + $.get('/user/companyData', function(result){
  228 + for(var i = 0; i < result.length; i++){
  229 + var companyCode = result[i].companyCode;
  230 + var children = result[i].children;
  231 + for(var j = 0; j < children.length; j++){
  232 + var code = children[j].code;
  233 + for(var k=0;k < xlList.length;k++ ){
  234 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  235 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  236 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  237 + }
241 } 238 }
242 } 239 }
243 } 240 }
244 - }  
245 - initPinYinSelect2('#line',data,'');  
246 - fage=true;  
247 -  
248 - $("#endDate").attr("disabled", true);  
249 - $("#endDate").val($("#startDate").val());  
250 - line = data[0].id;  
251 - statu = 0;  
252 -  
253 - updateModel();  
254 - } 241 + initPinYinSelect2('#line',data,'');
  242 + $("#endDate").attr("disabled", true);
  243 + $("#endDate").val($("#startDate").val());
  244 + line = data[0].id;
  245 + statu = 0;
  246 +
  247 + updateModel();
  248 +
  249 + });
  250 + });
255 251
  252 + $("#line").on("change", function(){
  253 + if($("#line").val() == " "){
  254 + $("#company").attr("disabled", false);
  255 + $("#subCompany").attr("disabled", false);
  256 + } else {
  257 + var temp = tempData[$("#line").val()].split(":");
  258 + $("#company").val(temp[0]);
  259 + updateCompany();
  260 + $("#subCompany").val(temp[1]);
  261 + $("#company").attr("disabled", true);
  262 + $("#subCompany").attr("disabled", true);
  263 + }
  264 + });
256 265
257 $("#query").on("click",jsDoQuery); 266 $("#query").on("click",jsDoQuery);
258 267
src/main/resources/static/pages/forms/statement/commandState.html
@@ -178,33 +178,44 @@ @@ -178,33 +178,44 @@
178 } 178 }
179 } 179 }
180 $('#subCompany').html(options); 180 $('#subCompany').html(options);
181 - initXl();  
182 } 181 }
183 182
184 - $("#subCompany").on("change",initXl);  
185 - function initXl(){  
186 - var data=[];  
187 - if(fage){  
188 - $("#line").select2("destroy").html('');  
189 - }  
190 - var fgs=$('#subCompany').val();  
191 - var gs=$('#company').val();  
192 - for(var i=0;i<xlList.length;i++){  
193 - if(gs!=""){  
194 - if(fgs!=""){  
195 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
196 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
197 - }  
198 - }else{  
199 - if(xlList[i]["gsbm"]==gs){  
200 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 183 + var tempData = {};
  184 + $.get('/report/lineList',function(xlList){
  185 + var data = [];
  186 + $.get('/user/companyData', function(result){
  187 + for(var i = 0; i < result.length; i++){
  188 + var companyCode = result[i].companyCode;
  189 + var children = result[i].children;
  190 + for(var j = 0; j < children.length; j++){
  191 + var code = children[j].code;
  192 + for(var k=0;k < xlList.length;k++ ){
  193 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  194 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  195 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  196 + }
201 } 197 }
202 } 198 }
203 } 199 }
  200 + initPinYinSelect2('#line',data,'');
  201 +
  202 + });
  203 + });
  204 +
  205 + $("#line").on("change", function(){
  206 + if($("#line").val() == " "){
  207 + $("#company").attr("disabled", false);
  208 + $("#subCompany").attr("disabled", false);
  209 + } else {
  210 + var temp = tempData[$("#line").val()].split(":");
  211 + $("#company").val(temp[0]);
  212 + updateCompany();
  213 + $("#subCompany").val(temp[1]);
  214 + $("#company").attr("disabled", true);
  215 + $("#subCompany").attr("disabled", true);
204 } 216 }
205 - initPinYinSelect2('#line',data,'');  
206 - fage=true;  
207 - } 217 + });
  218 +
208 219
209 $('#code').select2({ 220 $('#code').select2({
210 ajax: { 221 ajax: {
src/main/resources/static/pages/forms/statement/correctForm.html
@@ -112,16 +112,29 @@ @@ -112,16 +112,29 @@
112 $("#date").val(year + "-" + month + "-" + day); 112 $("#date").val(year + "-" + month + "-" + day);
113 $("#endDate").val(year + "-" + month + "-" + day); 113 $("#endDate").val(year + "-" + month + "-" + day);
114 114
115 - $.get('/basic/lineCode2Name',function(result){  
116 - var data=[];  
117 -  
118 - for(var code in result){  
119 - data.push({id: code, text: result[code]});  
120 - }  
121 - initPinYinSelect2('#line',data,'');  
122 -  
123 - })  
124 - $('#czcl').on('click', function () { 115 + $.get('/report/lineList',function(xlList){
  116 + var data = [];
  117 +// data.push({id: " ", text: "全部线路"});
  118 + $.get('/user/companyData', function(result){
  119 + for(var i = 0; i < result.length; i++){
  120 + var companyCode = result[i].companyCode;
  121 + var children = result[i].children;
  122 + for(var j = 0; j < children.length; j++){
  123 + var code = children[j].code;
  124 + for(var k=0;k < xlList.length;k++ ){
  125 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  126 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  127 +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  128 + }
  129 + }
  130 + }
  131 + }
  132 + initPinYinSelect2('#line',data,'');
  133 +
  134 + });
  135 + });
  136 +
  137 + $('#czcl').on('click', function () {
125 $('#code').val('').change(); 138 $('#code').val('').change();
126 }); 139 });
127 140
@@ -203,7 +216,7 @@ @@ -203,7 +216,7 @@
203 }); 216 });
204 217
205 var line = $("#line").val(); 218 var line = $("#line").val();
206 - var date = $("#date").val();endDate 219 + var date = $("#date").val();
207 var lpName = $("#lpName").val(); 220 var lpName = $("#lpName").val();
208 var endDate = $("#endDate").val(); 221 var endDate = $("#endDate").val();
209 var code = $("#code").val(); 222 var code = $("#code").val();
src/main/resources/static/pages/forms/statement/correctStatis.html
@@ -145,49 +145,8 @@ @@ -145,49 +145,8 @@
145 $("#times1").attr("disabled", true); 145 $("#times1").attr("disabled", true);
146 $("#times2").attr("disabled", true); 146 $("#times2").attr("disabled", true);
147 147
148 -// $.get('/basic/lineCode2Name', function(result){  
149 -// var data=[];  
150 -  
151 -// data.push({id: " ", text: "全部线路"});  
152 -// for(var code in result){  
153 -// data.push({id: code, text: result[code]});  
154 -// }  
155 -// console.log(data);  
156 -// initPinYinSelect2('#line',data,'');  
157 148
158 -// line = "";  
159 -// // updateModel();  
160 -// });  
161 -  
162 -// var obj = [];  
163 -// $.get('/user/companyData', function(result){  
164 -// obj = result;  
165 -// var options = '';  
166 -// for(var i = 0; i < obj.length; i++){  
167 -// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';  
168 -// }  
169 -// if(obj.length == 1){  
170 -// $('#company1').hide();  
171 -// if(obj[0].children.length == 1)  
172 -// $('#subCompany1').hide();  
173 -// }  
174 -// $('#company').html(options);  
175 -// updateCompany();  
176 -// });  
177 -// $("#company").on("change",updateCompany);  
178 -// function updateCompany(){  
179 -// var company = $('#company').val();  
180 -// var options = '';  
181 -// for(var i = 0; i < obj.length; i++){  
182 -// if(obj[i].companyCode == company){  
183 -// var children = obj[i].children;  
184 -// for(var j = 0; j < children.length; j++){  
185 -// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';  
186 -// }  
187 -// }  
188 -// }  
189 -// $('#subCompany').html(options);  
190 -// } 149 +
191 var fage=false; 150 var fage=false;
192 var xlList; 151 var xlList;
193 var obj = []; 152 var obj = [];
@@ -225,36 +184,44 @@ @@ -225,36 +184,44 @@
225 } 184 }
226 } 185 }
227 $('#subCompany').html(options); 186 $('#subCompany').html(options);
228 - initXl();  
229 } 187 }
230 188
231 - $("#subCompany").on("change",initXl);  
232 - function initXl(){  
233 - var data=[];  
234 - data.push({id:" ", text:"全部线路"});  
235 - if(fage){  
236 - $("#line").select2("destroy").html('');  
237 - }  
238 - var fgs=$('#subCompany').val();  
239 - var gs=$('#company').val();  
240 - for(var i=0;i<xlList.length;i++){  
241 - if(gs!=""){  
242 - if(fgs!=""){  
243 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
244 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
245 - }  
246 - }else{  
247 - if(xlList[i]["gsbm"]==gs){  
248 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 189 + var tempData = {};
  190 + $.get('/report/lineList',function(xlList){
  191 + var data = [];
  192 + data.push({id: " ", text: "全部线路"});
  193 + $.get('/user/companyData', function(result){
  194 + for(var i = 0; i < result.length; i++){
  195 + var companyCode = result[i].companyCode;
  196 + var children = result[i].children;
  197 + for(var j = 0; j < children.length; j++){
  198 + var code = children[j].code;
  199 + for(var k=0;k < xlList.length;k++ ){
  200 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  201 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  202 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  203 + }
249 } 204 }
250 } 205 }
251 } 206 }
  207 + initPinYinSelect2('#line',data,'');
  208 +
  209 + });
  210 + });
  211 +
  212 + $("#line").on("change", function(){
  213 + if($("#line").val() == " "){
  214 + $("#company").attr("disabled", false);
  215 + $("#subCompany").attr("disabled", false);
  216 + } else {
  217 + var temp = tempData[$("#line").val()].split(":");
  218 + $("#company").val(temp[0]);
  219 + updateCompany();
  220 + $("#subCompany").val(temp[1]);
  221 + $("#company").attr("disabled", true);
  222 + $("#subCompany").attr("disabled", true);
252 } 223 }
253 - initPinYinSelect2('#line',data,'');  
254 - fage=true;  
255 -  
256 - line = "";  
257 - } 224 + });
258 225
259 226
260 $("#query").on("click",jsDoQuery); 227 $("#query").on("click",jsDoQuery);
@@ -294,13 +261,12 @@ @@ -294,13 +261,12 @@
294 // $(".hidden").removeClass("hidden"); 261 // $(".hidden").removeClass("hidden");
295 $get('/busInterval/correctStatis', params, function(result){ 262 $get('/busInterval/correctStatis', params, function(result){
296 // 把数据填充到模版中 263 // 把数据填充到模版中
297 -// var tbodyHtml = template('list_company',{list:result, type:1});  
298 - var tbodyHtml = "";  
299 - if(result.length != 0){ 264 + var tbodyHtml = template('list_company',{list:result});;
  265 + /* if(result.length != 0){
300 tbodyHtml = template('list_company',{list:result[0].workList[0].workList, type:3}); 266 tbodyHtml = template('list_company',{list:result[0].workList[0].workList, type:3});
301 }else{ 267 }else{
302 tbodyHtml = template('list_company',{list:result, type:3}); 268 tbodyHtml = template('list_company',{list:result, type:3});
303 - } 269 + } */
304 270
305 // 把渲染好的模版html文本追加到表格中 271 // 把渲染好的模版html文本追加到表格中
306 // $('#forms').html(tbodyHtml); 272 // $('#forms').html(tbodyHtml);
@@ -314,7 +280,7 @@ @@ -314,7 +280,7 @@
314 }); 280 });
315 } 281 }
316 282
317 - $("#forms").on("click","tbody tr",function(){ 283 + /* $("#forms").on("click","tbody tr",function(){
318 if($(this).children().size() < 2){ 284 if($(this).children().size() < 2){
319 return; 285 return;
320 } 286 }
@@ -332,9 +298,9 @@ @@ -332,9 +298,9 @@
332 subCompany = g.workList; 298 subCompany = g.workList;
333 } 299 }
334 }); 300 });
335 - }); 301 + }); */
336 302
337 - $("#subinfo").on("click","tbody tr",function(){ 303 + /* $("#subinfo").on("click","tbody tr",function(){
338 if($(this).children().size() < 2){ 304 if($(this).children().size() < 2){
339 return; 305 return;
340 } 306 }
@@ -351,9 +317,9 @@ @@ -351,9 +317,9 @@
351 lines = g.workList; 317 lines = g.workList;
352 } 318 }
353 }); 319 });
354 - }); 320 + }); */
355 321
356 - $("#lineinfo").on("click","tbody tr",function(){ 322 + /* $("#lineinfo").on("click","tbody tr",function(){
357 if($(this).children().size() < 2){ 323 if($(this).children().size() < 2){
358 return; 324 return;
359 } 325 }
@@ -361,13 +327,13 @@ @@ -361,13 +327,13 @@
361 $(this).children().each(function(index){ 327 $(this).children().each(function(index){
362 params[index] = $(this).text(); 328 params[index] = $(this).text();
363 }); 329 });
364 - $.each(lines, function(i, g){ 330 + $.each(lines, function(i, g){
365 if(g.company == params[1] && g.subCompany == params[2] && g.line == params[3]){ 331 if(g.company == params[1] && g.subCompany == params[2] && g.line == params[3]){
366 var tbodyHtml = template('list_workList',{list:g.workList}); 332 var tbodyHtml = template('list_workList',{list:g.workList});
367 $("#lines").html(tbodyHtml); 333 $("#lines").html(tbodyHtml);
368 } 334 }
369 - });  
370 - }); 335 + });
  336 + }); */
371 337
372 // $("#export").on("click", function(){ 338 // $("#export").on("click", function(){
373 // $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){ 339 // $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
@@ -414,9 +380,8 @@ @@ -414,9 +380,8 @@
414 <th class="hidden"></th> 380 <th class="hidden"></th>
415 <th rowspan="2" width="120px">日期</th> 381 <th rowspan="2" width="120px">日期</th>
416 <th rowspan="2">公司</th> 382 <th rowspan="2">公司</th>
417 - {{if type>1}}<th rowspan="2">分公司</th>{{/if}}  
418 - {{if type<3}}<th rowspan="2">线路条数</th>{{/if}}  
419 - {{if type==3}}<th rowspan="2">线路</th>{{/if}} 383 + <th rowspan="2">分公司</th>
  384 + <th rowspan="2">线路</th>
420 <th rowspan="2">实际营运班次</th> 385 <th rowspan="2">实际营运班次</th>
421 <th colspan="3" align="center">待发调整数</th> 386 <th colspan="3" align="center">待发调整数</th>
422 <th rowspan="2">掉线调整数</th> 387 <th rowspan="2">掉线调整数</th>
@@ -438,18 +403,15 @@ @@ -438,18 +403,15 @@
438 {{each list as obj i}} 403 {{each list as obj i}}
439 <tr> 404 <tr>
440 {{if obj.date=='合计'}} 405 {{if obj.date=='合计'}}
441 - {{if type==1}}<td colspan="2">{{obj.date}}</td>{{/if}}  
442 - {{if type==2}}<td colspan="3">{{obj.date}}</td>{{/if}}  
443 - {{if type==3}}<td colspan="4">{{obj.date}}</td>{{/if}} 406 +
  407 + <td colspan="4">{{obj.date}}</td>
444 {{/if}} 408 {{/if}}
445 {{if obj.date!='合计'}} 409 {{if obj.date!='合计'}}
446 <td>{{obj.date}}</td> 410 <td>{{obj.date}}</td>
447 -  
448 - {{/if}}  
449 - {{if obj.date!='合计'}}<td>{{obj.company}}</td>{{/if}}  
450 - {{if type>1 && obj.date!='合计'}}<td>{{obj.subCompany}}</td>{{/if}}  
451 - {{if type<3}}<td>{{obj.lines}}</td>{{/if}}  
452 - {{if type==3 && obj.date!='合计'}}<td>{{obj.line}}</td>{{/if}} 411 + <td>{{obj.company}}</td>
  412 + <td>{{obj.subCompany}}</td>
  413 + <td>{{obj.xlname}}</td>
  414 + {{/if}}
453 <td>{{obj.sjbc}}</td> 415 <td>{{obj.sjbc}}</td>
454 <td>{{obj.sddf}}</td> 416 <td>{{obj.sddf}}</td>
455 <td>{{obj.zddf}}</td> 417 <td>{{obj.zddf}}</td>
@@ -465,7 +427,7 @@ @@ -465,7 +427,7 @@
465 {{/each}} 427 {{/each}}
466 {{if list.length == 0}} 428 {{if list.length == 0}}
467 <tr> 429 <tr>
468 - <td colspan="15"><h6 class="muted">没有找到相关数据</h6></td> 430 + <td colspan="14"><h6 class="muted">没有找到相关数据</h6></td>
469 </tr> 431 </tr>
470 {{/if}} 432 {{/if}}
471 </tbody> 433 </tbody>
src/main/resources/static/pages/forms/statement/daily.html
@@ -139,7 +139,7 @@ @@ -139,7 +139,7 @@
139 } 139 }
140 } 140 }
141 $('#fgsdmDaily').html(options); 141 $('#fgsdmDaily').html(options);
142 - initXl(); 142 +// initXl();
143 } 143 }
144 144
145 /* $.get('/basic/lineCode2Name',function(result){ 145 /* $.get('/basic/lineCode2Name',function(result){
@@ -152,7 +152,7 @@ @@ -152,7 +152,7 @@
152 152
153 }) */ 153 }) */
154 154
155 - $("#fgsdmDaily").on("change",initXl); 155 + /* $("#fgsdmDaily").on("change",initXl);
156 function initXl(){ 156 function initXl(){
157 var data=[]; 157 var data=[];
158 if(fage){ 158 if(fage){
@@ -175,7 +175,44 @@ @@ -175,7 +175,44 @@
175 } 175 }
176 initPinYinSelect2('#line',data,''); 176 initPinYinSelect2('#line',data,'');
177 fage=true; 177 fage=true;
178 - } 178 + } */
  179 + var tempData = {};
  180 + $.get('/report/lineList',function(xlList){
  181 + var data = [];
  182 +// data.push({id: " ", text: "全部线路"});
  183 + $.get('/user/companyData', function(result){
  184 + for(var i = 0; i < result.length; i++){
  185 + var companyCode = result[i].companyCode;
  186 + var children = result[i].children;
  187 + for(var j = 0; j < children.length; j++){
  188 + var code = children[j].code;
  189 + for(var k=0;k < xlList.length;k++ ){
  190 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  191 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  192 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  193 + }
  194 + }
  195 + }
  196 + }
  197 + initPinYinSelect2('#line',data,'');
  198 +
  199 + });
  200 + });
  201 +
  202 + $("#line").on("change", function(){
  203 + if($("#line").val() == " "){
  204 + $("#gsdmDaily").attr("disabled", false);
  205 + $("#fgsdmDaily").attr("disabled", false);
  206 + } else {
  207 + var temp = tempData[$("#line").val()].split(":");
  208 + $("#gsdmDaily").val(temp[0]);
  209 + updateCompany();
  210 + $("#fgsdmDaily").val(temp[1]);
  211 + $("#gsdmDaily").attr("disabled", true);
  212 + $("#fgsdmDaily").attr("disabled", true);
  213 + }
  214 + });
  215 +
179 216
180 var line; 217 var line;
181 var date; 218 var date;
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
@@ -176,34 +176,44 @@ @@ -176,34 +176,44 @@
176 } 176 }
177 } 177 }
178 $('#subCompany').html(options); 178 $('#subCompany').html(options);
179 - initXl();  
180 } 179 }
181 -  
182 - $("#subCompany").on("change",initXl);  
183 - function initXl(){  
184 - var data=[];  
185 - if(fage){  
186 - $("#line").select2("destroy").html('');  
187 - }  
188 - var fgs=$('#subCompany').val();  
189 - var gs=$('#company').val(); 180 +
  181 + var tempData = {};
  182 + $.get('/report/lineList',function(xlList){
  183 + var data = [];
190 data.push({id: " ", text: "全部线路"}); 184 data.push({id: " ", text: "全部线路"});
191 - for(var i=0;i<xlList.length;i++){  
192 - if(gs!=""){  
193 - if(fgs!=""){  
194 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
195 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
196 - }  
197 - }else{  
198 - if(xlList[i]["gsbm"]==gs){  
199 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 185 + $.get('/user/companyData', function(result){
  186 + for(var i = 0; i < result.length; i++){
  187 + var companyCode = result[i].companyCode;
  188 + var children = result[i].children;
  189 + for(var j = 0; j < children.length; j++){
  190 + var code = children[j].code;
  191 + for(var k=0;k < xlList.length;k++ ){
  192 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  193 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  194 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  195 + }
200 } 196 }
201 } 197 }
202 } 198 }
  199 + initPinYinSelect2('#line',data,'');
  200 +
  201 + });
  202 + });
  203 +
  204 + $("#line").on("change", function(){
  205 + if($("#line").val() == " "){
  206 + $("#company").attr("disabled", false);
  207 + $("#subCompany").attr("disabled", false);
  208 + } else {
  209 + var temp = tempData[$("#line").val()].split(":");
  210 + $("#company").val(temp[0]);
  211 + updateCompany();
  212 + $("#subCompany").val(temp[1]);
  213 + $("#company").attr("disabled", true);
  214 + $("#subCompany").attr("disabled", true);
203 } 215 }
204 - initPinYinSelect2('#line',data,'');  
205 - fage=true;  
206 - } 216 + });
207 217
208 var list; 218 var list;
209 $("#forms tbody").on("click","a",function(){ 219 $("#forms tbody").on("click","a",function(){
src/main/resources/static/pages/forms/statement/historyMessage.html
@@ -81,16 +81,29 @@ @@ -81,16 +81,29 @@
81 locale : 'zh-cn' 81 locale : 'zh-cn'
82 }); 82 });
83 83
84 - $.get('/basic/lineCode2Name',function(result){  
85 - var data=[];  
86 -  
87 - for(var code in result){  
88 - data.push({id: code, text: result[code]});  
89 - }  
90 - console.log(data);  
91 - initPinYinSelect2('#line',data,'');  
92 -  
93 - }) 84 + $.get('/report/lineList',function(xlList){
  85 + var data = [];
  86 +// data.push({id: " ", text: "全部线路"});
  87 + $.get('/user/companyData', function(result){
  88 + for(var i = 0; i < result.length; i++){
  89 + var companyCode = result[i].companyCode;
  90 + var children = result[i].children;
  91 + for(var j = 0; j < children.length; j++){
  92 + var code = children[j].code;
  93 + for(var k=0;k < xlList.length;k++ ){
  94 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  95 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  96 +// tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  97 + }
  98 + }
  99 + }
  100 + }
  101 + initPinYinSelect2('#line',data,'');
  102 +
  103 + });
  104 + });
  105 +
  106 +
94 $('#code').select2({ 107 $('#code').select2({
95 ajax: { 108 ajax: {
96 url: '/realSchedule/sreachVehic', 109 url: '/realSchedule/sreachVehic',
src/main/resources/static/pages/forms/statement/jobSummary.html
@@ -240,43 +240,46 @@ @@ -240,43 +240,46 @@
240 } 240 }
241 } 241 }
242 $('#fgsdmJob').html(options); 242 $('#fgsdmJob').html(options);
243 - initXl(); 243 +// initXl();
244 } 244 }
245 245
246 - $("#fgsdmJob").on("change",initXl);  
247 - function initXl(){  
248 - var data=[];  
249 - if(fage){  
250 - $("#line").select2("destroy").html('');  
251 - }  
252 - var fgs=$('#fgsdmJob').val();  
253 - var gs=$('#gsdmJob').val();  
254 - for(var i=0;i<xlList.length;i++){  
255 - if(gs!=""){  
256 - if(fgs!=""){  
257 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
258 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
259 - }  
260 - }else{  
261 - if(xlList[i]["gsbm"]==gs){  
262 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 246 + var tempData = {};
  247 + $.get('/report/lineList',function(xlList){
  248 + var data = [];
  249 +// data.push({id: " ", text: "全部线路"});
  250 + $.get('/user/companyData', function(result){
  251 + for(var i = 0; i < result.length; i++){
  252 + var companyCode = result[i].companyCode;
  253 + var children = result[i].children;
  254 + for(var j = 0; j < children.length; j++){
  255 + var code = children[j].code;
  256 + for(var k=0;k < xlList.length;k++ ){
  257 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  258 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  259 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  260 + }
263 } 261 }
264 } 262 }
265 } 263 }
266 - }  
267 - initPinYinSelect2('#line',data,'');  
268 - fage=true;  
269 - } 264 + initPinYinSelect2('#line',data,'');
  265 +
  266 + });
  267 + });
270 268
271 - /* $.get('/basic/lineCode2Name',function(result){  
272 - var data=[];  
273 -  
274 - for(var code in result){  
275 - data.push({id: code, text: result[code]}); 269 + $("#line").on("change", function(){
  270 + if($("#line").val() == " "){
  271 + $("#gsdmJob").attr("disabled", false);
  272 + $("#fgsdmJob").attr("disabled", false);
  273 + } else {
  274 + var temp = tempData[$("#line").val()].split(":");
  275 + $("#gsdmJob").val(temp[0]);
  276 + updateCompany();
  277 + $("#fgsdmJob").val(temp[1]);
  278 + $("#gsdmJob").attr("disabled", true);
  279 + $("#fgsdmJob").attr("disabled", true);
276 } 280 }
277 - initPinYinSelect2('#line',data,'');  
278 -  
279 - }) */ 281 + });
  282 +
280 283
281 jQuery.fn.rowspan = function(colIdx) { //封装的一个JQuery小插件 284 jQuery.fn.rowspan = function(colIdx) { //封装的一个JQuery小插件
282 return this.each(function(){ 285 return this.each(function(){
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
@@ -233,36 +233,44 @@ @@ -233,36 +233,44 @@
233 } 233 }
234 } 234 }
235 $('#subCompany').html(options); 235 $('#subCompany').html(options);
236 - initXl();  
237 } 236 }
238 237
239 - $("#subCompany").on("change",initXl);  
240 - function initXl(){  
241 - var data=[];  
242 - data.push({id:" ", text:"全部线路"});  
243 - if(fage){  
244 - $("#line").select2("destroy").html('');  
245 - }  
246 - var fgs=$('#subCompany').val();  
247 - var gs=$('#company').val();  
248 - for(var i=0;i<xlList.length;i++){  
249 - if(gs!=""){  
250 - if(fgs!=""){  
251 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
252 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
253 - }  
254 - }else{  
255 - if(xlList[i]["gsbm"]==gs){  
256 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 238 + var tempData = {};
  239 + $.get('/report/lineList',function(xlList){
  240 + var data = [];
  241 + data.push({id: " ", text: "全部线路"});
  242 + $.get('/user/companyData', function(result){
  243 + for(var i = 0; i < result.length; i++){
  244 + var companyCode = result[i].companyCode;
  245 + var children = result[i].children;
  246 + for(var j = 0; j < children.length; j++){
  247 + var code = children[j].code;
  248 + for(var k=0;k < xlList.length;k++ ){
  249 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  250 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  251 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  252 + }
257 } 253 }
258 } 254 }
259 } 255 }
  256 + initPinYinSelect2('#line',data,'');
  257 +
  258 + });
  259 + });
  260 +
  261 + $("#line").on("change", function(){
  262 + if($("#line").val() == " "){
  263 + $("#company").attr("disabled", false);
  264 + $("#subCompany").attr("disabled", false);
  265 + } else {
  266 + var temp = tempData[$("#line").val()].split(":");
  267 + $("#company").val(temp[0]);
  268 + updateCompany();
  269 + $("#subCompany").val(temp[1]);
  270 + $("#company").attr("disabled", true);
  271 + $("#subCompany").attr("disabled", true);
260 } 272 }
261 - initPinYinSelect2('#line',data,'');  
262 - line = data[0].id;  
263 - updateModel();  
264 - fage=true;  
265 - } 273 + });
266 274
267 var lb = 0; //标志是否有选择至少一个烂班类型 275 var lb = 0; //标志是否有选择至少一个烂班类型
268 $("#totalLb").on("change", function(){ 276 $("#totalLb").on("change", function(){
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
@@ -291,48 +291,57 @@ @@ -291,48 +291,57 @@
291 } 291 }
292 } 292 }
293 $('#subCompany').html(options); 293 $('#subCompany').html(options);
294 - initXl();  
295 } 294 }
296 295
297 - $("#subCompany").on("change",initXl);  
298 - function initXl(){  
299 - var data=[];  
300 - if(fage){  
301 - $("#line").select2("destroy").html('');  
302 - }  
303 - var fgs=$('#subCompany').val();  
304 - var gs=$('#company').val();  
305 - for(var i=0;i<xlList.length;i++){  
306 - if(gs!=""){  
307 - if(fgs!=""){  
308 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
309 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
310 - }  
311 - }else{  
312 - if(xlList[i]["gsbm"]==gs){  
313 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 296 +
  297 +
  298 + var tempData = {};
  299 + $.get('/report/lineList',function(xlList){
  300 + var data = [];
  301 + $.get('/user/companyData', function(result){
  302 + for(var i = 0; i < result.length; i++){
  303 + var companyCode = result[i].companyCode;
  304 + var children = result[i].children;
  305 + for(var j = 0; j < children.length; j++){
  306 + var code = children[j].code;
  307 + for(var k=0;k < xlList.length;k++ ){
  308 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  309 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  310 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  311 + }
314 } 312 }
315 } 313 }
316 } 314 }
317 - }  
318 - initPinYinSelect2('#line',data,'');  
319 - fage=true;  
320 -  
321 - line = data[0].id;  
322 - updateModel();  
323 -  
324 - var params = {};  
325 - params['line'] = line;  
326 - $get('/busInterval/getDir', params, function(result){  
327 - dirData = createTreeData(result);  
328 - var options = '<option value="">全部方向</option>';  
329 - $.each(dirData, function(i, g){  
330 - options += '<option value="'+g.name+'">'+g.name+'</option>'; 315 + initPinYinSelect2('#line',data,'');
  316 + line = data[0].id;
  317 + updateModel();
  318 +
  319 + var params = {};
  320 + params['line'] = line;
  321 + $get('/busInterval/getDir', params, function(result){
  322 + dirData = createTreeData(result);
  323 + var options = '<option value="">全部方向</option>';
  324 + $.each(dirData, function(i, g){
  325 + options += '<option value="'+g.name+'">'+g.name+'</option>';
  326 + });
  327 + $('#upDown').html(options);
331 }); 328 });
332 - $('#upDown').html(options);  
333 }); 329 });
334 - }  
335 - 330 + });
  331 +
  332 + $("#line").on("change", function(){
  333 + if($("#line").val() == " "){
  334 + $("#company").attr("disabled", false);
  335 + $("#subCompany").attr("disabled", false);
  336 + } else {
  337 + var temp = tempData[$("#line").val()].split(":");
  338 + $("#company").val(temp[0]);
  339 + updateCompany();
  340 + $("#subCompany").val(temp[1]);
  341 + $("#company").attr("disabled", true);
  342 + $("#subCompany").attr("disabled", true);
  343 + }
  344 + });
336 345
337 $("#query").on("click", function (){ 346 $("#query").on("click", function (){
338 jsDoQuery(); 347 jsDoQuery();
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
@@ -138,33 +138,43 @@ @@ -138,33 +138,43 @@
138 } 138 }
139 } 139 }
140 $('#subCompany').html(options); 140 $('#subCompany').html(options);
141 - initXl();  
142 } 141 }
143 -  
144 - $("#subCompany").on("change",initXl);  
145 - function initXl(){  
146 - var data=[];  
147 - if(fage){  
148 - $("#line").select2("destroy").html('');  
149 - }  
150 - var fgs=$('#subCompany').val();  
151 - var gs=$('#company').val();  
152 - for(var i=0;i<xlList.length;i++){  
153 - if(gs!=""){  
154 - if(fgs!=""){  
155 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
156 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
157 - }  
158 - }else{  
159 - if(xlList[i]["gsbm"]==gs){  
160 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 142 + var tempData = {};
  143 + $.get('/report/lineList',function(xlList){
  144 + var data = [];
  145 + $.get('/user/companyData', function(result){
  146 + for(var i = 0; i < result.length; i++){
  147 + var companyCode = result[i].companyCode;
  148 + var children = result[i].children;
  149 + for(var j = 0; j < children.length; j++){
  150 + var code = children[j].code;
  151 + for(var k=0;k < xlList.length;k++ ){
  152 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  153 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  154 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  155 + }
161 } 156 }
162 } 157 }
163 } 158 }
  159 + initPinYinSelect2('#line',data,'');
  160 +
  161 + });
  162 + });
  163 +
  164 + $("#line").on("change", function(){
  165 + if($("#line").val() == " "){
  166 + $("#company").attr("disabled", false);
  167 + $("#subCompany").attr("disabled", false);
  168 + } else {
  169 + var temp = tempData[$("#line").val()].split(":");
  170 + $("#company").val(temp[0]);
  171 + updateCompany();
  172 + $("#subCompany").val(temp[1]);
  173 + $("#company").attr("disabled", true);
  174 + $("#subCompany").attr("disabled", true);
164 } 175 }
165 - initPinYinSelect2('#line',data,'');  
166 - fage=true;  
167 - } 176 + });
  177 +
168 178
169 179
170 $("#query").on("click",jsDoQuery); 180 $("#query").on("click",jsDoQuery);
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
@@ -171,35 +171,46 @@ @@ -171,35 +171,46 @@
171 } 171 }
172 } 172 }
173 $('#subCompany').html(options); 173 $('#subCompany').html(options);
174 - initXl();  
175 } 174 }
176 175
177 - $("#subCompany").on("change",initXl);  
178 - function initXl(){  
179 - var data=[];  
180 - if(fage){  
181 - $("#line").select2("destroy").html('');  
182 - }  
183 - var fgs=$('#subCompany').val();  
184 - var gs=$('#company').val();  
185 - for(var i=0;i<xlList.length;i++){  
186 - if(gs!=""){  
187 - if(fgs!=""){  
188 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
189 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
190 - }  
191 - }else{  
192 - if(xlList[i]["gsbm"]==gs){  
193 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 176 +
  177 + var tempData = {};
  178 + $.get('/report/lineList',function(xlList){
  179 + var data = [];
  180 + $.get('/user/companyData', function(result){
  181 + for(var i = 0; i < result.length; i++){
  182 + var companyCode = result[i].companyCode;
  183 + var children = result[i].children;
  184 + for(var j = 0; j < children.length; j++){
  185 + var code = children[j].code;
  186 + for(var k=0;k < xlList.length;k++ ){
  187 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  188 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  189 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  190 + }
194 } 191 }
195 } 192 }
196 } 193 }
  194 + initPinYinSelect2('#line',data,'');
  195 + line = data[0].id;
  196 + updateModel();
  197 +
  198 + });
  199 + });
  200 +
  201 + $("#line").on("change", function(){
  202 + if($("#line").val() == " "){
  203 + $("#company").attr("disabled", false);
  204 + $("#subCompany").attr("disabled", false);
  205 + } else {
  206 + var temp = tempData[$("#line").val()].split(":");
  207 + $("#company").val(temp[0]);
  208 + updateCompany();
  209 + $("#subCompany").val(temp[1]);
  210 + $("#company").attr("disabled", true);
  211 + $("#subCompany").attr("disabled", true);
197 } 212 }
198 - initPinYinSelect2('#line',data,'');  
199 - line = data[0].id;  
200 - updateModel();  
201 - fage=true;  
202 - } 213 + });
203 214
204 215
205 $("#query").on("click", function(){ 216 $("#query").on("click", function(){
src/main/resources/static/pages/forms/statement/scheduleAnaly_sum.html
@@ -171,38 +171,45 @@ @@ -171,38 +171,45 @@
171 } 171 }
172 } 172 }
173 $('#subCompany').html(options); 173 $('#subCompany').html(options);
174 - initXl();  
175 } 174 }
176 -  
177 - $("#subCompany").on("change",initXl);  
178 - function initXl(){  
179 - var data=[];  
180 - if(fage){  
181 - $("#line").select2("destroy").html('');  
182 - }  
183 - var fgs=$('#subCompany').val();  
184 - var gs=$('#company').val();  
185 - for(var i=0;i<xlList.length;i++){  
186 - if(gs!=""){  
187 - if(fgs!=""){  
188 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
189 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
190 - }  
191 - }else{  
192 - if(xlList[i]["gsbm"]==gs){  
193 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 175 +
  176 + var tempData = {};
  177 + $.get('/report/lineList',function(xlList){
  178 + var data = [];
  179 + $.get('/user/companyData', function(result){
  180 + for(var i = 0; i < result.length; i++){
  181 + var companyCode = result[i].companyCode;
  182 + var children = result[i].children;
  183 + for(var j = 0; j < children.length; j++){
  184 + var code = children[j].code;
  185 + for(var k=0;k < xlList.length;k++ ){
  186 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  187 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  188 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  189 + }
194 } 190 }
195 } 191 }
196 } 192 }
197 - }  
198 - initPinYinSelect2('#line',data,'');  
199 - line = data[0].id;  
200 - updateModel();  
201 - initCl();  
202 -  
203 - fage=true;  
204 - } 193 + initPinYinSelect2('#line',data,'');
  194 + line = data[0].id;
  195 + updateModel();
  196 + initCl();
  197 + });
  198 + });
205 199
  200 + $("#line").on("change", function(){
  201 + if($("#line").val() == " "){
  202 + $("#company").attr("disabled", false);
  203 + $("#subCompany").attr("disabled", false);
  204 + } else {
  205 + var temp = tempData[$("#line").val()].split(":");
  206 + $("#company").val(temp[0]);
  207 + updateCompany();
  208 + $("#subCompany").val(temp[1]);
  209 + $("#company").attr("disabled", true);
  210 + $("#subCompany").attr("disabled", true);
  211 + }
  212 + });
206 213
207 $("#query").on("click", function(){ 214 $("#query").on("click", function(){
208 page = 0; 215 page = 0;
src/main/resources/static/pages/forms/statement/scheduleDaily.html
@@ -70,7 +70,7 @@ word-wrap: break-word; @@ -70,7 +70,7 @@ word-wrap: break-word;
70 <table class="table table-bordered table-hover table-checkable" id="forms"> 70 <table class="table table-bordered table-hover table-checkable" id="forms">
71 <thead> 71 <thead>
72 <tr> 72 <tr>
73 - <th colspan="40">线路调度日报</th> 73 + <th colspan="40"><lable id="xlmc"></lable>线路调度日报</th>
74 </tr> 74 </tr>
75 <tr> 75 <tr>
76 <td rowspan="3"><span >路线名</span></td> 76 <td rowspan="3"><span >路线名</span></td>
@@ -340,32 +340,46 @@ word-wrap: break-word; @@ -340,32 +340,46 @@ word-wrap: break-word;
340 } 340 }
341 } 341 }
342 $('#fgsdmDdrb').html(options); 342 $('#fgsdmDdrb').html(options);
343 - initXl();  
344 } 343 }
345 - $("#fgsdmDdrb").on("change",initXl);  
346 - function initXl(){  
347 - var data=[];  
348 - if(fage){  
349 - $("#line").select2("destroy").html('');  
350 - }  
351 - var fgs=$('#fgsdmDdrb').val();  
352 - var gs=$('#gsdmDdrb').val();  
353 - for(var i=0;i<xlList.length;i++){  
354 - if(gs!=""){  
355 - if(fgs!=""){  
356 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
357 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
358 - }  
359 - }else{  
360 - if(xlList[i]["gsbm"]==gs){  
361 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 344 +
  345 +
  346 + var tempData = {};
  347 + $.get('/report/lineList',function(xlList){
  348 + var data = [];
  349 + $.get('/user/companyData', function(result){
  350 + for(var i = 0; i < result.length; i++){
  351 + var companyCode = result[i].companyCode;
  352 + var children = result[i].children;
  353 + for(var j = 0; j < children.length; j++){
  354 + var code = children[j].code;
  355 + for(var k=0;k < xlList.length;k++ ){
  356 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  357 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  358 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  359 + }
362 } 360 }
363 } 361 }
364 } 362 }
  363 + initPinYinSelect2('#line',data,'');
  364 +
  365 + });
  366 + });
  367 +
  368 + $("#line").on("change", function(){
  369 + if($("#line").val() == " "){
  370 + $("#gsdmDdrb").attr("disabled", false);
  371 + $("#fgsdmDdrb").attr("disabled", false);
  372 + } else {
  373 + var temp = tempData[$("#line").val()].split(":");
  374 + $("#gsdmDdrb").val(temp[0]);
  375 + updateCompany();
  376 + $("#fgsdmDdrb").val(temp[1]);
  377 + $("#gsdmDdrb").attr("disabled", true);
  378 + $("#fgsdmDdrb").attr("disabled", true);
365 } 379 }
366 - initPinYinSelect2('#line',data,'');  
367 - fage=true;  
368 - } 380 + });
  381 +
  382 +
369 $('#export').attr('disabled', "true"); 383 $('#export').attr('disabled', "true");
370 384
371 var line = $("#line").val(); 385 var line = $("#line").val();
@@ -407,6 +421,7 @@ word-wrap: break-word; @@ -407,6 +421,7 @@ word-wrap: break-word;
407 layer.msg("请选择时间"); 421 layer.msg("请选择时间");
408 return; 422 return;
409 } 423 }
  424 + $("#xlmc").html(xlName);
410 $("#ddrbBody").height($(window).height()-100); 425 $("#ddrbBody").height($(window).height()-100);
411 $("c").html("全日"); 426 $("c").html("全日");
412 $("#export").removeAttr("disabled"); 427 $("#export").removeAttr("disabled");
src/main/resources/static/pages/forms/statement/statisticsDaily.html
@@ -206,33 +206,47 @@ @@ -206,33 +206,47 @@
206 } 206 }
207 } 207 }
208 $('#fgsdm').html(options); 208 $('#fgsdm').html(options);
209 - initXl(); 209 +// initXl();
210 } 210 }
211 - $("#fgsdm").on("change",initXl);  
212 - function initXl(){  
213 - var data=[]; 211 +
  212 + var tempData = {};
  213 + $.get('/report/lineList',function(xlList){
  214 + var data = [];
214 data.push({id: " ", text: "全部线路"}); 215 data.push({id: " ", text: "全部线路"});
215 - if(fage){  
216 - $("#line").select2("destroy").html('');  
217 - }  
218 - var fgs=$('#fgsdm').val();  
219 - var gs=$('#gsdm').val();  
220 - for(var i=0;i<xlList.length;i++){  
221 - if(gs!=""){  
222 - if(fgs!=""){  
223 - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){  
224 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});  
225 - }  
226 - }else{  
227 - if(xlList[i]["gsbm"]==gs){  
228 - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]}); 216 + $.get('/user/companyData', function(result){
  217 + for(var i = 0; i < result.length; i++){
  218 + var companyCode = result[i].companyCode;
  219 + var children = result[i].children;
  220 + for(var j = 0; j < children.length; j++){
  221 + var code = children[j].code;
  222 + for(var k=0;k < xlList.length;k++ ){
  223 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  224 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  225 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  226 + }
229 } 227 }
230 } 228 }
231 } 229 }
  230 + initPinYinSelect2('#line',data,'');
  231 +
  232 + });
  233 + });
  234 +
  235 + $("#line").on("change", function(){
  236 + if($("#line").val() == " "){
  237 + $("#gsdm").attr("disabled", false);
  238 + $("#fgsdm").attr("disabled", false);
  239 + } else {
  240 + var temp = tempData[$("#line").val()].split(":");
  241 + $("#gsdm").val(temp[0]);
  242 + updateCompany();
  243 + $("#fgsdm").val(temp[1]);
  244 + $("#gsdm").attr("disabled", true);
  245 + $("#fgsdm").attr("disabled", true);
232 } 246 }
233 - initPinYinSelect2('#line',data,'');  
234 - fage=true;  
235 - } 247 + });
  248 +
  249 +
236 var line =""; 250 var line ="";
237 var xlName =""; 251 var xlName ="";
238 var date = ""; 252 var date = "";
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
@@ -235,43 +235,50 @@ @@ -235,43 +235,50 @@
235 } 235 }
236 } 236 }
237 $('#subCompany').html(options); 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 $("#query").on("click", function (){ 283 $("#query").on("click", function (){
277 jsDoQuery(); 284 jsDoQuery();
src/main/resources/static/pages/forms/statement/waybill.html
@@ -158,14 +158,14 @@ @@ -158,14 +158,14 @@
158 } 158 }
159 } 159 }
160 $('#fgsdmXcld').html(options); 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 var data=[]; 169 var data=[];
170 if(fage){ 170 if(fage){
171 $("#line").select2("destroy").html(''); 171 $("#line").select2("destroy").html('');
@@ -187,7 +187,44 @@ @@ -187,7 +187,44 @@
187 } 187 }
188 initPinYinSelect2('#line',data,''); 188 initPinYinSelect2('#line',data,'');
189 fage=true; 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 var date = ''; 228 var date = '';
192 var line = ''; 229 var line = '';
193 $("#query").on("click",function(){ 230 $("#query").on("click",function(){
src/main/resources/static/pages/forms/statement/workDaily.html
@@ -112,44 +112,6 @@ @@ -112,44 +112,6 @@
112 day = "0" + day; 112 day = "0" + day;
113 $("#date").val(year + "-" + month + "-" + day); 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 var fage=false; 115 var fage=false;
154 var xlList; 116 var xlList;
155 var obj = []; 117 var obj = [];
@@ -188,34 +150,45 @@ @@ -188,34 +150,45 @@
188 } 150 }
189 } 151 }
190 $('#subCompany').html(options); 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 data.push({id: " ", text: "全部线路"}); 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,35 +180,46 @@
180 } 180 }
181 } 181 }
182 $('#fgsdmChange').html(options); 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 var line; 223 var line;
213 var startDate; 224 var startDate;
214 var endDate; 225 var endDate;
src/main/resources/static/pages/mforms/operationservices/operationservice.html
@@ -153,45 +153,45 @@ @@ -153,45 +153,45 @@
153 } 153 }
154 } 154 }
155 $('#fgsdmOperat').html(options); 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 data.push({id: " ", text: "全部线路"}); 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 $("#query").on( 196 $("#query").on(
197 "click", 197 "click",
src/main/resources/static/pages/mforms/shifdays/shifday.html
@@ -152,7 +152,6 @@ $(function(){ @@ -152,7 +152,6 @@ $(function(){
152 } 152 }
153 } 153 }
154 $('#fgsdmShif').html(options); 154 $('#fgsdmShif').html(options);
155 - initXl();  
156 } 155 }
157 156
158 157
@@ -166,30 +165,43 @@ $(function(){ @@ -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 $("#query").on("click",function(){ 207 $("#query").on("click",function(){
src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
@@ -150,32 +150,45 @@ @@ -150,32 +150,45 @@
150 } 150 }
151 } 151 }
152 $('#fgsdmManth').html(options); 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 $("#query").on("click",function(){ 192 $("#query").on("click",function(){
180 if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ 193 if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
181 layer.msg("请选择时间范围!"); 194 layer.msg("请选择时间范围!");
src/main/resources/static/pages/mforms/singledatas/singledata.html
@@ -134,34 +134,44 @@ @@ -134,34 +134,44 @@
134 } 134 }
135 } 135 }
136 $('#fgsdmSing').html(options); 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 $("#query").on("click",function(){ 177 $("#query").on("click",function(){
src/main/resources/static/pages/mforms/turnoutrates/turnoutrate.html
@@ -172,34 +172,44 @@ @@ -172,34 +172,44 @@
172 } 172 }
173 } 173 }
174 $('#fgsdmTurn').html(options); 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 var line; 214 var line;
205 var startDate; 215 var startDate;
src/main/resources/static/pages/mforms/vehicleloadings/vehicleloading.html
@@ -127,33 +127,43 @@ @@ -127,33 +127,43 @@
127 } 127 }
128 } 128 }
129 $('#fgsdmVehic').html(options); 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 var line ; 168 var line ;
159 var date ; 169 var date ;
src/main/resources/static/pages/mforms/waybilldays/waybillday.html
@@ -131,32 +131,46 @@ @@ -131,32 +131,46 @@
131 } 131 }
132 } 132 }
133 $('#fgsdmWaybillday').html(options); 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 var line; 174 var line;
161 var date; 175 var date;
162 var gsdmWaybillday; 176 var gsdmWaybillday;
src/main/resources/static/pages/report/countMileage/countBus/countBusMileage.html
@@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
37 <div class="portlet light porttlet-fit bordered"> 37 <div class="portlet light porttlet-fit bordered">
38 <div class="portlet-title"> 38 <div class="portlet-title">
39 <form class="form-inline" action=""> 39 <form class="form-inline" action="">
40 - <div style="display: inline-block; " id="gsdmDiv"> 40 + <div style="display: inline-block;margin-left: 28px; " id="gsdmDiv">
41 <span class="item-label" style="width: 80px;">公司: </span> 41 <span class="item-label" style="width: 80px;">公司: </span>
42 <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select> 42 <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
43 </div> 43 </div>
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 <span class="item-label" style="width: 80px;">分公司: </span> 45 <span class="item-label" style="width: 80px;">分公司: </span>
46 <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select> 46 <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
47 </div> 47 </div>
48 - <div style="display: inline-block;margin-left: 29px;"> 48 + <div style="display: inline-block;margin-left: 43px;">
49 <span class="item-label" style="width: 80px;">线路: </span> 49 <span class="item-label" style="width: 80px;">线路: </span>
50 <select class="form-control" name="line" id="line" style="width: 180px;"></select> 50 <select class="form-control" name="line" id="line" style="width: 180px;"></select>
51 </div> 51 </div>
@@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
66 <option value="js">驾/售</option> 66 <option value="js">驾/售</option>
67 </select> 67 </select>
68 </div> 68 </div>
69 - <div class="form-group"> 69 + <div class="form-group" style="margin-left: 55px;">
70 <input class="btn btn-default" type="button" id="query" value="查询"/> 70 <input class="btn btn-default" type="button" id="query" value="查询"/>
71 <input class="btn btn-default" type="button" id="export" value="导出"/> 71 <input class="btn btn-default" type="button" id="export" value="导出"/>
72 </div> 72 </div>
@@ -149,33 +149,46 @@ @@ -149,33 +149,46 @@
149 } 149 }
150 } 150 }
151 $('#fgsdm').html(options); 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 data.push({id: " ", text: "全部线路"}); 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 var line =""; 192 var line ="";
180 var xlName =""; 193 var xlName ="";
181 var date = ""; 194 var date = "";
@@ -241,9 +254,10 @@ @@ -241,9 +254,10 @@
241 params['date'] = date; 254 params['date'] = date;
242 params['date2'] = date2; 255 params['date2'] = date2;
243 params['xlName'] = xlName; 256 params['xlName'] = xlName;
  257 + params['zt']=zt;
244 params['type'] = "export"; 258 params['type'] = "export";
245 - $get('/realSchedule/statisticsDailyTj',params,function(result){  
246 - window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD")); 259 + $get('/report/countBusMileage',params,function(result){
  260 + window.open("/downloadFile/download?fileName=路单数据统计表");
247 }); 261 });
248 }); 262 });
249 263
@@ -306,8 +320,8 @@ @@ -306,8 +320,8 @@
306 <td>{{obj.jhwjcclc}}</td> 320 <td>{{obj.jhwjcclc}}</td>
307 <td>{{obj.kfks}}</td> 321 <td>{{obj.kfks}}</td>
308 <td>{{obj.zrwjcclc}}</td> 322 <td>{{obj.zrwjcclc}}</td>
309 - <td>0</td>  
310 - <td>0</td> 323 + <td>{{obj.zrwjcclc1}}</td>
  324 + <td>{{obj.zrwjcclc2}}</td>
311 <td>{{obj.ljyy}}</td> 325 <td>{{obj.ljyy}}</td>
312 <td>{{obj.ljjcc}}</td> 326 <td>{{obj.ljjcc}}</td>
313 <td>{{obj.yhl}}</td> 327 <td>{{obj.yhl}}</td>
src/main/resources/static/pages/report/countMileage/countLine/countLineMileage.html
@@ -184,33 +184,46 @@ @@ -184,33 +184,46 @@
184 } 184 }
185 } 185 }
186 $('#fgsdm').html(options); 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 data.push({id: " ", text: "全部线路"}); 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 var line =""; 227 var line ="";
215 var xlName =""; 228 var xlName ="";
216 var date = ""; 229 var date = "";
@@ -272,7 +285,7 @@ @@ -272,7 +285,7 @@
272 params['date2'] = date2; 285 params['date2'] = date2;
273 params['xlName'] = xlName; 286 params['xlName'] = xlName;
274 params['type'] = "export"; 287 params['type'] = "export";
275 - $get('/realSchedule/countLineMileage',params,function(result){ 288 + $get('/report/countLineMileage',params,function(result){
276 window.open("/downloadFile/download?fileName=线路公里统计表"); 289 window.open("/downloadFile/download?fileName=线路公里统计表");
277 }); 290 });
278 }); 291 });
@@ -293,8 +306,8 @@ @@ -293,8 +306,8 @@
293 <td>{{obj.jhnjcclc}}</td> 306 <td>{{obj.jhnjcclc}}</td>
294 <td>{{obj.jhwjcclc}}</td> 307 <td>{{obj.jhwjcclc}}</td>
295 <td>{{obj.zrwjcclc}}</td> 308 <td>{{obj.zrwjcclc}}</td>
296 - <td>0</td>  
297 - <td>0</td> 309 + <td>{{obj.zrwjcclc1}}</td>
  310 + <td>{{obj.zrwjcclc2}}</td>
298 <td>{{obj.lbss}}</td> 311 <td>{{obj.lbss}}</td>
299 <td>{{obj.ssgl_lz}}</td> 312 <td>{{obj.ssgl_lz}}</td>
300 <td>{{obj.ssgl_dm}}</td> 313 <td>{{obj.ssgl_dm}}</td>
src/main/resources/static/pages/report/inoutstation.html
@@ -238,37 +238,47 @@ @@ -238,37 +238,47 @@
238 } 238 }
239 } 239 }
240 $('#fgsdm').html(options); 240 $('#fgsdm').html(options);
241 - initXl();  
242 initCl(); 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 $("#query").on("click",function(){ 284 $("#query").on("click",function(){
src/main/resources/static/pages/report/message/message.html
@@ -120,16 +120,25 @@ @@ -120,16 +120,25 @@
120 day = "0" + day; 120 day = "0" + day;
121 $("#date").val(year + "-" + month + "-" + day); 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 $('#code').select2({ 142 $('#code').select2({
134 ajax: { 143 ajax: {
135 url: '/realSchedule/sreachVehic', 144 url: '/realSchedule/sreachVehic',
src/main/resources/static/pages/report/oil/oilListMonth.html
@@ -105,16 +105,28 @@ @@ -105,16 +105,28 @@
105 $("#date").val(year + "-0" + month + "-" + day); 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 $("#query").on('click',function(){ 132 $("#query").on('click',function(){
src/main/resources/static/pages/report/sheet/sheetList.html
@@ -170,37 +170,47 @@ @@ -170,37 +170,47 @@
170 } 170 }
171 } 171 }
172 $('#fgsdm').html(options); 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 $("#query").on('click',function(){ 215 $("#query").on('click',function(){
206 var line = $("#line").val(); 216 var line = $("#line").val();
src/main/resources/static/pages/report/timetable/timetable.html
@@ -237,36 +237,46 @@ @@ -237,36 +237,46 @@
237 } 237 }
238 } 238 }
239 $('#fgsdmTime').html(options); 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 var flag = 0; 282 var flag = 0;
src/main/resources/static/pages/scheduleApp/Gruntfile.js
@@ -87,7 +87,8 @@ module.exports = function (grunt) { @@ -87,7 +87,8 @@ module.exports = function (grunt) {
87 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令 87 'module/common/dts2/bcGroup/saBcgroup.js', // 班次选择整合指令
88 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令 88 'module/common/dts2/ttinfotable/saTimeTable.js', // 时刻表显示指令
89 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排版计划form中使用) 89 'module/common/dts2/scheduleplan/saScpdate.js', // saScpdate指令(非通用指令,只在排版计划form中使用)
90 - 'module/common/dts2/scheduleplan/saPlaninfoedit.js' // saPlaninfoedit指令(非通用指令,只在调度执勤日报中使用) 90 + 'module/common/dts2/scheduleplan/saPlaninfoedit.js', // saPlaninfoedit指令(非通用指令,只在调度执勤日报中使用)
  91 + 'module/common/dts2/scheduleplan/saPlaninfoedit2.js' // saPlaninfoedit2指令(非通用指令,只在调度执勤日报中使用)
91 ], 92 ],
92 dest: 'module/common/prj-common-directive.js' 93 dest: 'module/common/prj-common-directive.js'
93 }, 94 },
src/main/resources/static/pages/scheduleApp/module/common/dts1/select/saSelect5.js
@@ -195,6 +195,10 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -195,6 +195,10 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
195 * 验证内部数据,更新外部model 195 * 验证内部数据,更新外部model
196 */ 196 */
197 scope[ctrlAs].$$internal_validate_model = function() { 197 scope[ctrlAs].$$internal_validate_model = function() {
  198 + // TODO:
  199 + //console.log(scope[ctrlAs].$$internal_select_value);
  200 + //console.log(scope[ctrlAs].$$data_real);
  201 +
198 if (scope[ctrlAs].$$internal_select_value) { 202 if (scope[ctrlAs].$$internal_select_value) {
199 var select_value_temp = scope[ctrlAs].$$internal_select_value; 203 var select_value_temp = scope[ctrlAs].$$internal_select_value;
200 if (scope[ctrlAs].$$data_real && scope[ctrlAs].$$data_real.length > 0) { 204 if (scope[ctrlAs].$$data_real && scope[ctrlAs].$$data_real.length > 0) {
@@ -206,6 +210,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -206,6 +210,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
206 } 210 }
207 } 211 }
208 if (obj) { // 在data中判定有没有 212 if (obj) { // 在data中判定有没有
  213 + // 初始化的时候,模拟选中uiselect
  214 + scope[ctrlAs].$$internal_select_fn(obj);
  215 +
209 for (var k = 0; k < scope[ctrlAs].$$data.length; k++) { 216 for (var k = 0; k < scope[ctrlAs].$$data.length; k++) {
210 if (eval("scope[ctrlAs].$$data[k]" + "." + $icname_attr + " == obj." + $icname_attr)) { 217 if (eval("scope[ctrlAs].$$data[k]" + "." + $icname_attr + " == obj." + $icname_attr)) {
211 obj = undefined; 218 obj = undefined;
@@ -218,6 +225,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -218,6 +225,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
218 // 更新内部model,用于外部验证 225 // 更新内部model,用于外部验证
219 // 内部model的值暂时随意,以后再改 226 // 内部model的值暂时随意,以后再改
220 scope[ctrlAs].$$internalmodel = {desc: "ok"}; 227 scope[ctrlAs].$$internalmodel = {desc: "ok"};
  228 +
221 } else { 229 } else {
222 scope[ctrlAs].$$internalmodel = undefined; 230 scope[ctrlAs].$$internalmodel = undefined;
223 } 231 }
src/main/resources/static/pages/scheduleApp/module/common/dts2/scheduleplan/saPlanInfoEdit2.js 0 → 100644
  1 +/**
  2 + * saPlaninfoedit2指令,排班明细编辑控件,用在调度执勤日报的修改功能
  3 + * name(必须),控件的名字
  4 + * ds,外部数据源
  5 + * fd, 表单数据源
  6 + */
  7 +angular.module('ScheduleApp').directive(
  8 + 'saPlaninfoedit2',
  9 + [
  10 + function() {
  11 + return {
  12 + restrict: 'E',
  13 + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saPlaninfoeditTemplate.html',
  14 + scope: { // 独立作用域
  15 + ds: '=ngModel', // 时刻明细数据源头
  16 + fd: '=formData' // 表单数据源(车辆、驾驶员、售票员信息)
  17 + },
  18 + controllerAs: '$saPlanInfoEditCtrl',
  19 + bindToController: true,
  20 + controller: function() {
  21 + //var self = this;
  22 +
  23 + },
  24 +
  25 + compile: function(tElem, tAttrs) {
  26 + // 获取属性
  27 + var $attr_name = tAttrs["name"]; // 控件的名字
  28 + if (!$attr_name) {
  29 + throw {msg: "saPlaninfoedit2指令name属性不能为空"};
  30 + }
  31 +
  32 + // 内部controlAs名字
  33 + var ctrlAs = '$saPlanInfoEditCtrl';
  34 +
  35 +
  36 + // 内部变量,原始车辆,人员数据
  37 + var old_cl = {}; // key:{车辆id_车辆自编号},value:所在list下标数组
  38 + var old_j = {}; // key:{驾驶员id_姓名_工号}, value:所在list下标数组
  39 + var old_s = {}; // key:{售票员id_姓名_工号}, value:所在list下标数组
  40 + var old_isfb = false; // 是否有分班
  41 + var old_isfb_index = 0; // 分班开始索引
  42 + var old_hasJCBC = false; // 是否有进场班次
  43 + var old_max_fcno = 0; // 最大发车顺序号
  44 + var old_firstJCBCFcno = 0; // 第一个进场班次发车顺序号
  45 + var old_half_bcs = 0; // 一般的班次数量
  46 +
  47 + // 内部变量,变更的车辆,变更的人员
  48 + var new_cl1 = undefined; // 新的车辆1(车辆id_车辆自编号)
  49 + var new_cl2 = undefined; // 新的车辆2(车辆id_车辆自编号)
  50 + var new_j1 = undefined; // 新的驾驶员1(驾驶员id_姓名_工号)
  51 + var new_j2 = undefined; // 新的驾驶员2(驾驶员id_姓名_工号)
  52 + var new_s1 = undefined; // 新的售票员1(售票员id_姓名_工号)
  53 + var new_s2 = undefined; // 新的售票员2(售票员id_姓名_工号)
  54 +
  55 +
  56 + // 表单值,被赋值的次数
  57 + var form_data_assign_count = {
  58 + cl1 : 1,
  59 + cl2 : 1,
  60 + j1 : 1,
  61 + j2 : 1,
  62 + j3 : 1,
  63 + s1 : 1,
  64 + s2 : 1,
  65 + s3 : 1
  66 + };
  67 +
  68 + return {
  69 + pre: function(scope, element, attr) {
  70 +
  71 + },
  72 + post: function(scope, element, attr) {
  73 +
  74 + /**
  75 + * 刷新车辆数据。
  76 + */
  77 + scope[ctrlAs].$$internal_refresh_dsdata_cl = function() {
  78 + if (new_cl1) {
  79 + var new_cl1_id = new_cl1.split("_")[0];
  80 + var new_cl1_zbh = new_cl1.split("_")[1];
  81 +
  82 + if (new_cl2) {
  83 + var new_cl2_id = new_cl2.split("_")[0];
  84 + var new_cl2_zbh = new_cl2.split("_")[1];
  85 +
  86 + if (old_isfb) { // 使用分班判定
  87 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  88 + if (index < old_isfb_index) {
  89 + obj.cl = new_cl1_id;
  90 + obj.clZbh = new_cl1_zbh;
  91 + } else {
  92 + obj.cl = new_cl2_id;
  93 + obj.clZbh = new_cl2_zbh;
  94 + }
  95 + });
  96 +
  97 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  98 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  99 + if (obj.fcno <= old_firstJCBCFcno) {
  100 + obj.cl = new_cl1_id;
  101 + obj.clZbh = new_cl1_zbh;
  102 + } else {
  103 + obj.cl = new_cl2_id;
  104 + obj.clZbh = new_cl2_zbh;
  105 + }
  106 + });
  107 + } else { // 使用一半一半班次判定
  108 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  109 + if (index < old_half_bcs) {
  110 + obj.cl = new_cl1_id;
  111 + obj.clZbh = new_cl1_zbh;
  112 + } else {
  113 + obj.cl = new_cl2_id;
  114 + obj.clZbh = new_cl2_zbh;
  115 + }
  116 + });
  117 + }
  118 +
  119 + } else {
  120 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  121 + obj.cl = new_cl1_id;
  122 + obj.clZbh = new_cl1_zbh;
  123 + });
  124 + }
  125 +
  126 + } else {
  127 + // 清空,不使用旧的
  128 + angular.forEach(old_cl, function(value, key) {
  129 + angular.forEach(value, function(i) {
  130 + //scope[ctrlAs].ds[i].cl = key.split("_")[0];
  131 + //scope[ctrlAs].ds[i].clZbh = key.split("_")[1];
  132 + scope[ctrlAs].ds[i].cl = undefined;
  133 + scope[ctrlAs].ds[i].clZbh = undefined;
  134 + });
  135 + });
  136 + }
  137 + };
  138 +
  139 + /**
  140 + * 刷新驾驶员数据。
  141 + */
  142 + scope[ctrlAs].$$internal_refresh_dsdata_j = function() {
  143 + if (new_j1) {
  144 + var new_j1_id = new_j1.split("_")[0];
  145 + var new_j1_name = new_j1.split("_")[1];
  146 + var new_j1_gh = new_j1.split("_")[2];
  147 + if (new_j1_gh && new_j1_gh.indexOf("-") > 0) {
  148 + new_j1_gh = new_j1_gh.substr(3); // 修正工号,把 55- 这种前缀去掉
  149 + }
  150 +
  151 + if (new_j2) {
  152 + var new_j2_id = new_j2.split("_")[0];
  153 + var new_j2_name = new_j2.split("_")[1];
  154 + var new_j2_gh = new_j2.split("_")[2];
  155 + if (new_j2_gh && new_j2_gh.indexOf("-") > 0) {
  156 + new_j2_gh = new_j2_gh.substr(3); // 修正工号,把 55- 这种前缀去掉
  157 + }
  158 +
  159 + if (old_isfb) { // 使用分班判定
  160 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  161 + if (index < old_isfb_index) {
  162 + obj.j = new_j1_id;
  163 + obj.jGh = new_j1_gh;
  164 + obj.jName = new_j1_name;
  165 + } else {
  166 + obj.j = new_j2_id;
  167 + obj.jGh = new_j2_gh;
  168 + obj.jName = new_j2_name;
  169 + }
  170 + });
  171 +
  172 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  173 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  174 + if (obj.fcno <= old_firstJCBCFcno) {
  175 + obj.j = new_j1_id;
  176 + obj.jGh = new_j1_gh;
  177 + obj.jName = new_j1_name;
  178 + } else {
  179 + obj.j = new_j2_id;
  180 + obj.jGh = new_j2_gh;
  181 + obj.jName = new_j2_name;
  182 + }
  183 + });
  184 + } else { // 使用一半一半班次判定
  185 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  186 + if (index < old_half_bcs) {
  187 + obj.j = new_j1_id;
  188 + obj.jGh = new_j1_gh;
  189 + obj.jName = new_j1_name;
  190 + } else {
  191 + obj.j = new_j2_id;
  192 + obj.jGh = new_j2_gh;
  193 + obj.jName = new_j2_name;
  194 + }
  195 + });
  196 + }
  197 +
  198 + } else {
  199 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  200 + obj.j = new_j1_id;
  201 + obj.jGh = new_j1_gh;
  202 + obj.jName = new_j1_name;
  203 + });
  204 + }
  205 +
  206 + } else {
  207 + // 清空,不使用使用旧的
  208 + angular.forEach(old_j, function(value, key) {
  209 + angular.forEach(value, function(i) {
  210 + //scope[ctrlAs].ds[i].j = key.split("_")[0];
  211 + //scope[ctrlAs].ds[i].jName = key.split("_")[1];
  212 + //scope[ctrlAs].ds[i].jGh = key.split("_")[2];
  213 + scope[ctrlAs].ds[i].j = undefined;
  214 + scope[ctrlAs].ds[i].jName = undefined;
  215 + scope[ctrlAs].ds[i].jGh = undefined;
  216 + });
  217 + });
  218 + }
  219 + };
  220 +
  221 + /**
  222 + * 刷新售票员数据(和驾驶员配对的,有驾驶员,才有售票员)。
  223 + */
  224 + scope[ctrlAs].$$internal_refresh_dsdata_s = function() {
  225 + var j_id = undefined;
  226 + var s_id = undefined;
  227 + var s_gh = undefined;
  228 + var s_name = undefined;
  229 +
  230 + if (new_j1) {
  231 + j_id = new_j1.split("_")[0];
  232 + if (new_s1) {
  233 + s_id = new_s1.split("_")[0];
  234 + s_name = new_s1.split("_")[1];
  235 + s_gh = new_s1.split("_")[2];
  236 + if (s_gh && s_gh.indexOf("-") > 0) { // 修正工号,把 55- 这种前缀去掉
  237 + s_gh = s_gh.substr(3);
  238 + }
  239 + } else {
  240 + s_id = undefined;
  241 + s_gh = undefined;
  242 + s_name = undefined
  243 + }
  244 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  245 + if (obj.j == j_id) {
  246 + obj.s = s_id;
  247 + obj.sGh = s_gh;
  248 + obj.sName = s_name;
  249 + }
  250 + });
  251 + }
  252 + if (new_j2) {
  253 + j_id = new_j2.split("_")[0];
  254 + if (new_s2) {
  255 + s_id = new_s2.split("_")[0];
  256 + s_name = new_s2.split("_")[1];
  257 + s_gh = new_s2.split("_")[2];
  258 + if (s_gh && s_gh.indexOf("-") > 0) { // 修正工号,把 55- 这种前缀去掉
  259 + s_gh = s_gh.substr(3);
  260 + }
  261 + } else {
  262 + s_id = undefined;
  263 + s_gh = undefined;
  264 + s_name = undefined
  265 + }
  266 +
  267 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  268 + if (obj.j == j_id) {
  269 + obj.s = s_id;
  270 + obj.sGh = s_gh;
  271 + obj.sName = s_name;
  272 + }
  273 + });
  274 + }
  275 + };
  276 +
  277 +
  278 + //-------------- 监控表单车辆1的变化 ----------------//
  279 + scope.$watch(
  280 + function() {
  281 + return scope[ctrlAs].fd.cl1;
  282 + },
  283 + function(newValue, oldValue) {
  284 + // 初始化new_cl1
  285 + if (newValue.id) {
  286 + if (newValue.id && newValue.zbh) {
  287 + new_cl1 = newValue.id + "_" + newValue.zbh;
  288 + } else {
  289 + new_cl1 = undefined;
  290 + }
  291 + } else {
  292 + new_cl1 = undefined;
  293 + }
  294 +
  295 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
  296 + },
  297 + true
  298 + );
  299 +
  300 + //-------------- 监控表单车辆2的变化 ----------------//
  301 + scope.$watch(
  302 + function() {
  303 + return scope[ctrlAs].fd.cl2;
  304 + },
  305 + function(newValue, oldValue) {
  306 + // 初始化new_cl2
  307 + if (newValue.id) {
  308 + if (newValue.id && newValue.zbh) {
  309 + new_cl2 = newValue.id + "_" + newValue.zbh;
  310 + } else {
  311 + new_cl2 = undefined;
  312 + }
  313 + } else {
  314 + new_cl2 = undefined;
  315 + }
  316 +
  317 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
  318 + },
  319 + true
  320 + );
  321 +
  322 + //-------------- 监控表单驾驶员1的变化 ----------------//
  323 + scope.$watch(
  324 + function() {
  325 + return scope[ctrlAs].fd.j1;
  326 + },
  327 + function(newValue, oldValue) {
  328 + // 初始化j1
  329 + if (newValue.id) {
  330 + if (newValue.id && newValue.name && newValue.jobCode) {
  331 + new_j1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  332 + } else {
  333 + new_j1 = undefined;
  334 + }
  335 + } else {
  336 + new_j1 = undefined;
  337 + }
  338 +
  339 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  340 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  341 + },
  342 + true
  343 + );
  344 +
  345 + //-------------- 监控表单售票员1的变化 ----------------//
  346 + scope.$watch(
  347 + function() {
  348 + return scope[ctrlAs].fd.s1;
  349 + },
  350 + function(newValue, oldValue) {
  351 + // 初始化s1
  352 + if (newValue.id) {
  353 + if (newValue.id && newValue.name && newValue.jobCode) {
  354 + new_s1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  355 + } else {
  356 + new_s1 = undefined;
  357 + }
  358 + } else {
  359 + new_s1 = undefined;
  360 + }
  361 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  362 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  363 + },
  364 + true
  365 + );
  366 +
  367 + //-------------- 监控表单驾驶员2的变化 ----------------//
  368 + scope.$watch(
  369 + function() {
  370 + return scope[ctrlAs].fd.j2;
  371 + },
  372 + function(newValue, oldValue) {
  373 + // 初始化j2
  374 + if (newValue.id) {
  375 + if (newValue.id && newValue.name && newValue.jobCode) {
  376 + new_j2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  377 + } else {
  378 + new_j2 = undefined;
  379 + }
  380 + } else {
  381 + new_j2 = undefined;
  382 + }
  383 +
  384 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  385 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  386 + },
  387 + true
  388 + );
  389 +
  390 + //-------------- 监控表单售票员2的变化 ----------------//
  391 + scope.$watch(
  392 + function() {
  393 + return scope[ctrlAs].fd.s2;
  394 + },
  395 + function(newValue, oldValue) {
  396 + // 初始化s2
  397 + if (newValue && newValue.id) {
  398 + if (newValue.id && newValue.name && newValue.jobCode) {
  399 + new_s2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  400 + } else {
  401 + new_s2 = undefined;
  402 + }
  403 + } else {
  404 + new_s2 = undefined;
  405 + }
  406 +
  407 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  408 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  409 + },
  410 + true
  411 + );
  412 +
  413 + //-------------------- 监控ds的变化,更新数据源,初始化formdata的数据 ---------------//
  414 + scope.$watch(
  415 + function() {
  416 + return scope[ctrlAs].ds;
  417 + },
  418 + function(newValue, oldValue) {
  419 + if (newValue && newValue.length > 0) {
  420 + var j1 = newValue[0].j;
  421 +
  422 + var cl_ids = []; // 车辆ids数组(有顺序)
  423 + var j_s_ids = []; // 驾驶员ids,售票员ids,[{j:id,s:id},...](有顺序)
  424 + var isRepeat = false;
  425 + var i = 0;
  426 +
  427 + angular.forEach(newValue, function(obj, index) {
  428 + var k1 = obj.cl + "_" + obj.clZbh;
  429 + var k2 = !obj.j? undefined: obj.j + "_" + obj.jName + "_" + obj.jGh;
  430 + var k3 = !obj.s? undefined: obj.s + "_" + obj.sName + "_" + obj.sGh;
  431 +
  432 + if (!old_cl[k1]) {
  433 + old_cl[k1] = [];
  434 + }
  435 + if (!old_j[k2] && k2) {
  436 + old_j[k2] = [];
  437 + }
  438 + if (!old_s[k3] && k3) {
  439 + old_s[k3] = [];
  440 + }
  441 +
  442 + // 闭包
  443 + (function(i) {
  444 + old_cl[k1].push(i);
  445 + if (k2) {
  446 + old_j[k2].push(i);
  447 + }
  448 + if (k3) {
  449 + old_s[k3].push(i);
  450 + }
  451 + })(index);
  452 +
  453 + // 判断是否分班
  454 + if (j1 != obj.j && !old_isfb) {
  455 + old_isfb = true;
  456 + old_isfb_index = index;
  457 + }
  458 +
  459 + // 判断进出场
  460 + if (obj.bcType == 'in' && !old_hasJCBC) {
  461 + old_hasJCBC = true;
  462 + old_firstJCBCFcno = obj.fcno;
  463 + }
  464 +
  465 + //-------------- formdata用数据处理 -------------//
  466 + // 车辆处理
  467 + isRepeat = false;
  468 + if (obj.cl) {
  469 + for (i = 0; i < cl_ids.length; i++) {
  470 + if (cl_ids[i] == obj.cl) {
  471 + isRepeat = true;
  472 + break;
  473 + }
  474 + }
  475 + if (!isRepeat) {
  476 + cl_ids.push(obj.cl);
  477 + }
  478 + }
  479 +
  480 + // 人员处理(以驾驶员id为主,没有的话,售票员不管了)
  481 + isRepeat = false;
  482 + if (obj.j) {
  483 + for (i = 0; i < j_s_ids.length; i++) {
  484 + if (j_s_ids[i].j == obj.j) {
  485 + isRepeat = true;
  486 + break;
  487 + }
  488 + }
  489 + if (!isRepeat) {
  490 + j_s_ids.push({
  491 + j: obj.j,
  492 + s: !obj.s? undefined: obj.s
  493 + });
  494 + }
  495 + }
  496 + });
  497 +
  498 + old_max_fcno = newValue[newValue.length - 1].fcno;
  499 + old_half_bcs = newValue.length / 2;
  500 +
  501 + // 更新formdata
  502 + for (i = 0; i < cl_ids.length; i++) { // 车辆更新前两辆
  503 + if (i >= 2) {
  504 + break;
  505 + } else {
  506 + form_data_assign_count["cl" + (i + 1)] = 0;
  507 + scope[ctrlAs].fd["cl" + (i + 1)].id = cl_ids[i];
  508 + }
  509 + }
  510 + for (i = 0; i < j_s_ids.length; i++) { // 人员更新
  511 + if (i >= 3) {
  512 + break;
  513 + } else {
  514 + form_data_assign_count["j" + (i + 1)] = 0;
  515 + scope[ctrlAs].fd["j" + (i + 1)].id = j_s_ids[i].j;
  516 +
  517 + form_data_assign_count["s" + (i + 1)] = 0;
  518 + scope[ctrlAs].fd["s" + (i + 1)].id = j_s_ids[i].s;
  519 + }
  520 + }
  521 + }
  522 + }
  523 + );
  524 + }
  525 + }
  526 + }
  527 + };
  528 + }
  529 + ]
  530 +);
0 \ No newline at end of file 531 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
@@ -1500,6 +1500,10 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -1500,6 +1500,10 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1500 * 验证内部数据,更新外部model 1500 * 验证内部数据,更新外部model
1501 */ 1501 */
1502 scope[ctrlAs].$$internal_validate_model = function() { 1502 scope[ctrlAs].$$internal_validate_model = function() {
  1503 + // TODO:
  1504 + //console.log(scope[ctrlAs].$$internal_select_value);
  1505 + //console.log(scope[ctrlAs].$$data_real);
  1506 +
1503 if (scope[ctrlAs].$$internal_select_value) { 1507 if (scope[ctrlAs].$$internal_select_value) {
1504 var select_value_temp = scope[ctrlAs].$$internal_select_value; 1508 var select_value_temp = scope[ctrlAs].$$internal_select_value;
1505 if (scope[ctrlAs].$$data_real && scope[ctrlAs].$$data_real.length > 0) { 1509 if (scope[ctrlAs].$$data_real && scope[ctrlAs].$$data_real.length > 0) {
@@ -1511,6 +1515,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -1511,6 +1515,9 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1511 } 1515 }
1512 } 1516 }
1513 if (obj) { // 在data中判定有没有 1517 if (obj) { // 在data中判定有没有
  1518 + // 初始化的时候,模拟选中uiselect
  1519 + scope[ctrlAs].$$internal_select_fn(obj);
  1520 +
1514 for (var k = 0; k < scope[ctrlAs].$$data.length; k++) { 1521 for (var k = 0; k < scope[ctrlAs].$$data.length; k++) {
1515 if (eval("scope[ctrlAs].$$data[k]" + "." + $icname_attr + " == obj." + $icname_attr)) { 1522 if (eval("scope[ctrlAs].$$data[k]" + "." + $icname_attr + " == obj." + $icname_attr)) {
1516 obj = undefined; 1523 obj = undefined;
@@ -1523,6 +1530,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [ @@ -1523,6 +1530,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(&#39;saSelect5&#39;, [
1523 // 更新内部model,用于外部验证 1530 // 更新内部model,用于外部验证
1524 // 内部model的值暂时随意,以后再改 1531 // 内部model的值暂时随意,以后再改
1525 scope[ctrlAs].$$internalmodel = {desc: "ok"}; 1532 scope[ctrlAs].$$internalmodel = {desc: "ok"};
  1533 +
1526 } else { 1534 } else {
1527 scope[ctrlAs].$$internalmodel = undefined; 1535 scope[ctrlAs].$$internalmodel = undefined;
1528 } 1536 }
@@ -4763,4 +4771,534 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -4763,4 +4771,534 @@ angular.module(&#39;ScheduleApp&#39;).directive(
4763 }; 4771 };
4764 } 4772 }
4765 ] 4773 ]
  4774 +);
  4775 +/**
  4776 + * saPlaninfoedit2指令,排班明细编辑控件,用在调度执勤日报的修改功能
  4777 + * name(必须),控件的名字
  4778 + * ds,外部数据源
  4779 + * fd, 表单数据源
  4780 + */
  4781 +angular.module('ScheduleApp').directive(
  4782 + 'saPlaninfoedit2',
  4783 + [
  4784 + function() {
  4785 + return {
  4786 + restrict: 'E',
  4787 + templateUrl: '/pages/scheduleApp/module/common/dts2/scheduleplan/saPlaninfoeditTemplate.html',
  4788 + scope: { // 独立作用域
  4789 + ds: '=ngModel', // 时刻明细数据源头
  4790 + fd: '=formData' // 表单数据源(车辆、驾驶员、售票员信息)
  4791 + },
  4792 + controllerAs: '$saPlanInfoEditCtrl',
  4793 + bindToController: true,
  4794 + controller: function() {
  4795 + //var self = this;
  4796 +
  4797 + },
  4798 +
  4799 + compile: function(tElem, tAttrs) {
  4800 + // 获取属性
  4801 + var $attr_name = tAttrs["name"]; // 控件的名字
  4802 + if (!$attr_name) {
  4803 + throw {msg: "saPlaninfoedit2指令name属性不能为空"};
  4804 + }
  4805 +
  4806 + // 内部controlAs名字
  4807 + var ctrlAs = '$saPlanInfoEditCtrl';
  4808 +
  4809 +
  4810 + // 内部变量,原始车辆,人员数据
  4811 + var old_cl = {}; // key:{车辆id_车辆自编号},value:所在list下标数组
  4812 + var old_j = {}; // key:{驾驶员id_姓名_工号}, value:所在list下标数组
  4813 + var old_s = {}; // key:{售票员id_姓名_工号}, value:所在list下标数组
  4814 + var old_isfb = false; // 是否有分班
  4815 + var old_isfb_index = 0; // 分班开始索引
  4816 + var old_hasJCBC = false; // 是否有进场班次
  4817 + var old_max_fcno = 0; // 最大发车顺序号
  4818 + var old_firstJCBCFcno = 0; // 第一个进场班次发车顺序号
  4819 + var old_half_bcs = 0; // 一般的班次数量
  4820 +
  4821 + // 内部变量,变更的车辆,变更的人员
  4822 + var new_cl1 = undefined; // 新的车辆1(车辆id_车辆自编号)
  4823 + var new_cl2 = undefined; // 新的车辆2(车辆id_车辆自编号)
  4824 + var new_j1 = undefined; // 新的驾驶员1(驾驶员id_姓名_工号)
  4825 + var new_j2 = undefined; // 新的驾驶员2(驾驶员id_姓名_工号)
  4826 + var new_s1 = undefined; // 新的售票员1(售票员id_姓名_工号)
  4827 + var new_s2 = undefined; // 新的售票员2(售票员id_姓名_工号)
  4828 +
  4829 +
  4830 + // 表单值,被赋值的次数
  4831 + var form_data_assign_count = {
  4832 + cl1 : 1,
  4833 + cl2 : 1,
  4834 + j1 : 1,
  4835 + j2 : 1,
  4836 + j3 : 1,
  4837 + s1 : 1,
  4838 + s2 : 1,
  4839 + s3 : 1
  4840 + };
  4841 +
  4842 + return {
  4843 + pre: function(scope, element, attr) {
  4844 +
  4845 + },
  4846 + post: function(scope, element, attr) {
  4847 +
  4848 + /**
  4849 + * 刷新车辆数据。
  4850 + */
  4851 + scope[ctrlAs].$$internal_refresh_dsdata_cl = function() {
  4852 + if (new_cl1) {
  4853 + var new_cl1_id = new_cl1.split("_")[0];
  4854 + var new_cl1_zbh = new_cl1.split("_")[1];
  4855 +
  4856 + if (new_cl2) {
  4857 + var new_cl2_id = new_cl2.split("_")[0];
  4858 + var new_cl2_zbh = new_cl2.split("_")[1];
  4859 +
  4860 + if (old_isfb) { // 使用分班判定
  4861 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4862 + if (index < old_isfb_index) {
  4863 + obj.cl = new_cl1_id;
  4864 + obj.clZbh = new_cl1_zbh;
  4865 + } else {
  4866 + obj.cl = new_cl2_id;
  4867 + obj.clZbh = new_cl2_zbh;
  4868 + }
  4869 + });
  4870 +
  4871 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  4872 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  4873 + if (obj.fcno <= old_firstJCBCFcno) {
  4874 + obj.cl = new_cl1_id;
  4875 + obj.clZbh = new_cl1_zbh;
  4876 + } else {
  4877 + obj.cl = new_cl2_id;
  4878 + obj.clZbh = new_cl2_zbh;
  4879 + }
  4880 + });
  4881 + } else { // 使用一半一半班次判定
  4882 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4883 + if (index < old_half_bcs) {
  4884 + obj.cl = new_cl1_id;
  4885 + obj.clZbh = new_cl1_zbh;
  4886 + } else {
  4887 + obj.cl = new_cl2_id;
  4888 + obj.clZbh = new_cl2_zbh;
  4889 + }
  4890 + });
  4891 + }
  4892 +
  4893 + } else {
  4894 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4895 + obj.cl = new_cl1_id;
  4896 + obj.clZbh = new_cl1_zbh;
  4897 + });
  4898 + }
  4899 +
  4900 + } else {
  4901 + // 清空,不使用旧的
  4902 + angular.forEach(old_cl, function(value, key) {
  4903 + angular.forEach(value, function(i) {
  4904 + //scope[ctrlAs].ds[i].cl = key.split("_")[0];
  4905 + //scope[ctrlAs].ds[i].clZbh = key.split("_")[1];
  4906 + scope[ctrlAs].ds[i].cl = undefined;
  4907 + scope[ctrlAs].ds[i].clZbh = undefined;
  4908 + });
  4909 + });
  4910 + }
  4911 + };
  4912 +
  4913 + /**
  4914 + * 刷新驾驶员数据。
  4915 + */
  4916 + scope[ctrlAs].$$internal_refresh_dsdata_j = function() {
  4917 + if (new_j1) {
  4918 + var new_j1_id = new_j1.split("_")[0];
  4919 + var new_j1_name = new_j1.split("_")[1];
  4920 + var new_j1_gh = new_j1.split("_")[2];
  4921 + if (new_j1_gh && new_j1_gh.indexOf("-") > 0) {
  4922 + new_j1_gh = new_j1_gh.substr(3); // 修正工号,把 55- 这种前缀去掉
  4923 + }
  4924 +
  4925 + if (new_j2) {
  4926 + var new_j2_id = new_j2.split("_")[0];
  4927 + var new_j2_name = new_j2.split("_")[1];
  4928 + var new_j2_gh = new_j2.split("_")[2];
  4929 + if (new_j2_gh && new_j2_gh.indexOf("-") > 0) {
  4930 + new_j2_gh = new_j2_gh.substr(3); // 修正工号,把 55- 这种前缀去掉
  4931 + }
  4932 +
  4933 + if (old_isfb) { // 使用分班判定
  4934 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4935 + if (index < old_isfb_index) {
  4936 + obj.j = new_j1_id;
  4937 + obj.jGh = new_j1_gh;
  4938 + obj.jName = new_j1_name;
  4939 + } else {
  4940 + obj.j = new_j2_id;
  4941 + obj.jGh = new_j2_gh;
  4942 + obj.jName = new_j2_name;
  4943 + }
  4944 + });
  4945 +
  4946 + } else if (old_hasJCBC && old_firstJCBCFcno < old_max_fcno) { // 使用进出场判定
  4947 + angular.forEach(scope[ctrlAs].ds, function(obj) {
  4948 + if (obj.fcno <= old_firstJCBCFcno) {
  4949 + obj.j = new_j1_id;
  4950 + obj.jGh = new_j1_gh;
  4951 + obj.jName = new_j1_name;
  4952 + } else {
  4953 + obj.j = new_j2_id;
  4954 + obj.jGh = new_j2_gh;
  4955 + obj.jName = new_j2_name;
  4956 + }
  4957 + });
  4958 + } else { // 使用一半一半班次判定
  4959 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4960 + if (index < old_half_bcs) {
  4961 + obj.j = new_j1_id;
  4962 + obj.jGh = new_j1_gh;
  4963 + obj.jName = new_j1_name;
  4964 + } else {
  4965 + obj.j = new_j2_id;
  4966 + obj.jGh = new_j2_gh;
  4967 + obj.jName = new_j2_name;
  4968 + }
  4969 + });
  4970 + }
  4971 +
  4972 + } else {
  4973 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  4974 + obj.j = new_j1_id;
  4975 + obj.jGh = new_j1_gh;
  4976 + obj.jName = new_j1_name;
  4977 + });
  4978 + }
  4979 +
  4980 + } else {
  4981 + // 清空,不使用使用旧的
  4982 + angular.forEach(old_j, function(value, key) {
  4983 + angular.forEach(value, function(i) {
  4984 + //scope[ctrlAs].ds[i].j = key.split("_")[0];
  4985 + //scope[ctrlAs].ds[i].jName = key.split("_")[1];
  4986 + //scope[ctrlAs].ds[i].jGh = key.split("_")[2];
  4987 + scope[ctrlAs].ds[i].j = undefined;
  4988 + scope[ctrlAs].ds[i].jName = undefined;
  4989 + scope[ctrlAs].ds[i].jGh = undefined;
  4990 + });
  4991 + });
  4992 + }
  4993 + };
  4994 +
  4995 + /**
  4996 + * 刷新售票员数据(和驾驶员配对的,有驾驶员,才有售票员)。
  4997 + */
  4998 + scope[ctrlAs].$$internal_refresh_dsdata_s = function() {
  4999 + var j_id = undefined;
  5000 + var s_id = undefined;
  5001 + var s_gh = undefined;
  5002 + var s_name = undefined;
  5003 +
  5004 + if (new_j1) {
  5005 + j_id = new_j1.split("_")[0];
  5006 + if (new_s1) {
  5007 + s_id = new_s1.split("_")[0];
  5008 + s_name = new_s1.split("_")[1];
  5009 + s_gh = new_s1.split("_")[2];
  5010 + if (s_gh && s_gh.indexOf("-") > 0) { // 修正工号,把 55- 这种前缀去掉
  5011 + s_gh = s_gh.substr(3);
  5012 + }
  5013 + } else {
  5014 + s_id = undefined;
  5015 + s_gh = undefined;
  5016 + s_name = undefined
  5017 + }
  5018 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  5019 + if (obj.j == j_id) {
  5020 + obj.s = s_id;
  5021 + obj.sGh = s_gh;
  5022 + obj.sName = s_name;
  5023 + }
  5024 + });
  5025 + }
  5026 + if (new_j2) {
  5027 + j_id = new_j2.split("_")[0];
  5028 + if (new_s2) {
  5029 + s_id = new_s2.split("_")[0];
  5030 + s_name = new_s2.split("_")[1];
  5031 + s_gh = new_s2.split("_")[2];
  5032 + if (s_gh && s_gh.indexOf("-") > 0) { // 修正工号,把 55- 这种前缀去掉
  5033 + s_gh = s_gh.substr(3);
  5034 + }
  5035 + } else {
  5036 + s_id = undefined;
  5037 + s_gh = undefined;
  5038 + s_name = undefined
  5039 + }
  5040 +
  5041 + angular.forEach(scope[ctrlAs].ds, function(obj, index) {
  5042 + if (obj.j == j_id) {
  5043 + obj.s = s_id;
  5044 + obj.sGh = s_gh;
  5045 + obj.sName = s_name;
  5046 + }
  5047 + });
  5048 + }
  5049 + };
  5050 +
  5051 +
  5052 + //-------------- 监控表单车辆1的变化 ----------------//
  5053 + scope.$watch(
  5054 + function() {
  5055 + return scope[ctrlAs].fd.cl1;
  5056 + },
  5057 + function(newValue, oldValue) {
  5058 + // 初始化new_cl1
  5059 + if (newValue.id) {
  5060 + if (newValue.id && newValue.zbh) {
  5061 + new_cl1 = newValue.id + "_" + newValue.zbh;
  5062 + } else {
  5063 + new_cl1 = undefined;
  5064 + }
  5065 + } else {
  5066 + new_cl1 = undefined;
  5067 + }
  5068 +
  5069 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
  5070 + },
  5071 + true
  5072 + );
  5073 +
  5074 + //-------------- 监控表单车辆2的变化 ----------------//
  5075 + scope.$watch(
  5076 + function() {
  5077 + return scope[ctrlAs].fd.cl2;
  5078 + },
  5079 + function(newValue, oldValue) {
  5080 + // 初始化new_cl2
  5081 + if (newValue.id) {
  5082 + if (newValue.id && newValue.zbh) {
  5083 + new_cl2 = newValue.id + "_" + newValue.zbh;
  5084 + } else {
  5085 + new_cl2 = undefined;
  5086 + }
  5087 + } else {
  5088 + new_cl2 = undefined;
  5089 + }
  5090 +
  5091 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
  5092 + },
  5093 + true
  5094 + );
  5095 +
  5096 + //-------------- 监控表单驾驶员1的变化 ----------------//
  5097 + scope.$watch(
  5098 + function() {
  5099 + return scope[ctrlAs].fd.j1;
  5100 + },
  5101 + function(newValue, oldValue) {
  5102 + // 初始化j1
  5103 + if (newValue.id) {
  5104 + if (newValue.id && newValue.name && newValue.jobCode) {
  5105 + new_j1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5106 + } else {
  5107 + new_j1 = undefined;
  5108 + }
  5109 + } else {
  5110 + new_j1 = undefined;
  5111 + }
  5112 +
  5113 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  5114 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  5115 + },
  5116 + true
  5117 + );
  5118 +
  5119 + //-------------- 监控表单售票员1的变化 ----------------//
  5120 + scope.$watch(
  5121 + function() {
  5122 + return scope[ctrlAs].fd.s1;
  5123 + },
  5124 + function(newValue, oldValue) {
  5125 + // 初始化s1
  5126 + if (newValue.id) {
  5127 + if (newValue.id && newValue.name && newValue.jobCode) {
  5128 + new_s1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5129 + } else {
  5130 + new_s1 = undefined;
  5131 + }
  5132 + } else {
  5133 + new_s1 = undefined;
  5134 + }
  5135 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  5136 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  5137 + },
  5138 + true
  5139 + );
  5140 +
  5141 + //-------------- 监控表单驾驶员2的变化 ----------------//
  5142 + scope.$watch(
  5143 + function() {
  5144 + return scope[ctrlAs].fd.j2;
  5145 + },
  5146 + function(newValue, oldValue) {
  5147 + // 初始化j2
  5148 + if (newValue.id) {
  5149 + if (newValue.id && newValue.name && newValue.jobCode) {
  5150 + new_j2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5151 + } else {
  5152 + new_j2 = undefined;
  5153 + }
  5154 + } else {
  5155 + new_j2 = undefined;
  5156 + }
  5157 +
  5158 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  5159 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  5160 + },
  5161 + true
  5162 + );
  5163 +
  5164 + //-------------- 监控表单售票员2的变化 ----------------//
  5165 + scope.$watch(
  5166 + function() {
  5167 + return scope[ctrlAs].fd.s2;
  5168 + },
  5169 + function(newValue, oldValue) {
  5170 + // 初始化s2
  5171 + if (newValue && newValue.id) {
  5172 + if (newValue.id && newValue.name && newValue.jobCode) {
  5173 + new_s2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5174 + } else {
  5175 + new_s2 = undefined;
  5176 + }
  5177 + } else {
  5178 + new_s2 = undefined;
  5179 + }
  5180 +
  5181 + scope[ctrlAs].$$internal_refresh_dsdata_j();
  5182 + scope[ctrlAs].$$internal_refresh_dsdata_s();
  5183 + },
  5184 + true
  5185 + );
  5186 +
  5187 + //-------------------- 监控ds的变化,更新数据源,初始化formdata的数据 ---------------//
  5188 + scope.$watch(
  5189 + function() {
  5190 + return scope[ctrlAs].ds;
  5191 + },
  5192 + function(newValue, oldValue) {
  5193 + if (newValue && newValue.length > 0) {
  5194 + var j1 = newValue[0].j;
  5195 +
  5196 + var cl_ids = []; // 车辆ids数组(有顺序)
  5197 + var j_s_ids = []; // 驾驶员ids,售票员ids,[{j:id,s:id},...](有顺序)
  5198 + var isRepeat = false;
  5199 + var i = 0;
  5200 +
  5201 + angular.forEach(newValue, function(obj, index) {
  5202 + var k1 = obj.cl + "_" + obj.clZbh;
  5203 + var k2 = !obj.j? undefined: obj.j + "_" + obj.jName + "_" + obj.jGh;
  5204 + var k3 = !obj.s? undefined: obj.s + "_" + obj.sName + "_" + obj.sGh;
  5205 +
  5206 + if (!old_cl[k1]) {
  5207 + old_cl[k1] = [];
  5208 + }
  5209 + if (!old_j[k2] && k2) {
  5210 + old_j[k2] = [];
  5211 + }
  5212 + if (!old_s[k3] && k3) {
  5213 + old_s[k3] = [];
  5214 + }
  5215 +
  5216 + // 闭包
  5217 + (function(i) {
  5218 + old_cl[k1].push(i);
  5219 + if (k2) {
  5220 + old_j[k2].push(i);
  5221 + }
  5222 + if (k3) {
  5223 + old_s[k3].push(i);
  5224 + }
  5225 + })(index);
  5226 +
  5227 + // 判断是否分班
  5228 + if (j1 != obj.j && !old_isfb) {
  5229 + old_isfb = true;
  5230 + old_isfb_index = index;
  5231 + }
  5232 +
  5233 + // 判断进出场
  5234 + if (obj.bcType == 'in' && !old_hasJCBC) {
  5235 + old_hasJCBC = true;
  5236 + old_firstJCBCFcno = obj.fcno;
  5237 + }
  5238 +
  5239 + //-------------- formdata用数据处理 -------------//
  5240 + // 车辆处理
  5241 + isRepeat = false;
  5242 + if (obj.cl) {
  5243 + for (i = 0; i < cl_ids.length; i++) {
  5244 + if (cl_ids[i] == obj.cl) {
  5245 + isRepeat = true;
  5246 + break;
  5247 + }
  5248 + }
  5249 + if (!isRepeat) {
  5250 + cl_ids.push(obj.cl);
  5251 + }
  5252 + }
  5253 +
  5254 + // 人员处理(以驾驶员id为主,没有的话,售票员不管了)
  5255 + isRepeat = false;
  5256 + if (obj.j) {
  5257 + for (i = 0; i < j_s_ids.length; i++) {
  5258 + if (j_s_ids[i].j == obj.j) {
  5259 + isRepeat = true;
  5260 + break;
  5261 + }
  5262 + }
  5263 + if (!isRepeat) {
  5264 + j_s_ids.push({
  5265 + j: obj.j,
  5266 + s: !obj.s? undefined: obj.s
  5267 + });
  5268 + }
  5269 + }
  5270 + });
  5271 +
  5272 + old_max_fcno = newValue[newValue.length - 1].fcno;
  5273 + old_half_bcs = newValue.length / 2;
  5274 +
  5275 + // 更新formdata
  5276 + for (i = 0; i < cl_ids.length; i++) { // 车辆更新前两辆
  5277 + if (i >= 2) {
  5278 + break;
  5279 + } else {
  5280 + form_data_assign_count["cl" + (i + 1)] = 0;
  5281 + scope[ctrlAs].fd["cl" + (i + 1)].id = cl_ids[i];
  5282 + }
  5283 + }
  5284 + for (i = 0; i < j_s_ids.length; i++) { // 人员更新
  5285 + if (i >= 3) {
  5286 + break;
  5287 + } else {
  5288 + form_data_assign_count["j" + (i + 1)] = 0;
  5289 + scope[ctrlAs].fd["j" + (i + 1)].id = j_s_ids[i].j;
  5290 +
  5291 + form_data_assign_count["s" + (i + 1)] = 0;
  5292 + scope[ctrlAs].fd["s" + (i + 1)].id = j_s_ids[i].s;
  5293 + }
  5294 + }
  5295 + }
  5296 + }
  5297 + );
  5298 + }
  5299 + }
  5300 + }
  5301 + };
  5302 + }
  5303 + ]
4766 ); 5304 );
4767 \ No newline at end of file 5305 \ No newline at end of file
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
@@ -520,7 +520,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso @@ -520,7 +520,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
520 return { 520 return {
521 rest : $resource( 521 rest : $resource(
522 '/spic/:id', 522 '/spic/:id',
523 - {order: 'xl,scheduleDate,lp,xlDir,fcno', direction: 'ASC,ASC,ASC,ASC,ASC', id: '@id'}, 523 + {order: 'xl,scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC,ASC', id: '@id'},
524 { 524 {
525 list: { 525 list: {
526 method: 'GET', 526 method: 'GET',
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/info/list_info.html
@@ -12,8 +12,8 @@ @@ -12,8 +12,8 @@
12 <th style="width: 120px;">驾驶员(工号)</th> 12 <th style="width: 120px;">驾驶员(工号)</th>
13 <!--<th style="width: 120px;">售票员(工号)</th>--> 13 <!--<th style="width: 120px;">售票员(工号)</th>-->
14 <th style="width: 80px;">班次类型</th> 14 <th style="width: 80px;">班次类型</th>
15 - <th style="width: 80px;">上下行</th>  
16 <th style="width: 80px;">发车时间</th> 15 <th style="width: 80px;">发车时间</th>
  16 + <th style="width: 80px;">上下行</th>
17 <th style="width: 80px;">起点站</th> 17 <th style="width: 80px;">起点站</th>
18 <th style="width: 80px;">终点站</th> 18 <th style="width: 80px;">终点站</th>
19 <th style="width: 60px">备注</th> 19 <th style="width: 60px">备注</th>
@@ -84,6 +84,12 @@ @@ -84,6 +84,12 @@
84 <span ng-bind="info.bcType | dict:'ScheduleType':'未知' "></span> 84 <span ng-bind="info.bcType | dict:'ScheduleType':'未知' "></span>
85 </td> 85 </td>
86 <td> 86 <td>
  87 + <a href="#">
  88 + <i class="fa fa-clock-o" aria-hidden="true"></i>
  89 + <span ng-bind="info.fcsj"></span>
  90 + </a>
  91 + </td>
  92 + <td>
87 <a href="#" ng-if="info.xlDir == '0'"> 93 <a href="#" ng-if="info.xlDir == '0'">
88 <i class="fa fa-arrow-up" aria-hidden="true"></i> 94 <i class="fa fa-arrow-up" aria-hidden="true"></i>
89 <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span> 95 <span ng-bind="info.xlDir | dict:'LineTrend2':'未知' "></span>
@@ -94,12 +100,6 @@ @@ -94,12 +100,6 @@
94 </a> 100 </a>
95 </td> 101 </td>
96 <td> 102 <td>
97 - <a href="#">  
98 - <i class="fa fa-clock-o" aria-hidden="true"></i>  
99 - <span ng-bind="info.fcsj"></span>  
100 - </a>  
101 - </td>  
102 - <td>  
103 <a href="#" 103 <a href="#"
104 tooltip-animation="false" 104 tooltip-animation="false"
105 tooltip-placement="top" 105 tooltip-placement="top"
@@ -136,10 +136,23 @@ @@ -136,10 +136,23 @@
136 </a> 136 </a>
137 </td> 137 </td>
138 <td> 138 <td>
139 - <span ng-bind="info.updateBy.userName"></span> 139 + <a href="#"
  140 + tooltip-animation="false"
  141 + tooltip-placement="top"
  142 + uib-tooltip="{{info.updateBy.userName}}"
  143 + tooltip-class="headClass">
  144 + <i class="fa fa-user"></i>
  145 + <span ng-bind="info.updateBy.userName"></span>
  146 + </a>
140 </td> 147 </td>
141 <td> 148 <td>
142 - <span ng-bind="info.updateDate | date: 'yyyy-MM-dd'"></span> 149 + <a href="#"
  150 + tooltip-animation="false"
  151 + tooltip-placement="left"
  152 + uib-tooltip="{{info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'}}"
  153 + tooltip-class="headClass">
  154 + <span ng-bind="info.updateDate | date: 'yyyy-MM-dd HH:mm:ss'"></span>
  155 + </a>
143 </td> 156 </td>
144 157
145 </tr> 158 </tr>
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/edit.html
@@ -59,14 +59,14 @@ @@ -59,14 +59,14 @@
59 iterobjexp="item.insideCode" 59 iterobjexp="item.insideCode"
60 searchph="请输拼音..." 60 searchph="请输拼音..."
61 searchexp="this.insideCode" 61 searchexp="this.insideCode"
62 - <!--required --> 62 + required
63 > 63 >
64 </sa-Select5> 64 </sa-Select5>
65 </div> 65 </div>
66 - <!--&lt;!&ndash; 隐藏块,显示验证信息 &ndash;&gt;-->  
67 - <!--<div class="alert alert-danger well-sm" ng-show="myForm.cl1.$error.required">-->  
68 - <!--车辆1必须选择-->  
69 - <!--</div>--> 66 + <!-- 隐藏块,显示验证信息 -->
  67 + <div class="alert alert-danger well-sm" ng-show="myForm.cl1.$error.required">
  68 + 车辆1必须选择
  69 + </div>
70 </div> 70 </div>
71 <div class="form-group has-success has-feedback"> 71 <div class="form-group has-success has-feedback">
72 <label class="col-md-5 control-label">车辆2:</label> 72 <label class="col-md-5 control-label">车辆2:</label>
@@ -99,14 +99,14 @@ @@ -99,14 +99,14 @@
99 iterobjexp="item.personnelName + '(' + item.jobCode + ')'" 99 iterobjexp="item.personnelName + '(' + item.jobCode + ')'"
100 searchph="请输拼音..." 100 searchph="请输拼音..."
101 searchexp="this.personnelName" 101 searchexp="this.personnelName"
102 - <!--required --> 102 + required
103 > 103 >
104 </sa-Select5> 104 </sa-Select5>
105 </div> 105 </div>
106 - <!--&lt;!&ndash; 隐藏块,显示验证信息 &ndash;&gt;-->  
107 - <!--<div class="alert alert-danger well-sm" ng-show="myForm.j1.$error.required">-->  
108 - <!--驾驶员必须选择-->  
109 - <!--</div>--> 106 + <!-- 隐藏块,显示验证信息 -->
  107 + <div class="alert alert-danger well-sm" ng-show="myForm.j1.$error.required">
  108 + 驾驶员必须选择
  109 + </div>
110 </div> 110 </div>
111 111
112 <div class="form-group has-success has-feedback"> 112 <div class="form-group has-success has-feedback">
@@ -204,18 +204,26 @@ @@ -204,18 +204,26 @@
204 <div class="form-group has-success has-feedback"> 204 <div class="form-group has-success has-feedback">
205 <label class="col-md-2 control-label">排班明细:</label> 205 <label class="col-md-2 control-label">排班明细:</label>
206 <div class="col-md-10"> 206 <div class="col-md-10">
207 - <sa-Planinfoedit name="spi"  
208 - ng-model="ctrl.formData.planInfos"  
209 - ng-model-options="{ getterSetter: true }"  
210 - cl1="{{ctrl.formData.cl1}}"  
211 - cl2="{{ctrl.formData.cl2}}"  
212 - j1="{{ctrl.formData.j1}}"  
213 - j2="{{ctrl.formData.j2}}"  
214 - s1="{{ctrl.formData.s1}}"  
215 - s2="{{ctrl.formData.s2}}" 207 + <!--<sa-Planinfoedit name="spi"-->
  208 + <!--ng-model="ctrl.planInfos"-->
  209 + <!--ng-model-options="{ getterSetter: true }"-->
  210 + <!--cl1="{{ctrl.formData.cl1}}"-->
  211 + <!--cl2="{{ctrl.formData.cl2}}"-->
  212 + <!--j1="{{ctrl.formData.j1}}"-->
  213 + <!--j2="{{ctrl.formData.j2}}"-->
  214 + <!--s1="{{ctrl.formData.s1}}"-->
  215 + <!--s2="{{ctrl.formData.s2}}"-->
  216 + <!-->
  217 +
  218 + <!--</sa-Planinfoedit>-->
  219 +
  220 + <sa-Planinfoedit2 name="spi"
  221 + ng-model="ctrl.planInfos"
  222 + ng-model-options="{ getterSetter: true }"
  223 + form-data="ctrl.formData"
216 > 224 >
217 225
218 - </sa-Planinfoedit> 226 + </sa-Planinfoedit2>
219 </div> 227 </div>
220 </div> 228 </div>
221 </div> 229 </div>
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js
@@ -264,7 +264,7 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -264,7 +264,7 @@ angular.module(&#39;ScheduleApp&#39;).controller(
264 self.formData.j3 = {}; // 驾驶员3 264 self.formData.j3 = {}; // 驾驶员3
265 self.formData.s3 = {}; // 售票员3 265 self.formData.s3 = {}; // 售票员3
266 266
267 - self.formData.planInfos = undefined; // 排班明细 267 + self.planInfos = undefined; // 排班明细
268 268
269 var sdd = new Date(); 269 var sdd = new Date();
270 sdd.setTime(self.sd); 270 sdd.setTime(self.sd);
@@ -277,12 +277,12 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -277,12 +277,12 @@ angular.module(&#39;ScheduleApp&#39;).controller(
277 277
278 // 获取排班明细数据 278 // 获取排班明细数据
279 SPlanInfo.list(params, function(rst) { 279 SPlanInfo.list(params, function(rst) {
280 - self.formData.planInfos = rst.content; 280 + self.planInfos = rst.content;
281 }); 281 });
282 282
283 // 提交方法 283 // 提交方法
284 self.submit = function() { 284 self.submit = function() {
285 - service.batchUpdatePlanInfo(self.formData.planInfos).then( 285 + service.batchUpdatePlanInfo(self.planInfos).then(
286 function() { 286 function() {
287 $state.go("schedulePlanReportExtManage"); 287 $state.go("schedulePlanReportExtManage");
288 }, 288 },
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js
@@ -64,7 +64,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso @@ -64,7 +64,7 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
64 return { 64 return {
65 rest : $resource( 65 rest : $resource(
66 '/spic/:id', 66 '/spic/:id',
67 - {order: 'xl,scheduleDate,lp,xlDir,fcno', direction: 'ASC,ASC,ASC,ASC,ASC', id: '@id'}, 67 + {order: 'xl,scheduleDate,lp,fcno', direction: 'ASC,ASC,ASC,ASC', id: '@id'},
68 { 68 {
69 list: { 69 list: {
70 method: 'GET', 70 method: 'GET',
src/main/resources/static/pages/trafficManage/js/lineStationUpload.js
@@ -13,124 +13,46 @@ @@ -13,124 +13,46 @@
13 */ 13 */
14 14
15 (function(){ 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 $("#search").click(searchM); 57 $("#search").click(searchM);
136 // 绑定上传事件 58 // 绑定上传事件
@@ -149,7 +71,7 @@ @@ -149,7 +71,7 @@
149 $("#right_div table tbody").empty(); 71 $("#right_div table tbody").empty();
150 var params = {}; 72 var params = {};
151 // 取得输入框的值 73 // 取得输入框的值
152 - var inputs = $("ul.breadcrumb input"); 74 + var inputs = $(".param input,select");
153 // 遍历数组 75 // 遍历数组
154 $.each(inputs, function(i, element) { 76 $.each(inputs, function(i, element) {
155 params[$(element).attr("name")] = $(element).val(); 77 params[$(element).attr("name")] = $(element).val();
@@ -168,17 +90,36 @@ @@ -168,17 +90,36 @@
168 90
169 // 上传方法 91 // 上传方法
170 function uploadM() { 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,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 $("#setCL").click(setCLF); 186 $("#setCL").click(setCLF);
210 var params = {}; 187 var params = {};
211 function setCLF() { 188 function setCLF() {
src/main/resources/static/pages/trafficManage/lineStationUpload.html
1 <link href="css/trafficManage.css" rel="stylesheet" type="text/css" /> 1 <link href="css/trafficManage.css" rel="stylesheet" type="text/css" />
2 -<link href="css/autocompleter.css" rel="stylesheet" type="text/css" />  
3 <ul class="page-breadcrumb breadcrumb"> 2 <ul class="page-breadcrumb breadcrumb">
4 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li> 3 <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
5 <li><span class="active">运维管理</span> <i class="fa fa-circle"></i></li> 4 <li><span class="active">运维管理</span> <i class="fa fa-circle"></i></li>
@@ -7,17 +6,16 @@ @@ -7,17 +6,16 @@
7 </ul> 6 </ul>
8 <div class="tab_line"> 7 <div class="tab_line">
9 <div class="col-md-12"> 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 </div> 19 </div>
22 <!-- Begin: left-div --> 20 <!-- Begin: left-div -->
23 <div class="col-md-5 panel-wrap" style="height: 60%;"> 21 <div class="col-md-5 panel-wrap" style="height: 60%;">
@@ -63,6 +61,7 @@ @@ -63,6 +61,7 @@
63 </td> 61 </td>
64 <td> 62 <td>
65 {{obj.lineCode}} 63 {{obj.lineCode}}
  64 + <input type="hidden" value="{{obj.lineCode}}"/>
66 </td> 65 </td>
67 <td class="ttInfoId"> 66 <td class="ttInfoId">
68 {{obj.name}} 67 {{obj.name}}
src/main/resources/static/real_control_v2/css/line_schedule.css
@@ -691,7 +691,7 @@ label.destroy-sch small{ @@ -691,7 +691,7 @@ label.destroy-sch small{
691 text-align: center; 691 text-align: center;
692 } 692 }
693 .sub-task-table dl dt:nth-of-type(2), .sub-task-table dl dd:nth-of-type(2) { 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 .sub-task-table dl dt:nth-of-type(3), .sub-task-table dl dd:nth-of-type(3) { 696 .sub-task-table dl dt:nth-of-type(3), .sub-task-table dl dd:nth-of-type(3) {
697 width: 16%; 697 width: 16%;
@@ -706,7 +706,7 @@ label.destroy-sch small{ @@ -706,7 +706,7 @@ label.destroy-sch small{
706 width: 11%; 706 width: 11%;
707 } 707 }
708 .sub-task-table dl dt:nth-of-type(7), .sub-task-table dl dd:nth-of-type(7) { 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 .sub-task-table dl dt:nth-of-type(8), .sub-task-table dl dd:nth-of-type(8) { 711 .sub-task-table dl dt:nth-of-type(8), .sub-task-table dl dd:nth-of-type(8) {
712 width: 9%; 712 width: 9%;
src/main/resources/static/real_control_v2/css/main.css
@@ -1255,4 +1255,329 @@ ul.left_tabs_lg li{ @@ -1255,4 +1255,329 @@ ul.left_tabs_lg li{
1255 text-indent: 12px; 1255 text-indent: 12px;
1256 margin-bottom: 0; 1256 margin-bottom: 0;
1257 padding: 18px 5px; 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 \ No newline at end of file 1584 \ No newline at end of file
src/main/resources/static/real_control_v2/css/north.css
@@ -481,4 +481,13 @@ @@ -481,4 +481,13 @@
481 .ct-badge.ct-badge-TZRC:hover{ 481 .ct-badge.ct-badge-TZRC:hover{
482 background: #97a50f; 482 background: #97a50f;
483 color: #fff; 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 \ No newline at end of file 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,7 +3,7 @@
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
5 <h2>临加/子任务</h2></div> 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 <form class="uk-form uk-form-horizontal search-form"> 7 <form class="uk-form uk-form-horizontal search-form">
8 <div class="uk-grid"> 8 <div class="uk-grid">
9 <div class="uk-width-1-3"> 9 <div class="uk-width-1-3">
@@ -51,13 +51,13 @@ @@ -51,13 +51,13 @@
51 </div> 51 </div>
52 </div> 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 <h3 class="uk-panel-title" id="childTaskTitle"> 55 <h3 class="uk-panel-title" id="childTaskTitle">
56 子任务列表 56 子任务列表
57 <a id="addChildTaskBtn" data-uk-tooltip title="添加子任务"><i 57 <a id="addChildTaskBtn" data-uk-tooltip title="添加子任务"><i
58 class="uk-icon-plus"></i> </a> 58 class="uk-icon-plus"></i> </a>
59 </h3> 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 <div class="ct_table sub-task-table"> 61 <div class="ct_table sub-task-table">
62 <div class="ct_table_head"> 62 <div class="ct_table_head">
63 <dl> 63 <dl>
@@ -126,7 +126,12 @@ @@ -126,7 +126,12 @@
126 {{each list as task i}} 126 {{each list as task i}}
127 <dl data-id="{{task.id}}"> 127 <dl data-id="{{task.id}}">
128 <dd>{{i+1}}</dd> 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 <dd>{{task.startStationName}}</dd> 135 <dd>{{task.startStationName}}</dd>
131 <dd>{{task.endStationName}}</dd> 136 <dd>{{task.endStationName}}</dd>
132 <dd>{{task.startDate}}</dd> 137 <dd>{{task.startDate}}</dd>
@@ -137,9 +142,12 @@ @@ -137,9 +142,12 @@
137 {{if task.destroy}} 142 {{if task.destroy}}
138 <small style="color:red;">烂班</small> 143 <small style="color:red;">烂班</small>
139 {{/if}} 144 {{/if}}
  145 + {{if task.nbbm!=null}},{{task.nbbm}}{{/if}}
140 ) 146 )
141 </dd> 147 </dd>
142 - <dd title="{{task.remarks}}">{{task.remarks}}</dd> 148 + <dd title="{{task.remarks}}">
  149 + {{task.remarks}}
  150 + </dd>
143 </dl> 151 </dl>
144 {{/each}} 152 {{/each}}
145 </script> 153 </script>
@@ -328,8 +336,6 @@ @@ -328,8 +336,6 @@
328 }, modal_opts); 336 }, modal_opts);
329 }; 337 };
330 338
331 - $('#addChildTaskBtn').on('click', add_sub_task_other);  
332 -  
333 //回场子任务 339 //回场子任务
334 var add_sub_task_in = function () { 340 var add_sub_task_in = function () {
335 var sch = getActiveSch(); 341 var sch = getActiveSch();
@@ -408,6 +414,18 @@ @@ -408,6 +414,18 @@
408 }, modal_opts); 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 var callbackHandler = { 429 var callbackHandler = {
412 add_temp_sch: add_temp_sch, 430 add_temp_sch: add_temp_sch,
413 remove_sch: remove_sch, 431 remove_sch: remove_sch,
@@ -416,7 +434,9 @@ @@ -416,7 +434,9 @@
416 remove_sub_task: remove_sub_task, 434 remove_sub_task: remove_sub_task,
417 add_sub_task_out: add_sub_task_out, 435 add_sub_task_out: add_sub_task_out,
418 add_sub_task_range_turn: add_sub_task_range_turn, 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,7 +451,7 @@
431 name: "临加班次" 451 name: "临加班次"
432 }, 452 },
433 "add_sub_task": { 453 "add_sub_task": {
434 - name: "添加子任务", 454 + name: "添加子任务"/*,
435 items: { 455 items: {
436 'add_oil':{ 456 'add_oil':{
437 name: '空驶进出场' 457 name: '空驶进出场'
@@ -448,7 +468,7 @@ @@ -448,7 +468,7 @@
448 'add_sub_task_other': { 468 'add_sub_task_other': {
449 name: '自定义' 469 name: '自定义'
450 } 470 }
451 - } 471 + }*/
452 }, 472 },
453 'remove_sch': { 473 'remove_sch': {
454 name: '删除' 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 <div class="uk-modal-dialog" style="width: 1240px;"> 2 <div class="uk-modal-dialog" style="width: 1240px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 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 \ No newline at end of file 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 \ No newline at end of file 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 \ No newline at end of file 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 \ No newline at end of file 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,8 +54,7 @@
54 </div> 54 </div>
55 <div class="uk-width-1-2"> 55 <div class="uk-width-1-2">
56 <div class="uk-form-row"> 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 <div class="uk-form-controls"> 58 <div class="uk-form-controls">
60 <div class="uk-autocomplete uk-form jsy-autocom"> 59 <div class="uk-autocomplete uk-form jsy-autocom">
61 <input type="text" value="" name="jsy" required> 60 <input type="text" value="" name="jsy" required>
@@ -192,7 +191,10 @@ @@ -192,7 +191,10 @@
192 //}); 191 //});
193 192
194 //submit 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 f.on('success.form.fv', function (e) { 198 f.on('success.form.fv', function (e) {
197 e.preventDefault(); 199 e.preventDefault();
198 var param = $(this).serializeJSON(); 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,6 +35,22 @@
35 <div class="uk-autocomplete uk-form autocomplete-jsy"> 35 <div class="uk-autocomplete uk-form autocomplete-jsy">
36 <input type="text" name="jGh" placeholder="驾驶员"> 36 <input type="text" name="jGh" placeholder="驾驶员">
37 </div> 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 <button class="uk-button">检索</button> 54 <button class="uk-button">检索</button>
39 55
40 <label style="float: right;font-size: 12px;color: #989797;"> 56 <label style="float: right;font-size: 12px;color: #989797;">
@@ -122,6 +138,19 @@ @@ -122,6 +138,19 @@
122 </div> 138 </div>
123 </script> 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 <!-- 撤销实发tip --> 154 <!-- 撤销实发tip -->
126 <script id="edit-info-tip-cxsf-temp" type="text/html"> 155 <script id="edit-info-tip-cxsf-temp" type="text/html">
127 <div class="edit-info-tip"> 156 <div class="edit-info-tip">
@@ -248,6 +277,7 @@ @@ -248,6 +277,7 @@
248 $.each(rs.list, function () { 277 $.each(rs.list, function () {
249 this.jsonArray = JSON.parse(this.jsonArray); 278 this.jsonArray = JSON.parse(this.jsonArray);
250 etInfos[this.id] = this; 279 etInfos[this.id] = this;
  280 + this['ts_str'] = moment(this.ts).format('YYYY-MM-DD HH:mm');
251 281
252 nbbmArray.push({value: this.clZbh}); 282 nbbmArray.push({value: this.clZbh});
253 jsyArray.push({value: this.jGh+'/'+this.jName, 283 jsyArray.push({value: this.jGh+'/'+this.jName,
@@ -365,7 +395,7 @@ @@ -365,7 +395,7 @@
365 return gb_common.get_vals(rs); 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 function subData(data){ 399 function subData(data){
370 return { 400 return {
371 id: data.id, 401 id: data.id,
@@ -535,6 +565,26 @@ @@ -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 function sortFun(a, b) { 588 function sortFun(a, b) {
539 return (a.realExecDate + a.fcsj).localeCompare(b.realExecDate + b.fcsj); 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,6 +21,9 @@ var gb_common = (function () {
21 0x12: '报警' 21 0x12: '报警'
22 }; 22 };
23 23
  24 + var adjustExps = ['配车', '保养', '故障', '肇事', '路阻', '纠纷', '缺人', '客稀', '缺车', '气候', '援外', '吊慢', '抽减', '其他'];
  25 + var inOutExps = ['故障', '肇事', '纠纷', '其他'];
  26 +
24 var groupBy = function (list, field) { 27 var groupBy = function (list, field) {
25 var rs = {}, 28 var rs = {},
26 key; 29 key;
@@ -324,6 +327,17 @@ var gb_common = (function () { @@ -324,6 +327,17 @@ var gb_common = (function () {
324 return e = Math.pow(10, Math.max(c, d)), (mul(a, e) + mul(b, e)) / e; 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 function mul(a, b) { 341 function mul(a, b) {
328 var c = 0, 342 var c = 0,
329 d = a.toString(), 343 d = a.toString(),
@@ -372,6 +386,26 @@ var gb_common = (function () { @@ -372,6 +386,26 @@ var gb_common = (function () {
372 return rs; 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 return { 409 return {
376 reqCode80: reqCode80, 410 reqCode80: reqCode80,
377 groupBy: groupBy, 411 groupBy: groupBy,
@@ -395,7 +429,13 @@ var gb_common = (function () { @@ -395,7 +429,13 @@ var gb_common = (function () {
395 trim: trim, 429 trim: trim,
396 remarksAutocomplete: remarksAutocomplete, 430 remarksAutocomplete: remarksAutocomplete,
397 flatpickrDateTimeConfig: flatpickrDateTimeConfig, 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 //whichTransitionEvent:whichTransitionEvent 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,6 +75,9 @@ var gb_data_basic = (function () {
75 var carparks = {}; 75 var carparks = {};
76 //停车场数据 76 //停车场数据
77 gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) { 77 gb_common.$get('/realMap/carParkSpatialData', {}, function (rs) {
  78 + rs.list.sort(function (a, b) {
  79 + return a.parkName.localeCompare(b.parkName);
  80 + });
78 $.each(rs.list, function () { 81 $.each(rs.list, function () {
79 carparks[this.parkCode] = this; 82 carparks[this.parkCode] = this;
80 }); 83 });
@@ -116,6 +119,15 @@ var gb_data_basic = (function () { @@ -116,6 +119,15 @@ var gb_data_basic = (function () {
116 ep.emit('svg_attrs', data); 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 function findLineByCodes(codeArr) { 131 function findLineByCodes(codeArr) {
120 var rs = []; 132 var rs = [];
121 $.each(codeArr, function () { 133 $.each(codeArr, function () {
@@ -239,6 +251,12 @@ var gb_data_basic = (function () { @@ -239,6 +251,12 @@ var gb_data_basic = (function () {
239 }, 251 },
240 remarksMapps: function () { 252 remarksMapps: function () {
241 return remarksMapps; 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,7 +61,7 @@ var gb_embed_form_hanlde = (function () {
61 61
62 } 62 }
63 }); 63 });
64 - } 64 + };
65 65
66 66
67 return { 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 +7,23 @@ var gb_schedule_context_menu = (function () {
7 bgclose: false 7 bgclose: false
8 }, 8 },
9 folder = '/real_control_v2/fragments/line_schedule/context_menu'; 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 var callbackHandler = { 23 var callbackHandler = {
  24 + get_st_doms: function () {
  25 + return st_doms;
  26 + },
11 dftz: function (sch) { 27 dftz: function (sch) {
12 open_modal(folder + '/dftz.html', { 28 open_modal(folder + '/dftz.html', {
13 sch: sch 29 sch: sch
@@ -234,6 +250,11 @@ var gb_schedule_context_menu = (function () { @@ -234,6 +250,11 @@ var gb_schedule_context_menu = (function () {
234 open_modal(folder + '/add_temp_sch.html', { 250 open_modal(folder + '/add_temp_sch.html', {
235 sch: sch 251 sch: sch
236 }, modal_opts); 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,7 +295,7 @@ var gb_schedule_context_menu = (function () {
274 }, 295 },
275 'lj_zrw': { 296 'lj_zrw': {
276 name: '临加/子任务' 297 name: '临加/子任务'
277 - }, 298 + }/*,
278 'shortcut': { 299 'shortcut': {
279 name: '...', 300 name: '...',
280 items: { 301 items: {
@@ -294,6 +315,13 @@ var gb_schedule_context_menu = (function () { @@ -294,6 +315,13 @@ var gb_schedule_context_menu = (function () {
294 name: '(子任务)区间调头' 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 'sep4': '---------', 326 'sep4': '---------',
299 'tzrc': { 327 'tzrc': {
@@ -305,7 +333,7 @@ var gb_schedule_context_menu = (function () { @@ -305,7 +333,7 @@ var gb_schedule_context_menu = (function () {
305 'wdtz': { 333 'wdtz': {
306 name: '误点调整' 334 name: '误点调整'
307 }, 335 },
308 - 'sep3': '---------', 336 + 'sep4': '---------',
309 'lp_change': { 337 'lp_change': {
310 name: '路牌对调' 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,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 var addRemarks = function (list, remarks) { 575 var addRemarks = function (list, remarks) {
562 //if(!list || list) 576 //if(!list || list)
@@ -630,6 +644,7 @@ var gb_schedule_table = (function () { @@ -630,6 +644,7 @@ var gb_schedule_table = (function () {
630 reLoadAndRefresh: reLoadAndRefresh, 644 reLoadAndRefresh: reLoadAndRefresh,
631 showLateBadge: showLateBadge, 645 showLateBadge: showLateBadge,
632 cancelLateBadge: cancelLateBadge, 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,8 +169,8 @@ var disabled_submit_btn = function (form) {
169 function showUpdateDescription() { 169 function showUpdateDescription() {
170 //更新说明 170 //更新说明
171 var updateDescription = { 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 var storage = window.localStorage 176 var storage = window.localStorage
src/main/resources/static/real_control_v2/sch_manage/sch_imitate.html
@@ -379,15 +379,33 @@ @@ -379,15 +379,33 @@
379 } 379 }
380 alt_confirm('确定班次信息? ' + sch.xlName + '、起点 ' + sch.qdzName + ' , 终点 ' + sch.zdzName + ' 、待发 ' + sch.dfsj, function () { 380 alt_confirm('确定班次信息? ' + sch.xlName + '、起点 ' + sch.qdzName + ' , 终点 ' + sch.zdzName + ' 、待发 ' + sch.dfsj, function () {
381 $('.shade-loading').show(); 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 $('.shade-loading').hide(); 383 $('.shade-loading').hide();
384 $('.search-form').trigger('submit'); 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 var callbackHandler = { 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 $.contextMenu({ 411 $.contextMenu({
@@ -399,7 +417,11 @@ @@ -399,7 +417,11 @@
399 }, 417 },
400 items: { 418 items: {
401 'gps_imitate': { 419 'gps_imitate': {
402 - name: '模拟轨迹' 420 + name: '模拟轨迹(事前)'
  421 +
  422 + },
  423 + 'gps_imitate_after':{
  424 + name: '模拟轨迹(事后补传)'
403 } 425 }
404 } 426 }
405 }); 427 });