Commit 983d779f3c5a9cbac3060d0e48fb447669b179bb

Authored by 廖磊
2 parents 1580bdc9 701de6e7

Merge branch 'minhang' of 192.168.168.201:panzhaov5/bsth_control into

minhang
Showing 27 changed files with 1314 additions and 186 deletions
src/main/java/com/bsth/controller/BaseController2.java
... ... @@ -5,10 +5,13 @@ import com.bsth.common.ResponseCode;
5 5 import com.bsth.service.BaseService;
6 6 import com.bsth.service.schedule.utils.DataImportExportService;
7 7 import com.google.common.base.Splitter;
  8 +import jxl.Sheet;
  9 +import jxl.Workbook;
8 10 import org.springframework.beans.factory.annotation.Autowired;
9 11 import org.springframework.data.domain.Page;
10 12 import org.springframework.data.domain.PageRequest;
11 13 import org.springframework.data.domain.Sort;
  14 +import org.springframework.util.CollectionUtils;
12 15 import org.springframework.web.bind.annotation.*;
13 16 import org.springframework.web.multipart.MultipartFile;
14 17  
... ... @@ -164,11 +167,24 @@ public class BaseController2<T, ID extends Serializable> {
164 167 */
165 168 @RequestMapping(value = "/dataExport", method = RequestMethod.GET)
166 169 public void dataExport(HttpServletResponse response) throws Exception {
  170 + dataExport(response, null);
  171 + }
  172 +
  173 + @RequestMapping(value = "/dataExportExt", method = RequestMethod.GET)
  174 + public void dataExport(HttpServletResponse response, @RequestParam Map<String, Object> param) throws Exception {
167 175 // 1、使用ktr转换获取输出文件
168 176 File ktrfile = new File(this.getClass().getResource(getDataExportKtrClasspath()).toURI());
169   - File outputfile = dataImportExportService.fileDataOutput(
170   - getDataExportFilename(),
171   - ktrfile);
  177 + File outputfile = null;
  178 + if (!CollectionUtils.isEmpty(param)) {
  179 + outputfile = dataImportExportService.fileDataOutput(
  180 + getDataExportFilename(),
  181 + ktrfile,
  182 + param);
  183 + } else {
  184 + outputfile = dataImportExportService.fileDataOutput(
  185 + getDataExportFilename(),
  186 + ktrfile);
  187 + }
172 188  
173 189 System.out.println(outputfile.getName());
174 190 String filePath = outputfile.getAbsolutePath();
... ... @@ -225,4 +241,52 @@ public class BaseController2&lt;T, ID extends Serializable&gt; {
225 241 throw new RuntimeException("必须override,并指定ktr classpath");
226 242 }
227 243  
  244 +
  245 + public static class ExcelFileOutput {
  246 + private String fileName;
  247 + private List<Map<String, Object>> sheetnames = new ArrayList<>();
  248 +
  249 + public String getFileName() {
  250 + return fileName;
  251 + }
  252 +
  253 + public void setFileName(String fileName) {
  254 + this.fileName = fileName;
  255 + }
  256 +
  257 + public List<Map<String, Object>> getSheetnames() {
  258 + return sheetnames;
  259 + }
  260 +
  261 + public void setSheetnames(List<Map<String, Object>> sheetnames) {
  262 + this.sheetnames = sheetnames;
  263 + }
  264 + }
  265 +
  266 + /**
  267 + * 上传Excel文件,返回文件全路径名,工作区名称列表。
  268 + * @param file
  269 + * @return
  270 + * @throws Exception
  271 + */
  272 + @RequestMapping(value = "/uploadFile", method = RequestMethod.POST)
  273 + public ExcelFileOutput fileUpload(MultipartFile file) throws Exception {
  274 + // 返回对象
  275 + ExcelFileOutput rs = new ExcelFileOutput();
  276 +
  277 + // 上传文件
  278 + File file1 = dataImportExportService.uploadFile(file);
  279 + // 获取文件的sheet
  280 + Workbook book = Workbook.getWorkbook(file1);
  281 + for (Sheet sheet : book.getSheets()) {
  282 + String sheetname = sheet.getName();
  283 + Map<String, Object> s = new HashMap<>();
  284 + s.put("name", sheetname);
  285 + rs.getSheetnames().add(s);
  286 + }
  287 +
  288 + rs.setFileName(file1.getAbsolutePath());
  289 + return rs;
  290 + }
  291 +
228 292 }
... ...
src/main/java/com/bsth/controller/CarsController.java
1 1 package com.bsth.controller;
2 2  
  3 +import com.bsth.common.ResponseCode;
3 4 import com.bsth.entity.Cars;
  5 +import com.bsth.service.schedule.utils.DataImportExportService;
4 6 import com.bsth.service.schedule.utils.DataToolsProperties;
5 7 import org.springframework.beans.factory.annotation.Autowired;
6 8 import org.springframework.boot.context.properties.EnableConfigurationProperties;
7   -import org.springframework.web.bind.annotation.*;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
8 13  
  14 +import java.io.File;
  15 +import java.util.HashMap;
9 16 import java.util.Map;
10 17  
11 18 /**
... ... @@ -14,24 +21,12 @@ import java.util.Map;
14 21 @RestController
15 22 @RequestMapping("cars")
16 23 @EnableConfigurationProperties(DataToolsProperties.class)
17   -public class CarsController extends BaseController<Cars, Integer> {
  24 +public class CarsController extends BaseController2<Cars, Integer> {
18 25  
19 26 @Autowired
20 27 private DataToolsProperties dataToolsProperties;
21   -
22   - /**
23   - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody
24   - * @Title: save
25   - * @Description: TODO(持久化对象)
26   - * @param @param t
27   - * @param @return 设定文件
28   - * @return Map<String,Object> {status: 1(成功),-1(失败)}
29   - * @throws
30   - */
31   - @RequestMapping(method = RequestMethod.POST)
32   - public Map<String, Object> save(@RequestBody Cars t){
33   - return baseService.save(t);
34   - }
  28 + @Autowired
  29 + private DataImportExportService dataImportExportService;
35 30  
36 31 /**
37 32 * 验证。
... ... @@ -44,6 +39,48 @@ public class CarsController extends BaseController&lt;Cars, Integer&gt; {
44 39 return baseService.validateEquale(map);
45 40 }
46 41  
  42 + // uploadFile post
  43 +
  44 + // 验证excel sheet
  45 + @RequestMapping(value = "/validate/sheet", method = RequestMethod.GET)
  46 + public Map<String, Object> validateSheet() throws Exception {
  47 + Map<String, Object> rtn = new HashMap<>();
  48 +
  49 + // TODO:
  50 +
  51 + rtn.put("status", ResponseCode.SUCCESS);
  52 + return rtn;
  53 + }
  54 +
  55 + @RequestMapping(value = "/importfile", method = RequestMethod.POST)
  56 + public Map<String, Object> importData(
  57 + @RequestParam Map<String, Object> form)
  58 + throws Exception {
  59 + Map<String, Object> rtn = new HashMap<>();
  60 +
  61 + // TODO:
  62 + String filename = (String) form.get("filename");
  63 +
  64 +
  65 + try {
  66 + // 获取ktr转换文件绝对路径
  67 + File ktrfile = new File(this.getClass().getResource(getDataImportKtrClasspath()).toURI());
  68 + System.out.println(ktrfile.getAbsolutePath());
  69 + // 导入数据
  70 + dataImportExportService.fileDataImport(new File(filename), ktrfile);
  71 +
  72 + rtn.put("status", ResponseCode.SUCCESS);
  73 + rtn.put("msg", "导入成功");
  74 + } catch (Exception exp) {
  75 + exp.printStackTrace();
  76 + rtn.put("status", ResponseCode.ERROR);
  77 + rtn.put("msg", exp.getLocalizedMessage());
  78 + }
  79 +
  80 + return rtn;
  81 + }
  82 +
  83 +
47 84 @Override
48 85 protected String getDataImportKtrClasspath() {
49 86 return dataToolsProperties.getCarsDatainputktr();
... ...
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 +}
... ...
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
1 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 3 import com.alibaba.fastjson.JSONArray;
20 4 import com.bsth.controller.BaseController;
21 5 import com.bsth.controller.realcontrol.dto.ChangePersonCar;
... ... @@ -23,9 +7,14 @@ import com.bsth.controller.realcontrol.dto.DfsjChange;
23 7 import com.bsth.data.BasicData;
24 8 import com.bsth.data.schedule.DayOfSchedule;
25 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
26   -import com.bsth.security.util.SecurityUtils;
27 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 19 @RestController
31 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/schedule/TTInfoDetailController.java
1 1 package com.bsth.controller.schedule;
2 2  
3 3 import com.bsth.common.ResponseCode;
4   -import com.bsth.controller.BaseController;
  4 +import com.bsth.controller.BaseController2;
5 5 import com.bsth.entity.CarPark;
6 6 import com.bsth.entity.LineInformation;
7 7 import com.bsth.entity.StationRoute;
... ... @@ -38,7 +38,7 @@ import java.util.regex.Pattern;
38 38 */
39 39 @RestController
40 40 @RequestMapping("tidc")
41   -public class TTInfoDetailController extends BaseController<TTInfoDetail, Long> {
  41 +public class TTInfoDetailController extends BaseController2<TTInfoDetail, Long> {
42 42 @Autowired
43 43 private TTInfoDetailService ttInfoDetailService;
44 44 @Autowired
... ... @@ -56,53 +56,13 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; {
56 56 @Autowired
57 57 private DataToolsProperties dataToolsProperties;
58 58  
59   -
60   - public static class ExcelFileOutput {
61   - private String fileName;
62   - private List<Map<String, Object>> sheetnames = new ArrayList<>();
63   -
64   - public String getFileName() {
65   - return fileName;
66   - }
67   -
68   - public void setFileName(String fileName) {
69   - this.fileName = fileName;
70   - }
71   -
72   - public List<Map<String, Object>> getSheetnames() {
73   - return sheetnames;
74   - }
75   -
76   - public void setSheetnames(List<Map<String, Object>> sheetnames) {
77   - this.sheetnames = sheetnames;
78   - }
79   - }
80   -
81 59 /**
82 60 * 1、上传Excel文件,返回文件全路径名,工作区名称列表。
83 61 * @param file
84 62 * @return
85 63 * @throws Exception
86 64 */
87   - @RequestMapping(value = "/uploadFile", method = RequestMethod.POST)
88   - public ExcelFileOutput fileUpload(MultipartFile file) throws Exception {
89   - // 返回对象
90   - ExcelFileOutput rs = new ExcelFileOutput();
91   -
92   - // 上传文件
93   - File file1 = dataImportExportService.uploadFile(file);
94   - // 获取文件的sheet
95   - Workbook book = Workbook.getWorkbook(file1);
96   - for (Sheet sheet : book.getSheets()) {
97   - String sheetname = sheet.getName();
98   - Map<String, Object> s = new HashMap<>();
99   - s.put("name", sheetname);
100   - rs.getSheetnames().add(s);
101   - }
102 65  
103   - rs.setFileName(file1.getAbsolutePath());
104   - return rs;
105   - }
106 66  
107 67 /**
108 68 * 2、验证sheet(以后放到规则引擎里去做)。
... ... @@ -441,21 +401,6 @@ public class TTInfoDetailController extends BaseController&lt;TTInfoDetail, Long&gt; {
441 401 return ttInfoDetailService.getEditInfo(xlid, ttid);
442 402 }
443 403  
444   - /**
445   - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody
446   - * @Title: save
447   - * @Description: TODO(持久化对象)
448   - * @param @param t
449   - * @param @return 设定文件
450   - * @return Map<String,Object> {status: 1(成功),-1(失败)}
451   - * @throws
452   - */
453   - @RequestMapping(method = RequestMethod.POST)
454   - public Map<String, Object> save(@RequestBody TTInfoDetail t){
455   -
456   - return baseService.save(t);
457   - }
458   -
459 404 @Override
460 405 public TTInfoDetail findById(@PathVariable("id") Long aLong) {
461 406 return ttInfoDetailRepository.findOneExtend(aLong);
... ...
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
... ... @@ -2,13 +2,11 @@ package com.bsth.entity.realcontrol;
2 2  
3 3 import com.bsth.entity.sys.SysUser;
4 4 import com.fasterxml.jackson.annotation.JsonIgnore;
5   -
6   -import javax.persistence.*;
7   -
8 5 import org.apache.commons.lang3.StringUtils;
9 6 import org.joda.time.format.DateTimeFormat;
10 7 import org.joda.time.format.DateTimeFormatter;
11 8  
  9 +import javax.persistence.*;
12 10 import java.util.Date;
13 11 import java.util.HashSet;
14 12 import java.util.Set;
... ... @@ -177,8 +175,116 @@ public class ScheduleRealInfo {
177 175 /** 子任务 */
178 176 @OneToMany(fetch = FetchType.LAZY/*, cascade = CascadeType.ALL*/)
179 177 private Set<ChildTaskPlan> cTasks = new HashSet<>();
180   -
181   - /** ----------------
  178 +
  179 + /** 关联的公司名称 */
  180 + private String gsName;
  181 + /** 关联的公司编码 */
  182 + private String gsBm;
  183 + /** 关联的分公司名称 */
  184 + private String fgsName;
  185 + /** 关联的分公司编码 */
  186 + private String fgsBm;
  187 + /** 出场顺序号 */
  188 + private Integer ccno;
  189 +
  190 + //待发调试(是否自动调整)
  191 + private boolean dfAuto;
  192 + //是否有GPS信号
  193 + private boolean online;
  194 +
  195 + public boolean isDfAuto() {
  196 + return dfAuto;
  197 + }
  198 +
  199 + public void setDfAuto(boolean dfAuto) {
  200 + this.dfAuto = dfAuto;
  201 + }
  202 +
  203 + public boolean isOnline() {
  204 + return online;
  205 + }
  206 +
  207 + public void setOnline(boolean online) {
  208 + this.online = online;
  209 + }
  210 +
  211 + public String getQdzArrDatejh() {
  212 + return qdzArrDatejh;
  213 + }
  214 +
  215 + public void setQdzArrDatejh(String qdzArrDatejh) {
  216 + this.qdzArrDatejh = qdzArrDatejh;
  217 + }
  218 +
  219 + public String getQdzArrDatesj() {
  220 + return qdzArrDatesj;
  221 + }
  222 +
  223 + public void setQdzArrDatesj(String qdzArrDatesj) {
  224 + this.qdzArrDatesj = qdzArrDatesj;
  225 + }
  226 +
  227 + public void setcTasks(Set<ChildTaskPlan> cTasks) {
  228 + this.cTasks = cTasks;
  229 + }
  230 +
  231 + public String getGsName() {
  232 + return gsName;
  233 + }
  234 +
  235 + public void setGsName(String gsName) {
  236 + this.gsName = gsName;
  237 + }
  238 +
  239 + public String getGsBm() {
  240 + return gsBm;
  241 + }
  242 +
  243 + public void setGsBm(String gsBm) {
  244 + this.gsBm = gsBm;
  245 + }
  246 +
  247 + public String getFgsName() {
  248 + return fgsName;
  249 + }
  250 +
  251 + public void setFgsName(String fgsName) {
  252 + this.fgsName = fgsName;
  253 + }
  254 +
  255 + public String getFgsBm() {
  256 + return fgsBm;
  257 + }
  258 +
  259 + public void setFgsBm(String fgsBm) {
  260 + this.fgsBm = fgsBm;
  261 + }
  262 +
  263 + public Integer getCcno() {
  264 + return ccno;
  265 + }
  266 +
  267 + public void setCcno(Integer ccno) {
  268 + this.ccno = ccno;
  269 + }
  270 +
  271 + public static DateTimeFormatter getFmtHHmm() {
  272 + return fmtHHmm;
  273 + }
  274 +
  275 + public static void setFmtHHmm(DateTimeFormatter fmtHHmm) {
  276 + ScheduleRealInfo.fmtHHmm = fmtHHmm;
  277 + }
  278 +
  279 + public static DateTimeFormatter getFmtyyyyMMddHHmm() {
  280 + return fmtyyyyMMddHHmm;
  281 + }
  282 +
  283 + public static void setFmtyyyyMMddHHmm(DateTimeFormatter fmtyyyyMMddHHmm) {
  284 + ScheduleRealInfo.fmtyyyyMMddHHmm = fmtyyyyMMddHHmm;
  285 + }
  286 +
  287 + /** ----------------
182 288 @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
183 289 private RealTimeModel sjfcModel;
184 290 @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
... ...
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 +}
... ...
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.service.realcontrol.RealMapService;
  6 +import com.google.common.base.Splitter;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.jdbc.core.BeanPropertyRowMapper;
  11 +import org.springframework.jdbc.core.JdbcTemplate;
  12 +import org.springframework.stereotype.Service;
  13 +
  14 +import java.util.HashMap;
  15 +import java.util.List;
  16 +import java.util.Map;
  17 +
  18 +/**
  19 + * Created by panzhao on 2016/11/23.
  20 + */
  21 +@Service
  22 +public class RealMapServiceImpl implements RealMapService {
  23 +
  24 + @Autowired
  25 + JdbcTemplate jdbcTemplate;
  26 +
  27 + Logger logger = LoggerFactory.getLogger(this.getClass());
  28 +
  29 + @Override
  30 + public Map<String, Object> stationSpatialData(String idx) {
  31 + Map<String, Object> rs = new HashMap();
  32 +
  33 + try {
  34 + List<String> idArray = Splitter.on(",").splitToList(idx);
  35 + //拼接in语句
  36 + String inStr = "";
  37 + for (String code : idArray) {
  38 + inStr += (",'" + code+"'");
  39 + }
  40 + inStr = " (" + inStr.substring(1) + ")";
  41 +
  42 + 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";
  43 +
  44 + List<StationSpatialData> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(StationSpatialData.class));
  45 + rs.put("status", ResponseCode.SUCCESS);
  46 + rs.put("list", list);
  47 + } catch (Exception e) {
  48 + logger.error("", e);
  49 + rs.put("status", ResponseCode.ERROR);
  50 + rs.put("msg", "查询站点空间数据出现异常!");
  51 + }
  52 +
  53 + return rs;
  54 + }
  55 +}
... ...
src/main/java/com/bsth/service/schedule/utils/DataImportExportService.java
... ... @@ -24,6 +24,7 @@ public interface DataImportExportService {
24 24 * @throws Exception
25 25 */
26 26 void fileDataImport(MultipartFile datafile, File ktrFile) throws Exception;
  27 + void fileDataImport(File datafile, File ktrFile) throws Exception;
27 28  
28 29 /**
29 30 * 数据导出。
... ...
src/main/java/com/bsth/service/schedule/utils/DataImportExportServiceImpl.java
... ... @@ -111,6 +111,31 @@ public class DataImportExportServiceImpl implements DataImportExportService, Ini
111 111 }
112 112  
113 113 @Override
  114 + public void fileDataImport(File datafile, File ktrFile) throws Exception {
  115 +// // 1、上传数据文件
  116 +// File uploadFile = datafile;
  117 +
  118 + // 2、使用kettle运行封装数据导入逻辑的ktr转换文件
  119 + // 2.1、初始化kettle(组件初始化已经做了)
  120 + // 2.2、创建转换元数据,转换
  121 + TransMeta transMeta = new TransMeta(ktrFile.getAbsolutePath());
  122 + Trans trans = new Trans(transMeta);
  123 + // 2.3、设定命名参数,用于指定数据文件,注意每个ktr必须都有以下指定的命名参数
  124 + trans.setParameterValue("filepath", datafile.getAbsolutePath()); // 指定导入数据文件的位置
  125 + trans.setParameterValue("erroroutputdir", dataToolsProperties.getTransErrordir()); // ktr转换错误输出目录
  126 + // TODO:可以考虑设定日志输出
  127 + // 2.4、执行转换
  128 + trans.execute(null);
  129 + // 2.5、等待转换结束
  130 + trans.waitUntilFinished();
  131 +
  132 + // 3、判定ktr错误数,注意这种错误代表部分数据错误,不会终止转换执行,一般设计ktr的时候,会有错误输出文件,TODO:以后考虑使用日志实时输出
  133 + if (trans.getErrors() > 0) {
  134 + throw new Exception("转换数据部分错误,请查看相关错误输出文件!");
  135 + }
  136 + }
  137 +
  138 + @Override
114 139 public File fileDataOutput(String fileName, File ktrFile) throws Exception {
115 140 return fileDataOutput(fileName, ktrFile, null);
116 141 }
... ...
src/main/resources/application-dev.properties
... ... @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 8 spring.jpa.database= MYSQL
9 9 spring.jpa.show-sql= false
10 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11   -spring.datasource.url= jdbc:mysql://127.0.0.1/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 12 spring.datasource.username= root
13   -spring.datasource.password= root
  13 +spring.datasource.password= 123456
14 14 #DATASOURCE
15 15 spring.datasource.max-active=100
16 16 spring.datasource.max-idle=8
... ...
src/main/resources/datatools/ktrs/ttinfodetailoutputforedit.ktr
... ... @@ -11,17 +11,17 @@
11 11 <parameters>
12 12 <parameter>
13 13 <name>tempfilepath</name>
14   - <default_value/>
  14 + <default_value>&#x2f;Users&#x2f;xu&#x2f;resource&#x2f;project_code&#x2f;runtime_temp&#x2f;bsth_control_u_d_files&#x2f;temp&#x2f;test</default_value>
15 15 <description>&#x9ed8;&#x8ba4;&#x8f93;&#x51fa;&#x7684;&#x6587;&#x4ef6;&#x8def;&#x5f84;&#x540d;</description>
16 16 </parameter>
17 17 <parameter>
18 18 <name>ttid</name>
19   - <default_value/>
  19 + <default_value>63</default_value>
20 20 <description>&#x65f6;&#x523b;&#x8868;id</description>
21 21 </parameter>
22 22 <parameter>
23 23 <name>xlid</name>
24   - <default_value/>
  24 + <default_value>63017</default_value>
25 25 <description>&#x7ebf;&#x8def;id</description>
26 26 </parameter>
27 27 </parameters>
... ... @@ -1212,6 +1212,156 @@
1212 1212 <type>String</type>
1213 1213 <format/>
1214 1214 </field>
  1215 + <field>
  1216 + <name>fcno31_id</name>
  1217 + <type>String</type>
  1218 + <format/>
  1219 + </field>
  1220 + <field>
  1221 + <name>fcno31_fcsj</name>
  1222 + <type>String</type>
  1223 + <format/>
  1224 + </field>
  1225 + <field>
  1226 + <name>fcno31_zdname</name>
  1227 + <type>String</type>
  1228 + <format/>
  1229 + </field>
  1230 + <field>
  1231 + <name>fcno31_bctype</name>
  1232 + <type>String</type>
  1233 + <format/>
  1234 + </field>
  1235 + <field>
  1236 + <name>fcno31_xldir</name>
  1237 + <type>String</type>
  1238 + <format/>
  1239 + </field>
  1240 + <field>
  1241 + <name>fcno31_isfb</name>
  1242 + <type>String</type>
  1243 + <format/>
  1244 + </field>
  1245 + <field>
  1246 + <name>fcno32_id</name>
  1247 + <type>String</type>
  1248 + <format/>
  1249 + </field>
  1250 + <field>
  1251 + <name>fcno32_fcsj</name>
  1252 + <type>String</type>
  1253 + <format/>
  1254 + </field>
  1255 + <field>
  1256 + <name>fcno32_zdname</name>
  1257 + <type>String</type>
  1258 + <format/>
  1259 + </field>
  1260 + <field>
  1261 + <name>fcno32_bctype</name>
  1262 + <type>String</type>
  1263 + <format/>
  1264 + </field>
  1265 + <field>
  1266 + <name>fcno32_xldir</name>
  1267 + <type>String</type>
  1268 + <format/>
  1269 + </field>
  1270 + <field>
  1271 + <name>fcno32_isfb</name>
  1272 + <type>String</type>
  1273 + <format/>
  1274 + </field>
  1275 + <field>
  1276 + <name>fcno33_id</name>
  1277 + <type>String</type>
  1278 + <format/>
  1279 + </field>
  1280 + <field>
  1281 + <name>fcno33_fcsj</name>
  1282 + <type>String</type>
  1283 + <format/>
  1284 + </field>
  1285 + <field>
  1286 + <name>fcno33_zdname</name>
  1287 + <type>String</type>
  1288 + <format/>
  1289 + </field>
  1290 + <field>
  1291 + <name>fcno33_bctype</name>
  1292 + <type>String</type>
  1293 + <format/>
  1294 + </field>
  1295 + <field>
  1296 + <name>fcno33_xldir</name>
  1297 + <type>String</type>
  1298 + <format/>
  1299 + </field>
  1300 + <field>
  1301 + <name>fcno33_isfb</name>
  1302 + <type>String</type>
  1303 + <format/>
  1304 + </field>
  1305 + <field>
  1306 + <name>fcno34_id</name>
  1307 + <type>String</type>
  1308 + <format/>
  1309 + </field>
  1310 + <field>
  1311 + <name>fcno34_fcsj</name>
  1312 + <type>String</type>
  1313 + <format/>
  1314 + </field>
  1315 + <field>
  1316 + <name>fcno34_zdname</name>
  1317 + <type>String</type>
  1318 + <format/>
  1319 + </field>
  1320 + <field>
  1321 + <name>fcno34_bctype</name>
  1322 + <type>String</type>
  1323 + <format/>
  1324 + </field>
  1325 + <field>
  1326 + <name>fcno34_xldir</name>
  1327 + <type>String</type>
  1328 + <format/>
  1329 + </field>
  1330 + <field>
  1331 + <name>fcno34_isfb</name>
  1332 + <type>String</type>
  1333 + <format/>
  1334 + </field>
  1335 + <field>
  1336 + <name>fcno35_id</name>
  1337 + <type>String</type>
  1338 + <format/>
  1339 + </field>
  1340 + <field>
  1341 + <name>fcno35_fcsj</name>
  1342 + <type>String</type>
  1343 + <format/>
  1344 + </field>
  1345 + <field>
  1346 + <name>fcno35_zdname</name>
  1347 + <type>String</type>
  1348 + <format/>
  1349 + </field>
  1350 + <field>
  1351 + <name>fcno35_bctype</name>
  1352 + <type>String</type>
  1353 + <format/>
  1354 + </field>
  1355 + <field>
  1356 + <name>fcno35_xldir</name>
  1357 + <type>String</type>
  1358 + <format/>
  1359 + </field>
  1360 + <field>
  1361 + <name>fcno35_isfb</name>
  1362 + <type>String</type>
  1363 + <format/>
  1364 + </field>
1215 1365 </fields>
1216 1366 <custom>
1217 1367 <header_font_name>arial</header_font_name>
... ... @@ -3776,6 +3926,426 @@
3776 3926 <target_null_string/>
3777 3927 <target_aggregation_type>-</target_aggregation_type>
3778 3928 </field>
  3929 + <field>
  3930 + <field_name>id</field_name>
  3931 + <key_value>31</key_value>
  3932 + <target_name>fcno31_id</target_name>
  3933 + <target_type>String</target_type>
  3934 + <target_format/>
  3935 + <target_length>-1</target_length>
  3936 + <target_precision>-1</target_precision>
  3937 + <target_decimal_symbol/>
  3938 + <target_grouping_symbol/>
  3939 + <target_currency_symbol/>
  3940 + <target_null_string/>
  3941 + <target_aggregation_type>-</target_aggregation_type>
  3942 + </field>
  3943 + <field>
  3944 + <field_name>fcsj</field_name>
  3945 + <key_value>31</key_value>
  3946 + <target_name>fcno31_fcsj</target_name>
  3947 + <target_type>String</target_type>
  3948 + <target_format/>
  3949 + <target_length>-1</target_length>
  3950 + <target_precision>-1</target_precision>
  3951 + <target_decimal_symbol/>
  3952 + <target_grouping_symbol/>
  3953 + <target_currency_symbol/>
  3954 + <target_null_string/>
  3955 + <target_aggregation_type>-</target_aggregation_type>
  3956 + </field>
  3957 + <field>
  3958 + <field_name>fczdName</field_name>
  3959 + <key_value>31</key_value>
  3960 + <target_name>fcno31_zdname</target_name>
  3961 + <target_type>String</target_type>
  3962 + <target_format/>
  3963 + <target_length>-1</target_length>
  3964 + <target_precision>-1</target_precision>
  3965 + <target_decimal_symbol/>
  3966 + <target_grouping_symbol/>
  3967 + <target_currency_symbol/>
  3968 + <target_null_string/>
  3969 + <target_aggregation_type>-</target_aggregation_type>
  3970 + </field>
  3971 + <field>
  3972 + <field_name>bc_type</field_name>
  3973 + <key_value>31</key_value>
  3974 + <target_name>fcno31_bctype</target_name>
  3975 + <target_type>String</target_type>
  3976 + <target_format/>
  3977 + <target_length>-1</target_length>
  3978 + <target_precision>-1</target_precision>
  3979 + <target_decimal_symbol/>
  3980 + <target_grouping_symbol/>
  3981 + <target_currency_symbol/>
  3982 + <target_null_string/>
  3983 + <target_aggregation_type>-</target_aggregation_type>
  3984 + </field>
  3985 + <field>
  3986 + <field_name>xl_dir</field_name>
  3987 + <key_value>31</key_value>
  3988 + <target_name>fcno31_xldir</target_name>
  3989 + <target_type>String</target_type>
  3990 + <target_format/>
  3991 + <target_length>-1</target_length>
  3992 + <target_precision>-1</target_precision>
  3993 + <target_decimal_symbol/>
  3994 + <target_grouping_symbol/>
  3995 + <target_currency_symbol/>
  3996 + <target_null_string/>
  3997 + <target_aggregation_type>-</target_aggregation_type>
  3998 + </field>
  3999 + <field>
  4000 + <field_name>isfb</field_name>
  4001 + <key_value>31</key_value>
  4002 + <target_name>fcno31_isfb</target_name>
  4003 + <target_type>String</target_type>
  4004 + <target_format/>
  4005 + <target_length>-1</target_length>
  4006 + <target_precision>-1</target_precision>
  4007 + <target_decimal_symbol/>
  4008 + <target_grouping_symbol/>
  4009 + <target_currency_symbol/>
  4010 + <target_null_string/>
  4011 + <target_aggregation_type>-</target_aggregation_type>
  4012 + </field>
  4013 + <field>
  4014 + <field_name>id</field_name>
  4015 + <key_value>32</key_value>
  4016 + <target_name>fcno32_id</target_name>
  4017 + <target_type>String</target_type>
  4018 + <target_format/>
  4019 + <target_length>-1</target_length>
  4020 + <target_precision>-1</target_precision>
  4021 + <target_decimal_symbol/>
  4022 + <target_grouping_symbol/>
  4023 + <target_currency_symbol/>
  4024 + <target_null_string/>
  4025 + <target_aggregation_type>-</target_aggregation_type>
  4026 + </field>
  4027 + <field>
  4028 + <field_name>fcsj</field_name>
  4029 + <key_value>32</key_value>
  4030 + <target_name>fcno32_fcsj</target_name>
  4031 + <target_type>String</target_type>
  4032 + <target_format/>
  4033 + <target_length>-1</target_length>
  4034 + <target_precision>-1</target_precision>
  4035 + <target_decimal_symbol/>
  4036 + <target_grouping_symbol/>
  4037 + <target_currency_symbol/>
  4038 + <target_null_string/>
  4039 + <target_aggregation_type>-</target_aggregation_type>
  4040 + </field>
  4041 + <field>
  4042 + <field_name>fczdName</field_name>
  4043 + <key_value>32</key_value>
  4044 + <target_name>fcno32_zdname</target_name>
  4045 + <target_type>String</target_type>
  4046 + <target_format/>
  4047 + <target_length>-1</target_length>
  4048 + <target_precision>-1</target_precision>
  4049 + <target_decimal_symbol/>
  4050 + <target_grouping_symbol/>
  4051 + <target_currency_symbol/>
  4052 + <target_null_string/>
  4053 + <target_aggregation_type>-</target_aggregation_type>
  4054 + </field>
  4055 + <field>
  4056 + <field_name>bc_type</field_name>
  4057 + <key_value>32</key_value>
  4058 + <target_name>fcno32_bctype</target_name>
  4059 + <target_type>String</target_type>
  4060 + <target_format/>
  4061 + <target_length>-1</target_length>
  4062 + <target_precision>-1</target_precision>
  4063 + <target_decimal_symbol/>
  4064 + <target_grouping_symbol/>
  4065 + <target_currency_symbol/>
  4066 + <target_null_string/>
  4067 + <target_aggregation_type>-</target_aggregation_type>
  4068 + </field>
  4069 + <field>
  4070 + <field_name>xl_dir</field_name>
  4071 + <key_value>32</key_value>
  4072 + <target_name>fcno32_xldir</target_name>
  4073 + <target_type>String</target_type>
  4074 + <target_format/>
  4075 + <target_length>-1</target_length>
  4076 + <target_precision>-1</target_precision>
  4077 + <target_decimal_symbol/>
  4078 + <target_grouping_symbol/>
  4079 + <target_currency_symbol/>
  4080 + <target_null_string/>
  4081 + <target_aggregation_type>-</target_aggregation_type>
  4082 + </field>
  4083 + <field>
  4084 + <field_name>isfb</field_name>
  4085 + <key_value>32</key_value>
  4086 + <target_name>fcno32_isfb</target_name>
  4087 + <target_type>String</target_type>
  4088 + <target_format/>
  4089 + <target_length>-1</target_length>
  4090 + <target_precision>-1</target_precision>
  4091 + <target_decimal_symbol/>
  4092 + <target_grouping_symbol/>
  4093 + <target_currency_symbol/>
  4094 + <target_null_string/>
  4095 + <target_aggregation_type>-</target_aggregation_type>
  4096 + </field>
  4097 + <field>
  4098 + <field_name>id</field_name>
  4099 + <key_value>33</key_value>
  4100 + <target_name>fcno33_id</target_name>
  4101 + <target_type>String</target_type>
  4102 + <target_format/>
  4103 + <target_length>-1</target_length>
  4104 + <target_precision>-1</target_precision>
  4105 + <target_decimal_symbol/>
  4106 + <target_grouping_symbol/>
  4107 + <target_currency_symbol/>
  4108 + <target_null_string/>
  4109 + <target_aggregation_type>-</target_aggregation_type>
  4110 + </field>
  4111 + <field>
  4112 + <field_name>fcsj</field_name>
  4113 + <key_value>33</key_value>
  4114 + <target_name>fcno33_fcsj</target_name>
  4115 + <target_type>String</target_type>
  4116 + <target_format/>
  4117 + <target_length>-1</target_length>
  4118 + <target_precision>-1</target_precision>
  4119 + <target_decimal_symbol/>
  4120 + <target_grouping_symbol/>
  4121 + <target_currency_symbol/>
  4122 + <target_null_string/>
  4123 + <target_aggregation_type>-</target_aggregation_type>
  4124 + </field>
  4125 + <field>
  4126 + <field_name>fczdName</field_name>
  4127 + <key_value>33</key_value>
  4128 + <target_name>fcno33_zdname</target_name>
  4129 + <target_type>String</target_type>
  4130 + <target_format/>
  4131 + <target_length>-1</target_length>
  4132 + <target_precision>-1</target_precision>
  4133 + <target_decimal_symbol/>
  4134 + <target_grouping_symbol/>
  4135 + <target_currency_symbol/>
  4136 + <target_null_string/>
  4137 + <target_aggregation_type>-</target_aggregation_type>
  4138 + </field>
  4139 + <field>
  4140 + <field_name>bc_type</field_name>
  4141 + <key_value>33</key_value>
  4142 + <target_name>fcno33_bctype</target_name>
  4143 + <target_type>String</target_type>
  4144 + <target_format/>
  4145 + <target_length>-1</target_length>
  4146 + <target_precision>-1</target_precision>
  4147 + <target_decimal_symbol/>
  4148 + <target_grouping_symbol/>
  4149 + <target_currency_symbol/>
  4150 + <target_null_string/>
  4151 + <target_aggregation_type>-</target_aggregation_type>
  4152 + </field>
  4153 + <field>
  4154 + <field_name>xl_dir</field_name>
  4155 + <key_value>33</key_value>
  4156 + <target_name>fcno33_xldir</target_name>
  4157 + <target_type>String</target_type>
  4158 + <target_format/>
  4159 + <target_length>-1</target_length>
  4160 + <target_precision>-1</target_precision>
  4161 + <target_decimal_symbol/>
  4162 + <target_grouping_symbol/>
  4163 + <target_currency_symbol/>
  4164 + <target_null_string/>
  4165 + <target_aggregation_type>-</target_aggregation_type>
  4166 + </field>
  4167 + <field>
  4168 + <field_name>isfb</field_name>
  4169 + <key_value>33</key_value>
  4170 + <target_name>fcno33_isfb</target_name>
  4171 + <target_type>String</target_type>
  4172 + <target_format/>
  4173 + <target_length>-1</target_length>
  4174 + <target_precision>-1</target_precision>
  4175 + <target_decimal_symbol/>
  4176 + <target_grouping_symbol/>
  4177 + <target_currency_symbol/>
  4178 + <target_null_string/>
  4179 + <target_aggregation_type>-</target_aggregation_type>
  4180 + </field>
  4181 + <field>
  4182 + <field_name>id</field_name>
  4183 + <key_value>34</key_value>
  4184 + <target_name>fcno34_id</target_name>
  4185 + <target_type>String</target_type>
  4186 + <target_format/>
  4187 + <target_length>-1</target_length>
  4188 + <target_precision>-1</target_precision>
  4189 + <target_decimal_symbol/>
  4190 + <target_grouping_symbol/>
  4191 + <target_currency_symbol/>
  4192 + <target_null_string/>
  4193 + <target_aggregation_type>-</target_aggregation_type>
  4194 + </field>
  4195 + <field>
  4196 + <field_name>fcsj</field_name>
  4197 + <key_value>34</key_value>
  4198 + <target_name>fcno34_fcsj</target_name>
  4199 + <target_type>String</target_type>
  4200 + <target_format/>
  4201 + <target_length>-1</target_length>
  4202 + <target_precision>-1</target_precision>
  4203 + <target_decimal_symbol/>
  4204 + <target_grouping_symbol/>
  4205 + <target_currency_symbol/>
  4206 + <target_null_string/>
  4207 + <target_aggregation_type>-</target_aggregation_type>
  4208 + </field>
  4209 + <field>
  4210 + <field_name>fczdName</field_name>
  4211 + <key_value>34</key_value>
  4212 + <target_name>fcno34_zdname</target_name>
  4213 + <target_type>String</target_type>
  4214 + <target_format/>
  4215 + <target_length>-1</target_length>
  4216 + <target_precision>-1</target_precision>
  4217 + <target_decimal_symbol/>
  4218 + <target_grouping_symbol/>
  4219 + <target_currency_symbol/>
  4220 + <target_null_string/>
  4221 + <target_aggregation_type>-</target_aggregation_type>
  4222 + </field>
  4223 + <field>
  4224 + <field_name>bc_type</field_name>
  4225 + <key_value>34</key_value>
  4226 + <target_name>fcno34_bctype</target_name>
  4227 + <target_type>String</target_type>
  4228 + <target_format/>
  4229 + <target_length>-1</target_length>
  4230 + <target_precision>-1</target_precision>
  4231 + <target_decimal_symbol/>
  4232 + <target_grouping_symbol/>
  4233 + <target_currency_symbol/>
  4234 + <target_null_string/>
  4235 + <target_aggregation_type>-</target_aggregation_type>
  4236 + </field>
  4237 + <field>
  4238 + <field_name>xl_dir</field_name>
  4239 + <key_value>34</key_value>
  4240 + <target_name>fcno34_xldir</target_name>
  4241 + <target_type>String</target_type>
  4242 + <target_format/>
  4243 + <target_length>-1</target_length>
  4244 + <target_precision>-1</target_precision>
  4245 + <target_decimal_symbol/>
  4246 + <target_grouping_symbol/>
  4247 + <target_currency_symbol/>
  4248 + <target_null_string/>
  4249 + <target_aggregation_type>-</target_aggregation_type>
  4250 + </field>
  4251 + <field>
  4252 + <field_name>isfb</field_name>
  4253 + <key_value>34</key_value>
  4254 + <target_name>fcno34_isfb</target_name>
  4255 + <target_type>String</target_type>
  4256 + <target_format/>
  4257 + <target_length>-1</target_length>
  4258 + <target_precision>-1</target_precision>
  4259 + <target_decimal_symbol/>
  4260 + <target_grouping_symbol/>
  4261 + <target_currency_symbol/>
  4262 + <target_null_string/>
  4263 + <target_aggregation_type>-</target_aggregation_type>
  4264 + </field>
  4265 + <field>
  4266 + <field_name>id</field_name>
  4267 + <key_value>35</key_value>
  4268 + <target_name>fcno35_id</target_name>
  4269 + <target_type>String</target_type>
  4270 + <target_format/>
  4271 + <target_length>-1</target_length>
  4272 + <target_precision>-1</target_precision>
  4273 + <target_decimal_symbol/>
  4274 + <target_grouping_symbol/>
  4275 + <target_currency_symbol/>
  4276 + <target_null_string/>
  4277 + <target_aggregation_type>-</target_aggregation_type>
  4278 + </field>
  4279 + <field>
  4280 + <field_name>fcsj</field_name>
  4281 + <key_value>35</key_value>
  4282 + <target_name>fcno35_fcsj</target_name>
  4283 + <target_type>String</target_type>
  4284 + <target_format/>
  4285 + <target_length>-1</target_length>
  4286 + <target_precision>-1</target_precision>
  4287 + <target_decimal_symbol/>
  4288 + <target_grouping_symbol/>
  4289 + <target_currency_symbol/>
  4290 + <target_null_string/>
  4291 + <target_aggregation_type>-</target_aggregation_type>
  4292 + </field>
  4293 + <field>
  4294 + <field_name>fczdName</field_name>
  4295 + <key_value>35</key_value>
  4296 + <target_name>fcno35_zdname</target_name>
  4297 + <target_type>String</target_type>
  4298 + <target_format/>
  4299 + <target_length>-1</target_length>
  4300 + <target_precision>-1</target_precision>
  4301 + <target_decimal_symbol/>
  4302 + <target_grouping_symbol/>
  4303 + <target_currency_symbol/>
  4304 + <target_null_string/>
  4305 + <target_aggregation_type>-</target_aggregation_type>
  4306 + </field>
  4307 + <field>
  4308 + <field_name>bc_type</field_name>
  4309 + <key_value>35</key_value>
  4310 + <target_name>fcno35_bctype</target_name>
  4311 + <target_type>String</target_type>
  4312 + <target_format/>
  4313 + <target_length>-1</target_length>
  4314 + <target_precision>-1</target_precision>
  4315 + <target_decimal_symbol/>
  4316 + <target_grouping_symbol/>
  4317 + <target_currency_symbol/>
  4318 + <target_null_string/>
  4319 + <target_aggregation_type>-</target_aggregation_type>
  4320 + </field>
  4321 + <field>
  4322 + <field_name>xl_dir</field_name>
  4323 + <key_value>35</key_value>
  4324 + <target_name>fcno35_xldir</target_name>
  4325 + <target_type>String</target_type>
  4326 + <target_format/>
  4327 + <target_length>-1</target_length>
  4328 + <target_precision>-1</target_precision>
  4329 + <target_decimal_symbol/>
  4330 + <target_grouping_symbol/>
  4331 + <target_currency_symbol/>
  4332 + <target_null_string/>
  4333 + <target_aggregation_type>-</target_aggregation_type>
  4334 + </field>
  4335 + <field>
  4336 + <field_name>isfb</field_name>
  4337 + <key_value>35</key_value>
  4338 + <target_name>fcno35_isfb</target_name>
  4339 + <target_type>String</target_type>
  4340 + <target_format/>
  4341 + <target_length>-1</target_length>
  4342 + <target_precision>-1</target_precision>
  4343 + <target_decimal_symbol/>
  4344 + <target_grouping_symbol/>
  4345 + <target_currency_symbol/>
  4346 + <target_null_string/>
  4347 + <target_aggregation_type>-</target_aggregation_type>
  4348 + </field>
3779 4349 </fields>
3780 4350 <cluster_schema/>
3781 4351 <remotesteps> <input> </input> <output> </output> </remotesteps> <GUI>
... ...
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
... ... @@ -96,6 +96,25 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;BusInfoManageService_g&#39;, [&#39;$resource&#39;, fu
96 96 }
97 97 }
98 98 ),
  99 + import: $resource(
  100 + '/cars/importfile',
  101 + {},
  102 + {
  103 + do: {
  104 + method: 'POST',
  105 + headers: {
  106 + 'Content-Type': 'application/x-www-form-urlencoded'
  107 + },
  108 + transformRequest: function(obj) {
  109 + var str = [];
  110 + for (var p in obj) {
  111 + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
  112 + }
  113 + return str.join("&");
  114 + }
  115 + }
  116 + }
  117 + ),
99 118 validate: $resource(
100 119 '/cars/validate/:type',
101 120 {},
... ...
src/main/resources/static/real_control_v2/js/data/data_gps.js
... ... @@ -3,7 +3,7 @@
3 3 var gb_data_gps = (function() {
4 4  
5 5 //fixed time refresh delay
6   - var delay = 1000 * 80;
  6 + var delay = 1000 * 7;
7 7 //deviceId ——> gps
8 8 var realData = {};
9 9 //refresh after callback
... ...
src/main/resources/static/real_control_v2/js/main.js
... ... @@ -58,7 +58,7 @@ var gb_main_ep = new EventProxy(),
58 58 });
59 59  
60 60 //嵌入地图页面
61   - $('li.map-panel','#main-tab-content').load('/real_control_v2/mapmonitor/real.html');
  61 + $('li.map-panel','#main-tab-content').load('/real_control_v2/mapmonitor/real.html');
62 62 });
63 63  
64 64 function g_emit(id) {
... ...
src/main/resources/static/real_control_v2/mapmonitor/css/real.css
... ... @@ -305,4 +305,19 @@
305 305 left: 50%;
306 306 transform: translate(-50%, -50%);
307 307 -webkit-transform: translate(-50%, -50%);
  308 +}
  309 +
  310 +#tcWrap.maplibTc{
  311 + display: none;
  312 +}
  313 +
  314 +.real_spatial_panel{
  315 + position: absolute;
  316 + width: 300px;
  317 + height: 500px;
  318 + top: 5px;
  319 + left: 5px;
  320 + background: rgba(255, 255, 255, 0.98);
  321 + box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  322 + display: none;
308 323 }
309 324 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/map_config.html
... ... @@ -4,16 +4,16 @@
4 4 <div class="uk-form-row">
5 5 <span class="uk-form-label">图层</span>
6 6 <div class="uk-form-controls">
7   - <label><input type="radio" name="map_type" {{if map_type=='baidu'}}checked{{/if}}> 百度</label>
8   - <label><input type="radio" name="map_type" {{if map_type=='gaode'}}checked{{/if}}> 高德</label>
9   - <label><input type="checkbox" name="map_type" {{if traffic}}checked{{/if}}> 实时路况</label>
  7 + <label><input type="radio" value="baidu" name="map_type" {{if map_type=='baidu'}}checked{{/if}}> 百度</label>
  8 + <label><input type="radio" value="gaode" name="map_type" {{if map_type=='gaode'}}checked{{/if}}> 高德</label>
  9 + <label><input type="checkbox" name="traffic" {{if traffic}}checked{{/if}}> 实时路况</label>
10 10 </div>
11 11 </div>
12 12  
13 13 <div class="uk-form-row">
14 14 <span class="uk-form-label">空间数据</span>
15 15 <div class="uk-form-controls">
16   - <label><input type="checkbox" {{if spatialData.station}}checked{{/if}}> 站点</label>
  16 + <label><input type="checkbox" name="spatial_data_station" {{if spatialData.station}}checked{{/if}}> 站点</label>
17 17 <label><input type="checkbox" {{if spatialData.electronicFence}}checked{{/if}}> 电子围栏</label>
18 18 <label><input type="checkbox" {{if spatialData.carPark}}checked{{/if}}> 停车场</label>
19 19 </div>
... ... @@ -42,21 +42,21 @@
42 42 <div class="color_block">
43 43 上行
44 44 <div class="sp-placeholder">
45   - <div class="sp-placeholder-color" style="background: {{carIcon.color.up}}"></div>
  45 + <div class="sp-placeholder-color" data-name="carIcon.color.up" style="background: {{carIcon.color.up}}"></div>
46 46 </div>
47 47 </div>
48 48  
49 49 <div class="color_block">
50 50 下行
51 51 <div class="sp-placeholder">
52   - <div class="sp-placeholder-color" style="background: {{carIcon.color.down}}"></div>
  52 + <div class="sp-placeholder-color" data-name="carIcon.color.down" style="background: {{carIcon.color.down}}"></div>
53 53 </div>
54 54 </div>
55 55  
56 56 <div class="color_block">
57 57 非营运
58 58 <div class="sp-placeholder">
59   - <div class="sp-placeholder-color" style="background: {{carIcon.color.nonOperation}}"></div>
  59 + <div class="sp-placeholder-color" data-name="carIcon.color.nonOperation" style="background: {{carIcon.color.nonOperation}}"></div>
60 60 </div>
61 61 </div>
62 62 </div>
... ... @@ -68,14 +68,14 @@
68 68 <div class="color_block">
69 69 上行
70 70 <div class="sp-placeholder">
71   - <div class="sp-placeholder-color" style="background: {{section.color.up}}"></div>
  71 + <div class="sp-placeholder-color" data-name="section.color.up" style="background: {{section.color.up}}"></div>
72 72 </div>
73 73 </div>
74 74  
75 75 <div class="color_block">
76 76 下行
77 77 <div class="sp-placeholder">
78   - <div class="sp-placeholder-color" style="background: {{section.color.down}}"></div>
  78 + <div class="sp-placeholder-color" data-name="section.color.down" style="background: {{section.color.down}}"></div>
79 79 </div>
80 80 </div>
81 81 </div>
... ... @@ -85,3 +85,4 @@
85 85 </form>
86 86 </script>
87 87 </div>
  88 +<!-- 1111 -->
88 89 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/fragments/map_infowindow.html
1 1 <div>
2 2 <script id="map-win-gps-detail-temp" type="text/html">
3   - <div class="gps_info_win">
4   - <h5 style="color:#0E6AF9;">
5   - {{if stationName!=null}}
  3 + <div class="gps_info_win" >
  4 + <h4>{{nbbm}}</h4>
  5 + <h5>
  6 + {{lineName}}
  7 + ({{if stationName!=null}}
6 8 {{stationName}}
7 9 {{else}}
8 10 未知站点
9   - {{/if}}
  11 + {{/if}})
10 12 </h5>
11   - <h4 style="margin: 5px 0 5px 0;">
12   - <span style="color: #0E6AF9;">{{nbbm}}</span>
13   - </h4>
14   - <p>
15   - 营运状态:{{if state==0}}营运{{else}}非营运{{/if}}
16   - </p>
17   - <p>
18   - 走向:{{if upDown==0}}上行{{else if upDown==1}}下行{{else}}未知走向{{/if}}
19   - </p>
20 13 <p>速度:{{speed}}</p>
  14 + <p>角度:{{direction}}</p>
21 15 <p>经度:{{lon}}</p>
22 16 <p>纬度:{{lat}}</p>
23 17  
24   - <!--<p style="color: gray;">{{fromNow}} 更新</p>-->
  18 + <p class="date-str">{{dateStr}}</p>
25 19 <hr>
26   - <p>
27   - {{if currSch!=null}}
28   - 路牌:{{currSch.lpName}}
29   - {{/if}}
30   - </p>
31   - <p class="banci-info">
32   - {{if currSch!=null}}开往 {{currSch.zdzName}}{{/if}}
33   - </p>
34   - <p class="banci-info">
35   - {{if nextSch!=null}}
36   - 下一班{{nextSch.qdzName}} {{nextSch.fcsj}} 发车
37   - {{/if}}
38   - </p>
39   - <a href="javascript:lineGroup.toPlayBack('{{nbbm}}', '{{lineId}}')" class="link_to_pback"
40   - style="color:#006600;font-size:12px;">轨迹回放</a>
  20 + {{if expectStopTime!=null}}
  21 + <a href="javascript:;" style="color: #07D;margin-right: 7px;">预计 {{expectStopTime}} 分钟到达终点</a>
  22 + {{/if}}
  23 + <a href="javascript:;" style="float: right;">轨迹回放</a>
41 24 </div>
42 25 </script>
43 26 </div>
  27 +<!-- 2222 -->
44 28 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/config.js
1 1 /** 地图配置信息 */
2 2  
3   -var gb_map_config=(function () {
  3 +var gb_map_config = (function () {
4 4  
5   - var defaultConfig={
  5 + var defaultConfig = {
6 6  
7 7 //地图类型
8 8 map_type: 'baidu',
... ... @@ -27,7 +27,7 @@ var gb_map_config=(function () {
27 27 nonOperation: 'rgba(136, 133, 133, 1)'
28 28 }
29 29 },
30   - section:{
  30 + section: {
31 31 color: {
32 32 up: 'blue',
33 33 down: 'red'
... ... @@ -42,12 +42,12 @@ var gb_map_config=(function () {
42 42 temps = gb_common.compileTempByDom(dom, {compress: true});
43 43  
44 44 //渲染表单
45   - var formHtml=temps['map-config-form-temp'](defaultConfig);
  45 + var formHtml = temps['map-config-form-temp'](defaultConfig);
46 46 $('.map_config_wrap').html(formHtml);
47 47  
48 48 //颜色选择器
49 49 $('.map_config_wrap .color_block .sp-placeholder .sp-placeholder-color').each(function () {
50   - var c=$(this).css('background-color');
  50 + var c = $(this).css('background-color');
51 51 $(this).spectrum({
52 52 color: c,
53 53 showInput: true,
... ... @@ -73,57 +73,85 @@ var gb_map_config=(function () {
73 73 var configChangeHandler = function () {
74 74 //console.log('configChangeHandler..',this);
75 75 var name = $(this).attr('name')
76   - ,val = $(this).attr('value');
  76 + , val = $(this).attr('value');
77 77  
78   - if(!name)
  78 + if (!name)
79 79 return;
80 80  
81   - handler[name] && handler[name](val);
  81 + handler[name] && handler[name].call(this, val);
82 82 };
83 83  
84   - var handler={
85   - map_type: changeMapType
  84 + var handler = {
  85 + map_type: changeMapType,
  86 + traffic: trafficSwitch,
  87 + spatial_data_station: spatial_data_station
86 88 };
87 89  
88 90 //切换地图类型
89 91 function changeMapType(val) {
  92 + //修改配置项
  93 + set('map_type', val);
  94 +
90 95 gb_map_imap.changeMap(val, function () {
  96 + //重绘覆盖物
91 97 gb_map_overlay_mge.reDraw();
  98 + setTimeout(function () {
  99 + //实时路况为打开状态
  100 + if (defaultConfig.traffic)
  101 + gb_map_imap.call('traffic', true);
  102 + }, 1000);
92 103 });
93 104 }
94 105  
95   - function recursion_get_attr(data, attr){
  106 + //实时路况
  107 + function trafficSwitch(val) {
  108 + //修改配置项
  109 + set('traffic', this.checked);
  110 + gb_map_imap.call('traffic', this.checked);
  111 + }
  112 +
  113 + //空间数据 站点
  114 + function spatial_data_station(val) {
  115 + defaultConfig.spatialData.station=this.checked;
  116 + gb_map_spatial_data.refresh();
  117 + }
  118 +
  119 + function recursion_get_attr(data, attr) {
96 120 var ats = attr.split('.'),
97 121 val = data;
98 122  
99 123 $.each(ats, function (i, a) {
100   - val=val[a];
  124 + val = val[a];
101 125  
102   - if(!val)
  126 + if (!val)
103 127 return false;
104 128 });
105 129  
106 130 return val;
107 131 }
108   -
  132 +
109 133 function recursion_set_attr(data, attr, value) {
110 134 var ats = attr.split('.'),
111 135 tempVal = data
112   - ,len = ats.length;
  136 + , len = ats.length;
113 137  
114 138 $.each(ats, function (i, a) {
115   - if(i == len -1){
  139 + if (i == len - 1) {
116 140 tempVal[a] = value;
117 141 return false;
118 142 }
119 143 else
120   - tempVal=tempVal[a];
  144 + tempVal = tempVal[a];
121 145  
122   - if(!tempVal)
  146 + if (!tempVal)
123 147 return false;
124 148 });
125 149 }
126 150  
  151 + function set(name, val) {
  152 + defaultConfig[name] = val;
  153 + }
  154 +
127 155 return {
128 156 getConfig: function () {
129 157 return defaultConfig;
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/map/iMap.js
... ... @@ -24,20 +24,17 @@ var gb_map_imap = (function () {
24 24 var oldMap = maps[currentMap].instance;
25 25 oldMap.destroy && oldMap.destroy();
26 26 //新地图 INIT
27   - var text = maps[mapName].text;
  27 + //var text = maps[mapName].text;
28 28 //layer.msg('正在切换到' + text + '...', {icon : 16,shade : [ 0.6, '#393D49' ],time : 0});
29 29 var newMap = maps[mapName].instance;
30   - newMap.init(cb);
31 30  
32 31 currentMap = mapName;
  32 + newMap.init(cb);
33 33 } else
34 34 alertErr('不存在的地图实例' + mapName);
35 35 },
36 36 createCarIcon: createCarIcon,
37 37 call: function (f, opts) {
38   - if (f == 'init')
39   - setText(maps[currentMap].text);
40   -
41 38 var instance = maps[currentMap].instance;
42 39 if (instance[f])
43 40 instance[f](opts);
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/map/platform/baidu.js
... ... @@ -11,6 +11,8 @@ var gb_map_baidu = (function(){
11 11  
12 12 var polylines={};
13 13 var buffAreas = {};
  14 +
  15 + var ctrl;
14 16 var baiduInstance = {
15 17 //初始化
16 18 init: function(cb){
... ... @@ -20,18 +22,17 @@ var gb_map_baidu = (function(){
20 22 }
21 23 map = new BMap.Map($(gb_map_consts.mapContainer)[0]);
22 24 //中心点和缩放级别
23   - map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 12);
  25 + map.centerAndZoom(new BMap.Point(gb_map_consts.center_point.lng, gb_map_consts.center_point.lat), 13);
24 26 map.enableScrollWheelZoom();
25 27  
26   -
27   -
  28 + cb && cb();
28 29 //window.localStorage.setItem('real_map', 'baidu');
29 30  
30 31 // 路况控件
31   -/* var ctrl = new BMapLib.TrafficControl();
  32 + ctrl = new BMapLib.TrafficControl();
32 33 map.addControl(ctrl);
33 34  
34   - $(gb_map_consts.trafficBtn).on('click', function() {
  35 + /*$(gb_map_consts.trafficBtn).on('click', function() {
35 36 if (traffVisible) {
36 37 ctrl.hide();
37 38 traffVisible = false;
... ... @@ -78,8 +79,16 @@ var gb_map_baidu = (function(){
78 79 if(opt.hide)
79 80 polyline.hide();
80 81 map.addOverlay(polyline);
81   - //居中
82   - //centerToPolyline(polyline);
  82 +
  83 + //延迟居中,避免多次调用时抖动
  84 + delayToCenter(pos[parseInt(pos.length / 2)]);
  85 + //map.panTo(pos[parseInt(pos.length / 2)]);
  86 + },
  87 + traffic: function (enable) {
  88 + if(enable)
  89 + ctrl.show();
  90 + else
  91 + ctrl.hide();
83 92 },
84 93 //根据id 显示polyline
85 94 refreshPolyline: function (opt) {
... ... @@ -212,9 +221,9 @@ var gb_map_baidu = (function(){
212 221 }
213 222  
214 223 var bd_gps_info_win_opts = {
215   - width : 190,
  224 + width : 0,
216 225 height: 255,
217   - enableMessage:true
  226 + enableMessage:false
218 227 };
219 228 function createBDMarkerByGps(gpsData){
220 229  
... ... @@ -239,7 +248,7 @@ var gb_map_baidu = (function(){
239 248 }
240 249  
241 250 //隐藏线路线条
242   - function hideLinePolyline(){
  251 +/* function hideLinePolyline(){
243 252 if(!linePolyline || linePolyline.length == 0)
244 253 return;
245 254  
... ... @@ -258,7 +267,7 @@ var gb_map_baidu = (function(){
258 267 $.each(linePolyline, function(){
259 268 this.setStrokeOpacity(0.5);
260 269 });
261   - }
  270 + }*/
262 271  
263 272 function moveMarker(m, gps){
264 273 m.setPosition(new BMap.Point(gps.bd_lon, gps.bd_lat));
... ... @@ -297,6 +306,15 @@ var gb_map_baidu = (function(){
297 306 map.panTo(pos[parseInt(pos.length / 2)]);
298 307 }*/
299 308  
  309 +
  310 + var c_delay = 300, c_point;
  311 + function delayToCenter(point) {
  312 + c_point = point;
  313 + setTimeout(function () {
  314 + map.panTo(c_point);
  315 + }, c_delay);
  316 + }
  317 +
300 318 //文件载入完毕
301 319 mapmonitor_load_ep.emitLater('load_baidu');
302 320  
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/map/platform/gaode.js
... ... @@ -19,6 +19,7 @@ var gb_map_gaode = (function() {
19 19 var polylines={};
20 20 //实时路况是否显示
21 21 var traffVisible;
  22 + var trafficLayer;
22 23 var gaodeInstance = {
23 24 init : function(cb) {
24 25 var $mapCon = $(gb_map_consts.mapContainer);
... ... @@ -28,7 +29,7 @@ var gb_map_gaode = (function() {
28 29  
29 30 map = new AMap.Map($mapCon[0]);
30 31 // 地图中心和缩放级别
31   - map.setZoomAndCenter(14, [ gb_map_consts.center_point.lng, gb_map_consts.center_point.lat ]);
  32 + map.setZoomAndCenter(13, [ gb_map_consts.center_point.lng, gb_map_consts.center_point.lat ]);
32 33 // 加载完成
33 34 AMap.event.addListener(map, 'complete', function() {
34 35 //window.localStorage.setItem('real_map', 'gaode');
... ... @@ -38,11 +39,11 @@ var gb_map_gaode = (function() {
38 39 });
39 40  
40 41 // 实时路况图层
41   - /*var trafficLayer = new AMap.TileLayer.Traffic();
  42 + trafficLayer = new AMap.TileLayer.Traffic();
42 43 trafficLayer.setMap(map);
43 44 trafficLayer.hide();
44 45  
45   - $(gb_map_consts.trafficBtn).on('click', function() {
  46 + /*$(gb_map_consts.trafficBtn).on('click', function() {
46 47 if (traffVisible) {
47 48 trafficLayer.hide();
48 49 traffVisible = false;
... ... @@ -67,6 +68,12 @@ var gb_map_gaode = (function() {
67 68 $('.mapTools').removeClass('gaode');
68 69 $('.leftUtils').removeClass('gaode');
69 70 },
  71 + traffic: function (enable) {
  72 + if(enable)
  73 + trafficLayer.show();
  74 + else
  75 + trafficLayer.hide();
  76 + },
70 77 clearAll: function () {
71 78 realMarkers = {};
72 79 polylines={};
... ... @@ -88,7 +95,6 @@ var gb_map_gaode = (function() {
88 95 });
89 96  
90 97 opt.style.path=pos;
91   - console.log('opt.style', opt.style);
92 98 var polyline = new AMap.Polyline(opt.style);
93 99 //根据ID保存映射
94 100 polylines[opt.id]=polyline;
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/map_overlay_manager.js
... ... @@ -76,7 +76,7 @@ var gb_map_overlay_mge = (function () {
76 76  
77 77 showOverlayByChecks();
78 78 //显示路段
79   - showSection(gb_map_gps_tree.getChecked().filter(deviceFilter));
  79 + showSection(getCheckedDevice());
80 80  
81 81 reDrawing = false;
82 82 }
... ... @@ -89,7 +89,7 @@ var gb_map_overlay_mge = (function () {
89 89  
90 90  
91 91 var showOverlayByChecks = function () {
92   - var chs = gb_map_gps_tree.getChecked().filter(deviceFilter),chsMap={};
  92 + var chs = getCheckedDevice(),chsMap={};
93 93 $.each(chs, function () {
94 94 chsMap[this.a_attr.device]=true;
95 95 });
... ... @@ -106,6 +106,10 @@ var gb_map_overlay_mge = (function () {
106 106 //打开信息窗口
107 107 gb_map_imap.call('openWindow',{deviceId: deviceId});
108 108 };
  109 +
  110 + function getCheckedDevice() {
  111 + return gb_map_gps_tree.getChecked().filter(deviceFilter);
  112 + }
109 113 return {
110 114 init: init,
111 115 refresh: showOverlayByChecks,
... ... @@ -113,6 +117,7 @@ var gb_map_overlay_mge = (function () {
113 117 map_gps_win_temp: function (data) {
114 118 return temps['map-win-gps-detail-temp'](data);
115 119 },
116   - reDraw: reDraw
  120 + reDraw: reDraw,
  121 + getCheckedDevice: getCheckedDevice
117 122 };
118 123 })();
119 124 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/real.js
... ... @@ -9,7 +9,10 @@ var mapmonitor_load_ep = EventProxy.create(&#39;load_iMap&#39;, &#39;load_baidu&#39;, &#39;load_gaod
9 9 gb_map_config.init();
10 10  
11 11 //init tree
12   - gb_map_gps_tree.init(gb_map_overlay_mge.init);
  12 + gb_map_gps_tree.init(function () {
  13 + gb_map_overlay_mge.init();
  14 + gb_map_spatial_data.init();
  15 + });
13 16  
14 17 $(".real_bottom_panel").resizable({
15 18 handles: {
... ...
src/main/resources/static/real_control_v2/mapmonitor/js/spatial_data.js 0 → 100644
  1 +/** 空间数据 */
  2 +
  3 +var gb_map_spatial_data = (function () {
  4 +
  5 + var storage = window.localStorage;
  6 +
  7 + var activeLines = JSON.parse(storage.getItem('lineControlItems'));
  8 + var line_idx = (function () {
  9 + var str = '';
  10 + for (var i = 0, item; item = activeLines[i++];) {
  11 + str += (',' + item.lineCode);
  12 + }
  13 + return str.substr(1);
  14 + })();
  15 +
  16 + //线路站点路由数据
  17 + var lineStationArr;
  18 +
  19 +
  20 + var init = function () {
  21 + gb_common.$get('/realMap/stationSpatialData', {idx: line_idx}, function (rs) {
  22 + var list = rs.list;
  23 + //排序
  24 + list.sort(function (a, b) {
  25 + return a.stationRouteCode - b.stationRouteCode;
  26 + });
  27 + //按线路分组
  28 + var lineStationArr = gb_common.groupBy(list, 'lineCode');
  29 + //再按上下行分组
  30 + for (var lineCode in lineStationArr) {
  31 + lineStationArr[lineCode] = gb_common.groupBy(lineStationArr[lineCode], 'directions');
  32 + }
  33 +
  34 + refresh();
  35 + });
  36 + }
  37 +
  38 + var refresh = function () {
  39 + if(!triggerElem())
  40 + return;
  41 +
  42 + var chs = gb_map_overlay_mge.getCheckedDevice();
  43 + //要绘制的站点路由
  44 + var routes = {};
  45 + $.each(chs, function () {
  46 + routes[this.data.lineId+'_'+this.data.upDown]=1;
  47 + });
  48 +
  49 + console.log('chs', chs);
  50 + }
  51 +
  52 + var triggerElem = function () {
  53 + var config = gb_map_config.getConfig().spatialData
  54 + , elem = $('.real_spatial_panel');
  55 +
  56 + for (var att in config) {
  57 + if (config[att]) {
  58 + elem.show();
  59 + return true;
  60 + }
  61 + }
  62 + elem.hide();
  63 + return false;
  64 + }
  65 +
  66 + return {
  67 + refresh: refresh,
  68 + init: init
  69 + };
  70 +})();
0 71 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/mapmonitor/real.html
... ... @@ -29,9 +29,13 @@
29 29 </div>
30 30 </div>
31 31  
  32 +<div class="real_spatial_panel uk-animation-scale">
  33 +
  34 +</div>
32 35  
33 36 <script src="/real_control_v2/mapmonitor/js/config.js"></script>
34 37 <script src="/real_control_v2/mapmonitor/js/gps_tree.js"></script>
  38 +<script src="/real_control_v2/mapmonitor/js/spatial_data.js"></script>
35 39 <script src="/real_control_v2/mapmonitor/js/map_overlay_manager.js"></script>
36 40 <script src="/real_control_v2/mapmonitor/js/real.js"></script>
37 41 <script src="/real_control_v2/mapmonitor/js/map/iMap.js"></script>
... ...