Commit 89c1fc5a29b96f519766f9272f18eb81199dd8b1

Authored by 娄高锋
2 parents 90cd03ea 4a3754ef

Merge branch 'pudong_jdk8' of http://61.169.120.202:8888/panzhaov5/bsth_control into pudong_jdk8

Too many changes to show.

To preserve performance only 14 of 36 files are displayed.

src/main/java/com/bsth/common/SystemParamKeys.java
@@ -7,6 +7,8 @@ public class SystemParamKeys { @@ -7,6 +7,8 @@ public class SystemParamKeys {
7 7
8 public static final String SPECIAL_ROLES = "special.roles"; 8 public static final String SPECIAL_ROLES = "special.roles";
9 9
  10 + public static final String SPECIAL_DAYS = "special.days";
  11 +
10 public static final String URL_HTTP_GPS_REAL_CACHE = "url.http.gps.real.cache"; 12 public static final String URL_HTTP_GPS_REAL_CACHE = "url.http.gps.real.cache";
11 13
12 public static final String URL_HTTP_GPS_REAL = "url.http.gps.real"; 14 public static final String URL_HTTP_GPS_REAL = "url.http.gps.real";
src/main/java/com/bsth/controller/GeoPremiseController.java
@@ -3,6 +3,7 @@ package com.bsth.controller; @@ -3,6 +3,7 @@ package com.bsth.controller;
3 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
4 import com.bsth.entity.GeoPremise; 4 import com.bsth.entity.GeoPremise;
5 import com.bsth.service.GeoPremiseService; 5 import com.bsth.service.GeoPremiseService;
  6 +import com.bsth.util.GeoConverter;
6 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.web.bind.annotation.RequestMapping; 8 import org.springframework.web.bind.annotation.RequestMapping;
8 import org.springframework.web.bind.annotation.RequestMethod; 9 import org.springframework.web.bind.annotation.RequestMethod;
@@ -26,6 +27,8 @@ public class GeoPremiseController extends BaseController<GeoPremise, Integer> { @@ -26,6 +27,8 @@ public class GeoPremiseController extends BaseController<GeoPremise, Integer> {
26 public Map<String, Object> save(GeoPremise geoPremise) { 27 public Map<String, Object> save(GeoPremise geoPremise) {
27 Map<String, Object> result = new HashMap<>(); 28 Map<String, Object> result = new HashMap<>();
28 try { 29 try {
  30 + String coords = geoPremise.getCoords();
  31 + geoPremise.setCoordsWgs(GeoConverter.polygonBd2wgs(String.format("POLYGON((%s))", coords)).toString().replace("POLYGON((", "").replace("))", ""));
29 result.putAll(geoPremiseService.save(geoPremise)); 32 result.putAll(geoPremiseService.save(geoPremise));
30 result.put("status", ResponseCode.SUCCESS); 33 result.put("status", ResponseCode.SUCCESS);
31 } catch (Exception e) { 34 } catch (Exception e) {
src/main/java/com/bsth/controller/realcontrol/AdminUtilsController.java
@@ -8,7 +8,6 @@ import com.bsth.data.BasicData; @@ -8,7 +8,6 @@ import com.bsth.data.BasicData;
8 import com.bsth.security.SsoConfig; 8 import com.bsth.security.SsoConfig;
9 import com.bsth.service.SectionService; 9 import com.bsth.service.SectionService;
10 import com.bsth.service.StationService; 10 import com.bsth.service.StationService;
11 -import com.bsth.data.SystemParamCache;  
12 import com.bsth.data.directive.DayOfDirectives; 11 import com.bsth.data.directive.DayOfDirectives;
13 import com.bsth.data.directive.DirectivesPstThread; 12 import com.bsth.data.directive.DirectivesPstThread;
14 import com.bsth.data.directive.GatewayHttpUtils; 13 import com.bsth.data.directive.GatewayHttpUtils;
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
1 -package com.bsth.controller.realcontrol;  
2 -  
3 -import com.alibaba.fastjson.serializer.PropertyFilter;  
4 -import com.bsth.common.ResponseCode;  
5 -import com.bsth.data.BasicData;  
6 -import com.bsth.data.Station2ParkBuffer;  
7 -import com.bsth.data.pinyin.PersionPinYin;  
8 -import com.bsth.data.pinyin.PersionPinYinBuffer;  
9 -import com.bsth.entity.Line;  
10 -import com.bsth.entity.realcontrol.StationToPark;  
11 -import com.google.common.base.Splitter;  
12 -import com.google.common.collect.ArrayListMultimap;  
13 -import com.google.common.collect.BiMap;  
14 -import org.slf4j.Logger;  
15 -import org.slf4j.LoggerFactory;  
16 -import org.springframework.beans.factory.annotation.Autowired;  
17 -import org.springframework.web.bind.annotation.RequestMapping;  
18 -import org.springframework.web.bind.annotation.RequestMethod;  
19 -import org.springframework.web.bind.annotation.RequestParam;  
20 -import org.springframework.web.bind.annotation.RestController;  
21 -  
22 -import java.util.*;  
23 -  
24 -@RestController  
25 -@RequestMapping("/basic")  
26 -public class BasicDataController {  
27 -  
28 - @Autowired  
29 - BasicData.BasicDataLoader dataLoader;  
30 -  
31 - @Autowired  
32 - BasicData basicData;  
33 -  
34 - Logger logger = LoggerFactory.getLogger(this.getClass());  
35 -  
36 - @Autowired  
37 - Station2ParkBuffer station2ParkBuffer;  
38 -  
39 - @Autowired  
40 - PersionPinYinBuffer persionPinYinBuffer;  
41 -  
42 - @RequestMapping("/cars")  
43 - public Iterable<String> findAllNbbm(Map<String, Object> map){  
44 - return BasicData.deviceId2NbbmMap.values();  
45 - }  
46 -  
47 - @RequestMapping("/nbbm2deviceId")  
48 - public Map<String, String> nbbm2deviceId(Map<String, Object> map){  
49 - return BasicData.deviceId2NbbmMap.inverse();  
50 - }  
51 -  
52 - @RequestMapping("/lineCode2Name")  
53 - public Map<String, String> findLineCodeMap(){  
54 - return BasicData.lineCode2NameMap;  
55 - }  
56 -  
57 - @RequestMapping("/parks")  
58 - public Map<String, String> findParks(){  
59 - Map<String, String> rs = new HashMap<>();  
60 - List<String> codes = BasicData.parkCodeList;  
61 - for(String code : codes){  
62 - rs.put(code, BasicData.stationCode2NameMap.get(code));  
63 - }  
64 - return rs;  
65 - }  
66 -  
67 - /*@RequestMapping("/personnel")  
68 - public Map<String, Object> findPersonnelInfo(){  
69 - Map<String, Object> rs = new HashMap<>();  
70 - PersonnelFieldFilter filter=new PersonnelFieldFilter();  
71 - //驾驶员  
72 - rs.put("jsy", JSON.parse(JSON.toJSONString(BasicData.jsyMap.values(), filter)));  
73 - //售票员  
74 - rs.put("spy", JSON.parse(JSON.toJSONString(BasicData.spyMap.values(), filter)));*//*  
75 - return rs;  
76 - }*/  
77 -  
78 - @RequestMapping(value = "/all_personnel_py", method = RequestMethod.GET)  
79 - public List<PersionPinYin> findAll_PY(){  
80 - return persionPinYinBuffer.getAll();  
81 - }  
82 -  
83 - @RequestMapping("/all_personnel")  
84 - public Map<String, String> all_personnel(){  
85 - return BasicData.allPerson;  
86 - }  
87 -  
88 -  
89 - public class PersonnelFieldFilter implements PropertyFilter{  
90 -  
91 - String[] whiteList=new String[]{"jobCode", "personnelName", "brancheCompany"};  
92 - @Override  
93 - public boolean apply(Object object, String name, Object value) {  
94 - for(String f : whiteList){  
95 - if(name.equals(f))  
96 - return true;  
97 - }  
98 - return false;  
99 - }  
100 - }  
101 -  
102 - /**  
103 - * 刷新车辆和设备号对照数据  
104 - * @return  
105 - */  
106 - @RequestMapping(value = "/refresh_nbbm2Device", method = RequestMethod.POST)  
107 - public Map<String, Object> refreshNbbm2DeviceId(){  
108 - Map<String, Object> rs = new HashMap<>();  
109 - try {  
110 - dataLoader.loadDeviceInfo();  
111 - rs.put("status", ResponseCode.SUCCESS);  
112 - }catch (Exception e){  
113 - rs.put("status", ResponseCode.ERROR);  
114 - rs.put("msg", e.getMessage());  
115 - logger.error("", e);  
116 - }  
117 - return rs;  
118 - }  
119 -  
120 - /**  
121 - * 刷新员工对照数据  
122 - * @return  
123 - */  
124 - @RequestMapping(value = "/refresh_person_data", method = RequestMethod.POST)  
125 - public Map<String, Object> refreshPersonData(){  
126 - Map<String, Object> rs = new HashMap<>();  
127 - try {  
128 - dataLoader.loadPersonnelInfo();  
129 - rs.put("status", ResponseCode.SUCCESS);  
130 - }catch (Exception e){  
131 - rs.put("status", ResponseCode.ERROR);  
132 - rs.put("msg", e.getMessage());  
133 - logger.error("", e);  
134 - }  
135 - return rs;  
136 - }  
137 -  
138 - /**  
139 - * 车辆自编号和车牌号对照  
140 - * @return  
141 - */  
142 - @RequestMapping("/nbbm2PlateNo")  
143 - public Map<String, String> nbbm2PlateNo(){  
144 - return basicData.nbbmCompanyPlateMap;  
145 - }  
146 -  
147 -  
148 - /**  
149 - * 获取线路配车信息  
150 - * @return  
151 - */  
152 - @RequestMapping("/ccInfo")  
153 - public Map<String, Collection<String>> ccInfo(){  
154 -  
155 - ArrayListMultimap<String, String> listMultimap = ArrayListMultimap.create();  
156 - Set<String> ks = BasicData.nbbm2LineMap.keySet();  
157 -  
158 - Line line;  
159 - for(String nbbm : ks){  
160 - line = BasicData.nbbm2LineMap.get(nbbm);  
161 - listMultimap.put(line.getLineCode(), nbbm);  
162 - }  
163 - return listMultimap.asMap();  
164 - }  
165 -  
166 - /**  
167 - * 获取车辆信息  
168 - * @return  
169 - */  
170 - @RequestMapping("/ccInfo/lineArray")  
171 - public List<Map<String, String>> ccInfoByLine(@RequestParam String idx){  
172 - List<String> lines = Splitter.on(",").splitToList(idx);  
173 - List<Map<String, String>> rs = new ArrayList<>();  
174 - Map<String, String> map;  
175 -  
176 - //ArrayListMultimap<String, String> listMultimap = ArrayListMultimap.create();  
177 - Set<String> ks = BasicData.nbbm2LineMap.keySet();  
178 - BiMap<String,String> nbbm2deviceMap = BasicData.deviceId2NbbmMap.inverse();  
179 -  
180 - Line line;  
181 - for(String nbbm : ks){  
182 - line = BasicData.nbbm2LineMap.get(nbbm);  
183 - if(lines.contains(line.getLineCode())){  
184 - map = new HashMap<>();  
185 - map.put("nbbm", nbbm);  
186 - map.put("deviceId", nbbm2deviceMap.get(nbbm));  
187 - map.put("lineName", line.getName());  
188 - map.put("lineCode", line.getLineCode());  
189 - rs.add(map);  
190 - }  
191 - }  
192 - return rs;  
193 - }  
194 -  
195 - /**  
196 - * 获取站点和停车场历时公里对照表  
197 - * @param idx  
198 - * @return  
199 - */  
200 - @RequestMapping("/station2ParkData")  
201 - public Map<String, Collection<StationToPark>> findStation2ParkData(@RequestParam String idx){  
202 - List<String> lines = Splitter.on(",").splitToList(idx);  
203 - ArrayListMultimap<String, StationToPark> rs = ArrayListMultimap.create();  
204 -  
205 - for(String lineCode : lines){  
206 - rs.putAll(lineCode, Station2ParkBuffer.get(lineCode));  
207 - }  
208 - return rs.asMap();  
209 - }  
210 -  
211 - @RequestMapping(value = "/deleteStation2Park", method = RequestMethod.POST)  
212 - public Map<String, Object> deleteStation2Park(@RequestParam String lineCode,@RequestParam Integer id){  
213 - return station2ParkBuffer.delete(lineCode, id);  
214 - }  
215 -} 1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.alibaba.fastjson.serializer.PropertyFilter;
  4 +import com.bsth.common.ResponseCode;
  5 +import com.bsth.data.BasicData;
  6 +import com.bsth.data.Station2ParkBuffer;
  7 +import com.bsth.data.pinyin.PersionPinYin;
  8 +import com.bsth.data.pinyin.PersionPinYinBuffer;
  9 +import com.bsth.entity.Line;
  10 +import com.bsth.entity.Personnel;
  11 +import com.bsth.entity.realcontrol.StationToPark;
  12 +import com.google.common.base.Splitter;
  13 +import com.google.common.collect.ArrayListMultimap;
  14 +import com.google.common.collect.BiMap;
  15 +import org.slf4j.Logger;
  16 +import org.slf4j.LoggerFactory;
  17 +import org.springframework.beans.factory.annotation.Autowired;
  18 +import org.springframework.web.bind.annotation.RequestMapping;
  19 +import org.springframework.web.bind.annotation.RequestMethod;
  20 +import org.springframework.web.bind.annotation.RequestParam;
  21 +import org.springframework.web.bind.annotation.RestController;
  22 +
  23 +import java.util.*;
  24 +
  25 +@RestController
  26 +@RequestMapping("/basic")
  27 +public class BasicDataController {
  28 +
  29 + @Autowired
  30 + BasicData.BasicDataLoader dataLoader;
  31 +
  32 + @Autowired
  33 + BasicData basicData;
  34 +
  35 + Logger logger = LoggerFactory.getLogger(this.getClass());
  36 +
  37 + @Autowired
  38 + Station2ParkBuffer station2ParkBuffer;
  39 +
  40 + @Autowired
  41 + PersionPinYinBuffer persionPinYinBuffer;
  42 +
  43 + @RequestMapping("/cars")
  44 + public Iterable<String> findAllNbbm(Map<String, Object> map){
  45 + return BasicData.deviceId2NbbmMap.values();
  46 + }
  47 +
  48 + @RequestMapping("/nbbm2deviceId")
  49 + public Map<String, String> nbbm2deviceId(Map<String, Object> map){
  50 + return BasicData.deviceId2NbbmMap.inverse();
  51 + }
  52 +
  53 + @RequestMapping("/lineCode2Name")
  54 + public Map<String, String> findLineCodeMap(){
  55 + return BasicData.lineCode2NameMap;
  56 + }
  57 +
  58 + @RequestMapping("/parks")
  59 + public Map<String, String> findParks(){
  60 + Map<String, String> rs = new HashMap<>();
  61 + List<String> codes = BasicData.parkCodeList;
  62 + for(String code : codes){
  63 + rs.put(code, BasicData.stationCode2NameMap.get(code));
  64 + }
  65 + return rs;
  66 + }
  67 +
  68 + /*@RequestMapping("/personnel")
  69 + public Map<String, Object> findPersonnelInfo(){
  70 + Map<String, Object> rs = new HashMap<>();
  71 + PersonnelFieldFilter filter=new PersonnelFieldFilter();
  72 + //驾驶员
  73 + rs.put("jsy", JSON.parse(JSON.toJSONString(BasicData.jsyMap.values(), filter)));
  74 + //售票员
  75 + rs.put("spy", JSON.parse(JSON.toJSONString(BasicData.spyMap.values(), filter)));*//*
  76 + return rs;
  77 + }*/
  78 +
  79 + @RequestMapping(value = "/all_personnel_py", method = RequestMethod.GET)
  80 + public List<PersionPinYin> findAll_PY(){
  81 + return persionPinYinBuffer.getAll();
  82 + }
  83 +
  84 + @RequestMapping("/all_personnel")
  85 + public Map<String, String> all_personnel(){
  86 + return BasicData.allPerson;
  87 + }
  88 +
  89 + @RequestMapping("/allPersonnelMobile")
  90 + public Map<String, String> allPersonnelMobile(){
  91 + Map<String, String> result = new HashMap<>();
  92 + for (Personnel personnel : BasicData.perMap.values()) {
  93 + result.put(personnel.getJobCode(), personnel.getMobile());
  94 + }
  95 +
  96 + return result;
  97 + }
  98 +
  99 + public class PersonnelFieldFilter implements PropertyFilter{
  100 +
  101 + String[] whiteList=new String[]{"jobCode", "personnelName", "brancheCompany"};
  102 + @Override
  103 + public boolean apply(Object object, String name, Object value) {
  104 + for(String f : whiteList){
  105 + if(name.equals(f))
  106 + return true;
  107 + }
  108 + return false;
  109 + }
  110 + }
  111 +
  112 + /**
  113 + * 刷新车辆和设备号对照数据
  114 + * @return
  115 + */
  116 + @RequestMapping(value = "/refresh_nbbm2Device", method = RequestMethod.POST)
  117 + public Map<String, Object> refreshNbbm2DeviceId(){
  118 + Map<String, Object> rs = new HashMap<>();
  119 + try {
  120 + dataLoader.loadDeviceInfo();
  121 + rs.put("status", ResponseCode.SUCCESS);
  122 + }catch (Exception e){
  123 + rs.put("status", ResponseCode.ERROR);
  124 + rs.put("msg", e.getMessage());
  125 + logger.error("", e);
  126 + }
  127 + return rs;
  128 + }
  129 +
  130 + /**
  131 + * 刷新员工对照数据
  132 + * @return
  133 + */
  134 + @RequestMapping(value = "/refresh_person_data", method = RequestMethod.POST)
  135 + public Map<String, Object> refreshPersonData(){
  136 + Map<String, Object> rs = new HashMap<>();
  137 + try {
  138 + dataLoader.loadPersonnelInfo();
  139 + rs.put("status", ResponseCode.SUCCESS);
  140 + }catch (Exception e){
  141 + rs.put("status", ResponseCode.ERROR);
  142 + rs.put("msg", e.getMessage());
  143 + logger.error("", e);
  144 + }
  145 + return rs;
  146 + }
  147 +
  148 + /**
  149 + * 车辆自编号和车牌号对照
  150 + * @return
  151 + */
  152 + @RequestMapping("/nbbm2PlateNo")
  153 + public Map<String, String> nbbm2PlateNo(){
  154 + return basicData.nbbmCompanyPlateMap;
  155 + }
  156 +
  157 +
  158 + /**
  159 + * 获取线路配车信息
  160 + * @return
  161 + */
  162 + @RequestMapping("/ccInfo")
  163 + public Map<String, Collection<String>> ccInfo(){
  164 +
  165 + ArrayListMultimap<String, String> listMultimap = ArrayListMultimap.create();
  166 + Set<String> ks = BasicData.nbbm2LineMap.keySet();
  167 +
  168 + Line line;
  169 + for(String nbbm : ks){
  170 + line = BasicData.nbbm2LineMap.get(nbbm);
  171 + listMultimap.put(line.getLineCode(), nbbm);
  172 + }
  173 + return listMultimap.asMap();
  174 + }
  175 +
  176 + /**
  177 + * 获取车辆信息
  178 + * @return
  179 + */
  180 + @RequestMapping("/ccInfo/lineArray")
  181 + public List<Map<String, String>> ccInfoByLine(@RequestParam String idx){
  182 + List<String> lines = Splitter.on(",").splitToList(idx);
  183 + List<Map<String, String>> rs = new ArrayList<>();
  184 + Map<String, String> map;
  185 +
  186 + //ArrayListMultimap<String, String> listMultimap = ArrayListMultimap.create();
  187 + Set<String> ks = BasicData.nbbm2LineMap.keySet();
  188 + BiMap<String,String> nbbm2deviceMap = BasicData.deviceId2NbbmMap.inverse();
  189 +
  190 + Line line;
  191 + for(String nbbm : ks){
  192 + line = BasicData.nbbm2LineMap.get(nbbm);
  193 + if(lines.contains(line.getLineCode())){
  194 + map = new HashMap<>();
  195 + map.put("nbbm", nbbm);
  196 + map.put("deviceId", nbbm2deviceMap.get(nbbm));
  197 + map.put("lineName", line.getName());
  198 + map.put("lineCode", line.getLineCode());
  199 + rs.add(map);
  200 + }
  201 + }
  202 + return rs;
  203 + }
  204 +
  205 + /**
  206 + * 获取站点和停车场历时公里对照表
  207 + * @param idx
  208 + * @return
  209 + */
  210 + @RequestMapping("/station2ParkData")
  211 + public Map<String, Collection<StationToPark>> findStation2ParkData(@RequestParam String idx){
  212 + List<String> lines = Splitter.on(",").splitToList(idx);
  213 + ArrayListMultimap<String, StationToPark> rs = ArrayListMultimap.create();
  214 +
  215 + for(String lineCode : lines){
  216 + rs.putAll(lineCode, Station2ParkBuffer.get(lineCode));
  217 + }
  218 + return rs.asMap();
  219 + }
  220 +
  221 + @RequestMapping(value = "/deleteStation2Park", method = RequestMethod.POST)
  222 + public Map<String, Object> deleteStation2Park(@RequestParam String lineCode,@RequestParam Integer id){
  223 + return station2ParkBuffer.delete(lineCode, id);
  224 + }
  225 +}
src/main/java/com/bsth/controller/realcontrol/dto/StationSpatialData.java
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 -} 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 Integer stationRouteId;
  9 +
  10 + private String lineCode;
  11 +
  12 + private String stationName;
  13 +
  14 + private String stationCode;
  15 +
  16 + private String stationMark;
  17 +
  18 + private int directions;
  19 +
  20 + private Float distances;
  21 +
  22 + private Float toTime;
  23 +
  24 + private Integer versions;
  25 +
  26 + private Float gLonx;
  27 +
  28 + private Float gLaty;
  29 +
  30 + private Float radius;
  31 +
  32 + private String shapesType;
  33 +
  34 + private String gPolygonGrid;
  35 +
  36 + private Integer stationRouteCode;
  37 +
  38 + public Integer getStationRouteId() {
  39 + return stationRouteId;
  40 + }
  41 +
  42 + public void setStationRouteId(Integer stationRouteId) {
  43 + this.stationRouteId = stationRouteId;
  44 + }
  45 +
  46 + public String getLineCode() {
  47 + return lineCode;
  48 + }
  49 +
  50 + public void setLineCode(String lineCode) {
  51 + this.lineCode = lineCode;
  52 + }
  53 +
  54 + public String getStationName() {
  55 + return stationName;
  56 + }
  57 +
  58 + public void setStationName(String stationName) {
  59 + this.stationName = stationName;
  60 + }
  61 +
  62 + public String getStationCode() {
  63 + return stationCode;
  64 + }
  65 +
  66 + public void setStationCode(String stationCode) {
  67 + this.stationCode = stationCode;
  68 + }
  69 +
  70 + public String getStationMark() {
  71 + return stationMark;
  72 + }
  73 +
  74 + public void setStationMark(String stationMark) {
  75 + this.stationMark = stationMark;
  76 + }
  77 +
  78 + public int getDirections() {
  79 + return directions;
  80 + }
  81 +
  82 + public void setDirections(int directions) {
  83 + this.directions = directions;
  84 + }
  85 +
  86 + public Float getDistances() {
  87 + return distances;
  88 + }
  89 +
  90 + public void setDistances(Float distances) {
  91 + this.distances = distances;
  92 + }
  93 +
  94 + public Float getToTime() {
  95 + return toTime;
  96 + }
  97 +
  98 + public void setToTime(Float toTime) {
  99 + this.toTime = toTime;
  100 + }
  101 +
  102 + public Integer getVersions() {
  103 + return versions;
  104 + }
  105 +
  106 + public void setVersions(Integer versions) {
  107 + this.versions = versions;
  108 + }
  109 +
  110 + public Float getgLonx() {
  111 + return gLonx;
  112 + }
  113 +
  114 + public void setgLonx(Float gLonx) {
  115 + this.gLonx = gLonx;
  116 + }
  117 +
  118 + public Float getgLaty() {
  119 + return gLaty;
  120 + }
  121 +
  122 + public void setgLaty(Float gLaty) {
  123 + this.gLaty = gLaty;
  124 + }
  125 +
  126 + public Float getRadius() {
  127 + return radius;
  128 + }
  129 +
  130 + public void setRadius(Float radius) {
  131 + this.radius = radius;
  132 + }
  133 +
  134 + public String getShapesType() {
  135 + return shapesType;
  136 + }
  137 +
  138 + public void setShapesType(String shapesType) {
  139 + this.shapesType = shapesType;
  140 + }
  141 +
  142 + public String getgPolygonGrid() {
  143 + return gPolygonGrid;
  144 + }
  145 +
  146 + public void setgPolygonGrid(String gPolygonGrid) {
  147 + this.gPolygonGrid = gPolygonGrid;
  148 + }
  149 +
  150 + public Integer getStationRouteCode() {
  151 + return stationRouteCode;
  152 + }
  153 +
  154 + public void setStationRouteCode(Integer stationRouteCode) {
  155 + this.stationRouteCode = stationRouteCode;
  156 + }
  157 +}
src/main/java/com/bsth/controller/schedule/basicinfo/legacy/EmployeeController.java
@@ -3,6 +3,7 @@ package com.bsth.controller.schedule.basicinfo.legacy; @@ -3,6 +3,7 @@ package com.bsth.controller.schedule.basicinfo.legacy;
3 import com.bsth.common.ResponseCode; 3 import com.bsth.common.ResponseCode;
4 import com.bsth.controller.schedule.BController; 4 import com.bsth.controller.schedule.BController;
5 import com.bsth.controller.schedule.basicinfo.EmployeeController_facade; 5 import com.bsth.controller.schedule.basicinfo.EmployeeController_facade;
  6 +import com.bsth.data.pinyin.PersionPinYin;
6 import com.bsth.entity.Personnel; 7 import com.bsth.entity.Personnel;
7 import com.bsth.service.schedule.EmployeeService; 8 import com.bsth.service.schedule.EmployeeService;
8 import com.bsth.service.schedule.exception.ScheduleException; 9 import com.bsth.service.schedule.exception.ScheduleException;
@@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam; @@ -14,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestParam;
14 import org.springframework.web.bind.annotation.RestController; 15 import org.springframework.web.bind.annotation.RestController;
15 16
16 import java.util.HashMap; 17 import java.util.HashMap;
  18 +import java.util.List;
17 import java.util.Map; 19 import java.util.Map;
18 20
19 /** 21 /**
@@ -45,4 +47,9 @@ public class EmployeeController extends BController&lt;Personnel, Integer&gt; { @@ -45,4 +47,9 @@ public class EmployeeController extends BController&lt;Personnel, Integer&gt; {
45 47
46 return rtn; 48 return rtn;
47 } 49 }
  50 +
  51 + @RequestMapping(value = "/all_py", method = RequestMethod.GET)
  52 + public List<PersionPinYin> findAll_PY(){
  53 + return this.employeeService.findAll_PY();
  54 + }
48 } 55 }
src/main/java/com/bsth/controller/schedule/datasync/VehicleDataSyncController.java
@@ -63,14 +63,16 @@ public class VehicleDataSyncController extends BController&lt;VehicleDataSyncTask, @@ -63,14 +63,16 @@ public class VehicleDataSyncController extends BController&lt;VehicleDataSyncTask,
63 public ApiResult refreshBuffer() { 63 public ApiResult refreshBuffer() {
64 try { 64 try {
65 // 1、刷新车辆同步ETL文件 65 // 1、刷新车辆同步ETL文件
66 - // 注意:使用Kettle内部的相关类清除指定ktr的缓存  
67 - File ktrFile = new File(this.getClass().getResource(  
68 - dataToolsProperties.getVehicleDatasyncktr()).toURI());  
69 - FileObject fileObject = KettleVFS.getFileObject(ktrFile.getAbsolutePath());  
70 - FileSystem fileSystem = fileObject.getFileSystem();  
71 - FilesCache filesCache = KettleVFS.getInstance().getFileSystemManager().getFilesCache();  
72 -// System.out.println(filesCache.getFile(fileSystem, fileObject.getName()));  
73 - filesCache.removeFile(fileSystem, fileObject.getName()); 66 + etlCacheRefresh(dataToolsProperties.getVehicleDatasyncktr());
  67 + // 2、刷新人员配置导入导出ETL文件
  68 + etlCacheRefresh(dataToolsProperties.getEmployeesconfigDatainputktr());
  69 + etlCacheRefresh(dataToolsProperties.getEmployeesconfigDataoutputktr());
  70 + // 3、刷新车辆配置导入导出ETL文件
  71 + etlCacheRefresh(dataToolsProperties.getCarsconfigDatainputktr());
  72 + etlCacheRefresh(dataToolsProperties.getCarsconfigDataoutputktr());
  73 + // 4、刷新规则导入导出ETL文件
  74 + etlCacheRefresh(dataToolsProperties.getScheduleruleDatainputktr());
  75 + etlCacheRefresh(dataToolsProperties.getScheduleruleOutput());
74 76
75 return ApiResult.success( 77 return ApiResult.success(
76 "200", 78 "200",
@@ -84,6 +86,16 @@ public class VehicleDataSyncController extends BController&lt;VehicleDataSyncTask, @@ -84,6 +86,16 @@ public class VehicleDataSyncController extends BController&lt;VehicleDataSyncTask,
84 } 86 }
85 } 87 }
86 88
  89 + private void etlCacheRefresh(String ktrPath) throws Exception {
  90 + // 注意:使用Kettle内部的相关类清除指定ktr的缓存
  91 + File ktrFile = new File(this.getClass().getResource(ktrPath).toURI());
  92 + FileObject fileObject = KettleVFS.getFileObject(ktrFile.getAbsolutePath());
  93 + FileSystem fileSystem = fileObject.getFileSystem();
  94 + FilesCache filesCache = KettleVFS.getInstance().getFileSystemManager().getFilesCache();
  95 +// System.out.println(filesCache.getFile(fileSystem, fileObject.getName()));
  96 + filesCache.removeFile(fileSystem, fileObject.getName());
  97 + }
  98 +
87 /** 99 /**
88 * 手动添加同步任务。 100 * 手动添加同步任务。
89 * @param vehicleDataSyncTaskRequest 101 * @param vehicleDataSyncTaskRequest
src/main/java/com/bsth/data/SystemParamCache.java
@@ -21,6 +21,10 @@ public class SystemParamCache implements InitializingBean { @@ -21,6 +21,10 @@ public class SystemParamCache implements InitializingBean {
21 return systemParamService1.getValue(SystemParamKeys.SPECIAL_ROLES); 21 return systemParamService1.getValue(SystemParamKeys.SPECIAL_ROLES);
22 } 22 }
23 23
  24 + public static String getSpecialDays() {
  25 + return systemParamService1.getValue(SystemParamKeys.SPECIAL_DAYS);
  26 + }
  27 +
24 public static String getUrlHttpGpsRealCache() { 28 public static String getUrlHttpGpsRealCache() {
25 return systemParamService1.getValue(SystemParamKeys.URL_HTTP_GPS_REAL_CACHE); 29 return systemParamService1.getValue(SystemParamKeys.URL_HTTP_GPS_REAL_CACHE);
26 } 30 }
src/main/java/com/bsth/data/gpsdata_v2/cache/GeoCacheData.java
@@ -233,7 +233,7 @@ public class GeoCacheData { @@ -233,7 +233,7 @@ public class GeoCacheData {
233 private void loadPremiseGeoData() { 233 private void loadPremiseGeoData() {
234 ArrayListMultimap<String, PreconditionGeo> premiseGeoMapCopy = ArrayListMultimap.create(); 234 ArrayListMultimap<String, PreconditionGeo> premiseGeoMapCopy = ArrayListMultimap.create();
235 235
236 - String sql = "select * from bsth_f_geo_premise"; 236 + String sql = "SELECT name, station_code, line_code, up_down, coords_wgs AS coords FROM bsth_f_geo_premise";
237 List<PreconditionGeo> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(PreconditionGeo.class)); 237 List<PreconditionGeo> list = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(PreconditionGeo.class));
238 238
239 List<String> coordList; 239 List<String> coordList;
src/main/java/com/bsth/entity/GeoPremise.java
@@ -37,6 +37,11 @@ public class GeoPremise { @@ -37,6 +37,11 @@ public class GeoPremise {
37 */ 37 */
38 private String coords; 38 private String coords;
39 39
  40 + /**
  41 + * wgs84坐标
  42 + */
  43 + private String coordsWgs;
  44 +
40 public Integer getId() { 45 public Integer getId() {
41 return id; 46 return id;
42 } 47 }
@@ -84,4 +89,12 @@ public class GeoPremise { @@ -84,4 +89,12 @@ public class GeoPremise {
84 public void setCoords(String coords) { 89 public void setCoords(String coords) {
85 this.coords = coords; 90 this.coords = coords;
86 } 91 }
  92 +
  93 + public String getCoordsWgs() {
  94 + return coordsWgs;
  95 + }
  96 +
  97 + public void setCoordsWgs(String coordsWgs) {
  98 + this.coordsWgs = coordsWgs;
  99 + }
87 } 100 }
src/main/java/com/bsth/entity/Personnel.java
@@ -79,6 +79,11 @@ public class Personnel extends BEntity { @@ -79,6 +79,11 @@ public class Personnel extends BEntity {
79 private String remark; 79 private String remark;
80 80
81 /** 81 /**
  82 + * 移动电话
  83 + */
  84 + private String mobile;
  85 +
  86 + /**
82 * 0为不锁定 1为锁定 87 * 0为不锁定 1为锁定
83 * 因人员与金蝶同步 但存在调度需要独立添加人员并不会被同步掉的情况 88 * 因人员与金蝶同步 但存在调度需要独立添加人员并不会被同步掉的情况
84 */ 89 */
@@ -285,6 +290,14 @@ public class Personnel extends BEntity { @@ -285,6 +290,14 @@ public class Personnel extends BEntity {
285 this.destroy = destroy; 290 this.destroy = destroy;
286 } 291 }
287 292
  293 + public String getMobile() {
  294 + return mobile;
  295 + }
  296 +
  297 + public void setMobile(String mobile) {
  298 + this.mobile = mobile;
  299 + }
  300 +
288 public Integer getLocked() { 301 public Integer getLocked() {
289 return locked; 302 return locked;
290 } 303 }
src/main/java/com/bsth/service/impl/LsStationRouteServiceImpl.java
@@ -208,6 +208,11 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl&lt;LsStationRoute, I @@ -208,6 +208,11 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl&lt;LsStationRoute, I
208 stationRoute.setStationCode(stationRoute.getStation().getStationCode()); 208 stationRoute.setStationCode(stationRoute.getStation().getStationCode());
209 209
210 Station station = stationRoute.getStation(); 210 Station station = stationRoute.getStation();
  211 + stationRoute.setCenterPointWkt(station.getCenterPointWkt());
  212 + if (!StringUtils.isEmpty(stationRoute.getCenterPointWkt())) {
  213 + centerPoint(stationRoute);
  214 + }
  215 +
211 if (station.getId() == null) { 216 if (station.getId() == null) {
212 station.setId(currentId + count); 217 station.setId(currentId + count);
213 station.setStationCode(station.getId().toString()); 218 station.setStationCode(station.getId().toString());
@@ -252,10 +257,15 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl&lt;LsStationRoute, I @@ -252,10 +257,15 @@ public class LsStationRouteServiceImpl extends BaseServiceImpl&lt;LsStationRoute, I
252 Integer currentVersion = lineVersionsRepository.findCurrentVersion(line.getId()); 257 Integer currentVersion = lineVersionsRepository.findCurrentVersion(line.getId());
253 boolean isPresent = stationRepository.findById(station.getId()).isPresent(); 258 boolean isPresent = stationRepository.findById(station.getId()).isPresent();
254 stationRoute.setLineCode(line.getLineCode()); 259 stationRoute.setLineCode(line.getLineCode());
  260 + stationRoute.setCenterPointWkt(station.getCenterPointWkt());
255 if (stationRoute.getVersions() < currentVersion) { 261 if (stationRoute.getVersions() < currentVersion) {
256 throw new IllegalArgumentException("历史版本不可变更"); 262 throw new IllegalArgumentException("历史版本不可变更");
257 } 263 }
258 264
  265 + if (!StringUtils.isEmpty(stationRoute.getCenterPointWkt())) {
  266 + centerPoint(stationRoute);
  267 + }
  268 +
259 // 中心点坐标信息 269 // 中心点坐标信息
260 if (!isPresent) { 270 if (!isPresent) {
261 centerPoint(station); 271 centerPoint(station);
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
@@ -11,7 +11,11 @@ import com.bsth.repository.realcontrol.ChildTaskPlanRepository; @@ -11,7 +11,11 @@ import com.bsth.repository.realcontrol.ChildTaskPlanRepository;
11 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 11 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
12 import com.bsth.service.impl.BaseServiceImpl; 12 import com.bsth.service.impl.BaseServiceImpl;
13 import com.bsth.service.realcontrol.ChildTaskPlanService; 13 import com.bsth.service.realcontrol.ChildTaskPlanService;
  14 +import com.bsth.util.PrivilegeUtils;
14 import org.apache.commons.lang3.StringUtils; 15 import org.apache.commons.lang3.StringUtils;
  16 +import org.joda.time.DateTime;
  17 +import org.joda.time.format.DateTimeFormat;
  18 +import org.joda.time.format.DateTimeFormatter;
15 import org.slf4j.Logger; 19 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory; 20 import org.slf4j.LoggerFactory;
17 import org.springframework.beans.factory.annotation.Autowired; 21 import org.springframework.beans.factory.annotation.Autowired;
@@ -231,7 +235,15 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon @@ -231,7 +235,15 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
231 public Map<String, Object> saveHistory(ChildTaskPlan t) { 235 public Map<String, Object> saveHistory(ChildTaskPlan t) {
232 Map<String, Object> rs = new HashMap(); 236 Map<String, Object> rs = new HashMap();
233 try { 237 try {
234 - ScheduleRealInfo sch = t.getSchedule(); 238 + ScheduleRealInfo sch = scheduleRealInfoRepository.findById(t.getSchedule().getId()).get();
  239 + // 检查调度日期
  240 + DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
  241 + long today = formatter.parseMillis(new DateTime().toString("yyyy-MM-dd")), scheduleDate = formatter.parseMillis(sch.getScheduleDateStr());
  242 + if (today < scheduleDate || today - scheduleDate > 86400000 * PrivilegeUtils.getHistoryEditDays()) {
  243 + rs.put("status", ResponseCode.ERROR);
  244 + rs.put("msg", "无效的调度日期");
  245 + return rs;
  246 + }
235 //保存起终点名称 247 //保存起终点名称
236 String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_"; 248 String prefix = sch.getXlBm() + "_" + sch.getXlDir() + "_";
237 if(StringUtils.isEmpty(t.getStartStationName())) 249 if(StringUtils.isEmpty(t.getStartStationName()))
@@ -253,6 +265,25 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon @@ -253,6 +265,25 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
253 265
254 @Override 266 @Override
255 public Map<String, Object> delHistory(Long id) { 267 public Map<String, Object> delHistory(Long id) {
256 - return super.delete(id); 268 + Map<String, Object> rs = new HashMap();
  269 + try {
  270 + ScheduleRealInfo sch = childTaskPlanRepository.findById(id).get().getSchedule();
  271 + // 检查调度日期
  272 + DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd");
  273 + long today = formatter.parseMillis(new DateTime().toString("yyyy-MM-dd")), scheduleDate = formatter.parseMillis(sch.getScheduleDateStr());
  274 + if (today < scheduleDate || today - scheduleDate > 86400000 * PrivilegeUtils.getHistoryEditDays()) {
  275 + rs.put("status", ResponseCode.ERROR);
  276 + rs.put("msg", "无效的调度日期");
  277 + return rs;
  278 + }
  279 +
  280 + return super.delete(id);
  281 + } catch (Exception e) {
  282 + logger.error("", e);
  283 + rs.put("status", ResponseCode.ERROR);
  284 + rs.put("msg", e.getMessage());
  285 + }
  286 +
  287 + return rs;
257 } 288 }
258 } 289 }
src/main/java/com/bsth/service/realcontrol/impl/RealMapServiceImpl.java
@@ -42,7 +42,7 @@ public class RealMapServiceImpl implements RealMapService { @@ -42,7 +42,7 @@ public class RealMapServiceImpl implements RealMapService {
42 } 42 }
43 inStr = " (" + inStr.substring(1) + ")"; 43 inStr = " (" + inStr.substring(1) + ")";
44 44
45 - String sql = "select r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,ST_X(s.CENTER_POINT_WGS) G_LONX,ST_Y(s.CENTER_POINT_WGS) G_LATY,r.RADIUS,r.SHAPED_TYPE shapes_type,ST_AsText(r.BUFFER_POLYGON_WGS) 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"; 45 + String sql = "select r.ID STATION_ROUTE_ID,r.LINE_CODE,r.STATION_NAME,r.STATION_CODE,r.STATION_MARK,r.DIRECTIONS,r.DISTANCES,r.TO_TIME, r.VERSIONS,ST_X(s.CENTER_POINT_WGS) G_LONX,ST_Y(s.CENTER_POINT_WGS) G_LATY,r.RADIUS,r.SHAPED_TYPE shapes_type,ST_AsText(r.BUFFER_POLYGON_WGS) 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";
46 46
47 List<StationSpatialData> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(StationSpatialData.class)); 47 List<StationSpatialData> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(StationSpatialData.class));
48 rs.put("status", ResponseCode.SUCCESS); 48 rs.put("status", ResponseCode.SUCCESS);