Commit afec74968dd2b5d5f00493fdf433ae1f17f0f1df

Authored by zlz
2 parents 851da92c 26bb522b

Merge remote-tracking branch 'origin/minhang' into minhang

Showing 78 changed files with 3018 additions and 636 deletions

Too many changes to show.

To preserve performance only 78 of 375 files are displayed.

... ... @@ -18,21 +18,19 @@
18 18 <groupId>org.springframework.boot</groupId>
19 19 <artifactId>spring-boot-starter-web</artifactId>
20 20 </dependency>
21   -
  21 +
22 22 <dependency>
23   - <groupId>org.springframework.boot</groupId>
24   - <artifactId>spring-boot-starter-tomcat</artifactId>
25   - <scope>provided</scope>
26   - </dependency>
27   -
  23 + <groupId>org.springframework.boot</groupId>
  24 + <artifactId>spring-boot-starter-tomcat</artifactId>
  25 + <scope>provided</scope>
  26 + </dependency>
  27 +
28 28 <dependency>
29 29 <groupId>org.springframework.boot</groupId>
30 30 <artifactId>spring-boot-starter-security</artifactId>
31 31 </dependency>
32   -<!-- <dependency>
33   - <groupId>org.springframework.security</groupId>
34   - <artifactId>spring-security-config</artifactId>
35   - </dependency> -->
  32 + <!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId>
  33 + </dependency> -->
36 34 <dependency>
37 35 <groupId>org.springframework.boot</groupId>
38 36 <artifactId>spring-boot-starter-data-jpa</artifactId>
... ... @@ -68,27 +66,32 @@
68 66 <artifactId>fastjson</artifactId>
69 67 <version>1.2.4</version>
70 68 </dependency>
71   -
  69 +
72 70 <dependency>
73   - <groupId>org.apache.httpcomponents</groupId>
74   - <artifactId>httpclient</artifactId>
75   - </dependency>
  71 + <groupId>org.apache.httpcomponents</groupId>
  72 + <artifactId>httpclient</artifactId>
  73 + </dependency>
76 74  
77 75 <dependency>
78 76 <groupId>commons-dbcp</groupId>
79 77 <artifactId>commons-dbcp</artifactId>
80 78 </dependency>
81   - <dependency>
82   - <groupId>commons-lang</groupId>
83   - <artifactId>commons-lang</artifactId>
84   - <version>2.6</version>
85   - </dependency>
  79 + <dependency>
  80 + <groupId>commons-lang</groupId>
  81 + <artifactId>commons-lang</artifactId>
  82 + <version>2.6</version>
  83 + </dependency>
86 84 <dependency>
87 85 <groupId>org.apache.commons</groupId>
88 86 <artifactId>commons-lang3</artifactId>
89 87 <version>3.4</version>
90 88 </dependency>
91 89 <dependency>
  90 + <groupId>commons-fileupload</groupId>
  91 + <artifactId>commons-fileupload</artifactId>
  92 + <version>1.2.2</version>
  93 + </dependency>
  94 + <dependency>
92 95 <groupId>commons-io</groupId>
93 96 <artifactId>commons-io</artifactId>
94 97 <version>2.4</version>
... ... @@ -111,38 +114,38 @@
111 114 </dependency>
112 115 <!-- ftp文件上传包 -->
113 116 <dependency>
114   - <groupId>commons-net</groupId>
115   - <artifactId>commons-net</artifactId>
116   - <version>3.5</version>
  117 + <groupId>commons-net</groupId>
  118 + <artifactId>commons-net</artifactId>
  119 + <version>3.5</version>
  120 + </dependency>
  121 + <dependency>
  122 + <groupId>org.apache.commons</groupId>
  123 + <artifactId>commons-compress</artifactId>
  124 + <version>1.3</version>
  125 + </dependency>
  126 + <!-- drools 6依赖 -->
  127 + <dependency>
  128 + <groupId>org.kie</groupId>
  129 + <artifactId>kie-api</artifactId>
117 130 </dependency>
118 131 <dependency>
119   - <groupId>org.apache.commons</groupId>
120   - <artifactId>commons-compress</artifactId>
121   - <version>1.3</version>
  132 + <groupId>org.drools</groupId>
  133 + <artifactId>drools-compiler</artifactId>
  134 + </dependency>
  135 +
  136 + <!-- springboot测试 -->
  137 + <dependency>
  138 + <groupId>org.springframework.boot</groupId>
  139 + <artifactId>spring-boot-starter-test</artifactId>
  140 + <scope>test</scope>
122 141 </dependency>
123   - <!-- drools 6依赖 -->
124   - <dependency>
125   - <groupId>org.kie</groupId>
126   - <artifactId>kie-api</artifactId>
127   - </dependency>
128   - <dependency>
129   - <groupId>org.drools</groupId>
130   - <artifactId>drools-compiler</artifactId>
131   - </dependency>
132 142  
133   - <!-- springboot测试 -->
134   - <dependency>
135   - <groupId>org.springframework.boot</groupId>
136   - <artifactId>spring-boot-starter-test</artifactId>
137   - <scope>test</scope>
138   - </dependency>
139   -
140   - <dependency>
  143 + <dependency>
141 144 <groupId>c3p0</groupId>
142 145 <artifactId>c3p0</artifactId>
143 146 <version>0.9.1.2</version>
144 147 </dependency>
145   -
  148 +
146 149 <!-- 图表 -->
147 150 <dependency>
148 151 <groupId>com.google.code.gson</groupId>
... ... @@ -155,82 +158,79 @@
155 158 <version>2.1.8</version>
156 159 </dependency>
157 160  
158   - <dependency>
159   - <groupId>org.apache.tika</groupId>
160   - <artifactId>tika-core</artifactId>
161   - <version>1.7</version>
162   - </dependency>
  161 + <dependency>
  162 + <groupId>org.apache.tika</groupId>
  163 + <artifactId>tika-core</artifactId>
  164 + <version>1.7</version>
  165 + </dependency>
  166 +
  167 + <!-- pentaho kettle 依赖 -->
  168 + <dependency>
  169 + <groupId>com.pentaho.kettle</groupId>
  170 + <artifactId>kettle-core</artifactId>
  171 + <version>6.0.1.0-386</version>
  172 + </dependency>
  173 + <dependency>
  174 + <groupId>com.pentaho.kettle</groupId>
  175 + <artifactId>kettle-engine</artifactId>
  176 + <version>6.0.1.0-386</version>
  177 + </dependency>
  178 + <dependency>
  179 + <groupId>com.pentaho.kettle</groupId>
  180 + <artifactId>metastore</artifactId>
  181 + <version>6.0.1.0-386</version>
  182 + </dependency>
  183 + <dependency>
  184 + <groupId>com.pentaho.kettle</groupId>
  185 + <artifactId>vfs2</artifactId>
  186 + <version>2.1-20150824</version>
  187 + </dependency>
  188 + <dependency>
  189 + <groupId>net.sourceforge.jexcelapi</groupId>
  190 + <artifactId>jxl</artifactId>
  191 + <version>2.6.12</version>
  192 + </dependency>
  193 + <dependency>
  194 + <groupId>rhino</groupId>
  195 + <artifactId>js</artifactId>
  196 + <version>1.7R2</version>
  197 + </dependency>
  198 + <dependency>
  199 + <groupId>javax.mail</groupId>
  200 + <artifactId>mail</artifactId>
  201 + <version>1.4.7</version>
  202 + </dependency>
163 203  
164   - <!-- pentaho kettle 依赖 -->
165   - <dependency>
166   - <groupId>com.pentaho.kettle</groupId>
167   - <artifactId>kettle-core</artifactId>
168   - <version>6.0.1.0-386</version>
169   - </dependency>
170   - <dependency>
171   - <groupId>com.pentaho.kettle</groupId>
172   - <artifactId>kettle-engine</artifactId>
173   - <version>6.0.1.0-386</version>
174   - </dependency>
175   - <dependency>
176   - <groupId>com.pentaho.kettle</groupId>
177   - <artifactId>metastore</artifactId>
178   - <version>6.0.1.0-386</version>
179   - </dependency>
180   - <dependency>
181   - <groupId>com.pentaho.kettle</groupId>
182   - <artifactId>vfs2</artifactId>
183   - <version>2.1-20150824</version>
184   - </dependency>
185   - <dependency>
186   - <groupId>net.sourceforge.jexcelapi</groupId>
187   - <artifactId>jxl</artifactId>
188   - <version>2.6.12</version>
189   - </dependency>
190   - <dependency>
191   - <groupId>rhino</groupId>
192   - <artifactId>js</artifactId>
193   - <version>1.7R2</version>
194   - </dependency>
195   - <dependency>
196   - <groupId>javax.mail</groupId>
197   - <artifactId>mail</artifactId>
198   - <version>1.4.7</version>
199   - </dependency>
  204 + <dependency>
  205 + <groupId>com.github.axet</groupId>
  206 + <artifactId>kaptcha</artifactId>
  207 + <version>0.0.9</version>
  208 + </dependency>
200 209  
201 210 <dependency>
202   - <groupId>com.github.axet</groupId>
203   - <artifactId>kaptcha</artifactId>
204   - <version>0.0.9</version>
205   - </dependency>
206   -
207   - <dependency>
208   - <groupId>commons-codec</groupId>
209   - <artifactId>commons-codec</artifactId>
210   - <version>1.4</version>
211   - <scope>compile</scope>
212   - </dependency>
213   - <dependency>
214   - <groupId>org.bouncycastle</groupId>
215   - <artifactId>bcprov-jdk15on</artifactId>
216   - <version>1.52</version>
217   - </dependency>
218   - <dependency>
219   - <groupId>axis</groupId>
220   - <artifactId>axis</artifactId>
221   - <version>1.4</version>
222   - </dependency>
223   - <dependency>
224   - <groupId>javax.xml</groupId>
225   - <artifactId>jaxrpc-api</artifactId>
226   - <version>1.1</version>
  211 + <groupId>commons-codec</groupId>
  212 + <artifactId>commons-codec</artifactId>
  213 + <version>1.4</version>
  214 + <scope>compile</scope>
  215 + </dependency>
  216 + <dependency>
  217 + <groupId>org.bouncycastle</groupId>
  218 + <artifactId>bcprov-jdk15on</artifactId>
  219 + <version>1.52</version>
  220 + </dependency>
  221 + <dependency>
  222 + <groupId>axis</groupId>
  223 + <artifactId>axis</artifactId>
  224 + <version>1.4</version>
  225 + </dependency>
  226 + <dependency>
  227 + <groupId>javax.xml</groupId>
  228 + <artifactId>jaxrpc-api</artifactId>
  229 + <version>1.1</version>
227 230 </dependency>
228 231  
229   -<!-- <dependency>
230   - <groupId>org.springframework.boot</groupId>
231   - <artifactId>spring-boot-devtools</artifactId>
232   - <optional>true</optional>
233   - </dependency>-->
  232 + <!-- <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId>
  233 + <optional>true</optional> </dependency> -->
234 234 <dependency>
235 235 <groupId>com.vividsolutions</groupId>
236 236 <artifactId>jts</artifactId>
... ... @@ -239,18 +239,18 @@
239 239  
240 240 </dependencies>
241 241  
242   - <dependencyManagement>
243   - <dependencies>
244   - <!-- drools 6依赖 -->
245   - <dependency>
246   - <groupId>org.drools</groupId>
247   - <artifactId>drools-bom</artifactId>
248   - <type>pom</type>
249   - <version>6.2.0.Final</version>
250   - <scope>import</scope>
251   - </dependency>
252   - </dependencies>
253   - </dependencyManagement>
  242 + <dependencyManagement>
  243 + <dependencies>
  244 + <!-- drools 6依赖 -->
  245 + <dependency>
  246 + <groupId>org.drools</groupId>
  247 + <artifactId>drools-bom</artifactId>
  248 + <type>pom</type>
  249 + <version>6.3.0.Final</version>
  250 + <scope>import</scope>
  251 + </dependency>
  252 + </dependencies>
  253 + </dependencyManagement>
254 254  
255 255 <build>
256 256 <plugins>
... ... @@ -304,8 +304,8 @@
304 304 <url>http://repo.spring.io/milestone</url>
305 305 </pluginRepository>
306 306 </pluginRepositories>
307   -
  307 +
308 308 <properties>
309   - <start-class>com.bsth.Application</start-class>
  309 + <start-class>com.bsth.Application</start-class>
310 310 </properties>
311 311 </project>
... ...
src/main/java/com/bsth/common/Constants.java
... ... @@ -21,6 +21,9 @@ public class Constants {
21 21 public static final String LOGIN_FAILURE = "/user/loginFailure";
22 22 public static final String CAPTCHA = "/captcha.jpg";
23 23  
  24 + //对外的营运数据接口
  25 + public static final String SERVICE_INTERFACE = "/companyService/**";
  26 +
24 27 /**
25 28 * 线调部分子页面不做拦截,便于浏览器缓存
26 29 */
... ...
src/main/java/com/bsth/controller/DownloadController.java
... ... @@ -20,6 +20,7 @@ import org.springframework.http.ResponseEntity;
20 20 import org.springframework.stereotype.Component;
21 21 import org.springframework.web.bind.annotation.RequestMapping;
22 22  
  23 +import com.google.protobuf.UnknownFieldSet.Field;
23 24 import com.mysql.fabric.Response;
24 25  
25 26 /**
... ... @@ -39,9 +40,8 @@ public class DownloadController
39 40  
40 41 @RequestMapping("download2")
41 42 public ResponseEntity<byte[]> download2(String fileName) throws IOException {
42   -// fileName = fileName+".xls";
43 43 String fileNames=URLDecoder.decode(fileName,"UTF-8");
44   - fileNames =fileNames + ".xls";
  44 + fileNames = fileNames + ".xls";
45 45 String moudelPath = this.getClass().getResource("/").getPath()+ "static/pages/forms/export/"+fileNames;
46 46 System.out.println(moudelPath);
47 47 // String path="D:\\export\\target\\"+jName+".xls";
... ... @@ -75,5 +75,29 @@ public class DownloadController
75 75 os.write(buffer);// 输出文件
76 76 os.flush();
77 77 os.close();
  78 + file.delete();
  79 + }
  80 +
  81 + @RequestMapping("downloadList")
  82 + public void downloadList(HttpServletResponse response,String fileName)
  83 + throws IOException {
  84 +// String fileNames=URLDecoder.decode(fileName,"UTF-8");
  85 + fileName = fileName + ".zip";
  86 + String moudelPath = this.getClass().getResource("/").getPath()+ "static/pages/forms/export/"+fileName;
  87 + File file = new File(moudelPath);// path是根据日志路径和文件名拼接出来的
  88 +// String filename = file.getName();// 获取日志文件名称
  89 + InputStream fis = new BufferedInputStream(new FileInputStream(moudelPath));
  90 + byte[] buffer = new byte[fis.available()];
  91 + fis.read(buffer);
  92 + fis.close();
  93 + response.reset();
  94 + response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.replaceAll(" ", "").getBytes("utf-8"),"iso8859-1"));
  95 + response.addHeader("Content-Length", "" + file.length());
  96 + OutputStream os = new BufferedOutputStream(response.getOutputStream());
  97 + response.setContentType("application/octet-stream");
  98 + os.write(buffer);// 输出文件
  99 + os.flush();
  100 + os.close();
  101 + file.delete();
78 102 }
79 103 }
... ...
src/main/java/com/bsth/controller/logger/MileModifyController.java 0 → 100644
  1 +package com.bsth.controller.logger;
  2 +
  3 +import com.bsth.controller.BaseController;
  4 +import com.bsth.entity.logger.Logger_MileModify;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RestController;
  7 +
  8 +/**
  9 + * Created by panzhao on 2017/3/6.
  10 + */
  11 +@RestController
  12 +@RequestMapping("logger_mile_modify")
  13 +public class MileModifyController extends BaseController<Logger_MileModify, Long>{
  14 +}
... ...
src/main/java/com/bsth/controller/oil/CdlController.java 0 → 100644
  1 +package com.bsth.controller.oil;
  2 +
  3 +import java.util.Date;
  4 +import java.util.Map;
  5 +
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RequestMethod;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import com.bsth.controller.BaseController;
  12 +import com.bsth.entity.oil.Cdl;
  13 +import com.bsth.service.oil.CdlService;
  14 +
  15 +@RestController
  16 +@RequestMapping("cdl")
  17 +public class CdlController extends BaseController<Cdl, Integer>{
  18 + @Autowired
  19 + CdlService service;
  20 + @RequestMapping(value = "/save",method = RequestMethod.POST)
  21 + public Map<String, Object> saveCdl(Cdl t){
  22 +// SysUser user = SecurityUtils.getCurrentUser();
  23 + t.setUpdatetime(new Date());
  24 + /*SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
  25 + try {
  26 + t.setUpdatetime(sdf.parse("2016-10-13"));
  27 + } catch (ParseException e) {
  28 + // TODO Auto-generated catch block
  29 + e.printStackTrace();
  30 + }*/
  31 + return service.save(t);
  32 + }
  33 +}
... ...
src/main/java/com/bsth/controller/oil/DlbController.java 0 → 100644
  1 +package com.bsth.controller.oil;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.data.domain.Page;
  8 +import org.springframework.data.domain.PageRequest;
  9 +import org.springframework.data.domain.Sort;
  10 +import org.springframework.data.domain.Sort.Direction;
  11 +import org.springframework.web.bind.annotation.RequestMapping;
  12 +import org.springframework.web.bind.annotation.RequestMethod;
  13 +import org.springframework.web.bind.annotation.RequestParam;
  14 +import org.springframework.web.bind.annotation.RestController;
  15 +import com.bsth.controller.BaseController;
  16 +import com.bsth.entity.oil.Dlb;
  17 +import com.bsth.entity.oil.Ylb;
  18 +import com.bsth.service.oil.DlbService;
  19 +import com.google.common.base.Splitter;
  20 +
  21 +@RestController
  22 +@RequestMapping("dlb")
  23 +public class DlbController extends BaseController<Dlb, Integer>{
  24 + @Autowired
  25 + DlbService service;
  26 + /**
  27 + *
  28 + * @Title: list
  29 + * @Description: TODO(多条件分页查询)
  30 + * @param @param map 查询条件
  31 + * @param @param page 页码
  32 + * @param @param size 每页显示数量
  33 + * @throws
  34 + */
  35 + @RequestMapping(method = RequestMethod.GET)
  36 + public Page<Dlb> list(@RequestParam Map<String, Object> map,
  37 + @RequestParam(defaultValue = "0") int page,
  38 + @RequestParam(defaultValue = "10") int size,
  39 + @RequestParam(defaultValue = "id") String order,
  40 + @RequestParam(defaultValue = "DESC") String direction){
  41 +
  42 + Direction d;
  43 +// map.put("xlbm_like", map.get("xlbm_like").toString().trim());
  44 +// try {
  45 + String rq=map.get("rq").toString();
  46 + if(!(rq=="")){
  47 +//
  48 +// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
  49 +// Calendar calendar = new GregorianCalendar();
  50 +// calendar.setTime(sdf.parse(rq));
  51 +// calendar.add(calendar.DATE,1);
  52 +// Date date=calendar.getTime();
  53 + map.put("rq_eq", rq);
  54 +// map.put("rq_lt", sdf.format(date));
  55 +// System.out.println(rq);
  56 +// System.out.println(sdf.format(date));
  57 + }
  58 +// } catch (ParseException e) {
  59 +// // TODO Auto-generated catch block
  60 +// e.printStackTrace();
  61 +// }
  62 + if(null != direction && direction.equals("ASC"))
  63 + d = Direction.ASC;
  64 + else
  65 + d = Direction.DESC;
  66 +
  67 + // 允许多个字段排序,order可以写单个字段,也可以写多个字段
  68 + // 多个字段格式:{col1},{col2},{col3},....,{coln}
  69 + // 每个字段的排序方向都是一致,这个以后再看要不要改
  70 + List<String> list = Splitter.on(",").trimResults().splitToList(order);
  71 + return baseService.list(map, new PageRequest(page, size, new Sort(d, list)));
  72 + }
  73 +
  74 + @RequestMapping(value = "/obtain",method = RequestMethod.GET)
  75 + public Map<String, Object> obtain(@RequestParam Map<String, Object> map){
  76 + Map<String, Object> list=service.obtain(map);
  77 + System.out.println();
  78 + return list;
  79 + }
  80 +
  81 + /**
  82 + * 保存电量
  83 + * @param map
  84 + * @return
  85 + */
  86 + @RequestMapping(value = "/sort",method = RequestMethod.GET)
  87 + public Map<String, Object> sort(@RequestParam Map<String, Object> map){
  88 + Map<String, Object> list=service.sort(map);
  89 + return list;
  90 + }
  91 +
  92 + /**
  93 + * 核对电量(有加电没里程)
  94 + * @param map
  95 + * @return
  96 + */
  97 + @RequestMapping(value = "/checkDl",method = RequestMethod.GET)
  98 + public Map<String, Object> checkDl(@RequestParam Map<String, Object> map){
  99 + Map<String, Object> list=service.checkDl(map);
  100 + return list;
  101 + }
  102 +}
... ...
src/main/java/com/bsth/controller/oil/JdlController.java 0 → 100644
  1 +package com.bsth.controller.oil;
  2 +
  3 +import java.io.File;
  4 +import java.util.HashMap;
  5 +import java.util.Map;
  6 +
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestMethod;
  10 +import org.springframework.web.bind.annotation.RequestParam;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +import org.springframework.web.multipart.MultipartFile;
  13 +import org.springframework.web.servlet.ModelAndView;
  14 +
  15 +import com.alibaba.fastjson.JSON;
  16 +import com.alibaba.fastjson.JSONArray;
  17 +import com.alibaba.fastjson.JSONObject;
  18 +import com.bsth.controller.BaseController;
  19 +import com.bsth.entity.oil.Jdl;
  20 +import com.bsth.service.oil.JdlService;
  21 +import com.google.common.io.Files;
  22 +
  23 +@RestController
  24 +@RequestMapping("jdl")
  25 +public class JdlController extends BaseController<Jdl, Integer> {
  26 +
  27 + @Autowired
  28 + JdlService jdlService;
  29 +
  30 + public String getDataImportClasspath(){
  31 + return this.getClass().getResource("/").getPath() + "/static/pages/electricity/jdl";
  32 + }
  33 +
  34 + @RequestMapping(value = "/uploadFile",method = RequestMethod.POST)
  35 + public String uploadFile(MultipartFile file, String gsbm_, String gsName,
  36 + String fgsbm_, String fgsName) throws Exception{
  37 + Map<String, Object> map = new HashMap<String, Object>();
  38 +// File ktrfile = new File(this.getClass().getResource(getDataImportKtrClasspath()).toURI());
  39 +// System.out.println(ktrfile.getAbsolutePath());
  40 + System.out.println(file.getSize());
  41 + File newFile = new File(
  42 + getDataImportClasspath() + File.separator +
  43 + file.getOriginalFilename());
  44 + Files.write(file.getBytes(), newFile);
  45 + String result = jdlService.importExcel(newFile, gsbm_, gsName, fgsbm_, fgsName);
  46 + return "{\"result\":" + "\""+result+"\"}";
  47 + }
  48 +
  49 + @RequestMapping(value = "/query",method = RequestMethod.GET)
  50 + public Map<String, Object> query(@RequestParam Map<String, Object> map) throws Exception{
  51 + return jdlService.query(map);
  52 + }
  53 +
  54 +}
... ...
src/main/java/com/bsth/controller/oil/YlbController.java
... ... @@ -50,8 +50,14 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
50 50 * @return
51 51 */
52 52 @RequestMapping(value = "/obtain",method = RequestMethod.GET)
53   - public Map<String, Object> obtain(@RequestParam Map<String, Object> map){
54   - Map<String, Object> list=yblService.obtain(map);
  53 + public Map<String, Object> obtain(@RequestParam Map<String, Object> map) throws Exception{
  54 + Map<String, Object> list =new HashMap<String, Object>();
  55 + try {
  56 + list = yblService.obtain(map);
  57 + } catch (Exception e) {
  58 + // TODO Auto-generated catch block
  59 + throw e;
  60 + }
55 61 System.out.println();
56 62 return list;
57 63 }
... ... @@ -73,8 +79,14 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
73 79 * @return
74 80 */
75 81 @RequestMapping(value = "/outAndIn",method = RequestMethod.GET)
76   - public Map<String, Object> outAndIn(@RequestParam Map<String, Object> map){
77   - Map<String, Object> list=yblService.outAndIn(map);
  82 + public Map<String, Object> outAndIn(@RequestParam Map<String, Object> map) throws Exception{
  83 + Map<String, Object> list=new HashMap<String, Object>();
  84 + try {
  85 + list=yblService.outAndIn(map);
  86 + } catch (Exception e) {
  87 + // TODO: handle exception
  88 + }
  89 +
78 90 return list;
79 91 }
80 92  
... ... @@ -106,6 +118,7 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
106 118 @RequestParam(defaultValue = "DESC") String direction){
107 119  
108 120 Direction d;
  121 + map.put("xlbm_like", map.get("xlbm_like").toString().trim());
109 122 // try {
110 123 String rq=map.get("rq").toString();
111 124 if(!(rq=="")){
... ...
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
... ... @@ -2,8 +2,13 @@ package com.bsth.controller.realcontrol;
2 2  
3 3 import com.alibaba.fastjson.JSON;
4 4 import com.alibaba.fastjson.serializer.PropertyFilter;
  5 +import com.bsth.common.ResponseCode;
5 6 import com.bsth.data.BasicData;
  7 +import org.slf4j.Logger;
  8 +import org.slf4j.LoggerFactory;
  9 +import org.springframework.beans.factory.annotation.Autowired;
6 10 import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestMethod;
7 12 import org.springframework.web.bind.annotation.RestController;
8 13  
9 14 import java.util.HashMap;
... ... @@ -14,6 +19,13 @@ import java.util.Map;
14 19 @RequestMapping("/basic")
15 20 public class BasicDataController {
16 21  
  22 + @Autowired
  23 + BasicData.BasicDataLoader dataLoader;
  24 +
  25 + @Autowired
  26 + BasicData basicData;
  27 +
  28 + Logger logger = LoggerFactory.getLogger(this.getClass());
17 29  
18 30 @RequestMapping("/cars")
19 31 public Iterable<String> findAllNbbm(Map<String, Object> map){
... ... @@ -53,10 +65,6 @@ public class BasicDataController {
53 65  
54 66 @RequestMapping("/all_personnel")
55 67 public Map<String, String> all_personnel(){
56   - //Map<String, Object> rs = new HashMap<>();
57   - //PersonnelFieldFilter filter=new PersonnelFieldFilter();
58   -
59   - //rs.put("list", JSON.parse(JSON.toJSONString(BasicData.jsyMap.values(), filter)));
60 68 return BasicData.allPerson;
61 69 }
62 70  
... ... @@ -72,6 +80,50 @@ public class BasicDataController {
72 80 }
73 81 return false;
74 82 }
75   -
  83 + }
  84 +
  85 + /**
  86 + * 刷新车辆和设备号对照数据
  87 + * @return
  88 + */
  89 + @RequestMapping(value = "/refresh_nbbm2Device", method = RequestMethod.POST)
  90 + public Map<String, Object> refreshNbbm2DeviceId(){
  91 + Map<String, Object> rs = new HashMap<>();
  92 + try {
  93 + dataLoader.loadDeviceInfo();
  94 + rs.put("status", ResponseCode.SUCCESS);
  95 + }catch (Exception e){
  96 + rs.put("status", ResponseCode.ERROR);
  97 + rs.put("msg", e.getMessage());
  98 + logger.error("", e);
  99 + }
  100 + return rs;
  101 + }
  102 +
  103 + /**
  104 + * 刷新员工对照数据
  105 + * @return
  106 + */
  107 + @RequestMapping(value = "/refresh_person_data", method = RequestMethod.POST)
  108 + public Map<String, Object> refreshPersonData(){
  109 + Map<String, Object> rs = new HashMap<>();
  110 + try {
  111 + dataLoader.loadPersonnelInfo();
  112 + rs.put("status", ResponseCode.SUCCESS);
  113 + }catch (Exception e){
  114 + rs.put("status", ResponseCode.ERROR);
  115 + rs.put("msg", e.getMessage());
  116 + logger.error("", e);
  117 + }
  118 + return rs;
  119 + }
  120 +
  121 + /**
  122 + * 车辆自编号和车牌号对照
  123 + * @return
  124 + */
  125 + @RequestMapping("/nbbm2PlateNo")
  126 + public Map<String, String> nbbm2PlateNo(){
  127 + return basicData.getNbbm2PlateNo();
76 128 }
77 129 }
... ...
src/main/java/com/bsth/controller/realcontrol/LineConfigController.java
... ... @@ -35,8 +35,18 @@ public class LineConfigController extends BaseController&lt;LineConfig, Integer&gt;{
35 35 return lineConfigService.editOutTimeType(lineCode, type);
36 36 }
37 37  
  38 + @RequestMapping(value = "/enableInParkForSource", method = RequestMethod.POST)
  39 + public Map<String, Object> enableInParkForSource(@RequestParam String lineCode, @RequestParam int enable){
  40 + return lineConfigService.enableInParkForSource(lineCode, enable);
  41 + }
  42 +
38 43 @RequestMapping(value = "/getByLineCode")
39 44 public LineConfig getByLineCode(@RequestParam String lineCode){
40 45 return lineConfigService.getByLineCode(lineCode);
41 46 }
  47 +
  48 + @RequestMapping(value = "/bufferTimeDiff", method = RequestMethod.POST)
  49 + public Map<String, Object> bufferTimeDiff(@RequestParam String lineCode, @RequestParam String field,@RequestParam String value){
  50 + return lineConfigService.bufferTimeDiff(lineCode, field, value);
  51 + }
42 52 }
... ...
src/main/java/com/bsth/controller/realcontrol/OilStationSocietyController.java 0 → 100644
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.bsth.controller.BaseController;
  4 +import com.bsth.entity.realcontrol.OilStationSociety;
  5 +import org.springframework.web.bind.annotation.RequestMapping;
  6 +import org.springframework.web.bind.annotation.RestController;
  7 +
  8 +/**
  9 + * Created by panzhao on 2017/3/16.
  10 + */
  11 +@RestController
  12 +@RequestMapping("/oilStation")
  13 +public class OilStationSocietyController extends BaseController<OilStationSociety, String>{
  14 +}
... ...
src/main/java/com/bsth/controller/realcontrol/PageForwardingController.java
1   -package com.bsth.controller.realcontrol;
2   -
3   -import com.bsth.entity.sys.SysUser;
4   -import com.bsth.security.util.SecurityUtils;
5   -import org.springframework.stereotype.Controller;
6   -import org.springframework.web.bind.annotation.RequestMapping;
7   -import org.springframework.web.servlet.ModelAndView;
8   -
9   -/**
10   - * 线调登入页面转发
11   - * Created by panzhao on 2017/1/21.
12   - */
13   -@Controller
14   -@RequestMapping("real_control")
15   -public class PageForwardingController {
16   -
17   - @RequestMapping("/v2")
18   - public ModelAndView v2(){
19   - ModelAndView mv = new ModelAndView();
20   - SysUser user = SecurityUtils.getCurrentUser();
21   -
22   - //班次管理员
23   - if(user.getUserName().equals("bcgly")){
24   - mv.setViewName("/real_control_v2/sch_manage/sch_imitate.html");
25   - }
26   - //正常线调主页
27   - else
28   - mv.setViewName("/real_control_v2/main.html");
29   - return mv;
30   - }
31   -}
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.bsth.entity.sys.Role;
  4 +import com.bsth.entity.sys.SysUser;
  5 +import com.bsth.security.util.SecurityUtils;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.stereotype.Controller;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.servlet.ModelAndView;
  11 +
  12 +import javax.servlet.http.HttpServletResponse;
  13 +
  14 +/**
  15 + * 线调登入页面转发
  16 + * Created by panzhao on 2017/1/21.
  17 + */
  18 +@Controller
  19 +@RequestMapping("real_control")
  20 +public class PageForwardingController {
  21 +
  22 + Logger logger = LoggerFactory.getLogger(this.getClass());
  23 +
  24 + @RequestMapping("/v2")
  25 + public ModelAndView v2(HttpServletResponse response){
  26 + ModelAndView mv = new ModelAndView();
  27 + SysUser user = SecurityUtils.getCurrentUser();
  28 +
  29 + //班次管理员
  30 + if(user.getUserName().equals("bcgly")){
  31 + mv.setViewName("/real_control_v2/sch_manage/sch_imitate.html");
  32 + return mv;
  33 + }
  34 +
  35 + try{
  36 + //闵行运管所,直接打开地图页面
  37 + if(user.getRoles().size() == 1){
  38 + for(Role role : user.getRoles()){
  39 + if(role.getCodeName().equals("MH_YGS")){
  40 + // 直接重定向
  41 + response.sendRedirect("/pages/mapmonitor/alone/wrap.html");
  42 + return null;
  43 + }
  44 + }
  45 + }
  46 + }catch (Exception e){
  47 + logger.error("", e);
  48 + }
  49 +
  50 + //正常线调主页
  51 + mv.setViewName("/real_control_v2/main.html");
  52 + return mv;
  53 + }
  54 +}
... ...
src/main/java/com/bsth/controller/realcontrol/RealMapController.java
... ... @@ -49,6 +49,11 @@ public class RealMapController {
49 49 return realMapService.findRouteByLine(lineCode);
50 50 }
51 51  
  52 + @RequestMapping(value = "/multiRouteByLine")
  53 + public Map<String, Object> multiRouteByLine(@RequestParam String codeStr) {
  54 + return realMapService.multiRouteByLine(codeStr);
  55 + }
  56 +
52 57  
53 58 /**
54 59 * 获取线路的路段路由 和 站点路由信息 (为前端站间距计算提供数据源)
... ...
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -7,6 +7,7 @@ import com.bsth.controller.realcontrol.dto.DfsjChange;
7 7 import com.bsth.data.BasicData;
8 8 import com.bsth.data.schedule.DayOfSchedule;
9 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  10 +import com.bsth.entity.schedule.SchedulePlanInfo;
10 11 import com.bsth.service.realcontrol.ScheduleRealInfoService;
11 12 import org.apache.commons.lang3.StringEscapeUtils;
12 13 import org.joda.time.format.DateTimeFormat;
... ... @@ -143,6 +144,16 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
143 144 }
144 145  
145 146 /**
  147 + * 撤销执行
  148 + * @param id
  149 + * @return
  150 + */
  151 + @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST)
  152 + public Map<String, Object> revokeRealArrive(@RequestParam Long id){
  153 + return scheduleRealInfoService.revokeRealArrive(id);
  154 + }
  155 +
  156 + /**
146 157 *
147 158 * @Title: spaceAdjust
148 159 * @Description: TODO(间隔调整)
... ... @@ -261,14 +272,20 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
261 272 @RequestParam String date,@RequestParam String state) {
262 273 return scheduleRealInfoService.queryUserInfo(line, date,state);
263 274 }
  275 +
  276 + @RequestMapping(value = "/queryUserInfoPx")
  277 + public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line,
  278 + @RequestParam String date,@RequestParam String state,@RequestParam String type) {
  279 + return scheduleRealInfoService.queryUserInfoPx(line, date,state,type);
  280 + }
264 281  
265   - @RequestMapping(value = "/exportWaybill")
  282 + @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET)
266 283 public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh,
267 284 @RequestParam String lpName,@RequestParam String date,@RequestParam String line) {
268 285 return scheduleRealInfoService.exportWaybill(jName, clZbh, lpName,date,line);
269 286 }
270 287  
271   - @RequestMapping(value = "/exportWaybillQp")
  288 + @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET)
272 289 public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh
273 290 ,@RequestParam String date,@RequestParam String line) {
274 291 return scheduleRealInfoService.exportWaybillQp( clZbh, date,line);
... ... @@ -291,13 +308,13 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
291 308 return scheduleRealInfoService.findLine(line);
292 309 }
293 310  
294   - @RequestMapping(value="/findKMBC")
  311 + @RequestMapping(value="/findKMBC",method = RequestMethod.GET)
295 312 public Map<String,Object> findKMBC(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName
296 313 ,@RequestParam String date,@RequestParam String line){
297 314 return scheduleRealInfoService.findKMBC(jName, clZbh,lpName,date,line);
298 315 }
299 316  
300   - @RequestMapping(value="/findKMBCQp")
  317 + @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET)
301 318 public Map<String,Object> findKMBCQp(@RequestParam String clZbh
302 319 ,@RequestParam String date,@RequestParam String line){
303 320 return scheduleRealInfoService.findKMBCQp(clZbh,date,line);
... ... @@ -327,13 +344,13 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
327 344 * @param lpName 路牌
328 345 * @return
329 346 */
330   - @RequestMapping(value="/queryListWaybill")
  347 + @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET)
331 348 public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName
332 349 ,@RequestParam String date,@RequestParam String line){
333 350 return scheduleRealInfoService.queryListWaybill(jName, clZbh,lpName,date,line);
334 351 }
335 352  
336   - @RequestMapping(value="/queryListWaybillQp")
  353 + @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET)
337 354 public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh,
338 355 @RequestParam String date,@RequestParam String line){
339 356 return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line);
... ... @@ -345,6 +362,12 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
345 362 return scheduleRealInfoService.statisticsDaily(line, date, xlName, type);
346 363 }
347 364  
  365 + @RequestMapping(value="/statisticsDailyTj")
  366 + public List<Map<String,Object>> statisticsDailyTj(@RequestParam String line, @RequestParam String date,
  367 + @RequestParam String date2,@RequestParam String xlName, @RequestParam String type){
  368 + return scheduleRealInfoService.statisticsDailyTj(line, date,date2, xlName, type);
  369 + }
  370 +
348 371 @RequestMapping(value="/MapById",method = RequestMethod.GET)
349 372 public Map<String, Object> MapById(@RequestParam("id") Long id){
350 373 return scheduleRealInfoService.MapById(id);
... ... @@ -367,6 +390,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
367 390 return scheduleRealInfoService.realScheduleList(line,date);
368 391 }
369 392  
  393 + @RequestMapping(value="/realScheduleListQp")
  394 + public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){
  395 + return scheduleRealInfoService.realScheduleListQp(line,date);
  396 + }
  397 +
370 398 @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST)
371 399 public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){
372 400 cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson);
... ... @@ -429,4 +457,28 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
429 457 public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){
430 458 return scheduleRealInfoService.scheduleDailyQp(line,date);
431 459 }
  460 +
  461 + @RequestMapping(value = "scheduleDailyExport", method = RequestMethod.GET)
  462 + public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){
  463 + return scheduleRealInfoService.scheduleDailyExport(map);
  464 + }
  465 +
  466 + @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET)
  467 + public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){
  468 + return scheduleRealInfoService.exportWaybillMore(map);
  469 + }
  470 +
  471 + /**
  472 + * 获取当日计划排班 , 从计划表抓取数据
  473 + * @return
  474 + */
  475 + @RequestMapping(value = "currSchedulePlanByLineCode", method = RequestMethod.GET)
  476 + public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){
  477 + return scheduleRealInfoService.currentSchedulePlan(lineCode);
  478 + }
  479 +
  480 + @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST)
  481 + public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){
  482 + return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type);
  483 + }
432 484 }
... ...
src/main/java/com/bsth/controller/realcontrol/ServiceDataInterface.java 0 → 100644
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.bsth.data.schedule.DayOfSchedule;
  4 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  5 +import org.apache.commons.lang3.StringUtils;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RequestParam;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import java.util.ArrayList;
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * 对外的营运数据接口,主要输出当日的数据
  16 + * Created by panzhao on 2017/3/15.
  17 + */
  18 +@RestController
  19 +@RequestMapping("/companyService")
  20 +public class ServiceDataInterface {
  21 +
  22 + private final static String SECRE_KEY = "dVPHJkWUt5FhMT7jrM2dLV7QvlHAmZFd42rs1P0usBx8A7HZki";
  23 +
  24 + @Autowired
  25 + DayOfSchedule dayOfSchedule;
  26 +
  27 + @RequestMapping("/getCurrentDayPlan")
  28 + public List<ScheduleRealInfo> getCurrentDayPlan(
  29 + @RequestParam String companyId,
  30 + @RequestParam String workId,
  31 + @RequestParam String secretKey) {
  32 +
  33 + if (StringUtils.isEmpty(secretKey) || !secretKey.equals(SECRE_KEY))
  34 + return null;
  35 +
  36 + List<ScheduleRealInfo> all = new ArrayList<>(dayOfSchedule.findAll()), rs = new ArrayList<>();
  37 + for (ScheduleRealInfo sch : all) {
  38 + if (sch.getGsBm() != null
  39 + && sch.getGsBm().equals(companyId)
  40 + && sch.getjGh().equals(workId)) {
  41 + rs.add(sch);
  42 + }
  43 + }
  44 + return rs;
  45 + }
  46 +
  47 + @RequestMapping("/returnCCInfo")
  48 + public List<ScheduleRealInfo> returnCCInfo(@RequestParam String companyId, @RequestParam String secretKey){
  49 + if (StringUtils.isEmpty(secretKey) || !secretKey.equals(SECRE_KEY))
  50 + return null;
  51 +
  52 +
  53 + List<ScheduleRealInfo> all = new ArrayList<>(dayOfSchedule.findAll()), rs = new ArrayList<>();
  54 + for (ScheduleRealInfo sch : all) {
  55 +
  56 + if (sch.getBcType().equals("out")
  57 + && sch.getGsBm() != null
  58 + && sch.getGsBm().equals(companyId)) {
  59 + rs.add(sch);
  60 + }
  61 + }
  62 + return rs;
  63 + }
  64 +
  65 + @RequestMapping("/returnJCInfo")
  66 + public List<ScheduleRealInfo> returnJCInfo(@RequestParam String companyId, @RequestParam String secretKey){
  67 + if (StringUtils.isEmpty(secretKey) || !secretKey.equals(SECRE_KEY))
  68 + return null;
  69 +
  70 +
  71 + List<ScheduleRealInfo> all = new ArrayList<>(dayOfSchedule.findAll()), rs = new ArrayList<>();
  72 + for (ScheduleRealInfo sch : all) {
  73 + if (sch.getBcType().equals("in")
  74 + && sch.getGsBm() != null
  75 + && sch.getGsBm().equals(companyId)) {
  76 + rs.add(sch);
  77 + }
  78 + }
  79 + return rs;
  80 + }
  81 +}
... ...
src/main/java/com/bsth/controller/realcontrol/dto/LpData.java 0 → 100644
  1 +package com.bsth.controller.realcontrol.dto;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +
  5 +/**
  6 + * 路牌相关的数据(换路牌时要换的字段)
  7 + * Created by panzhao on 2017/3/2.
  8 + */
  9 +public class LpData {
  10 +
  11 + public LpData(ScheduleRealInfo sch) {
  12 + this.jGh = sch.getjGh();
  13 + this.jName = sch.getjName();
  14 + this.sGh = sch.getsGh();
  15 + this.sName = sch.getsName();
  16 + this.nbbm = sch.getClZbh();
  17 +
  18 + this.fcsj = sch.getFcsjActualTime();
  19 + this.zdsj = sch.getZdsjActualTime();
  20 +
  21 + this.qdName = sch.getQdzName();
  22 + this.zdzName = sch.getZdzName();
  23 + }
  24 +
  25 + public void appendTo(ScheduleRealInfo sch, int type) {
  26 +
  27 + if (type == 0) {
  28 + //只换人
  29 + sch.setjGh(this.jGh);
  30 + sch.setjName(this.jName);
  31 + sch.setsGh(this.sGh);
  32 + sch.setsName(this.sName);
  33 + } else if (type == 1) {
  34 + //只换车
  35 + sch.setClZbh(this.nbbm);
  36 + changeRealTime(sch);
  37 + /*//换实际时间
  38 + if(changeRealTime){
  39 + changeRealTime(sch);
  40 + }*/
  41 +
  42 + } else if (type == 2) {
  43 + //换人并换车
  44 + sch.setjGh(this.jGh);
  45 + sch.setjName(this.jName);
  46 + sch.setsGh(this.sGh);
  47 + sch.setsName(this.sName);
  48 + sch.setClZbh(this.nbbm);
  49 +
  50 + //换实际时间
  51 + //if(changeRealTime){
  52 + changeRealTime(sch);
  53 + //}
  54 + }
  55 + }
  56 +
  57 + public void changeRealTime(ScheduleRealInfo sch){
  58 + if (this.fcsj != null && this.qdName.equals(sch.getQdzName()))
  59 + sch.setFcsjActualAll(this.fcsj);
  60 + if (this.zdsj != null && this.zdzName.equals(sch.getZdzName()))
  61 + sch.setZdsjActualAll(this.zdsj);
  62 + }
  63 +
  64 + /**
  65 + * 起点站名称
  66 + */
  67 + private String qdName;
  68 +
  69 + /**
  70 + * 终点站名称
  71 + */
  72 + private String zdzName;
  73 +
  74 + /**
  75 + * 驾驶员
  76 + */
  77 + private String jGh;
  78 + private String jName;
  79 +
  80 + /**
  81 + * 售票员
  82 + */
  83 + private String sGh;
  84 + private String sName;
  85 +
  86 + /**
  87 + * 车辆自编号
  88 + */
  89 + private String nbbm;
  90 +
  91 + /**
  92 + * 实际发车时间
  93 + */
  94 + private Long fcsj;
  95 +
  96 + /**
  97 + * 实际终点时间
  98 + */
  99 + private Long zdsj;
  100 +
  101 + public String getjGh() {
  102 + return jGh;
  103 + }
  104 +
  105 + public void setjGh(String jGh) {
  106 + this.jGh = jGh;
  107 + }
  108 +
  109 + public String getjName() {
  110 + return jName;
  111 + }
  112 +
  113 + public void setjName(String jName) {
  114 + this.jName = jName;
  115 + }
  116 +
  117 + public String getsGh() {
  118 + return sGh;
  119 + }
  120 +
  121 + public void setsGh(String sGh) {
  122 + this.sGh = sGh;
  123 + }
  124 +
  125 + public String getsName() {
  126 + return sName;
  127 + }
  128 +
  129 + public void setsName(String sName) {
  130 + this.sName = sName;
  131 + }
  132 +
  133 + public String getNbbm() {
  134 + return nbbm;
  135 + }
  136 +
  137 + public void setNbbm(String nbbm) {
  138 + this.nbbm = nbbm;
  139 + }
  140 +
  141 + public Long getFcsj() {
  142 + return fcsj;
  143 + }
  144 +
  145 + public void setFcsj(Long fcsj) {
  146 + this.fcsj = fcsj;
  147 + }
  148 +
  149 + public Long getZdsj() {
  150 + return zdsj;
  151 + }
  152 +
  153 + public void setZdsj(Long zdsj) {
  154 + this.zdsj = zdsj;
  155 + }
  156 +}
... ...
src/main/java/com/bsth/controller/schedule/BController.java
... ... @@ -40,9 +40,12 @@ public class BController&lt;T, ID extends Serializable&gt; {
40 40 SysUser sysUser = sysUserService.findByUserName(userName);
41 41 BEntity t_b = null;
42 42 if (t instanceof BEntity) {
  43 + Date cdate = new Date();
43 44 t_b = (BEntity) t;
44 45 t_b.setCreateBy(sysUser);
45   - t_b.setCreateDate(new Date());
  46 + t_b.setCreateDate(cdate);
  47 + t_b.setUpdateBy(sysUser);
  48 + t_b.setUpdateDate(cdate);
46 49 }
47 50  
48 51 T t_saved = bService.save(t_b == null ? t : (T) t_b);
... ...
src/main/java/com/bsth/controller/schedule/core/GuideboardInfoController.java
... ... @@ -27,22 +27,10 @@ import java.util.Map;
27 27 public class GuideboardInfoController extends BController<GuideboardInfo, Long> {
28 28 @Autowired
29 29 private GuideboardInfoService guideboardInfoService;
30   -// @Autowired
31   -// private DataToolsProperties dataToolsProperties;
  30 +
32 31 @Autowired
33 32 private GuideboardInfoRepository guideboardInfoRepository;
34   -//
35   -// @Override
36   -// protected String getDataImportKtrClasspath() {
37   -// return dataToolsProperties.getGuideboardsDatainputktr();
38   -// }
39   -//
40   -// @Override
41   -// public GuideboardInfo findById(@PathVariable("id") Long aLong) {
42   -// return guideboardInfoRepository.findOneExtend(aLong);
43   -// }
44   -//
45   -//
  33 +
46 34 @RequestMapping(value = "/ttlpnames", method = RequestMethod.GET)
47 35 public List<Map<String, Object>> findLpName(Long ttid) {
48 36 return guideboardInfoRepository.findLpName(ttid);
... ...
src/main/java/com/bsth/controller/schedule/SchedulePlanController.java renamed to src/main/java/com/bsth/controller/schedule/core/SchedulePlanController.java
1   -package com.bsth.controller.schedule;
  1 +package com.bsth.controller.schedule.core;
2 2  
3   -import com.bsth.controller.BaseController;
  3 +import com.bsth.common.ResponseCode;
  4 +import com.bsth.controller.schedule.BController;
4 5 import com.bsth.entity.schedule.SchedulePlan;
5 6 import com.bsth.service.schedule.SchedulePlanService;
6 7 import org.springframework.beans.factory.annotation.Autowired;
7   -import org.springframework.web.bind.annotation.RequestBody;
  8 +import org.springframework.web.bind.annotation.PathVariable;
8 9 import org.springframework.web.bind.annotation.RequestMapping;
9 10 import org.springframework.web.bind.annotation.RequestMethod;
10 11 import org.springframework.web.bind.annotation.RestController;
11 12  
  13 +import java.util.Date;
  14 +import java.util.HashMap;
12 15 import java.util.Map;
13 16  
14 17 /**
... ... @@ -16,26 +19,11 @@ import java.util.Map;
16 19 */
17 20 @RestController
18 21 @RequestMapping("spc")
19   -public class SchedulePlanController extends BaseController<SchedulePlan, Long> {
  22 +public class SchedulePlanController extends BController<SchedulePlan, Long> {
20 23 @Autowired
21 24 private SchedulePlanService schedulePlanService;
22 25  
23 26 /**
24   - * 覆写方法,因为form提交的方式参数不全,改用 json形式提交 @RequestBody
25   - * @Title: save
26   - * @Description: TODO(持久化对象)
27   - * @param @param t
28   - * @param @return 设定文件
29   - * @return Map<String,Object> {status: 1(成功),-1(失败)}
30   - * @throws
31   - */
32   - @RequestMapping(method = RequestMethod.POST)
33   - public Map<String, Object> save(@RequestBody SchedulePlan t){
34   -
35   - return baseService.save(t);
36   - }
37   -
38   - /**
39 27 * 获取明天的一歌排班计划。
40 28 * @return
41 29 * @throws Exception
... ... @@ -49,4 +37,24 @@ public class SchedulePlanController extends BaseController&lt;SchedulePlan, Long&gt; {
49 37 }
50 38 }
51 39  
  40 + /**
  41 + * 创建指定线路,指定时间范围内的排班计划,使用的时刻表情况
  42 + * @param xlid 线路id
  43 + * @param from 开始时间
  44 + * @param to 结束时间
  45 + * @return
  46 + * @throws Exception
  47 + */
  48 + @RequestMapping(value = "/valttinfo/{xlid}/{from}/{to}", method = RequestMethod.GET)
  49 + public Map<String, Object> validateTTInfo(
  50 + @PathVariable(value = "xlid") Integer xlid,
  51 + @PathVariable(value = "from") Date from,
  52 + @PathVariable(value = "to") Date to
  53 + ) throws Exception {
  54 + Map<String, Object> rtn = new HashMap<>();
  55 + rtn.put("status", ResponseCode.SUCCESS);
  56 + rtn.put("data", schedulePlanService.validateTTInfo(xlid, from, to));
  57 + return rtn;
  58 + }
  59 +
52 60 }
... ...
src/main/java/com/bsth/controller/schedule/core/TTInfoDetailController.java
... ... @@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
8 8 import org.springframework.web.bind.annotation.PathVariable;
9 9 import org.springframework.web.bind.annotation.RequestMapping;
10 10 import org.springframework.web.bind.annotation.RequestMethod;
  11 +import org.springframework.web.bind.annotation.RequestParam;
11 12 import org.springframework.web.bind.annotation.RestController;
12 13  
13 14 import java.util.HashMap;
... ... @@ -87,5 +88,16 @@ public class TTInfoDetailController extends BController&lt;TTInfoDetail, Long&gt; {
87 88 }
88 89 return rtn;
89 90 }
90   -
  91 +
  92 + /**
  93 + * 时刻表明细批量插入
  94 + *
  95 + * @param entities
  96 + *
  97 + * @return
  98 + */
  99 + @RequestMapping(value = "/skbDetailMxSave" ,method = RequestMethod.POST)
  100 + public Map<String, Object> skbDetailMxSave(@RequestParam Map<String, Object> entities){
  101 + return ttInfoDetailService.skbDetailMxSave(entities);
  102 + }
91 103 }
... ...
src/main/java/com/bsth/controller/sys/RealControAuthorityController.java 0 → 100644
  1 +package com.bsth.controller.sys;
  2 +
  3 +import com.bsth.controller.BaseController;
  4 +import com.bsth.entity.sys.RealControAuthority;
  5 +import com.bsth.security.util.SecurityUtils;
  6 +import com.bsth.service.sys.RealControAuthorityService;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.web.bind.annotation.RequestMapping;
  9 +import org.springframework.web.bind.annotation.RequestParam;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import javax.servlet.http.HttpServletRequest;
  13 +
  14 +/**
  15 + * Created by panzhao on 2017/2/14.
  16 + */
  17 +@RestController
  18 +@RequestMapping("realControAuthority")
  19 +public class RealControAuthorityController extends BaseController<RealControAuthority, Integer> {
  20 +
  21 + @Autowired
  22 + RealControAuthorityService realControAuthorityService;
  23 +
  24 + @RequestMapping("findByUserId")
  25 + public RealControAuthority findByUserId(@RequestParam Integer userId){
  26 +
  27 + return realControAuthorityService.findByUserId(userId);
  28 + }
  29 +
  30 + @RequestMapping("findByCurrentUser")
  31 + public RealControAuthority findByUserId(HttpServletRequest request){
  32 + return realControAuthorityService.findByUserId(SecurityUtils.getCurrentUser().getId());
  33 + }
  34 +}
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -13,6 +13,7 @@ import org.slf4j.Logger;
13 13 import org.slf4j.LoggerFactory;
14 14 import org.springframework.beans.factory.annotation.Autowired;
15 15 import org.springframework.boot.CommandLineRunner;
  16 +import org.springframework.jdbc.core.JdbcTemplate;
16 17 import org.springframework.stereotype.Component;
17 18  
18 19 import java.util.*;
... ... @@ -89,6 +90,18 @@ public class BasicData implements CommandLineRunner {
89 90 return name != null? name: stationCode2NameMap.get(prefix + code);
90 91 }
91 92  
  93 + @Autowired
  94 + JdbcTemplate jdbcTemplate;
  95 + public Map<String, String> getNbbm2PlateNo(){
  96 + List<Map<String, Object>> list = jdbcTemplate.queryForList("select CAR_CODE,CAR_PLATE from bsth_c_cars where CAR_CODE is not null and CAR_PLATE is not null");
  97 +
  98 + Map<String, String> rs = new HashMap<>();
  99 + for(Map<String, Object> map : list){
  100 + rs.put(map.get("CAR_CODE").toString(), map.get("CAR_PLATE").toString());
  101 + }
  102 + return rs;
  103 + }
  104 +
92 105 @Component
93 106 public static class BasicDataLoader extends Thread {
94 107  
... ... @@ -309,9 +322,6 @@ public class BasicData implements CommandLineRunner {
309 322 if (StringUtils.isEmpty(jobCode))
310 323 continue;
311 324  
312   - /*if (jobCode.indexOf("-") != -1) {
313   - jobCode = jobCode.split("-")[1];
314   - }*/
315 325 if (p.getPosts() != null) {
316 326 if (p.getPosts().equals("1"))
317 327 jsyTempMap.put(jobCode, p);
... ...
src/main/java/com/bsth/data/directive/DayOfDirectives.java
1 1 package com.bsth.data.directive;
2 2  
3   -import java.util.ArrayList;
4   -import java.util.Collection;
5   -import java.util.Comparator;
6   -import java.util.HashMap;
7   -import java.util.List;
8   -import java.util.Map;
9   -
10   -import org.slf4j.Logger;
11   -import org.slf4j.LoggerFactory;
12   -import org.springframework.beans.factory.annotation.Autowired;
13   -import org.springframework.stereotype.Component;
14   -
15 3 import com.alibaba.fastjson.JSONObject;
16 4 import com.bsth.data.LineConfigData;
17 5 import com.bsth.entity.directive.D60;
... ... @@ -21,6 +9,12 @@ import com.bsth.entity.directive.DirectiveReponse;
21 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
22 10 import com.bsth.service.directive.DirectiveService;
23 11 import com.bsth.websocket.handler.SendUtils;
  12 +import org.slf4j.Logger;
  13 +import org.slf4j.LoggerFactory;
  14 +import org.springframework.beans.factory.annotation.Autowired;
  15 +import org.springframework.stereotype.Component;
  16 +
  17 +import java.util.*;
24 18  
25 19 /**
26 20 *
... ... @@ -42,6 +36,9 @@ public class DayOfDirectives {
42 36 //等待C0_A4回复的用户
43 37 //public static Map<K, V>
44 38  
  39 + //等待入库的指令
  40 + public static LinkedList<Directive> pstDirectives;
  41 +
45 42 @Autowired
46 43 DirectiveService directiveService;
47 44  
... ... @@ -57,14 +54,19 @@ public class DayOfDirectives {
57 54 static{
58 55 d60Map = new HashMap<>();
59 56 d64Map = new HashMap<>();
  57 + pstDirectives = new LinkedList<>();
60 58 }
61 59  
62 60 public void put60(D60 d60) {
63 61 d60Map.put(d60.getMsgId(), d60);
  62 + //等待持久化
  63 + pstDirectives.add(d60);
64 64 }
65 65  
66 66 public void put64(D64 d64) {
67 67 d64Map.put(d64.getKey(), d64);
  68 + //等待持久化
  69 + pstDirectives.add(d64);
68 70 }
69 71  
70 72 /**
... ... @@ -98,8 +100,9 @@ public class DayOfDirectives {
98 100 d60.setReply47Time(System.currentTimeMillis());
99 101 break;
100 102 }
101   - // 入库
102   - saveD60(d60);
  103 + // 等待持久化
  104 + if(!pstDirectives.contains(d60))
  105 + pstDirectives.add(d60);
103 106  
104 107 ScheduleRealInfo sch = d60.getSch();
105 108 if (null == sch)
... ... @@ -131,19 +134,20 @@ public class DayOfDirectives {
131 134 logger.warn("64响应 data is null ,json: " + json);
132 135 else {
133 136 d64.setRespAck(data.getShort("requestAck"));
134   - // 响应入库
135   - directiveService.save64(d64);
  137 + // 持久化
  138 + if(!pstDirectives.contains(d64))
  139 + pstDirectives.add(d64);
136 140 }
137 141 }
138 142 }
139 143  
140   - private void saveD60(D60 d60) {
  144 +/* private void saveD60(D60 d60) {
141 145 // 等47再入库
142 146 if (d60.getReply47() == null)
143 147 return;
144 148  
145 149 directiveService.save(d60);
146   - }
  150 + }*/
147 151  
148 152 public void clear(String device){
149 153 int c60 = 0, c64 = 0;
... ...
src/main/java/com/bsth/data/directive/DirectivesPstThread.java 0 → 100644
  1 +package com.bsth.data.directive;
  2 +
  3 +import com.bsth.entity.directive.D60;
  4 +import com.bsth.entity.directive.D64;
  5 +import com.bsth.entity.directive.Directive;
  6 +import com.bsth.repository.directive.D60Repository;
  7 +import com.bsth.repository.directive.D64Repository;
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.stereotype.Component;
  12 +
  13 +import java.util.LinkedList;
  14 +
  15 +/**
  16 + * 指令持久化线程
  17 + * Created by panzhao on 2017/3/6.
  18 + */
  19 +@Component
  20 +public class DirectivesPstThread extends Thread {
  21 +
  22 + Logger logger = LoggerFactory.getLogger(this.getClass());
  23 +
  24 + @Autowired
  25 + D60Repository d60Repository;
  26 +
  27 + @Autowired
  28 + D64Repository d64Repository;
  29 +
  30 + @Override
  31 + public void run() {
  32 + LinkedList<Directive> list = DayOfDirectives.pstDirectives;
  33 +
  34 + Directive directive;
  35 + for (int i = 0; i < 1000; i++) {
  36 + try {
  37 + directive = list.poll();
  38 +
  39 + if (directive instanceof D60) {
  40 + d60Repository.save((D60) directive);
  41 + }
  42 +
  43 + if (directive instanceof D64) {
  44 + d64Repository.save((D64) directive);
  45 + }
  46 + } catch (Exception e) {
  47 + logger.error("", e);
  48 + }
  49 + }
  50 + }
  51 +}
... ...
src/main/java/com/bsth/data/directive/FirstScheduleCheckThread.java
1   -package com.bsth.data.directive;
2   -
3   -import java.util.List;
4   -import java.util.Set;
5   -
6   -import org.slf4j.Logger;
7   -import org.slf4j.LoggerFactory;
8   -import org.springframework.beans.factory.annotation.Autowired;
9   -import org.springframework.stereotype.Component;
10   -
11   -import com.bsth.data.match.Arrival2Schedule;
12   -import com.bsth.data.match.ExpectArrivalEnd;
13   -import com.bsth.data.schedule.DayOfSchedule;
14   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
15   -import com.bsth.service.directive.DirectiveService;
16   -
17   -/**
18   - *
19   - * @ClassName: FirstScheduleCheckThread
20   - * @Description: TODO(首班出场检测)
21   - * @author PanZhao
22   - * @date 2016年8月27日 上午1:25:21
23   - *
24   - */
25   -@Component
26   -public class FirstScheduleCheckThread extends Thread{
27   -
28   - @Autowired
29   - DayOfSchedule dayOfSchedule;
30   -
31   - @Autowired
32   - DirectiveService directiveService;
33   -
34   - Logger logger = LoggerFactory.getLogger(this.getClass());
35   -
36   - //提前半小时下发指令
37   - private final static long THREE_MINUTES = 1000 * 60 * 30L;
38   -
39   - @Override
40   - public void run() {
41   - try{
42   - Set<String> cars = dayOfSchedule.allCar();
43   -
44   - long t = System.currentTimeMillis();
45   - List<ScheduleRealInfo> schList;
46   - ScheduleRealInfo first;
47   - for(String car : cars){
48   -
49   - schList = dayOfSchedule.findByNbbm(car);
50   -
51   - if(null == schList || schList.size() == 0)
52   - continue;
53   -
54   - first = schList.get(0);
55   -
56   - if(null != first.getBcType()
57   - && first.getBcType().equals("out")){
58   -
59   - //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令
60   - if(first.getJhlc() == null && first.getXlDir().equals(schList.get(1).getXlDir()))
61   - first = schList.get(1);
62   -
63   - //为首班补发指令
64   - if(first.getDirectiveState() == -1
65   - && Math.abs(first.getDfsjT() - t) < THREE_MINUTES){
66   -
67   - directiveService.send60Dispatch(first, dayOfSchedule.doneSum(first.getClZbh()), "定补@系统");
68   - //期望完成出场班次时间
69   - long endTime;
70   -
71   - if(first.getZdsj() != null)
72   - endTime=first.getZdsjT() - 60000;
73   - else
74   - endTime=schList.get(1).getDfsjT() - 60000;
75   -
76   - ExpectArrivalEnd ead = new ExpectArrivalEnd()
77   - ,ead2 = new ExpectArrivalEnd();
78   - ead.setNbbm(car);
79   - ead.setEndStation(first.getQdzCode());
80   - ead.setEndTime(endTime);
81   -
82   - ead2.setNbbm(car);
83   - ead2.setEndStation(first.getZdzCode());
84   - ead2.setEndTime(endTime);
85   -
86   - Arrival2Schedule.addExpect(car, ead);
87   - Arrival2Schedule.addExpect(car, ead2);
88   - }
89   - }
90   - }
91   - }catch(Exception e){
92   - logger.error("", e);
93   - }
94   - }
95   -}
  1 +//package com.bsth.data.directive;
  2 +//
  3 +//import java.util.List;
  4 +//import java.util.Set;
  5 +//
  6 +//import org.slf4j.Logger;
  7 +//import org.slf4j.LoggerFactory;
  8 +//import org.springframework.beans.factory.annotation.Autowired;
  9 +//import org.springframework.stereotype.Component;
  10 +//
  11 +//import com.bsth.data.match.Arrival2Schedule;
  12 +//import com.bsth.data.match.ExpectArrivalEnd;
  13 +//import com.bsth.data.schedule.DayOfSchedule;
  14 +//import com.bsth.entity.realcontrol.ScheduleRealInfo;
  15 +//import com.bsth.service.directive.DirectiveService;
  16 +//
  17 +///**
  18 +// *
  19 +// * @ClassName: FirstScheduleCheckThread
  20 +// * @Description: TODO(首班出场检测)
  21 +// * @author PanZhao
  22 +// * @date 2016年8月27日 上午1:25:21
  23 +// *
  24 +// */
  25 +//@Component
  26 +//public class FirstScheduleCheckThread extends Thread{
  27 +//
  28 +// @Autowired
  29 +// DayOfSchedule dayOfSchedule;
  30 +//
  31 +// @Autowired
  32 +// DirectiveService directiveService;
  33 +//
  34 +// Logger logger = LoggerFactory.getLogger(this.getClass());
  35 +//
  36 +// //提前半小时下发指令
  37 +// private final static long THREE_MINUTES = 1000 * 60 * 30L;
  38 +//
  39 +// @Override
  40 +// public void run() {
  41 +// try{
  42 +// Set<String> cars = dayOfSchedule.allCar();
  43 +//
  44 +// long t = System.currentTimeMillis();
  45 +// List<ScheduleRealInfo> schList;
  46 +// ScheduleRealInfo first;
  47 +// for(String car : cars){
  48 +//
  49 +// schList = dayOfSchedule.findByNbbm(car);
  50 +//
  51 +// if(null == schList || schList.size() == 0)
  52 +// continue;
  53 +//
  54 +// first = schList.get(0);
  55 +//
  56 +// if(null != first.getBcType()
  57 +// && first.getBcType().equals("out")){
  58 +//
  59 +// //没有计划里程的出场班次,出场既是首发站,发送下一班次的营运指令
  60 +// if(first.getJhlc() == null && first.getXlDir().equals(schList.get(1).getXlDir()))
  61 +// first = schList.get(1);
  62 +//
  63 +// //为首班补发指令
  64 +// if(first.getDirectiveState() == -1
  65 +// && Math.abs(first.getDfsjT() - t) < THREE_MINUTES){
  66 +//
  67 +// directiveService.send60Dispatch(first, dayOfSchedule.doneSum(first.getClZbh()), "定补@系统");
  68 +// //期望完成出场班次时间
  69 +// long endTime;
  70 +//
  71 +// if(first.getZdsj() != null)
  72 +// endTime=first.getZdsjT() - 60000;
  73 +// else
  74 +// endTime=schList.get(1).getDfsjT() - 60000;
  75 +//
  76 +// ExpectArrivalEnd ead = new ExpectArrivalEnd()
  77 +// ,ead2 = new ExpectArrivalEnd();
  78 +// ead.setNbbm(car);
  79 +// ead.setEndStation(first.getQdzCode());
  80 +// ead.setEndTime(endTime);
  81 +//
  82 +// ead2.setNbbm(car);
  83 +// ead2.setEndStation(first.getZdzCode());
  84 +// ead2.setEndTime(endTime);
  85 +//
  86 +// Arrival2Schedule.addExpect(car, ead);
  87 +// Arrival2Schedule.addExpect(car, ead2);
  88 +// }
  89 +// }
  90 +// }
  91 +// }catch(Exception e){
  92 +// logger.error("", e);
  93 +// }
  94 +// }
  95 +//}
... ...
src/main/java/com/bsth/data/gpsdata/GpsEntity.java
... ... @@ -88,6 +88,9 @@ public class GpsEntity {
88 88 /** 越界距离 */
89 89 private double outOfBoundDistance;
90 90  
  91 + /** gps是否有效 设备端发送的状态 */
  92 + private int valid;
  93 +
91 94 public Integer getCompanyCode() {
92 95 return companyCode;
93 96 }
... ... @@ -280,4 +283,12 @@ public class GpsEntity {
280 283 public void setOutOfBoundDistance(double outOfBoundDistance) {
281 284 this.outOfBoundDistance = outOfBoundDistance;
282 285 }
  286 +
  287 + public int getValid() {
  288 + return valid;
  289 + }
  290 +
  291 + public void setValid(int valid) {
  292 + this.valid = valid;
  293 + }
283 294 }
... ...
src/main/java/com/bsth/data/gpsdata/GpsRealData.java
... ... @@ -3,6 +3,7 @@ package com.bsth.data.gpsdata;
3 3 import com.bsth.data.BasicData;
4 4 import com.bsth.data.forecast.ForecastRealServer;
5 5 import com.bsth.data.gpsdata.thread.GpsDataLoaderThread;
  6 +import com.bsth.data.gpsdata.thread.OfflineMonitorThread;
6 7 import com.bsth.data.schedule.DayOfSchedule;
7 8 import com.bsth.entity.realcontrol.ScheduleRealInfo;
8 9 import com.google.common.collect.TreeMultimap;
... ... @@ -35,6 +36,9 @@ public class GpsRealData implements CommandLineRunner {
35 36 GpsDataLoaderThread gpsDataLoader;
36 37  
37 38 @Autowired
  39 + OfflineMonitorThread offlineMonitorThread;
  40 +
  41 + @Autowired
38 42 DayOfSchedule dayOfSchedule;
39 43  
40 44 @Autowired
... ... @@ -54,9 +58,10 @@ public class GpsRealData implements CommandLineRunner {
54 58 //定时从网关获取GPS数据
55 59 //Application.mainServices.scheduleWithFixedDelay(gpsDataLoader, 20, 5, TimeUnit.SECONDS);
56 60 //定时扫描掉离线
57   -
  61 + //Application.mainServices.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);
58 62 }
59 63  
  64 +
60 65 public void put(GpsEntity gps) {
61 66 String device = gps.getDeviceId();
62 67 GpsEntity old = gpsMap.get(device);
... ...
src/main/java/com/bsth/data/gpsdata/arrival/SignalHandle.java
... ... @@ -19,10 +19,22 @@ public abstract class SignalHandle {
19 19 return prevs != null && prevs.size() > 0 && prevs.getTail() != null;
20 20 }
21 21  
22   - protected boolean isDriftSignal(GpsEntity gps) {
  22 +/* protected boolean isDriftSignal(GpsEntity gps) {
  23 + return gps.getLat() == 0 || gps.getLon() == 0;
  24 + }*/
  25 +
  26 + /**
  27 + * gps掉线
  28 + * @param gps
  29 + * @return
  30 + */
  31 + protected boolean isGpsOffline(GpsEntity gps){
23 32 return gps.getLat() == 0 || gps.getLon() == 0;
24 33 }
25 34  
  35 + protected boolean isOffline(GpsEntity gps){
  36 + return gps.getAbnormalStatus() != null && gps.getAbnormalStatus().equals("offline");
  37 + }
26 38 /**
27 39 * 是不是异常信号
28 40 *
... ... @@ -34,7 +46,7 @@ public abstract class SignalHandle {
34 46 /**
35 47 * 连续异常信号个数统计
36 48 *
37   - * @param prevs
  49 + * @param
38 50 * @return protected int abnormalCount(CircleQueue<GpsEntity> prevs) {
39 51 * int count = 0;
40 52 * <p>
... ... @@ -58,10 +70,12 @@ public abstract class SignalHandle {
58 70  
59 71 protected void transformUpdown(GpsEntity gps, ScheduleRealInfo sch) {
60 72 int updown = Integer.parseInt(sch.getXlDir());
  73 + //gps 切换走向
  74 + gps.setUpDown(updown);
  75 +
61 76 List<StationRoute> srs = GeoCacheData.getStationRoute(sch.getXlBm(), updown);
62 77 StationRoute station = GeoUtils.gpsInStation(gps, srs);
63 78 if (station != null) {
64   - gps.setUpDown(updown);
65 79 gps.setStopNo(station.getCode());
66 80 }
67 81 }
... ... @@ -78,9 +92,9 @@ public abstract class SignalHandle {
78 92 return false;
79 93  
80 94 GpsEntity prev = prevs.getTail();
81   - //从漂移状态恢复
82   - if (isDriftSignal(prev)
83   - && !isDriftSignal(gps)) {
  95 + //从异常状态恢复
  96 + if (isGpsOffline(prev)
  97 + && !isGpsOffline(gps)) {
84 98 return true;
85 99 }
86 100  
... ...
src/main/java/com/bsth/data/gpsdata/arrival/entity/ArrivalInfo.java 0 → 100644
  1 +package com.bsth.data.gpsdata.arrival.entity;
  2 +
  3 +/**
  4 + * 到离站信息
  5 + * Created by panzhao on 2017/2/20.
  6 + */
  7 +public class ArrivalInfo {
  8 +
  9 + private String lineCode;
  10 +
  11 + private String deviceId;
  12 +
  13 + /** 时间戳 */
  14 + private Long ts;
  15 +
  16 + private String stop;
  17 +
  18 + private Integer upDown;
  19 +
  20 + private int inOut;
  21 +
  22 +
  23 +}
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/AbnormalStateHandle.java
... ... @@ -30,6 +30,9 @@ public class AbnormalStateHandle extends SignalHandle{
30 30 @Override
31 31 public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
32 32  
  33 + if(isOffline(gps))
  34 + return false;
  35 +
33 36 if(overspeed(gps))
34 37 return true;
35 38  
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
... ... @@ -46,10 +46,13 @@ public class InOutStationSignalHandle extends SignalHandle{
46 46  
47 47 private final static int MAX_BEFORE_TIME = 1000 * 60 * 72;
48 48  
  49 + //最大的班次时间差,防止异常的GPS时间打乱数据
  50 + private final static int MAX_NORMAL_DIFF = 1000 * 60 * 60 * 12;
  51 +
49 52 @Override
50 53 public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
51   - //忽略漂移信号
52   - if(isDriftSignal(gps))
  54 + //忽略掉线信号
  55 + if(isGpsOffline(gps))
53 56 return false;
54 57  
55 58 //从异常状态恢复的第一个信号
... ... @@ -106,8 +109,14 @@ public class InOutStationSignalHandle extends SignalHandle{
106 109 ScheduleRealInfo sch = dayOfSchedule.executeCurr(gps.getNbbm());
107 110 String qdzCode = sch.getQdzCode();
108 111  
  112 + int diff = (int) (sch.getDfsjT() - gps.getTimestamp());
  113 +
109 114 //首班出场最多提前1.2小时
110   - if(dayOfSchedule.isFirstOut(sch) && sch.getDfsjT() - gps.getTimestamp() > MAX_BEFORE_TIME)
  115 + if(dayOfSchedule.isFirstOut(sch) && diff > MAX_BEFORE_TIME)
  116 + return;
  117 +
  118 + //正常班次最大时间差
  119 + if(Math.abs(diff) > MAX_NORMAL_DIFF)
111 120 return;
112 121  
113 122 //起点发车
... ... @@ -169,8 +178,18 @@ public class InOutStationSignalHandle extends SignalHandle{
169 178  
170 179 if(gps.getStopNo().equals(sch.getZdzCode())){
171 180  
  181 + int diff = 0;
  182 + try{
  183 + diff = (int) (sch.getZdsjT() - gps.getTimestamp());
  184 + }catch(NullPointerException e){
  185 + logger.info("NullPointerException " + sch.getXlName() + " 有班次无班次历时,,,检查一下是否需要出站既出场。");
  186 + }
172 187 //进场最多提前1.2小时
173   - if(sch.getBcType().equals("in") && sch.getZdsjT() - gps.getTimestamp() > MAX_BEFORE_TIME)
  188 + if(sch.getBcType().equals("in") && diff > MAX_BEFORE_TIME)
  189 + return;
  190 +
  191 + //正常班次最大时间差
  192 + if(Math.abs(diff) > MAX_NORMAL_DIFF)
174 193 return;
175 194  
176 195 //实达时间不覆盖
... ... @@ -195,7 +214,7 @@ public class InOutStationSignalHandle extends SignalHandle{
195 214 //进站既进场
196 215 inStationAndInPark(sch, next);
197 216 //将gps转换为下一个班次走向的站内信号
198   - transformUpdown(gps, sch);
  217 + transformUpdown(gps, next);
199 218 }
200 219 }
201 220 else if(sch.getFcsjActual() == null){
... ... @@ -217,6 +236,11 @@ public class InOutStationSignalHandle extends SignalHandle{
217 236  
218 237 sendUtils.refreshSch(next);
219 238 dayOfSchedule.save(next);
  239 +
  240 + //分班的时候,需要再跳过1个班次
  241 + next = dayOfSchedule.next(next);
  242 + if(next != null)
  243 + dayOfSchedule.addExecPlan(next);
220 244 }
221 245 }
222 246  
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/OfflineSignalHandle.java
... ... @@ -21,9 +21,10 @@ public class OfflineSignalHandle extends SignalHandle{
21 21  
22 22 @Override
23 23 public boolean handle(GpsEntity gps, CircleQueue<GpsEntity> prevs) {
24   - //漂移信号不管
25   - if(isDriftSignal(gps)){
  24 + //掉线信号不管
  25 + if(isGpsOffline(gps)){
26 26 gps.setSignalState("drift");
  27 + gps.setAbnormalStatus("gps-offline");
27 28 return true;
28 29 }
29 30  
... ...
src/main/java/com/bsth/data/gpsdata/thread/GpsDataLoaderThread.java
... ... @@ -88,6 +88,7 @@ public class GpsDataLoaderThread extends Thread {
88 88 String nbbm;
89 89 GpsEntity old;
90 90 for (GpsEntity gps : list) {
  91 +
91 92 //没有设备号
92 93 if (StringUtils.isBlank(gps.getDeviceId()))
93 94 continue;
... ...
src/main/java/com/bsth/data/gpsdata/thread/OfflineMonitorThread.java
... ... @@ -2,7 +2,11 @@ package com.bsth.data.gpsdata.thread;
2 2  
3 3 import com.bsth.data.gpsdata.GpsEntity;
4 4 import com.bsth.data.gpsdata.GpsRealData;
  5 +import com.bsth.websocket.handler.SendUtils;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
5 8 import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Component;
6 10  
7 11 import java.util.Collection;
8 12  
... ... @@ -10,35 +14,45 @@ import java.util.Collection;
10 14 * GPS掉离线监控
11 15 * Created by panzhao on 2017/1/11.
12 16 */
  17 +@Component
13 18 public class OfflineMonitorThread extends Thread{
14 19  
15 20 @Autowired
16 21 GpsRealData gpsRealData;
17 22  
18   - //有任务时 掉线阈值
19   - private final static int LOSE_TIME = 1000 * 60 * 2;
  23 + //掉线阈值
  24 + private final static int LOSE_TIME = 1000 * 60 * 10;
  25 +
  26 + Logger logger = LoggerFactory.getLogger(this.getClass());
  27 +
  28 + @Autowired
  29 + SendUtils sendUtils;
20 30  
21 31 //无任务时 离线阈值
22   - private final static int OFFLINE_TIME = 1000 * 60 * 10;
  32 + //private final static int OFFLINE_TIME = 1000 * 60 * 10;
23 33  
24 34 @Override
25 35 public void run() {
26   - long t = System.currentTimeMillis();
27   - Collection<GpsEntity> list = gpsRealData.all();
28   -
29   - String state;
30   - for(GpsEntity gps : list){
31   - state = gps.getAbnormalStatus();
32   -
33   - if(state.equals("offline"))
34   - continue;
35   -
36   -
37   - //if(state.equals("lose"))
38   - //if(!state.equals("lose"))
39   - //if(state.equals(""))
40   - //if(gps.getTimestamp())
41   - //if(gps.getAbnormalStatus().equals("lose"))
  36 + try{
  37 + long t = System.currentTimeMillis();
  38 + Collection<GpsEntity> list = gpsRealData.all();
  39 +
  40 + String state;
  41 + for(GpsEntity gps : list){
  42 + state = gps.getAbnormalStatus();
  43 +
  44 + if(state != null && state.equals("offline"))
  45 + continue;
  46 +
  47 + if (t - gps.getTimestamp() > LOSE_TIME){
  48 + gps.setAbnormalStatus("offline");
  49 +
  50 + //通知页面有设备掉线
  51 + sendUtils.deviceOffline(gps);
  52 + }
  53 + }
  54 + }catch (Exception e){
  55 + logger.error("", e);
42 56 }
43 57 }
44 58 }
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -5,13 +5,10 @@ import com.alibaba.fastjson.JSONArray;
5 5 import com.bsth.Application;
6 6 import com.bsth.data.BasicData;
7 7 import com.bsth.data.LineConfigData;
8   -import com.bsth.data.directive.FirstScheduleCheckThread;
  8 +import com.bsth.data.directive.DirectivesPstThread;
9 9 import com.bsth.data.gpsdata.GpsRealData;
10 10 import com.bsth.data.gpsdata.recovery.GpsDataRecovery;
11   -import com.bsth.data.schedule.thread.ScheduleLateThread;
12   -import com.bsth.data.schedule.thread.SchedulePstThread;
13   -import com.bsth.data.schedule.thread.ScheduleRefreshThread;
14   -import com.bsth.data.schedule.thread.SubmitToTrafficManage;
  11 +import com.bsth.data.schedule.thread.*;
15 12 import com.bsth.entity.realcontrol.LineConfig;
16 13 import com.bsth.entity.realcontrol.ScheduleRealInfo;
17 14 import com.bsth.entity.schedule.SchedulePlanInfo;
... ... @@ -49,6 +46,9 @@ public class DayOfSchedule implements CommandLineRunner {
49 46  
50 47 Logger logger = LoggerFactory.getLogger(this.getClass());
51 48  
  49 + //按线路分组的 “计划” 排班数据
  50 + public static Map<String, List<SchedulePlanInfo>> schedulePlanMap;
  51 +
52 52 // 按车辆分组的班次数据
53 53 private static ArrayListMultimap<String, ScheduleRealInfo> nbbmScheduleMap;
54 54  
... ... @@ -101,6 +101,8 @@ public class DayOfSchedule implements CommandLineRunner {
101 101 currSchDateMap = new HashMap<>();
102 102 nbbm2SEStationMap = TreeMultimap.create();
103 103 carExecutePlanMap = new HashMap<>();
  104 +
  105 + schedulePlanMap = new HashMap<>();
104 106 }
105 107  
106 108 @Autowired
... ... @@ -110,9 +112,6 @@ public class DayOfSchedule implements CommandLineRunner {
110 112 SchedulePstThread schedulePstThread;
111 113  
112 114 @Autowired
113   - FirstScheduleCheckThread firstScheduleCheckThread;
114   -
115   - @Autowired
116 115 ScheduleLateThread scheduleLateThread;
117 116  
118 117 @Autowired
... ... @@ -124,6 +123,12 @@ public class DayOfSchedule implements CommandLineRunner {
124 123 @Autowired
125 124 GpsDataRecovery gpsDataRecovery;
126 125  
  126 + @Autowired
  127 + DirectivesPstThread directivesPstThread;
  128 +
  129 + @Autowired
  130 + CalcOilThread calcOilThread;
  131 +
127 132 private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd"), fmtHHmm = DateTimeFormat.forPattern("HH:mm");
128 133  
129 134 @Override
... ... @@ -135,9 +140,7 @@ public class DayOfSchedule implements CommandLineRunner {
135 140 //翻班线程
136 141 Application.mainServices.scheduleWithFixedDelay(scheduleRefreshThread, 15, 240, TimeUnit.SECONDS);
137 142 //入库
138   -// Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 60, TimeUnit.SECONDS);
139   - //首班出场指令补发器
140   -// Application.mainServices.scheduleWithFixedDelay(firstScheduleCheckThread, 30, 240, TimeUnit.SECONDS);
  143 +// Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 30, TimeUnit.SECONDS);
141 144 //班次误点扫描
142 145 // Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS);
143 146  
... ... @@ -148,6 +151,12 @@ public class DayOfSchedule implements CommandLineRunner {
148 151  
149 152 logger.info(diff / 1000 / 60 + "分钟之后提交到运管处");
150 153 //Application.mainServices.scheduleWithFixedDelay(submitToTrafficManage, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  154 +
  155 + //计算油、公里加注
  156 + Application.mainServices.scheduleWithFixedDelay(calcOilThread, diff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  157 +
  158 + //指令持久化线程
  159 + Application.mainServices.scheduleWithFixedDelay(directivesPstThread, 180, 180, TimeUnit.SECONDS);
151 160 }
152 161  
153 162 //数据恢复
... ... @@ -328,6 +337,8 @@ public class DayOfSchedule implements CommandLineRunner {
328 337  
329 338 // 查询计划排班
330 339 List<SchedulePlanInfo> planItr = cleanSchPlanItr(schPlanService.list(data).iterator());
  340 + //保存一份原始计划排班数据
  341 + schedulePlanMap.put(lineCode, planItr);
331 342  
332 343 // 转换为实际排班
333 344 realList = JSONArray.parseArray(JSON.toJSONString(planItr), ScheduleRealInfo.class);
... ... @@ -367,13 +378,16 @@ public class DayOfSchedule implements CommandLineRunner {
367 378 sch.setZdsj(fmtHHmm.print(fmtHHmm.parseMillis(sch.getFcsj()) + (sch.getBcsj() * 60 * 1000)));
368 379 sch.setLate(false);
369 380 }
  381 +
  382 + sch.setJhlcOrig(sch.getJhlc());
370 383 //计划里程为0,设置NULL
371   - if (sch.getJhlc() != null && sch.getJhlc() == 0)
372   - sch.setJhlc(null);
  384 + //if (sch.getJhlc() != null && sch.getJhlc() == 0)
  385 + // sch.setJhlc(null);
373 386 }
374 387 } catch (Exception e) {
375 388 logger.error("", e);
376 389 }
  390 +
377 391 return realList;
378 392 }
379 393  
... ... @@ -399,13 +413,15 @@ public class DayOfSchedule implements CommandLineRunner {
399 413 new BatchSaveUtils<ScheduleRealInfo>().saveList(list, ScheduleRealInfo.class);
400 414 }
401 415  
402   - private List<SchedulePlanInfo> cleanSchPlanItr(Iterator<SchedulePlanInfo> itrab) {
  416 + public List<SchedulePlanInfo> cleanSchPlanItr(Iterator<SchedulePlanInfo> itrab) {
403 417 List<SchedulePlanInfo> list = new ArrayList<>();
404 418  
405 419 SchedulePlanInfo sp;
406 420 while (itrab.hasNext()) {
407 421 sp = itrab.next();
408 422 sp.setSchedulePlan(null);
  423 + sp.setCreateBy(null);
  424 + sp.setUpdateBy(null);
409 425 list.add(sp);
410 426 }
411 427 return list;
... ... @@ -480,6 +496,9 @@ public class DayOfSchedule implements CommandLineRunner {
480 496 if (config != null)
481 497 outConfig = config.getOutConfig();
482 498  
  499 + //限定出站既出场的停车场
  500 + String park = config.getTwinsPark();
  501 + boolean limitPark = StringUtils.isNotEmpty(park);
483 502 boolean flag = false;
484 503 ScheduleRealInfo next = null;
485 504 for (ScheduleRealInfo temp : list) {
... ... @@ -492,7 +511,8 @@ public class DayOfSchedule implements CommandLineRunner {
492 511 continue;
493 512  
494 513 //出站既出场,忽略出场班次
495   - if (outConfig == 2 && temp.getBcType().equals("out"))
  514 + if (outConfig == 2 && temp.getBcType().equals("out")
  515 + && (!limitPark || park.equals(temp.getQdzCode())))
496 516 continue;
497 517  
498 518 if (flag) {
... ... @@ -515,6 +535,9 @@ public class DayOfSchedule implements CommandLineRunner {
515 535 if (config != null)
516 536 outConfig = config.getOutConfig();
517 537  
  538 + //限定出站既出场的停车场
  539 + String park = config.getTwinsPark();
  540 + boolean limitPark = StringUtils.isNotEmpty(park);
518 541 boolean flag = false;
519 542 ScheduleRealInfo next = null;
520 543 for (ScheduleRealInfo temp : list) {
... ... @@ -527,7 +550,8 @@ public class DayOfSchedule implements CommandLineRunner {
527 550 continue;
528 551  
529 552 //出站既出场,忽略出场班次
530   - if (outConfig == 2 && temp.getBcType().equals("out"))
  553 + if (outConfig == 2 && temp.getBcType().equals("out")
  554 + && (!limitPark || park.equals(temp.getQdzCode())))
531 555 continue;
532 556  
533 557 if (flag && temp.getXlDir().equals(sch.getXlDir())) {
... ... @@ -611,6 +635,7 @@ public class DayOfSchedule implements CommandLineRunner {
611 635 // }
612 636  
613 637 public List<ScheduleRealInfo> updateQdzTimePlan(String nbbm) {
  638 + Collections.sort(nbbmScheduleMap.get(nbbm), schFCSJComparator);
614 639 return schAttrCalculator.updateQdzTimePlan(nbbmScheduleMap.get(nbbm));
615 640 }
616 641  
... ... @@ -763,6 +788,8 @@ public class DayOfSchedule implements CommandLineRunner {
763 788 public void addExecPlan(ScheduleRealInfo sch) {
764 789 if(sch != null)
765 790 carExecutePlanMap.put(sch.getClZbh(), sch);
  791 + else
  792 + carExecutePlanMap.remove(sch.getClZbh());
766 793 }
767 794  
768 795 public void removeExecPlan(String clzbh) {
... ... @@ -814,6 +841,14 @@ public class DayOfSchedule implements CommandLineRunner {
814 841 return ups;
815 842 }
816 843  
  844 + public void removeNbbm2SchMapp(ScheduleRealInfo sch, String nbbm){
  845 + nbbmScheduleMap.remove(nbbm, sch);
  846 + }
  847 +
  848 + public void addNbbm2SchMapp(ScheduleRealInfo sch, String nbbm){
  849 + nbbmScheduleMap.put(nbbm, sch);
  850 + }
  851 +
817 852 public void reCalcExecPlan(String nbbm){
818 853 carExecutePlanMap.put(nbbm, schAttrCalculator.calcCurrentExecSch(nbbmScheduleMap.get(nbbm)));
819 854 }
... ...
src/main/java/com/bsth/data/schedule/thread/CalcOilThread.java 0 → 100644
  1 +package com.bsth.data.schedule.thread;
  2 +
  3 +import com.bsth.service.oil.YlbService;
  4 +import org.slf4j.Logger;
  5 +import org.slf4j.LoggerFactory;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.stereotype.Component;
  8 +
  9 +/**
  10 + * 计算油、公里加注量 线程
  11 + * Created by panzhao on 2017/3/7.
  12 + */
  13 +@Component
  14 +public class CalcOilThread extends Thread{
  15 +
  16 + @Autowired
  17 + YlbService ylbService;
  18 +
  19 + Logger logger = LoggerFactory.getLogger(this.getClass());
  20 +
  21 + @Override
  22 + public void run() {
  23 + try{
  24 + logger.info("开始计算路单里程加注量....");
  25 + ylbService.obtainDsq();
  26 + logger.info("计算路单里程加注量结束!");
  27 + } catch(Exception e){
  28 + logger.error("计算路单里程加注量失败",e);
  29 + }
  30 + }
  31 +}
... ...
src/main/java/com/bsth/data/schedule/thread/SubmitToTrafficManage.java
1 1 package com.bsth.data.schedule.thread;
2 2  
3 3 import com.bsth.service.TrafficManageService;
4   -import com.bsth.service.oil.YlbService;
5   -
6 4 import org.slf4j.Logger;
7 5 import org.slf4j.LoggerFactory;
8 6 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -19,18 +17,10 @@ public class SubmitToTrafficManage extends Thread{
19 17  
20 18 @Autowired
21 19 TrafficManageService trafficManageService;
22   -
23   - @Autowired
24   - YlbService YlbService;
25 20  
26 21 @Override
27 22 public void run() {
28 23 logger.info("开始提交数据到运管处...");
29   - try{
30   - YlbService.obtainDsq();
31   - } catch(Exception e){
32   - logger.error("计算路单里程加注量失败",e);
33   - }
34 24  
35 25 try {
36 26 //路单
... ...
src/main/java/com/bsth/entity/SectionRoute.java
... ... @@ -52,7 +52,7 @@ public class SectionRoute {
52 52 // 是否撤销
53 53 private Integer destroy;
54 54  
55   - /** 是否有路段限速数据 <0:无;1:有>*/
  55 + /** 是否有路段限速数据 <0:未分段;1:分段>*/
56 56 private Integer isRoadeSpeed;
57 57  
58 58 // 描述
... ...
src/main/java/com/bsth/entity/logger/Logger.java 0 → 100644
  1 +package com.bsth.entity.logger;
  2 +
  3 +import javax.persistence.GeneratedValue;
  4 +import javax.persistence.Id;
  5 +import javax.persistence.MappedSuperclass;
  6 +
  7 +/**
  8 + * 操作日志通用字段
  9 + * Created by panzhao on 2017/3/6.
  10 + */
  11 +@MappedSuperclass
  12 +public abstract class Logger {
  13 +
  14 + @Id
  15 + @GeneratedValue
  16 + private Long id;
  17 +
  18 + /** 用户信息 */
  19 + private String userName;
  20 + private String name;
  21 +
  22 + /** ########## 客户端信息 ########### */
  23 + /** ip */
  24 + private String clientIp;
  25 + /** 浏览器 */
  26 + private String browser;
  27 + /** 系统平台 */
  28 + private String clientSystem;
  29 + /** 浏览器内核 */
  30 + private String browserCore;
  31 +
  32 + /** 操作时间 */
  33 + private Long ts;
  34 +
  35 + public String getUserName() {
  36 + return userName;
  37 + }
  38 +
  39 + public void setUserName(String userName) {
  40 + this.userName = userName;
  41 + }
  42 +
  43 + public String getName() {
  44 + return name;
  45 + }
  46 +
  47 + public void setName(String name) {
  48 + this.name = name;
  49 + }
  50 +
  51 + public String getClientIp() {
  52 + return clientIp;
  53 + }
  54 +
  55 + public void setClientIp(String clientIp) {
  56 + this.clientIp = clientIp;
  57 + }
  58 +
  59 + public String getBrowser() {
  60 + return browser;
  61 + }
  62 +
  63 + public void setBrowser(String browser) {
  64 + this.browser = browser;
  65 + }
  66 +
  67 + public String getClientSystem() {
  68 + return clientSystem;
  69 + }
  70 +
  71 + public void setClientSystem(String clientSystem) {
  72 + this.clientSystem = clientSystem;
  73 + }
  74 +
  75 + public String getBrowserCore() {
  76 + return browserCore;
  77 + }
  78 +
  79 + public void setBrowserCore(String browserCore) {
  80 + this.browserCore = browserCore;
  81 + }
  82 +
  83 + public Long getTs() {
  84 + return ts;
  85 + }
  86 +
  87 + public void setTs(Long ts) {
  88 + this.ts = ts;
  89 + }
  90 +}
... ...
src/main/java/com/bsth/entity/logger/Logger_MileModify.java 0 → 100644
  1 +package com.bsth.entity.logger;
  2 +
  3 +import javax.persistence.Entity;
  4 +import javax.persistence.Table;
  5 +
  6 +/**
  7 + * 操作日志 -修改公里
  8 + * Created by panzhao on 2017/3/6.
  9 + */
  10 +@Entity
  11 +@Table(name = "logger_mile_modify")
  12 +public class Logger_MileModify extends Logger{
  13 +
  14 + /** 之前的公里 */
  15 + private Double beforeMile;
  16 +
  17 + /** 修改之后的公里 */
  18 + private Double afterMile;
  19 +
  20 + /** 线路 code/name */
  21 + private String lineStr;
  22 +
  23 + /** 路牌 */
  24 + private String lp;
  25 +
  26 + /** 车辆自编号 */
  27 + private String nbbm;
  28 +
  29 + /** 发车时间 */
  30 + private String fcsj;
  31 +
  32 + /** 班次ID */
  33 + private Long schId;
  34 +
  35 + /** 备注 */
  36 + private String remarks;
  37 +
  38 + public Double getBeforeMile() {
  39 + return beforeMile;
  40 + }
  41 +
  42 + public void setBeforeMile(Double beforeMile) {
  43 + this.beforeMile = beforeMile;
  44 + }
  45 +
  46 + public Double getAfterMile() {
  47 + return afterMile;
  48 + }
  49 +
  50 + public void setAfterMile(Double afterMile) {
  51 + this.afterMile = afterMile;
  52 + }
  53 +
  54 + public String getLineStr() {
  55 + return lineStr;
  56 + }
  57 +
  58 + public void setLineStr(String lineStr) {
  59 + this.lineStr = lineStr;
  60 + }
  61 +
  62 + public String getLp() {
  63 + return lp;
  64 + }
  65 +
  66 + public void setLp(String lp) {
  67 + this.lp = lp;
  68 + }
  69 +
  70 + public String getNbbm() {
  71 + return nbbm;
  72 + }
  73 +
  74 + public void setNbbm(String nbbm) {
  75 + this.nbbm = nbbm;
  76 + }
  77 +
  78 + public String getFcsj() {
  79 + return fcsj;
  80 + }
  81 +
  82 + public void setFcsj(String fcsj) {
  83 + this.fcsj = fcsj;
  84 + }
  85 +
  86 + public Long getSchId() {
  87 + return schId;
  88 + }
  89 +
  90 + public void setSchId(Long schId) {
  91 + this.schId = schId;
  92 + }
  93 +
  94 + public String getRemarks() {
  95 + return remarks;
  96 + }
  97 +
  98 + public void setRemarks(String remarks) {
  99 + this.remarks = remarks;
  100 + }
  101 +}
... ...
src/main/java/com/bsth/entity/oil/Cdl.java 0 → 100644
  1 +package com.bsth.entity.oil;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +import javax.persistence.Transient;
  10 +
  11 +import com.bsth.data.BasicData;
  12 +
  13 +@Entity
  14 +@Table(name = "bsth_c_cdl")
  15 +public class Cdl {
  16 + @Id
  17 + @GeneratedValue
  18 + private Integer id;
  19 +
  20 + private String nbbm;
  21 +
  22 + //存电量
  23 + private Double cdl;
  24 +
  25 + private Date updatetime;
  26 +
  27 + //恒定存电
  28 + private Double clcd;
  29 + //公司代码
  30 + private String gsdm;
  31 +
  32 + @Transient
  33 + private String gsname;
  34 +
  35 + @Transient
  36 + private String fgsname;
  37 +
  38 + //分公司代码
  39 + private String fgsdm;
  40 +
  41 + public Integer getId() {
  42 + return id;
  43 + }
  44 +
  45 + public void setId(Integer id) {
  46 + this.id = id;
  47 + }
  48 +
  49 + public String getNbbm() {
  50 + return nbbm;
  51 + }
  52 +
  53 + public void setNbbm(String nbbm) {
  54 + this.nbbm = nbbm;
  55 + }
  56 +
  57 +
  58 + public Double getCdl() {
  59 + return cdl;
  60 + }
  61 +
  62 + public void setCdl(Double cdl) {
  63 + this.cdl = cdl;
  64 + }
  65 +
  66 + public Double getClcd() {
  67 + return clcd;
  68 + }
  69 +
  70 + public void setClcd(Double clcd) {
  71 + this.clcd = clcd;
  72 + }
  73 +
  74 + public Date getUpdatetime() {
  75 + return updatetime;
  76 + }
  77 +
  78 + public void setUpdatetime(Date updatetime) {
  79 + this.updatetime = updatetime;
  80 + }
  81 +
  82 +
  83 + public String getGsdm(){
  84 + return gsdm;
  85 + }
  86 +
  87 + public void setGsdm(String gsdm){
  88 + this.gsdm=gsdm;
  89 + }
  90 +
  91 + public String getFgsdm() {
  92 + return fgsdm;
  93 + }
  94 +
  95 + public void setFgsdm(String fgsdm) {
  96 + this.fgsdm = fgsdm;
  97 + }
  98 +
  99 + public String getGsname() {
  100 + return BasicData.businessCodeNameMap.get(this.gsdm);
  101 + }
  102 +
  103 + public void setGsname(String gsname) {
  104 + this.gsname = gsname;
  105 + }
  106 +
  107 + public String getFgsname() {
  108 + return BasicData.businessFgsCodeNameMap.get(this.fgsdm+"_"+this.gsdm);
  109 + }
  110 +
  111 + public void setFgsname(String fgsname) {
  112 + this.fgsname = fgsname;
  113 + }
  114 +
  115 +
  116 +}
... ...
src/main/java/com/bsth/entity/oil/Dlb.java 0 → 100644
  1 +package com.bsth.entity.oil;
  2 +
  3 +import java.text.DecimalFormat;
  4 +import java.util.Date;
  5 +
  6 +import javax.persistence.Entity;
  7 +import javax.persistence.GeneratedValue;
  8 +import javax.persistence.Id;
  9 +import javax.persistence.Table;
  10 +import javax.persistence.Transient;
  11 +
  12 +import org.springframework.format.annotation.DateTimeFormat;
  13 +
  14 +import com.bsth.data.BasicData;
  15 +
  16 +@Entity
  17 +@Table(name = "bsth_c_dlb")
  18 +public class Dlb {
  19 + @Id
  20 + @GeneratedValue
  21 + private Integer id;
  22 + @DateTimeFormat(pattern="yyyy-MM-dd")
  23 + private Date rq;
  24 + private String xlbm;
  25 + private String ssgsdm;
  26 + private String fgsdm;
  27 + private String nbbm;
  28 + private String jsy;
  29 + private Double czlc=0.0;
  30 + private Double jzlc=0.0;
  31 + //出站存电
  32 + private Double czcd=0.0;
  33 + //进站存电
  34 + private Double jzcd=0.0;
  35 + //充电量
  36 + private Double cdl;
  37 + private int sfkt;
  38 + private String jhsj;
  39 + //耗电
  40 + private Double hd=0.0;
  41 + private Double sh=0.0;
  42 + private String shyy;
  43 + private Double zlc=0.0;
  44 + private int yhlx;
  45 +
  46 + private Double ns=0.0;
  47 + private Double fyylc=0.0;
  48 + private Double jhzlc=0.0;
  49 + private Double jhfyylc=0.0;
  50 + private int jhzbc;
  51 + private int jhbc;
  52 + private int sjzbc;
  53 + private int sjbc;
  54 + private String edituser;
  55 + private Date edittime;
  56 + private Date createtime;
  57 + private int nylx;
  58 + //进场顺序(根据最先出场和最后进场来关联车辆的存油量)
  59 + private int jcsx;
  60 +
  61 + @Transient
  62 + private String bglyh;
  63 +
  64 + @Transient
  65 + private String xlname;
  66 +
  67 + @Transient
  68 + private String gsname;
  69 +
  70 +
  71 +
  72 +
  73 + public Integer getId() {
  74 + return id;
  75 + }
  76 +
  77 + public void setId(Integer id) {
  78 + this.id = id;
  79 + }
  80 +
  81 + public Date getRq() {
  82 + return rq;
  83 + }
  84 +
  85 + public void setRq(Date rq) {
  86 + this.rq = rq;
  87 + }
  88 +
  89 + public String getXlbm() {
  90 + return xlbm;
  91 + }
  92 +
  93 + public void setXlbm(String xlbm) {
  94 + this.xlbm = xlbm;
  95 + }
  96 +
  97 + public String getSsgsdm() {
  98 + return ssgsdm;
  99 + }
  100 +
  101 + public void setSsgsdm(String ssgsdm) {
  102 + this.ssgsdm = ssgsdm;
  103 + }
  104 +
  105 + public String getFgsdm() {
  106 + return fgsdm;
  107 + }
  108 +
  109 + public void setFgsdm(String fgsdm) {
  110 + this.fgsdm = fgsdm;
  111 + }
  112 +
  113 + public String getNbbm() {
  114 + return nbbm;
  115 + }
  116 +
  117 + public void setNbbm(String nbbm) {
  118 + this.nbbm = nbbm;
  119 + }
  120 +
  121 + public String getJsy() {
  122 + return jsy;
  123 + }
  124 +
  125 + public void setJsy(String jsy) {
  126 + this.jsy = jsy;
  127 + }
  128 +
  129 + public Double getCzlc() {
  130 + return czlc;
  131 + }
  132 +
  133 + public void setCzlc(Double czlc) {
  134 + this.czlc = czlc;
  135 + }
  136 +
  137 + public Double getJzlc() {
  138 + return jzlc;
  139 + }
  140 +
  141 + public void setJzlc(Double jzlc) {
  142 + this.jzlc = jzlc;
  143 + }
  144 +
  145 + public Double getCzcd() {
  146 + return czcd;
  147 + }
  148 +
  149 + public void setCzcd(Double czcd) {
  150 + this.czcd = czcd;
  151 + }
  152 +
  153 + public Double getJzcd() {
  154 + return jzcd;
  155 + }
  156 +
  157 + public void setJzcd(Double jzcd) {
  158 + this.jzcd = jzcd;
  159 + }
  160 +
  161 + public Double getCdl() {
  162 + return cdl;
  163 + }
  164 +
  165 + public void setCdl(Double cdl) {
  166 + this.cdl = cdl;
  167 + }
  168 +
  169 + public int getSfkt() {
  170 + return sfkt;
  171 + }
  172 +
  173 + public void setSfkt(int sfkt) {
  174 + this.sfkt = sfkt;
  175 + }
  176 +
  177 + public String getJhsj() {
  178 + return jhsj;
  179 + }
  180 +
  181 + public void setJhsj(String jhsj) {
  182 + this.jhsj = jhsj;
  183 + }
  184 +
  185 + public Double getHd() {
  186 + return hd;
  187 + }
  188 +
  189 + public void setHd(Double hd) {
  190 + this.hd = hd;
  191 + }
  192 +
  193 + public Double getSh() {
  194 + return sh;
  195 + }
  196 +
  197 + public void setSh(Double sh) {
  198 + this.sh = sh;
  199 + }
  200 +
  201 + public String getShyy() {
  202 + return shyy;
  203 + }
  204 +
  205 + public void setShyy(String shyy) {
  206 + this.shyy = shyy;
  207 + }
  208 +
  209 + public Double getZlc() {
  210 + return zlc;
  211 + }
  212 +
  213 + public void setZlc(Double zlc) {
  214 + this.zlc = zlc;
  215 + }
  216 +
  217 + public int getYhlx() {
  218 + return yhlx;
  219 + }
  220 +
  221 + public void setYhlx(int yhlx) {
  222 + this.yhlx = yhlx;
  223 + }
  224 +
  225 + public Double getNs() {
  226 + return ns;
  227 + }
  228 +
  229 + public void setNs(Double ns) {
  230 + this.ns = ns;
  231 + }
  232 +
  233 + public Double getFyylc() {
  234 + return fyylc;
  235 + }
  236 +
  237 + public void setFyylc(Double fyylc) {
  238 + this.fyylc = fyylc;
  239 + }
  240 +
  241 + public Double getJhzlc() {
  242 + return jhzlc;
  243 + }
  244 +
  245 + public void setJhzlc(Double jhzlc) {
  246 + this.jhzlc = jhzlc;
  247 + }
  248 +
  249 + public Double getJhfyylc() {
  250 + return jhfyylc;
  251 + }
  252 +
  253 + public void setJhfyylc(Double jhfyylc) {
  254 + this.jhfyylc = jhfyylc;
  255 + }
  256 +
  257 + public int getJhzbc() {
  258 + return jhzbc;
  259 + }
  260 +
  261 + public void setJhzbc(int jhzbc) {
  262 + this.jhzbc = jhzbc;
  263 + }
  264 +
  265 + public int getJhbc() {
  266 + return jhbc;
  267 + }
  268 +
  269 + public void setJhbc(int jhbc) {
  270 + this.jhbc = jhbc;
  271 + }
  272 +
  273 + public int getSjzbc() {
  274 + return sjzbc;
  275 + }
  276 +
  277 + public void setSjzbc(int sjzbc) {
  278 + this.sjzbc = sjzbc;
  279 + }
  280 +
  281 + public int getSjbc() {
  282 + return sjbc;
  283 + }
  284 +
  285 + public void setSjbc(int sjbc) {
  286 + this.sjbc = sjbc;
  287 + }
  288 +
  289 + public String getEdituser() {
  290 + return edituser;
  291 + }
  292 +
  293 + public void setEdituser(String edituser) {
  294 + this.edituser = edituser;
  295 + }
  296 +
  297 + public Date getEdittime() {
  298 + return edittime;
  299 + }
  300 +
  301 + public void setEdittime(Date edittime) {
  302 + this.edittime = edittime;
  303 + }
  304 +
  305 + public Date getCreatetime() {
  306 + return createtime;
  307 + }
  308 +
  309 + public void setCreatetime(Date createtime) {
  310 + this.createtime = createtime;
  311 + }
  312 +
  313 + public int getNylx() {
  314 + return nylx;
  315 + }
  316 +
  317 + public void setNylx(int nylx) {
  318 + this.nylx = nylx;
  319 + }
  320 +
  321 + public int getJcsx() {
  322 + return jcsx;
  323 + }
  324 +
  325 + public void setJcsx(int jcsx) {
  326 + this.jcsx = jcsx;
  327 + }
  328 +
  329 + public String getBglyh() {
  330 + if(this.getZlc()==0){
  331 + return "0.00";
  332 + }else{
  333 + DecimalFormat df = new DecimalFormat("0.00");
  334 + return df.format(this.getHd()/this.getZlc()*100);
  335 + }
  336 + }
  337 +
  338 + public void setBglyh(String bglyh) {
  339 + this.bglyh = bglyh;
  340 + }
  341 +
  342 + public String getXlname() {
  343 + return BasicData.lineCode2NameMap.get(this.xlbm);
  344 + }
  345 +
  346 + public void setXlname(String xlname) {
  347 + this.xlname = xlname;
  348 + }
  349 +
  350 + public String getGsname() {
  351 + return BasicData.businessCodeNameMap.get(this.ssgsdm);
  352 + }
  353 +
  354 + public void setGsname(String gsname) {
  355 + this.gsname = gsname;
  356 + }
  357 +
  358 +
  359 +}
... ...
src/main/java/com/bsth/entity/oil/Jdl.java 0 → 100644
  1 +package com.bsth.entity.oil;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +import org.springframework.format.annotation.DateTimeFormat;
  11 +
  12 +@Entity
  13 +@Table(name = "bsth_c_jdl")
  14 +public class Jdl {
  15 + @Id
  16 + @GeneratedValue
  17 + private Integer id;
  18 + @DateTimeFormat(pattern="yyyy-MM-dd")
  19 + private Date rq;
  20 + private String gsBm;
  21 + private String gsName;
  22 + private String fgsBm;
  23 + private String fgsName;
  24 + private String nbbm;
  25 + private Double jdl = 0.0;
  26 + private String jdz;
  27 + private String remarks;
  28 + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
  29 + private Date createrDate;
  30 +
  31 +
  32 + public Integer getId() {
  33 + return id;
  34 + }
  35 + public void setId(Integer id) {
  36 + this.id = id;
  37 + }
  38 + public Date getRq() {
  39 + return rq;
  40 + }
  41 + public void setRq(Date rq) {
  42 + this.rq = rq;
  43 + }
  44 + public String getGsBm() {
  45 + return gsBm;
  46 + }
  47 + public void setGsBm(String gsBm) {
  48 + this.gsBm = gsBm;
  49 + }
  50 + public String getGsName() {
  51 + return gsName;
  52 + }
  53 + public void setGsName(String gsName) {
  54 + this.gsName = gsName;
  55 + }
  56 + public String getFgsBm() {
  57 + return fgsBm;
  58 + }
  59 + public void setFgsBm(String fgsBm) {
  60 + this.fgsBm = fgsBm;
  61 + }
  62 + public String getFgsName() {
  63 + return fgsName;
  64 + }
  65 + public void setFgsName(String fgsName) {
  66 + this.fgsName = fgsName;
  67 + }
  68 + public String getNbbm() {
  69 + return nbbm;
  70 + }
  71 + public void setNbbm(String nbbm) {
  72 + this.nbbm = nbbm;
  73 + }
  74 + public Double getJdl() {
  75 + return jdl;
  76 + }
  77 + public void setJdl(Double jdl) {
  78 + this.jdl = jdl;
  79 + }
  80 + public String getJdz() {
  81 + return jdz;
  82 + }
  83 + public void setJdz(String jdz) {
  84 + this.jdz = jdz;
  85 + }
  86 + public String getRemarks() {
  87 + return remarks;
  88 + }
  89 + public void setRemarks(String remarks) {
  90 + this.remarks = remarks;
  91 + }
  92 + public Date getCreaterDate() {
  93 + return createrDate;
  94 + }
  95 + public void setCreaterDate(Date createrDate) {
  96 + this.createrDate = createrDate;
  97 + }
  98 +
  99 +}
... ...
src/main/java/com/bsth/entity/realcontrol/LineConfig.java
... ... @@ -47,6 +47,9 @@ public class LineConfig {
47 47 /** 出场时间设置 0:真实出场(设备离开缓冲区时间) 1:请求出场时间 2:出站即出场 */
48 48 private int outConfig;
49 49  
  50 + /** 出站既出场 对应的停车场 */
  51 + private String twinsPark;
  52 +
50 53 /** 短语模板 , 号分隔多个 */
51 54 private String phraseTemps;
52 55  
... ... @@ -56,6 +59,23 @@ public class LineConfig {
56 59 /** 识别区间调头 */
57 60 private boolean readReverse;
58 61  
  62 + /** 原线路回场 */
  63 + private boolean inParkForSource;
  64 +
  65 + /**
  66 + * 到离站偏移值
  67 + */
  68 +
  69 + //上行进站
  70 + private int upInDiff;
  71 + //上行出站
  72 + private int upOutDiff;
  73 + //下行进站
  74 + private int downInDiff;
  75 + //下行出站
  76 + private int downOutDiff;
  77 +
  78 +
59 79 @OneToMany(cascade = CascadeType.ALL)
60 80 private Set<D80ReplyTemp> d80Temps = new HashSet<>();
61 81  
... ... @@ -151,4 +171,52 @@ public class LineConfig {
151 171 public void setReadReverse(boolean readReverse) {
152 172 this.readReverse = readReverse;
153 173 }
  174 +
  175 + public boolean isInParkForSource() {
  176 + return inParkForSource;
  177 + }
  178 +
  179 + public void setInParkForSource(boolean inParkForSource) {
  180 + this.inParkForSource = inParkForSource;
  181 + }
  182 +
  183 + public int getUpInDiff() {
  184 + return upInDiff;
  185 + }
  186 +
  187 + public void setUpInDiff(int upInDiff) {
  188 + this.upInDiff = upInDiff;
  189 + }
  190 +
  191 + public int getUpOutDiff() {
  192 + return upOutDiff;
  193 + }
  194 +
  195 + public void setUpOutDiff(int upOutDiff) {
  196 + this.upOutDiff = upOutDiff;
  197 + }
  198 +
  199 + public int getDownInDiff() {
  200 + return downInDiff;
  201 + }
  202 +
  203 + public void setDownInDiff(int downInDiff) {
  204 + this.downInDiff = downInDiff;
  205 + }
  206 +
  207 + public int getDownOutDiff() {
  208 + return downOutDiff;
  209 + }
  210 +
  211 + public void setDownOutDiff(int downOutDiff) {
  212 + this.downOutDiff = downOutDiff;
  213 + }
  214 +
  215 + public String getTwinsPark() {
  216 + return twinsPark;
  217 + }
  218 +
  219 + public void setTwinsPark(String twinsPark) {
  220 + this.twinsPark = twinsPark;
  221 + }
154 222 }
... ...
src/main/java/com/bsth/entity/realcontrol/OilStationSociety.java 0 → 100644
  1 +package com.bsth.entity.realcontrol;
  2 +
  3 +import javax.persistence.Entity;
  4 +import javax.persistence.Id;
  5 +import javax.persistence.Table;
  6 +
  7 +/**
  8 + * 社会加油站
  9 + * Created by panzhao on 2017/3/16.
  10 + */
  11 +@Entity
  12 +@Table(name = "bsth_c_oil_station")
  13 +public class OilStationSociety {
  14 +
  15 + @Id
  16 + private String lineCode;
  17 +
  18 + /**
  19 + * 加油站名称
  20 + */
  21 + private String stationName;
  22 +
  23 + /**
  24 + * 上行进场距离
  25 + */
  26 + private Double upInMile;
  27 + /**
  28 + * 上行出场距离
  29 + */
  30 + private Double upOutMile;
  31 +
  32 + /**
  33 + * 下行进场距离
  34 + */
  35 + private Double downInMile;
  36 + /**
  37 + * 下行出场距离
  38 + */
  39 + private Double downOutMile;
  40 +
  41 +
  42 + /**
  43 + * 上行进场时间 分钟
  44 + */
  45 + private int upInTime;
  46 + /**
  47 + * 上行出场时间 分钟
  48 + */
  49 + private int upOutTime;
  50 +
  51 + /**
  52 + * 下行进场时间 分钟
  53 + */
  54 + private int downInTime;
  55 + /**
  56 + * 下行出场时间 分钟
  57 + */
  58 + private int downOutTime;
  59 +
  60 +
  61 + public String getLineCode() {
  62 + return lineCode;
  63 + }
  64 +
  65 + public void setLineCode(String lineCode) {
  66 + this.lineCode = lineCode;
  67 + }
  68 +
  69 + public String getStationName() {
  70 + return stationName;
  71 + }
  72 +
  73 + public void setStationName(String stationName) {
  74 + this.stationName = stationName;
  75 + }
  76 +
  77 + public Double getUpInMile() {
  78 + return upInMile;
  79 + }
  80 +
  81 + public void setUpInMile(Double upInMile) {
  82 + this.upInMile = upInMile;
  83 + }
  84 +
  85 + public Double getUpOutMile() {
  86 + return upOutMile;
  87 + }
  88 +
  89 + public void setUpOutMile(Double upOutMile) {
  90 + this.upOutMile = upOutMile;
  91 + }
  92 +
  93 + public Double getDownInMile() {
  94 + return downInMile;
  95 + }
  96 +
  97 + public void setDownInMile(Double downInMile) {
  98 + this.downInMile = downInMile;
  99 + }
  100 +
  101 + public Double getDownOutMile() {
  102 + return downOutMile;
  103 + }
  104 +
  105 + public void setDownOutMile(Double downOutMile) {
  106 + this.downOutMile = downOutMile;
  107 + }
  108 +
  109 + public int getUpInTime() {
  110 + return upInTime;
  111 + }
  112 +
  113 + public void setUpInTime(int upInTime) {
  114 + this.upInTime = upInTime;
  115 + }
  116 +
  117 + public int getUpOutTime() {
  118 + return upOutTime;
  119 + }
  120 +
  121 + public void setUpOutTime(int upOutTime) {
  122 + this.upOutTime = upOutTime;
  123 + }
  124 +
  125 + public int getDownInTime() {
  126 + return downInTime;
  127 + }
  128 +
  129 + public void setDownInTime(int downInTime) {
  130 + this.downInTime = downInTime;
  131 + }
  132 +
  133 + public int getDownOutTime() {
  134 + return downOutTime;
  135 + }
  136 +
  137 + public void setDownOutTime(int downOutTime) {
  138 + this.downOutTime = downOutTime;
  139 + }
  140 +}
... ...
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
... ... @@ -87,6 +87,12 @@ public class ScheduleRealInfo {
87 87 private Integer bcs;
88 88 /** 计划里程 */
89 89 private Double jhlc;
  90 +
  91 + /** 原始计划里程 (原计调的数据) */
  92 + private Double jhlcOrig;
  93 +
  94 + /** 实际里程 这个字段被废弃*/
  95 + private Double realMileage;
90 96  
91 97 /** 实际里程 */
92 98 @Transient
... ... @@ -344,6 +350,8 @@ public class ScheduleRealInfo {
344 350 }
345 351  
346 352 public String getsGh() {
  353 + if(sGh == null)
  354 + return "";
347 355 return sGh;
348 356 }
349 357  
... ... @@ -352,6 +360,8 @@ public class ScheduleRealInfo {
352 360 }
353 361  
354 362 public String getsName() {
  363 + if(sGh == null)
  364 + return "";
355 365 return sName;
356 366 }
357 367  
... ... @@ -616,6 +626,11 @@ public class ScheduleRealInfo {
616 626 }
617 627 }
618 628  
  629 + @Override
  630 + public int hashCode() {
  631 + return ("schedule_" + this.id).hashCode();
  632 + }
  633 +
619 634 public String getQdzArrDateJH() {
620 635 return qdzArrDatejh;
621 636 }
... ... @@ -750,6 +765,7 @@ public class ScheduleRealInfo {
750 765 }
751 766  
752 767 public void destroy(){
  768 + this.jhlc = 0.0;
753 769 this.status = -1;
754 770 }
755 771  
... ... @@ -830,4 +846,20 @@ public class ScheduleRealInfo {
830 846 public void setReissue(boolean reissue) {
831 847 this.reissue = reissue;
832 848 }
  849 +
  850 + public Double getRealMileage() {
  851 + return realMileage;
  852 + }
  853 +
  854 + public void setRealMileage(Double realMileage) {
  855 + this.realMileage = realMileage;
  856 + }
  857 +
  858 + public Double getJhlcOrig() {
  859 + return jhlcOrig;
  860 + }
  861 +
  862 + public void setJhlcOrig(Double jhlcOrig) {
  863 + this.jhlcOrig = jhlcOrig;
  864 + }
833 865 }
... ...
src/main/java/com/bsth/entity/schedule/CarConfigInfo.java
1 1 package com.bsth.entity.schedule;
2 2  
  3 +import com.bsth.entity.CarPark;
3 4 import com.bsth.entity.Cars;
4 5 import com.bsth.entity.Line;
5 6 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
... ... @@ -47,9 +48,16 @@ public class CarConfigInfo extends BEntity implements Serializable {
47 48 private Date qyrq;
48 49 /** 终止日期 */
49 50 private Date zzrq;
  51 +
  52 +
50 53 @Column(nullable = false)
51 54 /** 停车点(TODO:这个不知道是否要关联)*/
52 55 private String tcd;
  56 +
  57 + /** 停车场关联(出场,进场班次会关联停车场) */
  58 + @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY)
  59 + private CarPark tcc;
  60 +
53 61 /** 受否切换 0或者1(TODO:不懂,貌似喝历史配车有关) */
54 62 @Column(nullable = false)
55 63 private int isSwitch;
... ... @@ -58,6 +66,26 @@ public class CarConfigInfo extends BEntity implements Serializable {
58 66 @Column(nullable = false)
59 67 private Boolean isCancel = false;
60 68  
  69 + //-------------- 车辆配置的停车场及相关信息 ------------//
  70 + /** 车辆配置-CheLiangPeiZhi 字典,ZW(早晚),FS(复驶),BSY(不使用) */
  71 + private String pzType;
  72 + /** 上行出场里程 */
  73 + private Double upOutLc;
  74 + /** 上行出场时间 */
  75 + private Double upOutSj;
  76 + /** 下行出场里程 */
  77 + private Double downOutLc;
  78 + /** 下行出场时间 */
  79 + private Double downOutSj;
  80 + /** 上行进场里程 */
  81 + private Double upInLc;
  82 + /** 上行进场时间 */
  83 + private Double upInSj;
  84 + /** 下行进场里程 */
  85 + private Double downInLc;
  86 + /** 下行进场时间 */
  87 + private Double downInSj;
  88 +
61 89 public CarConfigInfo() {}
62 90 public CarConfigInfo(Object id, Object xlid, Object xlname, Object clid) {
63 91 if (id != null) {
... ... @@ -156,4 +184,84 @@ public class CarConfigInfo extends BEntity implements Serializable {
156 184 public void setIsCancel(Boolean isCancel) {
157 185 this.isCancel = isCancel;
158 186 }
  187 +
  188 + public String getPzType() {
  189 + return pzType;
  190 + }
  191 +
  192 + public void setPzType(String pzType) {
  193 + this.pzType = pzType;
  194 + }
  195 +
  196 + public Double getUpOutLc() {
  197 + return upOutLc;
  198 + }
  199 +
  200 + public void setUpOutLc(Double upOutLc) {
  201 + this.upOutLc = upOutLc;
  202 + }
  203 +
  204 + public Double getUpOutSj() {
  205 + return upOutSj;
  206 + }
  207 +
  208 + public void setUpOutSj(Double upOutSj) {
  209 + this.upOutSj = upOutSj;
  210 + }
  211 +
  212 + public Double getDownOutLc() {
  213 + return downOutLc;
  214 + }
  215 +
  216 + public void setDownOutLc(Double downOutLc) {
  217 + this.downOutLc = downOutLc;
  218 + }
  219 +
  220 + public Double getDownOutSj() {
  221 + return downOutSj;
  222 + }
  223 +
  224 + public void setDownOutSj(Double downOutSj) {
  225 + this.downOutSj = downOutSj;
  226 + }
  227 +
  228 + public Double getUpInLc() {
  229 + return upInLc;
  230 + }
  231 +
  232 + public void setUpInLc(Double upInLc) {
  233 + this.upInLc = upInLc;
  234 + }
  235 +
  236 + public Double getUpInSj() {
  237 + return upInSj;
  238 + }
  239 +
  240 + public void setUpInSj(Double upInSj) {
  241 + this.upInSj = upInSj;
  242 + }
  243 +
  244 + public Double getDownInLc() {
  245 + return downInLc;
  246 + }
  247 +
  248 + public void setDownInLc(Double downInLc) {
  249 + this.downInLc = downInLc;
  250 + }
  251 +
  252 + public Double getDownInSj() {
  253 + return downInSj;
  254 + }
  255 +
  256 + public void setDownInSj(Double downInSj) {
  257 + this.downInSj = downInSj;
  258 + }
  259 +
  260 + public CarPark getTcc() {
  261 + return tcc;
  262 + }
  263 +
  264 + public void setTcc(CarPark tcc) {
  265 + this.tcc = tcc;
  266 + }
159 267 }
... ...
src/main/java/com/bsth/entity/schedule/SchedulePlan.java
... ... @@ -2,7 +2,6 @@ package com.bsth.entity.schedule;
2 2  
3 3 import com.bsth.entity.Line;
4 4 import com.bsth.entity.schedule.rule.ScheduleRule1;
5   -import com.bsth.entity.sys.SysUser;
6 5 import com.fasterxml.jackson.annotation.JsonIgnore;
7 6  
8 7 import javax.persistence.*;
... ... @@ -21,7 +20,7 @@ import java.util.List;
21 20 @NamedAttributeNode("ttInfo")
22 21 })
23 22 })
24   -public class SchedulePlan {
  23 +public class SchedulePlan extends BEntity {
25 24  
26 25 /** 主键Id */
27 26 @Id
... ... @@ -60,19 +59,6 @@ public class SchedulePlan {
60 59 @OneToMany(mappedBy = "schedulePlan", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
61 60 private List<SchedulePlanInfo> schedulePlanInfoList = new ArrayList<>();
62 61  
63   - /** 创建人 */
64   - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
65   - private SysUser createBy;
66   - /** 修改人 */
67   - @ManyToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY)
68   - private SysUser updateBy;
69   - /** 创建日期 */
70   - @Column(updatable = false, name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
71   - private Date createDate;
72   - /** 修改日期 */
73   - @Column(name = "update_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
74   - private Date updateDate;
75   -
76 62 public Long getId() {
77 63 return id;
78 64 }
... ... @@ -129,38 +115,6 @@ public class SchedulePlan {
129 115 this.schedulePlanInfoList = schedulePlanInfoList;
130 116 }
131 117  
132   - public SysUser getCreateBy() {
133   - return createBy;
134   - }
135   -
136   - public void setCreateBy(SysUser createBy) {
137   - this.createBy = createBy;
138   - }
139   -
140   - public SysUser getUpdateBy() {
141   - return updateBy;
142   - }
143   -
144   - public void setUpdateBy(SysUser updateBy) {
145   - this.updateBy = updateBy;
146   - }
147   -
148   - public Date getCreateDate() {
149   - return createDate;
150   - }
151   -
152   - public void setCreateDate(Date createDate) {
153   - this.createDate = createDate;
154   - }
155   -
156   - public Date getUpdateDate() {
157   - return updateDate;
158   - }
159   -
160   - public void setUpdateDate(Date updateDate) {
161   - this.updateDate = updateDate;
162   - }
163   -
164 118 public String getTtInfoNames() {
165 119 return ttInfoNames;
166 120 }
... ...
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
... ... @@ -157,9 +157,13 @@ public class SchedulePlanInfo {
157 157 Line xl,
158 158 ScheduleResult_output scheduleResult_output,
159 159 TTInfoDetail ttInfoDetail,
  160 + Boolean isFb,
160 161 CarConfigInfo carConfigInfo,
161 162 List<EmployeeConfigInfo> employeeConfigInfoList,
162   - SchedulePlan schedulePlan) {
  163 + SchedulePlan schedulePlan,
  164 + boolean isFirstBc, // 是否第一个班次
  165 + boolean isLastBc // 是否最后一个班次
  166 + ) {
163 167  
164 168 // TODO:关联的公司名称
165 169 // TODO:关联的公司编码
... ... @@ -191,7 +195,7 @@ public class SchedulePlanInfo {
191 195 // TODO:报道时间,出场时间没有
192 196 // 关联的驾驶员
193 197 EmployeeConfigInfo employeeConfigInfo = null;
194   - if (ttInfoDetail.getIsFB()) {
  198 + if (isFb) {
195 199 if (employeeConfigInfoList.size() > 1) {
196 200 employeeConfigInfo = employeeConfigInfoList.get(1);
197 201 } else {
... ... @@ -265,6 +269,47 @@ public class SchedulePlanInfo {
265 269 // 使用的时刻表名字
266 270 this.ttInfoName = ttInfoDetail.getTtinfo().getName();
267 271  
  272 + // 使用车辆配置的停车场信息
  273 + String pzType = carConfigInfo.getPzType(); // 配置类型
  274 + if (pzType != null && !pzType.equals("BSY")) {
  275 + if ("ZW".equals(pzType)) { // 只看早晚进出场
  276 + if (isFirstBc) { // 第一个班次是出场
  277 + this.qdz = carConfigInfo.getTcc().getId(); // 起点站-停车场id
  278 + this.qdzCode = carConfigInfo.getTcc().getParkCode(); // 起点站-停车场code
  279 + this.qdzName = carConfigInfo.getTcc().getParkName(); // 起点站-停车场name
  280 +
  281 + this.jhlc = "0".equals(this.xlDir) ? carConfigInfo.getUpOutLc() : carConfigInfo.getDownOutLc();
  282 + this.bcsj = "0".equals(this.xlDir) ? carConfigInfo.getUpOutSj().intValue() : carConfigInfo.getDownOutSj().intValue();
  283 +
  284 + } else if (isLastBc) { // 最后一个班次是进场
  285 + this.zdz = carConfigInfo.getTcc().getId(); // 终点站-停车场id
  286 + this.zdzCode = carConfigInfo.getTcc().getParkCode(); // 终点站-停车场code
  287 + this.zdzName = carConfigInfo.getTcc().getParkName(); // 终点站-停车场name
  288 +
  289 + this.jhlc = "0".equals(this.xlDir) ? carConfigInfo.getUpInLc() : carConfigInfo.getDownInLc();
  290 + this.bcsj = "0".equals(this.xlDir) ? carConfigInfo.getUpInSj().intValue() : carConfigInfo.getDownInSj().intValue();
  291 + }
  292 +
  293 + } else if ("FS".equals(pzType)) { // 所有进出场
  294 + if ("out".equals(this.bcType)) { // 出场班次
  295 + this.qdz = carConfigInfo.getTcc().getId(); // 起点站-停车场id
  296 + this.qdzCode = carConfigInfo.getTcc().getParkCode(); // 起点站-停车场code
  297 + this.qdzName = carConfigInfo.getTcc().getParkName(); // 起点站-停车场name
  298 +
  299 + this.jhlc = "0".equals(this.xlDir) ? carConfigInfo.getUpOutLc() : carConfigInfo.getDownOutLc();
  300 + this.bcsj = "0".equals(this.xlDir) ? carConfigInfo.getUpOutSj().intValue() : carConfigInfo.getDownOutSj().intValue();
  301 +
  302 + } else if ("in".equals(this.bcType)) {
  303 + this.zdz = carConfigInfo.getTcc().getId(); // 终点站-停车场id
  304 + this.zdzCode = carConfigInfo.getTcc().getParkCode(); // 终点站-停车场code
  305 + this.zdzName = carConfigInfo.getTcc().getParkName(); // 终点站-停车场name
  306 +
  307 + this.jhlc = "0".equals(this.xlDir) ? carConfigInfo.getUpInLc() : carConfigInfo.getDownInLc();
  308 + this.bcsj = "0".equals(this.xlDir) ? carConfigInfo.getUpInSj().intValue() : carConfigInfo.getDownInSj().intValue();
  309 + }
  310 + }
  311 + }
  312 +
268 313 }
269 314  
270 315  
... ...
src/main/java/com/bsth/entity/schedule/rule/ScheduleRule1Flat.java
... ... @@ -71,7 +71,7 @@ public class ScheduleRule1Flat extends BEntity {
71 71 @NotNull
72 72 private Integer ryStart;
73 73  
74   - /** 翻班格式(TODO:这个用在车子上的,暂时不管)*/
  74 + /** 翻班格式(类似格式:1110011)*/
75 75 private String fbgs;
76 76  
77 77 public Long getId() {
... ...
src/main/java/com/bsth/entity/sys/RealControAuthority.java 0 → 100644
  1 +package com.bsth.entity.sys;
  2 +
  3 +import javax.persistence.*;
  4 +
  5 +/**
  6 + * 线调权限配置
  7 + * Created by panzhao on 2017/2/14.
  8 + */
  9 +@Entity
  10 +@Table(name = "bsth_c_real_control_authority")
  11 +public class RealControAuthority {
  12 +
  13 + @Id
  14 + private Integer userId;
  15 +
  16 + /**
  17 + * 可调度的线路 , 分隔多个
  18 + */
  19 + @Column(length = 4000)
  20 + private String lineCodeStr;
  21 +
  22 + /**
  23 + * 调度模式 0: 监控模式 1:主调模式
  24 + */
  25 + private int pattern;
  26 +
  27 + public Integer getUserId() {
  28 + return userId;
  29 + }
  30 +
  31 + public void setUserId(Integer userId) {
  32 + this.userId = userId;
  33 + }
  34 +
  35 + public String getLineCodeStr() {
  36 + return lineCodeStr;
  37 + }
  38 +
  39 + public void setLineCodeStr(String lineCodeStr) {
  40 + this.lineCodeStr = lineCodeStr;
  41 + }
  42 +
  43 + public int getPattern() {
  44 + return pattern;
  45 + }
  46 +
  47 + public void setPattern(int pattern) {
  48 + this.pattern = pattern;
  49 + }
  50 +}
... ...
src/main/java/com/bsth/entity/sys/UserLine.java
1 1 package com.bsth.entity.sys;
2 2  
3   -import javax.persistence.Entity;
4   -import javax.persistence.GeneratedValue;
5   -import javax.persistence.GenerationType;
6   -import javax.persistence.Id;
7   -import javax.persistence.ManyToOne;
8   -import javax.persistence.Table;
9   -
10 3 import com.bsth.entity.Line;
11 4  
  5 +import javax.persistence.*;
  6 +
12 7 /**
13 8 *
14 9 * @ClassName: Line(用户线路分配实体类)
... ... @@ -20,6 +15,8 @@ import com.bsth.entity.Line;
20 15 * @Date 2016年8月26日 09:03:33
21 16 *
22 17 * @Version 公交调度系统BS版 0.1
  18 + *
  19 + * PS:这个类缺少主调监控模式的配置,暂不使用
23 20 *
24 21 */
25 22  
... ...
src/main/java/com/bsth/filter/BaseFilter.java
... ... @@ -16,7 +16,7 @@ public abstract class BaseFilter implements Filter {
16 16 /**
17 17 * 白名单
18 18 */
19   - private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA,
  19 + private String[] whiteListURLs = { Constants.LOGIN_PAGE,Constants.CAPTCHA, Constants.SERVICE_INTERFACE,
20 20 Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.METRONIC_URL, Constants.LOGIN, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS };
21 21  
22 22 @Override
... ...
src/main/java/com/bsth/filter/ResourceFilter.java
1 1 package com.bsth.filter;
2 2  
3   -import java.io.File;
4   -import java.io.IOException;
  3 +import com.bsth.util.RequestUtils;
  4 +import org.apache.commons.lang3.StringUtils;
5 5  
6 6 import javax.servlet.FilterChain;
7 7 import javax.servlet.ServletException;
8 8 import javax.servlet.http.HttpServletRequest;
9 9 import javax.servlet.http.HttpServletResponse;
10   -
11   -import org.apache.commons.lang3.StringUtils;
12   -
13   -import com.bsth.util.RequestUtils;
  10 +import java.io.File;
  11 +import java.io.IOException;
14 12  
15 13 /**
16   - *
  14 + * @author PanZhao
17 15 * @ClassName: ResourceFilter
18 16 * @Description: TODO(HTML片段过滤器)
19   - * @author PanZhao
20 17 * @date 2016年3月19日 下午10:10:11
21   - *
22 18 */
23 19 public class ResourceFilter extends BaseFilter {
24   -
25   - String[] params = new String[]{"no"};
26 20  
27   - @Override
28   - public void doFilter(HttpServletRequest request,
29   - HttpServletResponse response, FilterChain chain)
30   - throws IOException, ServletException {
31   -
32   - String uri = request.getRequestURI();
33   - int len = uri.length();
34   - if (RequestUtils.isAjaxRequest(request) ||
35   - !uri.substring(len - 5, len).equals(".html")) {
36   - super.doFilter(request, response, chain);
37   - } else {
38   -
39   - String fPath = this.getClass().getResource("/").getPath()
40   - + "static/" + uri;
41   -
42   - File f = new File(fPath);
43   -
44   -
45   - if (f.exists() && f.isFile() ){
46   - request.getRequestDispatcher("/?initFragment=" + joinParam(request)).forward(request, response);;
47   - }else
48   - response.sendRedirect("/");
49   - }
50   - }
51   -
52   - /**
53   - * 拼接参数
54   - * @param request
55   - * @return
56   - */
57   - public String joinParam(HttpServletRequest request){
58   -
59   - StringBuilder sb = new StringBuilder();
60   -
61   - String v
62   - ,url = request.getRequestURI();
63   - for(String p : params){
64   - v = request.getParameter(p);
65   - if(!StringUtils.isEmpty(v))
66   - sb.append("&" + p + "=" + v);
67   - }
68   -
69   - if(sb.length() > 0)
70   - url += "?" + sb.substring(1, sb.length());
71   - return url;
72   - }
  21 + String[] params = new String[]{"no"};
  22 +
  23 + @Override
  24 + public void doFilter(HttpServletRequest request,
  25 + HttpServletResponse response, FilterChain chain)
  26 + throws IOException, ServletException {
  27 +
  28 + String uri = request.getRequestURI();
  29 + String origin = request.getParameter("origin");
  30 + int len = uri.length();
  31 + if (RequestUtils.isAjaxRequest(request)
  32 + || (origin != null && origin.equals("real_control_iframe"))//来自线调 iframe 的请求
  33 + || !uri.substring(len - 5, len).equals(".html")) {
  34 + super.doFilter(request, response, chain);
  35 + } else {
  36 +
  37 + String fPath = this.getClass().getResource("/").getPath()
  38 + + "static/" + uri;
  39 +
  40 + File f = new File(fPath);
  41 +
  42 +
  43 + if (f.exists() && f.isFile()) {
  44 + request.getRequestDispatcher("/?initFragment=" + joinParam(request)).forward(request, response);
  45 + } else
  46 + response.sendRedirect("/");
  47 + }
  48 + }
  49 +
  50 + /**
  51 + * 拼接参数
  52 + *
  53 + * @param request
  54 + * @return
  55 + */
  56 + public String joinParam(HttpServletRequest request) {
  57 +
  58 + StringBuilder sb = new StringBuilder();
  59 +
  60 + String v, url = request.getRequestURI();
  61 + for (String p : params) {
  62 + v = request.getParameter(p);
  63 + if (!StringUtils.isEmpty(v))
  64 + sb.append("&" + p + "=" + v);
  65 + }
  66 +
  67 + if (sb.length() > 0)
  68 + url += "?" + sb.substring(1, sb.length());
  69 + return url;
  70 + }
73 71 }
... ...
src/main/java/com/bsth/repository/CarsRepository.java
... ... @@ -12,4 +12,7 @@ public interface CarsRepository extends BaseRepository&lt;Cars, Integer&gt;{
12 12  
13 13 @Query(value="select s from Cars s where s.id in(select e.cl.id from CarConfigInfo e where e.xl.id = ?1) ")
14 14 List<Cars> findCarsByLineId(Integer lineId);
  15 +
  16 + @Query(value="select s from Cars s")
  17 + List<Cars> findCars();
15 18 }
... ...
src/main/java/com/bsth/repository/logger/MileModifyRepository.java 0 → 100644
  1 +package com.bsth.repository.logger;
  2 +
  3 +import com.bsth.entity.logger.Logger_MileModify;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +/**
  8 + * Created by panzhao on 2017/3/6.
  9 + */
  10 +@Repository
  11 +public interface MileModifyRepository extends BaseRepository<Logger_MileModify, Long>{
  12 +}
... ...
src/main/java/com/bsth/repository/oil/CdlRepository.java 0 → 100644
  1 +package com.bsth.repository.oil;
  2 +
  3 +
  4 +
  5 +import java.util.List;
  6 +
  7 +import org.springframework.data.jpa.repository.Modifying;
  8 +import org.springframework.data.jpa.repository.Query;
  9 +import org.springframework.stereotype.Repository;
  10 +import org.springframework.transaction.annotation.Transactional;
  11 +
  12 +import com.bsth.entity.oil.Cdl;
  13 +import com.bsth.entity.oil.Cyl;
  14 +import com.bsth.repository.BaseRepository;
  15 +
  16 +@Repository
  17 +public interface CdlRepository extends BaseRepository<Cdl, Integer>{
  18 + @Transactional
  19 + @Modifying
  20 + @Query(value="SELECT * FROM bsth_c_cdl ",nativeQuery=true)
  21 + List<Cdl> obtainCdl();
  22 +}
... ...
src/main/java/com/bsth/repository/oil/CylRepository.java
1 1 package com.bsth.repository.oil;
2 2  
3 3  
  4 +import java.util.List;
  5 +
  6 +import org.springframework.data.jpa.repository.Modifying;
  7 +import org.springframework.data.jpa.repository.Query;
4 8 import org.springframework.stereotype.Repository;
  9 +import org.springframework.transaction.annotation.Transactional;
  10 +
5 11 import com.bsth.entity.oil.Cyl;
6 12 import com.bsth.repository.BaseRepository;
7 13  
8 14 @Repository
9 15 public interface CylRepository extends BaseRepository<Cyl, Integer>{
10   -
  16 + @Transactional
  17 + @Modifying
  18 + @Query(value="SELECT * FROM bsth_c_cyl where nbbm like %?1% and gsdm like %?2%",nativeQuery=true)
  19 + List<Cyl> obtainCyl(String nbbm,String gsdm);
11 20 }
... ...
src/main/java/com/bsth/repository/oil/DlbRepository.java 0 → 100644
  1 +package com.bsth.repository.oil;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.springframework.data.jpa.repository.Modifying;
  6 +import org.springframework.data.jpa.repository.Query;
  7 +import org.springframework.stereotype.Repository;
  8 +import org.springframework.transaction.annotation.Transactional;
  9 +
  10 +import com.bsth.entity.oil.Dlb;
  11 +import com.bsth.entity.oil.Ylb;
  12 +import com.bsth.repository.BaseRepository;
  13 +
  14 +@Repository
  15 +public interface DlbRepository extends BaseRepository<Dlb, Integer>{
  16 + /**
  17 + * 前一天DLB信息
  18 + * @param rq
  19 + * @return
  20 + */
  21 + @Transactional
  22 + @Modifying
  23 + @Query(value="SELECT a.* FROM bsth_c_dlb a where to_days(?1)-to_days(a.rq)=1"
  24 + + " and jcsx=(select max(b.jcsx) from bsth_c_dlb b where a.nbbm=b.nbbm and "
  25 + + " to_days(?1)-to_days(b.rq)=1 )",nativeQuery=true)
  26 + List<Dlb> obtainYlbefore(String rq);
  27 + /**
  28 + * 当天DLB信息
  29 + * @param rq
  30 + * @return
  31 + */
  32 + @Transactional
  33 + @Modifying
  34 + @Query(value="SELECT * FROM bsth_c_dlb where to_days(?)=to_days(rq)",nativeQuery=true)
  35 + List<Dlb> obtainDl(String rq);
  36 +
  37 +}
... ...
src/main/java/com/bsth/repository/oil/JdlRepository.java 0 → 100644
  1 +package com.bsth.repository.oil;
  2 +
  3 +
  4 +import java.util.List;
  5 +
  6 +import org.springframework.data.jpa.repository.Modifying;
  7 +import org.springframework.data.jpa.repository.Query;
  8 +import org.springframework.stereotype.Repository;
  9 +import org.springframework.transaction.annotation.Transactional;
  10 +
  11 +import com.bsth.entity.oil.Jdl;
  12 +import com.bsth.repository.BaseRepository;
  13 +
  14 +@Repository
  15 +public interface JdlRepository extends BaseRepository<Jdl, Integer>{
  16 +
  17 + @Transactional
  18 + @Modifying
  19 + @Query(value="INSERT INTO bsth_c_jdl("+
  20 + "gs_bm, gs_name, fgs_bm, fgs_name, rq, nbbm, jdl, jdz, remarks, creater_date)" +
  21 + " VALUES(" +
  22 + "?1,?2,?3,?4,str_to_date(?5,'%Y-%m-%d'),?6,?7,?8,?9,str_to_date(?10,'%Y-%m-%d %H:%i:%s'))", nativeQuery=true)
  23 + void insertData(String gsbm, String gsName, String fgsbm, String fgsName, String rq, String nbbm, String jdl, String jdz, String remarks, String createrDate);
  24 +
  25 + @Transactional
  26 + @Modifying
  27 + @Query(value="SELECT * FROM bsth_c_jdl where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm like %?4%",nativeQuery=true)
  28 + List<Jdl> query(String gsbm, String fgsbm, String rq, String nbbm);
  29 +
  30 +
  31 + @Transactional
  32 + @Modifying
  33 + @Query(value="SELECT * FROM bsth_c_jdl where rq = ?",nativeQuery=true)
  34 + List<Jdl> JdlList( String rq);
  35 +
  36 + @Transactional
  37 + @Modifying
  38 + @Query(value="SELECT jdl FROM bsth_c_jdl where gs_bm = ?1 and fgs_bm = ?2 and rq = ?3 and nbbm = ?4 and jdz = ?5",nativeQuery=true)
  39 + List<Double> queryBySame(String gsbm, String fgsbm, String rq, String nbbm, String jdz);
  40 +
  41 + @Transactional
  42 + @Modifying
  43 + @Query(value="UPDATE bsth_c_jdl set jdl = ?1 where gs_bm = ?2 and fgs_bm = ?3 and rq = ?4 and nbbm = ?5 and jdz = ?6",nativeQuery=true)
  44 + void UpdateJdl(String jdl, String gsbm, String fgsbm, String rq, String nbbm, String jdz);
  45 +
  46 +}
... ...
src/main/java/com/bsth/repository/oil/YlbRepository.java
... ... @@ -23,8 +23,9 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
23 23 @Modifying
24 24 @Query(value="SELECT a.* FROM bsth_c_ylb a where to_days(?1)-to_days(a.rq)=1"
25 25 + " and jcsx=(select max(b.jcsx) from bsth_c_ylb b where a.nbbm=b.nbbm and "
26   - + " to_days(?1)-to_days(b.rq)=1 )",nativeQuery=true)
27   - List<Ylb> obtainYlbefore(String rq);
  26 + + " to_days(?1)-to_days(b.rq)=1 ) and ssgsdm like %?2% and fgsdm like %?3% and "
  27 + + " xlbm like %?4% and nbbm like %?5% ",nativeQuery=true)
  28 + List<Ylb> obtainYlbefore(String rq,String gsbm,String fgsbm,String xlbm,String nbbm);
28 29  
29 30 /**
30 31 * 当天YLB信息
... ... @@ -33,10 +34,16 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
33 34 */
34 35 @Transactional
35 36 @Modifying
36   - @Query(value="SELECT * FROM bsth_c_ylb where to_days(?)=to_days(rq)",nativeQuery=true)
37   - List<Ylb> obtainYl(String rq);
  37 + @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and ssgsdm like %?2% "
  38 + + " and fgsdm like %?3%"
  39 + + " and xlbm like %?4% and nbbm like %?5% order by ?6 asc ",nativeQuery=true)
  40 + List<Ylb> obtainYl(String rq,String gsdm,String fgsdm,String xlbm,String nbbm,String px);
38 41  
39 42  
  43 + @Transactional
  44 + @Modifying
  45 + @Query(value="SELECT * FROM bsth_c_ylb where to_days(?1)=to_days(rq) and nbbm =?2 and jsy=?3",nativeQuery=true)
  46 + List<Ylb> queryListYlb(String rq,String nbbm,String jgh);
40 47 /**
41 48 * 查询当天总的加注量和总里程
42 49 * @param rq
... ... @@ -44,6 +51,6 @@ public interface YlbRepository extends BaseRepository&lt;Ylb, Integer&gt;{
44 51 */
45 52 @Transactional
46 53 @Modifying
47   - @Query(value="select sum(jzl) as jzl,sum(zlc) as zlc from bsth_c_ylb where nbbm=?1 and rq=?2",nativeQuery=true)
48   - List<Object[]> sumLcYl(String nbbm,Date rq);
  54 + @Query(value="select sum(jzl) as jzl,sum(zlc) as zlc ,sum(sh) as sh from bsth_c_ylb where nbbm=?1 and rq=?2 and xlbm like %?3%",nativeQuery=true)
  55 + List<Object[]> sumLcYl(String nbbm,Date rq,String xlbm);
49 56 }
... ...
src/main/java/com/bsth/repository/oil/YlxxbRepository.java
... ... @@ -19,8 +19,13 @@ public interface YlxxbRepository extends BaseRepository&lt;Ylxxb, Integer&gt;{
19 19 */
20 20 @Transactional
21 21 @Modifying
22   - @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?)=to_days(yyrq)",nativeQuery=true)
23   - List<Ylxxb> obtainYlxx(String rq);
  22 + @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and nylx=?2 and gsdm like %?3%",nativeQuery=true)
  23 + List<Ylxxb> obtainYlxx(String rq,int nylx,String gsdm);
  24 +
  25 + @Transactional
  26 + @Modifying
  27 + @Query(value="SELECT * FROM bsth_c_ylxxb where to_days(?1)=to_days(yyrq) and ssgs=?2",nativeQuery=true)
  28 + List<Ylxxb> checkYlxx(String rq,String gs);
24 29  
25 30 @Transactional
26 31 @Modifying
... ...
src/main/java/com/bsth/repository/realcontrol/OilStationSocietyRepository.java 0 → 100644
  1 +package com.bsth.repository.realcontrol;
  2 +
  3 +import com.bsth.entity.realcontrol.OilStationSociety;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.stereotype.Repository;
  6 +
  7 +/**
  8 + * Created by panzhao on 2017/3/16.
  9 + */
  10 +@Repository
  11 +public interface OilStationSocietyRepository extends BaseRepository<OilStationSociety, String>{
  12 +}
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -30,7 +30,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
30 30  
31 31 @Query(value="select min(s.id), s.jGh,s.clZbh,s.lpName,s.jName from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.jGh,s.clZbh,s.lpName ,s.jName order by (lpName+1)")
32 32 List<ScheduleRealInfo> queryUserInfo2(String line,String date);
33   -
  33 +
34 34 @Query(value="select min(s.id), s.clZbh from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.clZbh ")
35 35 List<ScheduleRealInfo> queryUserInfo3(String line,String date);
36 36  
... ... @@ -92,7 +92,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
92 92 @Query(value="select s from ScheduleRealInfo s where s.clZbh = ?1 and s.scheduleDate = str_to_date(?2,'%Y-%m-%d') and xlBm =?3 order by realExecDate,fcsj")
93 93 List<ScheduleRealInfo> queryListWaybill2(String clZbh,String date,String line);
94 94  
95   - @Query(value="select s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') order by realExecDate,fcsj")
  95 + @Query(value="select s from ScheduleRealInfo s where s.jGh like %?1% and s.clZbh like %?2% and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') order by realExecDate,fcsj")
96 96 List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date);
97 97  
98 98 @Query(value="select s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between str_to_date(?3,'%Y-%m-%d') and str_to_date(?4,'%Y-%m-%d') order by bcs")
... ... @@ -114,14 +114,25 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
114 114 void deleteByLineCodeAndDate(String xlBm, String schDate);
115 115  
116 116 //去掉了 xlBm is not null
117   - @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj")
  117 + @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.realExecDate,s.fcsj, (s.lpName+1)")
118 118 List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date);
119 119  
  120 + @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj")
  121 + List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date);
  122 +
120 123 @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.bcType not in ('in','out') order by s.xlBm")
121 124 List<ScheduleRealInfo> scheduleByDateAndLine2(String line,String date);
  125 +
  126 + //按月统计
  127 + @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m') = ?2 and s.bcType not in ('in','out') order by s.xlBm")
  128 + List<ScheduleRealInfo> scheduleByDateAndLine3(String line,String date);
  129 +
  130 + //按照时间段统计
  131 + @Query(value="select s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm")
  132 + List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2);
122 133  
123   - @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY realExecDate,fcsj,xlBm,clZbh")
124   - List<Map<String,Object>> yesterdayDataList(String line,String date);
  134 + @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY xlBm,clZbh")
  135 + List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm);
125 136  
126 137 @Query(value="select s from ScheduleRealInfo s where DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?1 ORDER BY xlBm,lpName,clZbh,xlDir")
127 138 List<ScheduleRealInfo> setLD(String date);
... ...
src/main/java/com/bsth/repository/schedule/GuideboardInfoRepository.java
... ... @@ -3,6 +3,7 @@ package com.bsth.repository.schedule;
3 3 import java.util.List;
4 4 import java.util.Map;
5 5  
  6 +import com.bsth.entity.Line;
6 7 import com.bsth.entity.schedule.EmployeeConfigInfo;
7 8 import com.bsth.entity.schedule.GuideboardInfo;
8 9 import com.bsth.repository.BaseRepository;
... ... @@ -37,4 +38,8 @@ public interface GuideboardInfoRepository extends BaseRepository&lt;GuideboardInfo,
37 38 "where td.ttinfo.id=?1 " +
38 39 "group by td.ttinfo.id, td.lp.id, td.lp.lpName")
39 40 List<Map<String, Object>> findLpName(Long ttid);
  41 +
  42 + @Query(value = "SELECT g FROM GuideboardInfo g where g.xl =?1 and g.lpName = ?2 and g.lpNo = ?3 and lpType =?4 and isCancel = 0")
  43 + List<GuideboardInfo> validateLp(Line xl,String lpName , int lpNo,String lpType);
  44 +
40 45 }
... ...
src/main/java/com/bsth/repository/schedule/SchedulePlanInfoRepository.java
... ... @@ -27,26 +27,29 @@ public interface SchedulePlanInfoRepository extends BaseRepository&lt;SchedulePlanI
27 27 Long deleteByXlAndScheduleDateGreaterThanEqualAndScheduleDateLessThanEqual(Integer xlid, Date startDate, Date endDate);
28 28  
29 29 @Query(value = " select " +
30   - "xl as xlId, " +
31   - "xl_name as xlName, " +
32   - "schedule_date as scheduleDate, " +
33   - "lp_name as lpName, " +
34   - "cl as clId, " +
35   - "cl_zbh as clZbh, " +
36   - "group_concat(distinct fcsj) ccsj, " +
37   - "group_concat(distinct j) jsyId, " +
38   - "group_concat(distinct j_gh) jsyGh, " +
39   - "group_concat(distinct j_name) jsyName, " +
40   - "group_concat(distinct s) spyId, " +
41   - "group_concat(distinct s_gh) spyGh, " +
42   - "group_concat(distinct s_name) spyName, " +
43   - "max(create_date) as createDate " +
44   - "from bsth_c_s_sp_info " +
45   - "where bc_type = 'out' and " +
46   - "xl = ?1 and " +
47   - "schedule_date = ?2 " +
48   - "group by xl_name, schedule_date, lp, lp_name, cl, cl_zbh " +
49   - "order by xl_name, schedule_date, lp ", nativeQuery = true)
  30 + "info.xl as xlId, " +
  31 + "info.xl_name as xlName, " +
  32 + "info.schedule_date as scheduleDate, " +
  33 + "info.lp_name as lpName, " +
  34 + "info.cl as clId, " +
  35 + "info.cl_zbh as clZbh, " +
  36 + "group_concat(info.fcsj) ccsj, " +
  37 + "group_concat(info.bc_type) bctype, " +
  38 + "group_concat(distinct info.j) jsyId, " +
  39 + "group_concat(distinct info.j_gh) jsyGh, " +
  40 + "group_concat(distinct info.j_name) jsyName, " +
  41 + "group_concat(distinct info.s) spyId, " +
  42 + "group_concat(distinct info.s_gh) spyGh, " +
  43 + "group_concat(distinct info.s_name) spyName, " +
  44 + "group_concat(info.fcno) fcno, " +
  45 + "max(info.update_date) as updateDate, " +
  46 + "max(user.user_name) as updateUserName, " +
  47 + "max(info.tt_info_name) as ttInfoName " +
  48 + "from bsth_c_s_sp_info info left join bsth_c_sys_user user on info.update_by = user.id " +
  49 + "where info.xl = ?1 and " +
  50 + "info.schedule_date = ?2 " +
  51 + "group by info.xl_name, info.schedule_date, info.lp, info.lp_name, info.cl, info.cl_zbh " +
  52 + "order by info.xl_name, info.schedule_date, info.lp ", nativeQuery = true)
50 53 List<Object[]> findGroupInfo(Integer xlid, Date scheduleDate);
51 54  
52 55 @Modifying
... ... @@ -71,14 +74,16 @@ public interface SchedulePlanInfoRepository extends BaseRepository&lt;SchedulePlanI
71 74 "scpinfo.scheduleDate = :p3 and " +
72 75 "scpinfo.lpName = :p4 and " +
73 76 "scpinfo.fcsj = :p5 and " +
74   - "scpinfo.bcType = :p6 ")
  77 + "scpinfo.bcType = :p6 and " +
  78 + "scpinfo.fcno = :p7 " )
75 79 int updateGroupInfo_type_2_4(
76 80 @Param("p1") String fcsj,
77 81 @Param("p2") Integer xlid,
78 82 @Param("p3") Date scheduleDate,
79 83 @Param("p4") String lpName,
80 84 @Param("p5") String fcsj_src,
81   - @Param("p6") String bcType);
  85 + @Param("p6") String bcType,
  86 + @Param("p7") Integer fcno);
82 87  
83 88 @Modifying
84 89 @Query(value = "update " +
... ...
src/main/java/com/bsth/repository/sys/RealControAuthorityRepository.java 0 → 100644
  1 +package com.bsth.repository.sys;
  2 +
  3 +import com.bsth.entity.sys.RealControAuthority;
  4 +import com.bsth.repository.BaseRepository;
  5 +import org.springframework.data.jpa.repository.Query;
  6 +import org.springframework.stereotype.Repository;
  7 +
  8 +/**
  9 + * Created by panzhao on 2017/2/14.
  10 + */
  11 +@Repository
  12 +public interface RealControAuthorityRepository extends BaseRepository<RealControAuthority, Integer>{
  13 +
  14 + @Query("select t from RealControAuthority t where t.userId=?1")
  15 + RealControAuthority findByUserId(Integer userId);
  16 +}
... ...
src/main/java/com/bsth/security/WebSecurityConfig.java
... ... @@ -36,7 +36,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
36 36 public void configure(WebSecurity web) throws Exception {
37 37 // 白名单
38 38 web.ignoring().antMatchers(Constants.LOGIN_PAGE, Constants.LOGIN, Constants.ASSETS_URL, Constants.FAVICON_URL, Constants.CAPTCHA,
39   - Constants.METRONIC_URL, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS);
  39 + Constants.SERVICE_INTERFACE, Constants.METRONIC_URL, Constants.LOGIN_FAILURE, Constants.UPSTREAM_URL, Constants.XD_CHILD_PAGES, Constants.XD_REAL_GPS);
40 40 }
41 41  
42 42 @Override
... ... @@ -54,14 +54,13 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
54 54 //指定登录页
55 55 .loginPage(Constants.LOGIN_PAGE)
56 56 .loginProcessingUrl(Constants.LOGIN).permitAll()
57   - //.failureUrl(Constants.LOGIN_PAGE + "?error=true")登录失败跳转的链接
58   - //.successHandler(loginSuccessHandler())登录成功后处理
59 57 .and().logout()
60   - //.addLogoutHandler(logoutHandler())
61 58 //禁用CXRF
62 59 .and().csrf().disable()
63 60 //禁用匿名用户功能
64   - .anonymous().disable();
  61 + .anonymous().disable()
  62 + //允许同源 iframe
  63 + .headers().frameOptions().sameOrigin().httpStrictTransportSecurity().disable();
65 64  
66 65 // 同时只保持一个回话
67 66 http.sessionManagement().maximumSessions(1)
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -2,6 +2,7 @@ package com.bsth.service.forms.impl;
2 2  
3 3 import java.sql.ResultSet;
4 4 import java.sql.SQLException;
  5 +import java.text.DecimalFormat;
5 6 import java.text.NumberFormat;
6 7 import java.text.ParseException;
7 8 import java.text.SimpleDateFormat;
... ... @@ -23,6 +24,7 @@ import com.bsth.entity.mcy_forms.Singledata;
23 24 import com.bsth.entity.mcy_forms.Turnoutrate;
24 25 import com.bsth.entity.mcy_forms.Vehicleloading;
25 26 import com.bsth.entity.mcy_forms.Waybillday;
  27 +import com.bsth.data.BasicData;
26 28 import com.bsth.entity.mcy_forms.Allline;
27 29 import com.bsth.entity.mcy_forms.Changetochange;
28 30 import com.bsth.entity.mcy_forms.Daily;
... ... @@ -47,33 +49,33 @@ public class FormsServiceImpl implements FormsService {
47 49 @Override
48 50 public List<Waybillday> waybillday(Map<String, Object> map) {
49 51  
50   - String sql ="select x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name "
51   - + " from bsth_c_s_sp_info_real x INNER join "
52   - + " ( select y.RQ,y.XLBM,y.NBBM,y.JSY,y.JZL,y.YH,c.personnel_name from"
53   - + " bsth_c_ylb y LEFT JOIN bsth_c_personnel c ON c.job_code=y.JSY "
54   - + " where 1=1 ";
55   - if(map.get("date").toString()!=""){
56   - sql+=" and to_days(y.RQ)=to_days('"+map.get("date").toString() + "') ";
57   - }
58   - if( map.get("line").toString()!=""){
59   - sql+=" and y.XLBM= '"+ map.get("line").toString()+"' GROUP BY y.NBBM) ";
60   - }
61   - sql+= " z on x.cl_zbh=z.nbbm where to_days( x.schedule_date)=to_days('"+map.get("date").toString()+"') ";
62   - if(map.get("gsdmWaybillday").toString()!=""){
63   - sql+=" and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"'";
64   - }
65   - if(map.get("fgsdmWaybillday").toString()!=""){
66   - sql+=" and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"'";
67   - }
68   - sql += " GROUP BY x.j_gh,x.cl_zbh,z.JZL,z.YH,z.personnel_name,x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name ";
  52 +
  53 +
  54 + String sql=" select t.*,z.jzl,z.yh from ("
  55 + + " select x.j_gh,x.cl_zbh,x.j_name,x.schedule_date,"
  56 + + " x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name from bsth_c_s_sp_info_real x "
  57 + + " where to_days( x.schedule_date)=to_days('"+map.get("date").toString() + "') "
  58 + + " and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"' "
  59 + + " and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"' "
  60 + + " and xl_bm like '%"+ map.get("line").toString().trim()+"%'"
  61 + + " GROUP BY x.j_gh,x.cl_zbh,x.j_name,"
  62 + + " x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name ) t"
  63 + + " LEFT join (select y.rq,y.xlbm,y.nbbm,y.jsy,y.jzl,y.yh from"
  64 + + " bsth_c_ylb y where 1=1 "
  65 + + " and to_days(y.RQ)=to_days('"+map.get("date").toString() + "') "
  66 + + " and y.XLBM like '%"+ map.get("line").toString().trim()+"%'"
  67 + + " and y.ssgsdm='"+map.get("gsdmWaybillday").toString()+"'"
  68 + + " and y.fgsdm='"+map.get("gsdmWaybillday").toString()+"') z "
  69 + + " on t.cl_zbh=z.nbbm ";
  70 +
69 71 List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() {
70 72 @Override
71 73 public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException {
72 74 Waybillday wbd = new Waybillday();
73 75 wbd.setCarPlate(arg0.getString("cl_zbh"));
74   - wbd.setJzl(arg0.getString("JZL"));
75   - wbd.setYh(arg0.getString("YH"));
76   - wbd.setjName(arg0.getString("personnel_name"));
  76 + wbd.setJzl(arg0.getString("jzl"));
  77 + wbd.setYh(arg0.getString("yh"));
  78 + wbd.setjName(arg0.getString("j_name"));
77 79 wbd.setRq(arg0.getString("schedule_date"));
78 80 wbd.setJgh(arg0.getString("j_gh"));
79 81 return wbd;
... ... @@ -193,7 +195,15 @@ public class FormsServiceImpl implements FormsService {
193 195 // 班次车辆人员日统计
194 196 @Override
195 197 public List<Shifday> shifday(Map<String, Object> map) {
196   - String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,"
  198 +
  199 + String sql ="select t.* from (select r.schedule_date,r.j_name,IFNULL(r.s_name,'')as s_name,"
  200 + + " r.cl_zbh,r.xl_bm, r.j_gh,r.gs_bm,r.fgs_bm FROM bsth_c_s_sp_info_real r where 1=1 "
  201 + + " and to_days(r.schedule_date)=to_days('"+ map.get("date").toString() + "') "
  202 + + " and r.xl_bm like '%"+map.get("line").toString()+"%' "
  203 + + " and r.gs_bm='"+map.get("gsdmShif").toString()+"' "
  204 + + " and r.fgs_bm='"+map.get("fgsdmShif").toString()+"' ) t"
  205 + + " GROUP BY t.schedule_date,t.j_name,t.s_name, t.cl_zbh,t.xl_bm,t.j_gh,t.gs_bm,t.fgs_bm ";
  206 + /*String sql = " select r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,"
197 207 + " r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type "
198 208 + " FROM bsth_c_s_sp_info_real r "
199 209 + " where 1=1 ";
... ... @@ -211,20 +221,18 @@ public class FormsServiceImpl implements FormsService {
211 221 sql+=" and r.fgs_bm='"+map.get("fgsdmShif").toString()+"'";
212 222 }
213 223 sql += " GROUP BY r.schedule_date,r.lp_name,r.xl_name,r.j_name,r.s_name, r.cl_zbh,r.xl_bm,r.cl_zbh,r.j_gh,r.j_gh,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
214   - + " ORDER BY r.lp_name asc";
  224 + + " ORDER BY r.lp_name asc";*/
215 225  
216 226 List<Shifday> list = jdbcTemplate.query(sql, new RowMapper<Shifday>() {
217 227  
218 228 @Override
219 229 public Shifday mapRow(ResultSet arg0, int arg1) throws SQLException {
220 230 Shifday shifday = new Shifday();
  231 + shifday.setRq(arg0.getString("schedule_date"));
221 232 shifday.setjName(arg0.getString("j_name").toString());
222 233 shifday.setsName(arg0.getString("s_name") == null ? "" : arg0.getString("s_name").toString());
223   - shifday.setLpName(arg0.getString("r.lp_name").toString());
224 234 shifday.setCarPlate(arg0.getString("cl_zbh").toString());
225 235 shifday.setJgh(arg0.getString("j_gh"));
226   - shifday.setZbh(arg0.getString("cl_zbh"));
227   - shifday.setRq(arg0.getString("schedule_date"));
228 236 return shifday;
229 237 }
230 238  
... ... @@ -335,33 +343,28 @@ public class FormsServiceImpl implements FormsService {
335 343 String rq3 = sdf1.format(d1);
336 344  
337 345 rq = rq2 + "-" + rq3;
338   -
339   - String sql = " SELECT r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
340   - + " FROM bsth_c_s_sp_info_real r "
341   - + " left join bsth_c_ylb y"
342   - + " ON r.cl_zbh = y.nbbm "
343   - + " where r.schedule_date_str BETWEEN '" + map.get("startDate").toString() + "'"
344   - + " and '"+ map.get("endDate").toString() + "'"
345   - + " and r.xl_bm='" + map.get("line").toString() + "'"
346   - + " AND r.gs_bm is not null";
347   -
348   - if(map.get("gsdmSing").toString()!=""){
349   - sql+=" and r.gs_bm='"+map.get("gsdmSing").toString()+"'";
350   - }
351   - if(map.get("fgsdmSing").toString()!=""){
352   - sql+=" and r.fgs_bm='"+map.get("fgsdmSing").toString()+"'";
353   - }
354   - sql += " GROUP BY r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
355   -
356 346 startDate = map.get("startDate").toString();
357 347 endDate = map.get("endDate").toString();
  348 + String sql = "select t.*,y.yh,y.jzl from ("
  349 + + " select r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm"
  350 + + " from bsth_c_s_sp_info_real r where r.schedule_date_str "
  351 + + " BETWEEN '"+startDate+"' and '"+endDate+"' and r.xl_bm='"+map.get("line").toString()+"' "
  352 + + " AND r.gs_bm is not null and r.gs_bm='"+map.get("gsdmSing").toString()+"' "
  353 + + " and r.fgs_bm='"+map.get("fgsdmSing").toString()+"' "
  354 + + " group by r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm) t "
  355 + + " LEFT JOIN (select a.nbbm,a.jsy,SUM(a.yh) as yh,SUM(a.jzl) as jzl "
  356 + + " from bsth_c_ylb a where a.rq BETWEEN '"+startDate+"' and '"+endDate+"'and "
  357 + + " a.ssgsdm='"+map.get("gsdmSing").toString()+"' and a.fgsdm='"+map.get("fgsdmSing").toString()+"' "
  358 + + "group by a.nbbm,a.jsy) y"
  359 + + " on y.nbbm=t.cl_zbh and y.jsy= t.j_gh";
  360 +
358 361 List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() {
359 362 //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
360 363 @Override
361 364 public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException {
362 365 Singledata sin = new Singledata();
363 366 sin.setrQ(rq);
364   - sin.setgS(arg0.getString("gs_name"));
  367 + sin.setgS(arg0.getString("gs_bm"));
365 368 sin.setxL(arg0.getString("xl_name"));
366 369 sin.setClzbh(arg0.getString("cl_zbh"));
367 370 sin.setJsy(arg0.getString("j_gh"));
... ... @@ -374,8 +377,13 @@ public class FormsServiceImpl implements FormsService {
374 377 return sin;
375 378 }
376 379 });
  380 + DecimalFormat df = new DecimalFormat("0.00");
377 381 for(int i=0;i<list.size();i++){
  382 +
378 383 Singledata si=list.get(i);
  384 + si.setgS(BasicData.businessCodeNameMap.get(si.getgS()));
  385 + si.setJzl(df.format(Double.parseDouble(si.getJzl())));
  386 + si.setHyl(df.format(Double.parseDouble(si.getHyl())));
379 387 Map<String, Object> maps = new HashMap<>();
380 388 maps = commonService.findKMBC1(si.getjName(),si.getClzbh(), startDate,
381 389 endDate);
... ... @@ -712,22 +720,20 @@ public class FormsServiceImpl implements FormsService {
712 720  
713 721 @Override
714 722 public List<Daily> daily(Map<String, Object> map) {
715   -
716   - String sql ="select r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name "
717   - + " from bsth_c_s_sp_info_real r LEFT JOIN bsth_c_ylb y ON r.cl_zbh = y.nbbm "
718   - + " WHERE 1 = 1"
719   - + " and r.xl_bm='" + map.get("line").toString() + "'"
720   - + " and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"')"
721   - + " AND r.gs_bm is not null";
722   -
723   - if(map.get("gsdmDaily").toString()!=""){
724   - sql+=" and r.gs_bm='"+map.get("gsdmDaily").toString()+"'";
725   - }
726   - if(map.get("fgsdmDaily").toString()!=""){
727   - sql+=" and r.fgs_bm='"+map.get("fgsdmDaily").toString()+"'";
728   - }
729   - sql += " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name ";
730   -
  723 + String sql="select t.schedule_date_str,"
  724 + + " t.cl_zbh,t.j_gh,t.j_name,x.yh from (select r.schedule_date_str,r.xl_bm,r.xl_name,"
  725 + + " r.cl_zbh,r.j_gh,r.j_name from bsth_c_s_sp_info_real r WHERE "
  726 + + " r.xl_bm='" + map.get("line").toString() + "' and to_days(r.schedule_date)=to_days('"+map.get("date").toString()+"') "
  727 + + " and r.gs_bm like '%"+map.get("gsdmDaily").toString()+"%' "
  728 + + " and r.fgs_bm like '%"+map.get("fgsdmDaily").toString()+"%' "
  729 + + " GROUP BY r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name) t"
  730 + + " left join (select * from bsth_c_ylb y where "
  731 + + " to_days(y.rq)=to_days('"+map.get("date").toString()+"') "
  732 + + " and y.xlbm= '" + map.get("line").toString() + "'"
  733 + + " and y.ssgsdm like '%"+map.get("gsdmDaily").toString()+"%' "
  734 + + " and y.fgsdm like '%"+map.get("fgsdmDaily").toString()+"%'"
  735 + + " ) x"
  736 + + " on t.cl_zbh = x.nbbm ";
731 737 List<Daily> list = jdbcTemplate.query(sql, new RowMapper<Daily>() {
732 738 @Override
733 739 public Daily mapRow(ResultSet arg0, int arg1) throws SQLException {
... ... @@ -736,7 +742,7 @@ public class FormsServiceImpl implements FormsService {
736 742 daily.setZbh(arg0.getString("cl_zbh"));
737 743 daily.setJgh(arg0.getString("j_gh"));
738 744 daily.setjName(arg0.getString("j_name"));
739   - daily.setYh(arg0.getString("YH"));
  745 + daily.setYh(arg0.getString("yh"));
740 746 return daily;
741 747 }
742 748 });
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -1345,8 +1345,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1345 1345 Collections.sort(keyMap1.get(key), new Comparator<Map<String, Object>>() {
1346 1346  
1347 1347 public int compare(Map<String, Object> o1, Map<String, Object> o2) {
1348   - Integer a;
1349   - Integer b;
  1348 + Long a;
  1349 + Long b;
1350 1350 String lp1 = o1.get("lp").toString();
1351 1351 String lp2 = o2.get("lp").toString();
1352 1352 String str1 = "";
... ... @@ -1358,8 +1358,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1358 1358 str2 += (int)lp2.charAt(i);
1359 1359 }
1360 1360  
1361   - a = Integer.valueOf(str1);
1362   - b = Integer.valueOf(str2);
  1361 + a = Long.valueOf(str1);
  1362 + b = Long.valueOf(str2);
1363 1363  
1364 1364 // 升序
1365 1365 return a.compareTo(b);
... ...
src/main/java/com/bsth/service/impl/PersonnelServiceImpl.java
... ... @@ -34,8 +34,9 @@ public class PersonnelServiceImpl extends BaseServiceImpl&lt;Personnel, Integer&gt; im
34 34 per=perIterator.next();
35 35 if(per.getJobCode().indexOf(jobCode)!=-1){
36 36 Map<String, String> jobCodeMap= new HashMap<>();
37   - jobCodeMap.put("id",per.getJobCode());
38   - jobCodeMap.put("text", per.getJobCode()+"/"+per.getPersonnelName());
  37 + String jboCode=per.getJobCode().substring(per.getJobCode().indexOf("-")+1);
  38 + jobCodeMap.put("id",jboCode);
  39 + jobCodeMap.put("text", jboCode+"/"+per.getPersonnelName());
39 40 jobCodeMap.put("gs", per.getCompanyCode());
40 41 list.add(jobCodeMap);
41 42 }
... ...
src/main/java/com/bsth/service/impl/StationRouteServiceImpl.java
... ... @@ -11,6 +11,8 @@ import com.bsth.repository.StationRouteRepository;
11 11 import com.bsth.service.StationRouteService;
12 12 import com.bsth.util.FTPClientUtils;
13 13 import com.bsth.util.PackTarGZUtils;
  14 +import com.bsth.util.Geo.GeoUtils;
  15 +import com.bsth.util.Geo.Point;
14 16 import com.bsth.util.db.DBUtils_MS;
15 17 import com.google.common.base.Splitter;
16 18 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -556,9 +558,15 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
556 558  
557 559 clientUtils.deleteFtpFile(url, port, username, password, remotePath, textFileName);
558 560  
559   - /** 行单文件内容 @param:<objects:站点路由;lineId:线路ID>*/
560   - String textStr = newTextFileToFTP(objects,lineId);
  561 + String textStr = "";
561 562  
  563 + boolean tempTag = ishxType(objects);
  564 +
  565 + if(tempTag)
  566 + textStr = hxTextFileToFtp(objects,lineId);// 环线行单文件内容
  567 + else
  568 + textStr = newTextFileToFTP(objects,lineId);/** 双向行单文件内容 @param:<objects:站点路由;lineId:线路ID>*/
  569 +
562 570 /*textStr = line.getName() + "\t" + "2" + "\r" + textStr;*/
563 571  
564 572 textStr = line.getName() + " " + "2" + "\r" + textStr;
... ... @@ -574,9 +582,6 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
574 582 /** 获取txt文件 */
575 583 File textFile = clientUtils.GetFtpFile(url, port, username, password, remotePath, textFileName);
576 584  
577   - /*File[] sources = new File[] {textFile};*/
578   - //File[] sources = new File[] {textFile};
579   -
580 585 File target = new File(odlGzFileName);
581 586  
582 587 // 将txt文件打包
... ... @@ -603,6 +608,24 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
603 608 }
604 609 return resultMap;
605 610 }
  611 + public boolean ishxType(List<Object[]> listObj) {
  612 + boolean tag = true;
  613 + String pointBStr[] = null,pointEStr[] = null;
  614 + int numzd = 0;
  615 + for(int i =0;i<listObj.size();i++) {
  616 + if(listObj.get(i)[3].equals("B") && Integer.valueOf(listObj.get(i)[8].toString())==0)
  617 + pointBStr = listObj.get(i)[2].toString().split(" ");
  618 + else if(listObj.get(i)[3].equals("E") && Integer.valueOf(listObj.get(i)[8].toString())==0)
  619 + pointEStr = listObj.get(i)[2].toString().split(" ");
  620 + if(Integer.valueOf(listObj.get(i)[8].toString())==1)
  621 + numzd++;
  622 + }
  623 + Point p1 = new Point(Double.valueOf(pointBStr[0]),Double.valueOf(pointBStr[1]));
  624 + Point p2 = new Point(Double.valueOf(pointEStr[0]),Double.valueOf(pointEStr[1]));
  625 + if(GeoUtils.getDistance(p1, p2)>100 && numzd>2)
  626 + tag = false;
  627 + return tag;
  628 + }
606 629  
607 630 /**
608 631 * @Description : TODO(形成行单文件内容)
... ... @@ -717,31 +740,79 @@ public class StationRouteServiceImpl extends BaseServiceImpl&lt;StationRoute, Integ
717 740 }
718 741  
719 742 }
720   -
721   - /*
722   - String bdJWPointStr = objects.get(i)[2].toString();
723   -
724   - String bdJWPointA[] = bdJWPointStr.split(" ");
725   -
726   - Map<String, Object> pointsM = new HashMap<String,Object>();
727   -
728   - pointsM.put("lng", bdJWPointA[0]);
729   -
730   - pointsM.put("lat", bdJWPointA[1]);
731   -
732   - System.out.println(objects.get(i)[7].toString());
733   -
734   - sleepStr = sleepStr + GetFormPointOnPolylineSeleepLimit(pointsM,sobje);*/
735 743 }
736 744  
737 745 stationRStr = stationRStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
738   -
739 746 }
740 747  
741 748 }
742   -
743 749 return stationRStr;
744   -
  750 + }
  751 +
  752 + public String hxTextFileToFtp(List<Object[]> objects,Integer lineId) {
  753 + String restStr = "";
  754 + // windows下的文本文件换行符
  755 + //String enterStr = "\r\n";
  756 + // linux/unix下的文本文件换行符
  757 + String enterStr = "\r";
  758 + int xh = 1 ;
  759 + for(int x =0;x<2;x++) {
  760 + for(int i = 0; i<objects.size();i++) {
  761 + if(Integer.valueOf(objects.get(i)[8].toString())==0) {
  762 + // 经度
  763 + String lng = objects.get(i)[0].equals("") ? "" : objects.get(i)[0].toString();
  764 + // 纬度
  765 + String lat = objects.get(i)[1].equals("") ? "" : objects.get(i)[1].toString();
  766 + lat = "\t" + lat;
  767 + // 站点类型
  768 + String stationMakeStr = objects.get(i)[3].equals("") ? "" : objects.get(i)[3].toString();
  769 + String stationMake = "";
  770 + if(stationMakeStr.equals("E")) {
  771 + stationMake = "\t2";
  772 + }else {
  773 + stationMake ="\t1";
  774 + }
  775 + // 站点序号
  776 + // String stationNo = objects.get(i)[4].equals("") ? "" : objects.get(i)[4].toString();
  777 + String stationNo = "\t" + xh;
  778 + // 站点编码
  779 + String stationCode = objects.get(i)[5].equals("") ? "" : objects.get(i)[5].toString();
  780 + stationCode = "\t" +stationCode;
  781 + double dis = objects.get(i)[6]==null ? 0.0 : Double.parseDouble(objects.get(i)[6].toString())*1000;
  782 + String tempDistc = String.valueOf((int) dis);
  783 + // 站点距离
  784 + String staitondistance = "\t" + tempDistc;
  785 + // 站点名称
  786 + String stationName = objects.get(i)[7].equals("") ? "" : objects.get(i)[7].toString();
  787 + stationName = "\t" +stationName;
  788 + // 限速
  789 + String sleepStr = "";
  790 + // 方向
  791 + int directions = objects.get(i)[8]==null ? null : Integer.valueOf(objects.get(i)[8].toString());
  792 + /** 获取路段路由信息 @pararm:<lineId:线路ID;directions:方向> */
  793 + List<Object[]> sobje = routeRepository.sectionRouteVector(lineId,directions);
  794 + if(sobje.size()==1) {
  795 + double dsleepStr = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(0)[2].toString());
  796 + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStr);
  797 + }else if(sobje.size()>1){
  798 + /** 这里暂时只根据站点名称去匹配所在路段的限速值 ,如果路段名称"至"之前的地名与站点名称等同,就认为站点在路段上。 */
  799 + for(int j =0;j<sobje.size();j++) {
  800 + String sectionName = sobje.get(j)[3].toString();
  801 + String sectionNameA[] = sectionName.split("至");
  802 + if(stationName.equals(sectionNameA[0])){
  803 + /*sleepStr = sobje.get(j)[2].toString();*/
  804 + double dsleepStrt = sobje.get(0)[2] == null ? 60d : Double.valueOf(sobje.get(j)[2].toString());
  805 + sleepStr = "\t" + new DecimalFormat("0").format(dsleepStrt);
  806 + }
  807 + }
  808 + }
  809 + xh++;
  810 + restStr = restStr + lng + lat + stationMake + stationNo + stationCode + staitondistance + sleepStr + stationName + enterStr;
  811 + }
  812 + }
  813 + }
  814 + System.out.println(restStr);
  815 + return restStr;
745 816 }
746 817  
747 818 public String GetFormPointOnPolylineSeleepLimit(Map<String, Object> p,List<Object[]> listObjArra) {
... ...
src/main/java/com/bsth/service/impl/StationServiceImpl.java
... ... @@ -758,7 +758,7 @@ public class StationServiceImpl extends BaseServiceImpl&lt;Station, Integer&gt; implem
758 758 String bsectionVector = "LINESTRING(" + sectionsBpoints + ")";
759 759  
760 760 // 城建坐标点集合
761   - String csectionVector = "";
  761 + String csectionVector = null;
762 762  
763 763 // 路段类型
764 764 String sectionType = "";
... ...
src/main/java/com/bsth/service/logger/MileModifyService.java 0 → 100644
  1 +package com.bsth.service.logger;
  2 +
  3 +import com.bsth.entity.logger.Logger_MileModify;
  4 +import com.bsth.service.BaseService;
  5 +
  6 +/**
  7 + * Created by panzhao on 2017/3/6.
  8 + */
  9 +public interface MileModifyService extends BaseService<Logger_MileModify, Long>{
  10 +}
... ...
src/main/java/com/bsth/service/logger/impl/MileModifyServiceImpl.java 0 → 100644
  1 +package com.bsth.service.logger.impl;
  2 +
  3 +import com.bsth.entity.logger.Logger_MileModify;
  4 +import com.bsth.service.impl.BaseServiceImpl;
  5 +import com.bsth.service.logger.MileModifyService;
  6 +import org.springframework.stereotype.Service;
  7 +
  8 +/**
  9 + * Created by panzhao on 2017/3/6.
  10 + */
  11 +@Service
  12 +public class MileModifyServiceImpl extends BaseServiceImpl<Logger_MileModify, Long> implements MileModifyService {
  13 +}
... ...
src/main/java/com/bsth/service/oil/CdlService.java 0 → 100644
  1 +package com.bsth.service.oil;
  2 +
  3 +
  4 +import com.bsth.entity.oil.Cdl;
  5 +import com.bsth.service.BaseService;
  6 +
  7 +public interface CdlService extends BaseService<Cdl, Integer>{
  8 +}
... ...
src/main/java/com/bsth/service/oil/DlbService.java 0 → 100644
  1 +package com.bsth.service.oil;
  2 +
  3 +import java.util.Map;
  4 +
  5 +import com.bsth.entity.oil.Dlb;
  6 +import com.bsth.service.BaseService;
  7 +
  8 +public interface DlbService extends BaseService<Dlb, Integer>{
  9 + Map<String, Object> obtain(Map<String, Object> map);
  10 +
  11 + Map<String, Object> sort(Map<String, Object> map);
  12 +
  13 + Map<String, Object> checkDl(Map<String, Object> map);
  14 +}
... ...
src/main/java/com/bsth/service/oil/JdlService.java 0 → 100644
  1 +package com.bsth.service.oil;
  2 +
  3 +import java.io.File;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.entity.oil.Jdl;
  7 +import com.bsth.service.BaseService;
  8 +
  9 +public interface JdlService extends BaseService<Jdl, Integer> {
  10 +
  11 + public String importExcel(File file, String gsbm_, String gsName, String fgsbm, String fgsName);
  12 +
  13 + public Map<String, Object> query(Map<String, Object> map);
  14 +
  15 +}
... ...