Commit ace4e67e7b2d8a475905ce12735a4db7a2ba10bb

Authored by 徐烜
2 parents 24476521 6cafe1ac

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

Showing 38 changed files with 3573 additions and 709 deletions

Too many changes to show.

To preserve performance only 38 of 577 files are displayed.

README.md
... ... @@ -447,9 +447,5 @@
447 447 | direction | float | 角度0-359 |
448 448 | inTemp | int | 车内温度 |
449 449 | serviceState | long | 设备状态字 |
450   -<<<<<<< HEAD
451   -| daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 |
452   -=======
453 450 | daysYear | int | 对应年中的天数 为分区字段 查询一定要用此字段过滤 |
454 451  
455   ->>>>>>> af8ec3bedc8644f5813e9adab12a163e93cc7f50
... ...
1   -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2   - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3   -
4   - <modelVersion>4.0.0</modelVersion>
5   - <groupId>com.bsth</groupId>
6   - <artifactId>bsth_control</artifactId>
7   - <version>0.0.1-SNAPSHOT</version>
8   - <packaging>war</packaging>
9   -
10   - <parent>
11   - <groupId>org.springframework.boot</groupId>
12   - <artifactId>spring-boot-starter-parent</artifactId>
13   - <version>1.3.3.RELEASE</version>
14   - </parent>
15   -
16   - <dependencies>
17   - <dependency>
18   - <groupId>org.springframework.boot</groupId>
19   - <artifactId>spring-boot-starter-web</artifactId>
20   - </dependency>
21   -
22   - <dependency>
23   - <groupId>org.springframework.boot</groupId>
24   - <artifactId>spring-boot-starter-tomcat</artifactId>
25   - <scope>provided</scope>
26   - </dependency>
27   - <dependency>
28   - <groupId>javax.servlet</groupId>
29   - <artifactId>javax.servlet-api</artifactId>
30   - <version>3.1.0</version>
31   - <scope>provided</scope>
32   - </dependency>
33   - <dependency>
34   - <groupId>org.springframework.boot</groupId>
35   - <artifactId>spring-boot-starter-security</artifactId>
36   - </dependency>
37   - <!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId>
38   - </dependency> -->
39   - <dependency>
40   - <groupId>org.springframework.boot</groupId>
41   - <artifactId>spring-boot-starter-data-jpa</artifactId>
42   - </dependency>
43   - <dependency>
44   - <groupId>org.springframework.boot</groupId>
45   - <artifactId>spring-boot-starter-aop</artifactId>
46   - </dependency>
47   -
48   - <dependency>
49   - <groupId>org.springframework</groupId>
50   - <artifactId>spring-context-support</artifactId>
51   - </dependency>
52   - <dependency>
53   - <groupId>org.springframework.boot</groupId>
54   - <artifactId>spring-boot-starter-redis</artifactId>
55   - </dependency>
56   - <dependency>
57   - <groupId>org.springframework.boot</groupId>
58   - <artifactId>spring-boot-starter-websocket</artifactId>
59   - </dependency>
60   - <dependency>
61   - <groupId>mysql</groupId>
62   - <artifactId>mysql-connector-java</artifactId>
63   - </dependency>
64   -
65   - <dependency>
66   - <groupId>joda-time</groupId>
67   - <artifactId>joda-time</artifactId>
68   - </dependency>
69   - <dependency>
70   - <groupId>com.alibaba</groupId>
71   - <artifactId>fastjson</artifactId>
72   - <version>1.2.4</version>
73   - </dependency>
74   -
75   - <dependency>
76   - <groupId>org.apache.httpcomponents</groupId>
77   - <artifactId>httpclient</artifactId>
78   - </dependency>
79   -
80   - <dependency>
81   - <groupId>commons-dbcp</groupId>
82   - <artifactId>commons-dbcp</artifactId>
83   - </dependency>
84   - <dependency>
85   - <groupId>commons-lang</groupId>
86   - <artifactId>commons-lang</artifactId>
87   - <version>2.6</version>
88   - </dependency>
89   - <dependency>
90   - <groupId>org.apache.commons</groupId>
91   - <artifactId>commons-lang3</artifactId>
92   - <version>3.4</version>
93   - </dependency>
94   - <dependency>
95   - <groupId>commons-fileupload</groupId>
96   - <artifactId>commons-fileupload</artifactId>
97   - <version>1.2.2</version>
98   - </dependency>
99   - <dependency>
100   - <groupId>commons-io</groupId>
101   - <artifactId>commons-io</artifactId>
102   - <version>2.4</version>
103   - </dependency>
104   - <dependency>
105   - <groupId>org.codehaus.janino</groupId>
106   - <artifactId>janino</artifactId>
107   - </dependency>
108   -
109   - <dependency>
110   - <groupId>org.apache.poi</groupId>
111   - <artifactId>poi-ooxml</artifactId>
112   - <version>3.13</version>
113   - </dependency>
114   -
115   - <dependency>
116   - <groupId>com.google.guava</groupId>
117   - <artifactId>guava</artifactId>
118   - <version>19.0</version>
119   - </dependency>
120   - <!-- ftp文件上传包 -->
121   - <dependency>
122   - <groupId>commons-net</groupId>
123   - <artifactId>commons-net</artifactId>
124   - <version>3.5</version>
125   - </dependency>
126   - <dependency>
127   - <groupId>org.apache.commons</groupId>
128   - <artifactId>commons-compress</artifactId>
129   - <version>1.3</version>
130   - </dependency>
131   - <!-- drools 6依赖 -->
132   - <dependency>
133   - <groupId>org.kie</groupId>
134   - <artifactId>kie-api</artifactId>
135   - </dependency>
136   - <dependency>
137   - <groupId>org.drools</groupId>
138   - <artifactId>drools-compiler</artifactId>
139   - </dependency>
140   -
141   - <!-- springboot测试 -->
142   - <dependency>
143   - <groupId>org.springframework.boot</groupId>
144   - <artifactId>spring-boot-starter-test</artifactId>
145   - <scope>test</scope>
146   - </dependency>
147   -
148   - <dependency>
149   - <groupId>c3p0</groupId>
150   - <artifactId>c3p0</artifactId>
151   - <version>0.9.1.2</version>
152   - </dependency>
153   -
154   - <!-- 图表 -->
155   - <dependency>
156   - <groupId>com.google.code.gson</groupId>
157   - <artifactId>gson</artifactId>
158   - <version>2.2.4</version>
159   - </dependency>
160   - <dependency>
161   - <groupId>com.github.abel533</groupId>
162   - <artifactId>ECharts</artifactId>
163   - <version>2.1.8</version>
164   - </dependency>
165   -
166   - <dependency>
167   - <groupId>org.apache.tika</groupId>
168   - <artifactId>tika-core</artifactId>
169   - <version>1.7</version>
170   - </dependency>
171   -
172   - <!-- pentaho kettle 依赖 -->
173   - <dependency>
174   - <groupId>com.pentaho.kettle</groupId>
175   - <artifactId>kettle-core</artifactId>
176   - <version>6.0.1.0-386</version>
177   - </dependency>
178   - <dependency>
179   - <groupId>com.pentaho.kettle</groupId>
180   - <artifactId>kettle-engine</artifactId>
181   - <version>6.0.1.0-386</version>
182   - </dependency>
183   - <dependency>
184   - <groupId>com.pentaho.kettle</groupId>
185   - <artifactId>metastore</artifactId>
186   - <version>6.0.1.0-386</version>
187   - </dependency>
188   - <dependency>
189   - <groupId>com.pentaho.kettle</groupId>
190   - <artifactId>vfs2</artifactId>
191   - <version>2.1-20150824</version>
192   - </dependency>
193   - <dependency>
194   - <groupId>net.sourceforge.jexcelapi</groupId>
195   - <artifactId>jxl</artifactId>
196   - <version>2.6.12</version>
197   - </dependency>
198   - <dependency>
199   - <groupId>rhino</groupId>
200   - <artifactId>js</artifactId>
201   - <version>1.7R2</version>
202   - </dependency>
203   - <dependency>
204   - <groupId>javax.mail</groupId>
205   - <artifactId>mail</artifactId>
206   - <version>1.4.7</version>
207   - </dependency>
208   -
209   - <dependency>
210   - <groupId>com.github.axet</groupId>
211   - <artifactId>kaptcha</artifactId>
212   - <version>0.0.9</version>
213   - </dependency>
214   -
215   - <dependency>
216   - <groupId>commons-codec</groupId>
217   - <artifactId>commons-codec</artifactId>
218   - <version>1.4</version>
219   - <scope>compile</scope>
220   - </dependency>
221   - <dependency>
222   - <groupId>org.bouncycastle</groupId>
223   - <artifactId>bcprov-jdk15on</artifactId>
224   - <version>1.52</version>
225   - </dependency>
226   - <dependency>
227   - <groupId>axis</groupId>
228   - <artifactId>axis</artifactId>
229   - <version>1.4</version>
230   - </dependency>
231   - <dependency>
232   - <groupId>javax.xml</groupId>
233   - <artifactId>jaxrpc-api</artifactId>
234   - <version>1.1</version>
235   - </dependency>
236   -
237   - <dependency>
238   - <groupId>org.apache.axis2</groupId>
239   - <artifactId>axis2-adb</artifactId>
240   - <version>1.7.4</version>
241   - </dependency>
242   - <dependency>
243   - <groupId>org.apache.axis2</groupId>
244   - <artifactId>axis2-transport-local</artifactId>
245   - <version>1.7.4</version>
246   - </dependency>
247   - <dependency>
248   - <groupId>org.apache.axis2</groupId>
249   - <artifactId>axis2-transport-http</artifactId>
250   - <version>1.7.4</version>
251   - </dependency>
252   -
253   - <dependency>
254   - <groupId>org.dbunit</groupId>
255   - <artifactId>dbunit</artifactId>
256   - <version>2.4.9</version>
257   - <scope>test</scope>
258   -
259   - <exclusions>
260   - <exclusion>
261   - <groupId>org.slf4j</groupId>
262   - <artifactId>slf4j-api</artifactId>
263   - </exclusion>
264   - </exclusions>
265   - </dependency>
266   -
267   - <dependency>
268   - <groupId>com.h2database</groupId>
269   - <artifactId>h2</artifactId>
270   - <version>1.2.132</version>
271   - <scope>test</scope>
272   - </dependency>
273   -
274   -
275   - <dependency>
276   - <groupId>ojdbc</groupId>
277   - <artifactId>ojdbc</artifactId>
278   - <version>14</version>
279   - </dependency>
280   -
281   - <dependency>
282   - <groupId>org.apache.mina</groupId>
283   - <artifactId>mina-core</artifactId>
284   - <version>2.0.13</version>
285   - </dependency>
286   -
287   - <dependency>
288   - <groupId>com.google.protobuf</groupId>
289   - <artifactId>protobuf-java</artifactId>
290   - <version>3.3.0</version>
291   - </dependency>
292   -
293   - <dependency>
294   - <groupId>com.github.stuxuhai</groupId>
295   - <artifactId>jpinyin</artifactId>
296   - <version>1.1.8</version>
297   - </dependency>
298   - </dependencies>
299   -
300   - <dependencyManagement>
301   - <dependencies>
302   - <!-- drools 6依赖 -->
303   - <dependency>
304   - <groupId>org.drools</groupId>
305   - <artifactId>drools-bom</artifactId>
306   - <type>pom</type>
307   - <version>6.3.0.Final</version>
308   - <scope>import</scope>
309   - </dependency>
310   - </dependencies>
311   - </dependencyManagement>
312   -
313   - <build>
314   - <plugins>
315   - <plugin>
316   - <artifactId>maven-compiler-plugin</artifactId>
317   - <version>2.3.2</version><!--$NO-MVN-MAN-VER$ -->
318   - <configuration>
319   - <source>1.7</source>
320   - <target>1.7</target>
321   - </configuration>
322   - </plugin>
323   - <plugin>
324   - <artifactId>maven-war-plugin</artifactId>
325   - <version>2.2</version><!--$NO-MVN-MAN-VER$ -->
326   - <configuration>
327   - <failOnMissingWebXml>false</failOnMissingWebXml>
328   - </configuration>
329   - </plugin>
330   - <plugin>
331   - <groupId>org.springframework.boot</groupId>
332   - <artifactId>spring-boot-maven-plugin</artifactId>
333   - </plugin>
334   - </plugins>
335   - <resources>
336   - <resource>
337   - <directory>src/main/resources</directory>
338   - <filtering>false</filtering>
339   - </resource>
340   - </resources>
341   - </build>
342   - <repositories>
343   - <repository>
344   - <id>spring-snapshots</id>
345   - <url>http://repo.spring.io/snapshot</url>
346   - <snapshots>
347   - <enabled>true</enabled>
348   - </snapshots>
349   - </repository>
350   - <repository>
351   - <id>spring-milestones</id>
352   - <url>http://repo.spring.io/milestone</url>
353   - </repository>
354   - </repositories>
355   - <pluginRepositories>
356   - <pluginRepository>
357   - <id>spring-snapshots</id>
358   - <url>http://repo.spring.io/snapshot</url>
359   - </pluginRepository>
360   - <pluginRepository>
361   - <id>spring-milestones</id>
362   - <url>http://repo.spring.io/milestone</url>
363   - </pluginRepository>
364   - </pluginRepositories>
365   -
366   - <properties>
367   - <start-class>com.bsth.Application</start-class>
368   - </properties>
369   -</project>
  1 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3 +
  4 + <modelVersion>4.0.0</modelVersion>
  5 + <groupId>com.bsth</groupId>
  6 + <artifactId>bsth_control</artifactId>
  7 + <version>0.0.1-SNAPSHOT</version>
  8 + <packaging>war</packaging>
  9 +
  10 + <parent>
  11 + <groupId>org.springframework.boot</groupId>
  12 + <artifactId>spring-boot-starter-parent</artifactId>
  13 + <version>2.1.6.RELEASE</version>
  14 + </parent>
  15 +
  16 + <dependencies>
  17 + <dependency>
  18 + <groupId>org.springframework.boot</groupId>
  19 + <artifactId>spring-boot-starter-web</artifactId>
  20 + </dependency>
  21 +
  22 + <dependency>
  23 + <groupId>org.springframework.boot</groupId>
  24 + <artifactId>spring-boot-starter-tomcat</artifactId>
  25 + <scope>provided</scope>
  26 + </dependency>
  27 + <dependency>
  28 + <groupId>javax.servlet</groupId>
  29 + <artifactId>javax.servlet-api</artifactId>
  30 + <version>3.1.0</version>
  31 + <scope>provided</scope>
  32 + </dependency>
  33 + <dependency>
  34 + <groupId>org.springframework.boot</groupId>
  35 + <artifactId>spring-boot-starter-security</artifactId>
  36 + </dependency>
  37 + <!-- <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId>
  38 + </dependency> -->
  39 + <dependency>
  40 + <groupId>org.springframework.boot</groupId>
  41 + <artifactId>spring-boot-starter-data-jpa</artifactId>
  42 + </dependency>
  43 + <dependency>
  44 + <groupId>org.springframework.boot</groupId>
  45 + <artifactId>spring-boot-starter-aop</artifactId>
  46 + </dependency>
  47 +
  48 + <dependency>
  49 + <groupId>org.springframework</groupId>
  50 + <artifactId>spring-context-support</artifactId>
  51 + </dependency>
  52 + <dependency>
  53 + <groupId>org.springframework.boot</groupId>
  54 + <artifactId>spring-boot-starter-websocket</artifactId>
  55 + </dependency>
  56 + <dependency>
  57 + <groupId>org.springframework.boot</groupId>
  58 + <artifactId>spring-boot-configuration-processor</artifactId>
  59 + <optional>true</optional>
  60 + </dependency>
  61 + <dependency>
  62 + <groupId>mysql</groupId>
  63 + <artifactId>mysql-connector-java</artifactId>
  64 + <version>5.1.38</version>
  65 + </dependency>
  66 +
  67 + <dependency>
  68 + <groupId>joda-time</groupId>
  69 + <artifactId>joda-time</artifactId>
  70 + </dependency>
  71 + <dependency>
  72 + <groupId>com.alibaba</groupId>
  73 + <artifactId>fastjson</artifactId>
  74 + <version>1.2.4</version>
  75 + </dependency>
  76 +
  77 + <dependency>
  78 + <groupId>org.apache.httpcomponents</groupId>
  79 + <artifactId>httpclient</artifactId>
  80 + </dependency>
  81 +
  82 + <!-- dbcp2数据库连接池 -->
  83 + <dependency>
  84 + <groupId>org.apache.commons</groupId>
  85 + <artifactId>commons-dbcp2</artifactId>
  86 + </dependency>
  87 +
  88 + <dependency>
  89 + <groupId>org.hibernate</groupId>
  90 + <artifactId>hibernate-search-orm</artifactId>
  91 + <version>5.11.2.Final</version>
  92 + </dependency>
  93 +
  94 + <dependency>
  95 + <groupId>commons-lang</groupId>
  96 + <artifactId>commons-lang</artifactId>
  97 + <version>2.6</version>
  98 + </dependency>
  99 + <dependency>
  100 + <groupId>org.apache.commons</groupId>
  101 + <artifactId>commons-lang3</artifactId>
  102 + <version>3.4</version>
  103 + </dependency>
  104 + <dependency>
  105 + <groupId>commons-fileupload</groupId>
  106 + <artifactId>commons-fileupload</artifactId>
  107 + <version>1.2.2</version>
  108 + </dependency>
  109 + <dependency>
  110 + <groupId>commons-io</groupId>
  111 + <artifactId>commons-io</artifactId>
  112 + <version>2.4</version>
  113 + </dependency>
  114 + <dependency>
  115 + <groupId>org.codehaus.janino</groupId>
  116 + <artifactId>janino</artifactId>
  117 + </dependency>
  118 +
  119 + <dependency>
  120 + <groupId>org.apache.poi</groupId>
  121 + <artifactId>poi-ooxml</artifactId>
  122 + <version>3.13</version>
  123 + </dependency>
  124 +
  125 + <dependency>
  126 + <groupId>com.google.guava</groupId>
  127 + <artifactId>guava</artifactId>
  128 + <version>19.0</version>
  129 + </dependency>
  130 + <!-- ftp文件上传包 -->
  131 + <dependency>
  132 + <groupId>commons-net</groupId>
  133 + <artifactId>commons-net</artifactId>
  134 + <version>3.5</version>
  135 + </dependency>
  136 + <dependency>
  137 + <groupId>org.apache.commons</groupId>
  138 + <artifactId>commons-compress</artifactId>
  139 + <version>1.3</version>
  140 + </dependency>
  141 + <!-- drools 6依赖 -->
  142 + <dependency>
  143 + <groupId>org.kie</groupId>
  144 + <artifactId>kie-api</artifactId>
  145 + </dependency>
  146 + <dependency>
  147 + <groupId>org.drools</groupId>
  148 + <artifactId>drools-compiler</artifactId>
  149 + </dependency>
  150 +
  151 + <!-- springboot测试 -->
  152 + <dependency>
  153 + <groupId>org.springframework.boot</groupId>
  154 + <artifactId>spring-boot-starter-test</artifactId>
  155 + <scope>test</scope>
  156 + </dependency>
  157 +
  158 + <dependency>
  159 + <groupId>c3p0</groupId>
  160 + <artifactId>c3p0</artifactId>
  161 + <version>0.9.1.2</version>
  162 + </dependency>
  163 +
  164 + <!-- 图表 -->
  165 + <dependency>
  166 + <groupId>com.google.code.gson</groupId>
  167 + <artifactId>gson</artifactId>
  168 + <version>2.8.5</version>
  169 + </dependency>
  170 + <dependency>
  171 + <groupId>com.github.abel533</groupId>
  172 + <artifactId>ECharts</artifactId>
  173 + <version>2.1.8</version>
  174 + </dependency>
  175 +
  176 + <dependency>
  177 + <groupId>org.apache.tika</groupId>
  178 + <artifactId>tika-core</artifactId>
  179 + <version>1.7</version>
  180 + </dependency>
  181 +
  182 + <!-- pentaho kettle 依赖 -->
  183 + <dependency>
  184 + <groupId>com.pentaho.kettle</groupId>
  185 + <artifactId>kettle-core</artifactId>
  186 + <version>6.0.1.0-386</version>
  187 + </dependency>
  188 + <dependency>
  189 + <groupId>com.pentaho.kettle</groupId>
  190 + <artifactId>kettle-engine</artifactId>
  191 + <version>6.0.1.0-386</version>
  192 + </dependency>
  193 + <dependency>
  194 + <groupId>com.pentaho.kettle</groupId>
  195 + <artifactId>metastore</artifactId>
  196 + <version>6.0.1.0-386</version>
  197 + </dependency>
  198 + <dependency>
  199 + <groupId>com.pentaho.kettle</groupId>
  200 + <artifactId>vfs2</artifactId>
  201 + <version>2.1-20150824</version>
  202 + </dependency>
  203 + <dependency>
  204 + <groupId>net.sourceforge.jexcelapi</groupId>
  205 + <artifactId>jxl</artifactId>
  206 + <version>2.6.12</version>
  207 + <exclusions>
  208 + <exclusion>
  209 + <groupId>log4j</groupId>
  210 + <artifactId>log4j</artifactId>
  211 + </exclusion>
  212 + </exclusions>
  213 + </dependency>
  214 + <dependency>
  215 + <groupId>rhino</groupId>
  216 + <artifactId>js</artifactId>
  217 + <version>1.7R2</version>
  218 + </dependency>
  219 + <dependency>
  220 + <groupId>javax.mail</groupId>
  221 + <artifactId>mail</artifactId>
  222 + <version>1.4.7</version>
  223 + </dependency>
  224 +
  225 + <dependency>
  226 + <groupId>com.github.axet</groupId>
  227 + <artifactId>kaptcha</artifactId>
  228 + <version>0.0.9</version>
  229 + </dependency>
  230 +
  231 + <dependency>
  232 + <groupId>commons-codec</groupId>
  233 + <artifactId>commons-codec</artifactId>
  234 + <version>1.4</version>
  235 + <scope>compile</scope>
  236 + </dependency>
  237 + <dependency>
  238 + <groupId>org.bouncycastle</groupId>
  239 + <artifactId>bcprov-jdk15on</artifactId>
  240 + <version>1.52</version>
  241 + </dependency>
  242 + <dependency>
  243 + <groupId>axis</groupId>
  244 + <artifactId>axis</artifactId>
  245 + <version>1.4</version>
  246 + </dependency>
  247 + <dependency>
  248 + <groupId>javax.xml</groupId>
  249 + <artifactId>jaxrpc-api</artifactId>
  250 + <version>1.1</version>
  251 + </dependency>
  252 +
  253 + <dependency>
  254 + <groupId>org.apache.axis2</groupId>
  255 + <artifactId>axis2-adb</artifactId>
  256 + <version>1.7.4</version>
  257 + </dependency>
  258 + <dependency>
  259 + <groupId>org.apache.axis2</groupId>
  260 + <artifactId>axis2-transport-local</artifactId>
  261 + <version>1.7.4</version>
  262 + </dependency>
  263 + <dependency>
  264 + <groupId>org.apache.axis2</groupId>
  265 + <artifactId>axis2-transport-http</artifactId>
  266 + <version>1.7.4</version>
  267 + </dependency>
  268 +
  269 + <dependency>
  270 + <groupId>org.dbunit</groupId>
  271 + <artifactId>dbunit</artifactId>
  272 + <version>2.4.9</version>
  273 + <scope>test</scope>
  274 +
  275 + <exclusions>
  276 + <exclusion>
  277 + <groupId>org.slf4j</groupId>
  278 + <artifactId>slf4j-api</artifactId>
  279 + </exclusion>
  280 + </exclusions>
  281 + </dependency>
  282 +
  283 + <dependency>
  284 + <groupId>com.h2database</groupId>
  285 + <artifactId>h2</artifactId>
  286 + <version>1.2.132</version>
  287 + <scope>test</scope>
  288 + </dependency>
  289 +
  290 +
  291 + <dependency>
  292 + <groupId>ojdbc</groupId>
  293 + <artifactId>ojdbc</artifactId>
  294 + <version>14</version>
  295 + </dependency>
  296 +
  297 + <dependency>
  298 + <groupId>org.apache.mina</groupId>
  299 + <artifactId>mina-core</artifactId>
  300 + <version>2.0.13</version>
  301 + </dependency>
  302 +
  303 + <dependency>
  304 + <groupId>com.google.protobuf</groupId>
  305 + <artifactId>protobuf-java</artifactId>
  306 + <version>3.3.0</version>
  307 + </dependency>
  308 +
  309 + <dependency>
  310 + <groupId>com.github.stuxuhai</groupId>
  311 + <artifactId>jpinyin</artifactId>
  312 + <version>1.1.8</version>
  313 + </dependency>
  314 +
  315 + <!-- dubbo 需要的jar start -->
  316 + <dependency>
  317 + <groupId>com.alibaba</groupId>
  318 + <artifactId>dubbo</artifactId>
  319 + <!--<version>2.6.3</version>-->
  320 + <version>2.5.3</version>
  321 + <exclusions>
  322 + <exclusion>
  323 + <groupId>org.springframework</groupId>
  324 + <artifactId>spring</artifactId>
  325 + </exclusion>
  326 + <exclusion>
  327 + <groupId>log4j</groupId>
  328 + <artifactId>log4j</artifactId>
  329 + </exclusion>
  330 + </exclusions>
  331 + </dependency>
  332 +
  333 + <dependency>
  334 + <groupId>org.apache.zookeeper</groupId>
  335 + <artifactId>zookeeper</artifactId>
  336 + <version>3.4.5</version>
  337 + <exclusions>
  338 + <exclusion>
  339 + <groupId>log4j</groupId>
  340 + <artifactId>log4j</artifactId>
  341 + </exclusion>
  342 + <exclusion>
  343 + <groupId>org.slf4j</groupId>
  344 + <artifactId>slf4j-log4j12</artifactId>
  345 + </exclusion>
  346 + </exclusions>
  347 + </dependency>
  348 +
  349 + <dependency>
  350 + <groupId>com.101tec</groupId>
  351 + <artifactId>zkclient</artifactId>
  352 + <version>0.3</version>
  353 + <exclusions>
  354 + <exclusion>
  355 + <groupId>log4j</groupId>
  356 + <artifactId>log4j</artifactId>
  357 + </exclusion>
  358 + </exclusions>
  359 + </dependency>
  360 +
  361 + <!-- plan common工程依赖 -->
  362 + <dependency>
  363 + <groupId>com.bsth.control_v2</groupId>
  364 + <artifactId>plan_module-common</artifactId>
  365 + <version>1.0-SNAPSHOT</version>
  366 + </dependency>
  367 + <!-- plan common config 工程依赖 -->
  368 + <dependency>
  369 + <groupId>com.bsth.control_v2</groupId>
  370 + <artifactId>plan_module-common-config</artifactId>
  371 + <version>1.0-SNAPSHOT</version>
  372 + </dependency>
  373 + <dependency>
  374 + <groupId>org.slf4j</groupId>
  375 + <artifactId>slf4j-api</artifactId>
  376 + <version>1.7.7</version>
  377 + </dependency>
  378 + <dependency>
  379 + <groupId>ch.qos.logback</groupId>
  380 + <artifactId>logback-classic</artifactId>
  381 + <version>1.1.11</version>
  382 + </dependency>
  383 + <dependency>
  384 + <groupId>org.slf4j</groupId>
  385 + <artifactId>log4j-over-slf4j</artifactId>
  386 + <version>1.7.7</version>
  387 + </dependency>
  388 +
  389 + <!-- web服务依赖 -->
  390 + <dependency>
  391 + <groupId>org.springframework.boot</groupId>
  392 + <artifactId>spring-boot-starter-web-services</artifactId>
  393 + </dependency>
  394 + <dependency>
  395 + <groupId>wsdl4j</groupId>
  396 + <artifactId>wsdl4j</artifactId>
  397 + </dependency>
  398 +
  399 + </dependencies>
  400 +
  401 + <dependencyManagement>
  402 + <dependencies>
  403 + <!-- drools 6依赖 -->
  404 + <dependency>
  405 + <groupId>org.drools</groupId>
  406 + <artifactId>drools-bom</artifactId>
  407 + <type>pom</type>
  408 + <version>6.3.0.Final</version>
  409 + <scope>import</scope>
  410 + </dependency>
  411 + </dependencies>
  412 + </dependencyManagement>
  413 +
  414 + <build>
  415 + <plugins>
  416 + <plugin>
  417 + <artifactId>maven-compiler-plugin</artifactId>
  418 + <version>2.3.2</version><!--$NO-MVN-MAN-VER$ -->
  419 + <configuration>
  420 + <source>1.8</source>
  421 + <target>1.8</target>
  422 + </configuration>
  423 + </plugin>
  424 + <plugin>
  425 + <artifactId>maven-war-plugin</artifactId>
  426 + <version>2.2</version><!--$NO-MVN-MAN-VER$ -->
  427 + <configuration>
  428 + <failOnMissingWebXml>false</failOnMissingWebXml>
  429 + </configuration>
  430 + </plugin>
  431 + <plugin>
  432 + <groupId>org.springframework.boot</groupId>
  433 + <artifactId>spring-boot-maven-plugin</artifactId>
  434 + </plugin>
  435 + <plugin>
  436 + <groupId>org.codehaus.mojo</groupId>
  437 + <artifactId>jaxb2-maven-plugin</artifactId>
  438 + <version>1.6</version>
  439 + <executions>
  440 + <execution>
  441 + <id>xjc</id>
  442 + <phase>none</phase>
  443 + <goals>
  444 + <goal>xjc</goal>
  445 + </goals>
  446 + </execution>
  447 + </executions>
  448 + <configuration>
  449 + <schemaDirectory>${project.basedir}/src/main/resources/xsd/</schemaDirectory>
  450 + <outputDirectory>${project.basedir}/src/main/java</outputDirectory>
  451 + <clearOutputDir>false</clearOutputDir>
  452 + <encoding>utf-8</encoding>
  453 + </configuration>
  454 + </plugin>
  455 + </plugins>
  456 + <resources>
  457 + <resource>
  458 + <directory>src/main/resources</directory>
  459 + <filtering>false</filtering>
  460 + </resource>
  461 + </resources>
  462 + </build>
  463 + <repositories>
  464 + <repository>
  465 + <id>spring-snapshots</id>
  466 + <url>http://repo.spring.io/snapshot</url>
  467 + <snapshots>
  468 + <enabled>true</enabled>
  469 + </snapshots>
  470 + </repository>
  471 + <repository>
  472 + <id>spring-milestones</id>
  473 + <url>http://repo.spring.io/milestone</url>
  474 + </repository>
  475 + </repositories>
  476 + <pluginRepositories>
  477 + <pluginRepository>
  478 + <id>spring-snapshots</id>
  479 + <url>http://repo.spring.io/snapshot</url>
  480 + </pluginRepository>
  481 + <pluginRepository>
  482 + <id>spring-milestones</id>
  483 + <url>http://repo.spring.io/milestone</url>
  484 + </pluginRepository>
  485 + </pluginRepositories>
  486 +
  487 + <properties>
  488 + <start-class>com.bsth.Application</start-class>
  489 + </properties>
  490 +</project>
... ...
src/main/java/com/bsth/Application.java
1   -package com.bsth;
2   -
3   -import com.fasterxml.jackson.databind.ObjectMapper;
4   -import com.fasterxml.jackson.databind.SerializationFeature;
5   -import org.springframework.boot.SpringApplication;
6   -import org.springframework.boot.autoconfigure.SpringBootApplication;
7   -import org.springframework.boot.builder.SpringApplicationBuilder;
8   -import org.springframework.boot.context.web.SpringBootServletInitializer;
9   -import org.springframework.context.annotation.Bean;
10   -import org.springframework.context.annotation.Primary;
11   -import org.springframework.transaction.annotation.EnableTransactionManagement;
12   -
13   -import java.util.concurrent.Executors;
14   -import java.util.concurrent.ScheduledExecutorService;
15   -
16   -@EnableTransactionManagement
17   -@SpringBootApplication
18   -public class Application extends SpringBootServletInitializer {
19   -
20   - public static ScheduledExecutorService mainServices = Executors.newScheduledThreadPool(18);
21   -
22   - @Override
23   - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
24   - return application.sources(Application.class);
25   - }
26   -
27   - @Bean
28   - @Primary
29   - public ObjectMapper objectMapper() {
30   - ObjectMapper objectMapper = new ObjectMapper();
31   - objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
32   -
33   - return objectMapper;
34   - }
35   -
36   - public static void main(String[] args) throws Exception {
37   - SpringApplication.run(Application.class, args);
38   - }
  1 +package com.bsth;
  2 +
  3 +import com.fasterxml.jackson.databind.ObjectMapper;
  4 +import com.fasterxml.jackson.databind.SerializationFeature;
  5 +import org.springframework.boot.SpringApplication;
  6 +import org.springframework.boot.autoconfigure.SpringBootApplication;
  7 +import org.springframework.boot.builder.SpringApplicationBuilder;
  8 +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
  9 +import org.springframework.context.annotation.Bean;
  10 +import org.springframework.context.annotation.Primary;
  11 +import org.springframework.transaction.annotation.EnableTransactionManagement;
  12 +
  13 +import java.util.concurrent.Executors;
  14 +import java.util.concurrent.ScheduledExecutorService;
  15 +
  16 +@EnableTransactionManagement
  17 +@SpringBootApplication
  18 +public class Application extends SpringBootServletInitializer {
  19 +
  20 + public static ScheduledExecutorService mainServices = Executors.newScheduledThreadPool(18);
  21 +
  22 + @Override
  23 + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
  24 + return application.sources(Application.class);
  25 + }
  26 +
  27 + @Bean
  28 + @Primary
  29 + public ObjectMapper objectMapper() {
  30 + ObjectMapper objectMapper = new ObjectMapper();
  31 + objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
  32 +
  33 + return objectMapper;
  34 + }
  35 +
  36 + public static void main(String[] args) throws Exception {
  37 + SpringApplication.run(Application.class, args);
  38 + }
39 39 }
40 40 \ No newline at end of file
... ...
src/main/java/com/bsth/WebAppConfiguration.java
1   -package com.bsth;
2   -
3   -import com.bsth.filter.ResourceFilter;
4   -import com.bsth.websocket.WebSocketHandshakeInterceptor;
5   -import com.bsth.websocket.handler.RealControlSocketHandler;
6   -import org.slf4j.Logger;
7   -import org.slf4j.LoggerFactory;
8   -import org.springframework.boot.context.embedded.FilterRegistrationBean;
9   -import org.springframework.context.annotation.Bean;
10   -import org.springframework.context.annotation.ComponentScan;
11   -import org.springframework.context.annotation.Configuration;
12   -import org.springframework.web.filter.CharacterEncodingFilter;
13   -import org.springframework.web.filter.HttpPutFormContentFilter;
14   -import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
15   -import org.springframework.web.socket.config.annotation.EnableWebSocket;
16   -import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
17   -import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
18   -import org.springframework.web.socket.server.standard.ServletServerContainerFactoryBean;
19   -
20   -import javax.servlet.Filter;
21   -
22   -@Configuration
23   -@EnableWebSocket
24   -@ComponentScan
25   -public class WebAppConfiguration extends WebMvcConfigurerAdapter implements WebSocketConfigurer{
26   -
27   -// @Autowired
28   -// HttpOpLogInterceptor httpOpLogInterceptor;
29   -
30   - Logger logger = LoggerFactory.getLogger(this.getClass());
31   -
32   - /**
33   - * @Title: httpPutFormContentFilter
34   - * @Description: TODO(弥补浏览器不支持PUT/DELETE,对携带 _method 参数的请求进行转换)
35   - */
36   - @Bean
37   - public Filter httpPutFormContentFilter() {
38   - return new HttpPutFormContentFilter();
39   - }
40   -
41   - /**
42   - * @Title: characterEncodingFilter
43   - * @Description: TODO(编码过滤器)
44   - */
45   - @Bean
46   - public Filter characterEncodingFilter(){
47   - return new CharacterEncodingFilter("UTF-8");
48   - }
49   -
50   - /**
51   - *
52   - * @Title: resourceFilterRegistration
53   - * @Description: TODO(静态资源过滤器, 只处理 /pages 目录下的片段请求 )
54   - */
55   - @Bean
56   - public FilterRegistrationBean resourceFilterRegistration(){
57   - FilterRegistrationBean registration = new FilterRegistrationBean();
58   - registration.setFilter(new ResourceFilter());
59   - registration.addUrlPatterns("/pages/*");
60   - return registration;
61   - }
62   -
63   - /**
64   - *
65   - * @Title: addInterceptors
66   - * @Description: TODO(HTTP结构化访问日志记录 )
67   -
68   - @Override
69   - public void addInterceptors(InterceptorRegistry registry) {
70   - registry.addInterceptor(httpOpLogInterceptor);
71   - }*/
72   -
73   - @Override
74   - public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
75   - //线调webSocket
76   - registry.addHandler(new RealControlSocketHandler(), "/sockjs/realcontrol").addInterceptors(new WebSocketHandshakeInterceptor())
77   - .withSockJS();
78   - }
79   -
80   - /**
81   - * 增加websocket的输出缓冲区
82   - * @return
83   - */
84   - @Bean
85   - public ServletServerContainerFactoryBean createServletServerContainerFactoryBean() {
86   - ServletServerContainerFactoryBean container = new ServletServerContainerFactoryBean();
87   - container.setMaxTextMessageBufferSize(52768);
88   - container.setMaxBinaryMessageBufferSize(52768);
89   - logger.info("Websocket factory returned");
90   - return container;
91   - }
92   -}
  1 +package com.bsth;
  2 +
  3 +import com.bsth.filter.ResourceFilter;
  4 +import com.bsth.websocket.WebSocketHandshakeInterceptor;
  5 +import com.bsth.websocket.handler.RealControlSocketHandler;
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.boot.web.servlet.FilterRegistrationBean;
  9 +import org.springframework.context.annotation.Bean;
  10 +import org.springframework.context.annotation.ComponentScan;
  11 +import org.springframework.context.annotation.Configuration;
  12 +import org.springframework.web.filter.CharacterEncodingFilter;
  13 +import org.springframework.web.filter.FormContentFilter;
  14 +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
  15 +import org.springframework.web.socket.config.annotation.EnableWebSocket;
  16 +import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
  17 +import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
  18 +
  19 +import javax.servlet.Filter;
  20 +
  21 +/**
  22 + * @author Hill
  23 + */
  24 +@Configuration
  25 +@EnableWebSocket
  26 +@ComponentScan
  27 +public class WebAppConfiguration implements WebSocketConfigurer, WebMvcConfigurer {
  28 +
  29 + /**
  30 + * @Title: httpPutFormContentFilter
  31 + * @Description: TODO(弥补浏览器不支持PUT/DELETE,对携带 _method 参数的请求进行转换)
  32 + */
  33 + @Bean
  34 + public Filter httpPutFormContentFilter() {
  35 + return new FormContentFilter();
  36 + }
  37 +
  38 + /**
  39 + * @Title: characterEncodingFilter
  40 + * @Description: TODO(编码过滤器)
  41 + */
  42 + /*@Bean
  43 + public Filter characterEncodingFilter(){
  44 + return new CharacterEncodingFilter("UTF-8");
  45 + }*/
  46 +
  47 + /**
  48 + *
  49 + * @Title: resourceFilterRegistration
  50 + * @Description: TODO(静态资源过滤器, 只处理 /pages 目录下的片段请求 )
  51 + */
  52 + @Bean
  53 + public FilterRegistrationBean resourceFilterRegistration(){
  54 + FilterRegistrationBean registration = new FilterRegistrationBean();
  55 + registration.setFilter(new ResourceFilter());
  56 + registration.addUrlPatterns("/pages/*");
  57 + return registration;
  58 + }
  59 +
  60 + @Override
  61 + public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
  62 + //线调webSocket
  63 + registry.addHandler(new RealControlSocketHandler(), "/sockjs/realcontrol").addInterceptors(new WebSocketHandshakeInterceptor())
  64 + .withSockJS();
  65 + }
  66 +}
... ...
src/main/java/com/bsth/XDApplication.java
  1 +<<<<<<< HEAD
1 2 package com.bsth;
2 3  
3 4 import com.bsth.data.BasicData;
... ... @@ -195,3 +196,274 @@ public class XDApplication implements CommandLineRunner {
195 196 //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);
196 197 }
197 198 }
  199 +=======
  200 +package com.bsth;
  201 +
  202 +import com.bsth.data.BasicData;
  203 +import com.bsth.data.LineVersionsData;
  204 +import com.bsth.data.ThreadMonotor;
  205 +import com.bsth.data.car_out_info.UpdateDBThread;
  206 +import com.bsth.data.directive.DirectivesPstThread;
  207 +import com.bsth.data.forecast.SampleTimeDataLoader;
  208 +import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
  209 +import com.bsth.data.gpsdata_v2.thread.OfflineMonitorThread;
  210 +import com.bsth.data.gpsdata_v2.thread.RfidDataLoaderThread;
  211 +import com.bsth.data.msg_queue.DirectivePushQueue;
  212 +import com.bsth.data.msg_queue.WebSocketPushQueue;
  213 +import com.bsth.data.safe_driv.SafeDrivDataLoadThread;
  214 +import com.bsth.data.schedule.DayOfSchedule;
  215 +import com.bsth.data.schedule.auto_exec.AutoExecScanThread;
  216 +import com.bsth.data.schedule.e_state_check.thread.FixedCheckStationCodeThread;
  217 +import com.bsth.data.schedule.edit_logs.SeiPstThread;
  218 +import com.bsth.data.schedule.late_adjust.ScheduleLateThread;
  219 +import com.bsth.data.schedule.signal.SchSiginUpdateDBThread;
  220 +import com.bsth.data.schedule.thread.CalcOilThread;
  221 +import com.bsth.data.schedule.thread.SchedulePstThread;
  222 +import com.bsth.data.schedule.thread.ScheduleRefreshThread;
  223 +import com.bsth.data.schedule.thread.SubmitToTrafficManage;
  224 +import com.bsth.util.DateUtils;
  225 +import com.bsth.util.Tools;
  226 +import org.slf4j.Logger;
  227 +import org.slf4j.LoggerFactory;
  228 +import org.springframework.beans.factory.annotation.Autowired;
  229 +import org.springframework.boot.CommandLineRunner;
  230 +import org.springframework.stereotype.Component;
  231 +
  232 +import java.util.concurrent.ScheduledExecutorService;
  233 +import java.util.concurrent.TimeUnit;
  234 +
  235 +/**
  236 + * 线调大部分服务都在这里启动
  237 + * Created by panzhao on 2017/5/14.
  238 + */
  239 +@Component
  240 +public class XDApplication implements CommandLineRunner {
  241 +
  242 + Logger log = LoggerFactory.getLogger(this.getClass());
  243 +
  244 + @Autowired
  245 + BasicData.BasicDataLoader basicDataLoader;
  246 + @Autowired
  247 + UpdateDBThread fcxxUpdateThread;
  248 + @Autowired
  249 + ScheduleRefreshThread scheduleRefreshThread;
  250 + @Autowired
  251 + SchedulePstThread schedulePstThread;
  252 + @Autowired
  253 + ScheduleLateThread scheduleLateThread;
  254 + @Autowired
  255 + SubmitToTrafficManage submitToTrafficManage;
  256 + @Autowired
  257 + CalcOilThread calcOilThread;
  258 + @Autowired
  259 + DirectivesPstThread directivesPstThread;
  260 + @Autowired
  261 + ThreadMonotor threadMonotor;
  262 + @Autowired
  263 + SeiPstThread seiPstThread;
  264 + @Autowired
  265 + SampleTimeDataLoader sampleTimeDataLoader;
  266 + @Autowired
  267 + SchSiginUpdateDBThread schSiginUpdateDBThread;
  268 + @Autowired
  269 + AutoExecScanThread autoExecScanThread;
  270 +
  271 + @Autowired
  272 + GpsDataLoaderThread gpsDataLoader;
  273 + @Autowired
  274 + RfidDataLoaderThread rfidDataLoader;
  275 +
  276 + @Autowired
  277 + OfflineMonitorThread offlineMonitorThread;
  278 +
  279 + @Autowired
  280 + LineVersionsData lineVersionsData;
  281 +
  282 + /*@Autowired
  283 + FixedEnableVerionsThread fixedEnableVerionsThread;*/
  284 +
  285 + @Autowired
  286 + SafeDrivDataLoadThread safeDrivDataLoadThread;
  287 +
  288 + @Autowired
  289 + FixedCheckStationCodeThread fixedCheckStationCodeThread;
  290 +
  291 + private static long timeDiff;
  292 + private static long timeDiffTraffic;
  293 +
  294 + static {
  295 + // 早上2:20
  296 + timeDiff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis();
  297 + if (timeDiff < 0)
  298 + timeDiff += (1000 * 60 * 60 * 24);
  299 + // 早上07:00
  300 + timeDiffTraffic = (DateUtils.getTimestamp() + 1000 * 60 * 60 * 7) - System.currentTimeMillis();
  301 + if (timeDiffTraffic < 0)
  302 + timeDiffTraffic += (1000 * 60 * 60 * 24);
  303 + }
  304 +
  305 + @Override
  306 + public void run(String... strings) throws Exception {
  307 + try {
  308 + Tools tools = new Tools("application.properties");
  309 + String environment = tools.getValue("spring.profiles.active");
  310 + //预先加载基础的对照数据
  311 + basicDataLoader.loadAllData();
  312 + switch (environment){
  313 + case "dev":
  314 + devInit();
  315 + break;
  316 + case "prod":
  317 + prodInit();
  318 + break;
  319 + case "test":
  320 + testInit();
  321 + break;
  322 + default:
  323 + break;
  324 + }
  325 + }catch (Exception e){
  326 + log.error("线调后台启动出现异常!!", e);
  327 + System.exit(1);
  328 + }
  329 + }
  330 +
  331 + @Autowired
  332 + DayOfSchedule dayOfSchedule;
  333 + public void devInit(){
  334 + log.info("devInit...");
  335 + ScheduledExecutorService sexec = Application.mainServices;
  336 + //抓取GPS数据
  337 + gpsDataLoader.setFlag(-1);
  338 + //dayOfSchedule.dataRecovery();
  339 +
  340 + //安全驾驶
  341 + sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
  342 +
  343 + /** 线调业务 */
  344 + sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
  345 + sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
  346 + sexec.scheduleWithFixedDelay(gpsDataLoader, 100, 2, TimeUnit.SECONDS);//抓取GPS数据
  347 + //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
  348 + sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码
  349 +
  350 + sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
  351 + sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程
  352 + sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库
  353 + sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库
  354 + sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
  355 + sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据
  356 + sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新
  357 + sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行
  358 + //DirectivePushQueue.start();//消息队列 -指令,系统下发的
  359 + WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的
  360 +
  361 + /** 线调为其他程序提供的数据 --写入数据库 */
  362 + sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
  363 + //线路首末班数据(网关用,班次更新时写入)
  364 + //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
  365 + sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)
  366 +
  367 + //运管处静态数据提交
  368 + //log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
  369 + //sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  370 + //计算油、公里加注
  371 + sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  372 +
  373 + //线路版本更新
  374 + sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);
  375 +
  376 + //线路版本更新
  377 + //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);
  378 + }
  379 +
  380 + public void prodInit(){
  381 + log.info("prodInit...");
  382 + ScheduledExecutorService sexec = Application.mainServices;
  383 + //安全驾驶
  384 + sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
  385 +
  386 + GpsDataLoaderThread.setFlag(-1);
  387 + /** 线调业务 */
  388 + sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
  389 + sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
  390 + sexec.scheduleWithFixedDelay(gpsDataLoader, 0, 2, TimeUnit.SECONDS);//抓取GPS数据
  391 + //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
  392 + sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码
  393 +
  394 + sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
  395 + sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程
  396 + sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库
  397 + sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库
  398 + sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
  399 + sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据
  400 + sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新
  401 + sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行
  402 + DirectivePushQueue.start();//消息队列 -指令,系统下发的
  403 + WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的
  404 +
  405 + /** 线调为其他程序提供的数据 --写入数据库 */
  406 + sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
  407 + //线路首末班数据(网关用,班次更新时写入)
  408 + //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
  409 + sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)
  410 +
  411 + //运管处静态数据提交
  412 + log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
  413 + sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  414 + //计算油、公里加注
  415 + sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  416 +
  417 + //线路版本更新
  418 + sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);
  419 +
  420 + //线路版本更新
  421 + //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);
  422 + }
  423 +
  424 + public void testInit(){
  425 + log.info("testInit...");
  426 + ScheduledExecutorService sexec = Application.mainServices;
  427 + //安全驾驶
  428 + sexec.scheduleWithFixedDelay(safeDrivDataLoadThread, 180, 10, TimeUnit.SECONDS);
  429 +
  430 + GpsDataLoaderThread.setFlag(-1);
  431 + //dayOfSchedule.dataRecovery();
  432 + /** 线调业务 */
  433 + sexec.scheduleWithFixedDelay(scheduleRefreshThread, 10, 120, TimeUnit.SECONDS);//班次更新线程
  434 + sexec.scheduleWithFixedDelay(scheduleLateThread, 140, 20, TimeUnit.SECONDS);//检查班次误点
  435 + sexec.scheduleWithFixedDelay(gpsDataLoader, 0, 2, TimeUnit.SECONDS);//抓取GPS数据
  436 + //sexec.scheduleWithFixedDelay(rfidDataLoader, 5, 5, TimeUnit.SECONDS);//抓取RFID数据
  437 + sexec.scheduleWithFixedDelay(fixedCheckStationCodeThread, 60, 60 * 5, TimeUnit.SECONDS);//检查班次站点编码
  438 +
  439 + sexec.scheduleWithFixedDelay(offlineMonitorThread, 120, 60, TimeUnit.SECONDS);//GPS设备掉离线
  440 + sexec.scheduleWithFixedDelay(schedulePstThread, 180, 10, TimeUnit.SECONDS);//班次延迟入库线程
  441 + sexec.scheduleWithFixedDelay(seiPstThread, 180, 60, TimeUnit.SECONDS);//班次修正日志入库
  442 + sexec.scheduleWithFixedDelay(directivesPstThread, 120, 60, TimeUnit.SECONDS);//调度指令延迟入库
  443 + sexec.scheduleWithFixedDelay(threadMonotor, 240, 60, TimeUnit.SECONDS);//线程监听(防止重要的线程阻塞、异常结束。以及部分主备切换工作)
  444 + sexec.scheduleWithFixedDelay(sampleTimeDataLoader, 140, 120 * 60, TimeUnit.SECONDS);//到离站预测需要的站点间耗时数据
  445 + sexec.scheduleWithFixedDelay(basicDataLoader, 1, 1, TimeUnit.HOURS);//基础数据更新
  446 + sexec.scheduleWithFixedDelay(autoExecScanThread, 180, 50, TimeUnit.SECONDS);//班次自动执行
  447 + //DirectivePushQueue.start();//消息队列 -指令,系统下发的
  448 + WebSocketPushQueue.start();//消息队列 -webSocket ,推送至线调web页面的
  449 +
  450 + /** 线调为其他程序提供的数据 --写入数据库 */
  451 + sexec.scheduleWithFixedDelay(fcxxUpdateThread, 160, 30, TimeUnit.SECONDS);//发车信息(发车屏、信息发布)
  452 + //线路首末班数据(网关用,班次更新时写入)
  453 + //com.bsth.data.schedule.f_a_l.FirstAndLastHandler
  454 + sexec.scheduleWithFixedDelay(schSiginUpdateDBThread, 160, 60 * 30, TimeUnit.SECONDS);//无法自动完成的班次信息(网关用,补信号)
  455 +
  456 + //运管处静态数据提交
  457 + //log.info(timeDiff / 1000 / 60 + "分钟之后提交到运管处");
  458 + //sexec.scheduleAtFixedRate(submitToTrafficManage, timeDiffTraffic / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  459 + //计算油、公里加注
  460 + sexec.scheduleAtFixedRate(calcOilThread, timeDiff / 1000, 60 * 60 * 24, TimeUnit.SECONDS);
  461 +
  462 + //线路版本更新
  463 + sexec.scheduleWithFixedDelay(lineVersionsData, 60 * 5, 60 * 15, TimeUnit.SECONDS);
  464 +
  465 + //线路版本更新
  466 + //sexec.scheduleWithFixedDelay(fixedEnableVerionsThread, 60 * 4, 60 * 2 , TimeUnit.SECONDS);
  467 + }
  468 +}
  469 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
... ...
src/main/java/com/bsth/common/Constants.java
... ... @@ -23,6 +23,11 @@ public class Constants {
23 23 public static final String XIANDIAO_LOGIN = "/xdlogin.html";
24 24 public static final String IPAD_IMG_URL = "/apple-touch-icon-72x72.png";
25 25  
  26 + // springboot manage health的检测url
  27 + public static final String ACTUATOR_MANAGEMENT_HEALTH = "/manage/health";
  28 + // web服务url
  29 + public static final String WEBSERVICE_URL = "/ws/**";
  30 +
26 31 //对外的营运数据接口
27 32 public static final String SERVICE_INTERFACE = "/companyService/**";
28 33  
... ...
src/main/java/com/bsth/controller/LineController.java
... ... @@ -81,6 +81,10 @@ public class LineController extends BaseController&lt;Line, Integer&gt; {
81 81 map.put("status", ResponseCode.ERROR);
82 82 return map;
83 83 }
  84 + if(t.getDestroy() == 0){
  85 + t.setInUse(1);
  86 + } else
  87 + t.setInUse(0);
84 88 // 添加线路版本
85 89 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
86 90 try {
... ... @@ -132,4 +136,14 @@ public class LineController extends BaseController&lt;Line, Integer&gt; {
132 136 public Map<String, Object> remove(Integer id){
133 137 return service.remove(id);
134 138 }
  139 +
  140 + /**
  141 + * 查询外部行业编码是否有更新
  142 + * @param id
  143 + * @return
  144 + */
  145 + @RequestMapping(value ="/getLineMatchStationIsUpdate" , method = RequestMethod.GET)
  146 + public Map<String, Object> getLineMatchStationIsUpdate(@RequestParam(defaultValue = "id") Integer id){
  147 + return service.getLineMatchStationIsUpdate(id);
  148 + }
135 149 }
... ...
src/main/java/com/bsth/controller/LineVersionsController.java
1 1 package com.bsth.controller;
2 2  
3   -import java.util.List;
4   -import java.util.Map;
5   -
  3 +import com.bsth.entity.LineVersions;
  4 +import com.bsth.entity.LsSectionRoute;
  5 +import com.bsth.entity.LsStationRoute;
  6 +import com.bsth.repository.LineRepository;
  7 +import com.bsth.repository.LsSectionRouteRepository;
  8 +import com.bsth.repository.LsStationRouteRepository;
  9 +import com.bsth.service.LineVersionsService;
6 10 import org.springframework.beans.factory.annotation.Autowired;
7 11 import org.springframework.web.bind.annotation.RequestMapping;
8 12 import org.springframework.web.bind.annotation.RequestMethod;
9 13 import org.springframework.web.bind.annotation.RequestParam;
10 14 import org.springframework.web.bind.annotation.RestController;
11 15  
12   -import com.bsth.entity.LineVersions;
13   -import com.bsth.repository.LineRepository;
14   -import com.bsth.service.LineVersionsService;
  16 +import java.util.List;
  17 +import java.util.Map;
15 18  
16 19 /**
17 20 *
... ... @@ -33,6 +36,13 @@ public class LineVersionsController extends BaseController&lt;LineVersions, Integer
33 36 @Autowired
34 37 private LineVersionsService service;
35 38  
  39 +
  40 + @Autowired
  41 + private LsStationRouteRepository lsStationRouteRepository;
  42 +
  43 + @Autowired
  44 + private LsSectionRouteRepository lsSectionRouteRepository;
  45 +
36 46 @Autowired
37 47 LineRepository lineRepository;
38 48  
... ... @@ -44,6 +54,11 @@ public class LineVersionsController extends BaseController&lt;LineVersions, Integer
44 54 return service.findLineVersionsMax(lineId);
45 55 }
46 56  
  57 + @RequestMapping(value = "findAllHistroyLineVersionsById", method = RequestMethod.GET)
  58 + public List<LineVersions> findAllHistroyLineVersionsById(@RequestParam(defaultValue = "lineId") int lineId) {
  59 + return service.findAllHistroyLineVersionsById(lineId);
  60 + }
  61 +
47 62 /**
48 63 * 获取线路所有版本
49 64 *
... ... @@ -76,6 +91,12 @@ public class LineVersionsController extends BaseController&lt;LineVersions, Integer
76 91 return service.add(map);
77 92 }
78 93  
  94 + @RequestMapping(value = "delete", method = RequestMethod.POST)
  95 + public Map<String, Object> delete(@RequestParam (defaultValue = "id") int id) {
  96 +
  97 + return service.deleteAllData(id);
  98 + }
  99 +
79 100 /**
80 101 * 根据线路id获取当前版本号
81 102 *
... ...
src/main/java/com/bsth/controller/RefuelController.java 0 → 100644
  1 +package com.bsth.controller;
  2 +
  3 +import com.bsth.entity.Refuel;
  4 +import com.bsth.service.RefuelService;
  5 +import com.google.common.io.Files;
  6 +
  7 +import java.io.File;
  8 +import java.util.List;
  9 +import java.util.Map;
  10 +
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.web.bind.annotation.RequestMapping;
  13 +import org.springframework.web.bind.annotation.RequestMethod;
  14 +import org.springframework.web.bind.annotation.RequestParam;
  15 +import org.springframework.web.bind.annotation.RestController;
  16 +import org.springframework.web.multipart.MultipartFile;
  17 +
  18 +/**
  19 + * Created in 19/9/3.
  20 + */
  21 +@RestController
  22 +@RequestMapping("refuel")
  23 +public class RefuelController extends BaseController<Refuel, Long> {
  24 +
  25 + @Autowired
  26 + private RefuelService refuelService;
  27 +
  28 + @RequestMapping(value = "/query", method = RequestMethod.GET)
  29 + public List<Refuel> query(@RequestParam Map<String, Object> map){
  30 + return refuelService.query(map);
  31 + }
  32 +
  33 + @RequestMapping(value = "/queryDaily", method = RequestMethod.GET)
  34 + public List<Map<String, Object>> queryDaily(@RequestParam Map<String, Object> map){
  35 + return refuelService.queryDaily(map);
  36 + }
  37 +
  38 + @RequestMapping(value = "/uploadFile",method = RequestMethod.POST)
  39 + public String uploadFile(MultipartFile file) throws Exception{
  40 + File newFile = new File(
  41 + getDataImportClasspath() + File.separator +
  42 + file.getOriginalFilename());
  43 + Files.write(file.getBytes(), newFile);
  44 + String result = refuelService.importExcel(newFile);
  45 + return "{\"result\":" + "\""+result+"\"}";
  46 + }
  47 +
  48 + private String getDataImportClasspath(){
  49 + return this.getClass().getResource("/").getPath() + "/static/pages/forms";
  50 + }
  51 +
  52 +}
... ...
src/main/java/com/bsth/controller/SectionRouteController.java
... ... @@ -36,6 +36,13 @@ public class SectionRouteController extends BaseController&lt;SectionRoute, Integer
36 36 @Autowired
37 37 SectionRouteService routeService;
38 38  
  39 + @RequestMapping(value = "/allls", method = RequestMethod.GET)
  40 + public Map allls(@RequestParam Map<String, Object> map) {
  41 +
  42 + return routeService.pageLs(map);
  43 + }
  44 +
  45 +
39 46 /**
40 47 * @param map
41 48 * @throws
... ... @@ -50,8 +57,17 @@ public class SectionRouteController extends BaseController&lt;SectionRoute, Integer
50 57 * @Description: TODO(撤销路段)
51 58 */
52 59 @RequestMapping(value = "/destroy", method = RequestMethod.POST)
53   - public Map<String, Object> destroy(@RequestParam Integer id) {
54   - return routeService.destroy(id);
  60 + public Map<String, Object> destroy(@RequestParam Map<String, Object> map) {
  61 +
  62 + int id = Integer.parseInt(map.get("id").toString());
  63 +
  64 + if(map.get("status") == null || Integer.parseInt(map.get("status").toString()) == 1) {
  65 + return routeService.destroy(id);
  66 + }else if(Integer.parseInt(map.get("status").toString()) == 2){
  67 + return routeService.destroyHistory(id);
  68 + }else {
  69 + return map;
  70 + }
55 71 }
56 72  
57 73 /**
... ...
src/main/java/com/bsth/controller/StationController.java
... ... @@ -127,7 +127,7 @@ public class StationController extends BaseController&lt;Station, Integer&gt; {
127 127 */
128 128 @RequestMapping(value="stationUpdate" , method = RequestMethod.POST)
129 129 public Map<String, Object> stationUpdate(@RequestParam Map<String, Object> map) {
130   - map.put("updateBy", "");
  130 + map.put("updateBy", ""); //??
131 131 return service.stationUpdate(map);
132 132 }
133 133  
... ... @@ -159,11 +159,11 @@ public class StationController extends BaseController&lt;Station, Integer&gt; {
159 159 public int updateStationAndSectionCode(@RequestParam Integer stationCount, Integer sectionCount) {
160 160 System.out.println(stationCount+" _ "+ sectionCount );
161 161 for(int i = 0; i < stationCount; i++) {
162   - System.out.println(i);
  162 +// System.out.println(i);
163 163 GetUIDAndCode.getStationId();
164 164 }
165 165 for(int j = 0; j < sectionCount; j++) {
166   - System.out.println(j);
  166 +// System.out.println(j);
167 167 GetUIDAndCode.getSectionId();
168 168 }
169 169 return 1;
... ...
src/main/java/com/bsth/controller/StationRouteController.java
1 1 package com.bsth.controller;
2 2  
3   -import com.bsth.entity.StationRoute;
4   -import com.bsth.entity.StationRouteCache;
5   -import com.bsth.repository.StationRouteCacheRepository;
6   -import com.bsth.repository.StationRouteRepository;
7   -import com.bsth.service.StationRouteService;
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import javax.servlet.http.HttpServletResponse;
  7 +
8 8 import org.springframework.beans.factory.annotation.Autowired;
9 9 import org.springframework.web.bind.annotation.RequestMapping;
10 10 import org.springframework.web.bind.annotation.RequestMethod;
11 11 import org.springframework.web.bind.annotation.RequestParam;
12 12 import org.springframework.web.bind.annotation.RestController;
13 13  
14   -import javax.servlet.http.HttpServletResponse;
15   -import java.util.List;
16   -import java.util.Map;
  14 +import com.bsth.entity.LsStationRoute;
  15 +import com.bsth.entity.StationRoute;
  16 +import com.bsth.entity.StationRouteCache;
  17 +import com.bsth.repository.StationRouteCacheRepository;
  18 +import com.bsth.repository.StationRouteRepository;
  19 +import com.bsth.service.StationRouteService;
17 20  
18 21 /**
19 22 *
... ... @@ -40,13 +43,20 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
40 43 StationRouteRepository stationRouteRepository;
41 44 @Autowired
42 45 StationRouteCacheRepository stationRouteCacheRepository;
43   -
44   - /**
45   - * @param @param map
46   - * @throws
47   - * @Title: list
48   - * @Description: TODO(多条件查询)
49   - */
  46 +
  47 +
  48 + @RequestMapping(value = "/allls", method = RequestMethod.GET)
  49 + public Map allls(@RequestParam Map<String, Object> map) {
  50 +
  51 + return service.pageLs(map);
  52 + }
  53 +
  54 + @RequestMapping(value = "/all_ls", method = RequestMethod.GET)
  55 + public Iterable<LsStationRoute> list_ls(@RequestParam Map<String, Object> map) {
  56 + return service.list_ls(map);
  57 + }
  58 +
  59 +
50 60 @RequestMapping(value = "/all", method = RequestMethod.GET)
51 61 public Iterable<StationRoute> list(@RequestParam Map<String, Object> map) {
52 62 return service.list(map);
... ... @@ -60,7 +70,7 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
60 70 /**
61 71 * @Description :TODO(查询路段信息)
62 72 *
63   - * @param map <line.id_eq:线路ID; directions_eq:方向>
  73 + * @param id
64 74 *
65 75 * @return Map<String, Object>
66 76 */
... ... @@ -218,8 +228,8 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
218 228 * @Description: TODO(上下行切换)
219 229 */
220 230 @RequestMapping(value = "/updSwitchDir", method = RequestMethod.POST)
221   - public Map<String, Object> updSwitchDir(@RequestParam String lineIds){
222   - return service.updSwitchDir(lineIds);
  231 + public Map<String, Object> updSwitchDir(@RequestParam String lineIds, @RequestParam(value = "status", required = false)int status){
  232 + return service.updSwitchDir(lineIds,status);
223 233 }
224 234  
225 235 /**
... ... @@ -231,7 +241,7 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
231 241 public Map<String, Object> upddis(@RequestParam Map<String, Object> map) {
232 242 return service.upddis(map);
233 243 }
234   -
  244 +
235 245 /**
236 246 *
237 247 * @Title: findCacheStationRoute
... ... @@ -258,4 +268,44 @@ public class StationRouteController extends BaseController&lt;StationRoute, Integer
258 268 int dir = Integer.parseInt(map.get("dir").toString());
259 269 return service.findCachePoint(lineId, dir);
260 270 }
  271 +
  272 +
  273 + /**
  274 + * 查询博协站点
  275 + * @param map
  276 + * @return
  277 + */
  278 + @RequestMapping(value = "/findMatchStation", method = RequestMethod.GET)
  279 + public Map<String, Object> findMatchStation(@RequestParam Map<String, Object> map){
  280 + return service.findMatchStation(map);
  281 + }
  282 +
  283 + /**
  284 + * 批量修改行业编码
  285 + * @param map
  286 + * @return
  287 + */
  288 + @RequestMapping(value = "/updIndustryCode",method = RequestMethod.POST)
  289 + public Map<String, Object> updIndustryCode(@RequestParam Map<String, Object> map) {
  290 + return service.updIndustryCode(map);
  291 + }
  292 +
  293 + /**
  294 + * 匹配外部站点行业编码
  295 + * @param map
  296 + * @return
  297 + */
  298 + @RequestMapping(value = "/matchIndustryCode",method = RequestMethod.POST)
  299 + public Map<String, Object> matchIndustryCode(@RequestParam Map<String, Object> map) {
  300 + return service.matchIndustryCode(map);
  301 + }
  302 + /**
  303 + * 匹配附近站点行业编码
  304 + * @param map
  305 + * @return
  306 + */
  307 + @RequestMapping(value = "/matchNearbyStation",method = RequestMethod.GET)
  308 + public Map<String, Object> matchNearbyStation(@RequestParam Map<String, Object> map) {
  309 + return service.matchNearbyStation(map);
  310 + }
261 311 }
... ...
src/main/java/com/bsth/controller/calc/CalcExportController.java 0 → 100644
  1 +package com.bsth.controller.calc;
  2 +
  3 +import java.text.SimpleDateFormat;
  4 +import java.util.ArrayList;
  5 +import java.util.HashMap;
  6 +import java.util.Iterator;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +import org.springframework.beans.factory.annotation.Autowired;
  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 +
  16 +import com.bsth.common.ResponseCode;
  17 +import com.bsth.entity.calc.CalcWaybill;
  18 +import com.bsth.entity.mcy_forms.Waybillday;
  19 +import com.bsth.service.calc.CalcLbStatuAnalyService;
  20 +import com.bsth.service.calc.CalcMixService;
  21 +import com.bsth.service.calc.CalcWaybillService;
  22 +import com.bsth.util.ReportUtils;
  23 +
  24 +@RestController
  25 +@RequestMapping("calc_export")
  26 +public class CalcExportController {
  27 +
  28 + @Autowired
  29 + CalcWaybillService service;
  30 +
  31 + @Autowired
  32 + CalcLbStatuAnalyService lbService;
  33 +
  34 + @Autowired
  35 + CalcMixService clacMixService;
  36 +
  37 + @RequestMapping(value = "/waybilldayExport", method = RequestMethod.GET)
  38 + public Map<String, Object> calcjsyspyExport(@RequestParam Map<String, Object> map) {
  39 +
  40 + String line="";
  41 + if(map.get("line")!=null){
  42 + line=map.get("line").toString().trim();
  43 + }
  44 + String lineName="";
  45 + if(map.get("lineName")!=null){
  46 + lineName=map.get("lineName").toString().trim();
  47 + }
  48 + String startDate="";
  49 + if(map.get("startDate")!=null){
  50 + startDate=map.get("startDate").toString().trim();
  51 + }
  52 + String endDate="";
  53 + if(map.get("endDate")!=null){
  54 + endDate=map.get("endDate").toString().trim();
  55 + }
  56 + String cont="";
  57 + if(map.get("cont")!=null){
  58 + cont=map.get("cont").toString().trim();
  59 + }
  60 + String empnames="";
  61 + if(map.get("empnames")!=null){
  62 + empnames=map.get("empnames").toString().trim();
  63 + }
  64 + String gsdmManth="";
  65 + if(map.get("gsdmManth")!=null){
  66 + gsdmManth=map.get("gsdmManth").toString().trim();
  67 + }
  68 + String fgsdmManth="";
  69 + if(map.get("fgsdmManth")!=null){
  70 + fgsdmManth=map.get("fgsdmManth").toString().trim();
  71 + }
  72 +
  73 + Map<String, Object> resMap = new HashMap<String, Object>();
  74 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  75 + List<Map<String, Object>> list = clacMixService.calcjsyspy(line, startDate, endDate, empnames, cont, gsdmManth, fgsdmManth);
  76 +
  77 + Map<String, Object> temp = new HashMap<String, Object>();
  78 + temp.put("i", "序号");
  79 + temp.put("jName", empnames);
  80 + temp.put("jhyybc", "计划营运班次");
  81 + temp.put("jhfyybc", "计划空驶班次");
  82 + temp.put("sjyybc", "实际营运班次");
  83 + temp.put("sjfyybc", "实际空驶班次");
  84 + temp.put("lbbc", "烂班班次");
  85 + temp.put("ljbc", "临加班次");
  86 + temp.put("jhzlc", "计划总里程");
  87 + temp.put("jhyylc", "计划营运里程");
  88 + temp.put("jhfyylc", "计划空驶里程");
  89 + temp.put("sjzlc", "实际总里程");
  90 + temp.put("sjyylc", "实际营运里程");
  91 + temp.put("sjfyylc", "实际空驶里程");
  92 + temp.put("lblc", "烂班里程");
  93 + temp.put("ljyylc", "临加营运里程");
  94 + temp.put("ljfyylc", "临加空驶里程");
  95 + resList.add(temp);
  96 + for(int i = 0; i < list.size(); i++){
  97 + temp = list.get(i);
  98 + temp.put("i", i+1);
  99 + resList.add(temp);
  100 + }
  101 +
  102 + String date = startDate.replaceAll("-", "");
  103 + if(!startDate.equals(endDate)){
  104 + date = startDate.replaceAll("-", "") + "-" + endDate.replaceAll("-", "");
  105 + }
  106 +
  107 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  108 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  109 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  110 + Map<String,Object> mm = new HashMap<String, Object>();
  111 + ReportUtils ee = new ReportUtils();
  112 +
  113 + try {
  114 + listI.add(resList.iterator());
  115 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  116 + ee.excelReplace(listI, new Object[] { mm }, path+"mould/calcjsyspy.xls",
  117 + path+"export/"+date+"-"+lineName+"-人车班次公里统计.xls");
  118 + resMap.put("status", ResponseCode.SUCCESS);
  119 + } catch (Exception e) {
  120 + e.printStackTrace();
  121 + resMap.put("status", ResponseCode.ERROR);
  122 + }
  123 + return resMap;
  124 + }
  125 +
  126 + @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET)
  127 + public Map<String, Object> singledataExportTj(@RequestParam Map<String, Object> map) {
  128 +
  129 + String line="";
  130 + if(map.get("line")!=null){
  131 + line=map.get("line").toString().trim();
  132 + }
  133 + String lineName="";
  134 + if(map.get("lineName")!=null){
  135 + lineName=map.get("lineName").toString().trim();
  136 + }
  137 + String startDate="";
  138 + if(map.get("startDate")!=null){
  139 + startDate=map.get("startDate").toString().trim();
  140 + }
  141 + String endDate="";
  142 + if(map.get("endDate")!=null){
  143 + endDate=map.get("endDate").toString().trim();
  144 + }
  145 + String tjtype="";
  146 + if(map.get("tjtype")!=null){
  147 + tjtype=map.get("tjtype").toString().trim();
  148 + }
  149 + String cont="";
  150 + if(map.get("cont")!=null){
  151 + cont=map.get("cont").toString().trim();
  152 + }
  153 + String gsdmSing="";
  154 + if(map.get("gsdmSing")!=null){
  155 + gsdmSing=map.get("gsdmSing").toString().trim();
  156 + }
  157 + String fgsdmSing="";
  158 + if(map.get("fgsdmSing")!=null){
  159 + fgsdmSing=map.get("fgsdmSing").toString().trim();
  160 + }
  161 + String sfdc="";
  162 + if(map.get("sfdc")!=null){
  163 + sfdc=map.get("sfdc").toString().trim();
  164 + }
  165 +
  166 + Map<String, Object> resMap = new HashMap<String, Object>();
  167 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  168 + List<Map<String, Object>> list = clacMixService.singledatatj(line, startDate, endDate, tjtype, cont, gsdmSing, fgsdmSing, sfdc);
  169 +
  170 + Map<String, Object> temp = new HashMap<String, Object>();
  171 + temp.put("i", "序号");
  172 + temp.put("gS", "所属公司");
  173 + temp.put("xlName", "线路");
  174 + temp.put("jName", tjtype);
  175 + temp.put("jhzlc", "计划公里");
  176 + temp.put("sjzlc", "行驶里程(包括空放)");
  177 + temp.put("sjfyylc", "空驶里程");
  178 + temp.put("hyl", "耗油量");
  179 + temp.put("jzl", "加注量");
  180 + temp.put("sh", "非营业用油");
  181 +
  182 + resList.add(temp);
  183 + for(int i = 0; i < list.size(); i++){
  184 + temp = list.get(i);
  185 + temp.put("i", i+1);
  186 + if(temp.get("xlName") == null){
  187 + temp.put("xlName", "");
  188 + }
  189 + resList.add(temp);
  190 + }
  191 +
  192 + String date = startDate.replaceAll("-", "");
  193 + if(!startDate.equals(endDate)){
  194 + date = startDate.replaceAll("-", "") + "-" + endDate.replaceAll("-", "");
  195 + }
  196 +
  197 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  198 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  199 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  200 + Map<String,Object> mm = new HashMap<String, Object>();
  201 + ReportUtils ee = new ReportUtils();
  202 +
  203 + try {
  204 + listI.add(resList.iterator());
  205 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  206 + ee.excelReplace(listI, new Object[] { mm }, path+"mould/calcsingledata.xls",
  207 + path+"export/"+date+"-"+lineName+"-路单数据(统计).xls");
  208 + resMap.put("status", ResponseCode.SUCCESS);
  209 + } catch (Exception e) {
  210 + e.printStackTrace();
  211 + resMap.put("status", ResponseCode.ERROR);
  212 + }
  213 + return resMap;
  214 + }
  215 +
  216 + @RequestMapping(value = "/lbStatuAnalyExport", method = RequestMethod.GET)
  217 + public Map<String, Object> lbStatuAnalyExport(@RequestParam Map<String, Object> map) {
  218 +
  219 + String gsdm="";
  220 + if(map.get("company")!=null){
  221 + gsdm=map.get("company").toString().trim();
  222 + }
  223 + String fgsdm="";
  224 + if(map.get("subCompany")!=null){
  225 + fgsdm=map.get("subCompany").toString().trim();
  226 + }
  227 + String line="";
  228 + if(map.get("line")!=null){
  229 + line=map.get("line").toString().trim();
  230 + }
  231 + String lineName="";
  232 + if(map.get("lineName")!=null){
  233 + lineName=map.get("lineName").toString().trim();
  234 + }
  235 + String date="";
  236 + if(map.get("startDate")!=null){
  237 + date=map.get("startDate").toString().trim();
  238 + }
  239 + String date2="";
  240 + if(map.get("endDate")!=null){
  241 + date2=map.get("endDate").toString().trim();
  242 + }
  243 + String sfyy="";
  244 + if(map.get("sfyy")!=null){
  245 + sfyy=map.get("sfyy").toString().trim();
  246 + }
  247 + String type="";
  248 + if(map.get("type")!=null){
  249 + type=map.get("type").toString().trim();
  250 + }
  251 +
  252 + Map<String, Object> resMap = new HashMap<String, Object>();
  253 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  254 + List<Map<String, Object>> list = lbService.lbStatuAnaly(gsdm, fgsdm, line, date, date2, sfyy, type);
  255 +
  256 + for(int i = 0; i < list.size(); i++){
  257 + Map<String, Object> temp = list.get(i);
  258 + temp.put("i", i+1);
  259 + if(!temp.containsKey("date") || temp.get("date") == null){
  260 + temp.put("date", "");
  261 + }
  262 + if(!temp.containsKey("company") || temp.get("company") == null){
  263 + temp.put("company", "");
  264 + }
  265 + if(!temp.containsKey("subCompany") || temp.get("subCompany") == null){
  266 + temp.put("subCompany", "");
  267 + }
  268 + resList.add(temp);
  269 + }
  270 +
  271 + String Data = date.replaceAll("-", "");
  272 + if(!date.equals(date2)){
  273 + Data = date.replaceAll("-", "") + "-" + date2.replaceAll("-", "");
  274 + }
  275 +
  276 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  277 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  278 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  279 + Map<String,Object> mm = new HashMap<String, Object>();
  280 + ReportUtils ee = new ReportUtils();
  281 +
  282 + try {
  283 + listI.add(resList.iterator());
  284 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  285 + ee.excelReplace(listI, new Object[] { mm }, path+"mould/calcLbStatuAnaly.xls",
  286 + path+"export/"+Data+"-"+lineName+"-烂班情况分析表(统计).xls");
  287 + resMap.put("status", ResponseCode.SUCCESS);
  288 + } catch (Exception e) {
  289 + e.printStackTrace();
  290 + resMap.put("status", ResponseCode.ERROR);
  291 + }
  292 + return resMap;
  293 + }
  294 +
  295 +}
... ...
src/main/java/com/bsth/controller/calc/CalcIntervalController.java 0 → 100644
  1 +package com.bsth.controller.calc;
  2 +
  3 +import java.util.ArrayList;
  4 +import java.util.List;
  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.RequestParam;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import com.bsth.controller.BaseController;
  13 +import com.bsth.entity.calc.CalcInterval;
  14 +import com.bsth.service.calc.CalcIntervalService;
  15 +
  16 +@RestController
  17 +@RequestMapping("calcInterval")
  18 +public class CalcIntervalController extends BaseController<CalcInterval,Integer>{
  19 + @Autowired
  20 + CalcIntervalService calcIntervalService;
  21 + @RequestMapping(value="/countList")
  22 + public List<Map<String,Object>> countList(@RequestParam Map<String, Object> map){
  23 + List<Map<String, Object>> list=calcIntervalService.countList(map);
  24 + return list;
  25 + }
  26 +
  27 + @RequestMapping(value="/listInterval")
  28 + public List<Map<String, Object>> listInterval(@RequestParam Map<String, Object> map){
  29 + List<Map<String, Object>>list=calcIntervalService.listInterval(map);
  30 + return list;
  31 + }
  32 +
  33 + @RequestMapping(value="/interval")
  34 + public List<Map<String,Object>> interval(@RequestParam Map<String, Object> map){
  35 + List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
  36 + if(map.get("status")==null){
  37 + list=calcIntervalService.interval(map);
  38 + }else{
  39 + list=calcIntervalService.intervalDetail(map);
  40 + }
  41 + return list;
  42 + }
  43 +
  44 + @RequestMapping(value="/exportDetail")
  45 + public List<Map<String,Object>> exportDetail(@RequestParam Map<String, Object> map){
  46 + List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
  47 + list=calcIntervalService.exportDetail(map);
  48 + return list;
  49 + }
  50 +
  51 + @RequestMapping(value="/sumInterval")
  52 + public List<Map<String,Object>> sumInterval(@RequestParam Map<String, Object> map){
  53 + List<Map<String, Object>> list=calcIntervalService.sumInterval(map);
  54 + return list;
  55 + }
  56 +
  57 +
  58 +}
... ...
src/main/java/com/bsth/controller/calc/CalcLbStatuAnalyController.java 0 → 100644
  1 +package com.bsth.controller.calc;
  2 +
  3 +import java.util.List;
  4 +import java.util.Map;
  5 +
  6 +import com.bsth.controller.BaseController;
  7 +import com.bsth.entity.calc.CalcLbStatuAnaly;
  8 +import com.bsth.service.calc.CalcLbStatuAnalyService;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestParam;
  12 +import org.springframework.web.bind.annotation.RestController;
  13 +
  14 +/**
  15 + * Created by 19/03/18.
  16 + */
  17 +@RestController
  18 +@RequestMapping("calcLbStatuAnaly")
  19 +public class CalcLbStatuAnalyController extends BaseController<CalcLbStatuAnaly, Integer> {
  20 +
  21 + @Autowired
  22 + private CalcLbStatuAnalyService service;
  23 +
  24 +
  25 + @RequestMapping(value="/lbStatuAnaly")
  26 + public List<Map<String,Object>> lbStatuAnaly(@RequestParam Map<String, Object> map){
  27 + String gsdm="";
  28 + if(map.get("company")!=null){
  29 + gsdm=map.get("company").toString().trim();
  30 + }
  31 + String fgsdm="";
  32 + if(map.get("subCompany")!=null){
  33 + fgsdm=map.get("subCompany").toString().trim();
  34 + }
  35 + String line="";
  36 + if(map.get("line")!=null){
  37 + line=map.get("line").toString().trim();
  38 + }
  39 + String date="";
  40 + if(map.get("startDate")!=null){
  41 + date=map.get("startDate").toString().trim();
  42 + }
  43 + String date2="";
  44 + if(map.get("endDate")!=null){
  45 + date2=map.get("endDate").toString().trim();
  46 + }
  47 + String sfyy="";
  48 + if(map.get("sfyy")!=null){
  49 + sfyy=map.get("sfyy").toString().trim();
  50 + }
  51 + String type="";
  52 + if(map.get("type")!=null){
  53 + type=map.get("type").toString().trim();
  54 + }
  55 + return service.lbStatuAnaly(gsdm,fgsdm,line,date,date2,sfyy,type);
  56 + }
  57 +
  58 +}
... ...
src/main/java/com/bsth/controller/calc/CalcMixController.java 0 → 100644
  1 +package com.bsth.controller.calc;
  2 +
  3 +import java.util.List;
  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.RequestParam;
  10 +import org.springframework.web.bind.annotation.RestController;
  11 +
  12 +import com.bsth.service.calc.CalcMixService;
  13 +
  14 +@RestController
  15 +@RequestMapping("calc_mix")
  16 +public class CalcMixController {
  17 +
  18 + @Autowired
  19 + CalcMixService service;
  20 +
  21 + @RequestMapping(value="/calcjsyspy")
  22 + public List<Map<String, Object>> calcjsyspy(@RequestParam Map<String, Object> map){
  23 + String line="";
  24 + if(map.get("line")!=null){
  25 + line=map.get("line").toString().trim();
  26 + }
  27 + String startDate="";
  28 + if(map.get("startDate")!=null){
  29 + startDate=map.get("startDate").toString().trim();
  30 + }
  31 + String endDate="";
  32 + if(map.get("endDate")!=null){
  33 + endDate=map.get("endDate").toString().trim();
  34 + }
  35 + String empnames="";
  36 + if(map.get("empnames")!=null){
  37 + empnames=map.get("empnames").toString().trim();
  38 + }
  39 + String cont="";
  40 + if(map.get("cont")!=null){
  41 + cont=map.get("cont").toString().trim();
  42 + }
  43 + String gsdmManth="";
  44 + if(map.get("gsdmManth")!=null){
  45 + gsdmManth=map.get("gsdmManth").toString().trim();
  46 + }
  47 + String fgsdmManth="";
  48 + if(map.get("fgsdmManth")!=null){
  49 + fgsdmManth=map.get("fgsdmManth").toString().trim();
  50 + }
  51 + return service.calcjsyspy(line, startDate, endDate, empnames, cont, gsdmManth, fgsdmManth);
  52 + }
  53 +
  54 + @RequestMapping(value = "/singledatatj", method = RequestMethod.GET)
  55 + public List<Map<String, Object>> singledatatj(@RequestParam Map<String, Object> map) {
  56 + String line="";
  57 + if(map.get("line")!=null){
  58 + line=map.get("line").toString().trim();
  59 + }
  60 + String startDate="";
  61 + if(map.get("startDate")!=null){
  62 + startDate=map.get("startDate").toString().trim();
  63 + }
  64 + String endDate="";
  65 + if(map.get("endDate")!=null){
  66 + endDate=map.get("endDate").toString().trim();
  67 + }
  68 + String tjtype="";
  69 + if(map.get("tjtype")!=null){
  70 + tjtype=map.get("tjtype").toString().trim();
  71 + }
  72 + String cont="";
  73 + if(map.get("cont")!=null){
  74 + cont=map.get("cont").toString().trim();
  75 + }
  76 + String gsdmSing="";
  77 + if(map.get("gsdmSing")!=null){
  78 + gsdmSing=map.get("gsdmSing").toString().trim();
  79 + }
  80 + String fgsdmSing="";
  81 + if(map.get("fgsdmSing")!=null){
  82 + fgsdmSing=map.get("fgsdmSing").toString().trim();
  83 + }
  84 + String sfdc="";
  85 + if(map.get("sfdc")!=null){
  86 + sfdc=map.get("sfdc").toString().trim();
  87 + }
  88 + return service.singledatatj(line, startDate, endDate, tjtype, cont, gsdmSing, fgsdmSing, sfdc);
  89 + }
  90 +
  91 +}
... ...
src/main/java/com/bsth/controller/calc/CalcWaybillController.java
... ... @@ -317,4 +317,8 @@ public class CalcWaybillController extends BaseController&lt;CalcWaybill, Integer&gt;
317 317 return calcWaybillService.getBusMileage(line, date, date2, xlName, zt, by, type);
318 318 }
319 319  
  320 + @RequestMapping(value="/calcDetailMonthly")
  321 + public List<List<String>> calcDetailMonthly(@RequestParam Map<String, Object> map){
  322 + return calcWaybillService.calcDetailMonthly(map);
  323 + }
320 324 }
... ...
src/main/java/com/bsth/controller/jdtest/JdTestController.java 0 → 100644
  1 +package com.bsth.controller.jdtest;
  2 +
  3 +import java.text.SimpleDateFormat;
  4 +import java.util.ArrayList;
  5 +import java.util.HashMap;
  6 +import java.util.Iterator;
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.web.bind.annotation.RequestMapping;
  11 +import org.springframework.web.bind.annotation.RequestMethod;
  12 +import org.springframework.web.bind.annotation.RequestParam;
  13 +import org.springframework.web.bind.annotation.RestController;
  14 +import com.bsth.controller.BaseController;
  15 +import com.bsth.data.BasicData;
  16 +import com.bsth.entity.oil.Ylb;
  17 +import com.bsth.entity.oil.Ylxxb;
  18 +import com.bsth.entity.sys.Dictionary;
  19 +import com.bsth.service.jdtest.JdtestService;
  20 +import com.bsth.service.oil.YlbService;
  21 +import com.bsth.service.sys.DictionaryService;
  22 +import com.bsth.util.Arith;
  23 +import com.bsth.util.ReportUtils;
  24 +
  25 +@RestController
  26 +@RequestMapping("jdtest")
  27 +public class JdTestController extends BaseController<Ylb, Integer>{
  28 + @Autowired
  29 + YlbService ylbService;
  30 + @Autowired
  31 + DictionaryService dictionaryService;
  32 + @Autowired
  33 + JdtestService jdtestService;
  34 +
  35 + /*
  36 + * 油量平衡表导出
  37 + */
  38 + @RequestMapping(value = "/listExport",method = RequestMethod.POST)
  39 + public List<Map<String, Object>> listExport(@RequestParam Map<String, Object> map){
  40 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  41 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  42 + Map<String, Object> dMap=new HashMap<>();
  43 + dMap.put("dGroup_eq", "oilType");
  44 + Iterator<Dictionary> it= dictionaryService.list(dMap).iterator();
  45 + while (it.hasNext()) {
  46 + Dictionary d=it.next();
  47 + dMap.put(d.getdCode(), d.getdName());
  48 + }
  49 +
  50 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  51 + ReportUtils ee = new ReportUtils();
  52 + List<Ylb> ylb= ylbService.listYlb(map);
  53 +// (new CustomerSpecs<Ylb>(map)).iterator();
  54 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  55 + for (Ylb y : ylb) {
  56 + Map<String, Object> m = new HashMap<String, Object>();
  57 + m.put("rq", sdfMonth.format(y.getRq()));
  58 + m.put("gsname",y.getGsname() );
  59 + m.put("fgsname", y.getFgsname());
  60 + m.put("xlname", y.getXlname()==null?"":y.getXlname());
  61 + m.put("nbbm", y.getNbbm());
  62 + m.put("jsy", y.getJsy());
  63 + m.put("name", y.getName());
  64 + m.put("jzl", y.getJzl()<=0?"0":y.getJzl());
  65 + m.put("czlc", "0");
  66 + m.put("jzlc", "0");
  67 + m.put("czyl", y.getCzyl()<=0?"0":y.getCzyl());
  68 + m.put("jzyl", y.getJzyl()<=0?"0":y.getJzyl());
  69 + m.put("yh", y.getYh()<=0?"0":y.getYh());
  70 + String rylx="";
  71 + if(y.getRylx()!=null){
  72 + if(dMap.get(y.getRylx())==null){
  73 + rylx="";
  74 + }else{
  75 + rylx=dMap.get(y.getRylx()).toString();
  76 + }
  77 + }
  78 + m.put("rylx", rylx);
  79 + m.put("ns", y.getNs()==null?"0":y.getNs());
  80 + String shyy ="无";
  81 + if(y.getShyy()!=null){
  82 + shyy=y.getShyy();
  83 + if(shyy.equals("1")){shyy="票务用油";}
  84 + else if(shyy.equals("2")){shyy="保养用油";}
  85 + else if(shyy.equals("3")){shyy="报废车用油";}
  86 + else if(shyy.equals("4")){shyy="其它用油";}
  87 + else if(shyy.equals("5")){shyy="人保部";}
  88 + else if(shyy.equals("6")){shyy="车队";}
  89 + else if(shyy.equals("7")){shyy="车间(高保)";}
  90 + else if(shyy.equals("8")){shyy="车间(小修)";}
  91 + else{shyy ="无";}
  92 + }
  93 + m.put("shyy", shyy);
  94 + m.put("sh", y.getSh()<=0?"0":y.getSh());
  95 + m.put("zlc", y.getZlc()<=0?"0":y.getZlc());
  96 + m.put("bglyh", y.getBglyh());
  97 + m.put("zyh", Arith.add(y.getSh(), y.getYh()));
  98 + resList.add(m);
  99 + }
  100 + try {
  101 + map.put("sheetName", map.get("rq"));
  102 + listI.add(resList.iterator());
  103 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  104 + ee.excelReplace(listI, new Object[] { map }, path+"mould/list.xls",
  105 + path+"export/"+map.get("rq").toString()+ "进出场存油量.xls");
  106 + } catch (Exception e) {
  107 + e.printStackTrace();
  108 + }
  109 +
  110 + return resList;
  111 +
  112 + }
  113 +
  114 + /*
  115 + * 场外加油匹配当天线路数据
  116 + */
  117 + @RequestMapping(value = "/cwjyList",method = RequestMethod.GET)
  118 + public List<Ylxxb> cwjyList(@RequestParam Map<String, Object> map){
  119 + List<Ylxxb> cwjyList=jdtestService.cwjyList(map);
  120 + return cwjyList;
  121 + }
  122 +
  123 + /*
  124 + * 油量路单报表
  125 + */
  126 + @RequestMapping(value="/daily",method = RequestMethod.GET)
  127 + public List<Map<String, Object>> daily(@RequestParam Map<String, Object> map){
  128 + List<Map<String, Object>> list=jdtestService.daily(map);
  129 +
  130 + if(map.get("type").toString().equals("export")){
  131 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  132 + ReportUtils ee = new ReportUtils();
  133 + Map<String, Object> m=new HashMap<>();
  134 +
  135 + try {
  136 + String lineName = map.get("lineName").toString();
  137 + String date = map.get("date").toString();
  138 + m.put("line", lineName);
  139 + m.put("date", date);
  140 + listI.add(list.iterator());
  141 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  142 + ee.excelReplace(listI, new Object[] { m }, path + "mould/jd_daily.xls",
  143 + path + "export/" + date
  144 + + "-" + lineName + "-班次日报表.xls");
  145 + } catch (Exception e) {
  146 + e.printStackTrace();
  147 + }
  148 + }
  149 + return list;
  150 + }
  151 +
  152 +}
... ...
src/main/java/com/bsth/controller/oil/CwjyController.java
1 1 package com.bsth.controller.oil;
2 2  
3 3  
  4 +import java.io.File;
4 5 import java.util.Date;
5 6 import java.util.HashMap;
6 7 import java.util.List;
... ... @@ -11,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
11 12 import org.springframework.web.bind.annotation.RequestMethod;
12 13 import org.springframework.web.bind.annotation.RequestParam;
13 14 import org.springframework.web.bind.annotation.RestController;
  15 +import org.springframework.web.multipart.MultipartFile;
14 16  
15 17 import com.bsth.common.ResponseCode;
16 18 import com.bsth.controller.BaseController;
... ... @@ -22,6 +24,7 @@ import com.bsth.entity.sys.SysUser;
22 24 import com.bsth.security.util.SecurityUtils;
23 25 import com.bsth.service.oil.CwjyService;
24 26 import com.bsth.util.PageObject;
  27 +import com.google.common.io.Files;
25 28  
26 29 @RestController
27 30 @RequestMapping("cwjy")
... ... @@ -62,6 +65,12 @@ public class CwjyController extends BaseController&lt;Cwjy, Integer&gt;{
62 65 return pagequery;
63 66 }
64 67  
  68 + @RequestMapping(value = "/cwjyList",method = RequestMethod.GET)
  69 + public List<Ylxxb> cwjyList(@RequestParam Map<String, Object> map){
  70 + List<Ylxxb> cwjyList=service.cwjyList(map);
  71 + return cwjyList;
  72 + }
  73 +
65 74 @RequestMapping(value="/bynbbm",method = RequestMethod.GET)
66 75 public Ylxxb bynbbm(@RequestParam Map<String, Object> map){
67 76  
... ... @@ -89,4 +98,23 @@ public class CwjyController extends BaseController&lt;Cwjy, Integer&gt;{
89 98 return maps;
90 99 }
91 100  
  101 + /*
  102 + * 场外加油导入
  103 + */
  104 + @RequestMapping(value = "/uploadFile",method = RequestMethod.POST)
  105 + public String uploadFile(MultipartFile file, String gsbm_, String gsName,
  106 + String fgsbm_, String fgsName) throws Exception{
  107 + Map<String, Object> map = new HashMap<String, Object>();
  108 + File newFile = new File(
  109 + getDataImportClasspath() + File.separator +
  110 + file.getOriginalFilename());
  111 + Files.write(file.getBytes(), newFile);
  112 + String result = service.importExcel(newFile, gsbm_, gsName);
  113 + return "{\"result\":" + "\""+result+"\"}";
  114 + }
  115 +
  116 + public String getDataImportClasspath(){
  117 + return this.getClass().getResource("/").getPath() + "/static/pages/oil";
  118 + }
  119 +
92 120 }
... ...
src/main/java/com/bsth/controller/oil/DlbController.java
... ... @@ -152,7 +152,11 @@ public class DlbController extends BaseController&lt;Dlb, Integer&gt;{
152 152 m.put("rq", y.getRq());
153 153 m.put("gsname",y.getGsname() );
154 154 m.put("fgsname", y.getFgsname());
155   - m.put("xlname", y.getXlname());
  155 + if(y.getLinename()==null){
  156 + m.put("xlname", y.getXlname()==null?"":y.getXlname());
  157 + }else{
  158 + m.put("xlname", y.getLinename());
  159 + }
156 160 m.put("nbbm", y.getNbbm());
157 161 m.put("jsy", y.getJsy());
158 162 m.put("name", y.getName());
... ...
src/main/java/com/bsth/controller/oil/JqlController.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 +
  14 +import com.bsth.controller.BaseController;
  15 +import com.bsth.entity.oil.Jql;
  16 +import com.bsth.service.oil.JqlService;
  17 +import com.google.common.io.Files;
  18 +
  19 +@RestController
  20 +@RequestMapping("jql")
  21 +public class JqlController extends BaseController<Jql, Integer> {
  22 +
  23 + @Autowired
  24 + JqlService jqlService;
  25 +
  26 + public String getDataImportClasspath(){
  27 + return this.getClass().getResource("/").getPath() + "/static/pages/hydrogen/jql";
  28 + }
  29 +
  30 + @RequestMapping(value = "/uploadFile",method = RequestMethod.POST)
  31 + public String uploadFile(MultipartFile file, String gsbm_, String gsName,
  32 + String fgsbm_, String fgsName) throws Exception{
  33 + Map<String, Object> map = new HashMap<String, Object>();
  34 + File newFile = new File(
  35 + getDataImportClasspath() + File.separator +
  36 + file.getOriginalFilename());
  37 + Files.write(file.getBytes(), newFile);
  38 + String result = jqlService.importExcel(newFile, gsbm_, gsName, fgsbm_, fgsName);
  39 + return "{\"result\":" + "\""+result+"\"}";
  40 + }
  41 +
  42 + @RequestMapping(value = "/query",method = RequestMethod.GET)
  43 + public Map<String, Object> query(@RequestParam Map<String, Object> map) throws Exception{
  44 + return jqlService.query(map);
  45 + }
  46 +
  47 +}
... ...
src/main/java/com/bsth/controller/oil/QlbController.java 0 → 100644
  1 +package com.bsth.controller.oil;
  2 +
  3 +import java.text.SimpleDateFormat;
  4 +import java.util.ArrayList;
  5 +import java.util.Date;
  6 +import java.util.HashMap;
  7 +import java.util.Iterator;
  8 +import java.util.List;
  9 +import java.util.Map;
  10 +
  11 +import org.springframework.beans.factory.annotation.Autowired;
  12 +import org.springframework.data.domain.Page;
  13 +import org.springframework.data.domain.PageRequest;
  14 +import org.springframework.data.domain.Sort;
  15 +import org.springframework.data.domain.Sort.Direction;
  16 +import org.springframework.web.bind.annotation.RequestMapping;
  17 +import org.springframework.web.bind.annotation.RequestMethod;
  18 +import org.springframework.web.bind.annotation.RequestParam;
  19 +import org.springframework.web.bind.annotation.RestController;
  20 +import com.bsth.controller.BaseController;
  21 +import com.bsth.entity.oil.Qlb;
  22 +import com.bsth.service.oil.QlbService;
  23 +import com.bsth.util.Arith;
  24 +import com.bsth.util.ReportUtils;
  25 +import com.google.common.base.Splitter;
  26 +
  27 +@RestController
  28 +@RequestMapping("qlb")
  29 +public class QlbController extends BaseController<Qlb, Integer>{
  30 + @Autowired
  31 + QlbService service;
  32 + /**
  33 + *
  34 + * @Title: list
  35 + * @Description: TODO(多条件分页查询)
  36 + * @param @param map 查询条件
  37 + * @param @param page 页码
  38 + * @param @param size 每页显示数量
  39 + * @throws
  40 + */
  41 + @RequestMapping(method = RequestMethod.GET)
  42 + public Page<Qlb> list(@RequestParam Map<String, Object> map,
  43 + @RequestParam(defaultValue = "0") int page,
  44 + @RequestParam(defaultValue = "10") int size,
  45 + @RequestParam(defaultValue = "id") String order,
  46 + @RequestParam(defaultValue = "DESC") String direction){
  47 +
  48 + Direction d;
  49 +// map.put("xlbm_like", map.get("xlbm_like").toString().trim());
  50 +// try {
  51 + String rq=map.get("rq").toString();
  52 + if(!(rq=="")){
  53 +//
  54 +// SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
  55 +// Calendar calendar = new GregorianCalendar();
  56 +// calendar.setTime(sdf.parse(rq));
  57 +// calendar.add(calendar.DATE,1);
  58 +// Date date=calendar.getTime();
  59 + map.put("rq_eq", rq);
  60 +// map.put("rq_lt", sdf.format(date));
  61 +// System.out.println(rq);
  62 +// System.out.println(sdf.format(date));
  63 + }
  64 +// } catch (ParseException e) {
  65 +// // TODO Auto-generated catch block
  66 +// e.printStackTrace();
  67 +// }
  68 + if(null != direction && direction.equals("ASC"))
  69 + d = Direction.ASC;
  70 + else
  71 + d = Direction.DESC;
  72 +
  73 + // 允许多个字段排序,order可以写单个字段,也可以写多个字段
  74 + // 多个字段格式:{col1},{col2},{col3},....,{coln}
  75 + // 每个字段的排序方向都是一致,这个以后再看要不要改
  76 + List<String> list = Splitter.on(",").trimResults().splitToList(order);
  77 + return baseService.list(map, new PageRequest(page, size, new Sort(d, list)));
  78 + }
  79 + @RequestMapping(value = "/qlbList",method = RequestMethod.GET)
  80 + public List<Qlb> qlbList(@RequestParam Map<String, Object> map){
  81 + List<Qlb> list=service.listQlb(map);
  82 + return list;
  83 + }
  84 +
  85 +
  86 +
  87 + @RequestMapping(value = "/obtain",method = RequestMethod.GET)
  88 + public Map<String, Object> obtain(@RequestParam Map<String, Object> map) throws Exception{
  89 + Map<String, Object> list=new HashMap<String, Object>();
  90 + try {
  91 + list = service.obtain(map);
  92 + } catch (Exception e) {
  93 + // TODO Auto-generated catch block
  94 + throw e;
  95 + }
  96 + return list;
  97 + }
  98 +
  99 + /**
  100 + * 保存氢量
  101 + * @param map
  102 + * @return
  103 + */
  104 + @RequestMapping(value = "/sort",method = RequestMethod.GET)
  105 + public Map<String, Object> sort(@RequestParam Map<String, Object> map){
  106 + Map<String, Object> list=service.sort(map);
  107 + return list;
  108 + }
  109 +
  110 + /**
  111 + * 核对氢量(有加氢没里程)
  112 + * @param map
  113 + * @return
  114 + */
  115 + @RequestMapping(value = "/checkQl",method = RequestMethod.GET)
  116 + public Map<String, Object> checkQl(@RequestParam Map<String, Object> map){
  117 + Map<String, Object> list=service.checkQl(map);
  118 + return list;
  119 + }
  120 +
  121 + @RequestMapping(value = "/sumQlb",method = RequestMethod.GET)
  122 + public Map<String, Object> sumQlb(@RequestParam Map<String, Object> map){
  123 + Map<String, Object> list=service.sumQlb(map);
  124 + return list;
  125 + }
  126 +
  127 + @RequestMapping(value = "/saveQlbList",method = RequestMethod.POST)
  128 + public Map<String, Object> saveQlbList(@RequestParam Map<String, Object> map){
  129 + Map<String, Object> list=new HashMap<String, Object>();
  130 + try {
  131 + list = service.saveQlbList(map);
  132 + } catch (Exception e) {
  133 + // TODO Auto-generated catch block
  134 + e.printStackTrace();
  135 + }
  136 + return list;
  137 + }
  138 +
  139 +
  140 + @RequestMapping(value = "/listExport",method = RequestMethod.POST)
  141 + public List<Map<String, Object>> listExport(@RequestParam Map<String, Object> map){
  142 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  143 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  144 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  145 + ReportUtils ee = new ReportUtils();
  146 + List<Qlb> qlb = service.listQlb(map);
  147 +// (new CustomerSpecs<Ylb>(map)).iterator();
  148 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  149 + for (Qlb y : qlb) {
  150 + Map<String, Object> m = new HashMap<String, Object>();
  151 + m.put("rq", y.getRq());
  152 + m.put("gsname",y.getGsname() );
  153 + m.put("fgsname", y.getFgsname());
  154 + if(y.getLinename()==null){
  155 + m.put("xlname", y.getXlname()==null?"":y.getXlname());
  156 + }else{
  157 + m.put("xlname", y.getLinename());
  158 + }
  159 + m.put("nbbm", y.getNbbm());
  160 + m.put("jsy", y.getJsy());
  161 + m.put("name", y.getName());
  162 + m.put("jql", y.getJql()<=0?"0":y.getJql());
  163 + m.put("czcl", y.getCzcl()<=0?"0":y.getCzcl()+"%");
  164 + m.put("jzcl", y.getJzcl()<=0?"0":y.getJzcl()+"%");
  165 + m.put("czlc", y.getCzlc()<=0?"0":y.getCzlc());
  166 + m.put("jzlc", y.getJzlc()<=0?"0":y.getJzlc());
  167 + m.put("hn", y.getHn()<=0?"0":y.getHn());
  168 + String shyy ="无";
  169 + if(y.getShyy()!=null){
  170 + shyy=y.getShyy();
  171 + if(shyy.equals("1")){shyy="票务用";}
  172 + else if(shyy.equals("2")){shyy="保养用";}
  173 + else if(shyy.equals("3")){shyy="报废车用";}
  174 + else if(shyy.equals("4")){shyy="其它用";}
  175 + else if(shyy.equals("5")){shyy="人保部";}
  176 + else if(shyy.equals("6")){shyy="车队";}
  177 + else if(shyy.equals("7")){shyy="车间(高保)";}
  178 + else if(shyy.equals("8")){shyy="车间(小修)";}
  179 + else{shyy ="无";}
  180 + }
  181 + m.put("ns", y.getNs()<=0?"0":y.getNs());
  182 + m.put("shyy", shyy);
  183 + m.put("sh", y.getSh()<=0?"0":y.getSh());
  184 + m.put("zlc", y.getZlc()<=0?"0":y.getZlc());
  185 + m.put("rdlx", "");
  186 + m.put("bglnh", y.getBglhn());
  187 + m.put("znh", Arith.add(y.getSh(), y.getHn()));
  188 + resList.add(m);
  189 + }
  190 + try {
  191 + map.put("sheetName", map.get("rq"));
  192 + listI.add(resList.iterator());
  193 + String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
  194 + ee.excelReplace(listI, new Object[] { map }, path+"mould/listQl.xls",
  195 + path+"export/"+map.get("rq").toString()+ "进出场存氢量.xls");
  196 + } catch (Exception e) {
  197 + e.printStackTrace();
  198 + }
  199 +
  200 + return resList;
  201 +
  202 + }
  203 +
  204 +
  205 + @RequestMapping(value = "/checkJsy",method = RequestMethod.GET)
  206 + public String checkJsy(@RequestParam Map<String, Object> map){
  207 + String list=service.checkJsy(map);
  208 + return list;
  209 + }
  210 +
  211 + @RequestMapping(value = "/deleteIds", method = RequestMethod.POST)
  212 + public Map<String, Object> deleteIds(@RequestParam Map<String, Object> map) {
  213 + Map<String, Object> maps=new HashMap<String, Object>();
  214 + try {
  215 + maps= service.deleteIds(map);
  216 + } catch (Exception e) {
  217 + // TODO Auto-generated catch block
  218 + e.printStackTrace();
  219 + }
  220 + return maps;
  221 + }
  222 +
  223 + @RequestMapping(value = "/saveQlb",method = RequestMethod.POST)
  224 + public Map<String, Object> saveQlb(Qlb t){
  225 +// SysUser user = SecurityUtils.getCurrentUser();
  226 + t.setCreatetime(new Date());
  227 +// Ylb t=new Ylb();
  228 + return service.saveQlb(t);
  229 + }
  230 +
  231 + @RequestMapping(value = "/updateJsy",method = RequestMethod.GET)
  232 + public Map<String, Object> updateJsy(@RequestParam Map<String, Object> map){
  233 + return service.update(map);
  234 + }
  235 +}
... ...
src/main/java/com/bsth/controller/oil/YlbController.java
... ... @@ -26,9 +26,11 @@ import org.springframework.web.bind.annotation.RestController;
26 26  
27 27 import com.bsth.controller.BaseController;
28 28 import com.bsth.entity.oil.Ylb;
  29 +import com.bsth.entity.sys.Dictionary;
29 30 import com.bsth.entity.sys.SysUser;
30 31 import com.bsth.security.util.SecurityUtils;
31 32 import com.bsth.service.oil.YlbService;
  33 +import com.bsth.service.sys.DictionaryService;
32 34 import com.bsth.util.Arith;
33 35 import com.bsth.util.ReportUtils;
34 36 import com.google.common.base.Splitter;
... ... @@ -38,7 +40,8 @@ import com.google.common.base.Splitter;
38 40 public class YlbController extends BaseController<Ylb, Integer>{
39 41 @Autowired
40 42 YlbService ylbService;
41   -
  43 + @Autowired
  44 + DictionaryService dictionaryService;
42 45 @RequestMapping(value = "/saveYlb",method = RequestMethod.POST)
43 46 public Map<String, Object> saveYlb(Ylb t){
44 47 // SysUser user = SecurityUtils.getCurrentUser();
... ... @@ -245,9 +248,18 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
245 248 public List<Map<String, Object>> listExport(@RequestParam Map<String, Object> map){
246 249 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
247 250 sdfSimple = new SimpleDateFormat("yyyyMMdd");
  251 + Map<String, Object> dMap=new HashMap<>();
  252 + dMap.put("dGroup_eq", "oilType");
  253 + Iterator<Dictionary> it= dictionaryService.list(dMap).iterator();
  254 + while (it.hasNext()) {
  255 + Dictionary d=it.next();
  256 + dMap.put(d.getdCode(), d.getdName());
  257 + }
  258 +
248 259 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
249 260 ReportUtils ee = new ReportUtils();
250 261 List<Ylb> ylb= ylbService.listYlb(map);
  262 +
251 263 // (new CustomerSpecs<Ylb>(map)).iterator();
252 264 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
253 265 for (Ylb y : ylb) {
... ... @@ -255,7 +267,11 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
255 267 m.put("rq", sdfMonth.format(y.getRq()));
256 268 m.put("gsname",y.getGsname() );
257 269 m.put("fgsname", y.getFgsname());
258   - m.put("xlname", y.getXlname()==null?"":y.getXlname());
  270 + if(y.getLinename()==null){
  271 + m.put("xlname", y.getXlname()==null?"":y.getXlname());
  272 + }else{
  273 + m.put("xlname", y.getLinename());
  274 + }
259 275 m.put("nbbm", y.getNbbm());
260 276 m.put("jsy", y.getJsy());
261 277 m.put("name", y.getName());
... ... @@ -267,8 +283,13 @@ public class YlbController extends BaseController&lt;Ylb, Integer&gt;{
267 283 m.put("yh", y.getYh()<=0?"0":y.getYh());
268 284 String rylx="";
269 285 if(y.getRylx()!=null){
270   - if(y.getRylx().equals("0")){rylx="0号柴油";}
271   - if(y.getRylx().equals("1")){rylx="负10号柴油";}
  286 + /*if(y.getRylx().equals("0")){rylx="0号柴油";}
  287 + if(y.getRylx().equals("1")){rylx="负10号柴油";}*/
  288 + if(dMap.get(y.getRylx())==null){
  289 + rylx="";
  290 + }else{
  291 + rylx=dMap.get(y.getRylx()).toString();
  292 + }
272 293 }
273 294 m.put("rylx", rylx);
274 295 m.put("ns", y.getNs()==null?"0":y.getNs());
... ...
src/main/java/com/bsth/controller/realcontrol/AdminUtilsController.java
1   -package com.bsth.controller.realcontrol;
2   -
3   -import com.bsth.data.directive.DayOfDirectives;
4   -import com.bsth.data.directive.DirectivesPstThread;
5   -import com.bsth.data.gpsdata_v2.cache.GeoCacheData;
6   -import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;
7   -import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
8   -import com.bsth.data.msg_queue.DirectivePushQueue;
9   -import com.bsth.data.msg_queue.WebSocketPushQueue;
10   -import com.bsth.data.pilot80.PilotReport;
11   -import com.bsth.data.schedule.DayOfSchedule;
12   -import com.bsth.entity.realcontrol.ScheduleRealInfo;
13   -import com.bsth.websocket.handler.SendUtils;
14   -import org.slf4j.Logger;
15   -import org.slf4j.LoggerFactory;
16   -import org.springframework.beans.factory.annotation.Autowired;
17   -import org.springframework.web.bind.annotation.RequestMapping;
18   -import org.springframework.web.bind.annotation.RequestParam;
19   -import org.springframework.web.bind.annotation.RestController;
20   -
21   -import java.util.HashMap;
22   -import java.util.List;
23   -import java.util.Map;
24   -
25   -/**
26   - * Created by panzhao on 2017/4/14.
27   - */
28   -@RestController
29   -@RequestMapping("adminUtils")
30   -public class AdminUtilsController {
31   -
32   -
33   - Logger logger = LoggerFactory.getLogger(this.getClass());
34   -
35   - @Autowired
36   - DayOfSchedule dayOfSchedule;
37   -
38   - @Autowired
39   - GeoCacheData geoCacheData;
40   -
41   - @Autowired
42   - DayOfDirectives dayOfDirectives;
43   -
44   - @Autowired
45   - SendUtils sendUtils;
46   -
47   - @Autowired
48   - PilotReport pilotReport;
49   -
50   - /**
51   - * 出现重复班次的车辆
52   - * @param
53   -
54   - @RequestMapping(value = "/schRepeat", method = RequestMethod.POST)
55   - public void schRepeat(@RequestParam String nbbm){
56   - logger.info("前端通知,车辆 " + nbbm + "出现重复班次,开始检测...");
57   - List<ScheduleRealInfo> list = dayOfSchedule.findByNbbm(nbbm);
58   - logger.info("检测前,车辆班次数量:" + list.size());
59   -
60   - Map<Long, ScheduleRealInfo> map = new HashMap<>();
61   - for(ScheduleRealInfo sch : list){
62   - if(map.containsKey(sch.getId())){
63   - logger.info("检测到重复ID: " + sch.getId());
64   - }
65   - map.put(sch.getId(), sch);
66   - }
67   -
68   - logger.info("检测后,车辆班次数量:" + list.size());
69   - if(map.values().size() > 0){
70   - dayOfSchedule.replaceByNbbm(nbbm, map.values());
71   - }
72   - }*/
73   -
74   -/* @RequestMapping(value = "/directivePushQueue")
75   - public void directivePushQueue(){
76   - DirectivePushQueue.start();
77   - }*/
78   -
79   - @RequestMapping(value = "/directiveQueueSize")
80   - public void directiveQueueSize(){
81   - DirectivePushQueue.size();
82   - }
83   -
84   - /*@RequestMapping(value = "/webSocketPushQueue")
85   - public void webSocketPushQueue(){
86   - WebSocketPushQueue.start();
87   - }*/
88   -
89   - @RequestMapping(value = "/webSocketQueueSize")
90   - public void webSocketQueueSize(){
91   - WebSocketPushQueue.size();
92   - }
93   -
94   - @RequestMapping(value = "/setHttpFlag")
95   - public void setHttpFlag(@RequestParam int flag){
96   - if(flag != 0 && flag != -1)
97   - return;
98   - GpsDataLoaderThread.setFlag(flag);
99   - }
100   -
101   - @RequestMapping(value = "/updateCacheBuff")
102   - public void updateCacheBuff(){
103   - geoCacheData.loadData();
104   - }
105   -
106   - @RequestMapping(value = "/reCalcLpSch")
107   - public void reCalcLpSch(){
108   - dayOfSchedule._test_reCalcLpSch();
109   - }
110   -
111   - @RequestMapping(value = "/findSchByLpName")
112   - public List<ScheduleRealInfo> findSchByLpName(@RequestParam String lpName){
113   - return dayOfSchedule.getLpScheduleMap().get(lpName);
114   - }
115   -
116   - @RequestMapping(value = "/findSchByNbbm")
117   - public List<ScheduleRealInfo> findSchByNbbm(@RequestParam String nbbm){
118   - return dayOfSchedule.findByNbbm(nbbm);
119   - }
120   -
121   - @RequestMapping(value = "/removeExecPlan")
122   - public int removeExecPlan(@RequestParam String nbbm){
123   - dayOfSchedule.removeExecPlan(nbbm);
124   - return 1;
125   - }
126   -
127   - @RequestMapping(value = "/sch_re_calc_id_maps")
128   - public int reCalcIdMaps(){
129   - return dayOfSchedule.reCalcIdMaps();
130   - }
131   -
132   - @RequestMapping(value = "/sch_size_string")
133   - public String schSizeString(){
134   - return dayOfSchedule.sizeString();
135   - }
136   -
137   - @RequestMapping(value = "/containerSize")
138   - public Map<String, Integer> containerSize(){
139   - Map<String, Integer> rs = new HashMap<>();
140   - rs.put("60_size", dayOfDirectives.all60().size());
141   - rs.put("80_size", pilotReport.findAll().size());
142   - rs.put("nbbm_sch_size", dayOfSchedule.findAll().size());
143   - rs.put("lp_sch_size", dayOfSchedule.findAllByLpContainer().size());
144   - rs.put("id_sch_size", dayOfSchedule.findAllByIdContainer().size());
145   - rs.put("pst_sch_size", dayOfSchedule.getPstSize());
146   - rs.put("speeds_size", OverspeedProcess.size());
147   - return rs;
148   - }
149   -
150   - @RequestMapping(value = "/websocketRadioText")
151   - public int radioText(String t, String lineCode){
152   - sendUtils.sendRadioText(t, lineCode);
153   - return 0;
154   - }
155   -
156   - @Autowired
157   - DirectivesPstThread directivesPstThread;
158   -
159   - @RequestMapping(value = "/_sd_60_pst")
160   - public void sd_60_pst(){
161   - logger.info("手动入库指令....");
162   - directivesPstThread.run();
163   - }
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import java.text.SimpleDateFormat;
  4 +import java.util.*;
  5 +
  6 +import org.slf4j.Logger;
  7 +import org.slf4j.LoggerFactory;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.RequestParam;
  11 +import org.springframework.web.bind.annotation.RestController;
  12 +
  13 +import com.bsth.common.ResponseCode;
  14 +import com.bsth.data.directive.DayOfDirectives;
  15 +import com.bsth.data.directive.DirectivesPstThread;
  16 +import com.bsth.data.gpsdata_v2.cache.GeoCacheData;
  17 +import com.bsth.data.gpsdata_v2.handlers.overspeed.OverspeedProcess;
  18 +import com.bsth.data.gpsdata_v2.thread.GpsDataLoaderThread;
  19 +import com.bsth.data.msg_queue.DirectivePushQueue;
  20 +import com.bsth.data.msg_queue.WebSocketPushQueue;
  21 +import com.bsth.data.pilot80.PilotReport;
  22 +import com.bsth.data.schedule.DayOfSchedule;
  23 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  24 +import com.bsth.websocket.handler.SendUtils;
  25 +
  26 +import ch.qos.logback.classic.Level;
  27 +import ch.qos.logback.classic.LoggerContext;
  28 +
  29 +/**
  30 + * Created by panzhao on 2017/4/14.
  31 + */
  32 +@RestController
  33 +@RequestMapping("adminUtils")
  34 +public class AdminUtilsController {
  35 +
  36 +
  37 + Logger logger = LoggerFactory.getLogger(this.getClass());
  38 +
  39 + @Autowired
  40 + DayOfSchedule dayOfSchedule;
  41 +
  42 + @Autowired
  43 + GeoCacheData geoCacheData;
  44 +
  45 + @Autowired
  46 + DayOfDirectives dayOfDirectives;
  47 +
  48 + @Autowired
  49 + SendUtils sendUtils;
  50 +
  51 + @Autowired
  52 + PilotReport pilotReport;
  53 +
  54 + /**
  55 + * 出现重复班次的车辆
  56 + *
  57 + * @param
  58 + * @RequestMapping(value = "/schRepeat", method = RequestMethod.POST)
  59 + * public void schRepeat(@RequestParam String nbbm){
  60 + * logger.info("前端通知,车辆 " + nbbm + "出现重复班次,开始检测...");
  61 + * List<ScheduleRealInfo> list = dayOfSchedule.findByNbbm(nbbm);
  62 + * logger.info("检测前,车辆班次数量:" + list.size());
  63 + * <p>
  64 + * Map<Long, ScheduleRealInfo> map = new HashMap<>();
  65 + * for(ScheduleRealInfo sch : list){
  66 + * if(map.containsKey(sch.getId())){
  67 + * logger.info("检测到重复ID: " + sch.getId());
  68 + * }
  69 + * map.put(sch.getId(), sch);
  70 + * }
  71 + * <p>
  72 + * logger.info("检测后,车辆班次数量:" + list.size());
  73 + * if(map.values().size() > 0){
  74 + * dayOfSchedule.replaceByNbbm(nbbm, map.values());
  75 + * }
  76 + * }
  77 + */
  78 +
  79 +/* @RequestMapping(value = "/directivePushQueue")
  80 + public void directivePushQueue(){
  81 + DirectivePushQueue.start();
  82 + }*/
  83 + @RequestMapping(value = "/directiveQueueSize")
  84 + public void directiveQueueSize() {
  85 + DirectivePushQueue.size();
  86 + }
  87 +
  88 + /*@RequestMapping(value = "/webSocketPushQueue")
  89 + public void webSocketPushQueue(){
  90 + WebSocketPushQueue.start();
  91 + }*/
  92 +
  93 + @RequestMapping(value = "/webSocketQueueSize")
  94 + public void webSocketQueueSize() {
  95 + WebSocketPushQueue.size();
  96 + }
  97 +
  98 + @RequestMapping(value = "/setHttpFlag")
  99 + public void setHttpFlag(@RequestParam int flag) {
  100 + if (flag != 0 && flag != -1)
  101 + return;
  102 + GpsDataLoaderThread.setFlag(flag);
  103 + }
  104 +
  105 + @RequestMapping(value = "/updateCacheBuff")
  106 + public void updateCacheBuff() {
  107 + geoCacheData.loadData();
  108 + }
  109 +
  110 + @RequestMapping(value = "/reCalcLpSch")
  111 + public void reCalcLpSch() {
  112 + dayOfSchedule._test_reCalcLpSch();
  113 + }
  114 +
  115 + @RequestMapping(value = "/findSchByLpName")
  116 + public List<ScheduleRealInfo> findSchByLpName(@RequestParam String lpName) {
  117 + return dayOfSchedule.getLpScheduleMap().get(lpName);
  118 + }
  119 +
  120 + @RequestMapping(value = "/findSchByNbbm")
  121 + public List<ScheduleRealInfo> findSchByNbbm(@RequestParam String nbbm) {
  122 + return dayOfSchedule.findByNbbm(nbbm);
  123 + }
  124 +
  125 + @RequestMapping(value = "/executeCurr")
  126 + public ScheduleRealInfo executeCurr(@RequestParam String nbbm) {
  127 + return dayOfSchedule.executeCurr(nbbm);
  128 + };
  129 +
  130 + @RequestMapping(value = "/reCalcExecPlan4Nbbm")
  131 + public void reCalcExecPlan4Nbbm(@RequestParam String nbbm) {
  132 + dayOfSchedule.reCalcExecPlan(nbbm);
  133 + };
  134 +
  135 + @RequestMapping(value = "/reCalcExecPlan4Line")
  136 + public void reCalcExecPlan4Line(@RequestParam String lineCode) {
  137 + Set<String> nbbms = dayOfSchedule.findCarByLineCode(lineCode);
  138 + for (String nbbm : nbbms) {
  139 + dayOfSchedule.reCalcExecPlan(nbbm);
  140 + }
  141 + };
  142 +
  143 + @RequestMapping(value = "/removeExecPlan")
  144 + public int removeExecPlan(@RequestParam String nbbm) {
  145 + dayOfSchedule.removeExecPlan(nbbm);
  146 + return 1;
  147 + }
  148 +
  149 + @RequestMapping(value = "/sch_re_calc_id_maps")
  150 + public int reCalcIdMaps() {
  151 + return dayOfSchedule.reCalcIdMaps();
  152 + }
  153 +
  154 + @RequestMapping(value = "/sch_size_string")
  155 + public String schSizeString() {
  156 + return dayOfSchedule.sizeString();
  157 + }
  158 +
  159 + @RequestMapping(value = "/containerSize")
  160 + public Map<String, Integer> containerSize() {
  161 + Map<String, Integer> rs = new HashMap<>();
  162 + rs.put("60_size", dayOfDirectives.all60().size());
  163 + rs.put("80_size", pilotReport.findAll().size());
  164 + rs.put("nbbm_sch_size", dayOfSchedule.findAll().size());
  165 + rs.put("lp_sch_size", dayOfSchedule.findAllByLpContainer().size());
  166 + rs.put("id_sch_size", dayOfSchedule.findAllByIdContainer().size());
  167 + rs.put("pst_sch_size", dayOfSchedule.getPstSize());
  168 + rs.put("speeds_size", OverspeedProcess.size());
  169 + return rs;
  170 + }
  171 +
  172 + @RequestMapping(value = "/websocketRadioText")
  173 + public int radioText(String t, String lineCode) {
  174 + sendUtils.sendRadioText(t, lineCode);
  175 + return 0;
  176 + }
  177 +
  178 + @Autowired
  179 + DirectivesPstThread directivesPstThread;
  180 +
  181 + @RequestMapping(value = "/_sd_60_pst")
  182 + public void sd_60_pst() {
  183 + logger.info("手动入库指令....");
  184 + directivesPstThread.run();
  185 + }
  186 +
  187 + /**
  188 + * 删除班次,删除内存中未清理掉的非当天的班次
  189 + * @createDate 2019.05.13
  190 + * @author zhangxianzhou
  191 + * @param id 线路id
  192 + * @return 被删除的班次信息
  193 + */
  194 + @RequestMapping("/deleteSchduleBC")
  195 + public Map<String, Object> deleteSchduleBC(Long id) {
  196 + Map<String, Object> rs = new HashMap<>();
  197 + rs.put("status", ResponseCode.ERROR);
  198 + ScheduleRealInfo sch = null;
  199 + try {
  200 + sch = dayOfSchedule.get(id);
  201 + if (sch == null) {
  202 + rs.put("msg", "无效的id号");
  203 + return rs;
  204 + }
  205 +
  206 + //内存中删除
  207 + dayOfSchedule.deleteBC(sch);
  208 + rs.put("delete", sch);
  209 + rs.put("status", ResponseCode.SUCCESS);
  210 +
  211 + } catch (Exception e) {
  212 + logger.error("", e);
  213 + rs.put("msg", e.getMessage());
  214 + sch.setDeleted(false);
  215 + }
  216 +
  217 + return rs;
  218 + }
  219 +
  220 + @RequestMapping("/changeLogLevel")
  221 + public Map<String, Object> changeLogLevel(@RequestParam String level) {
  222 + Map<String, Object> rs = new HashMap<>();
  223 + rs.put("errCode", 1);
  224 + LoggerContext context = (LoggerContext)LoggerFactory.getILoggerFactory();
  225 + context.getLogger("root").setLevel(Level.toLevel(level));
  226 + rs.put("errCode", 0);
  227 + rs.put("errMsg", "成功");
  228 +
  229 + return rs;
  230 + }
164 231 }
165 232 \ No newline at end of file
... ...
src/main/java/com/bsth/controller/realcontrol/RealMapController.java
... ... @@ -27,6 +27,11 @@ public class RealMapController {
27 27 return realMapService.stationSpatialData(idx);
28 28 }
29 29  
  30 + @RequestMapping(value = "/stationVersionSpatialData")
  31 + public Map<String, Object> stationVersionSpatialData(@RequestParam String idx) {
  32 + return realMapService.stationVersionSpatialData(idx);
  33 + }
  34 +
30 35 /**
31 36 * 停车场
32 37 *
... ... @@ -49,6 +54,12 @@ public class RealMapController {
49 54 return realMapService.findRouteByLine(idx);
50 55 }
51 56  
  57 +
  58 + @RequestMapping(value = "/findRouteAndVersionByLine")
  59 + public Map<String, Object> findRouteByLineAndVersion(@RequestParam String idx) {
  60 + return realMapService.findRouteAndVersionByLine(idx);
  61 + }
  62 +
52 63 @RequestMapping(value = "/multiRouteByLine")
53 64 public Map<String, Object> multiRouteByLine(@RequestParam String codeStr) {
54 65 return realMapService.multiRouteByLine(codeStr);
... ...
src/main/java/com/bsth/controller/realcontrol/ReportRegisterController.java 0 → 100644
  1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.bsth.common.ResponseCode;
  6 +import com.bsth.controller.BaseController;
  7 +import com.bsth.data.report_register.ReportRegisterService;
  8 +import com.bsth.data.report_register.entity.ReportRegister;
  9 +import com.bsth.util.HttpClientUtils;
  10 +import org.slf4j.Logger;
  11 +import org.slf4j.LoggerFactory;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.beans.propertyeditors.CustomDateEditor;
  14 +import org.springframework.web.bind.WebDataBinder;
  15 +import org.springframework.web.bind.annotation.InitBinder;
  16 +import org.springframework.web.bind.annotation.PathVariable;
  17 +import org.springframework.web.bind.annotation.RequestMapping;
  18 +import org.springframework.web.bind.annotation.RequestMethod;
  19 +import org.springframework.web.bind.annotation.RequestParam;
  20 +import org.springframework.web.bind.annotation.RestController;
  21 +import org.springframework.web.context.request.WebRequest;
  22 +
  23 +import java.text.DateFormat;
  24 +import java.text.SimpleDateFormat;
  25 +import java.util.Date;
  26 +import java.util.HashMap;
  27 +import java.util.Map;
  28 +
  29 +/**
  30 + * 报备登记
  31 + * Created by yrf on 2019/12/04.
  32 + */
  33 +@RestController
  34 +@RequestMapping("reportRegister")
  35 +public class ReportRegisterController extends BaseController<ReportRegister, Long>{
  36 +
  37 + Logger log = LoggerFactory.getLogger(this.getClass());
  38 +
  39 + final static String url = "http://61.171.28.220:8090/complaint/TsReport/input.do"; // 临港服务投诉
  40 +// final static String url = "http://61.171.28.220:8018/complaint/TsReport/input.do"; // 浦交服务投诉
  41 +// final static String url = "http://114.80.178.13/complaint/TsReport/input.do";
  42 +// final static String url = "http://192.168.168.228:8080/complaint/TsReport/input.do";
  43 +
  44 + @Autowired
  45 + ReportRegisterService reportRegisterService;
  46 +
  47 + @InitBinder
  48 + public void initBinder(WebDataBinder binder, WebRequest request) {
  49 + //转换日期 注意这里的转化要和传进来的字符串的格式一直 如2015-9-9 就应该为yyyy-MM-dd
  50 + DateFormat dateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  51 + binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));// CustomDateEditor为自定义日期编辑器
  52 + }
  53 +
  54 +
  55 + @RequestMapping(value = "/findList", method = RequestMethod.GET)
  56 + public Map<String, Object> findList(@RequestParam Map<String, String> map) {
  57 + return reportRegisterService.findList(map);
  58 + }
  59 +
  60 + @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  61 + public ReportRegister findById(@PathVariable("id") Long id) {
  62 + ReportRegister reportRegister = reportRegisterService.findById(id);
  63 + return reportRegister;
  64 + }
  65 +
  66 + @RequestMapping(value = "/delete", method = RequestMethod.POST)
  67 + public Map<String, Object> deleteInfo(ReportRegister t) {
  68 + Map<String, Object> map = new HashMap<>();
  69 + try{
  70 +// map = baseService.delete(id);
  71 + reportRegisterService.deleteInfo(t);
  72 + String data = "{ID:'"+t.getID()+"', STATUS:'2'}";
  73 + StringBuilder sb = HttpClientUtils.post(url,data);
  74 + JSONObject obj = JSON.parseObject(sb.toString());
  75 + map.put("status2", obj);
  76 + } catch (Exception e) {
  77 + log.error(e.toString(), e);
  78 + }
  79 + return map;
  80 + }
  81 +
  82 +
  83 + @RequestMapping(method = RequestMethod.POST)
  84 + public Map<String, Object> save(ReportRegister t) {
  85 + Map<String, Object> map = new HashMap<>();
  86 + try{
  87 + reportRegisterService.save(t);
  88 + map.put("status", ResponseCode.SUCCESS);
  89 + map.put("t", t);
  90 + StringBuilder sb = HttpClientUtils.post(url,t.toString());
  91 + JSONObject obj = JSON.parseObject(sb.toString());
  92 + map.put("status2", obj);
  93 + } catch (Exception e) {
  94 + log.error(e.toString(), e);
  95 + }
  96 + return map;
  97 + }
  98 +}
... ...
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -5,6 +5,7 @@ import java.io.IOException;
5 5 import java.io.InputStream;
6 6 import java.io.OutputStream;
7 7 import java.net.HttpURLConnection;
  8 +<<<<<<< HEAD
8 9 import java.net.URL;
9 10 import java.util.ArrayList;
10 11 import java.util.Collection;
... ... @@ -22,6 +23,31 @@ import org.springframework.web.bind.annotation.RequestMapping;
22 23 import org.springframework.web.bind.annotation.RequestMethod;
23 24 import org.springframework.web.bind.annotation.RequestParam;
24 25 import org.springframework.web.bind.annotation.RestController;
  26 +=======
  27 +import java.net.MalformedURLException;
  28 +import java.net.URL;
  29 +import java.net.URLEncoder;
  30 +import java.sql.Connection;
  31 +import java.sql.Date;
  32 +import java.sql.PreparedStatement;
  33 +import java.sql.ResultSet;
  34 +import java.util.*;
  35 +
  36 +import com.bsth.data.forecast.entity.ArrivalEntity;
  37 +import com.bsth.entity.sys.SysUser;
  38 +import com.bsth.security.util.SecurityUtils;
  39 +import com.bsth.util.ReportUtils;
  40 +import com.bsth.util.db.DBUtils_MS;
  41 +import com.bsth.util.db.DBUtils_control;
  42 +import com.fasterxml.jackson.databind.ObjectMapper;
  43 +import org.apache.commons.io.IOUtils;
  44 +import org.apache.commons.lang3.StringEscapeUtils;
  45 +import org.joda.time.DateTime;
  46 +import org.joda.time.format.DateTimeFormat;
  47 +import org.joda.time.format.DateTimeFormatter;
  48 +import org.springframework.beans.factory.annotation.Autowired;
  49 +import org.springframework.web.bind.annotation.*;
  50 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
25 51  
26 52 import com.alibaba.fastjson.JSONArray;
27 53 import com.bsth.common.ResponseCode;
... ... @@ -32,12 +58,18 @@ import com.bsth.data.BasicData;
32 58 import com.bsth.data.schedule.DayOfSchedule;
33 59 import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
34 60 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  61 +<<<<<<< HEAD
35 62 import com.bsth.entity.schedule.SchedulePlanInfo;
36 63 import com.bsth.entity.sys.SysUser;
37 64 import com.bsth.security.util.SecurityUtils;
38 65 import com.bsth.service.realcontrol.ScheduleRealInfoService;
39 66 import com.bsth.util.ConfigUtil;
40 67 import com.fasterxml.jackson.databind.ObjectMapper;
  68 +=======
  69 +import com.bsth.entity.report.RepairReport;
  70 +import com.bsth.entity.schedule.SchedulePlanInfo;
  71 +import com.bsth.service.realcontrol.ScheduleRealInfoService;
  72 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
41 73  
42 74 @RestController
43 75 @RequestMapping("/realSchedule")
... ... @@ -48,6 +80,7 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
48 80  
49 81 @Autowired
50 82 DayOfSchedule dayOfSchedule;
  83 +<<<<<<< HEAD
51 84 //待发时间调整时间
52 85 public static Long dfsj= 0L;
53 86 //待发时间调整
... ... @@ -55,6 +88,8 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
55 88 dfsj = sj;
56 89 return dfsj;
57 90 }
  91 +=======
  92 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
58 93  
59 94 @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST)
60 95 public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){
... ... @@ -83,6 +118,7 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
83 118 return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType, null);
84 119 }
85 120  
  121 +<<<<<<< HEAD
86 122  
87 123 /**
88 124 *
... ... @@ -114,6 +150,8 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
114 150 }
115 151  
116 152  
  153 +=======
  154 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
117 155 /**
118 156 *
119 157 * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔
... ... @@ -182,9 +220,14 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
182 220 * @throws
183 221 */
184 222 @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST)
  223 +<<<<<<< HEAD
185 224 public Map<String, Object> realOutAdjust(@RequestParam Long id, @RequestParam String fcsjActual,
186 225 @RequestParam String remarks) {
187 226 return scheduleRealInfoService.realOutAdjust(id, fcsjActual, remarks);
  227 +=======
  228 + public Map<String, Object> realOutAdjust(@RequestParam Map<String, String> map) {
  229 + return scheduleRealInfoService.realOutAdjust(map);
  230 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
188 231 }
189 232  
190 233 /**
... ... @@ -320,9 +363,15 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
320 363 }
321 364  
322 365 @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET)
  366 +<<<<<<< HEAD
323 367 public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName, @RequestParam String clZbh,
324 368 @RequestParam String lpName,@RequestParam String date,@RequestParam String line) {
325 369 return scheduleRealInfoService.exportWaybill(jName, clZbh, lpName,date,line);
  370 +=======
  371 + public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName,@RequestParam String jGh, @RequestParam String clZbh,
  372 + @RequestParam String lpName,@RequestParam String date,@RequestParam String line) {
  373 + return scheduleRealInfoService.exportWaybill(jName,jGh, clZbh, lpName,date,line);
  374 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
326 375 }
327 376  
328 377 @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET)
... ... @@ -402,15 +451,25 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
402 451 /**
403 452 * @Title queryListWaybill
404 453 * @Description 查询行车路单列表
  454 +<<<<<<< HEAD
405 455 * @param jName 驾驶员名字
  456 +=======
  457 + * @param jGh 驾驶员名字
  458 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
406 459 * @param clZbh 车辆自编号(内部编号)
407 460 * @param lpName 路牌
408 461 * @return
409 462 */
410 463 @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET)
  464 +<<<<<<< HEAD
411 465 public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName
412 466 ,@RequestParam String date,@RequestParam String line){
413 467 return scheduleRealInfoService.queryListWaybill(jName, clZbh,lpName,date,line);
  468 +=======
  469 + public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName
  470 + ,@RequestParam String date,@RequestParam String line){
  471 + return scheduleRealInfoService.queryListWaybill(jGh, clZbh,lpName,date,line);
  472 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
414 473 }
415 474  
416 475 /**
... ... @@ -589,7 +648,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
589 648 }
590 649  
591 650 @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST)
  651 +<<<<<<< HEAD
592 652 public Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){
  653 +=======
  654 + public synchronized Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){
  655 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
593 656 cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson);
594 657 List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class);
595 658 return scheduleRealInfoService.multi_tzrc(cpcs, null);
... ... @@ -626,7 +689,11 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
626 689 long t = System.currentTimeMillis();
627 690 if(c != 1)
628 691 t -= (ONE_DAY + (1000 * 60 * 60 * 6));
  692 +<<<<<<< HEAD
629 693 for(int i = 0; i < 4; i ++){
  694 +=======
  695 + for(int i = 0; i < 3; i ++){
  696 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
630 697 rs.add(fmtyyyyMMdd.print(t));
631 698 t -= ONE_DAY;
632 699 }
... ... @@ -742,13 +809,18 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
742 809  
743 810 /**
744 811 * 从历史库里删除临加班次
  812 +<<<<<<< HEAD
745 813 * @param sch
  814 +=======
  815 + * @param id
  816 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
746 817 * @return
747 818 */
748 819 @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE)
749 820 public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){
750 821 return scheduleRealInfoService.deleteToHistory(id);
751 822 }
  823 +<<<<<<< HEAD
752 824  
753 825 /**
754 826 * 从历史库里删除临加班次
... ... @@ -819,4 +891,323 @@ public class ScheduleRealInfoController extends BaseController&lt;ScheduleRealInfo,
819 891  
820 892 return res;
821 893 }
  894 +=======
  895 +
  896 + @RequestMapping(value = "isCircleQdz", method = RequestMethod.POST)
  897 + public Map<String, Object> isCircleQdz(@RequestParam String line, String nbbm, String ts, String qdzCode){
  898 + Map<String, Object> map =new HashMap<>();
  899 + map.put("isExist",scheduleRealInfoService.isCircleQdz(nbbm, ts, line, qdzCode));
  900 + return map;
  901 + }
  902 +
  903 + /**
  904 + * 从历史库里删除临加班次
  905 + * @param param
  906 + * @return
  907 + */
  908 + @RequestMapping(value = "wxsb", method = RequestMethod.POST)
  909 + public Map<String, Object> repairReport(@RequestParam Map<String, Object> param){
  910 + return scheduleRealInfoService.repairReport(param, true);
  911 + }
  912 +
  913 + @RequestMapping(value = "wxsb", method = RequestMethod.GET)
  914 + public List<RepairReport> repairReportList(@RequestParam String line, @RequestParam String date, @RequestParam String code, @RequestParam String type){
  915 + return scheduleRealInfoService.repairReportList(line, date, code, type);
  916 + }
  917 +
  918 + @RequestMapping(value = "lineLevel", method = RequestMethod.GET)
  919 + public Map<String, String> lineLevel(@RequestParam String idx){
  920 + return scheduleRealInfoService.getLevelsByLines(Arrays.asList(idx.split(",")));
  921 + }
  922 +
  923 + /**
  924 + * 反馈安全驾驶系统
  925 + * @param param
  926 + * @return
  927 + */
  928 + @RequestMapping(value = "ackDsm", method = RequestMethod.POST)
  929 + public Map<String, Object> ackDsm(@RequestParam Map<String, Object> param){
  930 + Map<String, Object> res = new HashMap<>();
  931 + InputStream in = null;
  932 + SysUser user = SecurityUtils.getCurrentUser();
  933 + DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
  934 + StringBuilder url = new StringBuilder("http://211.95.61.66:9008/modules/dsmCheckTheRecord/addDsm?"), uri = new StringBuilder();
  935 + HttpURLConnection con = null;
  936 + try {
  937 + uri.append("ddyName=").append(URLEncoder.encode(user == null ? "admin" : user.getUserName(), "UTF-8"));
  938 + uri.append("&checkTime=").append(URLEncoder.encode(fmt.print(System.currentTimeMillis()), "UTF-8"));
  939 + uri.append("&nbbm=").append(URLEncoder.encode(param.get("nbbm").toString(), "UTF-8"));
  940 + uri.append("&starttime=").append(URLEncoder.encode(fmt.print(Long.parseLong(param.get("ts").toString())), "UTF-8"));
  941 + url.append(uri);
  942 + con = (HttpURLConnection)new URL(url.toString()).openConnection();
  943 + con.setDoInput(true);
  944 + con.setRequestMethod("POST");
  945 + con.setConnectTimeout(5000);
  946 + con.setReadTimeout(5000);
  947 + con.setRequestProperty("keep-alive", "true");
  948 + con.setRequestProperty("accept", "*/*");
  949 + con.setRequestProperty("content-type", "application/x-www-form-urlencoded");
  950 + con.connect();
  951 +
  952 + if (con.getResponseCode() == 200) {
  953 + in = con.getInputStream();
  954 + ByteArrayOutputStream bout = new ByteArrayOutputStream();
  955 + IOUtils.copy(in, bout);
  956 + Map<String, Object> map = new ObjectMapper().readValue(bout.toByteArray(), Map.class);
  957 + System.out.println(map);
  958 + }
  959 + } catch (MalformedURLException e) {
  960 + // TODO Auto-generated catch block
  961 + e.printStackTrace();
  962 + } catch (IOException e) {
  963 + // TODO Auto-generated catch block
  964 + e.printStackTrace();
  965 + } finally {
  966 + if (con != null) {
  967 + con.disconnect();
  968 + }
  969 + }
  970 +
  971 + return res;
  972 + }
  973 +
  974 + @RequestMapping(value = "exportPlan", method = RequestMethod.GET)
  975 + public Map<String, Object> exportPlan(@RequestParam String date){
  976 + Map<String, Object> res = new HashMap<>();
  977 + DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm");
  978 + Connection conn = null;
  979 + PreparedStatement ps = null;
  980 + ResultSet rs = null;
  981 +
  982 + List<Map<String, Object>> list = new ArrayList<>();
  983 + String sql = "select xl_name,xl_dir,schedule_date,fcsj,cl_zbh,j_name,bcsj from bsth_c_s_sp_info where schedule_date = ? and xl_bm in (22205, 202104, 202105, 202106, 202107, 210415) and bc_type = 'normal'";
  984 + try{
  985 + conn = DBUtils_control.getConnection();
  986 + ps = conn.prepareStatement(sql);
  987 + ps.setString(1, date);
  988 + rs = ps.executeQuery();
  989 + ObjectMapper mapper = new ObjectMapper();
  990 +
  991 + while (rs.next()) {
  992 + SchedulePlan schedulePlan = new SchedulePlan();
  993 + schedulePlan.setXlName(rs.getString("xl_name"));
  994 + schedulePlan.setXlDir(rs.getInt("xl_dir"));
  995 + Date scheduleDate = rs.getDate("schedule_date");
  996 + schedulePlan.setScheduleDate(new DateTime(scheduleDate.getTime()).toString("yyyy-MM-dd"));
  997 + String fcsj = rs.getString("fcsj");
  998 + int bcsj = rs.getInt("bcsj");
  999 + DateTime fcsjDt = dateTimeFormatter.parseDateTime(schedulePlan.getScheduleDate() + " " + fcsj);
  1000 + schedulePlan.setFcsj(fcsjDt.toString("HH:mm:00"));
  1001 + DateTime ddsjDt = fcsjDt.plusMinutes(bcsj);
  1002 + schedulePlan.setDdsj(ddsjDt.toString("HH:mm:00"));
  1003 + schedulePlan.setSjdStart(fcsjDt.toString("HH:00:00"));
  1004 + DateTime endDt = fcsjDt.plusHours(1);
  1005 + schedulePlan.setSjdEnd(endDt.toString("HH:00:00"));
  1006 + schedulePlan.setClZbh(rs.getString("cl_zbh"));
  1007 + schedulePlan.setJsy(rs.getString("j_name"));
  1008 + schedulePlan.setBcsj(bcsj);
  1009 +
  1010 + list.add(mapper.readValue(mapper.writeValueAsString(schedulePlan), HashMap.class));
  1011 + }
  1012 + List<Iterator<?>> iterators = new ArrayList<Iterator<?>>();
  1013 + iterators.add(list.iterator());
  1014 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1015 + String sourcePath = path + "mould/schedulePlan.xls";
  1016 +
  1017 + new ReportUtils().excelReplace(iterators, new Object[]{}, sourcePath, path + "export/" + date + "-花博会专线班次.xls");
  1018 +
  1019 + res.put("status", ResponseCode.SUCCESS);
  1020 + res.put("msg", "成功");
  1021 + } catch (Exception e) {
  1022 + res.put("status", ResponseCode.ERROR);
  1023 + res.put("msg", e.getMessage());
  1024 + } finally {
  1025 + DBUtils_control.close(rs, ps, conn);
  1026 + }
  1027 +
  1028 + return res;
  1029 + }
  1030 +
  1031 + public final static class SchedulePlan {
  1032 + private String company = "浦东公司[46]";
  1033 +
  1034 + private String xlName = "";
  1035 +
  1036 + private int xlDir;
  1037 +
  1038 + private String xlDirStr = "";
  1039 +
  1040 + private String scheduleDate = "";
  1041 +
  1042 + private String sjdStart = "";
  1043 +
  1044 + private String sjdEnd = "";
  1045 +
  1046 + private String fcsj = "";
  1047 +
  1048 + private int bcsj;
  1049 +
  1050 + private String ddsj = "";
  1051 +
  1052 + private int yys = 25;
  1053 +
  1054 + private String clZbh = "";
  1055 +
  1056 + private String cph = "";
  1057 +
  1058 + private String color = "绿牌";
  1059 +
  1060 + private String jsy = "";
  1061 +
  1062 + private String jsydh = "";
  1063 +
  1064 + private int pj = 10;
  1065 +
  1066 + public String getCompany() {
  1067 + return company;
  1068 + }
  1069 +
  1070 + public void setCompany(String company) {
  1071 + this.company = company;
  1072 + }
  1073 +
  1074 + public String getXlName() {
  1075 + return xlName;
  1076 + }
  1077 +
  1078 + public void setXlName(String xlName) {
  1079 + this.xlName = xlName;
  1080 + }
  1081 +
  1082 + public int getXlDir() {
  1083 + return xlDir;
  1084 + }
  1085 +
  1086 + public void setXlDir(int xlDir) {
  1087 + this.xlDir = xlDir;
  1088 + }
  1089 +
  1090 + public String getXlDirStr() {
  1091 + xlDirStr = "";
  1092 + if (xlDir == 0) {
  1093 + xlDirStr = "上行";
  1094 + } else if (xlDir == 1) {
  1095 + xlDirStr = "下行";
  1096 + }
  1097 + return xlDirStr;
  1098 + }
  1099 +
  1100 + public void setXlDirStr(String xlDirStr) {
  1101 + this.xlDirStr = xlDirStr;
  1102 + }
  1103 +
  1104 + public String getScheduleDate() {
  1105 + return scheduleDate;
  1106 + }
  1107 +
  1108 + public void setScheduleDate(String scheduleDate) {
  1109 + this.scheduleDate = scheduleDate;
  1110 + }
  1111 +
  1112 + public String getSjdStart() {
  1113 + return sjdStart;
  1114 + }
  1115 +
  1116 + public void setSjdStart(String sjdStart) {
  1117 + this.sjdStart = sjdStart;
  1118 + }
  1119 +
  1120 + public String getSjdEnd() {
  1121 + return sjdEnd;
  1122 + }
  1123 +
  1124 + public void setSjdEnd(String sjdEnd) {
  1125 + this.sjdEnd = sjdEnd;
  1126 + }
  1127 +
  1128 + public String getFcsj() {
  1129 + return fcsj;
  1130 + }
  1131 +
  1132 + public void setFcsj(String fcsj) {
  1133 + this.fcsj = fcsj;
  1134 + }
  1135 +
  1136 + public int getBcsj() {
  1137 + return bcsj;
  1138 + }
  1139 +
  1140 + public void setBcsj(int bcsj) {
  1141 + this.bcsj = bcsj;
  1142 + }
  1143 +
  1144 + public String getDdsj() {
  1145 + return ddsj;
  1146 + }
  1147 +
  1148 + public void setDdsj(String ddsj) {
  1149 + this.ddsj = ddsj;
  1150 + }
  1151 +
  1152 + public int getYys() {
  1153 + return yys;
  1154 + }
  1155 +
  1156 + public void setYys(int yys) {
  1157 + this.yys = yys;
  1158 + }
  1159 +
  1160 + public String getClZbh() {
  1161 + return clZbh;
  1162 + }
  1163 +
  1164 + public void setClZbh(String clZbh) {
  1165 + this.clZbh = clZbh;
  1166 + }
  1167 +
  1168 + public String getCph() {
  1169 + cph = BasicData.nbbmCompanyPlateMap.get(clZbh);
  1170 + if (cph == null) {
  1171 + cph = "";
  1172 + }
  1173 + return cph;
  1174 + }
  1175 +
  1176 + public void setCph(String cph) {
  1177 + this.cph = cph;
  1178 + }
  1179 +
  1180 + public String getColor() {
  1181 + return color;
  1182 + }
  1183 +
  1184 + public void setColor(String color) {
  1185 + this.color = color;
  1186 + }
  1187 +
  1188 + public String getJsy() {
  1189 + return jsy;
  1190 + }
  1191 +
  1192 + public void setJsy(String jsy) {
  1193 + this.jsy = jsy;
  1194 + }
  1195 +
  1196 + public String getJsydh() {
  1197 + return jsydh;
  1198 + }
  1199 +
  1200 + public void setJsydh(String jsydh) {
  1201 + this.jsydh = jsydh;
  1202 + }
  1203 +
  1204 + public int getPj() {
  1205 + return pj;
  1206 + }
  1207 +
  1208 + public void setPj(int pj) {
  1209 + this.pj = pj;
  1210 + }
  1211 + }
  1212 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
822 1213 }
... ...
src/main/java/com/bsth/controller/realcontrol/ServiceDataInterface.java
... ... @@ -75,7 +75,7 @@ public class ServiceDataInterface {
75 75 map.put("jGh", sch.getjGh());
76 76 map.put("jName", sch.getjName());
77 77 map.put("sGh", sch.getsGh());
78   - map.put("sName", sch.getsGh());
  78 + map.put("sName", sch.getsName());
79 79 map.put("lpName", sch.getLpName());
80 80 map.put("xlBm", sch.getXlBm());
81 81 map.put("xlName", sch.getXlName());
... ...
src/main/java/com/bsth/controller/report/CalcSheetController.java
... ... @@ -29,6 +29,14 @@ public class CalcSheetController extends BaseController&lt;CalcSheet, Integer&gt;{
29 29 List<CalcSheet> list=calcSheetService.calcListSheet(map);
30 30 return list;
31 31 }
  32 +
  33 + //D级别线路发车到站准点率列表
  34 + @RequestMapping(value = "/calcListSheet_d",method = RequestMethod.GET)
  35 + public List<CalcSheet> calcListSheet_d(@RequestParam Map<String, Object> map){
  36 + List<CalcSheet> list=calcSheetService.calcListSheet_d(map);
  37 + return list;
  38 + }
  39 +
32 40 //发车站点准点率详细
33 41 @RequestMapping(value = "/calcSheet",method = RequestMethod.GET)
34 42 public List<Sheet> calcSheet(@RequestParam Map<String, Object> map){
... ... @@ -42,4 +50,11 @@ public class CalcSheetController extends BaseController&lt;CalcSheet, Integer&gt;{
42 50 List<Map<String, Object>> list=calcSheetService.calcTurnoutrate(map);
43 51 return list;
44 52 }
  53 +
  54 +
  55 + @RequestMapping(value = "/calcTurnoutrateZgf",method = RequestMethod.GET)
  56 + public List<Map<String, Object>> calcTurnoutrateZgf(@RequestParam Map<String, Object> map){
  57 + List<Map<String, Object>> list=calcSheetService.calcTurnoutrateZgf(map);
  58 + return list;
  59 + }
45 60 }
... ...
src/main/java/com/bsth/controller/report/CardIsingningController.java 0 → 100644
  1 +package com.bsth.controller.report;
  2 +
  3 +
  4 +import com.bsth.entity.card_signing.CardSigning;
  5 +import com.bsth.service.report.CardSigningService;
  6 +import org.springframework.beans.factory.annotation.Autowired;
  7 +import org.springframework.web.bind.annotation.*;
  8 +
  9 +import java.util.List;
  10 +import java.util.Map;
  11 +
  12 +@RestController
  13 +@RequestMapping("CardSigning")
  14 +public class CardIsingningController {
  15 + @Autowired
  16 + CardSigningService cardSigningService;
  17 +
  18 + //线路插卡率列表
  19 + @RequestMapping(value = "/cardList",method = RequestMethod.GET)
  20 + public List<CardSigning> sheetList(@RequestParam Map<String, Object> map){
  21 + List<CardSigning> list= cardSigningService.cardList(map);
  22 + return list;
  23 + }
  24 +
  25 + //线路插卡率 线路详细列表第二级
  26 + @RequestMapping(value = "/calcListSheet",method = RequestMethod.GET)
  27 + public List<CardSigning> calcListSheet(@RequestParam Map<String, Object> map){
  28 + List<CardSigning> list= cardSigningService.calcListSheet(map);
  29 + return list;
  30 + }
  31 +
  32 + //线路插卡率 线路详细列表第二级
  33 + @RequestMapping(value = "/calcSheet",method = RequestMethod.GET)
  34 + public List<CardSigning> calcSheet(@RequestParam Map<String, Object> map){
  35 + List<CardSigning> list= cardSigningService.calcSheet(map);
  36 + return list;
  37 + }
  38 +
  39 +
  40 +
  41 +
  42 +}
... ...
src/main/java/com/bsth/controller/report/ReportController.java
... ... @@ -19,6 +19,7 @@ import com.alibaba.fastjson.JSONObject;
19 19 import com.bsth.data.BasicData;
20 20 import com.bsth.entity.StationRoute;
21 21 import com.bsth.entity.excep.ArrivalInfo;
  22 +import com.bsth.entity.mcy_forms.Singledata;
22 23 import com.bsth.entity.realcontrol.ScheduleRealInfo;
23 24 import com.bsth.service.report.ReportService;
24 25 import com.bsth.util.ReportUtils;
... ... @@ -357,13 +358,12 @@ public class ReportController {
357 358  
358 359 return lMap;
359 360 }
360   -
361   -
362 361 @RequestMapping(value="/online")
363 362 public Map<String, Object> online(@RequestParam Map<String, Object> map){
364 363 return service.online(map);
365 364 }
366 365  
  366 +<<<<<<< HEAD
367 367 @RequestMapping(value="/workingHours" ,method = RequestMethod.POST)
368 368 public List<Map<String, Object>> workingHours(@RequestParam String gsdm, @RequestParam String fgsdm,
369 369 @RequestParam String line, @RequestParam String date, @RequestParam String date2, @RequestParam String gh,
... ... @@ -385,5 +385,32 @@ public class ReportController {
385 385 }
386 386 }
387 387 return list;
  388 +=======
  389 +
  390 +
  391 + @RequestMapping(value = "/singledatatj", method = RequestMethod.GET)
  392 + public List<Singledata> singledatatj(@RequestParam Map<String, Object> map) {
  393 +
  394 + return service.singledatatj(map);
  395 + }
  396 +
  397 + //单日统计路单公里与油量,电量合并
  398 + @RequestMapping(value = "/singleEnergy", method = RequestMethod.GET)
  399 + public List<Map<String, Object>> singleEnergy(@RequestParam Map<String, Object> map) {
  400 +
  401 + return service.singleEnergy(map);
  402 + }
  403 +
  404 + /**
  405 + * @Description :TODO(路单线路明细月报表导出数据)
  406 + *
  407 + * @param map <tables>
  408 + *
  409 + * @return Map<String, Object>
  410 + */
  411 + @RequestMapping(value = "/calcDetailMonthlyE" , method = RequestMethod.POST)
  412 + public Map<String, Object> calcDetailMonthlyE(@RequestParam Map<String,Object> map) {
  413 + return service.calcDetailMonthlyE(map);
  414 +>>>>>>> 6cafe1acab4252c1fd171e0669654f317bf0fd4a
388 415 }
389 416 }
... ...
src/main/java/com/bsth/controller/schedule/BController_facade.java 0 → 100644
  1 +package com.bsth.controller.schedule;
  2 +
  3 +import com.bsth.common.Constants;
  4 +import com.bsth.common.ResponseCode;
  5 +import com.bsth.control_v2.plan_module.common.dto.PageRequestDto;
  6 +import com.bsth.control_v2.plan_module.common.exception.PlanModuleException;
  7 +import com.bsth.control_v2.plan_module.common.service.BServiceFacade;
  8 +import com.bsth.entity.sys.SysUser;
  9 +import com.bsth.service.sys.SysUserService;
  10 +import org.springframework.beans.factory.annotation.Autowired;
  11 +import org.springframework.web.bind.annotation.*;
  12 +
  13 +import javax.servlet.http.HttpSession;
  14 +import java.io.Serializable;
  15 +import java.util.Date;
  16 +import java.util.HashMap;
  17 +import java.util.List;
  18 +import java.util.Map;
  19 +
  20 +public abstract class BController_facade<Id extends Serializable, DTO> {
  21 + protected abstract BServiceFacade<Id, DTO> getBServiceFacade();
  22 +
  23 + @Autowired
  24 + private SysUserService sysUserService;
  25 +
  26 + //---------------- 设置操作用户 ----------------//
  27 + public void setCreateUserInfo(DTO dto, Integer userId, Date createDate) {
  28 + throw new PlanModuleException("子类必须override setCUserInfo方法!");
  29 + }
  30 + public void setUpdateUserInfo(DTO dto, Integer userId, Date updateDate) {
  31 + throw new PlanModuleException("子类必须override setUpdateUserInfo方法!");
  32 + }
  33 +
  34 + //---------------- 扩展的save,update,delete操作 --------------------//
  35 + protected boolean isSaveExtend() {
  36 + return false;
  37 + }
  38 + protected DTO saveExtend(DTO dto) {
  39 + throw new PlanModuleException("子类如果isSaveExtend()==true,必须覆写saveExtend!");
  40 + }
  41 + protected boolean isUpdateExtend() {
  42 + return false;
  43 + }
  44 + protected DTO updateExtend(DTO dto) {
  45 + throw new PlanModuleException("子类如果isUpdateExtend()==true,必须覆写updateExtend!");
  46 + }
  47 + protected boolean isDeleteExtend() {
  48 + return false;
  49 + }
  50 + protected void deleteExtend(Id id) {
  51 + throw new PlanModuleException("子类如果isDeleteExtend()==true,必须覆写deleteExtend!");
  52 + }
  53 +
  54 + //---------------- CRUD 操作 ----------------//
  55 + // Create操作
  56 + @RequestMapping(method = RequestMethod.POST)
  57 + public Map<String, Object> save(@RequestBody DTO dto, HttpSession httpSession) {
  58 + String userName = String.valueOf(httpSession.getAttribute(Constants.SESSION_USERNAME));
  59 + SysUser sysUser = sysUserService.findByUserName(userName);
  60 + setCreateUserInfo(dto, sysUser.getId(), new Date());
  61 + setUpdateUserInfo(dto, sysUser.getId(), new Date());
  62 +
  63 + Map<String, Object> rtn = new HashMap<>();
  64 + try {
  65 + DTO dto_saved;
  66 + if (isSaveExtend()) {
  67 + dto_saved = saveExtend(dto);
  68 + } else {
  69 + dto_saved = getBServiceFacade().save(dto);
  70 + }
  71 + rtn.put("status", ResponseCode.SUCCESS);
  72 + rtn.put("data", dto_saved);
  73 + } catch (Exception exp) {
  74 + rtn.put("status", ResponseCode.ERROR);
  75 + rtn.put("msg", exp.getMessage());
  76 + }
  77 +
  78 + return rtn;
  79 + }
  80 +
  81 + // Update操作
  82 + @RequestMapping(value="/{id}", method = RequestMethod.POST)
  83 + public Map<String, Object> update(@RequestBody DTO dto, HttpSession httpSession) {
  84 + String userName = String.valueOf(httpSession.getAttribute(Constants.SESSION_USERNAME));
  85 + SysUser sysUser = sysUserService.findByUserName(userName);
  86 + setUpdateUserInfo(dto, sysUser.getId(), new Date());
  87 +
  88 + Map<String, Object> rtn = new HashMap<>();
  89 + try {
  90 + DTO dto_updated;
  91 + if (isUpdateExtend()) {
  92 + dto_updated = updateExtend(dto);
  93 + } else {
  94 + dto_updated = getBServiceFacade().save(dto);
  95 + }
  96 + rtn.put("status", ResponseCode.SUCCESS);
  97 + rtn.put("data", dto_updated);
  98 + } catch (Exception exp) {
  99 + rtn.put("status", ResponseCode.ERROR);
  100 + rtn.put("msg", exp.getMessage());
  101 + }
  102 +
  103 + return rtn;
  104 + }
  105 +
  106 + // Research操作
  107 + @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  108 + public Map<String, Object> findById(@PathVariable("id") Id id) {
  109 + Map<String, Object> rtn = new HashMap<>();
  110 + try {
  111 + DTO dto = getBServiceFacade().findById(id);
  112 + rtn.put("status", ResponseCode.SUCCESS);
  113 + rtn.put("data", dto);
  114 + } catch (Exception exp) {
  115 + rtn.put("status", ResponseCode.ERROR);
  116 + rtn.put("msg", exp.getMessage());
  117 + }
  118 +
  119 + return rtn;
  120 + }
  121 +
  122 + // 查询所有操作
  123 + @RequestMapping(value = "/all", method = RequestMethod.GET)
  124 + public Map<String, Object> list(@RequestParam Map<String, Object> param) {
  125 + Map<String, Object> rtn = new HashMap<>();
  126 + try {
  127 + List<DTO> tList = getBServiceFacade().list(param);
  128 + rtn.put("status", ResponseCode.SUCCESS);
  129 + rtn.put("data", tList);
  130 + } catch (Exception exp) {
  131 + rtn.put("status", ResponseCode.ERROR);
  132 + rtn.put("msg", exp.getMessage());
  133 + }
  134 + return rtn;
  135 + }
  136 +
  137 + // 分页查询操作
  138 + @RequestMapping(method = RequestMethod.GET)
  139 + public Map<String, Object> list(
  140 + @RequestParam Map<String, Object> map,
  141 + @RequestParam(defaultValue = "0") int page,
  142 + @RequestParam(defaultValue = "10") int size,
  143 + @RequestParam(defaultValue = "id") String order,
  144 + @RequestParam(defaultValue = "DESC") String direction) {
  145 + PageRequestDto pageRequestDto = PageRequestDto.getBuilder()
  146 + .setPage(page)
  147 + .setSize(size)
  148 + .setOrder(order)
  149 + .setDirection(direction)
  150 + .build();
  151 + Map<String, Object> rtn = new HashMap<>();
  152 + try {
  153 + rtn.put("data", getBServiceFacade().list(map, pageRequestDto));
  154 + rtn.put("status", ResponseCode.SUCCESS);
  155 + } catch (Exception exp) {
  156 + rtn.put("status", ResponseCode.ERROR);
  157 + rtn.put("msg", exp.getMessage());
  158 + }
  159 + return rtn;
  160 + }
  161 +
  162 + // Delete操作
  163 + @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
  164 + public Map<String, Object> delete(@PathVariable("id") Id id, HttpSession httpSession) {
  165 + Map<String, Object> rtn = new HashMap<>();
  166 + try {
  167 + // 由于种种原因,这里不保存用户和操作时间了
  168 + if (isDeleteExtend()) {
  169 + deleteExtend(id);
  170 + } else {
  171 + getBServiceFacade().delete(id);
  172 + }
  173 + rtn.put("status", ResponseCode.SUCCESS);
  174 + } catch (Exception exp) {
  175 + rtn.put("status", ResponseCode.ERROR);
  176 + rtn.put("msg", exp.getMessage());
  177 + }
  178 + return rtn;
  179 + }
  180 +}
... ...
src/main/java/com/bsth/controller/schedule/basicinfo/CarController_facade.java 0 → 100644
  1 +package com.bsth.controller.schedule.basicinfo;
  2 +
  3 +import com.alibaba.dubbo.config.annotation.Reference;
  4 +import com.bsth.common.ResponseCode;
  5 +import com.bsth.control_v2.plan_module.common.config.springboot.dubbo.DubboConfigCondition;
  6 +import com.bsth.control_v2.plan_module.common.dto.baseinfo.CarDto;
  7 +import com.bsth.control_v2.plan_module.common.dto.sys.UserDto;
  8 +import com.bsth.control_v2.plan_module.common.service.BServiceFacade;
  9 +import com.bsth.control_v2.plan_module.common.service.baseinfo.CarServiceFacade;
  10 +import com.bsth.controller.schedule.BController_facade;
  11 +import com.bsth.service.schedule.CarsService;
  12 +import com.bsth.service.schedule.utils.DataToolsFile;
  13 +import org.apache.commons.lang3.StringUtils;
  14 +import org.apache.poi.ss.usermodel.Workbook;
  15 +import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.context.annotation.Conditional;
  17 +import org.springframework.web.bind.annotation.RequestMapping;
  18 +import org.springframework.web.bind.annotation.RequestMethod;
  19 +import org.springframework.web.bind.annotation.RequestParam;
  20 +import org.springframework.web.bind.annotation.RestController;
  21 +import org.springframework.web.multipart.MultipartFile;
  22 +
  23 +import javax.servlet.http.HttpServletResponse;
  24 +import java.io.*;
  25 +import java.util.*;
  26 +
  27 +/**
  28 + * 车辆基础信息controller_facade
  29 + */
  30 +@RestController
  31 +@Conditional(DubboConfigCondition.class)
  32 +@RequestMapping("cars_sc")
  33 +public class CarController_facade extends BController_facade<Integer, CarDto> {
  34 +
  35 + @Override
  36 + public void setCreateUserInfo(CarDto carDto, Integer userId, Date createDate) {
  37 + UserDto userDto = UserDto.getBuilder()
  38 + .setId(userId)
  39 + .build();
  40 + carDto.setCreateBy(userDto);
  41 + carDto.setCreateDate(createDate);
  42 + }
  43 + @Override
  44 + public void setUpdateUserInfo(CarDto carDto, Integer userId, Date updateDate) {
  45 + UserDto userDto = UserDto.getBuilder()
  46 + .setId(userId)
  47 + .build();
  48 + carDto.setUpdateBy(userDto);
  49 + carDto.setUpdateDate(updateDate);
  50 + }
  51 +
  52 + @Reference
  53 + private CarServiceFacade carServiceFacade;
  54 + @Override
  55 + protected BServiceFacade<Integer, CarDto> getBServiceFacade() {
  56 + return carServiceFacade;
  57 + }
  58 +
  59 + @RequestMapping(value = "/validate_zbh", method = RequestMethod.GET)
  60 + public Map<String, Object> validate_zbh(@RequestParam Map<String, Object> param) {
  61 + Map<String, Object> rtn = new HashMap<>();
  62 + try {
  63 + // 自编号验证
  64 + CarDto carDto = CarDto.getBuilder()
  65 + .setId(param.get("id_eq") == null ?
  66 + null : Integer.valueOf(param.get("id_eq").toString()))
  67 + .setInsideCode(param.get("insideCode_eq") == null ?
  68 + null : param.get("insideCode_eq").toString())
  69 + .build();
  70 + this.carServiceFacade.validate_repeat_nbbh(carDto);
  71 + rtn.put("status", ResponseCode.SUCCESS);
  72 + } catch (Exception exp) {
  73 + rtn.put("status", ResponseCode.ERROR);
  74 + rtn.put("msg", exp.getMessage());
  75 + }
  76 + return rtn;
  77 + }
  78 +
  79 + @RequestMapping(value = "/validate_clbh", method = RequestMethod.GET)
  80 + public Map<String, Object> validate_clbh(@RequestParam Map<String, Object> param) {
  81 + Map<String, Object> rtn = new HashMap<>();
  82 + try {
  83 + // 车辆编号验证
  84 + CarDto carDto = CarDto.getBuilder()
  85 + .setId(param.get("id_eq") == null ?
  86 + null : Integer.valueOf(param.get("id_eq").toString()))
  87 + .setCarCode(param.get("carCode_eq") == null ?
  88 + null : param.get("carCode_eq").toString())
  89 + .build();
  90 + this.carServiceFacade.validate_repeat_clbh(carDto);
  91 + rtn.put("status", ResponseCode.SUCCESS);
  92 + } catch (Exception exp) {
  93 + rtn.put("status", ResponseCode.ERROR);
  94 + rtn.put("msg", exp.getMessage());
  95 + }
  96 + return rtn;
  97 + }
  98 +
  99 + @RequestMapping(value = "/validate_cph", method = RequestMethod.GET)
  100 + public Map<String, Object> validate_cph(@RequestParam Map<String, Object> param) {
  101 + Map<String, Object> rtn = new HashMap<>();
  102 + try {
  103 + // 车牌号验证
  104 + CarDto carDto = CarDto.getBuilder()
  105 + .setId(param.get("id_eq") == null ?
  106 + null : Integer.valueOf(param.get("id_eq").toString()))
  107 + .setCarPlate(param.get("carPlate_eq") == null ?
  108 + null : param.get("carPlate_eq").toString())
  109 + .build();
  110 + this.carServiceFacade.validate_repeat_cph(carDto);
  111 + rtn.put("status", ResponseCode.SUCCESS);
  112 + } catch (Exception exp) {
  113 + rtn.put("status", ResponseCode.ERROR);
  114 + rtn.put("msg", exp.getMessage());
  115 + }
  116 + return rtn;
  117 + }
  118 +
  119 + @RequestMapping(value = "/validate_sbbh", method = RequestMethod.GET)
  120 + public Map<String, Object> validate_sbbh(@RequestParam Map<String, Object> param) {
  121 + Map<String, Object> rtn = new HashMap<>();
  122 + try {
  123 + // 设备编号验证
  124 + CarDto carDto = CarDto.getBuilder()
  125 + .setId(param.get("id_eq") == null ?
  126 + null : Integer.valueOf(param.get("id_eq").toString()))
  127 + .setEquipmentCode(param.get("equipmentCode_eq") == null ?
  128 + null : param.get("equipmentCode_eq").toString())
  129 + .build();
  130 + this.carServiceFacade.validate_repeat_sbbh(carDto);
  131 + rtn.put("status", ResponseCode.SUCCESS);
  132 + } catch (Exception exp) {
  133 + rtn.put("status", ResponseCode.ERROR);
  134 + rtn.put("msg", exp.getMessage());
  135 + }
  136 + return rtn;
  137 + }
  138 +
  139 + //------------------ TODO:导入导出逻辑,之后会服务化 -----------------//
  140 + @Autowired
  141 + private CarsService carsService;
  142 + // 上传excel文件
  143 + @RequestMapping(value = "/uploadFile", method = RequestMethod.POST)
  144 + public Map<String, Object> uploadFile(MultipartFile file) {
  145 + Map<String, Object> rtn = new HashMap<>();
  146 + try {
  147 + DataToolsFile dataToolsFile = carsService.uploadFile(file.getOriginalFilename(), file.getBytes());
  148 + // excel文件名
  149 + String fileName = dataToolsFile.getFile().getAbsolutePath();
  150 + Workbook wb = dataToolsFile.getFileType().getWorkBook(dataToolsFile.getFile());
  151 +
  152 + // excel文件sheet
  153 + List<String> sheetnames = new ArrayList<>();
  154 + for (int i = 0; i < wb.getNumberOfSheets(); i ++) {
  155 + sheetnames.add(wb.getSheetAt(i).getSheetName());
  156 + }
  157 +
  158 + wb.close();
  159 +
  160 + rtn.put("status", ResponseCode.SUCCESS);
  161 + rtn.put("filename", fileName);
  162 + rtn.put("sheetnames", StringUtils.join(sheetnames, ","));
  163 + } catch (Exception exp) {
  164 + exp.printStackTrace();
  165 + rtn.put("status", ResponseCode.ERROR);
  166 + rtn.put("msg", exp.getMessage());
  167 + }
  168 + return rtn;
  169 + }
  170 + // 导入excel文件
  171 + @RequestMapping(value = "/importFile", method = RequestMethod.POST)
  172 + public Map<String, Object> importFile(@RequestParam Map<String, Object> params) {
  173 + Map<String, Object> rtn = new HashMap<>();
  174 +
  175 + try {
  176 + File file = new File(String.valueOf(params.get("filename")));
  177 + if (!file.exists()) {
  178 + throw new Exception("导入文件不存在!");
  179 + }
  180 + carsService.importData(file, params);
  181 +
  182 + rtn.put("status", ResponseCode.SUCCESS);
  183 + rtn.put("msg", "导入文件成功");
  184 + } catch (Exception exp) {
  185 + rtn.put("status", ResponseCode.ERROR);
  186 + rtn.put("msg", exp.getMessage());
  187 + }
  188 +
  189 + return rtn;
  190 + }
  191 + // 上传并导入excel文件
  192 + @RequestMapping(value = "/uploadAndImportFile", method = RequestMethod.POST)
  193 + public Map<String, Object> uploadAndImportFile(MultipartFile file) {
  194 + Map<String, Object> rtn = new HashMap<>();
  195 +
  196 + try {
  197 + DataToolsFile dataToolsFile = carsService.uploadFile(file.getOriginalFilename(), file.getBytes());
  198 + Map<String, Object> params = new HashMap<>();
  199 + carsService.importData(dataToolsFile.getFile(), params);
  200 +
  201 + rtn.put("status", ResponseCode.SUCCESS);
  202 + rtn.put("msg", "上传&导入文件成功");
  203 + } catch (Exception exp) {
  204 + exp.printStackTrace();
  205 + rtn.put("status", ResponseCode.ERROR);
  206 + rtn.put("msg", exp.getMessage());
  207 + }
  208 +
  209 + return rtn;
  210 + }
  211 +
  212 + // 导出数据到xls文件
  213 + @RequestMapping(value = "/exportFile", method = RequestMethod.GET)
  214 + public void exportFile(HttpServletResponse response,
  215 + @RequestParam Map<String, Object> params) throws Exception {
  216 + DataToolsFile dataToolsFile = carsService.exportData(params);
  217 + // 流输出导出文件
  218 + response.setHeader("content-type", "application/octet-stream");
  219 + response.setHeader("Content-Disposition", "attachment; filename=" + dataToolsFile.getFile().getName());
  220 + response.setContentType("application/octet-stream");
  221 +
  222 + OutputStream os = response.getOutputStream();
  223 + BufferedOutputStream bos = new BufferedOutputStream(os);
  224 +
  225 + InputStream is = new FileInputStream(dataToolsFile.getFile());
  226 + BufferedInputStream bis = new BufferedInputStream(is);
  227 +
  228 + int length = 0;
  229 + byte[] temp = new byte[1 * 1024 * 10];
  230 + while ((length = bis.read(temp)) != -1) {
  231 + bos.write(temp, 0, length);
  232 + }
  233 + bos.flush();
  234 + bis.close();
  235 + bos.close();
  236 + is.close();
  237 + }
  238 +
  239 +
  240 +
  241 +
  242 +}
... ...
src/main/java/com/bsth/controller/schedule/basicinfo/CarDeviceController_facade.java 0 → 100644
  1 +package com.bsth.controller.schedule.basicinfo;
  2 +
  3 +import com.alibaba.dubbo.config.annotation.Reference;
  4 +import com.bsth.common.ResponseCode;
  5 +import com.bsth.control_v2.plan_module.common.config.springboot.dubbo.DubboConfigCondition;
  6 +import com.bsth.control_v2.plan_module.common.dto.baseinfo.CarDeviceDto;
  7 +import com.bsth.control_v2.plan_module.common.dto.sys.UserDto;
  8 +import com.bsth.control_v2.plan_module.common.service.BServiceFacade;
  9 +import com.bsth.control_v2.plan_module.common.service.baseinfo.CarDeviceServiceFacade;
  10 +import com.bsth.controller.schedule.BController_facade;
  11 +import org.joda.time.DateTime;
  12 +import org.springframework.context.annotation.Conditional;
  13 +import org.springframework.web.bind.annotation.RequestMapping;
  14 +import org.springframework.web.bind.annotation.RequestMethod;
  15 +import org.springframework.web.bind.annotation.RequestParam;
  16 +import org.springframework.web.bind.annotation.RestController;
  17 +
  18 +import java.util.Date;
  19 +import java.util.HashMap;
  20 +import java.util.Map;
  21 +
  22 +@RestController
  23 +@Conditional(DubboConfigCondition.class)
  24 +@RequestMapping("cde_sc")
  25 +public class CarDeviceController_facade extends BController_facade<Long, CarDeviceDto> {
  26 + @Override
  27 + public void setCreateUserInfo(CarDeviceDto carDeviceDto, Integer userId, Date createDate) {
  28 + UserDto userDto = UserDto.getBuilder()
  29 + .setId(userId)
  30 + .build();
  31 + carDeviceDto.setCreateBy(userDto);
  32 + carDeviceDto.setCreateDate(createDate);
  33 + }
  34 +
  35 + @Override
  36 + public void setUpdateUserInfo(CarDeviceDto carDeviceDto, Integer userId, Date updateDate) {
  37 + UserDto userDto = UserDto.getBuilder()
  38 + .setId(userId)
  39 + .build();
  40 + carDeviceDto.setUpdateBy(userDto);
  41 + carDeviceDto.setUpdateDate(updateDate);
  42 + }
  43 +
  44 + @Reference
  45 + private CarDeviceServiceFacade carDeviceServiceFacade;
  46 +
  47 + @Override
  48 + protected BServiceFacade<Long, CarDeviceDto> getBServiceFacade() {
  49 + return carDeviceServiceFacade;
  50 + }
  51 + @RequestMapping(value = "/validate_qyrq", method = RequestMethod.GET)
  52 + public Map<String, Object> validate_qyrq(@RequestParam Map<String, Object> param) {
  53 + Map<String, Object> rtn = new HashMap<>();
  54 +
  55 + try {
  56 + // 启用日期验证
  57 + // 计算日期
  58 + Date qyrq_c = null;
  59 + if (param.get("qyrq_eq") != null) {
  60 + try {
  61 + qyrq_c = new Date();
  62 + qyrq_c.setTime(Long.parseLong(param.get("qyrq_eq").toString()));
  63 + } catch (Exception exp) {
  64 + qyrq_c = new DateTime(param.get("qyrq_eq").toString()).toDate();
  65 + }
  66 + }
  67 +
  68 + CarDeviceDto carDeviceDto = CarDeviceDto.getBuilder()
  69 + .setId(param.get("id_eq") == null ?
  70 + null : Long.valueOf(param.get("id_eq").toString()))
  71 + .setXl(param.get("xl_eq") == null ?
  72 + null : Integer.valueOf(param.get("xl_eq").toString()))
  73 + .setCl(param.get("cl_eq") == null ?
  74 + null : Integer.valueOf(param.get("cl_eq").toString()))
  75 + .setQyrq(qyrq_c)
  76 + .build();
  77 +
  78 + this.carDeviceServiceFacade.validate_qyrq(carDeviceDto);
  79 + rtn.put("status", ResponseCode.SUCCESS);
  80 + } catch (Exception exp) {
  81 + rtn.put("status", ResponseCode.ERROR);
  82 + rtn.put("msg", exp.getMessage());
  83 + }
  84 +
  85 + return rtn;
  86 + }
  87 +}
... ...
src/main/java/com/bsth/controller/schedule/basicinfo/EmployeeController_facade.java 0 → 100644
  1 +package com.bsth.controller.schedule.basicinfo;
  2 +
  3 +import com.alibaba.dubbo.config.annotation.Reference;
  4 +import com.bsth.common.ResponseCode;
  5 +import com.bsth.control_v2.plan_module.common.config.springboot.dubbo.DubboConfigCondition;
  6 +import com.bsth.control_v2.plan_module.common.dto.baseinfo.PersonnelDto;
  7 +import com.bsth.control_v2.plan_module.common.dto.sys.UserDto;
  8 +import com.bsth.control_v2.plan_module.common.service.BServiceFacade;
  9 +import com.bsth.control_v2.plan_module.common.service.baseinfo.PersonnelServiceFacade;
  10 +import com.bsth.controller.schedule.BController_facade;
  11 +import com.bsth.service.schedule.EmployeeService;
  12 +import com.bsth.service.schedule.utils.DataToolsFile;
  13 +import org.apache.commons.lang3.StringUtils;
  14 +import org.apache.poi.ss.usermodel.Workbook;
  15 +import org.springframework.beans.factory.annotation.Autowired;
  16 +import org.springframework.context.annotation.Conditional;
  17 +import org.springframework.web.bind.annotation.RequestMapping;
  18 +import org.springframework.web.bind.annotation.RequestMethod;
  19 +import org.springframework.web.bind.annotation.RequestParam;
  20 +import org.springframework.web.bind.annotation.RestController;
  21 +import org.springframework.web.multipart.MultipartFile;
  22 +
  23 +import javax.servlet.http.HttpServletResponse;
  24 +import java.io.*;
  25 +import java.util.*;
  26 +
  27 +/**
  28 + * 人员基础信息Controller_facade
  29 + */
  30 +@RestController
  31 +@Conditional(DubboConfigCondition.class)
  32 +@RequestMapping("ee")
  33 +public class EmployeeController_facade extends BController_facade<Integer, PersonnelDto> {
  34 + @Override
  35 + public void setCreateUserInfo(PersonnelDto personnelDto, Integer userId, Date createDate) {
  36 + UserDto userDto = UserDto.getBuilder()
  37 + .setId(userId)
  38 + .build();
  39 + personnelDto.setCreateBy(userDto);
  40 + personnelDto.setCreateDate(createDate);
  41 + }
  42 +
  43 + @Override
  44 + public void setUpdateUserInfo(PersonnelDto personnelDto, Integer userId, Date updateDate) {
  45 + UserDto userDto = UserDto.getBuilder()
  46 + .setId(userId)
  47 + .build();
  48 + personnelDto.setUpdateBy(userDto);
  49 + personnelDto.setUpdateDate(updateDate);
  50 + }
  51 +
  52 + @Reference
  53 + private PersonnelServiceFacade personnelServiceFacade;
  54 + @Override
  55 + protected BServiceFacade<Integer, PersonnelDto> getBServiceFacade() {
  56 + return personnelServiceFacade;
  57 + }
  58 + @RequestMapping(value = "/validate_gh", method = RequestMethod.GET)
  59 + public Map<String, Object> validate_gh(@RequestParam Map<String, Object> param) {
  60 + Map<String, Object> rtn = new HashMap<>();
  61 + try {
  62 + // 工号验证
  63 + PersonnelDto personnelDto = PersonnelDto.getBuilder()
  64 + .setId(param.get("id_eq") == null ?
  65 + null : Integer.valueOf(param.get("id_eq").toString()))
  66 + .setCompanyCode(param.get("companyCode_eq") == null ?
  67 + null : param.get("companyCode_eq").toString())
  68 + .setJobCode(param.get("jobCode_eq") == null ?
  69 + null : param.get("jobCode_eq").toString())
  70 + .build();
  71 + this.personnelServiceFacade.validate_gh(personnelDto);
  72 + rtn.put("status", ResponseCode.SUCCESS);
  73 + } catch (Exception exp) {
  74 + rtn.put("status", ResponseCode.ERROR);
  75 + rtn.put("msg", exp.getMessage());
  76 + }
  77 +
  78 + return rtn;
  79 + }
  80 +
  81 + //------------------ TODO:导入导出逻辑,之后会服务化 -----------------//
  82 + @Autowired
  83 + private EmployeeService employeeService;
  84 + // 上传excel文件
  85 + @RequestMapping(value = "/uploadFile", method = RequestMethod.POST)
  86 + public Map<String, Object> uploadFile(MultipartFile file) {
  87 + Map<String, Object> rtn = new HashMap<>();
  88 + try {
  89 + DataToolsFile dataToolsFile = employeeService.uploadFile(file.getOriginalFilename(), file.getBytes());
  90 + // excel文件名
  91 + String fileName = dataToolsFile.getFile().getAbsolutePath();
  92 + Workbook wb = dataToolsFile.getFileType().getWorkBook(dataToolsFile.getFile());
  93 +
  94 + // excel文件sheet
  95 + List<String> sheetnames = new ArrayList<>();
  96 + for (int i = 0; i < wb.getNumberOfSheets(); i ++) {
  97 + sheetnames.add(wb.getSheetAt(i).getSheetName());
  98 + }
  99 +
  100 + wb.close();
  101 +
  102 + rtn.put("status", ResponseCode.SUCCESS);
  103 + rtn.put("filename", fileName);
  104 + rtn.put("sheetnames", StringUtils.join(sheetnames, ","));
  105 + } catch (Exception exp) {
  106 + exp.printStackTrace();
  107 + rtn.put("status", ResponseCode.ERROR);
  108 + rtn.put("msg", exp.getMessage());
  109 + }
  110 + return rtn;
  111 + }
  112 + // 导入excel文件
  113 + @RequestMapping(value = "/importFile", method = RequestMethod.POST)
  114 + public Map<String, Object> importFile(@RequestParam Map<String, Object> params) {
  115 + Map<String, Object> rtn = new HashMap<>();
  116 +
  117 + try {
  118 + File file = new File(String.valueOf(params.get("filename")));
  119 + if (!file.exists()) {
  120 + throw new Exception("导入文件不存在!");
  121 + }
  122 + employeeService.importData(file, params);
  123 +
  124 + rtn.put("status", ResponseCode.SUCCESS);
  125 + rtn.put("msg", "导入文件成功");
  126 + } catch (Exception exp) {
  127 + rtn.put("status", ResponseCode.ERROR);
  128 + rtn.put("msg", exp.getMessage());
  129 + }
  130 +
  131 + return rtn;
  132 + }
  133 + // 上传并导入excel文件
  134 + @RequestMapping(value = "/uploadAndImportFile", method = RequestMethod.POST)
  135 + public Map<String, Object> uploadAndImportFile(MultipartFile file) {
  136 + Map<String, Object> rtn = new HashMap<>();
  137 +
  138 + try {
  139 + DataToolsFile dataToolsFile = employeeService.uploadFile(file.getOriginalFilename(), file.getBytes());
  140 + Map<String, Object> params = new HashMap<>();
  141 + employeeService.importData(dataToolsFile.getFile(), params);
  142 +
  143 + rtn.put("status", ResponseCode.SUCCESS);
  144 + rtn.put("msg", "上传&导入文件成功");
  145 + } catch (Exception exp) {
  146 + exp.printStackTrace();
  147 + rtn.put("status", ResponseCode.ERROR);
  148 + rtn.put("msg", exp.getMessage());
  149 + }
  150 +
  151 + return rtn;
  152 + }
  153 +
  154 + // 导出数据到xls文件
  155 + @RequestMapping(value = "/exportFile", method = RequestMethod.GET)
  156 + public void exportFile(HttpServletResponse response,
  157 + @RequestParam Map<String, Object> params) throws Exception {
  158 + DataToolsFile dataToolsFile = employeeService.exportData(params);
  159 + // 流输出导出文件
  160 + response.setHeader("content-type", "application/octet-stream");
  161 + response.setHeader("Content-Disposition", "attachment; filename=" + dataToolsFile.getFile().getName());
  162 + response.setContentType("application/octet-stream");
  163 +
  164 + OutputStream os = response.getOutputStream();
  165 + BufferedOutputStream bos = new BufferedOutputStream(os);
  166 +
  167 + InputStream is = new FileInputStream(dataToolsFile.getFile());
  168 + BufferedInputStream bis = new BufferedInputStream(is);
  169 +
  170 + int length = 0;
  171 + byte[] temp = new byte[1 * 1024 * 10];
  172 + while ((length = bis.read(temp)) != -1) {
  173 + bos.write(temp, 0, length);
  174 + }
  175 + bos.flush();
  176 + bis.close();
  177 + bos.close();
  178 + is.close();
  179 + }
  180 +
  181 +}
... ...
src/main/java/com/bsth/controller/schedule/basicinfo/CarDeviceController.java renamed to src/main/java/com/bsth/controller/schedule/basicinfo/legacy/CarDeviceController.java
1   -package com.bsth.controller.schedule.basicinfo;
  1 +package com.bsth.controller.schedule.basicinfo.legacy;
2 2  
3 3 import com.bsth.common.ResponseCode;
4 4 import com.bsth.controller.schedule.BController;
  5 +import com.bsth.controller.schedule.basicinfo.CarDeviceController_facade;
5 6 import com.bsth.entity.CarDevice;
6 7 import com.bsth.service.schedule.CarDeviceService;
7 8 import com.bsth.service.schedule.exception.ScheduleException;
8 9 import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
9 11 import org.springframework.web.bind.annotation.RequestMapping;
10 12 import org.springframework.web.bind.annotation.RequestMethod;
11 13 import org.springframework.web.bind.annotation.RequestParam;
... ... @@ -17,7 +19,8 @@ import java.util.Map;
17 19 /**
18 20 * Created by xu on 16/12/15.
19 21 */
20   -@RestController(value = "carDeviceController_sc")
  22 +@RestController("carDeviceController_sc")
  23 +@ConditionalOnMissingBean(CarDeviceController_facade.class)
21 24 @RequestMapping("cde_sc")
22 25 public class CarDeviceController extends BController<CarDevice, Long> {
23 26 @Autowired
... ...
src/main/java/com/bsth/controller/schedule/basicinfo/CarsController.java renamed to src/main/java/com/bsth/controller/schedule/basicinfo/legacy/CarsController.java
1   -package com.bsth.controller.schedule.basicinfo;
  1 +package com.bsth.controller.schedule.basicinfo.legacy;
2 2  
3 3 import com.bsth.common.ResponseCode;
4 4 import com.bsth.controller.schedule.BController;
  5 +import com.bsth.controller.schedule.basicinfo.CarController_facade;
5 6 import com.bsth.entity.Cars;
6 7 import com.bsth.service.schedule.CarsService;
7 8 import com.bsth.service.schedule.exception.ScheduleException;
8 9 import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
9 11 import org.springframework.web.bind.annotation.RequestMapping;
10 12 import org.springframework.web.bind.annotation.RequestMethod;
11 13 import org.springframework.web.bind.annotation.RequestParam;
... ... @@ -17,7 +19,8 @@ import java.util.Map;
17 19 /**
18 20 * 车辆基础信息controller
19 21 */
20   -@RestController(value = "carsController_sc")
  22 +@RestController("carsController_sc")
  23 +@ConditionalOnMissingBean(CarController_facade.class)
21 24 @RequestMapping("cars_sc")
22 25 public class CarsController extends BController<Cars, Integer> {
23 26 @Autowired
... ...
src/main/java/com/bsth/controller/schedule/basicinfo/EmployeeController.java renamed to src/main/java/com/bsth/controller/schedule/basicinfo/legacy/EmployeeController.java
1   -package com.bsth.controller.schedule.basicinfo;
  1 +package com.bsth.controller.schedule.basicinfo.legacy;
2 2  
3 3 import com.bsth.common.ResponseCode;
4 4 import com.bsth.controller.schedule.BController;
  5 +import com.bsth.controller.schedule.basicinfo.EmployeeController_facade;
5 6 import com.bsth.entity.Personnel;
6 7 import com.bsth.service.schedule.EmployeeService;
7 8 import com.bsth.service.schedule.exception.ScheduleException;
8 9 import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
9 11 import org.springframework.web.bind.annotation.RequestMapping;
10 12 import org.springframework.web.bind.annotation.RequestMethod;
11 13 import org.springframework.web.bind.annotation.RequestParam;
... ... @@ -18,6 +20,7 @@ import java.util.Map;
18 20 * 人员基础信息Controller
19 21 */
20 22 @RestController
  23 +@ConditionalOnMissingBean(EmployeeController_facade.class)
21 24 @RequestMapping("ee")
22 25 public class EmployeeController extends BController<Personnel, Integer> {
23 26 @Autowired
... ...