Commit 68477f472e25658815aa5a42c16ed853c7bfb2de

Authored by 徐烜
2 parents 14f7a305 35ff92e6

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

Showing 63 changed files with 2477 additions and 959 deletions

Too many changes to show.

To preserve performance only 63 of 104 files are displayed.

src/main/java/com/bsth/Application.java
@@ -10,6 +10,8 @@ import org.springframework.context.annotation.Bean; @@ -10,6 +10,8 @@ import org.springframework.context.annotation.Bean;
10 import org.springframework.context.annotation.Primary; 10 import org.springframework.context.annotation.Primary;
11 import org.springframework.transaction.annotation.EnableTransactionManagement; 11 import org.springframework.transaction.annotation.EnableTransactionManagement;
12 12
  13 +import java.util.Calendar;
  14 +import java.util.Date;
13 import java.util.concurrent.Executors; 15 import java.util.concurrent.Executors;
14 import java.util.concurrent.ScheduledExecutorService; 16 import java.util.concurrent.ScheduledExecutorService;
15 17
src/main/java/com/bsth/controller/gps/GpsController.java
@@ -4,11 +4,15 @@ import com.bsth.data.BasicData; @@ -4,11 +4,15 @@ 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.service.gps.GpsService; 6 import com.bsth.service.gps.GpsService;
  7 +import com.bsth.service.gps.entity.GpsSpeed;
7 import com.google.common.base.Splitter; 8 import com.google.common.base.Splitter;
8 import org.springframework.beans.factory.annotation.Autowired; 9 import org.springframework.beans.factory.annotation.Autowired;
9 import org.springframework.web.bind.annotation.*; 10 import org.springframework.web.bind.annotation.*;
10 11
11 import javax.servlet.http.HttpServletResponse; 12 import javax.servlet.http.HttpServletResponse;
  13 +
  14 +import java.text.ParseException;
  15 +import java.util.ArrayList;
12 import java.util.List; 16 import java.util.List;
13 import java.util.Map; 17 import java.util.Map;
14 18
@@ -91,11 +95,12 @@ public class GpsController { @@ -91,11 +95,12 @@ public class GpsController {
91 95
92 /** 96 /**
93 * gps补全 97 * gps补全
  98 + * type 0 : 实时GPS 1:走补传
94 * @return 99 * @return
95 */ 100 */
96 @RequestMapping(value = "/gpsCompletion", method = RequestMethod.POST) 101 @RequestMapping(value = "/gpsCompletion", method = RequestMethod.POST)
97 - public Map<String, Object> gpsCompletion(@RequestParam long schId) {  
98 - return gpsService.gpsCompletion(schId); 102 + public Map<String, Object> gpsCompletion(@RequestParam long schId, @RequestParam int type) {
  103 + return gpsService.gpsCompletion(schId, type);
99 } 104 }
100 105
101 /** 106 /**
@@ -178,4 +183,13 @@ public class GpsController { @@ -178,4 +183,13 @@ public class GpsController {
178 @RequestParam(defaultValue = "DESC") String direction){ 183 @RequestParam(defaultValue = "DESC") String direction){
179 return gpsService.safeDrivList(map , page, size, order, direction); 184 return gpsService.safeDrivList(map , page, size, order, direction);
180 } 185 }
  186 +
  187 + @RequestMapping(value = "/findPosition", method = RequestMethod.GET)
  188 + public List<GpsSpeed> findPosition(@RequestParam String vehicle,@RequestParam String startdate,@RequestParam String enddate) throws ParseException {
  189 + String deviceid = BasicData.deviceId2NbbmMap.inverse().get(vehicle);
  190 + List<GpsSpeed> listGpsSpeed = new ArrayList<GpsSpeed>();
  191 + listGpsSpeed = gpsService.findPosition(deviceid,startdate,enddate);
  192 + return listGpsSpeed;
  193 + }
  194 +
181 } 195 }
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON; @@ -4,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/controller/sys/IntervalController.java 0 → 100644
  1 +package com.bsth.controller.sys;
  2 +
  3 +import java.util.Map;
  4 +
  5 +import org.springframework.beans.factory.annotation.Autowired;
  6 +import org.springframework.web.bind.annotation.RequestMapping;
  7 +import org.springframework.web.bind.annotation.RequestMethod;
  8 +import org.springframework.web.bind.annotation.RequestParam;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import com.alibaba.fastjson.JSON;
  12 +import com.bsth.entity.sys.Interval;
  13 +import com.bsth.service.sys.IntervalService;
  14 +
  15 +@RestController
  16 +@RequestMapping("interval")
  17 +public class IntervalController {
  18 +
  19 + @Autowired
  20 + IntervalService intervalService;
  21 +
  22 + @RequestMapping(value = "/save", method = RequestMethod.POST)
  23 + public Map<String, Object> save(@RequestParam String array){
  24 + return intervalService.saveList(JSON.parseArray(array, Interval.class));
  25 + }
  26 +}
src/main/java/com/bsth/data/BasicData.java
@@ -134,6 +134,9 @@ public class BasicData implements CommandLineRunner { @@ -134,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/excep/Speeding.java
@@ -52,6 +52,33 @@ public class Speeding { @@ -52,6 +52,33 @@ public class Speeding {
52 private Float lat; 52 private Float lat;
53 53
54 /** 54 /**
  55 + * 超速结束时的经度
  56 + */
  57 + private Float endlon;
  58 +
  59 + public Float getEndlon() {
  60 + return endlon;
  61 + }
  62 +
  63 + public void setEndlon(Float endlon) {
  64 + this.endlon = endlon;
  65 + }
  66 +
  67 + public Float getEndlat() {
  68 + return endlat;
  69 + }
  70 +
  71 + public void setEndlat(Float endlat) {
  72 + this.endlat = endlat;
  73 + }
  74 +
  75 + /**
  76 + * 超速结束时的纬度
  77 + */
  78 + private Float endlat;
  79 +
  80 +
  81 + /**
55 * 速度 82 * 速度
56 */ 83 */
57 private Float speed; 84 private Float speed;
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/entity/sys/Interval.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Column;
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.GeneratedValue;
  8 +import javax.persistence.GenerationType;
  9 +import javax.persistence.Id;
  10 +import javax.persistence.Table;
  11 +
  12 +
  13 +@Entity
  14 +@Table(name = "bsth_c_interval")
  15 +public class Interval {
  16 +
  17 + @Id
  18 + @GeneratedValue(strategy = GenerationType.IDENTITY)
  19 + private Integer id;
  20 +
  21 + /** 大间隔等级 */
  22 + private String level;
  23 + /** 高峰*/
  24 + private Integer peak;
  25 + public Integer getPeak() {
  26 + return peak;
  27 + }
  28 +
  29 + public void setPeak(Integer peak) {
  30 + this.peak = peak;
  31 + }
  32 +
  33 + public Integer getTrough() {
  34 + return trough;
  35 + }
  36 +
  37 + public void setTrough(Integer trough) {
  38 + this.trough = trough;
  39 + }
  40 +
  41 +
  42 + public Integer getCreateBy() {
  43 + return createBy;
  44 + }
  45 +
  46 + public void setCreateBy(Integer createBy) {
  47 + this.createBy = createBy;
  48 + }
  49 +
  50 + public Date getCreateDate() {
  51 + return createDate;
  52 + }
  53 +
  54 + public void setCreateDate(Date createDate) {
  55 + this.createDate = createDate;
  56 + }
  57 +
  58 + public Integer getUpdateBy() {
  59 + return updateBy;
  60 + }
  61 +
  62 + public void setUpdateBy(Integer updateBy) {
  63 + this.updateBy = updateBy;
  64 + }
  65 +
  66 + public Date getUpdateDate() {
  67 + return updateDate;
  68 + }
  69 +
  70 + public void setUpdateDate(Date updateDate) {
  71 + this.updateDate = updateDate;
  72 + }
  73 +
  74 + /** 低谷 */
  75 + private Integer trough;
  76 +
  77 + @Column(name = "create_by")
  78 + private Integer createBy;
  79 +
  80 + @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
  81 + private Date createDate;
  82 +
  83 + @Column(name = "update_by")
  84 + private Integer updateBy;
  85 +
  86 + @Column(name = "update_date", columnDefinition = "timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
  87 + private Date updateDate;
  88 +
  89 + public Integer getId() {
  90 + return id;
  91 + }
  92 +
  93 + public void setId(Integer id) {
  94 + this.id = id;
  95 + }
  96 +
  97 + public String getLevel() {
  98 + return level;
  99 + }
  100 +
  101 + public void setLevel(String level) {
  102 + this.level = level;
  103 + }
  104 +
  105 +}
src/main/java/com/bsth/repository/LineRepository.java
@@ -39,6 +39,6 @@ public interface LineRepository extends BaseRepository&lt;Line, Integer&gt; { @@ -39,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/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/repository/sys/IntervalRepository.java 0 → 100644
  1 +package com.bsth.repository.sys;
  2 +
  3 +
  4 +import org.springframework.stereotype.Repository;
  5 +import com.bsth.entity.sys.Interval;
  6 +import com.bsth.repository.BaseRepository;
  7 +
  8 +@Repository
  9 +public interface IntervalRepository extends BaseRepository<Interval, Integer> {
  10 +
  11 +}
src/main/java/com/bsth/service/TrafficManageService.java
@@ -24,7 +24,7 @@ public interface TrafficManageService { @@ -24,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
@@ -302,7 +302,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -302,7 +302,7 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
302 302
303 Map<String, List<D80>> rs = new HashMap<>(); 303 Map<String, List<D80>> rs = new HashMap<>();
304 for (String code : lineList) 304 for (String code : lineList)
305 - rs.put(code, pilotReport.unconfirmed80(Integer.parseInt(code))); 305 + rs.put(code, pilotReport.unconfirmed80(code));
306 306
307 return rs; 307 return rs;
308 } 308 }
src/main/java/com/bsth/service/excep/impl/SpeedingServiceImpl.java
@@ -9,6 +9,7 @@ import java.text.SimpleDateFormat; @@ -9,6 +9,7 @@ import java.text.SimpleDateFormat;
9 import java.util.ArrayList; 9 import java.util.ArrayList;
10 import java.util.Date; 10 import java.util.Date;
11 import java.util.HashMap; 11 import java.util.HashMap;
  12 +import java.util.Iterator;
12 import java.util.List; 13 import java.util.List;
13 import java.util.Map; 14 import java.util.Map;
14 15
@@ -24,6 +25,8 @@ import com.bsth.service.excep.SpeedingService; @@ -24,6 +25,8 @@ import com.bsth.service.excep.SpeedingService;
24 import com.bsth.util.EchartConver; 25 import com.bsth.util.EchartConver;
25 import com.bsth.util.PageHelper; 26 import com.bsth.util.PageHelper;
26 import com.bsth.util.PageObject; 27 import com.bsth.util.PageObject;
  28 +import com.bsth.util.TransGPS;
  29 +import com.bsth.util.TransGPS.Location;
27 import com.bsth.util.db.DBUtils_MS; 30 import com.bsth.util.db.DBUtils_MS;
28 import com.github.abel533.echarts.Option; 31 import com.github.abel533.echarts.Option;
29 import com.google.gson.Gson; 32 import com.google.gson.Gson;
@@ -39,7 +42,7 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -39,7 +42,7 @@ public class SpeedingServiceImpl implements SpeedingService {
39 ResultSet rs = null; 42 ResultSet rs = null;
40 int page=Integer.parseInt(map.get("page").toString()); 43 int page=Integer.parseInt(map.get("page").toString());
41 List<Speeding> list=new ArrayList<Speeding>(); 44 List<Speeding> list=new ArrayList<Speeding>();
42 - String sql="select * from bsth_c_speeding where 1=1 "; 45 + String sql="select * from bsth_c_speeding where speed > 60 ";
43 Object line=map.get("line"); 46 Object line=map.get("line");
44 Object nbbm=map.get("nbbm"); 47 Object nbbm=map.get("nbbm");
45 Object updown=map.get("updown"); 48 Object updown=map.get("updown");
@@ -83,7 +86,6 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -83,7 +86,6 @@ public class SpeedingServiceImpl implements SpeedingService {
83 86
84 } 87 }
85 88
86 -  
87 /*sql +=" order by id limit ?,?";*/ 89 /*sql +=" order by id limit ?,?";*/
88 90
89 91
@@ -104,17 +106,23 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -104,17 +106,23 @@ public class SpeedingServiceImpl implements SpeedingService {
104 } 106 }
105 107
106 static List<Speeding> resultSet2Set(ResultSet rs) throws SQLException{ 108 static List<Speeding> resultSet2Set(ResultSet rs) throws SQLException{
107 - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); 109 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
108 List<Speeding> list=new ArrayList<Speeding>(); 110 List<Speeding> list=new ArrayList<Speeding>();
109 Speeding speeding; 111 Speeding speeding;
  112 + Float lon, lat;
  113 + Location location;
110 while(rs.next()){ 114 while(rs.next()){
  115 + lon = rs.getFloat("lon");
  116 + lat = rs.getFloat("lat");
  117 + location = TransGPS.LocationMake(lon, lat);
  118 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location));
111 speeding=new Speeding(); 119 speeding=new Speeding();
112 speeding.setId(Integer.valueOf(rs.getObject("id").toString())); 120 speeding.setId(Integer.valueOf(rs.getObject("id").toString()));
113 - speeding.setLat(Float.valueOf(rs.getObject("lat").toString())); 121 + speeding.setLon((float)location.getLng());
  122 + speeding.setLat((float)location.getLat());
114 speeding.setLine(Integer.valueOf(rs.getObject("line").toString())); 123 speeding.setLine(Integer.valueOf(rs.getObject("line").toString()));
115 //run 时注解 124 //run 时注解
116 speeding.setLineName(BasicData.lineCode2NameMap.get(speeding.getLine().toString())); 125 speeding.setLineName(BasicData.lineCode2NameMap.get(speeding.getLine().toString()));
117 - speeding.setLon(Float.valueOf(rs.getObject("lon").toString()));  
118 speeding.setSpeed(Float.valueOf(rs.getObject("speed").toString())); 126 speeding.setSpeed(Float.valueOf(rs.getObject("speed").toString()));
119 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString()))); 127 speeding.setTimestamp((Long.valueOf(rs.getObject("timestamp").toString())));
120 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp()))); 128 speeding.setTimestampDate(sdf.format(new Date(speeding.getTimestamp())));
@@ -127,14 +135,12 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -127,14 +135,12 @@ public class SpeedingServiceImpl implements SpeedingService {
127 135
128 @Override 136 @Override
129 public PageObject<Speeding> Pagequery(Map<String, Object> map) { 137 public PageObject<Speeding> Pagequery(Map<String, Object> map) {
130 - String sql="select count(*) record from bsth_c_speeding where 1=1 "; 138 +/* String sql="select count(*) record from bsth_c_speeding where 1=1 ";
131 Object line=map.get("line"); 139 Object line=map.get("line");
132 Object nbbm=map.get("nbbm"); 140 Object nbbm=map.get("nbbm");
133 Object updown=map.get("updown"); 141 Object updown=map.get("updown");
134 Object startDate=map.get("startDate"); 142 Object startDate=map.get("startDate");
135 Object endDate=map.get("endDate"); 143 Object endDate=map.get("endDate");
136 - //时间转换  
137 - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
138 144
139 if(line!=null){ 145 if(line!=null){
140 sql +=" and line like'%"+line.toString().trim()+"%'"; 146 sql +=" and line like'%"+line.toString().trim()+"%'";
@@ -186,14 +192,17 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -186,14 +192,17 @@ public class SpeedingServiceImpl implements SpeedingService {
186 e.printStackTrace(); 192 e.printStackTrace();
187 }finally { 193 }finally {
188 DBUtils_MS.close(rs, ps, conn); 194 DBUtils_MS.close(rs, ps, conn);
189 - } 195 + }*/
190 196
  197 + //时间转换
  198 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
191 List<Speeding> list=findAll(map); 199 List<Speeding> list=findAll(map);
192 List<Speeding> listResult = new ArrayList<Speeding>(); 200 List<Speeding> listResult = new ArrayList<Speeding>();
193 int curPage;//页码 201 int curPage;//页码
194 int pageData;//每页的记录条数 202 int pageData;//每页的记录条数
195 int start;//起始数据下标 203 int start;//起始数据下标
196 int totalPage;//总页数 204 int totalPage;//总页数
  205 + int totalData = 0;
197 if(list.size()>1){ 206 if(list.size()>1){
198 Speeding speedingNow;//下标为i的车 207 Speeding speedingNow;//下标为i的车
199 Speeding speedingLast;//下标为i-1的车 208 Speeding speedingLast;//下标为i-1的车
@@ -206,11 +215,20 @@ public class SpeedingServiceImpl implements SpeedingService { @@ -206,11 +215,20 @@ public class SpeedingServiceImpl implements SpeedingService {
206 strLast = speedingLast.getVehicle()+speedingLast.getLine()+speedingLast.getUpDown(); 215 strLast = speedingLast.getVehicle()+speedingLast.getLine()+speedingLast.getUpDown();
207 //同一车辆同一线路同一方向并且该记录的超速的开始时间减去上一条超速记录的结束时间小于等于10s,证明该车超速。//PS:祛除数据库中的重复发送数据 216 //同一车辆同一线路同一方向并且该记录的超速的开始时间减去上一条超速记录的结束时间小于等于10s,证明该车超速。//PS:祛除数据库中的重复发送数据
208 if(strNow.equals(strLast) && Math.abs(speedingNow.getTimestamp()-speedingLast.getTimestamp())<=10*1000 && (speedingNow.getTimestamp()-speedingLast.getTimestamp()!=0)){ 217 if(strNow.equals(strLast) && Math.abs(speedingNow.getTimestamp()-speedingLast.getTimestamp())<=10*1000 && (speedingNow.getTimestamp()-speedingLast.getTimestamp()!=0)){
209 - speedingLast.setEndtimestamp(speedingNow.getTimestamp()); 218 + speedingLast.setEndtimestamp(speedingNow.getTimestamp());//设置结束时间时间戳
210 speedingLast.setEndtimestampDate(sdf.format(new Date(speedingNow.getTimestamp())));//设置结束时间 219 speedingLast.setEndtimestampDate(sdf.format(new Date(speedingNow.getTimestamp())));//设置结束时间
  220 + speedingLast.setEndlon(speedingNow.getLon());//设置结束时的经度
  221 + speedingLast.setEndlat(speedingNow.getLat());//设置结束时的纬度
211 listResult.add(speedingLast); 222 listResult.add(speedingLast);
212 } 223 }
213 } 224 }
  225 + Iterator<Speeding> speedIt = listResult.iterator();
  226 + while(speedIt.hasNext()){
  227 + Speeding speeding = speedIt.next();
  228 + if(speeding.getEndtimestamp()-speeding.getTimestamp()<=1000){
  229 + speedIt.remove();
  230 + }
  231 + }
214 232
215 totalData = listResult.size();//总记录条数。 233 totalData = listResult.size();//总记录条数。
216 if(map.get("curPage") == null || map.get("curPage").equals("0")){ 234 if(map.get("curPage") == null || map.get("curPage").equals("0")){
src/main/java/com/bsth/service/gps/GpsService.java
1 package com.bsth.service.gps; 1 package com.bsth.service.gps;
2 2
  3 +import com.bsth.data.gpsdata.GpsEntity;
3 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;
4 import com.bsth.service.gps.entity.GpsSpeed_DTO; 6 import com.bsth.service.gps.entity.GpsSpeed_DTO;
5 7
6 import javax.servlet.http.HttpServletResponse; 8 import javax.servlet.http.HttpServletResponse;
  9 +
  10 +import java.text.ParseException;
7 import java.util.List; 11 import java.util.List;
8 import java.util.Map; 12 import java.util.Map;
9 13
@@ -21,7 +25,7 @@ public interface GpsService { @@ -21,7 +25,7 @@ public interface GpsService {
21 25
22 Map<String,Object> findRoadSpeed(String lineCode); 26 Map<String,Object> findRoadSpeed(String lineCode);
23 27
24 - Map<String,Object> gpsCompletion(long schId); 28 + Map<String,Object> gpsCompletion(long schId, int type);
25 29
26 Map<String,Object> history_v2(String nbbm, long st, long et); 30 Map<String,Object> history_v2(String nbbm, long st, long et);
27 31
@@ -38,4 +42,7 @@ public interface GpsService { @@ -38,4 +42,7 @@ public interface GpsService {
38 void abnormalExcel(String nbbm, long st, long et, HttpServletResponse resp); 42 void abnormalExcel(String nbbm, long st, long et, HttpServletResponse resp);
39 43
40 void arrivalExcel(String nbbm, long st, long et, HttpServletResponse resp); 44 void arrivalExcel(String nbbm, long st, long et, HttpServletResponse resp);
  45 +
  46 + List<GpsSpeed> findPosition(String deviceid, String startdate,
  47 + String enddate) throws ParseException;
41 } 48 }
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
@@ -45,6 +45,8 @@ import java.sql.Connection; @@ -45,6 +45,8 @@ import java.sql.Connection;
45 import java.sql.PreparedStatement; 45 import java.sql.PreparedStatement;
46 import java.sql.ResultSet; 46 import java.sql.ResultSet;
47 import java.text.DecimalFormat; 47 import java.text.DecimalFormat;
  48 +import java.text.ParseException;
  49 +import java.text.SimpleDateFormat;
48 import java.util.*; 50 import java.util.*;
49 51
50 @Service 52 @Service
@@ -445,7 +447,7 @@ public class GpsServiceImpl implements GpsService { @@ -445,7 +447,7 @@ public class GpsServiceImpl implements GpsService {
445 * @return 447 * @return
446 */ 448 */
447 @Override 449 @Override
448 - public Map<String, Object> gpsCompletion(long schId) { 450 + public Map<String, Object> gpsCompletion(long schId, int type) {
449 Map<String, Object> rs = new HashMap<>(); 451 Map<String, Object> rs = new HashMap<>();
450 452
451 try { 453 try {
@@ -479,12 +481,18 @@ public class GpsServiceImpl implements GpsService { @@ -479,12 +481,18 @@ public class GpsServiceImpl implements GpsService {
479 }); 481 });
480 Map<String, Object> fs = list.get(0); 482 Map<String, Object> fs = list.get(0);
481 //替换设备号和时间 483 //替换设备号和时间
482 - int diff = (int) (sch.getDfsjT() - Long.parseLong(fs.get("ts").toString()) - 1000 * 70); 484 + long diff = ((sch.getDfsjT() - Long.parseLong(fs.get("ts").toString())) - 1000 * 70);
483 485
484 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); 486 String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh());
  487 + int serviceState;
485 for (Map<String, Object> map : list) { 488 for (Map<String, Object> map : list) {
486 map.put("device_id", deviceId); 489 map.put("device_id", deviceId);
487 map.put("ts", Long.parseLong(map.get("ts").toString()) + diff); 490 map.put("ts", Long.parseLong(map.get("ts").toString()) + diff);
  491 + if(type==1){
  492 + //走补传协议
  493 + serviceState = Integer.parseInt(map.get("service_state").toString());
  494 + map.put("service_state", serviceState |= 0x00100000);
  495 + }
488 } 496 }
489 497
490 String sqlBefore = "insert into bsth_c_template(", sqlValues = " values("; 498 String sqlBefore = "insert into bsth_c_template(", sqlValues = " values(";
@@ -975,4 +983,57 @@ public class GpsServiceImpl implements GpsService { @@ -975,4 +983,57 @@ public class GpsServiceImpl implements GpsService {
975 } 983 }
976 return true; 984 return true;
977 } 985 }
  986 +
  987 + @Override
  988 + public List<GpsSpeed> findPosition(String deviceid, String startdate,
  989 + String enddate) throws ParseException{
  990 + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  991 + Calendar c = Calendar.getInstance();
  992 + Date date = sdf.parse(startdate);
  993 + c.setTime(date);
  994 + int daysYear = c.get(Calendar.DAY_OF_YEAR);//获取当前是今年的第几天。
  995 +
  996 + long startTime = sdf.parse(startdate).getTime();
  997 + long endTime = sdf.parse(enddate).getTime();
  998 +
  999 + String sql = "select DEVICE_ID,LON,LAT,TS,INOUT_STOP,SERVICE_STATE ,speed_gps from bsth_c_gps_info where days_year=? and device_id=? and ts >= ? and ts <= ?" +
  1000 + " ORDER BY TS ";
  1001 + Connection conn = null;
  1002 + PreparedStatement ps = null;
  1003 + ResultSet rs = null;
  1004 + List<GpsSpeed> listResult = new ArrayList<GpsSpeed>();
  1005 + GpsSpeed gpsSpeed = null;
  1006 + try {
  1007 + conn = DBUtils_MS.getConnection();
  1008 + ps = conn.prepareStatement(sql);
  1009 + ps.setInt(1, daysYear);
  1010 + ps.setString(2, deviceid);
  1011 + ps.setLong(3,startTime);
  1012 + ps.setLong(4,endTime);
  1013 + rs = ps.executeQuery();
  1014 + Float lon, lat;
  1015 + Location location;
  1016 + while (rs.next()) {
  1017 + gpsSpeed = new GpsSpeed();
  1018 + // to 百度坐标
  1019 + lon = rs.getFloat("LON");
  1020 + lat = rs.getFloat("LAT");
  1021 + location = TransGPS.LocationMake(lon, lat);
  1022 + location = TransGPS.bd_encrypt(TransGPS.transformFromWGSToGCJ(location));
  1023 + gpsSpeed.setVehicle(rs.getString("device_id"));
  1024 + gpsSpeed.setLon((float)location.getLng());
  1025 + gpsSpeed.setLat((float)location.getLat());
  1026 + gpsSpeed.setSpeed(rs.getFloat("speed_gps"));
  1027 + gpsSpeed.setTimestamp(rs.getLong("TS"));
  1028 + // 上下行
  1029 + listResult.add(gpsSpeed);
  1030 + }
  1031 + } catch (Exception e) {
  1032 + e.printStackTrace();
  1033 + } finally {
  1034 + DBUtils_MS.close(rs, ps, conn);
  1035 + }
  1036 + return listResult;
  1037 +
  1038 + }
978 } 1039 }
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
@@ -17,17 +17,24 @@ import java.util.List; @@ -17,17 +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/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 }
@@ -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
@@ -570,15 +570,15 @@ public class ReportServiceImpl implements ReportService{ @@ -570,15 +570,15 @@ public class ReportServiceImpl implements ReportService{
570 String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class); 570 String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
571 571
572 //查询全程 572 //查询全程
573 - String sqlqc="select t.*,x.station_name as qdz_name from ( "  
574 - + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir FROM bsth_c_s_ttinfo_detail " 573 + String sqlqc="select t.* from ( "
  574 + + " (SELECT bc_type, fcsj,qdz,2 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
575 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') " 575 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
576 + " and fcsj <='"+minfcsj+"') " 576 + " and fcsj <='"+minfcsj+"') "
577 + " union " 577 + " union "
578 - + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir FROM bsth_c_s_ttinfo_detail " 578 + + " (SELECT bc_type, fcsj,qdz,1 as xh,xl_dir,qdz_name FROM bsth_c_s_ttinfo_detail "
579 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') " 579 + " where ttinfo ='"+ttinfo+"' and (bc_type='normal' || bc_type='region') "
580 + " and fcsj > '"+minfcsj+"') " 580 + " and fcsj > '"+minfcsj+"') "
581 - + "order by xl_dir,xh,fcsj ) t left join bsth_c_station x on t.qdz=x.id"; 581 + + "order by xl_dir,xh,fcsj ) t ";
582 List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc, 582 List<Map<String, String>> qclist= jdbcTemplate.query(sqlqc,
583 new RowMapper<Map<String, String>>(){ 583 new RowMapper<Map<String, String>>(){
584 @Override 584 @Override
@@ -619,12 +619,12 @@ public class ReportServiceImpl implements ReportService{ @@ -619,12 +619,12 @@ public class ReportServiceImpl implements ReportService{
619 sxbc++; 619 sxbc++;
620 upfcsj.add(m.get("fcsj")); 620 upfcsj.add(m.get("fcsj"));
621 if(sxqdz.length() == 0 && m.containsKey("qdz_name")) 621 if(sxqdz.length() == 0 && m.containsKey("qdz_name"))
622 - sxqdz = m.get("qdz_name"); 622 + sxqdz = m.get("qdz_name")==null?"":m.get("qdz_name").toString();
623 } else { 623 } else {
624 xxbc++; 624 xxbc++;
625 downfcsj.add(m.get("fcsj")); 625 downfcsj.add(m.get("fcsj"));
626 if(xxqdz.length() == 0 && m.containsKey("qdz_name")) 626 if(xxqdz.length() == 0 && m.containsKey("qdz_name"))
627 - xxqdz = m.get("qdz_name"); 627 + xxqdz = m.get("qdz_name")==null?"":m.get("qdz_name").toString();
628 } 628 }
629 } 629 }
630 if(upfcsj.size() != 0) 630 if(upfcsj.size() != 0)
@@ -1591,15 +1591,16 @@ public class ReportServiceImpl implements ReportService{ @@ -1591,15 +1591,16 @@ public class ReportServiceImpl implements ReportService{
1591 map.put("ssgl_other", culateService.culateSsMileXx(list, "其他")); 1591 map.put("ssgl_other", culateService.culateSsMileXx(list, "其他"));
1592 1592
1593 1593
1594 - double zrwjcclc=culateService.culateZrwJccLc(list, "");  
1595 - 1594 + double zrwjcclc=culateService.culateZrwJccLc(list, "故障");
  1595 + double zrwjcclc1=culateService.culateZrwJccLc(list, "肇事");
  1596 + double zrwjcclc2=culateService.culateZrwJccLc(list, "纠纷");
1596 map.put("zrwjcclc", zrwjcclc); 1597 map.put("zrwjcclc", zrwjcclc);
1597 - map.put("zrwjcclc1", 0);  
1598 - map.put("zrwjcclc2", 0);  
1599 - 1598 + map.put("zrwjcclc1", zrwjcclc1);
  1599 + map.put("zrwjcclc2", zrwjcclc2);
  1600 + double zrwjcc=Arith.add(Arith.add(zrwjcclc, zrwjcclc1), zrwjcclc2);
1600 double kfks=culateService.culateKfksLc(lists); 1601 double kfks=culateService.culateKfksLc(lists);
1601 map.put("kfks", kfks); 1602 map.put("kfks", kfks);
1602 - double zlc=Arith.add(Arith.add(Arith.add(zrwjcclc, ljlc), 1603 + double zlc=Arith.add(Arith.add(Arith.add(zrwjcc, ljlc),
1603 Arith.add(zjcclc, zyylc)),kfks); 1604 Arith.add(zjcclc, zyylc)),kfks);
1604 1605
1605 1606
src/main/java/com/bsth/service/sys/IntervalService.java 0 → 100644
  1 +package com.bsth.service.sys;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.entity.sys.Interval;
  7 +import com.bsth.service.BaseService;
  8 +
  9 +public interface IntervalService extends BaseService<Interval, Integer> {
  10 +
  11 + Map<String, Object> saveList(List<Interval> parseArray);
  12 +
  13 +}
src/main/java/com/bsth/service/sys/impl/IntervalServiceImpl.java 0 → 100644
  1 +package com.bsth.service.sys.impl;
  2 +
  3 +import java.util.HashMap;
  4 +import java.util.List;
  5 +import java.util.Map;
  6 +
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +
  12 +import com.bsth.common.ResponseCode;
  13 +import com.bsth.entity.sys.Interval;
  14 +import com.bsth.repository.sys.IntervalRepository;
  15 +import com.bsth.service.impl.BaseServiceImpl;
  16 +import com.bsth.service.sys.IntervalService;
  17 +
  18 +@Service
  19 +public class IntervalServiceImpl extends BaseServiceImpl<Interval, Integer> implements IntervalService {
  20 +
  21 + @Autowired
  22 + IntervalRepository intervalRepository;
  23 +
  24 + Logger logger = LoggerFactory.getLogger(this.getClass());
  25 +
  26 + @Override
  27 + public Map<String, Object> saveList(List<Interval> parseArray) {
  28 + Map<String, Object> map = new HashMap<>();
  29 + try{
  30 + intervalRepository.save(parseArray);
  31 + map.put("status", ResponseCode.SUCCESS);
  32 + }catch(Exception e){
  33 + map.put("status", ResponseCode.ERROR);
  34 + logger.error("", e);
  35 + }
  36 + return map;
  37 + }
  38 +
  39 +}
src/main/java/com/bsth/service/traffic/YgcBasicDataService.java
@@ -9,5 +9,13 @@ public interface YgcBasicDataService { @@ -9,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/interval/list.html 0 → 100644
  1 +<!-- <link href="/pages/base/line/css/animate.css" rel="stylesheet" type="text/css" />
  2 +<link href="/pages/base/line/css/tipso.css" rel="stylesheet" type="text/css" /> -->
  3 +<!-- 片段标题 START -->
  4 +<div class="page-head">
  5 + <div class="page-title">
  6 + <h1>大间隔信息</h1>
  7 + </div>
  8 +</div>
  9 +<!-- 片段标题 END -->
  10 +
  11 +<!-- 线路信息导航栏组件 START -->
  12 +<ul class="page-breadcrumb breadcrumb">
  13 + <li><a href="/pages/home.html" data-pjax>首页</a> <i class="fa fa-circle"></i></li>
  14 + <li><span class="active">基础信息</span> <i class="fa fa-circle"></i></li>
  15 + <li><span class="active">大间隔信息</span></li>
  16 +</ul>
  17 +<!-- 线路信息导航栏组件 END -->
  18 +
  19 +<div class="row">
  20 + <div class="col-md-12">
  21 + <div class="portlet light porttlet-fit bordered">
  22 + <div class="portlet-title">
  23 + <div class="tipso-animation">
  24 + </div>
  25 + <div class="caption">
  26 + <i class="fa fa-info-circle font-dark"></i>
  27 + <span class="caption-subject font-dark sbold uppercase">线路信息</span>
  28 + </div>
  29 + <div class="actions">
  30 + <div class="btn-group btn-group-devided" data-toggle="buttons">
  31 + <a class="btn btn-circle blue" href="add.html" data-pjax><i class="fa fa-plus"></i> 添加线路</a>
  32 + </div>
  33 + </div>
  34 + </div>
  35 + <div class="portlet-body">
  36 + <div class="table-container" style="margin-top: 10px">
  37 + <table class="table table-striped table-bordered table-hover table-checkable" id="datatable_line">
  38 + <thead>
  39 + <tr role="row" class="heading">
  40 + <th >#</th>
  41 + <th >序号</th>
  42 + <th >大间隔ID</th>
  43 + <th >大间隔等级</th>
  44 + <th >高峰间隔时间</th>
  45 + <th >低谷间隔时间</th>
  46 + <th >操作</th>
  47 + </tr>
  48 + <tr role="row" class="filter">
  49 + <td>#</td>
  50 + <td></td>
  51 + <td></td>
  52 + <td></td>
  53 + <td></td>
  54 + <td></td>
  55 + <td>
  56 + <button class="btn btn-sm green btn-outline filter-submit margin-bottom" >
  57 + <i class="fa fa-search"></i> 搜索
  58 + </button>
  59 +
  60 + <button class="btn btn-sm red btn-outline filter-cancel" id="notification-trigger">
  61 + <i class="fa fa-times"></i> 重置
  62 + </button>
  63 + </td>
  64 + </tr>
  65 + </thead>
  66 + <tbody></tbody>
  67 + </table>
  68 + <div style="text-align: right;">
  69 + <ul id="pagination" class="pagination"></ul>
  70 + </div>
  71 + </div>
  72 + </div>
  73 + </div>
  74 + </div>
  75 +</div>
  76 +<script type="text/html" id="line_list_temp">
  77 + {{each list as obj i }}
  78 + <tr>
  79 + <td style="vertical-align: middle;">
  80 + <input type="checkbox" class="group-checkable icheck" value="{{obj.name}}" id="{{obj.id}}" data-id="{{obj.id}}" data-lineName="{{obj.name}}">
  81 + </td>
  82 + <td style="vertical-align: middle;">
  83 + {{(list.page*10)+(i+1)}}
  84 + </td>
  85 + <td>
  86 + {{obj.lineCode}}
  87 + </td>
  88 + <td>
  89 + {{obj.name}}
  90 + </td>
  91 + <td>
  92 + {{if obj.nature == 'lj'}}
  93 + 路救
  94 + {{else if obj.nature == 'bc'}}
  95 + 备车
  96 + {{else if obj.nature == 'dbc'}}
  97 + 定班车
  98 + {{else if obj.nature == 'yxl'}}
  99 + 夜宵路
  100 + {{else if obj.nature == 'cgxl'}}
  101 + 常规线路
  102 + {{else if obj.nature == 'gjxl'}}
  103 + 过江线路
  104 + {{else if obj.nature == 'csbs'}}
  105 + 穿梭巴士
  106 + {{else if obj.nature == 'tyxl'}}
  107 + 特约线路
  108 + {{else if obj.nature == 'qt'}}
  109 + 其他
  110 + {{else if obj.nature == 'cctxl'}}
  111 + 村村通线路
  112 + {{/if}}
  113 + </td>
  114 + <td>
  115 + {{if obj.level == '1'}}
  116 + 一级线路
  117 + {{else if obj.level == '2'}}
  118 + 二级线路
  119 + {{else if obj.level == '0'}}
  120 + 未知等级
  121 + {{/if}}
  122 + </td>
  123 + <td>
  124 + {{obj.shanghaiLinecode}}
  125 + </td>
  126 + <td>
  127 + {{if obj.destroy == 1}}
  128 + <span style="font-weight: bold; color: red; padding: 5px; background-color: #FFE4E1; margin: 5px; font-size: 9px;border-radius: 4px;">撤销</span>
  129 + {{else if obj.destroy == 0}}
  130 + <span style="font-weight: bold; color: #07824e; padding: 5px; background-color: #FFE4E1; margin: 5px; font-size: 9px;border-radius: 4px;">运营</span>
  131 + {{/if}}
  132 + </td>
  133 + <td>
  134 + <a href="/pages/base/lineinformation/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>
  135 + </td>
  136 + <td>
  137 + <a href="/pages/base/stationroute/list.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 查看 </a>
  138 + </td>
  139 + <td>
  140 + <a href="details.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 详细 </a>
  141 + <a href="edit.html?no={{obj.id}}" class="btn default blue-stripe btn-sm" data-pjax> 修改 </a>
  142 + </td>
  143 + </tr>
  144 + {{/each}}
  145 + {{if list.length == 0}}
  146 + <tr>
  147 + <td colspan=13><h6 class="muted">没有找到相关数据</h6></td>
  148 + </tr>
  149 + {{/if}}
  150 +</script>
  151 +<!-- <script src="/pages/base/line/js/tipso.js"></script> -->
  152 +<!-- 线路信息片段JS模块 -->
  153 +<script src="/pages/base/line/js/line-list-table.js"></script>
0 \ No newline at end of file 154 \ No newline at end of file
src/main/resources/static/pages/base/timesmodel/js/base-fun.js
@@ -382,13 +382,14 @@ var BaseFun = function() { @@ -382,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) {
@@ -607,8 +610,10 @@ var BaseFun = function() { @@ -607,8 +610,10 @@ var BaseFun = function() {
607 // 判断是否在高峰时间范围.【true--表示在,false--表示不在】. 610 // 判断是否在高峰时间范围.【true--表示在,false--表示不在】.
608 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) {
609 if(order == 'asc') { 612 if(order == 'asc') {
610 - arr[a-1].isfb = isfb ? 1 : 0;  
611 - arr[a-1].STOPTIME = 0; 613 + if(a>0) {
  614 + arr[a-1].isfb = isfb ? 1 : 0;
  615 + arr[a-1].STOPTIME = 0;
  616 + }
612 }else if(order == 'desc') { 617 }else if(order == 'desc') {
613 var index_ = a + tcbcgzA[t].deletebcNum * 2; 618 var index_ = a + tcbcgzA[t].deletebcNum * 2;
614 arr[index_].STOPTIME = 0; 619 arr[index_].STOPTIME = 0;
@@ -637,6 +642,7 @@ var BaseFun = function() { @@ -637,6 +642,7 @@ var BaseFun = function() {
637 dgmaxtzsj = parseInt(map.dgmaxtzsj); 642 dgmaxtzsj = parseInt(map.dgmaxtzsj);
638 // 计算低谷最少配车数 (低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙. 643 // 计算低谷最少配车数 (低谷上行行驶时间 + 低谷下行行驶时间 + 低谷最大停站时间*2) / 低谷最大发车间隙.
639 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);
640 // var dgminpcs = 4; 646 // var dgminpcs = 4;
641 // 定义返回数组. 647 // 定义返回数组.
642 var rs = new Array(); 648 var rs = new Array();
@@ -711,12 +717,23 @@ var BaseFun = function() { @@ -711,12 +717,23 @@ var BaseFun = function() {
711 avgMakerCarNum = parseInt(avgMakerCarNum / bxlpbc.length); 717 avgMakerCarNum = parseInt(avgMakerCarNum / bxlpbc.length);
712 // console.log(bxlpbc); 718 // console.log(bxlpbc);
713 // 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班. 719 // 调整某班型下的各个路牌对应的班次以及工时、停站时间、是否分班.
714 - rs = rs.concat(baseF.abstractBcByWorkTime(bxlpbc , map , dataMap , saa , cara , bxrclist[x] , dgminpcs , avgMakerCarNum)); 720 + rs = rs.concat(baseF.abstractBcByWorkTime(bxlpbc , map , dataMap , saa , cara , bxrclist[x] , dgminpcs , avgMakerCarNum ,zwxeLpNum));
715 } 721 }
716 } 722 }
717 return rs; 723 return rs;
718 }, 724 },
719 725
  726 + cuontZwxeLpNum : function(list) {
  727 + var count = 0;
  728 + for(var c = 0 ; c<list.length;c++) {
  729 + if(list[c].type == '五工二休') {
  730 + count = list[c].fpcls;
  731 + break;
  732 + }
  733 + }
  734 + return count;
  735 + },
  736 +
720 /** 737 /**
721 * @description (TODO) 更新路牌数组的路牌名称. 738 * @description (TODO) 更新路牌数组的路牌名称.
722 * @param cara 路牌数组 739 * @param cara 路牌数组
@@ -778,17 +795,15 @@ var BaseFun = function() { @@ -778,17 +795,15 @@ var BaseFun = function() {
778 // 第一步 根据表单中的参数得到所有路牌下的班次数[从各路牌下的第一个班次发车时间 到 营运结束时间点并且是连续的班次数]. 795 // 第一步 根据表单中的参数得到所有路牌下的班次数[从各路牌下的第一个班次发车时间 到 营运结束时间点并且是连续的班次数].
779 var allLMapBc = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap); 796 var allLMapBc = baseF.GetByArgusInitAllLpDownedBcCollections(saa , cara , map , seMap , dataMap);
780 797
781 - // return {'json':jsonArray,'bxrcgs':null};  
782 -  
783 // 第二步 纵向调整 798 // 第二步 纵向调整
784 baseF.evenStartDepartSpace(allLMapBc , dataMap); 799 baseF.evenStartDepartSpace(allLMapBc , dataMap);
785 800
786 // 第三步 剔除首末班车以外的班次,并确认首末班车. 801 // 第三步 剔除首末班车以外的班次,并确认首末班车.
787 var markArray = baseF.markFirstAndLastBusAlsoDietNotInRangeBc(allLMapBc , dataMap); 802 var markArray = baseF.markFirstAndLastBusAlsoDietNotInRangeBc(allLMapBc , dataMap);
788 - 803 + // return {'json':markArray,'bxrcgs':null};
789 // 第四步 横向调整 804 // 第四步 横向调整
790 baseF.resizeByPitStopTime(cara , markArray , dataMap); 805 baseF.resizeByPitStopTime(cara , markArray , dataMap);
791 - 806 + // return {'json':markArray,'bxrcgs':null};
792 /** 807 /**
793 * 第五步 把班型合理的分配到各个路牌上. 808 * 第五步 把班型合理的分配到各个路牌上.
794 * 809 *
@@ -798,17 +813,13 @@ var BaseFun = function() { @@ -798,17 +813,13 @@ var BaseFun = function() {
798 */ 813 */
799 // 切割班型/人次/配车数 字符串 为 数组对象. 814 // 切割班型/人次/配车数 字符串 为 数组对象.
800 var list = baseF.getBxRcListCollection(map.bxrc); 815 var list = baseF.getBxRcListCollection(map.bxrc);
801 -  
802 // 把班型分配到对应的具体路牌上. 816 // 把班型分配到对应的具体路牌上.
803 baseF.bxAlloTotLp(list,cara); 817 baseF.bxAlloTotLp(list,cara);
804 -  
805 // 第六步 抽车来满足工时. 818 // 第六步 抽车来满足工时.
806 var tempA = baseF.abstractCar(list , markArray , cara , saa , dataMap , map); 819 var tempA = baseF.abstractCar(list , markArray , cara , saa , dataMap , map);
807 - 820 + // return {'json':tempA,'bxrcgs':null};
808 // 第七步 确定吃饭时间. 821 // 第七步 确定吃饭时间.
809 baseF.markeEatTime(list , tempA , cara , saa , dataMap ,map); 822 baseF.markeEatTime(list , tempA , cara , saa , dataMap ,map);
810 -  
811 -  
812 baseF.resizeByPitStopTime(cara , tempA , dataMap); 823 baseF.resizeByPitStopTime(cara , tempA , dataMap);
813 baseF.updfcno01(tempA,0); 824 baseF.updfcno01(tempA,0);
814 // return {'json':tempA,'bxrcgs':null}; 825 // return {'json':tempA,'bxrcgs':null};
@@ -838,7 +849,7 @@ var BaseFun = function() { @@ -838,7 +849,7 @@ var BaseFun = function() {
838 } 849 }
839 lpbcArray.sort(function(a,b){return a.fcint - b.fcint}); 850 lpbcArray.sort(function(a,b){return a.fcint - b.fcint});
840 baseF.isHaveBc(baseF.getDateTime('10:15') , baseF.getDateTime('12:15'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 0); 851 baseF.isHaveBc(baseF.getDateTime('10:15') , baseF.getDateTime('12:15'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 0);
841 - //baseF.isHaveBc(baseF.getDateTime('18:00') , baseF.getDateTime('19:00'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 1); 852 + baseF.isHaveBc(baseF.getDateTime('18:00') , baseF.getDateTime('19:00'),lpbcArray,cfddDm ,dataMap , cara[c] ,map, markArray, 1);
842 } 853 }
843 }, 854 },
844 855
@@ -1064,12 +1075,13 @@ var BaseFun = function() { @@ -1064,12 +1075,13 @@ var BaseFun = function() {
1064 var lLen = list.length , cLen = clzs.length; 1075 var lLen = list.length , cLen = clzs.length;
1065 if(lLen<= 0 || cLen<=0 ) 1076 if(lLen<= 0 || cLen<=0 )
1066 return false; 1077 return false;
1067 - // 最多车次与总车次的比例.  
1068 - var blnum = Math.round(cLen/list[0].fpcls); 1078 + list.sort(function(a,b){return a.fpcls-b.fpcls});
1069 // 定义已经分配出去的路牌. 1079 // 定义已经分配出去的路牌.
1070 var rs = new Array(); 1080 var rs = new Array();
1071 // 遍历 1081 // 遍历
1072 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);
1073 // 得到没有分配出去的路牌. 1085 // 得到没有分配出去的路牌.
1074 var dxa = baseF.chaji_array(clzs,rs); 1086 var dxa = baseF.chaji_array(clzs,rs);
1075 // 定义当前车次数. 1087 // 定义当前车次数.
@@ -1077,29 +1089,32 @@ var BaseFun = function() { @@ -1077,29 +1089,32 @@ var BaseFun = function() {
1077 // 定义记录当前分割路牌的次数下标.分配到班型车次下的路牌数组. 1089 // 定义记录当前分割路牌的次数下标.分配到班型车次下的路牌数组.
1078 var index = 0 , sslp = new Array(); 1090 var index = 0 , sslp = new Array();
1079 // 当前车次所有占比例. 1091 // 当前车次所有占比例.
1080 - var tempint = parseInt(rsnum/blnum); 1092 + //var tempint = parseInt(rsnum/blnum);
1081 // 判断如果比例小1 则为当前车次数. 1093 // 判断如果比例小1 则为当前车次数.
1082 - blnum = tempint <= 1 ? rsnum : blnum; 1094 + //blnum = tempint <= 1 ? rsnum : blnum;
1083 // 判断当前班型车次数组下标值.如果为倒数第二个或者之前. 1095 // 判断当前班型车次数组下标值.如果为倒数第二个或者之前.
1084 if(r < lLen-1) { 1096 if(r < lLen-1) {
1085 // 遍历 1097 // 遍历
1086 - for(var c = 0 ; c < tempint ; c++) { 1098 + for(var c = 0 ; c < rsnum ; c++) {
1087 // 创建新的没有分配出去的路牌数组. 1099 // 创建新的没有分配出去的路牌数组.
1088 var temp = dxa.concat(); 1100 var temp = dxa.concat();
1089 // 创建切割路牌数组. 1101 // 创建切割路牌数组.
1090 var tagA = new Array(); 1102 var tagA = new Array();
1091 // 判断切割的下标值是否小于等于路牌数组的倒数第二个或者之前. 1103 // 判断切割的下标值是否小于等于路牌数组的倒数第二个或者之前.
1092 if(index <= (dxa.length-blnum) ) { 1104 if(index <= (dxa.length-blnum) ) {
1093 - tagA = temp.splice(index,blnum); 1105 + /*tagA = temp.splice(index,blnum);*/
  1106 + tagA = temp.splice(index,1);
1094 }else { 1107 }else {
1095 - tagA = temp.splice((dxa.length-blnum),blnum); 1108 + /*tagA = temp.splice((dxa.length-blnum),blnum);*/
  1109 + tagA = temp.splice((dxa.length-blnum),1);
1096 } 1110 }
1097 // 组合切割路牌数组.赋值给已分配出去的路牌. 1111 // 组合切割路牌数组.赋值给已分配出去的路牌.
1098 rs = rs.concat(tagA); 1112 rs = rs.concat(tagA);
1099 // 赋值给分配到班型车次下的路牌数组. 1113 // 赋值给分配到班型车次下的路牌数组.
1100 sslp = sslp.concat(tagA); 1114 sslp = sslp.concat(tagA);
1101 // 记录切割下标. 1115 // 记录切割下标.
1102 - index = index + 1 + blnum; 1116 + index = index + blnum;
  1117 + // index = index + blnum;
1103 } 1118 }
1104 // 分配到班型车次下的路牌数组. 1119 // 分配到班型车次下的路牌数组.
1105 list[r].sslp = sslp; 1120 list[r].sslp = sslp;
@@ -1302,10 +1317,10 @@ var BaseFun = function() { @@ -1302,10 +1317,10 @@ var BaseFun = function() {
1302 var sgbcfcsj = baseF.getDateTime(sslpbcA[r+1].fcsj), 1317 var sgbcfcsj = baseF.getDateTime(sslpbcA[r+1].fcsj),
1303 dqbcddsj = baseF.getDateTime(sslpbcA[r].ARRIVALTIME), 1318 dqbcddsj = baseF.getDateTime(sslpbcA[r].ARRIVALTIME),
1304 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
1305 // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.) 1322 // 定义每每相邻两个班次之间的时间差分钟数(也就是停站时间.)
1306 var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000); 1323 var dxmin = parseInt( (sgbcfcsj - dqbcddsj)/60000);
1307 - // 定义当前班次方向下标代码[0代表上行;1代表下行].  
1308 - var cctag = baseF.dirDmToIndex(sslpbcA[r].xlDir);  
1309 // 定义是否高峰 1324 // 定义是否高峰
1310 var flag = baseF.isPeakTimeScope(dqbcfcsj , dataMap); 1325 var flag = baseF.isPeakTimeScope(dqbcfcsj , dataMap);
1311 // 获取行驶时间. 1326 // 获取行驶时间.
@@ -1348,22 +1363,41 @@ var BaseFun = function() { @@ -1348,22 +1363,41 @@ var BaseFun = function() {
1348 } 1363 }
1349 } 1364 }
1350 if(flag) { 1365 if(flag) {
1351 - // 修改当前班次的停站时间.  
1352 - sslpbcA[r].STOPTIME = parseInt(dxmin) ;  
1353 - // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.  
1354 - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);  
1355 - // 修改下一个班次的发车时间.  
1356 - sslpbcA[r+1].fcsj = baseF.getTimeStr(dqbcddsj);  
1357 - // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.  
1358 - dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);  
1359 - // 修改下一个班次的到达时间.  
1360 - sslpbcA[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj); 1366 + if(!baseF.isDirSmbc(baseF.dirDmToIndex(sslpbcA[r+1].xlDir) , sslpbcA[r+1].fcsj , dataMap)) {
  1367 + // 修改当前班次的停站时间.
  1368 + sslpbcA[r].STOPTIME = parseInt(dxmin) ;
  1369 + // 当前班次的到达时间 + 停站时间 作为下一个班次的发车时间.
  1370 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + dxmin);
  1371 + // 修改下一个班次的发车时间.
  1372 + sslpbcA[r+1].fcsj = baseF.getTimeStr(dqbcddsj);
  1373 + // 下一个班次的发车时间 + 行驶时间 作为下一个班次的到达时间.
  1374 + dqbcddsj.setMinutes(dqbcddsj.getMinutes() + sslpbcA[r+1].bcsj);
  1375 + // 修改下一个班次的到达时间.
  1376 + sslpbcA[r+1].ARRIVALTIME = baseF.getTimeStr(dqbcddsj);
  1377 + }else {
  1378 + if(r>0) {
  1379 + // 修改当前班次的停站时间.
  1380 + sslpbcA[r].STOPTIME = parseInt(dxmin) ;
  1381 + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].STOPTIME);
  1382 + sslpbcA[r].ARRIVALTIME = baseF.getTimeStr(sgbcfcsj);
  1383 + sgbcfcsj.setMinutes(sgbcfcsj.getMinutes() - sslpbcA[r].bcsj);
  1384 + sslpbcA[r].fcsj = baseF.getTimeStr(sgbcfcsj);
  1385 + sslpbcA[r-1].STOPTIME = parseInt( ( sgbcfcsj - baseF.getDateTime(sslpbcA[r-1].ARRIVALTIME))/60000);
  1386 + }
  1387 + }
1361 } 1388 }
1362 } 1389 }
1363 } 1390 }
1364 } 1391 }
1365 }, 1392 },
1366 1393
  1394 + isDirSmbc : function(dirDm , fcsj , dataMap) {
  1395 + var falg = false;
  1396 + if(fcsj == dataMap.smbcsjArr[dirDm].kssj || fcsj == dataMap.smbcsjArr[dirDm].jssj)
  1397 + falg = true;
  1398 + return falg;
  1399 + },
  1400 +
1367 BXPplaceClassesTime01 : function(saa,cara,map,seMap,dataMap,lpNoA) { 1401 BXPplaceClassesTime01 : function(saa,cara,map,seMap,dataMap,lpNoA) {
1368 var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap); 1402 var jsonArray = baseF.plgfbc(saa,cara,map,seMap,dataMap);
1369 var list = baseF.splitBxRc(map.bxrc); 1403 var list = baseF.splitBxRc(map.bxrc);
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/js/outboundmap-load.js
@@ -8,7 +8,6 @@ $(function(){ @@ -8,7 +8,6 @@ $(function(){
8 8
9 // 获取参数线路ID 9 // 获取参数线路ID
10 var no = $.url().param('no'); 10 var no = $.url().param('no');
11 - var up = $.url().param('up');  
12 var paramArr = new Array(); 11 var paramArr = new Array();
13 paramArr = no.split(",");// 在每个逗号(,)处进行分解。 12 paramArr = no.split(",");// 在每个逗号(,)处进行分解。
14 /*paramArr[0]:id 13 /*paramArr[0]:id
src/main/resources/static/pages/excep/js/speeding-map.js 0 → 100644
  1 +/**
  2 + * 百度地图
  3 + *
  4 + * - - - - - -》init:地图初始化
  5 + *
  6 + * - - - - - -》lineInfoPanl:从百度地图抓去站点与路段数据
  7 + *
  8 + * - - - - - -》getDistanceAndDuration:获取距离与时间
  9 + *
  10 + * - - - - - -》pointsPolygon:地图画多边行
  11 + *
  12 + * - - - - - -》pointsCircle:画圆
  13 + *
  14 + * - - - - - -》localSearchFromAdreesToPoint:根据地理名称获取百度经纬度坐标
  15 + *
  16 + * - - - - - -》drawingUpline:在地图上画出上行线路走向
  17 + *
  18 + * - - - - - -》stationsNameToPoints:站点名称获取百度坐标(手动规划)
  19 + *
  20 + * - - - - - -》getDistanceAndTotime:根据坐标点获取两点之间的时间与距离(手动规划)
  21 + *
  22 + * - - - - - -》getSectionListPlonly:根据坐标点获取两点之间的折线路段(手动规划)
  23 + */
  24 +
  25 +var SpeedingMap = function () {
  26 +
  27 + /** WorldsBMap 全局变量定义 mapBValue:地图对象;polygon:多边形;polyUpline:走向折线;circle:圆 *//*
  28 + var mapBValue = '';polygon='',polyUpline='',circle='',iseditStatus = false;*/
  29 +
  30 + var Bmap = {
  31 +
  32 + init : function() {
  33 + // 设置中心点,
  34 + var CENTER_POINT = {lng : 121.528733,lat : 31.237425};
  35 +
  36 + // 百度API Key
  37 + var bdKey = 'IGGrr4UjwIYzatoCRFKEL8sT';
  38 +
  39 + // 初始化百度地图
  40 + mapBValue = new BMap.Map("speedingMap");
  41 +
  42 + //中心点和缩放级别
  43 + mapBValue.centerAndZoom(new BMap.Point(CENTER_POINT.lng,CENTER_POINT.lat), 15);
  44 +
  45 + //启用地图拖拽事件,默认启用(可不写)
  46 + mapBValue.enableDragging();
  47 +
  48 + //启用地图滚轮放大缩小
  49 + mapBValue.enableScrollWheelZoom();
  50 +
  51 + //禁用鼠标双击放大
  52 + mapBValue.disableDoubleClickZoom();
  53 +
  54 + //启用键盘上下左右键移动地图
  55 + mapBValue.enableKeyboard();
  56 +
  57 + return mapBValue;
  58 + },
  59 +
  60 + /** 获取地图对象 @return 地图对象map */
  61 + getmapBValue : function() {
  62 +
  63 + return mapBValue;
  64 +
  65 + },
  66 +
  67 + /* drawTravelRoute:function(data){
  68 + var driving = Bmap.DrivingRoute(map, {renderOptions:{map: map}})
  69 +
  70 + }*/
  71 +
  72 + }
  73 +
  74 + return Bmap;
  75 +
  76 +}();
0 \ No newline at end of file 77 \ No newline at end of file
src/main/resources/static/pages/excep/speedingListmh.html
@@ -146,7 +146,10 @@ @@ -146,7 +146,10 @@
146 {{(obj.endtimestamp-obj.timestamp)/1000}}秒 146 {{(obj.endtimestamp-obj.timestamp)/1000}}秒
147 </td> 147 </td>
148 <td> 148 <td>
149 - <a class="btn default blue-stripe btn-sm lookTrajectory" data-pjax> 149 + <a class="btn default blue-stripe btn-sm lookTrajectory" data-vehicle ="{{obj.vehicle}}"
  150 + data-startdate="{{obj.timestampDate}}" data-enddate="{{obj.endtimestampDate}}"
  151 + data-lon="{{obj.lon}}" data-lat="{{obj.lat}}"
  152 + data-endlon="{{obj.endlon}}" data-endlat="{{obj.endlat}}" >
150 查看轨迹 153 查看轨迹
151 </a> 154 </a>
152 </td> 155 </td>
@@ -162,6 +165,8 @@ @@ -162,6 +165,8 @@
162 {{/if}} 165 {{/if}}
163 </script> 166 </script>
164 167
  168 +<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
  169 +
165 <script> 170 <script>
166 $(function(){ 171 $(function(){
167 var page = 0, initPagination; 172 var page = 0, initPagination;
@@ -185,7 +190,20 @@ $(function(){ @@ -185,7 +190,20 @@ $(function(){
185 var parameter = new Object(); 190 var parameter = new Object();
186 parameter.endDate = $("input[name='endDate']")[0].value; 191 parameter.endDate = $("input[name='endDate']")[0].value;
187 parameter.startDate = $("input[name='startDate']")[0].value; 192 parameter.startDate = $("input[name='startDate']")[0].value;
188 - jsDoQuery(parameter,true); 193 +
  194 + //搜索线路
  195 + $.get('/basic/lineCode2Name',function(result){
  196 + var data=[];
  197 + data.push({id: " ", text: "全部线路"});
  198 + for(var code in result){
  199 + data.push({id: code, text: result[code]});
  200 + }
  201 + initPinYinSelect2($('#line'),data,function(ldmcSelector) {
  202 + ldmcSelector.select2("val",data[1].id);//因为数据量太大,所以默认一条线路作为查询参数
  203 + });
  204 + parameter.line = data[1].id;
  205 + jsDoQuery(parameter,true);
  206 + });
189 207
190 //时间戳转换为年月日 208 //时间戳转换为年月日
191 function timeToData(time){ 209 function timeToData(time){
@@ -223,7 +241,7 @@ $(function(){ @@ -223,7 +241,7 @@ $(function(){
223 /* 241 /*
224 * 获取数据 p: 要提交的参数, pagination: 是否重新分页 242 * 获取数据 p: 要提交的参数, pagination: 是否重新分页
225 */ 243 */
226 - function jsDoQuery(p, pagination){ 244 + function jsDoQuery(p, pagination){
227 var params = {}; 245 var params = {};
228 if(p) 246 if(p)
229 params = p; 247 params = p;
@@ -243,7 +261,27 @@ $(function(){ @@ -243,7 +261,27 @@ $(function(){
243 } 261 }
244 layer.close(i); 262 layer.close(i);
245 $(".lookTrajectory").click(function(){ 263 $(".lookTrajectory").click(function(){
246 - layer.alert("暂未开放此功能!"); 264 + var vehicle = $(this).data('vehicle');
  265 + var startDate = $(this).data('startdate');
  266 + var endDate = $(this).data('enddate');
  267 + var lon = $(this).data('lon');
  268 + var lat = $(this).data('lat');
  269 + var endLon = $(this).data('endlon');
  270 + var endLat = $(this).data('endlat');
  271 + var storage = window.localStorage;
  272 + storage.setItem("zbhAndDate",vehicle+","+startDate+","+endDate+","+lon+","+lat+","+endLon+","+endLat);
  273 + $.get('/pages/excep/speedingMap.html?',function (result) {
  274 + layer.open({
  275 + type: 1,
  276 + title:'<i class="uk-icon-play-circle"></i>轨迹回放',
  277 + shadeClose: true,
  278 + shade: true,
  279 + scrollbar: false,
  280 + maxmin: false, //开启最大化最小化按钮
  281 + area: ['100%', '100%'],
  282 + content:result,//内容
  283 + });
  284 + });
247 }) 285 })
248 }); 286 });
249 } 287 }
@@ -307,17 +345,6 @@ $(function(){ @@ -307,17 +345,6 @@ $(function(){
307 $('tr.filter .filter-submit').click(); 345 $('tr.filter .filter-submit').click();
308 }); 346 });
309 }); 347 });
310 -  
311 - //搜索线路  
312 - $.get('/basic/lineCode2Name',function(result){  
313 - var data=[];  
314 - data.push({id: " ", text: "全部线路"});  
315 - for(var code in result){  
316 - data.push({id: code, text: result[code]});  
317 - }  
318 - initPinYinSelect2('#line',data,'');  
319 -  
320 - });  
321 348
322 $("#line").on("change",initXl); 349 $("#line").on("change",initXl);
323 function initXl(){ 350 function initXl(){
@@ -334,6 +361,7 @@ $(&#39;#nbbm&#39;).select2({ @@ -334,6 +361,7 @@ $(&#39;#nbbm&#39;).select2({
334 xlbm:$('#line').val()}; 361 xlbm:$('#line').val()};
335 }, 362 },
336 processResults: function (data) { 363 processResults: function (data) {
  364 + console.log(data);
337 return { 365 return {
338 results: data 366 results: data
339 }; 367 };
@@ -370,7 +398,6 @@ $(&#39;#nbbm&#39;).select2({ @@ -370,7 +398,6 @@ $(&#39;#nbbm&#39;).select2({
370 398
371 //改变状态 399 //改变状态
372 function changeEnabled(id,enabled){ 400 function changeEnabled(id,enabled){
373 - debugger  
374 $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){ 401 $get('/user/changeEnabled',{id:id,enabled:enabled},function(result){
375 jsDoQuery(null, true); 402 jsDoQuery(null, true);
376 }) 403 })
src/main/resources/static/pages/excep/speedingMap.html 0 → 100644
  1 +<style>
  2 + .play_back-layer .layui-layer-title{
  3 + height: 36px;
  4 + border-bottom: none;
  5 + }
  6 +</style>
  7 +
  8 +<div id="titleMap">
  9 +<button id="run" style="margin-left:10px" class="btn btn-sm green btn-outline filter-submit margin-bottom">运行</button>
  10 +</div>
  11 +<div id="speedingMap">
  12 +</div>
  13 +<style type="text/css">
  14 +
  15 +#speedingMap{
  16 + width: 100%;
  17 + border: 2px solid #fdfdfd;
  18 + height: calc(100% - 30px);
  19 + overflow: hidden;
  20 +}
  21 +</style>
  22 +<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=IGGrr4UjwIYzatoCRFKEL8sT"></script>
  23 +<script type="text/javascript" src="/pages/excep/js/speeding-map.js"></script>
  24 +<script type="text/javascript">
  25 +$(function(){
  26 + var dataArr = window.localStorage.zbhAndDate.split(",");//获取页面传递过来的车辆自编号以及超速起始时间和超速结束时间
  27 + var vehicle = dataArr[0];
  28 + var startdate = dataArr[1];
  29 + var enddate = dataArr[2];
  30 + var lon = dataArr[3];//起点经度
  31 + var lat = dataArr[4];//起点纬度
  32 + var endLon = dataArr[5];//终点经度
  33 + var endLat = dataArr[6];//终点纬度
  34 + var Points = [];
  35 + $.ajax({
  36 + type: "GET",
  37 + async:false,
  38 + url: '/gps/findPosition',
  39 + data: {vehicle:vehicle,startdate:startdate,enddate:enddate},
  40 + success: function(data){
  41 + console.log("123"+data);
  42 + $.each(data,function(i,item){
  43 + console.log(item);
  44 + if(item.lon>1 && item.lat>1){
  45 + var point = new BMap.Point(item.lon,item.lat);
  46 + Points.push(point);
  47 + }
  48 + });
  49 + }
  50 + });
  51 + setTimeout(function(){
  52 + var map = SpeedingMap.init();//创建地图
  53 + var myP1 = new BMap.Point(lon,lat); //起点
  54 + var myP2 = new BMap.Point(endLon,endLat); //终点
  55 + map.centerAndZoom(myP1,18);//地图中心点坐标
  56 + console.log(Points);
  57 + var polyline = new BMap.Polyline(Points, {strokeColor:"blue", strokeWeight:5, strokeOpacity:0.5}); //创建折线
  58 + var myIcon = new BMap.Icon("/pages/excep/img/bus.png", new BMap.Size(32, 70), {//小车图片
  59 + imageOffset: new BMap.Size(5,20) //图片的偏移量。为了是图片底部中心对准坐标点。
  60 + });
  61 + $(document).on('click', '#run', function() {
  62 + map.clearOverlays();//清空上一次的轨迹
  63 + map.addOverlay(polyline);//增加折线
  64 + var paths = Points.length;//获得有几个点
  65 + var carMk = new BMap.Marker(Points[0],{icon:myIcon});
  66 + map.addOverlay(carMk);
  67 + i=0;
  68 + function resetMkPoint(i){
  69 + carMk.setPosition(Points[i]);
  70 + if(i < paths){
  71 + setTimeout(function(){
  72 + i++;
  73 + resetMkPoint(i);
  74 + },100);
  75 + }
  76 + }
  77 + setTimeout(function(){
  78 + resetMkPoint(0);
  79 + },100)
  80 + });
  81 + });
  82 +}, 100);
  83 +</script>
  84 +
  85 +
src/main/resources/static/pages/forms/statement/account.html
@@ -86,7 +86,7 @@ @@ -86,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
@@ -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();