Commit 742d7ab017b18639b11f0fd7fb72498e1ea995a5

Authored by 潘钊
2 parents 0817c9a6 49257b4c

Merge branch 'minhang' into qingpu

Showing 28 changed files with 1265 additions and 295 deletions

Too many changes to show.

To preserve performance only 28 of 89 files are displayed.

src/main/java/com/bsth/controller/realcontrol/LineConfigController.java
1 package com.bsth.controller.realcontrol; 1 package com.bsth.controller.realcontrol;
2 2
3 -import java.util.Map;  
4 -  
5 -import org.springframework.beans.factory.annotation.Autowired;  
6 -import org.springframework.web.bind.annotation.PathVariable;  
7 -import org.springframework.web.bind.annotation.RequestMapping;  
8 -import org.springframework.web.bind.annotation.RequestMethod;  
9 -import org.springframework.web.bind.annotation.RequestParam;  
10 -import org.springframework.web.bind.annotation.RestController;  
11 -  
12 import com.bsth.controller.BaseController; 3 import com.bsth.controller.BaseController;
13 import com.bsth.entity.realcontrol.LineConfig; 4 import com.bsth.entity.realcontrol.LineConfig;
14 import com.bsth.service.realcontrol.LineConfigService; 5 import com.bsth.service.realcontrol.LineConfigService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.*;
  8 +
  9 +import java.util.Map;
15 10
16 @RestController 11 @RestController
17 @RequestMapping("/lineConfig") 12 @RequestMapping("/lineConfig")
@@ -39,4 +34,9 @@ public class LineConfigController extends BaseController<LineConfig, Integer>{ @@ -39,4 +34,9 @@ public class LineConfigController extends BaseController<LineConfig, Integer>{
39 public Map<String, Object> editOutTimeType(@RequestParam String lineCode, @RequestParam int type){ 34 public Map<String, Object> editOutTimeType(@RequestParam String lineCode, @RequestParam int type){
40 return lineConfigService.editOutTimeType(lineCode, type); 35 return lineConfigService.editOutTimeType(lineCode, type);
41 } 36 }
  37 +
  38 + @RequestMapping(value = "/getByLineCode")
  39 + public LineConfig getByLineCode(@RequestParam String lineCode){
  40 + return lineConfigService.getByLineCode(lineCode);
  41 + }
42 } 42 }
src/main/java/com/bsth/controller/realcontrol/RealMapController.java 0 → 100644
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.bsth.service.realcontrol.RealMapService;
  4 +import org.springframework.beans.factory.annotation.Autowired;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RequestParam;
  7 +import org.springframework.web.bind.annotation.RestController;
  8 +
  9 +import java.util.Map;
  10 +
  11 +/**
  12 + * 线调 地图监控相关
  13 + * Created by panzhao on 2016/11/23.
  14 + */
  15 +@RestController
  16 +@RequestMapping("realMap")
  17 +public class RealMapController {
  18 +
  19 + @Autowired
  20 + RealMapService realMapService;
  21 +
  22 + /**
  23 + * 根据线路获取站点路由及空间数据
  24 + */
  25 + @RequestMapping(value = "/stationSpatialData")
  26 + public Map<String, Object> stationSpatialData(@RequestParam String idx){
  27 + return realMapService.stationSpatialData(idx);
  28 + }
  29 +
  30 + /**
  31 + * 停车场
  32 + * @return
  33 + */
  34 + @RequestMapping(value = "/carParkSpatialData")
  35 + public Map<String, Object> carParkSpatialData(){
  36 + return realMapService.carParkSpatialData();
  37 + }
  38 +}
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
1 package com.bsth.controller.realcontrol; 1 package com.bsth.controller.realcontrol;
2 2
3 -import java.io.UnsupportedEncodingException;  
4 -import java.net.URLDecoder;  
5 -import java.util.*;  
6 -  
7 -import org.apache.commons.lang3.StringEscapeUtils;  
8 -import org.drools.core.runtime.help.impl.XStreamJSon.JSonAbortWorkItemConverter;  
9 -import org.joda.time.format.DateTimeFormat;  
10 -import org.joda.time.format.DateTimeFormatter;  
11 -import org.springframework.beans.factory.annotation.Autowired;  
12 -import org.springframework.web.bind.annotation.PathVariable;  
13 -import org.springframework.web.bind.annotation.RequestMapping;  
14 -import org.springframework.web.bind.annotation.RequestMethod;  
15 -import org.springframework.web.bind.annotation.RequestParam;  
16 -import org.springframework.web.bind.annotation.RestController;  
17 -  
18 -import com.alibaba.fastjson.JSON;  
19 import com.alibaba.fastjson.JSONArray; 3 import com.alibaba.fastjson.JSONArray;
20 import com.bsth.controller.BaseController; 4 import com.bsth.controller.BaseController;
21 import com.bsth.controller.realcontrol.dto.ChangePersonCar; 5 import com.bsth.controller.realcontrol.dto.ChangePersonCar;
@@ -23,9 +7,14 @@ import com.bsth.controller.realcontrol.dto.DfsjChange; @@ -23,9 +7,14 @@ import com.bsth.controller.realcontrol.dto.DfsjChange;
23 import com.bsth.data.BasicData; 7 import com.bsth.data.BasicData;
24 import com.bsth.data.schedule.DayOfSchedule; 8 import com.bsth.data.schedule.DayOfSchedule;
25 import com.bsth.entity.realcontrol.ScheduleRealInfo; 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
26 -import com.bsth.security.util.SecurityUtils;  
27 import com.bsth.service.realcontrol.ScheduleRealInfoService; 10 import com.bsth.service.realcontrol.ScheduleRealInfoService;
28 -import com.google.common.base.Splitter; 11 +import org.apache.commons.lang3.StringEscapeUtils;
  12 +import org.joda.time.format.DateTimeFormat;
  13 +import org.joda.time.format.DateTimeFormatter;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.web.bind.annotation.*;
  16 +
  17 +import java.util.*;
29 18
30 @RestController 19 @RestController
31 @RequestMapping("/realSchedule") 20 @RequestMapping("/realSchedule")
src/main/java/com/bsth/controller/realcontrol/dto/StationSpatialData.java 0 → 100644
  1 +package com.bsth.controller.realcontrol.dto;
  2 +
  3 +/**
  4 + * Created by panzhao on 2016/11/23.
  5 + */
  6 +public class StationSpatialData {
  7 +
  8 + private String lineCode;
  9 +
  10 + private String stationName;
  11 +
  12 + private String stationCode;
  13 +
  14 + private String stationMark;
  15 +
  16 + private int directions;
  17 +
  18 + private Float distances;
  19 +
  20 + private Float toTime;
  21 +
  22 + private Integer versions;
  23 +
  24 + private Float gLonx;
  25 +
  26 + private Float gLaty;
  27 +
  28 + private Float radius;
  29 +
  30 + private String shapesType;
  31 +
  32 + private String gPolygonGrid;
  33 +
  34 + private Integer stationRouteCode;
  35 +
  36 + public String getLineCode() {
  37 + return lineCode;
  38 + }
  39 +
  40 + public void setLineCode(String lineCode) {
  41 + this.lineCode = lineCode;
  42 + }
  43 +
  44 + public String getStationName() {
  45 + return stationName;
  46 + }
  47 +
  48 + public void setStationName(String stationName) {
  49 + this.stationName = stationName;
  50 + }
  51 +
  52 + public String getStationCode() {
  53 + return stationCode;
  54 + }
  55 +
  56 + public void setStationCode(String stationCode) {
  57 + this.stationCode = stationCode;
  58 + }
  59 +
  60 + public String getStationMark() {
  61 + return stationMark;
  62 + }
  63 +
  64 + public void setStationMark(String stationMark) {
  65 + this.stationMark = stationMark;
  66 + }
  67 +
  68 + public int getDirections() {
  69 + return directions;
  70 + }
  71 +
  72 + public void setDirections(int directions) {
  73 + this.directions = directions;
  74 + }
  75 +
  76 + public Float getDistances() {
  77 + return distances;
  78 + }
  79 +
  80 + public void setDistances(Float distances) {
  81 + this.distances = distances;
  82 + }
  83 +
  84 + public Float getToTime() {
  85 + return toTime;
  86 + }
  87 +
  88 + public void setToTime(Float toTime) {
  89 + this.toTime = toTime;
  90 + }
  91 +
  92 + public Integer getVersions() {
  93 + return versions;
  94 + }
  95 +
  96 + public void setVersions(Integer versions) {
  97 + this.versions = versions;
  98 + }
  99 +
  100 + public Float getgLonx() {
  101 + return gLonx;
  102 + }
  103 +
  104 + public void setgLonx(Float gLonx) {
  105 + this.gLonx = gLonx;
  106 + }
  107 +
  108 + public Float getgLaty() {
  109 + return gLaty;
  110 + }
  111 +
  112 + public void setgLaty(Float gLaty) {
  113 + this.gLaty = gLaty;
  114 + }
  115 +
  116 + public Float getRadius() {
  117 + return radius;
  118 + }
  119 +
  120 + public void setRadius(Float radius) {
  121 + this.radius = radius;
  122 + }
  123 +
  124 + public String getShapesType() {
  125 + return shapesType;
  126 + }
  127 +
  128 + public void setShapesType(String shapesType) {
  129 + this.shapesType = shapesType;
  130 + }
  131 +
  132 + public String getgPolygonGrid() {
  133 + return gPolygonGrid;
  134 + }
  135 +
  136 + public void setgPolygonGrid(String gPolygonGrid) {
  137 + this.gPolygonGrid = gPolygonGrid;
  138 + }
  139 +
  140 + public Integer getStationRouteCode() {
  141 + return stationRouteCode;
  142 + }
  143 +
  144 + public void setStationRouteCode(Integer stationRouteCode) {
  145 + this.stationRouteCode = stationRouteCode;
  146 + }
  147 +}
src/main/java/com/bsth/controller/report/ReportController.java
@@ -48,5 +48,25 @@ public class ReportController { @@ -48,5 +48,25 @@ public class ReportController {
48 @RequestParam String code) { 48 @RequestParam String code) {
49 return service.historyMessageCount(line, date, code); 49 return service.historyMessageCount(line, date, code);
50 } 50 }
  51 +
  52 + @RequestMapping(value = "/tbodyTime1", method = RequestMethod.GET)
  53 + public Map<String, Object> tbodyTime1(@RequestParam String line,@RequestParam String date) {
  54 + return service.tbodyTime1(line, date);
  55 + }
  56 +
  57 + @RequestMapping(value = "/tbodyTime2", method = RequestMethod.GET)
  58 + public Map<String, Object> tbodyTime2(@RequestParam String line,@RequestParam String date) {
  59 + return service.tbodyTime2(line, date);
  60 + }
  61 +
  62 + @RequestMapping(value = "/tbodyTime3", method = RequestMethod.GET)
  63 + public List<Map<String, Object>> tbodyTime3(@RequestParam String line,@RequestParam String date) {
  64 + return service.tbodyTime3(line, date);
  65 + }
  66 +
  67 + @RequestMapping(value = "/tbodyTime5", method = RequestMethod.GET)
  68 + public List<Map<String, Object>> tbodyTime5(@RequestParam String line,@RequestParam String date) {
  69 + return service.tbodyTime5(line, date);
  70 + }
51 71
52 } 72 }
src/main/java/com/bsth/controller/schedule/TrafficManageController.java
@@ -3,25 +3,24 @@ package com.bsth.controller.schedule; @@ -3,25 +3,24 @@ package com.bsth.controller.schedule;
3 import com.bsth.service.TrafficManageService; 3 import com.bsth.service.TrafficManageService;
4 4
5 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
6 -import org.springframework.web.bind.annotation.PathVariable;  
7 import org.springframework.web.bind.annotation.RequestMapping; 6 import org.springframework.web.bind.annotation.RequestMapping;
8 import org.springframework.web.bind.annotation.RequestMethod; 7 import org.springframework.web.bind.annotation.RequestMethod;
9 import org.springframework.web.bind.annotation.RequestParam; 8 import org.springframework.web.bind.annotation.RequestParam;
10 import org.springframework.web.bind.annotation.RestController; 9 import org.springframework.web.bind.annotation.RestController;
11 10
12 /** 11 /**
13 - * 12 + *
14 * @author BSTH 13 * @author BSTH
15 * 14 *
16 */ 15 */
17 @RestController 16 @RestController
18 @RequestMapping("trmg") 17 @RequestMapping("trmg")
19 public class TrafficManageController { 18 public class TrafficManageController {
20 - 19 +
21 @Autowired 20 @Autowired
22 - private TrafficManageService trManageService;  
23 -  
24 - 21 + private TrafficManageService trManageService;
  22 +
  23 +
25 @RequestMapping(value = "/setXL", method = RequestMethod.GET) 24 @RequestMapping(value = "/setXL", method = RequestMethod.GET)
26 public String setXL() throws Exception { 25 public String setXL() throws Exception {
27 try { 26 try {
@@ -30,7 +29,7 @@ public class TrafficManageController { @@ -30,7 +29,7 @@ public class TrafficManageController {
30 throw new Exception(exp.getCause()); 29 throw new Exception(exp.getCause());
31 } 30 }
32 } 31 }
33 - 32 +
34 @RequestMapping(value = "/setCL", method = RequestMethod.GET) 33 @RequestMapping(value = "/setCL", method = RequestMethod.GET)
35 public String setCL() throws Exception { 34 public String setCL() throws Exception {
36 try { 35 try {
@@ -39,7 +38,7 @@ public class TrafficManageController { @@ -39,7 +38,7 @@ public class TrafficManageController {
39 throw new Exception(exp.getCause()); 38 throw new Exception(exp.getCause());
40 } 39 }
41 } 40 }
42 - 41 +
43 @RequestMapping(value = "/setSJ", method = RequestMethod.GET) 42 @RequestMapping(value = "/setSJ", method = RequestMethod.GET)
44 public String setSJ() throws Exception { 43 public String setSJ() throws Exception {
45 try { 44 try {
@@ -48,16 +47,43 @@ public class TrafficManageController { @@ -48,16 +47,43 @@ public class TrafficManageController {
48 throw new Exception(exp.getCause()); 47 throw new Exception(exp.getCause());
49 } 48 }
50 } 49 }
51 -  
52 - @RequestMapping(value = "/setCS", method = RequestMethod.GET)  
53 - public String setCS() throws Exception { 50 +
  51 + @RequestMapping(value = "/setLD", method = RequestMethod.GET)
  52 + public String setLD() throws Exception {
54 try { 53 try {
55 - return trManageService.setCS(); 54 + return trManageService.setLD();
  55 + } catch (Exception exp) {
  56 + throw new Exception(exp.getCause());
  57 + }
  58 + }
  59 +
  60 + @RequestMapping(value = "/setLCYH", method = RequestMethod.GET)
  61 + public String setLCYH() throws Exception {
  62 + try {
  63 + return trManageService.setLCYH();
  64 + } catch (Exception exp) {
  65 + throw new Exception(exp.getCause());
  66 + }
  67 + }
  68 +
  69 + @RequestMapping(value = "/setDDRB", method = RequestMethod.GET)
  70 + public String setDDRB() throws Exception {
  71 + try {
  72 + return trManageService.setDDRB();
56 } catch (Exception exp) { 73 } catch (Exception exp) {
57 throw new Exception(exp.getCause()); 74 throw new Exception(exp.getCause());
58 } 75 }
59 } 76 }
60 - 77 +
  78 + @RequestMapping(value = "/setJHBC", method = RequestMethod.GET)
  79 + public String setJHBC() throws Exception {
  80 + try {
  81 + return trManageService.setJHBC();
  82 + } catch (Exception exp) {
  83 + throw new Exception(exp.getCause());
  84 + }
  85 + }
  86 +
61 @RequestMapping(value = "/setSKB", method = RequestMethod.GET) 87 @RequestMapping(value = "/setSKB", method = RequestMethod.GET)
62 public String setSKB(@RequestParam("ids") String ids) throws Exception { 88 public String setSKB(@RequestParam("ids") String ids) throws Exception {
63 try { 89 try {
@@ -66,7 +92,7 @@ public class TrafficManageController { @@ -66,7 +92,7 @@ public class TrafficManageController {
66 throw new Exception(exp.getCause()); 92 throw new Exception(exp.getCause());
67 } 93 }
68 } 94 }
69 - 95 +
70 @RequestMapping(value = "/setXLPC", method = RequestMethod.GET) 96 @RequestMapping(value = "/setXLPC", method = RequestMethod.GET)
71 public String setXLPC() throws Exception { 97 public String setXLPC() throws Exception {
72 try { 98 try {
@@ -75,13 +101,23 @@ public class TrafficManageController { @@ -75,13 +101,23 @@ public class TrafficManageController {
75 throw new Exception(exp.getCause()); 101 throw new Exception(exp.getCause());
76 } 102 }
77 } 103 }
78 -  
79 - @RequestMapping(value = "/setJHBC", method = RequestMethod.GET)  
80 - public String setJHBC() throws Exception { 104 +
  105 + @RequestMapping(value = "/setCS", method = RequestMethod.GET)
  106 + public String setCS() throws Exception {
81 try { 107 try {
82 - return trManageService.setDDRB(); 108 + return trManageService.setCS();
83 } catch (Exception exp) { 109 } catch (Exception exp) {
84 throw new Exception(exp.getCause()); 110 throw new Exception(exp.getCause());
85 } 111 }
86 } 112 }
  113 +
  114 + @RequestMapping(value = "/getDownLoadAllDataFile", method = RequestMethod.GET)
  115 + public String getDownLoadAllDataFile() throws Exception {
  116 + try {
  117 + return trManageService.getDownLoadAllDataFile();
  118 + } catch (Exception exp) {
  119 + throw new Exception(exp.getCause());
  120 + }
  121 + }
  122 +
87 } 123 }
src/main/java/com/bsth/controller/sys/UserController.java
@@ -73,9 +73,13 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; { @@ -73,9 +73,13 @@ public class UserController extends BaseController&lt;SysUser, Integer&gt; {
73 } 73 }
74 74
75 //解密RSA 75 //解密RSA
76 - userName = RSAUtils.decryptBase64(userName);  
77 - password = RSAUtils.decryptBase64(password);  
78 - 76 + try {
  77 + userName = RSAUtils.decryptBase64(userName);
  78 + password = RSAUtils.decryptBase64(password);
  79 + } catch (RuntimeException e) {
  80 + return put(rs, "msg", "decrypt RSA fail!可能页面已过期,尝试刷新页面。");
  81 + }
  82 +
79 SysUser user = sysUserService.findByUserName(userName); 83 SysUser user = sysUserService.findByUserName(userName);
80 if (null == user) 84 if (null == user)
81 return put(rs, "msg", "不存在的用户"); 85 return put(rs, "msg", "不存在的用户");
src/main/java/com/bsth/data/BasicData.java
@@ -70,7 +70,7 @@ public class BasicData implements CommandLineRunner { @@ -70,7 +70,7 @@ public class BasicData implements CommandLineRunner {
70 public static Map<String, String> allPerson; 70 public static Map<String, String> allPerson;
71 71
72 //站点名和运管处编号 对照 72 //站点名和运管处编号 对照
73 - public static Map<String, Map<String, Map>> stationName2YgcNumber; 73 + public static Map<String,Integer> stationName2YgcNumber;
74 74
75 75
76 static Logger logger = LoggerFactory.getLogger(BasicData.class); 76 static Logger logger = LoggerFactory.getLogger(BasicData.class);
@@ -233,13 +233,6 @@ public class BasicData implements CommandLineRunner { @@ -233,13 +233,6 @@ public class BasicData implements CommandLineRunner {
233 * @Description: TODO(加载线路相关信息) 233 * @Description: TODO(加载线路相关信息)
234 */ 234 */
235 public void loadLineInfo(){ 235 public void loadLineInfo(){
236 - List<StationRoute> stationsList = null;// 站点路由集  
237 - StationRoute stationRoute = null;  
238 - int size = 0;  
239 - Map<String, Integer> station2Number ;  
240 - Map<String, Map> dirs2Statioin ;  
241 - int[] dirs = {0,1};// 运行方向 上下行  
242 - int num = 1;  
243 Iterator<Line> iterator = lineRepository.findAll().iterator(); 236 Iterator<Line> iterator = lineRepository.findAll().iterator();
244 237
245 Line line; 238 Line line;
@@ -247,7 +240,7 @@ public class BasicData implements CommandLineRunner { @@ -247,7 +240,7 @@ public class BasicData implements CommandLineRunner {
247 Map<String, String> code2name = new HashMap<>(); 240 Map<String, String> code2name = new HashMap<>();
248 Map<Integer, String> id2SHcode = new HashMap<Integer, String>(); 241 Map<Integer, String> id2SHcode = new HashMap<Integer, String>();
249 Map<String, String> code2SHcode = new HashMap<String, String>(); 242 Map<String, String> code2SHcode = new HashMap<String, String>();
250 - Map<String, Map<String, Map>> tempStationName2YgcNumber = new HashMap<String, Map<String, Map>>(); 243 + Map<String, Integer> tempStationName2YgcNumber = new HashMap<String, Integer>();
251 244
252 while(iterator.hasNext()){ 245 while(iterator.hasNext()){
253 line = iterator.next(); 246 line = iterator.next();
@@ -259,27 +252,26 @@ public class BasicData implements CommandLineRunner { @@ -259,27 +252,26 @@ public class BasicData implements CommandLineRunner {
259 /** 252 /**
260 * 加载运管处的站点及序号 253 * 加载运管处的站点及序号
261 * 上行从1开始,下行顺序续编 254 * 上行从1开始,下行顺序续编
262 -  
263 - num = 1;  
264 - dirs2Statioin = new HashMap<String, Map>();  
265 - for (int i = 0; i < dirs.length; i++) {  
266 - // 分别取得上下行的站点  
267 - stationsList = stationRouteRepository.findByLine(line.getLineCode(), dirs[i]);  
268 - size = stationsList == null ? 0 :stationsList.size();  
269 - if(size > 0 ){  
270 - station2Number = new HashMap<String, Integer>();  
271 - for (int j = 0; j < size; j++) {  
272 - stationRoute = stationsList.get(j);  
273 - // map保存为(站点名称 -->序号)  
274 - station2Number.put(stationRoute.getStationName(), num++); 255 + */
  256 + List<Object[]> ygcLines = stationRouteRepository.findAllLineWithYgc();
  257 + if(ygcLines != null && ygcLines.size() > 0){
  258 + int size = ygcLines.size();
  259 + Object[] tempArray ;
  260 + int num = 1;
  261 + String key;
  262 + String lineCode = "";
  263 + for (int i = 0; i < size; i ++){
  264 + tempArray = ygcLines.get(i);
  265 + if(lineCode.equals("")){
  266 + lineCode = tempArray[0]+"";
  267 + }else if(!lineCode.equals(tempArray[0]+"")){
  268 + num = 1;
  269 + lineCode = tempArray[0]+"";
275 } 270 }
276 - // 保存两个数据,(0 --> station2Number)(1 --> station2Number) 0上行 1 下行  
277 - dirs2Statioin.put(dirs[i]+"", station2Number); 271 + key = tempArray[0] + "_"+tempArray[1] + "_"+tempArray[2];
  272 + tempStationName2YgcNumber.put(key,num++);
278 } 273 }
279 } 274 }
280 - // 保存(站点编码 --> dirs2Statioin)  
281 - tempStationName2YgcNumber.put(line.getLineCode(), dirs2Statioin);  
282 - */  
283 } 275 }
284 276
285 lineId2CodeMap = biMap; 277 lineId2CodeMap = biMap;
src/main/java/com/bsth/data/arrival/ArrivalData_GPS.java
@@ -41,8 +41,8 @@ public class ArrivalData_GPS implements CommandLineRunner{ @@ -41,8 +41,8 @@ public class ArrivalData_GPS implements CommandLineRunner{
41 41
42 @Override 42 @Override
43 public void run(String... arg0) throws Exception { 43 public void run(String... arg0) throws Exception {
44 - logger.info("ArrivalData_GPS,30,10");  
45 - //Application.mainServices.scheduleWithFixedDelay(dataLoaderThread, 40, 10, TimeUnit.SECONDS); 44 + logger.info("ArrivalData_GPS,30,06");
  45 + //Application.mainServices.scheduleWithFixedDelay(dataLoaderThread, 40, 6, TimeUnit.SECONDS);
46 } 46 }
47 47
48 @Component 48 @Component
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
1 package com.bsth.data.gpsdata; 1 package com.bsth.data.gpsdata;
2 2
3 -import java.io.BufferedReader;  
4 -import java.io.InputStreamReader;  
5 -import java.util.*;  
6 -import java.util.concurrent.TimeUnit;  
7 - 3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.Application;
  6 +import com.bsth.data.BasicData;
  7 +import com.bsth.data.forecast.ForecastRealServer;
  8 +import com.bsth.data.schedule.DayOfSchedule;
  9 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  10 +import com.bsth.util.ConfigUtil;
  11 +import com.google.common.collect.TreeMultimap;
8 import org.apache.commons.lang3.StringUtils; 12 import org.apache.commons.lang3.StringUtils;
9 import org.apache.http.HttpEntity; 13 import org.apache.http.HttpEntity;
10 import org.apache.http.client.methods.CloseableHttpResponse; 14 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -17,15 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -17,15 +21,10 @@ import org.springframework.beans.factory.annotation.Autowired;
17 import org.springframework.boot.CommandLineRunner; 21 import org.springframework.boot.CommandLineRunner;
18 import org.springframework.stereotype.Component; 22 import org.springframework.stereotype.Component;
19 23
20 -import com.alibaba.fastjson.JSON;  
21 -import com.alibaba.fastjson.JSONObject;  
22 -import com.bsth.Application;  
23 -import com.bsth.data.BasicData;  
24 -import com.bsth.data.forecast.ForecastRealServer;  
25 -import com.bsth.data.schedule.DayOfSchedule;  
26 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
27 -import com.bsth.util.ConfigUtil;  
28 -import com.google.common.collect.TreeMultimap; 24 +import java.io.BufferedReader;
  25 +import java.io.InputStreamReader;
  26 +import java.util.*;
  27 +import java.util.concurrent.TimeUnit;
29 28
30 /** 29 /**
31 * 30 *
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
@@ -472,7 +472,6 @@ public class DayOfSchedule implements CommandLineRunner { @@ -472,7 +472,6 @@ public class DayOfSchedule implements CommandLineRunner {
472 } 472 }
473 473
474 public void put(ScheduleRealInfo sch) { 474 public void put(ScheduleRealInfo sch) {
475 -  
476 schAttrCalculator 475 schAttrCalculator
477 .calcRealDate(sch) 476 .calcRealDate(sch)
478 .calcAllTimeByFcsj(sch); 477 .calcAllTimeByFcsj(sch);
src/main/java/com/bsth/data/schedule/SchAttrCalculator.java
1 package com.bsth.data.schedule; 1 package com.bsth.data.schedule;
2 2
3 -import java.text.ParseException;  
4 -import java.util.ArrayList;  
5 -import java.util.Collections;  
6 -import java.util.List;  
7 - 3 +import com.bsth.data.LineConfigData;
  4 +import com.bsth.entity.realcontrol.LineConfig;
  5 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
8 import org.joda.time.format.DateTimeFormat; 6 import org.joda.time.format.DateTimeFormat;
9 import org.joda.time.format.DateTimeFormatter; 7 import org.joda.time.format.DateTimeFormatter;
10 import org.slf4j.Logger; 8 import org.slf4j.Logger;
@@ -12,9 +10,10 @@ import org.slf4j.LoggerFactory; @@ -12,9 +10,10 @@ import org.slf4j.LoggerFactory;
12 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
13 import org.springframework.stereotype.Component; 11 import org.springframework.stereotype.Component;
14 12
15 -import com.bsth.data.LineConfigData;  
16 -import com.bsth.entity.realcontrol.LineConfig;  
17 -import com.bsth.entity.realcontrol.ScheduleRealInfo; 13 +import java.text.ParseException;
  14 +import java.util.ArrayList;
  15 +import java.util.Collections;
  16 +import java.util.List;
18 17
19 /** 18 /**
20 * 19 *
@@ -49,11 +48,30 @@ public class SchAttrCalculator { @@ -49,11 +48,30 @@ public class SchAttrCalculator {
49 if (null == sch.getFcsjT()) 48 if (null == sch.getFcsjT())
50 calcFcsjTime(sch); 49 calcFcsjTime(sch);
51 50
52 - 51 + //計發時間
53 if(sch.getFcsj().compareTo(conf.getStartOpt()) < 0){ 52 if(sch.getFcsj().compareTo(conf.getStartOpt()) < 0){
54 sch.setFcsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsj()) + DAY_TIME); 53 sch.setFcsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsj()) + DAY_TIME);
55 } 54 }
56 - 55 +
  56 + //待發時間
  57 + if(sch.getDfsj().compareTo(conf.getStartOpt()) < 0){
  58 + sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj()) + DAY_TIME);
  59 + }
  60 + else
  61 + sch.setDfsjAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getDfsj()));
  62 +
  63 + //實發時間
  64 + if(sch.getFcsjActual() != null &&
  65 + sch.getFcsjActual().compareTo(conf.getStartOpt()) < 0){
  66 + sch.setFcsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getFcsjActual()) + DAY_TIME);
  67 + }
  68 +
  69 + //實際終點時間
  70 + if(sch.getZdsjActual() != null &&
  71 + sch.getZdsjActual().compareTo(conf.getStartOpt()) < 0){
  72 + sch.setZdsjActualAll(fmtyyyyMMddHHmm.parseMillis(sch.getScheduleDateStr()+sch.getZdsjActual()) + DAY_TIME);
  73 + }
  74 +
57 sch.setRealExecDate(fmtyyyyMMdd.print(sch.getFcsjT())); 75 sch.setRealExecDate(fmtyyyyMMdd.print(sch.getFcsjT()));
58 } catch (Exception e) { 76 } catch (Exception e) {
59 logger.error("", e); 77 logger.error("", e);
src/main/java/com/bsth/entity/Line.java
@@ -144,6 +144,9 @@ public class Line implements Serializable { @@ -144,6 +144,9 @@ public class Line implements Serializable {
144 /** 修改日期 timestamp */ 144 /** 修改日期 timestamp */
145 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP") 145 @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
146 private Date updateDate; 146 private Date updateDate;
  147 +
  148 + /** 是否在使用 <1:是;0:否> bit length(50) */
  149 + private Integer inUse;
147 150
148 public Integer getWarrantCar() { 151 public Integer getWarrantCar() {
149 return warrantCar; 152 return warrantCar;
@@ -448,4 +451,8 @@ public class Line implements Serializable { @@ -448,4 +451,8 @@ public class Line implements Serializable {
448 public void setUpdateDate(Date updateDate) { 451 public void setUpdateDate(Date updateDate) {
449 this.updateDate = updateDate; 452 this.updateDate = updateDate;
450 } 453 }
  454 +
  455 + public Integer getInUse() { return inUse; }
  456 +
  457 + public void setInUse(Integer inUse) { this.inUse = inUse; }
451 } 458 }
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
@@ -2,13 +2,11 @@ package com.bsth.entity.realcontrol; @@ -2,13 +2,11 @@ package com.bsth.entity.realcontrol;
2 2
3 import com.bsth.entity.sys.SysUser; 3 import com.bsth.entity.sys.SysUser;
4 import com.fasterxml.jackson.annotation.JsonIgnore; 4 import com.fasterxml.jackson.annotation.JsonIgnore;
5 -  
6 -import javax.persistence.*;  
7 -  
8 import org.apache.commons.lang3.StringUtils; 5 import org.apache.commons.lang3.StringUtils;
9 import org.joda.time.format.DateTimeFormat; 6 import org.joda.time.format.DateTimeFormat;
10 import org.joda.time.format.DateTimeFormatter; 7 import org.joda.time.format.DateTimeFormatter;
11 8
  9 +import javax.persistence.*;
12 import java.util.Date; 10 import java.util.Date;
13 import java.util.HashSet; 11 import java.util.HashSet;
14 import java.util.Set; 12 import java.util.Set;
@@ -49,11 +47,6 @@ public class ScheduleRealInfo { @@ -49,11 +47,6 @@ public class ScheduleRealInfo {
49 47
50 /** 车辆自编号 */ 48 /** 车辆自编号 */
51 private String clZbh; 49 private String clZbh;
52 -  
53 - /** 报道时间(格式 HH:mm)  
54 - private String bdTime; */  
55 - /** 出场时间(格式 HH:mm)  
56 - private String ccTime;*/  
57 50
58 /** 驾驶员工号 */ 51 /** 驾驶员工号 */
59 private String jGh; 52 private String jGh;
@@ -143,15 +136,6 @@ public class ScheduleRealInfo { @@ -143,15 +136,6 @@ public class ScheduleRealInfo {
143 @Transient 136 @Transient
144 private boolean late; 137 private boolean late;
145 138
146 - /**实际里程*/  
147 - private Float realMileage;  
148 -  
149 - /** 增加公里 */  
150 - private Float addMileage;  
151 -  
152 - /** 抽减公里 */  
153 - private Float remMileage;  
154 -  
155 /** 备注*/ 139 /** 备注*/
156 private String remarks; 140 private String remarks;
157 141
@@ -169,16 +153,126 @@ public class ScheduleRealInfo { @@ -169,16 +153,126 @@ public class ScheduleRealInfo {
169 private Integer opDirectiveState; 153 private Integer opDirectiveState;
170 154
171 /** 起点站计划到达时间 */ 155 /** 起点站计划到达时间 */
  156 + @Transient
172 private String qdzArrDatejh; 157 private String qdzArrDatejh;
173 - 158 +
174 /** 起点站实际到达时间 */ 159 /** 起点站实际到达时间 */
  160 + @Transient
175 private String qdzArrDatesj; 161 private String qdzArrDatesj;
176 - 162 +
177 /** 子任务 */ 163 /** 子任务 */
178 @OneToMany(fetch = FetchType.LAZY/*, cascade = CascadeType.ALL*/) 164 @OneToMany(fetch = FetchType.LAZY/*, cascade = CascadeType.ALL*/)
179 private Set<ChildTaskPlan> cTasks = new HashSet<>(); 165 private Set<ChildTaskPlan> cTasks = new HashSet<>();
180 -  
181 - /** ---------------- 166 +
  167 + /** 关联的公司名称 */
  168 + private String gsName;
  169 + /** 关联的公司编码 */
  170 + private String gsBm;
  171 + /** 关联的分公司名称 */
  172 + private String fgsName;
  173 + /** 关联的分公司编码 */
  174 + private String fgsBm;
  175 + /** 出场顺序号 */
  176 + private Integer ccno;
  177 +
  178 + //待发调试(是否自动调整)
  179 + private boolean dfAuto;
  180 + //是否有GPS信号
  181 + private boolean online;
  182 +
  183 + public boolean isDfAuto() {
  184 + return dfAuto;
  185 + }
  186 +
  187 + public void setDfAuto(boolean dfAuto) {
  188 + this.dfAuto = dfAuto;
  189 + }
  190 +
  191 + public boolean isOnline() {
  192 + return online;
  193 + }
  194 +
  195 + public void setOnline(boolean online) {
  196 + this.online = online;
  197 + }
  198 +
  199 + public String getQdzArrDatejh() {
  200 + return qdzArrDatejh;
  201 + }
  202 +
  203 + public void setQdzArrDatejh(String qdzArrDatejh) {
  204 + this.qdzArrDatejh = qdzArrDatejh;
  205 + }
  206 +
  207 + public String getQdzArrDatesj() {
  208 + return qdzArrDatesj;
  209 + }
  210 +
  211 + public void setQdzArrDatesj(String qdzArrDatesj) {
  212 + this.qdzArrDatesj = qdzArrDatesj;
  213 + }
  214 +
  215 + public void setcTasks(Set<ChildTaskPlan> cTasks) {
  216 + this.cTasks = cTasks;
  217 + }
  218 +
  219 + public String getGsName() {
  220 + return gsName;
  221 + }
  222 +
  223 + public void setGsName(String gsName) {
  224 + this.gsName = gsName;
  225 + }
  226 +
  227 + public String getGsBm() {
  228 + return gsBm;
  229 + }
  230 +
  231 + public void setGsBm(String gsBm) {
  232 + this.gsBm = gsBm;
  233 + }
  234 +
  235 + public String getFgsName() {
  236 + return fgsName;
  237 + }
  238 +
  239 + public void setFgsName(String fgsName) {
  240 + this.fgsName = fgsName;
  241 + }
  242 +
  243 + public String getFgsBm() {
  244 + return fgsBm;
  245 + }
  246 +
  247 + public void setFgsBm(String fgsBm) {
  248 + this.fgsBm = fgsBm;
  249 + }
  250 +
  251 + public Integer getCcno() {
  252 + return ccno;
  253 + }
  254 +
  255 + public void setCcno(Integer ccno) {
  256 + this.ccno = ccno;
  257 + }
  258 +
  259 + public static DateTimeFormatter getFmtHHmm() {
  260 + return fmtHHmm;
  261 + }
  262 +
  263 + public static void setFmtHHmm(DateTimeFormatter fmtHHmm) {
  264 + ScheduleRealInfo.fmtHHmm = fmtHHmm;
  265 + }
  266 +
  267 + public static DateTimeFormatter getFmtyyyyMMddHHmm() {
  268 + return fmtyyyyMMddHHmm;
  269 + }
  270 +
  271 + public static void setFmtyyyyMMddHHmm(DateTimeFormatter fmtyyyyMMddHHmm) {
  272 + ScheduleRealInfo.fmtyyyyMMddHHmm = fmtyyyyMMddHHmm;
  273 + }
  274 +
  275 + /** ----------------
182 @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) 276 @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
183 private RealTimeModel sjfcModel; 277 private RealTimeModel sjfcModel;
184 @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL) 278 @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@@ -460,30 +554,6 @@ public class ScheduleRealInfo { @@ -460,30 +554,6 @@ public class ScheduleRealInfo {
460 this.status = status; 554 this.status = status;
461 } 555 }
462 556
463 - public Float getRealMileage() {  
464 - return realMileage;  
465 - }  
466 -  
467 - public void setRealMileage(Float realMileage) {  
468 - this.realMileage = realMileage;  
469 - }  
470 -  
471 - public Float getAddMileage() {  
472 - return addMileage;  
473 - }  
474 -  
475 - public void setAddMileage(Float addMileage) {  
476 - this.addMileage = addMileage;  
477 - }  
478 -  
479 - public Float getRemMileage() {  
480 - return remMileage;  
481 - }  
482 -  
483 - public void setRemMileage(Float remMileage) {  
484 - this.remMileage = remMileage;  
485 - }  
486 -  
487 public String getRemarks() { 557 public String getRemarks() {
488 return remarks; 558 return remarks;
489 } 559 }
src/main/java/com/bsth/repository/StationRouteRepository.java
@@ -257,4 +257,15 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int @@ -257,4 +257,15 @@ public interface StationRouteRepository extends BaseRepository&lt;StationRoute, Int
257 @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH) 257 @EntityGraph(value = "stationRoute_station", type = EntityGraph.EntityGraphType.FETCH)
258 @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1") 258 @Query("select s from StationRoute s where s.destroy=0 and s.lineCode=?1")
259 List<StationRoute> findByLineCode(String lineCode); 259 List<StationRoute> findByLineCode(String lineCode);
  260 +
  261 + @Query("SELECT " +
  262 + "lineCode,directions,stationName,stationRouteCode " +
  263 + "FROM " +
  264 + "StationRoute s " +
  265 + "WHERE " +
  266 + "s.destroy = 0 " +
  267 + "and s.lineCode in(select lineCode from Line where inUse = 1) " +
  268 + "ORDER BY " +
  269 + "lineCode,directions,stationRouteCode")
  270 + List<Object[]> findAllLineWithYgc();
260 } 271 }
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
@@ -29,8 +29,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI @@ -29,8 +29,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
29 @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 order by bcs") 29 @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 order by bcs")
30 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName); 30 List<ScheduleRealInfo> exportWaybill(String jName,String clZbh,String lpName);
31 31
  32 + //把sum(addMileage) 替换为0 数据表去掉了 add_mileage 字段
32 @Query(value="select new map(clZbh as clZbh,jGh as jGh,jName as jName,sum(jhlc) as zgl," 33 @Query(value="select new map(clZbh as clZbh,jGh as jGh,jName as jName,sum(jhlc) as zgl,"
33 - + "sum(addMileage) as ksgl,count(jName) as bcs) from ScheduleRealInfo s where" 34 + + " 0 as ksgl,count(jName) as bcs) from ScheduleRealInfo s where"
34 + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName") 35 + " s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by clZbh,jGh,jName")
35 List<Map<String, Object>> dailyInfo(String line,String date); 36 List<Map<String, Object>> dailyInfo(String line,String date);
36 37
src/main/java/com/bsth/service/impl/TrafficManageServiceImpl.java
1 package com.bsth.service.impl; 1 package com.bsth.service.impl;
2 2
3 -import java.io.BufferedOutputStream;  
4 -import java.io.File;  
5 -import java.io.FileOutputStream;  
6 -import java.io.IOException;  
7 -import java.sql.Connection;  
8 -import java.sql.PreparedStatement;  
9 -import java.sql.ResultSet;  
10 -import java.text.DecimalFormat;  
11 -import java.text.SimpleDateFormat;  
12 -import java.util.Date;  
13 -import java.util.HashMap;  
14 -import java.util.Iterator;  
15 -import java.util.List;  
16 -import java.util.Map;  
17 -import java.util.Set;  
18 -  
19 -import org.apache.commons.lang.time.DateUtils;  
20 -import org.slf4j.Logger;  
21 -import org.slf4j.LoggerFactory;  
22 -import org.springframework.beans.factory.annotation.Autowired;  
23 -import org.springframework.data.domain.Sort;  
24 -import org.springframework.data.domain.Sort.Direction;  
25 -import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;  
26 -import org.springframework.stereotype.Service;  
27 -  
28 import com.bsth.data.BasicData; 3 import com.bsth.data.BasicData;
29 -import com.bsth.entity.Cars;  
30 -import com.bsth.entity.Line;  
31 -import com.bsth.entity.LineInformation;  
32 -import com.bsth.entity.Personnel;  
33 -import com.bsth.entity.StationRoute; 4 +import com.bsth.entity.*;
34 import com.bsth.entity.realcontrol.ChildTaskPlan; 5 import com.bsth.entity.realcontrol.ChildTaskPlan;
35 import com.bsth.entity.realcontrol.ScheduleRealInfo; 6 import com.bsth.entity.realcontrol.ScheduleRealInfo;
36 import com.bsth.entity.schedule.SchedulePlanInfo; 7 import com.bsth.entity.schedule.SchedulePlanInfo;
37 import com.bsth.entity.schedule.TTInfo; 8 import com.bsth.entity.schedule.TTInfo;
38 import com.bsth.entity.schedule.TTInfoDetail; 9 import com.bsth.entity.schedule.TTInfoDetail;
39 import com.bsth.entity.search.CustomerSpecs; 10 import com.bsth.entity.search.CustomerSpecs;
40 -import com.bsth.repository.CarsRepository;  
41 -import com.bsth.repository.LineInformationRepository;  
42 -import com.bsth.repository.LineRepository;  
43 -import com.bsth.repository.PersonnelRepository;  
44 -import com.bsth.repository.StationRouteRepository;  
45 -import com.bsth.repository.schedule.CarConfigInfoRepository;  
46 -import com.bsth.repository.schedule.EmployeeConfigInfoRepository;  
47 -import com.bsth.repository.schedule.SchedulePlanInfoRepository;  
48 -import com.bsth.repository.schedule.TTInfoDetailRepository;  
49 -import com.bsth.repository.schedule.TTInfoRepository; 11 +import com.bsth.repository.*;
  12 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  13 +import com.bsth.repository.schedule.*;
50 import com.bsth.service.TrafficManageService; 14 import com.bsth.service.TrafficManageService;
51 import com.bsth.util.TimeUtils; 15 import com.bsth.util.TimeUtils;
52 import com.bsth.util.db.DBUtils_MS; 16 import com.bsth.util.db.DBUtils_MS;
@@ -54,7 +18,25 @@ import com.bsth.webService.trafficManage.geotool.services.Internal; @@ -54,7 +18,25 @@ import com.bsth.webService.trafficManage.geotool.services.Internal;
54 import com.bsth.webService.trafficManage.geotool.services.InternalPortType; 18 import com.bsth.webService.trafficManage.geotool.services.InternalPortType;
55 import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator; 19 import com.bsth.webService.trafficManage.org.tempuri.WebServiceLocator;
56 import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap; 20 import com.bsth.webService.trafficManage.org.tempuri.WebServiceSoap;
57 -import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 21 +import org.apache.commons.lang.time.DateUtils;
  22 +import org.slf4j.Logger;
  23 +import org.slf4j.LoggerFactory;
  24 +import org.springframework.beans.factory.annotation.Autowired;
  25 +import org.springframework.data.domain.Sort;
  26 +import org.springframework.data.domain.Sort.Direction;
  27 +import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
  28 +import org.springframework.stereotype.Service;
  29 +
  30 +import java.io.BufferedOutputStream;
  31 +import java.io.File;
  32 +import java.io.FileOutputStream;
  33 +import java.io.IOException;
  34 +import java.sql.Connection;
  35 +import java.sql.PreparedStatement;
  36 +import java.sql.ResultSet;
  37 +import java.text.DecimalFormat;
  38 +import java.text.SimpleDateFormat;
  39 +import java.util.*;
58 /** 40 /**
59 * 41 *
60 * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类) 42 * @ClassName: TrafficManageServiceImpl(运管处接口service业务层实现类)
@@ -63,7 +45,7 @@ import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; @@ -63,7 +45,7 @@ import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
63 * 45 *
64 * @Description: TODO(运管处接口service业务层) 46 * @Description: TODO(运管处接口service业务层)
65 * 47 *
66 - * @Author bsth@z 48 + * @Author bsth@zq
67 * 49 *
68 * @Date 2016年10月28日 上午9:21:17 50 * @Date 2016年10月28日 上午9:21:17
69 * 51 *
@@ -158,8 +140,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -158,8 +140,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
158 @Override 140 @Override
159 public String setXL() { 141 public String setXL() {
160 String result = "failure"; 142 String result = "failure";
  143 + StringBuffer sBuffer = new StringBuffer();
161 try { 144 try {
162 - StringBuffer sBuffer = new StringBuffer(); ;  
163 Iterator<Line> lineIterator = lineRepository.findAll().iterator(); 145 Iterator<Line> lineIterator = lineRepository.findAll().iterator();
164 Line line = null; 146 Line line = null;
165 List<StationRoute> stationsList = null;// 站点路由集 147 List<StationRoute> stationsList = null;// 站点路由集
@@ -168,7 +150,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -168,7 +150,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
168 sBuffer.append("<XLs>"); 150 sBuffer.append("<XLs>");
169 while(lineIterator.hasNext()){ 151 while(lineIterator.hasNext()){
170 line = lineIterator.next(); 152 line = lineIterator.next();
171 - if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null){ 153 + if(BasicData.lineId2ShangHaiCodeMap.get(line.getId()) == null
  154 + || line.getInUse() == 0){
172 continue; 155 continue;
173 } 156 }
174 sBuffer.append("<XL>"); 157 sBuffer.append("<XL>");
@@ -208,7 +191,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -208,7 +191,6 @@ public class TrafficManageServiceImpl implements TrafficManageService{
208 sBuffer.append("</XLs>"); 191 sBuffer.append("</XLs>");
209 System.out.println(sBuffer.toString()); 192 System.out.println(sBuffer.toString());
210 if(sBuffer.indexOf("<XL>") != -1){ 193 if(sBuffer.indexOf("<XL>") != -1){
211 - logger.info("setXL:"+sBuffer.toString());  
212 String portResult = portType.setXL(userNameXl, passwordXl, sBuffer.toString()); 194 String portResult = portType.setXL(userNameXl, passwordXl, sBuffer.toString());
213 String portArray[] = portResult.split("\n"); 195 String portArray[] = portResult.split("\n");
214 if(portArray.length >= 4){ 196 if(portArray.length >= 4){
@@ -224,8 +206,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -224,8 +206,10 @@ public class TrafficManageServiceImpl implements TrafficManageService{
224 } 206 }
225 } 207 }
226 } catch (Exception e) { 208 } catch (Exception e) {
  209 + logger.error("setXL:",e);
227 e.printStackTrace(); 210 e.printStackTrace();
228 }finally{ 211 }finally{
  212 + logger.info("setXL:"+sBuffer.toString());
229 logger.info("setXL:"+result); 213 logger.info("setXL:"+result);
230 } 214 }
231 return result; 215 return result;
@@ -237,8 +221,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -237,8 +221,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
237 @Override 221 @Override
238 public String setCL() { 222 public String setCL() {
239 String result = "failure"; 223 String result = "failure";
  224 + StringBuffer sBuffer =new StringBuffer();
240 try { 225 try {
241 - StringBuffer sBuffer =new StringBuffer();  
242 sBuffer.append("<CLs>"); 226 sBuffer.append("<CLs>");
243 Cars cars = null; 227 Cars cars = null;
244 String company; 228 String company;
@@ -258,13 +242,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -258,13 +242,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
258 sBuffer.append("</CL>"); 242 sBuffer.append("</CL>");
259 } 243 }
260 sBuffer.append("</CLs>"); 244 sBuffer.append("</CLs>");
261 - logger.info("setCL:"+sBuffer.toString());  
262 if(ssop.setCL(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ 245 if(ssop.setCL(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
263 result = "success"; 246 result = "success";
264 } 247 }
265 } catch (Exception e) { 248 } catch (Exception e) {
  249 + logger.error("setCL:",e);
266 e.printStackTrace(); 250 e.printStackTrace();
267 }finally{ 251 }finally{
  252 + logger.info("setCL:"+sBuffer.toString());
268 logger.info("setCL:"+result); 253 logger.info("setCL:"+result);
269 } 254 }
270 return result; 255 return result;
@@ -276,8 +261,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -276,8 +261,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
276 @Override 261 @Override
277 public String setSJ() { 262 public String setSJ() {
278 String result = "failure"; 263 String result = "failure";
  264 + StringBuffer sBuffer =new StringBuffer();
279 try { 265 try {
280 - StringBuffer sBuffer =new StringBuffer();  
281 sBuffer.append("<SJs>"); 266 sBuffer.append("<SJs>");
282 Personnel personnel = null; 267 Personnel personnel = null;
283 String company; 268 String company;
@@ -295,13 +280,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -295,13 +280,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
295 sBuffer.append("</SJ>"); 280 sBuffer.append("</SJ>");
296 } 281 }
297 sBuffer.append("</SJs>"); 282 sBuffer.append("</SJs>");
298 - logger.info("setSJ:"+sBuffer.toString());  
299 if(ssop.setSJ(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ 283 if(ssop.setSJ(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
300 result = "success"; 284 result = "success";
301 }; 285 };
302 } catch (Exception e) { 286 } catch (Exception e) {
  287 + logger.error("setSJ:",e);
303 e.printStackTrace(); 288 e.printStackTrace();
304 }finally{ 289 }finally{
  290 + logger.info("setSJ:"+sBuffer.toString());
305 logger.info("setSJ:"+result); 291 logger.info("setSJ:"+result);
306 } 292 }
307 return result; 293 return result;
@@ -309,15 +295,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -309,15 +295,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
309 295
310 /** 296 /**
311 * 上传路单 297 * 上传路单
312 - * @param date  
313 - * @return xml格式的字符串 298 + * @return 上传成功标识
314 */ 299 */
315 public String setLD(){ 300 public String setLD(){
316 String result = "failure"; 301 String result = "failure";
317 // 取昨天 的日期 302 // 取昨天 的日期
318 String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); 303 String date = sdfnyr.format(DateUtils.addDays(new Date(), -1));
  304 + StringBuffer sf = new StringBuffer();
319 try { 305 try {
320 - StringBuffer sf = new StringBuffer();  
321 sf.append("<DLDS>"); 306 sf.append("<DLDS>");
322 List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date); 307 List<ScheduleRealInfo> list = scheduleRealInfoRepository.setLD(date);
323 List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date); 308 List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLDGroup(date);
@@ -368,20 +353,19 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -368,20 +353,19 @@ public class TrafficManageServiceImpl implements TrafficManageService{
368 sf.append("</LD>"); 353 sf.append("</LD>");
369 } 354 }
370 } 355 }
371 -  
372 sf.append("</LDList>"); 356 sf.append("</LDList>");
373 sf.append("</DLD>"); 357 sf.append("</DLD>");
374 } 358 }
375 } 359 }
376 -  
377 sf.append("</DLDS>"); 360 sf.append("</DLDS>");
378 - logger.info("setLD:"+sf.toString());  
379 if(ssop.setLD(userNameOther, passwordOther, sf.toString()).isSuccess()){ 361 if(ssop.setLD(userNameOther, passwordOther, sf.toString()).isSuccess()){
380 result = "success"; 362 result = "success";
381 } 363 }
382 } catch (Exception e) { 364 } catch (Exception e) {
  365 + logger.error("setLD:",e);
383 e.printStackTrace(); 366 e.printStackTrace();
384 }finally{ 367 }finally{
  368 + logger.info("setLD:"+sf.toString());
385 logger.info("setLD:"+result); 369 logger.info("setLD:"+result);
386 } 370 }
387 return result; 371 return result;
@@ -389,15 +373,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -389,15 +373,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
389 373
390 /** 374 /**
391 * 上传里程油耗 375 * 上传里程油耗
392 - * @param date  
393 - * @return 376 + * @return 上传成功标识
394 */ 377 */
395 public String setLCYH(){ 378 public String setLCYH(){
396 String result = "failure"; 379 String result = "failure";
397 // 取昨天 的日期 380 // 取昨天 的日期
398 String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); 381 String date = sdfnyr.format(DateUtils.addDays(new Date(), -1));
  382 + StringBuffer sf = new StringBuffer();
399 try { 383 try {
400 - StringBuffer sf = new StringBuffer();  
401 sf.append("<LCYHS>"); 384 sf.append("<LCYHS>");
402 List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date); 385 List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setLCYHGroup(date);
403 List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); 386 List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date);
@@ -451,13 +434,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -451,13 +434,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
451 } 434 }
452 } 435 }
453 sf.append("</LCYHS>"); 436 sf.append("</LCYHS>");
454 - logger.info("setLCYH:"+sf.toString());  
455 if(ssop.setLCYH(userNameOther, passwordOther, sf.toString()).isSuccess()){ 437 if(ssop.setLCYH(userNameOther, passwordOther, sf.toString()).isSuccess()){
456 result = "success"; 438 result = "success";
457 } 439 }
458 } catch (Exception e) { 440 } catch (Exception e) {
  441 + logger.error("setLCYH:",e);
459 e.printStackTrace(); 442 e.printStackTrace();
460 }finally{ 443 }finally{
  444 + logger.info("setLCYH:"+sf.toString());
461 logger.info("setLCYH:"+result); 445 logger.info("setLCYH:"+result);
462 } 446 }
463 return result; 447 return result;
@@ -471,8 +455,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -471,8 +455,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
471 String result = "failure"; 455 String result = "failure";
472 // 取昨天 的日期 456 // 取昨天 的日期
473 String date = sdfnyr.format(DateUtils.addDays(new Date(), -1)); 457 String date = sdfnyr.format(DateUtils.addDays(new Date(), -1));
  458 + StringBuffer sf = new StringBuffer();
474 try { 459 try {
475 - StringBuffer sf = new StringBuffer();  
476 sf.append("<DDRBS>"); 460 sf.append("<DDRBS>");
477 List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date); 461 List<ScheduleRealInfo> listGroup = scheduleRealInfoRepository.setDDRBGroup(date);
478 List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date); 462 List<ScheduleRealInfo> list = scheduleRealInfoRepository.findByDate(date);
@@ -554,13 +538,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -554,13 +538,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
554 } 538 }
555 } 539 }
556 sf.append("</DDRBS>"); 540 sf.append("</DDRBS>");
557 - logger.info("setDDRB:"+sf.toString());  
558 if(ssop.setDDRB(userNameOther, passwordOther, sf.toString()).isSuccess()){ 541 if(ssop.setDDRB(userNameOther, passwordOther, sf.toString()).isSuccess()){
559 result = "success"; 542 result = "success";
560 } 543 }
561 } catch (Exception e) { 544 } catch (Exception e) {
  545 + logger.error("setDDRB:",e);
562 e.printStackTrace(); 546 e.printStackTrace();
563 }finally{ 547 }finally{
  548 + logger.info("setDDRB:"+sf.toString());
564 logger.info("setDDRB:"+result); 549 logger.info("setDDRB:"+result);
565 } 550 }
566 return result; 551 return result;
@@ -572,8 +557,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -572,8 +557,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
572 @Override 557 @Override
573 public String setJHBC() { 558 public String setJHBC() {
574 String result = "failure"; 559 String result = "failure";
  560 + StringBuffer sBuffer =new StringBuffer();
575 try { 561 try {
576 - StringBuffer sBuffer =new StringBuffer();  
577 sBuffer.append("<JHBCs>"); 562 sBuffer.append("<JHBCs>");
578 // 声明变量 563 // 声明变量
579 SchedulePlanInfo schedulePlanInfo = null; 564 SchedulePlanInfo schedulePlanInfo = null;
@@ -633,13 +618,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -633,13 +618,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
633 } 618 }
634 } 619 }
635 sBuffer.append("</JHBCs>"); 620 sBuffer.append("</JHBCs>");
636 - logger.info("setJHBC:"+sBuffer.toString());  
637 if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ 621 if(ssop.setJHBC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
638 result = "success"; 622 result = "success";
639 } 623 }
640 } catch (Exception e) { 624 } catch (Exception e) {
  625 + logger.error("setJHBC:",e);
641 e.printStackTrace(); 626 e.printStackTrace();
642 }finally{ 627 }finally{
  628 + logger.info("setJHBC:"+sBuffer.toString());
643 logger.info("setJHBC:"+result); 629 logger.info("setJHBC:"+result);
644 } 630 }
645 return result; 631 return result;
@@ -651,14 +637,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -651,14 +637,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{
651 @Override 637 @Override
652 public String setSKB(String ids) { 638 public String setSKB(String ids) {
653 String result = "failure"; 639 String result = "failure";
  640 + StringBuffer sBuffer = new StringBuffer();
654 try { 641 try {
655 String[] idArray = ids.split(","); 642 String[] idArray = ids.split(",");
656 - StringBuffer sBuffer = new StringBuffer(); 643 + StringBuffer sBufferA;
  644 + StringBuffer sBufferB;
657 TTInfo ttInfo; 645 TTInfo ttInfo;
658 - TTInfoDetail ttInfoDetail; 646 + TTInfoDetail ttInfoDetail = null;
659 Iterator<TTInfoDetail> ttInfoDetailIterator; 647 Iterator<TTInfoDetail> ttInfoDetailIterator;
660 HashMap<String,Object> param = new HashMap<String, Object>(); 648 HashMap<String,Object> param = new HashMap<String, Object>();
661 - String ttinfoJhlc = null;//计划总里程  
662 String lineCode ; 649 String lineCode ;
663 sBuffer.append("<SKBs>"); 650 sBuffer.append("<SKBs>");
664 for (int i = 0; i < idArray.length; i++) { 651 for (int i = 0; i < idArray.length; i++) {
@@ -668,57 +655,61 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -668,57 +655,61 @@ public class TrafficManageServiceImpl implements TrafficManageService{
668 param.put("ttinfo.id_eq", ttInfo.getId()); 655 param.put("ttinfo.id_eq", ttInfo.getId());
669 ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param), 656 ttInfoDetailIterator = ttInfoDetailRepository.findAll(new CustomerSpecs<TTInfoDetail>(param),
670 new Sort(Direction.ASC, "xlDir")).iterator(); 657 new Sort(Direction.ASC, "xlDir")).iterator();
671 - sBuffer.append("<SKB>");  
672 - sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl().getId()))  
673 - .append("</XLBM>");  
674 - ttinfoJhlc = new String();  
675 - sBuffer.append("<JHZLC>").append(ttinfoJhlc).append("</JHZLC>");  
676 - sBuffer.append("<JHYYLC>").append(ttinfoJhlc).append("</JHYYLC>");  
677 - sBuffer.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>");  
678 - sBuffer.append("<JSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</JSRQ>");/////////  
679 - sBuffer.append("<ZJZX>").append(changeRuleDay(ttInfo.getRule_days())).append("</ZJZX>");  
680 - sBuffer.append("<TBYY>").append("").append("</TBYY>");  
681 - sBuffer.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>");  
682 - int num = 1;  
683 - // 加上<BCList>  
684 if(ttInfoDetailIterator.hasNext()){ 658 if(ttInfoDetailIterator.hasNext()){
685 - sBuffer.append("<BCList>");  
686 - }  
687 - while (ttInfoDetailIterator.hasNext()) {  
688 - ttInfoDetail = ttInfoDetailIterator.next();  
689 - if(ttInfoDetail.getBcType().equals("in") || ttInfoDetail.getBcType().equals("out")){  
690 - continue; 659 + sBuffer.append("<SKB>");
  660 + sBuffer.append("<XLBM>").append(BasicData.lineId2ShangHaiCodeMap.get(ttInfo.getXl().getId()))
  661 + .append("</XLBM>");
  662 + sBufferB = new StringBuffer();
  663 + sBufferB.append("<KSRQ>").append(sdfnyr.format(ttInfo.getQyrq())).append("</KSRQ>");
  664 + // 结束日期暂时不要,节假日的班次表才需要,如春节的班次表
  665 + sBufferB.append("<JSRQ>").append("").append("</JSRQ>");
  666 + sBufferB.append("<ZJZX>").append(changeRuleDay(ttInfo.getRule_days())).append("</ZJZX>");
  667 + sBufferB.append("<TBYY>").append("").append("</TBYY>");
  668 + sBufferB.append("<UPDT>").append(sdfnyrsfm.format(new Date())).append("</UPDT>");
  669 + sBufferB.append("<BCList>");
  670 + int num = 1;
  671 + while (ttInfoDetailIterator.hasNext()) {
  672 + ttInfoDetail = ttInfoDetailIterator.next();
  673 + if(ttInfoDetail.getBcType().equals("in") || ttInfoDetail.getBcType().equals("out")){
  674 + continue;
  675 + }
  676 + if(num++ == 1){
  677 + sBufferA = new StringBuffer();
  678 + sBufferA.append("<JHZLC>").append(ttInfoDetail.getJhlc()).append("</JHZLC>");
  679 + sBufferA.append("<JHYYLC>").append(ttInfoDetail.getJhlc()).append("</JHYYLC>");
  680 + sBuffer.append(sBufferA).append(sBufferB);
  681 + }
  682 + lineCode = ttInfoDetail.getXl().getLineCode();
  683 + // 如果发车时间格式错误,忽略此条
  684 + if(changeTimeFormat(ttInfoDetail) == null){
  685 + continue;
  686 + }
  687 + sBuffer.append("<BC>");
  688 + sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>");
  689 + sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>");
  690 + sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>");
  691 + sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(
  692 + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationName())).append("</ZDXH>");
  693 + sBuffer.append("<JHFCSJ>").append(changeTimeFormat(ttInfoDetail)).append("</JHFCSJ>");
  694 + sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>");
  695 + sBuffer.append("<DDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(
  696 + lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationName())).append("</DDXH>");
  697 + sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>");
  698 + sBuffer.append("</BC>");
691 } 699 }
692 - ttinfoJhlc = ttInfoDetail.getJhlc()+"";// 设置计划总里程  
693 - lineCode = ttInfoDetail.getXl().getLineCode();  
694 - sBuffer.append("<BC>");  
695 - sBuffer.append("<LPBH>").append(ttInfoDetail.getLp().getLpNo()).append("</LPBH>");  
696 - sBuffer.append("<SXX>").append(ttInfoDetail.getXlDir()).append("</SXX>");  
697 - sBuffer.append("<FCZDMC>").append(ttInfoDetail.getQdz().getStationName()).append("</FCZDMC>");  
698 - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(  
699 - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getQdz().getStationName())).append("</ZDXH>");  
700 - sBuffer.append("<JHFCSJ>").append(ttInfoDetail.getFcsj()).append("</JHFCSJ>");  
701 - sBuffer.append("<DDZDMC>").append(ttInfoDetail.getZdz().getStationName()).append("</DDZDMC>");  
702 - sBuffer.append("<ZDXH>").append(getYgcStationNumByLineCodeAndDirectionAndStationName(  
703 - lineCode, ttInfoDetail.getXlDir(), ttInfoDetail.getZdz().getStationName())).append("</ZDXH>");  
704 - sBuffer.append("<JHDDSJ>").append(calcDdsj(ttInfoDetail.getFcsj(),ttInfoDetail.getBcsj())).append("</JHDDSJ>");  
705 - sBuffer.append("</BC>");  
706 -  
707 - num++;  
708 - }  
709 - if(sBuffer.indexOf("<BCList>") != -1){  
710 sBuffer.append("</BCList>"); 700 sBuffer.append("</BCList>");
  701 + sBuffer.append("</SKB>");
711 } 702 }
712 - sBuffer.append("</SKB>");  
713 } 703 }
714 sBuffer.append("</SKBs>"); 704 sBuffer.append("</SKBs>");
715 - logger.info("setSKB:"+sBuffer.toString());  
716 if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ 705 if(ssop.setSKB(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
717 result = "success"; 706 result = "success";
718 } 707 }
719 } catch (Exception e) { 708 } catch (Exception e) {
  709 + logger.error("setSKB:", e);
720 e.printStackTrace(); 710 e.printStackTrace();
721 }finally{ 711 }finally{
  712 + logger.info("setSKB:"+sBuffer.toString());
722 logger.info("setSKB:"+result); 713 logger.info("setSKB:"+result);
723 } 714 }
724 return result; 715 return result;
@@ -730,8 +721,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -730,8 +721,8 @@ public class TrafficManageServiceImpl implements TrafficManageService{
730 @Override 721 @Override
731 public String setXLPC() { 722 public String setXLPC() {
732 String result = "failure"; 723 String result = "failure";
  724 + StringBuffer sBuffer =new StringBuffer();
733 try { 725 try {
734 - StringBuffer sBuffer =new StringBuffer();  
735 sBuffer.append("<XLPCs>"); 726 sBuffer.append("<XLPCs>");
736 // 声明变量 727 // 声明变量
737 Line line = null; 728 Line line = null;
@@ -773,13 +764,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -773,13 +764,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
773 sBuffer.append("</XLPC>"); 764 sBuffer.append("</XLPC>");
774 } 765 }
775 sBuffer.append("</XLPCs>"); 766 sBuffer.append("</XLPCs>");
776 - logger.info("setXLPC:"+sBuffer.toString());  
777 if(ssop.setXLPC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ 767 if(ssop.setXLPC(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
778 result = "success"; 768 result = "success";
779 } 769 }
780 } catch (Exception e) { 770 } catch (Exception e) {
  771 + logger.error("setXLPC:",e);
781 e.printStackTrace(); 772 e.printStackTrace();
782 }finally{ 773 }finally{
  774 + logger.info("setXLPC:"+sBuffer.toString());
783 logger.info("setXLPC:"+result); 775 logger.info("setXLPC:"+result);
784 } 776 }
785 return result; 777 return result;
@@ -832,13 +824,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -832,13 +824,14 @@ public class TrafficManageServiceImpl implements TrafficManageService{
832 sBuffer.append("</CS>"); 824 sBuffer.append("</CS>");
833 } 825 }
834 sBuffer.append("</CSs>"); 826 sBuffer.append("</CSs>");
835 - logger.info("setCS:"+sBuffer.toString());  
836 if(ssop.setCS(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){ 827 if(ssop.setCS(userNameOther, passwordOther, sBuffer.toString()).isSuccess()){
837 result = "success"; 828 result = "success";
838 } 829 }
839 } catch (Exception e) { 830 } catch (Exception e) {
  831 + logger.error("setCS:",e);
840 e.printStackTrace(); 832 e.printStackTrace();
841 } finally { 833 } finally {
  834 + logger.info("setCS:"+sBuffer.toString());
842 logger.info("setCS:"+result); 835 logger.info("setCS:"+result);
843 DBUtils_MS.close(rs, ps, conn); 836 DBUtils_MS.close(rs, ps, conn);
844 } 837 }
@@ -949,11 +942,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -949,11 +942,11 @@ public class TrafficManageServiceImpl implements TrafficManageService{
949 min = fullTime % 60; 942 min = fullTime % 60;
950 sumHour = Integer.valueOf(fcsjArray[0])+hour; 943 sumHour = Integer.valueOf(fcsjArray[0])+hour;
951 if(sumHour >= 24){ 944 if(sumHour >= 24){
952 - result = sumHour - 24+":"; 945 + result = String.format("%02d",sumHour - 24);
953 }else{ 946 }else{
954 - result = sumHour +":"; 947 + result = String.format("%02d",sumHour);;
955 } 948 }
956 - result +=String.format("%02d", min); 949 + result +=":"+String.format("%02d", min);
957 }else{ 950 }else{
958 result = fcsj; 951 result = fcsj;
959 } 952 }
@@ -961,6 +954,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -961,6 +954,26 @@ public class TrafficManageServiceImpl implements TrafficManageService{
961 } 954 }
962 955
963 /** 956 /**
  957 + * 改变时间格式
  958 + * @param ttInfoDetail 时刻表详细
  959 + * @return xx:yy
  960 + */
  961 + private String changeTimeFormat(TTInfoDetail ttInfoDetail){
  962 + String result = "00:00";
  963 + String fcsj = ttInfoDetail.getFcsj();
  964 + if(fcsj.indexOf(":") != -1){
  965 + // 时和分隔开
  966 + String[] fcsjArray = fcsj.split(":");
  967 + result = String.format("%02d", Integer.valueOf(fcsjArray[0]))+":";
  968 + result +=String.format("%02d", Integer.valueOf(fcsjArray[1]));
  969 + }else{
  970 + result = null;
  971 + logger.info("setSKB:发车时间错误:ttInfoDetail.id="+ttInfoDetail.getId());
  972 + }
  973 + return result;
  974 + }
  975 +
  976 + /**
964 * 拼装线路计划班次表的XML 977 * 拼装线路计划班次表的XML
965 * @param sBuffer 978 * @param sBuffer
966 * @param schedulePlanInfo 979 * @param schedulePlanInfo
@@ -993,7 +1006,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -993,7 +1006,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
993 flag = 0; 1006 flag = 0;
994 } 1007 }
995 result += flag; 1008 result += flag;
996 - if(i !=ruleDayArray.length ){ 1009 + if(i !=ruleDayArray.length -1){
997 result +=","; 1010 result +=",";
998 } 1011 }
999 } 1012 }
@@ -1017,15 +1030,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -1017,15 +1030,15 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1017 } 1030 }
1018 } 1031 }
1019 /** 1032 /**
1020 - * @param stations 站点路由集 1033 + * @param stationsList 站点路由集
1021 * @param sBuffer sBuffer 1034 * @param sBuffer sBuffer
1022 - * @param StartId 站点序号起始ID 1035 + * @param startId 站点序号起始ID
1023 * 1036 *
1024 * @return 站点序号累加后的ID 1037 * @return 站点序号累加后的ID
1025 */ 1038 */
1026 private int packagStationXml(List<StationRoute> stationsList,StringBuffer sBuffer,int startId){ 1039 private int packagStationXml(List<StationRoute> stationsList,StringBuffer sBuffer,int startId){
1027 int size = stationsList.size(); 1040 int size = stationsList.size();
1028 - StationRoute srRoute = null; 1041 + StationRoute srRoute;
1029 String zdlx ;// 站点类型:0:起点站、1:终点站、2:中途站 1042 String zdlx ;// 站点类型:0:起点站、1:终点站、2:中途站
1030 for (int i = 0; i < size; i++) { 1043 for (int i = 0; i < size; i++) {
1031 srRoute = stationsList.get(i); 1044 srRoute = stationsList.get(i);
@@ -1062,9 +1075,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{ @@ -1062,9 +1075,7 @@ public class TrafficManageServiceImpl implements TrafficManageService{
1062 */ 1075 */
1063 private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationName){ 1076 private Integer getYgcStationNumByLineCodeAndDirectionAndStationName(String lineCode,String direction,String stationName){
1064 Integer number = 0; 1077 Integer number = 0;
1065 - Map<String, Map> dirs2Statioin = BasicData.stationName2YgcNumber.get(lineCode);  
1066 - Map<String, Integer> station2Number = dirs2Statioin.get(direction);  
1067 - number = station2Number.get(stationName); 1078 + number = BasicData.stationName2YgcNumber.get(lineCode+"_"+direction+"_"+stationName);
1068 return number; 1079 return number;
1069 } 1080 }
1070 } 1081 }
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
@@ -373,7 +373,10 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS @@ -373,7 +373,10 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
373 if(t.getJcsx()==1){ 373 if(t.getJcsx()==1){
374 Double jcyl=t.getCzyl(); 374 Double jcyl=t.getCzyl();
375 zyl=jcyl+jzl-yl; 375 zyl=jcyl+jzl-yl;
376 - Double yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc))); 376 + Double yh=0.0;
  377 + if(zlc>0&&t.getZlc()>0){
  378 + yh=Double.parseDouble(df.format(zyl*(t.getZlc()/zlc)));
  379 + }
377 t.setYh(yh); 380 t.setYh(yh);
378 nextJzyl=t.getJzl()+t.getCzyl()-yh; 381 nextJzyl=t.getJzl()+t.getCzyl()-yh;
379 t.setJzyl(Double.parseDouble(df.format(nextJzyl))); 382 t.setJzyl(Double.parseDouble(df.format(nextJzyl)));
src/main/java/com/bsth/service/realcontrol/LineConfigService.java
1 package com.bsth.service.realcontrol; 1 package com.bsth.service.realcontrol;
2 2
3 -import java.util.Map;  
4 -  
5 import com.bsth.entity.realcontrol.LineConfig; 3 import com.bsth.entity.realcontrol.LineConfig;
6 import com.bsth.service.BaseService; 4 import com.bsth.service.BaseService;
7 5
  6 +import java.util.Map;
  7 +
8 public interface LineConfigService extends BaseService<LineConfig, Integer>{ 8 public interface LineConfigService extends BaseService<LineConfig, Integer>{
9 9
10 Map<String, Object> check(String[] codeArray); 10 Map<String, Object> check(String[] codeArray);
@@ -15,4 +15,5 @@ public interface LineConfigService extends BaseService&lt;LineConfig, Integer&gt;{ @@ -15,4 +15,5 @@ public interface LineConfigService extends BaseService&lt;LineConfig, Integer&gt;{
15 15
16 Map<String, Object> editOutTimeType(String lineCode, int type); 16 Map<String, Object> editOutTimeType(String lineCode, int type);
17 17
  18 + LineConfig getByLineCode(String lineCode);
18 } 19 }
src/main/java/com/bsth/service/realcontrol/RealMapService.java 0 → 100644
  1 +package com.bsth.service.realcontrol;
  2 +
  3 +import java.util.Map;
  4 +
  5 +/**
  6 + * Created by panzhao on 2016/11/23.
  7 + */
  8 +public interface RealMapService {
  9 + Map<String, Object> stationSpatialData(String idx);
  10 +
  11 + Map<String,Object> carParkSpatialData();
  12 +}
src/main/java/com/bsth/service/realcontrol/impl/LineConfigServiceImpl.java
1 package com.bsth.service.realcontrol.impl; 1 package com.bsth.service.realcontrol.impl;
2 2
3 -import java.util.ArrayList;  
4 -import java.util.HashMap;  
5 -import java.util.List;  
6 -import java.util.Map;  
7 -  
8 -import org.springframework.beans.factory.annotation.Autowired;  
9 -import org.springframework.stereotype.Service;  
10 -  
11 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
12 import com.bsth.data.LineConfigData; 4 import com.bsth.data.LineConfigData;
13 import com.bsth.entity.realcontrol.LineConfig; 5 import com.bsth.entity.realcontrol.LineConfig;
14 import com.bsth.repository.realcontrol.LineConfigRepository; 6 import com.bsth.repository.realcontrol.LineConfigRepository;
15 import com.bsth.service.impl.BaseServiceImpl; 7 import com.bsth.service.impl.BaseServiceImpl;
16 import com.bsth.service.realcontrol.LineConfigService; 8 import com.bsth.service.realcontrol.LineConfigService;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +
  12 +import java.util.ArrayList;
  13 +import java.util.HashMap;
  14 +import java.util.List;
  15 +import java.util.Map;
17 16
18 @Service 17 @Service
19 public class LineConfigServiceImpl extends BaseServiceImpl<LineConfig, Integer> implements LineConfigService{ 18 public class LineConfigServiceImpl extends BaseServiceImpl<LineConfig, Integer> implements LineConfigService{
@@ -78,4 +77,9 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt; @@ -78,4 +77,9 @@ public class LineConfigServiceImpl extends BaseServiceImpl&lt;LineConfig, Integer&gt;
78 rs.put("type", type); 77 rs.put("type", type);
79 return rs; 78 return rs;
80 } 79 }
  80 +
  81 + @Override
  82 + public LineConfig getByLineCode(String lineCode) {
  83 + return lineConfigData.get(lineCode);
  84 + }
81 } 85 }
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java 0 → 100644
  1 +package com.bsth.service.realcontrol.impl;
  2 +
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.realcontrol.dto.StationSpatialData;
  5 +import com.bsth.entity.CarPark;
  6 +import com.bsth.service.realcontrol.RealMapService;
  7 +import com.google.common.base.Splitter;
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
  12 +import org.springframework.jdbc.core.JdbcTemplate;
  13 +import org.springframework.stereotype.Service;
  14 +
  15 +import java.util.HashMap;
  16 +import java.util.List;
  17 +import java.util.Map;
  18 +
  19 +/**
  20 + * Created by panzhao on 2016/11/23.
  21 + */
  22 +@Service
  23 +public class RealMapServiceImpl implements RealMapService {
  24 +
  25 + @Autowired
  26 + JdbcTemplate jdbcTemplate;
  27 +
  28 + Logger logger = LoggerFactory.getLogger(this.getClass());
  29 +
  30 + @Override
  31 + public Map<String, Object> stationSpatialData(String idx) {
  32 + Map<String, Object> rs = new HashMap();
  33 +
  34 + try {
  35 + List<String> idArray = Splitter.on(",").splitToList(idx);
  36 + //拼接in语句
  37 + String inStr = "";
  38 + for (String code : idArray) {
  39 + inStr += (",'" + code+"'");
  40 + }
  41 + inStr = " (" + inStr.substring(1) + ")";
  42 +
  43 + String sql = "select r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,s.G_LONX,s.G_LATY,s.RADIUS,s.SHAPES_TYPE,ST_AsText(s.G_POLYGON_GRID) as G_POLYGON_GRID, r.STATION_ROUTE_CODE from bsth_c_stationroute r inner join bsth_c_station s on r.station=s.id where r.line_code in "+inStr+" and r.destroy=0";
  44 +
  45 + List<StationSpatialData> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(StationSpatialData.class));
  46 + rs.put("status", ResponseCode.SUCCESS);
  47 + rs.put("list", list);
  48 + } catch (Exception e) {
  49 + logger.error("", e);
  50 + rs.put("status", ResponseCode.ERROR);
  51 + rs.put("msg", "查询站点空间数据出现异常!");
  52 + }
  53 +
  54 + return rs;
  55 + }
  56 +
  57 + @Override
  58 + public Map<String, Object> carParkSpatialData() {
  59 + Map<String, Object> rs = new HashMap();
  60 +
  61 + try {
  62 + String sql = "select ID, AREA,PARK_CODE,PARK_NAME,ST_AsText(G_PARK_POINT) as G_PARK_POINT,G_CENTER_POINT,RADIUS,SHAPES_TYPE from bsth_c_car_park WHERE destroy=0 and shapes_type='d'";
  63 +
  64 + List<CarPark> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(CarPark.class));
  65 + rs.put("status", ResponseCode.SUCCESS);
  66 + rs.put("list", list);
  67 + } catch (Exception e) {
  68 + logger.error("", e);
  69 + rs.put("status", ResponseCode.ERROR);
  70 + rs.put("msg", "查询停车场空间数据出现异常!");
  71 + }
  72 + return rs;
  73 + }
  74 +}
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -276,8 +276,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -276,8 +276,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
276 return rs; 276 return rs;
277 } 277 }
278 //截取工号 278 //截取工号
279 - if(t.getsGh().indexOf("-") != -1){  
280 - t.setsGh(t.getsGh().split("-")[1]); 279 + if(t.getjGh().indexOf("-") != -1){
  280 + t.setjGh(t.getjGh().split("-")[1]);
281 } 281 }
282 282
283 t.setScheduleDateStr(schDate); 283 t.setScheduleDateStr(schDate);
@@ -1145,7 +1145,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1145,7 +1145,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1145 || scheduleRealInfo.getBcType().equals("venting")){ 1145 || scheduleRealInfo.getBcType().equals("venting")){
1146 ksgl += tempJhlc; 1146 ksgl += tempJhlc;
1147 }else{ 1147 }else{
1148 - yygl += tempJhlc; 1148 + if(scheduleRealInfo.getStatus() != -1){
  1149 + yygl += tempJhlc;
  1150 + }
1149 } 1151 }
1150 }else{ 1152 }else{
1151 Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); 1153 Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
@@ -1154,7 +1156,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1154,7 +1156,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1154 if(childTaskPlan.getMileageType().equals("empty")){ 1156 if(childTaskPlan.getMileageType().equals("empty")){
1155 ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); 1157 ksgl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
1156 }else{ 1158 }else{
1157 - yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage(); 1159 + if(childTaskPlan.isDestroy()){
  1160 + remMileage += tempJhlc;
  1161 + cjbc++;
  1162 + }else{
  1163 + yygl += childTaskPlan.getMileage()==null?0:childTaskPlan.getMileage();
  1164 + }
1158 } 1165 }
1159 } 1166 }
1160 } 1167 }
@@ -1631,7 +1638,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1631,7 +1638,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1631 */ 1638 */
1632 @Override 1639 @Override
1633 public Map<String, Object> multi_dftz(List<DfsjChange> dfsjcs) { 1640 public Map<String, Object> multi_dftz(List<DfsjChange> dfsjcs) {
1634 - Map<String, Object> rs = new HashMap<>(); 1641 + Map<String, Object> rs = new HashMap<>()
  1642 + ,tempMap = new HashMap<>();
1635 List<ScheduleRealInfo> list = new ArrayList<>(); 1643 List<ScheduleRealInfo> list = new ArrayList<>();
1636 1644
1637 ScheduleRealInfo sch,next; 1645 ScheduleRealInfo sch,next;
@@ -1639,20 +1647,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1639,20 +1647,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1639 if(StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj())) 1647 if(StringUtils.isEmpty(dc.getOld_dfsj()) || StringUtils.isEmpty(dc.getNew_dfsj()))
1640 continue; 1648 continue;
1641 1649
1642 - sch = dayOfSchedule.get(dc.getSchId()); 1650 + /*sch = dayOfSchedule.get(dc.getSchId());
1643 if(sch==null) 1651 if(sch==null)
1644 continue; 1652 continue;
1645 1653
1646 sch.setDfsjAll(dc.getNew_dfsj()); 1654 sch.setDfsjAll(dc.getNew_dfsj());
1647 //重新计算终点时间 1655 //重新计算终点时间
1648 sch.calcEndTime(); 1656 sch.calcEndTime();
1649 - list.add(sch); 1657 + list.add(sch);*/
  1658 + tempMap = outgoAdjust(dc.getSchId(),"", dc.getNew_dfsj());
1650 1659
1651 - next=dayOfSchedule.next(sch);  
1652 - if(next.getQdzName().equals(sch.getZdzName())){ 1660 + if(tempMap.get("status").equals(ResponseCode.SUCCESS)){
  1661 + list.addAll((Collection<? extends ScheduleRealInfo>) tempMap.get("ts"));
  1662 + }
  1663 + //next=dayOfSchedule.next(sch);
  1664 + /*if(next.getQdzName().equals(sch.getZdzName())){
1653 next.setQdzArrDateJH(sch.getZdsj()); 1665 next.setQdzArrDateJH(sch.getZdsj());
1654 list.add(next); 1666 list.add(next);
1655 - } 1667 + }*/
1656 } 1668 }
1657 1669
1658 rs.put("status", ResponseCode.SUCCESS); 1670 rs.put("status", ResponseCode.SUCCESS);
src/main/java/com/bsth/service/report/ReportService.java
@@ -18,4 +18,12 @@ public interface ReportService { @@ -18,4 +18,12 @@ public interface ReportService {
18 List<Map<String, String>> sreachZd(String line,int zdlx,String zd); 18 List<Map<String, String>> sreachZd(String line,int zdlx,String zd);
19 19
20 List<Object[]> historyMessageCount(String line, String date, String code); 20 List<Object[]> historyMessageCount(String line, String date, String code);
  21 +
  22 + Map<String, Object> tbodyTime1(String line ,String date);
  23 +
  24 + Map<String, Object> tbodyTime2(String line ,String date);
  25 +
  26 + List<Map<String, Object>> tbodyTime3(String line ,String date);
  27 + List<Map<String, Object>> tbodyTime5(String line ,String date);
  28 +
21 } 29 }
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -3,6 +3,7 @@ import java.sql.Connection; @@ -3,6 +3,7 @@ import java.sql.Connection;
3 import java.sql.PreparedStatement; 3 import java.sql.PreparedStatement;
4 import java.sql.ResultSet; 4 import java.sql.ResultSet;
5 import java.sql.SQLException; 5 import java.sql.SQLException;
  6 +import java.text.DecimalFormat;
6 import java.text.ParseException; 7 import java.text.ParseException;
7 import java.text.SimpleDateFormat; 8 import java.text.SimpleDateFormat;
8 import java.util.ArrayList; 9 import java.util.ArrayList;
@@ -16,12 +17,15 @@ import org.slf4j.Logger; @@ -16,12 +17,15 @@ import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory; 17 import org.slf4j.LoggerFactory;
17 import org.springframework.beans.factory.annotation.Autowired; 18 import org.springframework.beans.factory.annotation.Autowired;
18 import org.springframework.jdbc.core.JdbcTemplate; 19 import org.springframework.jdbc.core.JdbcTemplate;
  20 +import org.springframework.jdbc.core.RowMapper;
19 import org.springframework.stereotype.Service; 21 import org.springframework.stereotype.Service;
20 22
21 import com.bsth.data.BasicData; 23 import com.bsth.data.BasicData;
22 import com.bsth.entity.StationRoute; 24 import com.bsth.entity.StationRoute;
23 import com.bsth.entity.excep.ArrivalInfo; 25 import com.bsth.entity.excep.ArrivalInfo;
  26 +import com.bsth.entity.oil.Ylb;
24 import com.bsth.entity.realcontrol.ScheduleRealInfo; 27 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  28 +import com.bsth.entity.schedule.SchedulePlanInfo;
25 import com.bsth.repository.StationRouteRepository; 29 import com.bsth.repository.StationRouteRepository;
26 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 30 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
27 import com.bsth.service.report.ReportService; 31 import com.bsth.service.report.ReportService;
@@ -252,5 +256,515 @@ public class ReportServiceImpl implements ReportService{ @@ -252,5 +256,515 @@ public class ReportServiceImpl implements ReportService{
252 List<Object[]> list = scheduleRealInfoRepository.historyMessageCount(line, date, code); 256 List<Object[]> list = scheduleRealInfoRepository.historyMessageCount(line, date, code);
253 return list; 257 return list;
254 } 258 }
  259 + @Override
  260 + public Map<String, Object> tbodyTime1(String line, String date) {
  261 + DecimalFormat df = new DecimalFormat("#0.00");
  262 + // TODO Auto-generated method stub
  263 + //查询配车
  264 + String sqlPc=" SELECT cl_zbh FROM bsth_c_s_sp_info "
  265 + +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' "
  266 + + " and xl_bm='"+line+"' and bc_type='normal' "
  267 + + " group by cl_zbh ";
  268 + Map<String, Object> map=new HashMap<String,Object>();
  269 + List<Map<String, Object>> listPc= jdbcTemplate.query(sqlPc,
  270 + new RowMapper<Map<String, Object>>(){
  271 + @Override
  272 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  273 + Map<String, Object> m=new HashMap<String,Object>();
  274 + m.put("zbh", rs.getString("cl_zbh"));
  275 + return m;
  276 + }
  277 + });
  278 + //配车
  279 + int pcs=listPc.size();
  280 +
  281 +
  282 + String sqlPlan="select jhlc, bc_type ,fcsj from bsth_c_s_sp_info "
  283 + + "where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'";
  284 +
  285 + //班次
  286 + int zgf_0 = 6*60+31,zgf_1 = 8*60+30,wgf_0 = 16*60+1,wgf_1 = 18*60;
  287 + int qcBc=0,qjBc=0,zqcBc=0,zqjBc=0,wqcBc=0,wqjBc=0;
  288 + double zlc = 0 , yylc = 0,kslc=0;
  289 + //查询班次
  290 + List<Map<String, Object>> listPlan= jdbcTemplate.query(sqlPlan,
  291 + new RowMapper<Map<String, Object>>(){
  292 + @Override
  293 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  294 + Map<String, Object> m2=new HashMap<String,Object>();
  295 + m2.put("jhlc", rs.getDouble("jhlc"));
  296 + m2.put("bcType", rs.getString("bc_type"));
  297 + m2.put("fcsj", rs.getString("fcsj"));
  298 + return m2;
  299 + }
  300 + });
  301 +
  302 + for (int i = 0; i < listPlan.size(); i++) {
  303 + Map<String, Object> m=listPlan.get(i);
  304 + double jhlc=Double.parseDouble(m.get("jhlc").toString());
  305 + String bcType=m.get("bcType").toString();
  306 + String fcsjs[]=m.get("fcsj").toString().split(":");
  307 +
  308 + zlc +=jhlc;
  309 + if(bcType.equals("normal")){
  310 + qcBc ++;
  311 + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
  312 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
  313 + zqcBc++;
  314 + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
  315 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
  316 + wqcBc++;
  317 + }
  318 + yylc +=jhlc;
  319 + }else if(bcType.equals("region")){
  320 + qjBc++;
  321 + if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > zgf_0
  322 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < zgf_1){
  323 + zqjBc++;
  324 + }else if((Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) > wgf_0
  325 + && (Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1])) < wgf_1){
  326 + wqjBc++;
  327 + }
  328 +
  329 + yylc+=jhlc;
  330 + }else{
  331 + kslc+=jhlc;
  332 + }
  333 + }
  334 +
  335 + map.put("pcs", pcs);
  336 + map.put("qcbc", qcBc);
  337 + map.put("qjbc", qjBc);
  338 + map.put("zqcbc", zqcBc);
  339 + map.put("zqjbc", zqjBc);
  340 + map.put("wqcbc", wqcBc);
  341 + map.put("wqjbc", wqjBc);
  342 + map.put("zlc", df.format( zlc));
  343 + map.put("yylc", df.format(yylc));
  344 + map.put("kslc",df.format( kslc));
  345 + //查询里程
  346 + return map;
  347 + }
  348 + @Override
  349 + public Map<String, Object> tbodyTime2(String line, String date) {
  350 + DecimalFormat df = new DecimalFormat("#0.00");
  351 + // TODO Auto-generated method stub
  352 + //查询配车
  353 + String sqlPc=" SELECT sum(bcsj) as yysj ,sum(jhlc) as yygl FROM bsth_c_s_sp_info "
  354 + +" where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' "
  355 + + " and xl_bm='"+line+"' and bc_type in ('normal' ,'region' )";
  356 + Map<String, Object> map=new HashMap<String,Object>();
  357 + List<Map<String, Object>> list= jdbcTemplate.query(sqlPc,
  358 + new RowMapper<Map<String, Object>>(){
  359 + @Override
  360 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  361 + Map<String, Object> m=new HashMap<String,Object>();
  362 + m.put("yysj", rs.getInt("yysj"));
  363 + m.put("yygl", rs.getString("yygl")==null?"0":rs.getString("yygl"));
  364 + return m;
  365 + }
  366 + });
  367 + int yysj=0 ;
  368 + double yycs=0 ,yygl=0;
  369 + if(list.size()>0){
  370 + Map<String, Object> m=list.get(0);
  371 + yysj=Integer.parseInt((m.get("yysj").toString()));
  372 + yygl=Double.parseDouble(m.get("yygl").toString());
  373 + }
  374 + if(yysj>0){
  375 + yycs =yygl/(yysj*1.0/60);
  376 + }
  377 + int hh=yysj/60;
  378 + int mm=yysj%60;
  379 +
  380 + map.put("yysj", hh+":"+mm);
  381 + map.put("yycs", df.format(yycs)+"公里/小时");
  382 +// map.put(key, value)
  383 + return map;
  384 + }
255 385
  386 + public static void main(String[] args) {
  387 + System.out.println(609360/60);
  388 + System.out.println(609360%60);
  389 + }
  390 + @Override
  391 + public List<Map<String, Object>> tbodyTime3(String line, String date) {
  392 + // TODO Auto-generated method stub
  393 + List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
  394 + String sqlZd=" select qdz_name, count(cl_zbh) as cls , 'zqc' as lx from bsth_c_s_sp_info where "
  395 + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' and bc_type='normal' "
  396 + + " and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union "
  397 + + " select qdz_name, count(cl_zbh) as cls , 'wqc' as lx from bsth_c_s_sp_info "
  398 + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' "
  399 + + " and bc_type='normal' and fcsj>'16:01' and fcsj<'18:00' group by qdz_name union "
  400 + + " select qdz_name, count(cl_zbh) as cls , 'zqj' as lx from bsth_c_s_sp_info "
  401 + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' "
  402 + + " and bc_type='region' and fcsj>'06:31' and fcsj<'08:00' group by qdz_name union "
  403 + + " select qdz_name, count(cl_zbh) as cls , 'wqj' as lx from bsth_c_s_sp_info "
  404 + + " where DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"' "
  405 + + " and bc_type='region' and fcsj>'16:01' and fcsj<'18:00'group by qdz_name";
  406 +
  407 + List<Map<String, Object>> lists= jdbcTemplate.query(sqlZd,
  408 + new RowMapper<Map<String, Object>>(){
  409 + @Override
  410 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  411 + Map<String, Object> m=new HashMap<String,Object>();
  412 + m.put("zdm", rs.getString("qdz_name"));
  413 + m.put("cls", rs.getString("cls"));
  414 + m.put("lx", rs.getString("lx"));
  415 + return m;
  416 + }
  417 + });
  418 + int a=0;
  419 + int b=0;
  420 + int c=0;
  421 + int d=0;
  422 + for(int i=0;i<lists.size();i++){
  423 + boolean fage=true;
  424 + Map<String, Object> newMap= new HashMap<String, Object>();
  425 + list.add(newMap);
  426 + Map<String, Object> maps=lists.get(i);
  427 + if(maps.get("lx").equals("zqc")){
  428 + list.get(a).put("zqcZm", maps.get("zdm"));
  429 + list.get(a).put("zqcCls", maps.get("cls"));
  430 + a++;
  431 + fage=false;
  432 + }else if(maps.get("lx").equals("wqc")){
  433 + list.get(b).put("wqcZm", maps.get("zdm"));
  434 + list.get(b).put("wqcCls", maps.get("cls"));
  435 + b++;
  436 + fage=false;
  437 + }else if(maps.get("lx").equals("zqj")){
  438 + list.get(c).put("zqjZm", maps.get("zdm"));
  439 + list.get(c).put("zqjCls", maps.get("cls"));
  440 + c++;
  441 + fage=false;
  442 + }else if(maps.get("lx").equals("wqj")){
  443 + list.get(d).put("wqjZm", maps.get("zdm"));
  444 + list.get(d).put("wqjCls", maps.get("cls"));
  445 + d++;
  446 + fage=false;
  447 + }
  448 + if(fage){
  449 + break;
  450 + }
  451 + }
  452 + boolean status=true;
  453 + while (status) {
  454 + for (int i = 0; i < list.size(); i++) {
  455 + if(list.get(i).isEmpty()){
  456 + list.remove(i);
  457 + status=true;
  458 + }else{
  459 + status=false;
  460 + }
  461 + }
  462 +
  463 + }
  464 + return list;
  465 + }
  466 + @Override
  467 + public List<Map<String, Object>> tbodyTime5(String line, String date) {
  468 + // TODO Auto-generated method stub
  469 + String sql="select min(fcsj) as fcsj,'lx0' as lx from bsth_c_s_sp_info where "
  470 + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'"
  471 + + " and bc_type='out' and xl_dir=0 union "
  472 + + " select min(fcsj) as fcsj,'lx1' as lx from bsth_c_s_sp_info where "
  473 + + " DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'"
  474 + + " and bc_type='out' and xl_dir=1";
  475 + List<Map<String, Object>> lists= jdbcTemplate.query(sql,
  476 + new RowMapper<Map<String, Object>>(){
  477 + @Override
  478 + public Map<String, Object> mapRow(ResultSet rs, int rowNum) throws SQLException {
  479 + Map<String, Object> m=new HashMap<String,Object>();
  480 + m.put("lx", rs.getString("lx"));
  481 + m.put("fcsj", rs.getString("fcsj"));
  482 + return m;
  483 + }
  484 + });
  485 +
  486 + String sqlList="select * from bsth_c_s_sp_info where "
  487 + + "DATE_FORMAT(schedule_date,'%Y-%m-%d') ='"+date+"' and xl_bm='"+line+"'"
  488 + + " and bc_type='normal' order by fcsj";
  489 + List<SchedulePlanInfo> list= jdbcTemplate.query(sqlList,
  490 + new RowMapper<SchedulePlanInfo>(){
  491 + @Override
  492 + public SchedulePlanInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
  493 + SchedulePlanInfo m=new SchedulePlanInfo();
  494 + m.setBcsj(rs.getInt("bcsj"));
  495 + m.setXlDir(rs.getString("xl_dir"));
  496 + m.setFcsj(rs.getString("fcsj"));
  497 + return m;
  498 + }
  499 + });
  500 + //上下行最早发车时间 (用于与夜班线 跨零点的班次进行比较)
  501 + String lx0="";
  502 + String lx1="";
  503 + for (int x = 0; x < lists.size(); x++) {
  504 + if(lists.get(x).get("lx").equals("lx0")){
  505 + lx0=lists.get(x).get("fcsj").toString();
  506 + }else{
  507 + lx1=lists.get(x).get("fcsj").toString();
  508 + }
  509 + }
  510 +
  511 + String[] lx0sj = lx0.split(":");
  512 + int sxFc=Integer.parseInt(lx0sj[0])*60+Integer.parseInt(lx0sj[1]);
  513 + String[] lx1sj = lx1.split(":");
  514 + int xxFc=Integer.parseInt(lx1sj[0])*60+Integer.parseInt(lx1sj[1]);
  515 + //班次
  516 + int sj_0 = 6*60+31,sj_1 = 8*60+30,sj_2 = 16*60+1,sj_3 = 18*60;
  517 +
  518 + //顺序 出场--早高峰---中午---晚高峰---进场
  519 + //实驶时间时间(分),0为上行,1为下行
  520 + int ccsj0=0,ccsj1=0,zgf0=0,zgf1=0,zw0=0,zw1=0,wgf0=0,wgf1=0,jcsj0=0,jcsj1=0;
  521 +
  522 + //记录上一个发车时间(方便记录间距)
  523 + int cfc0=0,cfc1=0,zfc0=0,zfc1=0,zwfc0=0,zwfc1=0,wfc0=0,wfc1=0,jcfc0Z=0,jcfc1Z=0,jcfc0W=0,jcfc1W=0;
  524 + //车距 (发车时间的间距) i--MIN a--MAX
  525 + int iC=999,aC=-1,iZg=999,aZg=-1,iZw=999,aZw=-1,iWg=999,aWg=-1,iJcZ=999,aJcZ=-1,iJcW=999,aJcW=-1;
  526 + int iC1=999,aC1=-1,iZg1=999,aZg1=-1,iZw1=999,aZw1=-1,iWg1=999,aWg1=-1,iJc1Z=999,aJc1Z=-1,iJc1W=999,aJc1W=-1;
  527 +// List<ScheduleRealInfo> list = scheduleRealInfoRepository.scheduleByDateAndLine(line, date);
  528 + for(int i=0;i<list.size();i++){
  529 + SchedulePlanInfo t=list.get(i);
  530 + String xlDir=t.getXlDir();
  531 + int bcsj=t.getBcsj();
  532 + String fcsj=t.getFcsj();
  533 + String[] fcsjs=fcsj.split(":");
  534 + int fcsjNum=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]);
  535 +
  536 + if(xlDir.equals("0")){
  537 + if(fcsjNum>=sxFc && fcsjNum<sj_0){
  538 + ccsj0 +=bcsj;
  539 + if(aC<0){
  540 + cfc0 =fcsjNum;
  541 + aC=0;
  542 + }else{
  543 + if(fcsjNum-cfc0<iC){
  544 + iC=fcsjNum-cfc0;
  545 + }
  546 + if(fcsjNum-cfc0>aC){
  547 + aC=fcsjNum-cfc0;
  548 + }
  549 +
  550 + cfc0=fcsjNum;
  551 + }
  552 +
  553 + }else if(fcsjNum>=sj_0 && fcsjNum<=sj_1){
  554 + zgf0 +=bcsj;
  555 + if(aZg<0){
  556 + zfc0 =fcsjNum;
  557 + aZg=0;
  558 + }else{
  559 + if(fcsjNum-zfc0<iZg){
  560 + iZg=fcsjNum-zfc0;
  561 + }
  562 +
  563 + if(fcsjNum-zfc0>aZg){
  564 + aZg=fcsjNum-zfc0;
  565 + }
  566 +
  567 + zfc0=fcsjNum;
  568 + }
  569 + }else if(fcsjNum>sj_1 && fcsjNum<sj_2){
  570 + zw0 +=bcsj;
  571 + if(aZw<0){
  572 + zwfc0 =fcsjNum;
  573 + aZw=0;
  574 + }else{
  575 + if(fcsjNum-zwfc0<iZw){
  576 + iZw=fcsjNum-zwfc0;
  577 + }
  578 + if(fcsjNum-zwfc0>aZw){
  579 + aZw=fcsjNum-zwfc0;
  580 + }
  581 + zwfc0=fcsjNum;
  582 + }
  583 +
  584 + }else if(fcsjNum>=sj_2 && fcsjNum<=sj_3){
  585 + wgf0 +=bcsj;
  586 + if(aWg<0){
  587 + wfc0=fcsjNum;
  588 + aWg=0;
  589 + }else{
  590 + if(fcsjNum-wfc0<iWg){
  591 + iWg=fcsjNum-wfc0;
  592 + }
  593 + if(fcsjNum-wfc0>aWg){
  594 + aWg=fcsjNum-wfc0;
  595 + }
  596 + wfc0=fcsjNum;
  597 + }
  598 + }else if(fcsjNum>sj_3){
  599 + jcsj0 +=bcsj;
  600 + if(aJcW<0){
  601 + jcfc0W=fcsjNum;
  602 + aJcW=0;
  603 + }else{
  604 + if(fcsjNum-jcfc0W<iJcW){
  605 + iJcW=fcsjNum-jcfc0W;
  606 + }
  607 + if(fcsjNum-jcfc0W>aJcW){
  608 + aJcW=fcsjNum-jcfc0W;
  609 + }
  610 + jcfc0W=fcsjNum;
  611 + }
  612 + }else if(fcsjNum<sxFc){
  613 + jcsj0 +=bcsj;
  614 + if(aJcZ<0){
  615 + jcfc0Z=fcsjNum;
  616 + aJcZ=0;
  617 + }else{
  618 + if(fcsjNum-jcfc0Z<iJcZ){
  619 + iJcZ=fcsjNum-jcfc0Z;
  620 + }
  621 + if(fcsjNum-jcfc0Z>aJcZ){
  622 + aJcZ=fcsjNum-jcfc0Z;
  623 + }
  624 + jcfc0Z=fcsjNum;
  625 + }
  626 + }
  627 +
  628 +
  629 + }else{
  630 + if(fcsjNum>=xxFc && fcsjNum<sj_0){
  631 + ccsj1 +=bcsj;
  632 + if(aC1<0){
  633 + cfc1=fcsjNum;
  634 + aC1=0;
  635 + }else{
  636 + if(fcsjNum-cfc1<iC1){
  637 + iC1=fcsjNum-cfc1;
  638 + }
  639 + if(fcsjNum-cfc1>aC1){
  640 + aC1=fcsjNum-cfc1;
  641 + }
  642 + cfc1=fcsjNum;
  643 + }
  644 + }else if(fcsjNum>=sj_0 && fcsjNum<=sj_1){
  645 + zgf1 +=bcsj;
  646 + if(aZg1<0){
  647 + zfc1=fcsjNum;
  648 + aZg1=0;
  649 + }else{
  650 + if(fcsjNum-zfc1<iZg1){
  651 + iZg1=fcsjNum-zfc1;
  652 + }
  653 + if(fcsjNum-zfc1>aZg1){
  654 + aZg1=fcsjNum-zfc1;
  655 + }
  656 +
  657 + zfc1=fcsjNum;
  658 + }
  659 + }else if(fcsjNum>sj_1 && fcsjNum<sj_2){
  660 + zw1 +=bcsj;
  661 + if(aZw1<0){
  662 + zwfc1=fcsjNum;
  663 + aZw1=0;
  664 + }else{
  665 + if(fcsjNum-zwfc1<iZw1){
  666 + iZw1=fcsjNum-zwfc1;
  667 + }
  668 + if(fcsjNum-zwfc1>aZw1){
  669 + aZw1=fcsjNum-zwfc1;
  670 + }
  671 + zwfc1=fcsjNum;
  672 + }
  673 + }else if(fcsjNum>=sj_2 && fcsjNum<=sj_3){
  674 + wgf1 +=bcsj;
  675 + if(aWg1<0){
  676 + wfc1=fcsjNum;
  677 + aWg1=0;
  678 + }else{
  679 + if(fcsjNum-wfc1<iWg1){
  680 + iWg1=fcsjNum-wfc1;
  681 + }
  682 + if(fcsjNum-wfc1<aWg1){
  683 + aWg1=fcsjNum-wfc1;
  684 + }
  685 + wfc1=fcsjNum;
  686 + }
  687 + }else if(fcsjNum>sj_3){
  688 + jcsj1 +=bcsj;
  689 + if(aJc1W<0){
  690 + jcfc1W=fcsjNum;
  691 + aJc1W=0;
  692 + }else{
  693 + if(fcsjNum-jcfc1W<iJc1W){
  694 + aJc1W=fcsjNum-jcfc1W;
  695 + }
  696 + if(fcsjNum-jcfc1W>aJc1W){
  697 + aJc1W=fcsjNum-jcfc1W;
  698 + }
  699 +
  700 + jcfc1W=fcsjNum;
  701 + }
  702 + }else if(fcsjNum<xxFc){
  703 + jcsj1 +=bcsj;
  704 + if(aJc1Z<0){
  705 + jcfc1Z=fcsjNum;
  706 + aJc1Z=0;
  707 + }else{
  708 + if(fcsjNum-jcfc1Z<iJc1Z){
  709 + aJc1Z=fcsjNum-jcfc1Z;
  710 + }
  711 + if(fcsjNum-jcfc1Z>aJc1Z){
  712 + aJc1Z=fcsjNum-jcfc1Z;
  713 + }
  714 +
  715 + jcfc1Z=fcsjNum;
  716 + }
  717 + }
  718 + }
  719 +
  720 + }
  721 +
  722 +
  723 + List<Map<String, Object>> newList=new ArrayList<Map<String,Object>>();
  724 + Map<String, Object> newmap1=new HashMap<String,Object>();
  725 + Map<String, Object> newmap2=new HashMap<String,Object>();
  726 + Map<String, Object> newmap3=new HashMap<String,Object>();
  727 + Map<String, Object> newmap4=new HashMap<String,Object>();
  728 + Map<String, Object> newmap5=new HashMap<String,Object>();
  729 + newmap1.put("sjd", "(首)——6:30");
  730 + newmap1.put("sxsj", ccsj0);
  731 + newmap1.put("xxsj", ccsj1);
  732 + newmap1.put("fqsj", ccsj0+ccsj1);
  733 + newmap1.put("cj", (iC-iC1>0?iC1:iC)+"——"+(aC-aC1>0?aC:aC1));
  734 +
  735 + newmap2.put("sjd", "6:31——8:30");
  736 + newmap2.put("sxsj", zgf0);
  737 + newmap2.put("xxsj", zgf1);
  738 + newmap2.put("fqsj", zgf1+zgf0);
  739 + newmap2.put("cj", (iZg-iZg1>0?iZg1:iZg)+"——"+(aZg-aZg1>0?aZg:aZg1));
  740 +
  741 + newmap3.put("sjd", "8:30——16:00");
  742 + newmap3.put("sxsj", zw0);
  743 + newmap3.put("xxsj", zw1);
  744 + newmap3.put("fqsj", zw0+zw1);
  745 + newmap3.put("cj", (iZw-iZw1>0?iZw1:iZw)+"——"+(aZw-aZw1>0?aZw:aZw1));
  746 +
  747 + newmap4.put("sjd", "16:01——18:00");
  748 + newmap4.put("sxsj", wgf0);
  749 + newmap4.put("xxsj", wgf1);
  750 + newmap4.put("fqsj", wgf0+wgf1);
  751 + newmap4.put("cj", (iWg-iWg1>0?iWg1:iWg)+"——"+(aWg-aWg1>0?aWg:aWg1));
  752 +
  753 + newmap5.put("sjd", "18:00——(末)");
  754 + newmap5.put("sxsj", jcsj0);
  755 + newmap5.put("xxsj", jcsj1);
  756 + newmap5.put("fqsj", jcsj0+jcsj1);
  757 + int min0=iJcZ-iJcW>0?iJcW:iJcZ;
  758 + int max0=aJcZ-aJcW>0?aJcZ:aJcW;
  759 + int min1=iJc1Z-iJc1W>0?iJc1W:iJc1Z;
  760 + int max1=aJc1Z-aJc1W>0?aJc1Z:aJc1W;
  761 + newmap5.put("cj", (min0-min1>0?min1:min0)+"——"+(max0-max1>0?max0:max1));
  762 +
  763 + newList.add(newmap1);
  764 + newList.add(newmap2);
  765 + newList.add(newmap3);
  766 + newList.add(newmap4);
  767 + newList.add(newmap5);
  768 + return newList;
  769 + }
256 } 770 }
src/main/resources/application-dev.properties
@@ -8,7 +8,7 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy @@ -8,7 +8,7 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 spring.jpa.database= MYSQL 8 spring.jpa.database= MYSQL
9 spring.jpa.show-sql= false 9 spring.jpa.show-sql= false
10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11 -spring.datasource.url= jdbc:mysql://192.168.168.201/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false 11 +spring.datasource.url= jdbc:mysql://192.168.168.201/mh_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 spring.datasource.username= root 12 spring.datasource.username= root
13 spring.datasource.password= 123456 13 spring.datasource.password= 123456
14 #DATASOURCE 14 #DATASOURCE
src/main/resources/application-prod.properties
@@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 spring.jpa.database= MYSQL 8 spring.jpa.database= MYSQL
9 spring.jpa.show-sql= false 9 spring.jpa.show-sql= false
10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11 -spring.datasource.url= jdbc:mysql://192.168.40.100:3306/qp_control?useUnicode=true&characterEncoding=utf-8&useSSL=false 11 +spring.datasource.url= jdbc:mysql://192.168.168.171:3306/control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 spring.datasource.username= root 12 spring.datasource.username= root
13 -spring.datasource.password= root@JSP2jsp 13 +spring.datasource.password= root2jsp
14 #DATASOURCE 14 #DATASOURCE
15 spring.datasource.max-active=100 15 spring.datasource.max-active=100
16 spring.datasource.max-idle=8 16 spring.datasource.max-idle=8
@@ -26,6 +26,6 @@ spring.datasource.validation-query=select 1 @@ -26,6 +26,6 @@ spring.datasource.validation-query=select 1
26 ## 26 ##
27 #222.66.0.204:5555 27 #222.66.0.204:5555
28 ##\u5B9E\u65F6gps 28 ##\u5B9E\u65F6gps
29 -http.gps.real.url= http://192.168.40.82:8080/transport_server/rtgps/ 29 +http.gps.real.url= http://192.168.168.171:8080/transport_server/rtgps/
30 ##\u6D88\u606F\u4E0B\u53D1 30 ##\u6D88\u606F\u4E0B\u53D1
31 -http.send.directive = http://192.168.40.82:8080/transport_server/message/  
32 \ No newline at end of file 31 \ No newline at end of file
  32 +http.send.directive = http://192.168.168.171:8080/transport_server/message/
33 \ No newline at end of file 33 \ No newline at end of file
src/main/resources/datatools/config-prod.properties
@@ -5,13 +5,13 @@ datatools.kettle_properties=/datatools/kettle.properties @@ -5,13 +5,13 @@ datatools.kettle_properties=/datatools/kettle.properties
5 # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正) 5 # 2、ktr文件通用配置变量(数据库连接,根据不同的环境需要修正)
6 6
7 #数据库ip地址 7 #数据库ip地址
8 -datatools.kvars_dbip=192.168.40.100 8 +datatools.kvars_dbip=192.168.168.171
9 #数据库用户名 9 #数据库用户名
10 datatools.kvars_dbuname=root 10 datatools.kvars_dbuname=root
11 #数据库密码 11 #数据库密码
12 -datatools.kvars_dbpwd=root@JSP2jsp 12 +datatools.kvars_dbpwd=root2jsp
13 #数据库库名 13 #数据库库名
14 -datatools.kvars_dbdname=qp_control 14 +datatools.kvars_dbdname=control
15 15
16 # 3、上传数据配置信息 16 # 3、上传数据配置信息
17 # 上传文件目录配置(根据不同的环境需要修正) 17 # 上传文件目录配置(根据不同的环境需要修正)