Commit c4e419a222b7023118e2472b9a5969069e8c1650

Authored by 娄高锋
1 parent 5628589d

调度日报汇总表;审计公里汇总表。

src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
1 -package com.bsth.controller.realcontrol;  
2 -  
3 -import java.io.ByteArrayOutputStream;  
4 -import java.io.IOException;  
5 -import java.io.InputStream;  
6 -import java.io.OutputStream;  
7 -import java.net.HttpURLConnection;  
8 -import java.net.MalformedURLException;  
9 -import java.net.URL;  
10 -import java.net.URLEncoder;  
11 -import java.sql.Connection;  
12 -import java.sql.Date;  
13 -import java.sql.PreparedStatement;  
14 -import java.sql.ResultSet;  
15 -import java.util.*;  
16 -  
17 -import com.bsth.data.forecast.entity.ArrivalEntity;  
18 -import com.bsth.entity.sys.SysUser;  
19 -import com.bsth.security.util.SecurityUtils;  
20 -import com.bsth.util.ReportUtils;  
21 -import com.bsth.util.db.DBUtils_MS;  
22 -import com.bsth.util.db.DBUtils_control;  
23 -import com.fasterxml.jackson.databind.ObjectMapper;  
24 -import org.apache.commons.io.IOUtils;  
25 -import org.apache.commons.lang3.StringEscapeUtils;  
26 -import org.joda.time.DateTime;  
27 -import org.joda.time.format.DateTimeFormat;  
28 -import org.joda.time.format.DateTimeFormatter;  
29 -import org.springframework.beans.factory.annotation.Autowired;  
30 -import org.springframework.web.bind.annotation.*;  
31 -  
32 -import com.alibaba.fastjson.JSONArray;  
33 -import com.bsth.common.ResponseCode;  
34 -import com.bsth.controller.BaseController;  
35 -import com.bsth.controller.realcontrol.dto.ChangePersonCar;  
36 -import com.bsth.controller.realcontrol.dto.DfsjChange;  
37 -import com.bsth.data.BasicData;  
38 -import com.bsth.data.schedule.DayOfSchedule;  
39 -import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;  
40 -import com.bsth.entity.realcontrol.ScheduleRealInfo;  
41 -import com.bsth.entity.report.RepairReport;  
42 -import com.bsth.entity.schedule.SchedulePlanInfo;  
43 -import com.bsth.service.realcontrol.ScheduleRealInfoService;  
44 -  
45 -@RestController  
46 -@RequestMapping("/realSchedule")  
47 -public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long> {  
48 -  
49 - @Autowired  
50 - ScheduleRealInfoService scheduleRealInfoService;  
51 -  
52 - @Autowired  
53 - DayOfSchedule dayOfSchedule;  
54 -  
55 - @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST)  
56 - public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){  
57 - return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm);  
58 - }  
59 -  
60 - @RequestMapping(value = "/lines")  
61 - public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) {  
62 - return scheduleRealInfoService.findByLines(lines);  
63 - }  
64 -  
65 - @RequestMapping(value = "/car")  
66 - public List<ScheduleRealInfo> findByCar(String nbbm){  
67 - return dayOfSchedule.findByNbbm(nbbm);  
68 - }  
69 -  
70 - /**  
71 - *  
72 - * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id  
73 - * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws  
74 - */  
75 - @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST)  
76 - public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks,  
77 - @RequestParam String dfsj,String bcType,  
78 - @RequestParam(defaultValue = "") String opType) {  
79 - return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType, null);  
80 - }  
81 -  
82 - /**  
83 - *  
84 - * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔  
85 - */  
86 - @RequestMapping(value = "/destroy", method = RequestMethod.POST)  
87 - public Map<String, Object> destroy(@RequestParam String idsStr  
88 - /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/,  
89 - @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) {  
90 - return scheduleRealInfoService.destroy(idsStr, remarks, adjustExps, null);  
91 - }  
92 -  
93 - /**  
94 - *  
95 - * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws  
96 - */  
97 - @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET)  
98 - public Map<String, String> carDeviceMapp() {  
99 - return BasicData.deviceId2NbbmMap.inverse();  
100 - }  
101 -  
102 - /**  
103 - *  
104 - * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param  
105 - * lineId @throws  
106 - */  
107 - @RequestMapping(value = "/driver", method = RequestMethod.GET)  
108 - public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode) {  
109 - return scheduleRealInfoService.findDriverByLine(lineCode);  
110 - }  
111 -  
112 - /**  
113 - *  
114 - * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param  
115 - * lineId @throws  
116 - */  
117 - @RequestMapping(value = "/conductor", method = RequestMethod.GET)  
118 - public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode) {  
119 - return scheduleRealInfoService.findConductorByLine(lineCode);  
120 - }  
121 -  
122 - /**  
123 - *  
124 - * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param  
125 - * lineId @throws  
126 - */  
127 - @RequestMapping(value = "/cars", method = RequestMethod.GET)  
128 - public List<Map<String, String>> findCarByLine(@RequestParam String lineCode) {  
129 - return scheduleRealInfoService.findCarByLine(lineCode);  
130 - }  
131 -  
132 - /**  
133 - *  
134 - * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws  
135 - */  
136 - @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET)  
137 - public List<Map<String, String>> sreachVehic(@RequestParam String nbbm) {  
138 - return scheduleRealInfoService.sreachVehic(nbbm);  
139 - }  
140 - /**  
141 - *  
142 - * @Title: realOutAdjust  
143 - * @Description: TODO(实发调整)  
144 - * @param @param id 班次ID  
145 - * @param @param fcsjActual 实际发车时间 HH:mm  
146 - * @param @param remarks 备注  
147 - * @throws  
148 - */  
149 - @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST)  
150 - public Map<String, Object> realOutAdjust(@RequestParam Map<String, String> map) {  
151 - return scheduleRealInfoService.realOutAdjust(map);  
152 - }  
153 -  
154 - /**  
155 - *  
156 - * @Title: revokeDestroy  
157 - * @Description: TODO(撤销烂班)  
158 - * @param @param id  
159 - * @throws  
160 - */  
161 - @RequestMapping(value = "/revokeDestroy", method = RequestMethod.POST)  
162 - public Map<String, Object> revokeDestroy(@RequestParam Long id){  
163 - return scheduleRealInfoService.revokeDestroy(id);  
164 - }  
165 -  
166 - /**  
167 - *  
168 - * @Title: revokeRealOutgo  
169 - * @Description: TODO(撤销实发)  
170 - * @param @param id  
171 - * @throws  
172 - */  
173 - @RequestMapping(value = "/revokeRealOutgo", method = RequestMethod.POST)  
174 - public Map<String, Object> revokeRealOutgo(@RequestParam Long id){  
175 - return scheduleRealInfoService.revokeRealOutgo(id);  
176 - }  
177 -  
178 - /**  
179 - * 撤销执行  
180 - * @param id  
181 - * @return  
182 - */  
183 - @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST)  
184 - public Map<String, Object> revokeRealArrive(@RequestParam Long id){  
185 - return scheduleRealInfoService.revokeRealArrive(id);  
186 - }  
187 -  
188 - /**  
189 - *  
190 - * @Title: spaceAdjust  
191 - * @Description: TODO(间隔调整)  
192 - * @param @param ids 要调整的班次数组ID  
193 - * @param @param space 间隔  
194 - * @throws  
195 - */  
196 - @RequestMapping(value = "/spaceAdjust", method = RequestMethod.POST)  
197 - public Map<String, Object> spaceAdjust(Long[] ids, Integer space){  
198 - return scheduleRealInfoService.spaceAdjust(ids, space);  
199 - }  
200 -  
201 - /**  
202 - *  
203 - * @Title: schInfoFineTune  
204 - * @Description: TODO(发车信息微调)  
205 - * @param @param map  
206 - * @throws  
207 - */  
208 - @RequestMapping(value = "/schInfoFineTune", method = RequestMethod.POST)  
209 - public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){  
210 - return scheduleRealInfoService.schInfoFineTune(map);  
211 - }  
212 -  
213 - /**  
214 - *  
215 - * @Title: outgoAdjustAll  
216 - * @Description: TODO(批量待发调整)  
217 - * @param @param list  
218 - * @throws  
219 - */  
220 - @RequestMapping(value = "/outgoAdjustAll", method = RequestMethod.POST)  
221 - public Map<String, Object> outgoAdjustAll(@RequestParam String params){  
222 - //反转义  
223 - params = StringEscapeUtils.unescapeHtml4(params);  
224 - return scheduleRealInfoService.outgoAdjustAll(params);  
225 - }  
226 -  
227 - /**  
228 - *  
229 - * @Title: findByLineAndUpDown  
230 - * @Description: TODO(根据线路和走向获取班次)  
231 - * @param @param line  
232 - * @param @param upDown  
233 - */  
234 - @RequestMapping(value = "/findByLineAndUpDown")  
235 - public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam String line,@RequestParam Integer upDown){  
236 - return dayOfSchedule.findByLineAndUpDown(line, upDown);  
237 - }  
238 -  
239 - /**  
240 - *  
241 - * @Title: findRouteByLine  
242 - * @Description: TODO(获取线路的站点,路段路由)  
243 - * @param @param lineCode  
244 - * @throws  
245 - */  
246 - @RequestMapping(value = "/findRouteByLine")  
247 - public Map<String, Object> findRouteByLine(@RequestParam String lineCode){  
248 - return scheduleRealInfoService.findRouteByLine(lineCode);  
249 - }  
250 -  
251 - /**  
252 - *  
253 - * @Title: removeChildTask  
254 - * @Description: TODO(删除子任务)  
255 - * @param @param taskId 子任务ID  
256 - * @throws  
257 - */  
258 - @RequestMapping(value = "/childTask/{taskId}", method = RequestMethod.DELETE)  
259 - public Map<String, Object> removeChildTask(@PathVariable("taskId") Long taskId){  
260 - return scheduleRealInfoService.removeChildTask(taskId);  
261 - }  
262 -  
263 - /**  
264 - *  
265 - * @Title: findByLineCode  
266 - * @Description: TODO(根据线路获取班次信息)  
267 - * @param @param lineCode  
268 - */  
269 - @RequestMapping(value = "/lineCode/{lineCode}")  
270 - public List<ScheduleRealInfo> findByLineCode(@PathVariable("lineCode") String lineCode){  
271 - return dayOfSchedule.findByLineCode(lineCode);  
272 - }  
273 -  
274 - @RequestMapping(value = "/queryUserInfo")  
275 - public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line,  
276 - @RequestParam String date,@RequestParam String state) {  
277 - return scheduleRealInfoService.queryUserInfo(line, date,state);  
278 - }  
279 -  
280 - @RequestMapping(value = "/queryUserInfoPx")  
281 - public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line,  
282 - @RequestParam String date,@RequestParam String state,@RequestParam String type) {  
283 - return scheduleRealInfoService.queryUserInfoPx(line, date,state,type);  
284 - }  
285 -  
286 - @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET)  
287 - public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName,@RequestParam String jGh, @RequestParam String clZbh,  
288 - @RequestParam String lpName,@RequestParam String date,@RequestParam String line) {  
289 - return scheduleRealInfoService.exportWaybill(jName,jGh, clZbh, lpName,date,line);  
290 - }  
291 -  
292 - @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET)  
293 - public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh  
294 - ,@RequestParam String date,@RequestParam String line) {  
295 - return scheduleRealInfoService.exportWaybillQp( clZbh, date,line);  
296 - }  
297 -  
298 -  
299 - @RequestMapping(value = "/dailyInfo")  
300 - public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date,@RequestParam String type) {  
301 - return scheduleRealInfoService.dailyInfo(line, date, type);  
302 - }  
303 -  
304 - @RequestMapping(value = "/historyMessage")  
305 - public List<Object[]> historyMessage(@RequestParam String line, @RequestParam String date,  
306 - @RequestParam String code, @RequestParam String type) {  
307 - return scheduleRealInfoService.historyMessage(line, date, code, type);  
308 - }  
309 -  
310 - @RequestMapping(value="/findLine")  
311 - public List<Map<String,String>> findLine(@RequestParam String line){  
312 - return scheduleRealInfoService.findLine(line);  
313 - }  
314 -  
315 - @RequestMapping(value="/findKMBC",method = RequestMethod.GET)  
316 - public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName  
317 - ,@RequestParam String date,@RequestParam String line){  
318 - return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line);  
319 - }  
320 -  
321 - /**  
322 - * 路单公里统计 (闵行审计专用)  
323 - * @param jGh  
324 - * @param clZbh  
325 - * @param lpName  
326 - * @param date  
327 - * @param line  
328 - * @return  
329 - */  
330 - @RequestMapping(value="/findKMBC_mh_2",method = RequestMethod.GET)  
331 - public Map<String,Object> findKMBC_mh_2(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName  
332 - ,@RequestParam String date,@RequestParam String line){  
333 - return scheduleRealInfoService.findKMBC_mh_2(jGh, clZbh,lpName,date,line);  
334 - }  
335 -  
336 - @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET)  
337 - public Map<String,Object> findKMBCQp(@RequestParam String clZbh  
338 - ,@RequestParam String date,@RequestParam String line){  
339 - return scheduleRealInfoService.findKMBCQp(clZbh,date,line);  
340 - }  
341 -  
342 - @RequestMapping(value="/findLpName")  
343 - public List<Map<String,String>> findLpName(@RequestParam String lpName){  
344 - return scheduleRealInfoService.findLpName(lpName);  
345 - }  
346 -  
347 - @RequestMapping(value = "/account")  
348 - public List<Map<String,Object>> account(@RequestParam String line, @RequestParam String date,  
349 - @RequestParam String code,@RequestParam String xlName, @RequestParam String type) {  
350 - return scheduleRealInfoService.account(line, date, code, xlName, type);  
351 - }  
352 -  
353 - @RequestMapping(value = "/accountPx")  
354 - public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date,  
355 - @RequestParam String code,@RequestParam String xlName, @RequestParam String px) {  
356 - return scheduleRealInfoService.accountPx(line, date, code, xlName, px);  
357 - }  
358 -  
359 - @RequestMapping(value = "/correctForm")  
360 - public List<SchEditInfoDto> correctForm(@RequestParam String line, @RequestParam String date,  
361 - @RequestParam String endDate,  
362 - @RequestParam String lpName, @RequestParam String code,  
363 - @RequestParam String type,@RequestParam String changType) {  
364 - return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type,changType);  
365 - }  
366 - /**  
367 - * @Title queryListWaybill  
368 - * @Description 查询行车路单列表  
369 - * @param jGh 驾驶员名字  
370 - * @param clZbh 车辆自编号(内部编号)  
371 - * @param lpName 路牌  
372 - * @return  
373 - */  
374 - @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET)  
375 - public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName  
376 - ,@RequestParam String date,@RequestParam String line){  
377 - return scheduleRealInfoService.queryListWaybill(jGh, clZbh,lpName,date,line);  
378 - }  
379 -  
380 - /**  
381 - * @Title queryListWaybill  
382 - * @Description 查询行车路单列表(闵行审计专用路单)  
383 - * @param jName 驾驶员名字  
384 - * @param clZbh 车辆自编号(内部编号)  
385 - * @param lpName 路牌  
386 - * @return  
387 - */  
388 - @RequestMapping(value="/queryListWaybill_mh_2",method = RequestMethod.GET)  
389 - public List<ScheduleRealInfo> queryListWaybill_mh_2(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName  
390 - ,@RequestParam String date,@RequestParam String line){  
391 - return scheduleRealInfoService.queryListWaybill2(jName, clZbh,lpName,date,line);  
392 - }  
393 -  
394 - @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET)  
395 - public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh,  
396 - @RequestParam String date,@RequestParam String line){  
397 - return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line);  
398 - }  
399 -  
400 - @RequestMapping(value="/statisticsDaily")  
401 - public List<Map<String,Object>> statisticsDaily(@RequestParam String line, @RequestParam String date,  
402 - @RequestParam String xlName, @RequestParam String type){  
403 - return scheduleRealInfoService.statisticsDaily(line, date, xlName, type);  
404 - }  
405 -  
406 - @RequestMapping(value="/statisticsDaily_mh_2")  
407 - public List<Map<String,Object>> statisticsDaily_mh_2(@RequestParam String line, @RequestParam String date,  
408 - @RequestParam String xlName, @RequestParam String type){  
409 - return scheduleRealInfoService.statisticsDaily_mh_2(line, date, xlName, type);  
410 - }  
411 -  
412 - @RequestMapping(value="/statisticsDailyTj")  
413 - public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){  
414 - String gsdm="";  
415 - if(map.get("gsdm")!=null){  
416 - gsdm=map.get("gsdm").toString();  
417 - }  
418 - String fgsdm="";  
419 - if(map.get("fgsdm")!=null){  
420 - fgsdm=map.get("fgsdm").toString();  
421 - }  
422 - String line="";  
423 - if(map.get("line")!=null){  
424 - line=map.get("line").toString();  
425 - }  
426 - String date="";  
427 - if(map.get("date")!=null){  
428 - date=map.get("date").toString();  
429 - }  
430 - String date2="";  
431 - if(map.get("date2")!=null){  
432 - date2=map.get("date2").toString();  
433 - }  
434 - String xlName="";  
435 - if(map.get("xlName")!=null){  
436 - xlName=map.get("xlName").toString();  
437 - }  
438 - String type="";  
439 - if(map.get("type")!=null){  
440 - type=map.get("type").toString();  
441 - }  
442 - String nature="0";  
443 - if(map.get("nature")!=null){  
444 - nature=map.get("nature").toString();  
445 - }  
446 - return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type,nature);  
447 - }  
448 -  
449 - /*  
450 - * 公里修正报表  
451 - */  
452 - @RequestMapping(value="/mileageReportTj")  
453 - public List<Map<String,Object>> mileageReport(@RequestParam Map<String, Object> map){  
454 - String gsdm="";  
455 - if(map.get("gsdm")!=null){  
456 - gsdm=map.get("gsdm").toString();  
457 - }  
458 - String fgsdm="";  
459 - if(map.get("fgsdm")!=null){  
460 - fgsdm=map.get("fgsdm").toString();  
461 - }  
462 - String line="";  
463 - if(map.get("line")!=null){  
464 - line=map.get("line").toString();  
465 - }  
466 - String date="";  
467 - if(map.get("date")!=null){  
468 - date=map.get("date").toString();  
469 - }  
470 - String date2="";  
471 - if(map.get("date2")!=null){  
472 - date2=map.get("date2").toString();  
473 - }  
474 - String xlName="";  
475 - if(map.get("xlName")!=null){  
476 - xlName=map.get("xlName").toString();  
477 - }  
478 - return scheduleRealInfoService.mileageReport(gsdm,fgsdm,line, date,date2);  
479 - }  
480 -  
481 - /*  
482 - * 班次修正报表  
483 - */  
484 - @RequestMapping(value="/scheduleCorrectionReport")  
485 - public List<Map<String,Object>> scheduleCorrectionReport(@RequestParam Map<String, Object> map){  
486 - String gsdm="";  
487 - if(map.get("gsdm")!=null){  
488 - gsdm=map.get("gsdm").toString();  
489 - }  
490 - String fgsdm="";  
491 - if(map.get("fgsdm")!=null){  
492 - fgsdm=map.get("fgsdm").toString();  
493 - }  
494 - String line="";  
495 - if(map.get("line")!=null){  
496 - line=map.get("line").toString();  
497 - }  
498 - String date="";  
499 - if(map.get("date")!=null){  
500 - date=map.get("date").toString();  
501 - }  
502 - String date2="";  
503 - if(map.get("date2")!=null){  
504 - date2=map.get("date2").toString();  
505 - }  
506 - String xlName="";  
507 - if(map.get("xlName")!=null){  
508 - xlName=map.get("xlName").toString();  
509 - }  
510 - return scheduleRealInfoService.scheduleCorrectionReport(gsdm,fgsdm,line, date,date2);  
511 - }  
512 -  
513 - @RequestMapping(value="/MapById",method = RequestMethod.GET)  
514 - public Map<String, Object> MapById(@RequestParam("id") Long id){  
515 - return scheduleRealInfoService.MapById(id);  
516 - }  
517 -  
518 - @RequestMapping(value="/MapByIdQp",method = RequestMethod.GET)  
519 - public Map<String, Object> MapByIdQp(@RequestParam("id") Long id){  
520 - return scheduleRealInfoService.MapByIdQp(id);  
521 - }  
522 -  
523 - /**  
524 - * @Title: scheduleDaily  
525 - * @Description: TODO(调度日报表)  
526 - * @param line 线路  
527 - * @param date 时间  
528 - * @return  
529 - */  
530 - @RequestMapping(value="/scheduleDaily")  
531 - public Map<String,Object> scheduleDaily(@RequestParam String line,@RequestParam String date){  
532 - return scheduleRealInfoService.scheduleDaily(line,date);  
533 - }  
534 -  
535 - @RequestMapping(value="/realScheduleList")  
536 - public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){  
537 - return scheduleRealInfoService.realScheduleList(line,date);  
538 - }  
539 -  
540 - @RequestMapping(value="/realScheduleList_zrw")  
541 - public List<ScheduleRealInfo> realScheduleList_zrw(@RequestParam String line,@RequestParam String date){  
542 - return scheduleRealInfoService.realScheduleList_zrw(line,date);  
543 - }  
544 -  
545 - @RequestMapping(value="/realScheduleList_mh_2")  
546 - public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){  
547 - return scheduleRealInfoService.realScheduleList_mh_2(line,date);  
548 - }  
549 -  
550 - @RequestMapping(value="/realScheduleListQp")  
551 - public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){  
552 - return scheduleRealInfoService.realScheduleListQp(line,date);  
553 - }  
554 -  
555 - @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST)  
556 - public synchronized Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){  
557 - cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson);  
558 - List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class);  
559 - return scheduleRealInfoService.multi_tzrc(cpcs, null);  
560 - }  
561 -  
562 - @RequestMapping(value="/multi_dftz", method=RequestMethod.POST)  
563 - public Map<String, Object> multi_dftz(@RequestParam String dcsJson){  
564 - dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson);  
565 - List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class);  
566 - return scheduleRealInfoService.multi_dftz(dfsjcs);  
567 - }  
568 -  
569 - @RequestMapping(value="/changeBcType/{id}", method=RequestMethod.POST)  
570 - public Map<String, Object> changeBcType(@PathVariable("id") Long id, String bcType, String remarks, String majorStationName){  
571 - return scheduleRealInfoService.changeBcType(id, bcType, remarks, majorStationName);  
572 - }  
573 -  
574 - @RequestMapping(value="/history", method=RequestMethod.POST)  
575 - public Map<String,Object> historySave(ScheduleRealInfo sch){  
576 - return scheduleRealInfoService.historySave(sch);  
577 - }  
578 -  
579 -  
580 - private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd");  
581 - private final static long ONE_DAY = 1000 * 60 * 60 * 24;  
582 - /**  
583 - * 获取可编辑的历史班次日期  
584 - * @return  
585 - */  
586 - @RequestMapping("dateArray")  
587 - public List<String> dateArray(@RequestParam(defaultValue = "0") int c){  
588 - List<String> rs = new ArrayList<>();  
589 -  
590 - long t = System.currentTimeMillis();  
591 - if(c != 1)  
592 - t -= (ONE_DAY + (1000 * 60 * 60 * 6));  
593 - for(int i = 0; i < 3; i ++){  
594 - rs.add(fmtyyyyMMdd.print(t));  
595 - t -= ONE_DAY;  
596 - }  
597 - return rs;  
598 - }  
599 -  
600 - @RequestMapping(value = "svgAttr", method = RequestMethod.POST)  
601 - public Map<String, Object> svgAttr(@RequestParam String jsonStr){  
602 - return scheduleRealInfoService.svgAttr(jsonStr);  
603 - }  
604 -  
605 - @RequestMapping(value = "svgAttr", method = RequestMethod.GET)  
606 - public Map<String, Object> findSvgAttr(@RequestParam String idx){  
607 - return scheduleRealInfoService.findSvgAttr(idx);  
608 - }  
609 -  
610 - @RequestMapping(value = "addRemarks", method = RequestMethod.POST)  
611 - public Map<String, Object> addRemarks(@RequestParam Long id, @RequestParam String remarks){  
612 - return scheduleRealInfoService.addRemarks(id, remarks);  
613 - }  
614 -  
615 - @RequestMapping(value = "scheduleDailyQp", method = RequestMethod.GET)  
616 - public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){  
617 - return scheduleRealInfoService.scheduleDailyQp(line,date);  
618 - }  
619 -  
620 - @RequestMapping(value = "scheduleDailyExport", method = RequestMethod.GET)  
621 - public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){  
622 - return scheduleRealInfoService.scheduleDailyExport(map);  
623 - }  
624 -  
625 - @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET)  
626 - public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){  
627 - return scheduleRealInfoService.exportWaybillMore(map);  
628 - }  
629 -  
630 - /**  
631 - * 获取当日计划排班 , 从计划表抓取数据  
632 - * @return  
633 - */  
634 - @RequestMapping(value = "currSchedulePlanByLineCode", method = RequestMethod.GET)  
635 - public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){  
636 - return scheduleRealInfoService.currentSchedulePlan(lineCode);  
637 - }  
638 -  
639 - @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST)  
640 - public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){  
641 - return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type);  
642 - }  
643 -  
644 - /**  
645 - * 删除当日实际排班  
646 - * @return  
647 - */  
648 - @RequestMapping(value = "deleteRealSchedule", method = RequestMethod.POST)  
649 - public Map<String, Object> deleteRealSchedule(@RequestParam String lineCode){  
650 - return dayOfSchedule.deleteRealSchedule(lineCode);  
651 - }  
652 -  
653 - /**  
654 - * 从计划表重新加载当日排班  
655 - * @param lineCode  
656 - * @return  
657 - */  
658 - @RequestMapping(value = "reLoadRealSchedule", method = RequestMethod.POST)  
659 - public Map<String, Object> reLoadRealSchedule(@RequestParam String lineCode){  
660 - Map<String, Object> rs = new HashMap<>();  
661 - List<ScheduleRealInfo> list = dayOfSchedule.findByLineCode(lineCode);  
662 - if(list != null && list.size() > 0){  
663 - rs.put("status", ResponseCode.ERROR);  
664 - rs.put("msg", "失败," + list.get(0).getXlName() + "当日存在实际排班,无法重新加载。");  
665 - return rs;  
666 - }  
667 -  
668 - int code = dayOfSchedule.reloadSch(lineCode);  
669 -  
670 - //重新按公司编码索引数据  
671 - dayOfSchedule.groupByGsbm();  
672 - rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR);  
673 - return rs;  
674 - }  
675 -  
676 - /**  
677 - * 误点调整  
678 - * @param idx  
679 - * @param minute  
680 - * @return  
681 - */  
682 - @RequestMapping(value = "lateAdjust", method = RequestMethod.POST)  
683 - public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){  
684 - return scheduleRealInfoService.lateAdjust(idx, minute);  
685 - }  
686 -  
687 - /**  
688 - * 获取所有应发未到的班次  
689 - * @param idx  
690 - * @return  
691 - */  
692 - @RequestMapping(value = "allLate2")  
693 - public List<ScheduleRealInfo> allLate2(@RequestParam String idx){  
694 - return scheduleRealInfoService.allLate2(idx);  
695 - }  
696 -  
697 - /**  
698 - * 添加一个临加到历史库  
699 - * @param sch  
700 - * @return  
701 - */  
702 - @RequestMapping(value = "history/add", method = RequestMethod.POST)  
703 - public Map<String, Object> addToHistory(ScheduleRealInfo sch){  
704 - return scheduleRealInfoService.addToHistory(sch);  
705 - }  
706 -  
707 - /**  
708 - * 从历史库里删除临加班次  
709 - * @param id  
710 - * @return  
711 - */  
712 - @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE)  
713 - public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){  
714 - return scheduleRealInfoService.deleteToHistory(id);  
715 - }  
716 -  
717 - @RequestMapping(value = "isCircleQdz", method = RequestMethod.POST)  
718 - public Map<String, Object> isCircleQdz(@RequestParam String line, String nbbm, String ts, String qdzCode){  
719 - Map<String, Object> map =new HashMap<>();  
720 - map.put("isExist",scheduleRealInfoService.isCircleQdz(nbbm, ts, line, qdzCode));  
721 - return map;  
722 - }  
723 -  
724 - /**  
725 - * 从历史库里删除临加班次  
726 - * @param param  
727 - * @return  
728 - */  
729 - @RequestMapping(value = "wxsb", method = RequestMethod.POST)  
730 - public Map<String, Object> repairReport(@RequestParam Map<String, Object> param){  
731 - return scheduleRealInfoService.repairReport(param, true);  
732 - }  
733 -  
734 - @RequestMapping(value = "wxsb", method = RequestMethod.GET)  
735 - public List<RepairReport> repairReportList(@RequestParam String line, @RequestParam String date, @RequestParam String code, @RequestParam String type){  
736 - return scheduleRealInfoService.repairReportList(line, date, code, type);  
737 - }  
738 -  
739 - @RequestMapping(value = "lineLevel", method = RequestMethod.GET)  
740 - public Map<String, String> lineLevel(@RequestParam String idx){  
741 - return scheduleRealInfoService.getLevelsByLines(Arrays.asList(idx.split(",")));  
742 - }  
743 -  
744 - /**  
745 - * 反馈安全驾驶系统  
746 - * @param param  
747 - * @return  
748 - */  
749 - @RequestMapping(value = "ackDsm", method = RequestMethod.POST)  
750 - public Map<String, Object> ackDsm(@RequestParam Map<String, Object> param){  
751 - Map<String, Object> res = new HashMap<>();  
752 - InputStream in = null;  
753 - SysUser user = SecurityUtils.getCurrentUser();  
754 - DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");  
755 - StringBuilder url = new StringBuilder("http://211.95.61.66:9008/modules/dsmCheckTheRecord/addDsm?"), uri = new StringBuilder();  
756 - HttpURLConnection con = null;  
757 - try {  
758 - uri.append("ddyName=").append(URLEncoder.encode(user == null ? "admin" : user.getUserName(), "UTF-8"));  
759 - uri.append("&checkTime=").append(URLEncoder.encode(fmt.print(System.currentTimeMillis()), "UTF-8"));  
760 - uri.append("&nbbm=").append(URLEncoder.encode(param.get("nbbm").toString(), "UTF-8"));  
761 - uri.append("&starttime=").append(URLEncoder.encode(fmt.print(Long.parseLong(param.get("ts").toString())), "UTF-8"));  
762 - url.append(uri);  
763 - con = (HttpURLConnection)new URL(url.toString()).openConnection();  
764 - con.setDoInput(true);  
765 - con.setRequestMethod("POST");  
766 - con.setConnectTimeout(5000);  
767 - con.setReadTimeout(5000);  
768 - con.setRequestProperty("keep-alive", "true");  
769 - con.setRequestProperty("accept", "*/*");  
770 - con.setRequestProperty("content-type", "application/x-www-form-urlencoded");  
771 - con.connect();  
772 -  
773 - if (con.getResponseCode() == 200) {  
774 - in = con.getInputStream();  
775 - ByteArrayOutputStream bout = new ByteArrayOutputStream();  
776 - IOUtils.copy(in, bout);  
777 - Map<String, Object> map = new ObjectMapper().readValue(bout.toByteArray(), Map.class);  
778 - System.out.println(map);  
779 - }  
780 - } catch (MalformedURLException e) {  
781 - // TODO Auto-generated catch block  
782 - e.printStackTrace();  
783 - } catch (IOException e) {  
784 - // TODO Auto-generated catch block  
785 - e.printStackTrace();  
786 - } finally {  
787 - if (con != null) {  
788 - con.disconnect();  
789 - }  
790 - }  
791 -  
792 - return res;  
793 - }  
794 -  
795 - @RequestMapping(value = "exportPlan", method = RequestMethod.GET)  
796 - public Map<String, Object> exportPlan(@RequestParam String date){  
797 - Map<String, Object> res = new HashMap<>();  
798 - DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm");  
799 - Connection conn = null;  
800 - PreparedStatement ps = null;  
801 - ResultSet rs = null;  
802 -  
803 - List<Map<String, Object>> list = new ArrayList<>();  
804 - 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'";  
805 - try{  
806 - conn = DBUtils_control.getConnection();  
807 - ps = conn.prepareStatement(sql);  
808 - ps.setString(1, date);  
809 - rs = ps.executeQuery();  
810 - ObjectMapper mapper = new ObjectMapper();  
811 -  
812 - while (rs.next()) {  
813 - SchedulePlan schedulePlan = new SchedulePlan();  
814 - schedulePlan.setXlName(rs.getString("xl_name"));  
815 - schedulePlan.setXlDir(rs.getInt("xl_dir"));  
816 - Date scheduleDate = rs.getDate("schedule_date");  
817 - schedulePlan.setScheduleDate(new DateTime(scheduleDate.getTime()).toString("yyyy-MM-dd"));  
818 - String fcsj = rs.getString("fcsj");  
819 - int bcsj = rs.getInt("bcsj");  
820 - DateTime fcsjDt = dateTimeFormatter.parseDateTime(schedulePlan.getScheduleDate() + " " + fcsj);  
821 - schedulePlan.setFcsj(fcsjDt.toString("HH:mm:00"));  
822 - DateTime ddsjDt = fcsjDt.plusMinutes(bcsj);  
823 - schedulePlan.setDdsj(ddsjDt.toString("HH:mm:00"));  
824 - schedulePlan.setSjdStart(fcsjDt.toString("HH:00:00"));  
825 - DateTime endDt = fcsjDt.plusHours(1);  
826 - schedulePlan.setSjdEnd(endDt.toString("HH:00:00"));  
827 - schedulePlan.setClZbh(rs.getString("cl_zbh"));  
828 - schedulePlan.setJsy(rs.getString("j_name"));  
829 - schedulePlan.setBcsj(bcsj);  
830 -  
831 - list.add(mapper.readValue(mapper.writeValueAsString(schedulePlan), HashMap.class));  
832 - }  
833 - List<Iterator<?>> iterators = new ArrayList<Iterator<?>>();  
834 - iterators.add(list.iterator());  
835 - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";  
836 - String sourcePath = path + "mould/schedulePlan.xls";  
837 -  
838 - new ReportUtils().excelReplace(iterators, new Object[]{}, sourcePath, path + "export/" + date + "-花博会专线班次.xls");  
839 -  
840 - res.put("status", ResponseCode.SUCCESS);  
841 - res.put("msg", "成功");  
842 - } catch (Exception e) {  
843 - res.put("status", ResponseCode.ERROR);  
844 - res.put("msg", e.getMessage());  
845 - } finally {  
846 - DBUtils_control.close(rs, ps, conn);  
847 - }  
848 -  
849 - return res;  
850 - }  
851 -  
852 - public final static class SchedulePlan {  
853 - private String company = "浦东公司[46]";  
854 -  
855 - private String xlName = "";  
856 -  
857 - private int xlDir;  
858 -  
859 - private String xlDirStr = "";  
860 -  
861 - private String scheduleDate = "";  
862 -  
863 - private String sjdStart = "";  
864 -  
865 - private String sjdEnd = "";  
866 -  
867 - private String fcsj = "";  
868 -  
869 - private int bcsj;  
870 -  
871 - private String ddsj = "";  
872 -  
873 - private int yys = 25;  
874 -  
875 - private String clZbh = "";  
876 -  
877 - private String cph = "";  
878 -  
879 - private String color = "绿牌";  
880 -  
881 - private String jsy = "";  
882 -  
883 - private String jsydh = "";  
884 -  
885 - private int pj = 10;  
886 -  
887 - public String getCompany() {  
888 - return company;  
889 - }  
890 -  
891 - public void setCompany(String company) {  
892 - this.company = company;  
893 - }  
894 -  
895 - public String getXlName() {  
896 - return xlName;  
897 - }  
898 -  
899 - public void setXlName(String xlName) {  
900 - this.xlName = xlName;  
901 - }  
902 -  
903 - public int getXlDir() {  
904 - return xlDir;  
905 - }  
906 -  
907 - public void setXlDir(int xlDir) {  
908 - this.xlDir = xlDir;  
909 - }  
910 -  
911 - public String getXlDirStr() {  
912 - xlDirStr = "";  
913 - if (xlDir == 0) {  
914 - xlDirStr = "上行";  
915 - } else if (xlDir == 1) {  
916 - xlDirStr = "下行";  
917 - }  
918 - return xlDirStr;  
919 - }  
920 -  
921 - public void setXlDirStr(String xlDirStr) {  
922 - this.xlDirStr = xlDirStr;  
923 - }  
924 -  
925 - public String getScheduleDate() {  
926 - return scheduleDate;  
927 - }  
928 -  
929 - public void setScheduleDate(String scheduleDate) {  
930 - this.scheduleDate = scheduleDate;  
931 - }  
932 -  
933 - public String getSjdStart() {  
934 - return sjdStart;  
935 - }  
936 -  
937 - public void setSjdStart(String sjdStart) {  
938 - this.sjdStart = sjdStart;  
939 - }  
940 -  
941 - public String getSjdEnd() {  
942 - return sjdEnd;  
943 - }  
944 -  
945 - public void setSjdEnd(String sjdEnd) {  
946 - this.sjdEnd = sjdEnd;  
947 - }  
948 -  
949 - public String getFcsj() {  
950 - return fcsj;  
951 - }  
952 -  
953 - public void setFcsj(String fcsj) {  
954 - this.fcsj = fcsj;  
955 - }  
956 -  
957 - public int getBcsj() {  
958 - return bcsj;  
959 - }  
960 -  
961 - public void setBcsj(int bcsj) {  
962 - this.bcsj = bcsj;  
963 - }  
964 -  
965 - public String getDdsj() {  
966 - return ddsj;  
967 - }  
968 -  
969 - public void setDdsj(String ddsj) {  
970 - this.ddsj = ddsj;  
971 - }  
972 -  
973 - public int getYys() {  
974 - return yys;  
975 - }  
976 -  
977 - public void setYys(int yys) {  
978 - this.yys = yys;  
979 - }  
980 -  
981 - public String getClZbh() {  
982 - return clZbh;  
983 - }  
984 -  
985 - public void setClZbh(String clZbh) {  
986 - this.clZbh = clZbh;  
987 - }  
988 -  
989 - public String getCph() {  
990 - cph = BasicData.nbbmCompanyPlateMap.get(clZbh);  
991 - if (cph == null) {  
992 - cph = "";  
993 - }  
994 - return cph;  
995 - }  
996 -  
997 - public void setCph(String cph) {  
998 - this.cph = cph;  
999 - }  
1000 -  
1001 - public String getColor() {  
1002 - return color;  
1003 - }  
1004 -  
1005 - public void setColor(String color) {  
1006 - this.color = color;  
1007 - }  
1008 -  
1009 - public String getJsy() {  
1010 - return jsy;  
1011 - }  
1012 -  
1013 - public void setJsy(String jsy) {  
1014 - this.jsy = jsy;  
1015 - }  
1016 -  
1017 - public String getJsydh() {  
1018 - return jsydh;  
1019 - }  
1020 -  
1021 - public void setJsydh(String jsydh) {  
1022 - this.jsydh = jsydh;  
1023 - }  
1024 -  
1025 - public int getPj() {  
1026 - return pj;  
1027 - }  
1028 -  
1029 - public void setPj(int pj) {  
1030 - this.pj = pj;  
1031 - }  
1032 - }  
1033 -} 1 +package com.bsth.controller.realcontrol;
  2 +
  3 +import java.io.ByteArrayOutputStream;
  4 +import java.io.IOException;
  5 +import java.io.InputStream;
  6 +import java.io.OutputStream;
  7 +import java.net.HttpURLConnection;
  8 +import java.net.MalformedURLException;
  9 +import java.net.URL;
  10 +import java.net.URLEncoder;
  11 +import java.sql.Connection;
  12 +import java.sql.Date;
  13 +import java.sql.PreparedStatement;
  14 +import java.sql.ResultSet;
  15 +import java.util.*;
  16 +
  17 +import com.bsth.data.forecast.entity.ArrivalEntity;
  18 +import com.bsth.entity.sys.SysUser;
  19 +import com.bsth.security.util.SecurityUtils;
  20 +import com.bsth.util.ReportUtils;
  21 +import com.bsth.util.db.DBUtils_MS;
  22 +import com.bsth.util.db.DBUtils_control;
  23 +import com.fasterxml.jackson.databind.ObjectMapper;
  24 +import org.apache.commons.io.IOUtils;
  25 +import org.apache.commons.lang3.StringEscapeUtils;
  26 +import org.joda.time.DateTime;
  27 +import org.joda.time.format.DateTimeFormat;
  28 +import org.joda.time.format.DateTimeFormatter;
  29 +import org.springframework.beans.factory.annotation.Autowired;
  30 +import org.springframework.web.bind.annotation.*;
  31 +
  32 +import com.alibaba.fastjson.JSONArray;
  33 +import com.bsth.common.ResponseCode;
  34 +import com.bsth.controller.BaseController;
  35 +import com.bsth.controller.realcontrol.dto.ChangePersonCar;
  36 +import com.bsth.controller.realcontrol.dto.DfsjChange;
  37 +import com.bsth.data.BasicData;
  38 +import com.bsth.data.schedule.DayOfSchedule;
  39 +import com.bsth.data.schedule.edit_logs.service.dto.SchEditInfoDto;
  40 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  41 +import com.bsth.entity.report.RepairReport;
  42 +import com.bsth.entity.schedule.SchedulePlanInfo;
  43 +import com.bsth.service.realcontrol.ScheduleRealInfoService;
  44 +
  45 +@RestController
  46 +@RequestMapping("/realSchedule")
  47 +public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, Long> {
  48 +
  49 + @Autowired
  50 + ScheduleRealInfoService scheduleRealInfoService;
  51 +
  52 + @Autowired
  53 + DayOfSchedule dayOfSchedule;
  54 +
  55 + @RequestMapping(value = "check_fgs_ascription", method = RequestMethod.POST)
  56 + public Map<String, Object> checkPCFgsAscription(@RequestParam Long schId, String jGh, String sGh, String nbbm){
  57 + return scheduleRealInfoService.checkPCFgsAscription(schId, jGh, sGh, nbbm);
  58 + }
  59 +
  60 + @RequestMapping(value = "/lines")
  61 + public Map<String, Collection<ScheduleRealInfo>> findByLines(@RequestParam String lines) {
  62 + return scheduleRealInfoService.findByLines(lines);
  63 + }
  64 +
  65 + @RequestMapping(value = "/car")
  66 + public List<ScheduleRealInfo> findByCar(String nbbm){
  67 + return dayOfSchedule.findByNbbm(nbbm);
  68 + }
  69 +
  70 + /**
  71 + *
  72 + * @Title: outgoAdjust @Description: TODO(待发调整) @param @param id
  73 + * 主键 @param @param remarks 备注 @param @param dfsj 待发时间(HH:mm) @throws
  74 + */
  75 + @RequestMapping(value = "/outgoAdjust", method = RequestMethod.POST)
  76 + public Map<String, Object> outgoAdjust(@RequestParam Long id, @RequestParam String remarks,
  77 + @RequestParam String dfsj,String bcType,
  78 + @RequestParam(defaultValue = "") String opType) {
  79 + return scheduleRealInfoService.outgoAdjust(id, remarks, dfsj, bcType, opType, null);
  80 + }
  81 +
  82 + /**
  83 + *
  84 + * @Title: destroy @Description: TODO(销毁,烂班) @param @param idsStr 要烂掉的班次ID ,分隔
  85 + */
  86 + @RequestMapping(value = "/destroy", method = RequestMethod.POST)
  87 + public Map<String, Object> destroy(@RequestParam String idsStr
  88 + /*, @RequestParam(defaultValue = "-1") int spaceAdjust*/,
  89 + @RequestParam String remarks, @RequestParam String adjustExps/*, @RequestParam(defaultValue = "0") int spaceNum*/) {
  90 + return scheduleRealInfoService.destroy(idsStr, remarks, adjustExps, null);
  91 + }
  92 +
  93 + /**
  94 + *
  95 + * @Title: carDeviceMapp @Description: TODO(获取车辆自编号和设备号对照,从缓存取) @throws
  96 + */
  97 + @RequestMapping(value = "/carDeviceMapp", method = RequestMethod.GET)
  98 + public Map<String, String> carDeviceMapp() {
  99 + return BasicData.deviceId2NbbmMap.inverse();
  100 + }
  101 +
  102 + /**
  103 + *
  104 + * @Title: findPersionByLine @Description: TODO(根据线路主键获取驾驶员) @param @param
  105 + * lineId @throws
  106 + */
  107 + @RequestMapping(value = "/driver", method = RequestMethod.GET)
  108 + public List<Map<String, String>> findDriverByLine(@RequestParam String lineCode) {
  109 + return scheduleRealInfoService.findDriverByLine(lineCode);
  110 + }
  111 +
  112 + /**
  113 + *
  114 + * @Title: findPersionByLine @Description: TODO(根据线路主键获取售票员) @param @param
  115 + * lineId @throws
  116 + */
  117 + @RequestMapping(value = "/conductor", method = RequestMethod.GET)
  118 + public List<Map<String, String>> findConductorByLine(@RequestParam String lineCode) {
  119 + return scheduleRealInfoService.findConductorByLine(lineCode);
  120 + }
  121 +
  122 + /**
  123 + *
  124 + * @Title: findPersionByLine @Description: TODO(根据线路主键获取车辆) @param @param
  125 + * lineId @throws
  126 + */
  127 + @RequestMapping(value = "/cars", method = RequestMethod.GET)
  128 + public List<Map<String, String>> findCarByLine(@RequestParam String lineCode) {
  129 + return scheduleRealInfoService.findCarByLine(lineCode);
  130 + }
  131 +
  132 + /**
  133 + *
  134 + * @Title: sreachNbbm @Description: TODO(搜索车辆内部编码) @throws
  135 + */
  136 + @RequestMapping(value = "/sreachVehic", method = RequestMethod.GET)
  137 + public List<Map<String, String>> sreachVehic(@RequestParam String nbbm) {
  138 + return scheduleRealInfoService.sreachVehic(nbbm);
  139 + }
  140 + /**
  141 + *
  142 + * @Title: realOutAdjust
  143 + * @Description: TODO(实发调整)
  144 + * @param @param id 班次ID
  145 + * @param @param fcsjActual 实际发车时间 HH:mm
  146 + * @param @param remarks 备注
  147 + * @throws
  148 + */
  149 + @RequestMapping(value = "/realOutAdjust", method = RequestMethod.POST)
  150 + public Map<String, Object> realOutAdjust(@RequestParam Map<String, String> map) {
  151 + return scheduleRealInfoService.realOutAdjust(map);
  152 + }
  153 +
  154 + /**
  155 + *
  156 + * @Title: revokeDestroy
  157 + * @Description: TODO(撤销烂班)
  158 + * @param @param id
  159 + * @throws
  160 + */
  161 + @RequestMapping(value = "/revokeDestroy", method = RequestMethod.POST)
  162 + public Map<String, Object> revokeDestroy(@RequestParam Long id){
  163 + return scheduleRealInfoService.revokeDestroy(id);
  164 + }
  165 +
  166 + /**
  167 + *
  168 + * @Title: revokeRealOutgo
  169 + * @Description: TODO(撤销实发)
  170 + * @param @param id
  171 + * @throws
  172 + */
  173 + @RequestMapping(value = "/revokeRealOutgo", method = RequestMethod.POST)
  174 + public Map<String, Object> revokeRealOutgo(@RequestParam Long id){
  175 + return scheduleRealInfoService.revokeRealOutgo(id);
  176 + }
  177 +
  178 + /**
  179 + * 撤销执行
  180 + * @param id
  181 + * @return
  182 + */
  183 + @RequestMapping(value = "/revokeRealArrive", method = RequestMethod.POST)
  184 + public Map<String, Object> revokeRealArrive(@RequestParam Long id){
  185 + return scheduleRealInfoService.revokeRealArrive(id);
  186 + }
  187 +
  188 + /**
  189 + *
  190 + * @Title: spaceAdjust
  191 + * @Description: TODO(间隔调整)
  192 + * @param @param ids 要调整的班次数组ID
  193 + * @param @param space 间隔
  194 + * @throws
  195 + */
  196 + @RequestMapping(value = "/spaceAdjust", method = RequestMethod.POST)
  197 + public Map<String, Object> spaceAdjust(Long[] ids, Integer space){
  198 + return scheduleRealInfoService.spaceAdjust(ids, space);
  199 + }
  200 +
  201 + /**
  202 + *
  203 + * @Title: schInfoFineTune
  204 + * @Description: TODO(发车信息微调)
  205 + * @param @param map
  206 + * @throws
  207 + */
  208 + @RequestMapping(value = "/schInfoFineTune", method = RequestMethod.POST)
  209 + public Map<String, Object> schInfoFineTune(@RequestParam Map<String, String> map){
  210 + return scheduleRealInfoService.schInfoFineTune(map);
  211 + }
  212 +
  213 + /**
  214 + *
  215 + * @Title: outgoAdjustAll
  216 + * @Description: TODO(批量待发调整)
  217 + * @param @param list
  218 + * @throws
  219 + */
  220 + @RequestMapping(value = "/outgoAdjustAll", method = RequestMethod.POST)
  221 + public Map<String, Object> outgoAdjustAll(@RequestParam String params){
  222 + //反转义
  223 + params = StringEscapeUtils.unescapeHtml4(params);
  224 + return scheduleRealInfoService.outgoAdjustAll(params);
  225 + }
  226 +
  227 + /**
  228 + *
  229 + * @Title: findByLineAndUpDown
  230 + * @Description: TODO(根据线路和走向获取班次)
  231 + * @param @param line
  232 + * @param @param upDown
  233 + */
  234 + @RequestMapping(value = "/findByLineAndUpDown")
  235 + public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam String line,@RequestParam Integer upDown){
  236 + return dayOfSchedule.findByLineAndUpDown(line, upDown);
  237 + }
  238 +
  239 + /**
  240 + *
  241 + * @Title: findRouteByLine
  242 + * @Description: TODO(获取线路的站点,路段路由)
  243 + * @param @param lineCode
  244 + * @throws
  245 + */
  246 + @RequestMapping(value = "/findRouteByLine")
  247 + public Map<String, Object> findRouteByLine(@RequestParam String lineCode){
  248 + return scheduleRealInfoService.findRouteByLine(lineCode);
  249 + }
  250 +
  251 + /**
  252 + *
  253 + * @Title: removeChildTask
  254 + * @Description: TODO(删除子任务)
  255 + * @param @param taskId 子任务ID
  256 + * @throws
  257 + */
  258 + @RequestMapping(value = "/childTask/{taskId}", method = RequestMethod.DELETE)
  259 + public Map<String, Object> removeChildTask(@PathVariable("taskId") Long taskId){
  260 + return scheduleRealInfoService.removeChildTask(taskId);
  261 + }
  262 +
  263 + /**
  264 + *
  265 + * @Title: findByLineCode
  266 + * @Description: TODO(根据线路获取班次信息)
  267 + * @param @param lineCode
  268 + */
  269 + @RequestMapping(value = "/lineCode/{lineCode}")
  270 + public List<ScheduleRealInfo> findByLineCode(@PathVariable("lineCode") String lineCode){
  271 + return dayOfSchedule.findByLineCode(lineCode);
  272 + }
  273 +
  274 + @RequestMapping(value = "/queryUserInfo")
  275 + public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line,
  276 + @RequestParam String date,@RequestParam String state) {
  277 + return scheduleRealInfoService.queryUserInfo(line, date,state);
  278 + }
  279 +
  280 + @RequestMapping(value = "/queryUserInfoPx")
  281 + public List<ScheduleRealInfo> queryUserInfoPx(@RequestParam String line,
  282 + @RequestParam String date,@RequestParam String state,@RequestParam String type) {
  283 + return scheduleRealInfoService.queryUserInfoPx(line, date,state,type);
  284 + }
  285 +
  286 + @RequestMapping(value = "/exportWaybill",method = RequestMethod.GET)
  287 + public List<ScheduleRealInfo> exportWaybill(@RequestParam String jName,@RequestParam String jGh, @RequestParam String clZbh,
  288 + @RequestParam String lpName,@RequestParam String date,@RequestParam String line) {
  289 + return scheduleRealInfoService.exportWaybill(jName,jGh, clZbh, lpName,date,line);
  290 + }
  291 +
  292 + @RequestMapping(value = "/exportWaybillQp",method = RequestMethod.GET)
  293 + public List<ScheduleRealInfo> exportWaybillQp(@RequestParam String clZbh
  294 + ,@RequestParam String date,@RequestParam String line) {
  295 + return scheduleRealInfoService.exportWaybillQp( clZbh, date,line);
  296 + }
  297 +
  298 +
  299 + @RequestMapping(value = "/dailyInfo")
  300 + public List<Map<String, Object>> dailyInfo(@RequestParam String line, @RequestParam String date,@RequestParam String type) {
  301 + return scheduleRealInfoService.dailyInfo(line, date, type);
  302 + }
  303 +
  304 + @RequestMapping(value = "/historyMessage")
  305 + public List<Object[]> historyMessage(@RequestParam String line, @RequestParam String date,
  306 + @RequestParam String code, @RequestParam String type) {
  307 + return scheduleRealInfoService.historyMessage(line, date, code, type);
  308 + }
  309 +
  310 + @RequestMapping(value="/findLine")
  311 + public List<Map<String,String>> findLine(@RequestParam String line){
  312 + return scheduleRealInfoService.findLine(line);
  313 + }
  314 +
  315 + @RequestMapping(value="/findKMBC",method = RequestMethod.GET)
  316 + public Map<String,Object> findKMBC(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName
  317 + ,@RequestParam String date,@RequestParam String line){
  318 + return scheduleRealInfoService.findKMBC(jGh, clZbh,lpName,date,line);
  319 + }
  320 +
  321 + /**
  322 + * 路单公里统计 (闵行审计专用)
  323 + * @param jGh
  324 + * @param clZbh
  325 + * @param lpName
  326 + * @param date
  327 + * @param line
  328 + * @return
  329 + */
  330 + @RequestMapping(value="/findKMBC_mh_2",method = RequestMethod.GET)
  331 + public Map<String,Object> findKMBC_mh_2(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName
  332 + ,@RequestParam String date,@RequestParam String line){
  333 + return scheduleRealInfoService.findKMBC_mh_2(jGh, clZbh,lpName,date,line);
  334 + }
  335 +
  336 + @RequestMapping(value="/findKMBCQp",method = RequestMethod.GET)
  337 + public Map<String,Object> findKMBCQp(@RequestParam String clZbh
  338 + ,@RequestParam String date,@RequestParam String line){
  339 + return scheduleRealInfoService.findKMBCQp(clZbh,date,line);
  340 + }
  341 +
  342 + @RequestMapping(value="/findLpName")
  343 + public List<Map<String,String>> findLpName(@RequestParam String lpName){
  344 + return scheduleRealInfoService.findLpName(lpName);
  345 + }
  346 +
  347 + @RequestMapping(value = "/account")
  348 + public List<Map<String,Object>> account(@RequestParam String line, @RequestParam String date,
  349 + @RequestParam String code,@RequestParam String xlName, @RequestParam String type) {
  350 + return scheduleRealInfoService.account(line, date, code, xlName, type);
  351 + }
  352 +
  353 + @RequestMapping(value = "/accountPx")
  354 + public List<Map<String,Object>> accountPx(@RequestParam String line, @RequestParam String date,
  355 + @RequestParam String code,@RequestParam String xlName, @RequestParam String px) {
  356 + return scheduleRealInfoService.accountPx(line, date, code, xlName, px);
  357 + }
  358 +
  359 + @RequestMapping(value = "/correctForm")
  360 + public List<SchEditInfoDto> correctForm(@RequestParam String line, @RequestParam String date,
  361 + @RequestParam String endDate,
  362 + @RequestParam String lpName, @RequestParam String code,
  363 + @RequestParam String type,@RequestParam String changType) {
  364 + return scheduleRealInfoService.correctForm(line, date, endDate, lpName, code, type,changType);
  365 + }
  366 + /**
  367 + * @Title queryListWaybill
  368 + * @Description 查询行车路单列表
  369 + * @param jGh 驾驶员名字
  370 + * @param clZbh 车辆自编号(内部编号)
  371 + * @param lpName 路牌
  372 + * @return
  373 + */
  374 + @RequestMapping(value="/queryListWaybill",method = RequestMethod.GET)
  375 + public List<ScheduleRealInfo> queryListWaybill(@RequestParam String jGh,@RequestParam String clZbh,@RequestParam String lpName
  376 + ,@RequestParam String date,@RequestParam String line){
  377 + return scheduleRealInfoService.queryListWaybill(jGh, clZbh,lpName,date,line);
  378 + }
  379 +
  380 + /**
  381 + * @Title queryListWaybill
  382 + * @Description 查询行车路单列表(闵行审计专用路单)
  383 + * @param jName 驾驶员名字
  384 + * @param clZbh 车辆自编号(内部编号)
  385 + * @param lpName 路牌
  386 + * @return
  387 + */
  388 + @RequestMapping(value="/queryListWaybill_mh_2",method = RequestMethod.GET)
  389 + public List<ScheduleRealInfo> queryListWaybill_mh_2(@RequestParam String jName,@RequestParam String clZbh,@RequestParam String lpName
  390 + ,@RequestParam String date,@RequestParam String line){
  391 + return scheduleRealInfoService.queryListWaybill2(jName, clZbh,lpName,date,line);
  392 + }
  393 +
  394 + @RequestMapping(value="/queryListWaybillQp",method = RequestMethod.GET)
  395 + public List<ScheduleRealInfo> queryListWaybillQp(@RequestParam String clZbh,
  396 + @RequestParam String date,@RequestParam String line){
  397 + return scheduleRealInfoService.queryListWaybillQp(clZbh,date,line);
  398 + }
  399 +
  400 + @RequestMapping(value="/statisticsDaily")
  401 + public List<Map<String,Object>> statisticsDaily(@RequestParam String line, @RequestParam String date,
  402 + @RequestParam String xlName, @RequestParam String type){
  403 + return scheduleRealInfoService.statisticsDaily(line, date, xlName, type);
  404 + }
  405 +
  406 + @RequestMapping(value="/statisticsDaily_mh_2")
  407 + public List<Map<String,Object>> statisticsDaily_mh_2(@RequestParam String line, @RequestParam String date,
  408 + @RequestParam String xlName, @RequestParam String type){
  409 + return scheduleRealInfoService.statisticsDaily_mh_2(line, date, xlName, type);
  410 + }
  411 +
  412 + @RequestMapping(value="/dispatchDailySum")
  413 + public List<Map<String,Object>> dispatchDailySum(@RequestParam Map<String, Object> map){
  414 + String date="";
  415 + if(map.get("date")!=null){
  416 + date=map.get("date").toString();
  417 + }
  418 + String nature="0";
  419 + if(map.get("nature")!=null){
  420 + nature=map.get("nature").toString();
  421 + }
  422 + String type="";
  423 + if(map.get("type")!=null){
  424 + type=map.get("type").toString();
  425 + }
  426 + return scheduleRealInfoService.dispatchDailySum(date, nature, type);
  427 + }
  428 +
  429 + @RequestMapping(value="/statisticsDailyTj")
  430 + public List<Map<String,Object>> statisticsDailyTj(@RequestParam Map<String, Object> map){
  431 + String gsdm="";
  432 + if(map.get("gsdm")!=null){
  433 + gsdm=map.get("gsdm").toString();
  434 + }
  435 + String fgsdm="";
  436 + if(map.get("fgsdm")!=null){
  437 + fgsdm=map.get("fgsdm").toString();
  438 + }
  439 + String line="";
  440 + if(map.get("line")!=null){
  441 + line=map.get("line").toString();
  442 + }
  443 + String date="";
  444 + if(map.get("date")!=null){
  445 + date=map.get("date").toString();
  446 + }
  447 + String date2="";
  448 + if(map.get("date2")!=null){
  449 + date2=map.get("date2").toString();
  450 + }
  451 + String xlName="";
  452 + if(map.get("xlName")!=null){
  453 + xlName=map.get("xlName").toString();
  454 + }
  455 + String type="";
  456 + if(map.get("type")!=null){
  457 + type=map.get("type").toString();
  458 + }
  459 + String nature="0";
  460 + if(map.get("nature")!=null){
  461 + nature=map.get("nature").toString();
  462 + }
  463 + return scheduleRealInfoService.statisticsDailyTj(gsdm,fgsdm,line, date,date2, xlName, type,nature);
  464 + }
  465 +
  466 + /*
  467 + * 公里修正报表
  468 + */
  469 + @RequestMapping(value="/mileageReportTj")
  470 + public List<Map<String,Object>> mileageReport(@RequestParam Map<String, Object> map){
  471 + String gsdm="";
  472 + if(map.get("gsdm")!=null){
  473 + gsdm=map.get("gsdm").toString();
  474 + }
  475 + String fgsdm="";
  476 + if(map.get("fgsdm")!=null){
  477 + fgsdm=map.get("fgsdm").toString();
  478 + }
  479 + String line="";
  480 + if(map.get("line")!=null){
  481 + line=map.get("line").toString();
  482 + }
  483 + String date="";
  484 + if(map.get("date")!=null){
  485 + date=map.get("date").toString();
  486 + }
  487 + String date2="";
  488 + if(map.get("date2")!=null){
  489 + date2=map.get("date2").toString();
  490 + }
  491 + String xlName="";
  492 + if(map.get("xlName")!=null){
  493 + xlName=map.get("xlName").toString();
  494 + }
  495 + return scheduleRealInfoService.mileageReport(gsdm,fgsdm,line, date,date2);
  496 + }
  497 +
  498 + /*
  499 + * 班次修正报表
  500 + */
  501 + @RequestMapping(value="/scheduleCorrectionReport")
  502 + public List<Map<String,Object>> scheduleCorrectionReport(@RequestParam Map<String, Object> map){
  503 + String gsdm="";
  504 + if(map.get("gsdm")!=null){
  505 + gsdm=map.get("gsdm").toString();
  506 + }
  507 + String fgsdm="";
  508 + if(map.get("fgsdm")!=null){
  509 + fgsdm=map.get("fgsdm").toString();
  510 + }
  511 + String line="";
  512 + if(map.get("line")!=null){
  513 + line=map.get("line").toString();
  514 + }
  515 + String date="";
  516 + if(map.get("date")!=null){
  517 + date=map.get("date").toString();
  518 + }
  519 + String date2="";
  520 + if(map.get("date2")!=null){
  521 + date2=map.get("date2").toString();
  522 + }
  523 + String xlName="";
  524 + if(map.get("xlName")!=null){
  525 + xlName=map.get("xlName").toString();
  526 + }
  527 + return scheduleRealInfoService.scheduleCorrectionReport(gsdm,fgsdm,line, date,date2);
  528 + }
  529 +
  530 + @RequestMapping(value="/MapById",method = RequestMethod.GET)
  531 + public Map<String, Object> MapById(@RequestParam("id") Long id){
  532 + return scheduleRealInfoService.MapById(id);
  533 + }
  534 +
  535 + @RequestMapping(value="/MapByIdQp",method = RequestMethod.GET)
  536 + public Map<String, Object> MapByIdQp(@RequestParam("id") Long id){
  537 + return scheduleRealInfoService.MapByIdQp(id);
  538 + }
  539 +
  540 + /**
  541 + * @Title: scheduleDaily
  542 + * @Description: TODO(调度日报表)
  543 + * @param line 线路
  544 + * @param date 时间
  545 + * @return
  546 + */
  547 + @RequestMapping(value="/scheduleDaily")
  548 + public Map<String,Object> scheduleDaily(@RequestParam String line,@RequestParam String date){
  549 + return scheduleRealInfoService.scheduleDaily(line,date);
  550 + }
  551 +
  552 + @RequestMapping(value="/realScheduleList")
  553 + public List<ScheduleRealInfo> realScheduleList(@RequestParam String line,@RequestParam String date){
  554 + return scheduleRealInfoService.realScheduleList(line,date);
  555 + }
  556 +
  557 + @RequestMapping(value="/realScheduleList_zrw")
  558 + public List<ScheduleRealInfo> realScheduleList_zrw(@RequestParam String line,@RequestParam String date){
  559 + return scheduleRealInfoService.realScheduleList_zrw(line,date);
  560 + }
  561 +
  562 + @RequestMapping(value="/realScheduleList_mh_2")
  563 + public List<ScheduleRealInfo> realScheduleList_mh_2(@RequestParam String line,@RequestParam String date){
  564 + return scheduleRealInfoService.realScheduleList_mh_2(line,date);
  565 + }
  566 +
  567 + @RequestMapping(value="/realScheduleListQp")
  568 + public List<ScheduleRealInfo> realScheduleListQp(@RequestParam String line,@RequestParam String date){
  569 + return scheduleRealInfoService.realScheduleListQp(line,date);
  570 + }
  571 +
  572 + @RequestMapping(value="/multi_tzrc", method=RequestMethod.POST)
  573 + public synchronized Map<String, Object> multi_tzrc(@RequestParam String cpcsJson){
  574 + cpcsJson = StringEscapeUtils.unescapeHtml4(cpcsJson);
  575 + List<ChangePersonCar> cpcs = JSONArray.parseArray(cpcsJson, ChangePersonCar.class);
  576 + return scheduleRealInfoService.multi_tzrc(cpcs, null);
  577 + }
  578 +
  579 + @RequestMapping(value="/multi_dftz", method=RequestMethod.POST)
  580 + public Map<String, Object> multi_dftz(@RequestParam String dcsJson){
  581 + dcsJson = StringEscapeUtils.unescapeHtml4(dcsJson);
  582 + List<DfsjChange> dfsjcs = JSONArray.parseArray(dcsJson, DfsjChange.class);
  583 + return scheduleRealInfoService.multi_dftz(dfsjcs);
  584 + }
  585 +
  586 + @RequestMapping(value="/changeBcType/{id}", method=RequestMethod.POST)
  587 + public Map<String, Object> changeBcType(@PathVariable("id") Long id, String bcType, String remarks, String majorStationName){
  588 + return scheduleRealInfoService.changeBcType(id, bcType, remarks, majorStationName);
  589 + }
  590 +
  591 + @RequestMapping(value="/history", method=RequestMethod.POST)
  592 + public Map<String,Object> historySave(ScheduleRealInfo sch){
  593 + return scheduleRealInfoService.historySave(sch);
  594 + }
  595 +
  596 +
  597 + private static DateTimeFormatter fmtyyyyMMdd = DateTimeFormat.forPattern("yyyy-MM-dd");
  598 + private final static long ONE_DAY = 1000 * 60 * 60 * 24;
  599 + /**
  600 + * 获取可编辑的历史班次日期
  601 + * @return
  602 + */
  603 + @RequestMapping("dateArray")
  604 + public List<String> dateArray(@RequestParam(defaultValue = "0") int c){
  605 + List<String> rs = new ArrayList<>();
  606 +
  607 + long t = System.currentTimeMillis();
  608 + if(c != 1)
  609 + t -= (ONE_DAY + (1000 * 60 * 60 * 6));
  610 + for(int i = 0; i < 3; i ++){
  611 + rs.add(fmtyyyyMMdd.print(t));
  612 + t -= ONE_DAY;
  613 + }
  614 + return rs;
  615 + }
  616 +
  617 + @RequestMapping(value = "svgAttr", method = RequestMethod.POST)
  618 + public Map<String, Object> svgAttr(@RequestParam String jsonStr){
  619 + return scheduleRealInfoService.svgAttr(jsonStr);
  620 + }
  621 +
  622 + @RequestMapping(value = "svgAttr", method = RequestMethod.GET)
  623 + public Map<String, Object> findSvgAttr(@RequestParam String idx){
  624 + return scheduleRealInfoService.findSvgAttr(idx);
  625 + }
  626 +
  627 + @RequestMapping(value = "addRemarks", method = RequestMethod.POST)
  628 + public Map<String, Object> addRemarks(@RequestParam Long id, @RequestParam String remarks){
  629 + return scheduleRealInfoService.addRemarks(id, remarks);
  630 + }
  631 +
  632 + @RequestMapping(value = "scheduleDailyQp", method = RequestMethod.GET)
  633 + public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){
  634 + return scheduleRealInfoService.scheduleDailyQp(line,date);
  635 + }
  636 +
  637 + @RequestMapping(value = "scheduleDailyExport", method = RequestMethod.GET)
  638 + public List<Map<String, Object>> scheduleDailyExport(@RequestParam Map<String, Object> map){
  639 + return scheduleRealInfoService.scheduleDailyExport(map);
  640 + }
  641 +
  642 + @RequestMapping(value = "exportWaybillMore", method = RequestMethod.GET)
  643 + public Map<String, Object> exportWaybillMore(@RequestParam Map<String, Object> map){
  644 + return scheduleRealInfoService.exportWaybillMore(map);
  645 + }
  646 +
  647 + /**
  648 + * 获取当日计划排班 , 从计划表抓取数据
  649 + * @return
  650 + */
  651 + @RequestMapping(value = "currSchedulePlanByLineCode", method = RequestMethod.GET)
  652 + public List<SchedulePlanInfo> currentSchedulePlan(@RequestParam String lineCode){
  653 + return scheduleRealInfoService.currentSchedulePlan(lineCode);
  654 + }
  655 +
  656 + @RequestMapping(value = "lpChangeMulti", method = RequestMethod.POST)
  657 + public Map<String, Object> lpChangeMulti(@RequestParam String leftIdx, @RequestParam String rightIdx,@RequestParam int type){
  658 + return scheduleRealInfoService.lpChangeMulti(leftIdx, rightIdx, type);
  659 + }
  660 +
  661 + /**
  662 + * 删除当日实际排班
  663 + * @return
  664 + */
  665 + @RequestMapping(value = "deleteRealSchedule", method = RequestMethod.POST)
  666 + public Map<String, Object> deleteRealSchedule(@RequestParam String lineCode){
  667 + return dayOfSchedule.deleteRealSchedule(lineCode);
  668 + }
  669 +
  670 + /**
  671 + * 从计划表重新加载当日排班
  672 + * @param lineCode
  673 + * @return
  674 + */
  675 + @RequestMapping(value = "reLoadRealSchedule", method = RequestMethod.POST)
  676 + public Map<String, Object> reLoadRealSchedule(@RequestParam String lineCode){
  677 + Map<String, Object> rs = new HashMap<>();
  678 + List<ScheduleRealInfo> list = dayOfSchedule.findByLineCode(lineCode);
  679 + if(list != null && list.size() > 0){
  680 + rs.put("status", ResponseCode.ERROR);
  681 + rs.put("msg", "失败," + list.get(0).getXlName() + "当日存在实际排班,无法重新加载。");
  682 + return rs;
  683 + }
  684 +
  685 + int code = dayOfSchedule.reloadSch(lineCode);
  686 +
  687 + //重新按公司编码索引数据
  688 + dayOfSchedule.groupByGsbm();
  689 + rs.put("status", code==0? ResponseCode.SUCCESS: ResponseCode.ERROR);
  690 + return rs;
  691 + }
  692 +
  693 + /**
  694 + * 误点调整
  695 + * @param idx
  696 + * @param minute
  697 + * @return
  698 + */
  699 + @RequestMapping(value = "lateAdjust", method = RequestMethod.POST)
  700 + public Map<String, Object> lateAdjust(@RequestParam String idx,@RequestParam float minute ){
  701 + return scheduleRealInfoService.lateAdjust(idx, minute);
  702 + }
  703 +
  704 + /**
  705 + * 获取所有应发未到的班次
  706 + * @param idx
  707 + * @return
  708 + */
  709 + @RequestMapping(value = "allLate2")
  710 + public List<ScheduleRealInfo> allLate2(@RequestParam String idx){
  711 + return scheduleRealInfoService.allLate2(idx);
  712 + }
  713 +
  714 + /**
  715 + * 添加一个临加到历史库
  716 + * @param sch
  717 + * @return
  718 + */
  719 + @RequestMapping(value = "history/add", method = RequestMethod.POST)
  720 + public Map<String, Object> addToHistory(ScheduleRealInfo sch){
  721 + return scheduleRealInfoService.addToHistory(sch);
  722 + }
  723 +
  724 + /**
  725 + * 从历史库里删除临加班次
  726 + * @param id
  727 + * @return
  728 + */
  729 + @RequestMapping(value = "history/{id}", method = RequestMethod.DELETE)
  730 + public Map<String, Object> deleteToHistory(@PathVariable("id") Long id){
  731 + return scheduleRealInfoService.deleteToHistory(id);
  732 + }
  733 +
  734 + @RequestMapping(value = "isCircleQdz", method = RequestMethod.POST)
  735 + public Map<String, Object> isCircleQdz(@RequestParam String line, String nbbm, String ts, String qdzCode){
  736 + Map<String, Object> map =new HashMap<>();
  737 + map.put("isExist",scheduleRealInfoService.isCircleQdz(nbbm, ts, line, qdzCode));
  738 + return map;
  739 + }
  740 +
  741 + /**
  742 + * 从历史库里删除临加班次
  743 + * @param param
  744 + * @return
  745 + */
  746 + @RequestMapping(value = "wxsb", method = RequestMethod.POST)
  747 + public Map<String, Object> repairReport(@RequestParam Map<String, Object> param){
  748 + return scheduleRealInfoService.repairReport(param, true);
  749 + }
  750 +
  751 + @RequestMapping(value = "wxsb", method = RequestMethod.GET)
  752 + public List<RepairReport> repairReportList(@RequestParam String line, @RequestParam String date, @RequestParam String code, @RequestParam String type){
  753 + return scheduleRealInfoService.repairReportList(line, date, code, type);
  754 + }
  755 +
  756 + @RequestMapping(value = "lineLevel", method = RequestMethod.GET)
  757 + public Map<String, String> lineLevel(@RequestParam String idx){
  758 + return scheduleRealInfoService.getLevelsByLines(Arrays.asList(idx.split(",")));
  759 + }
  760 +
  761 + /**
  762 + * 反馈安全驾驶系统
  763 + * @param param
  764 + * @return
  765 + */
  766 + @RequestMapping(value = "ackDsm", method = RequestMethod.POST)
  767 + public Map<String, Object> ackDsm(@RequestParam Map<String, Object> param){
  768 + Map<String, Object> res = new HashMap<>();
  769 + InputStream in = null;
  770 + SysUser user = SecurityUtils.getCurrentUser();
  771 + DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
  772 + StringBuilder url = new StringBuilder("http://211.95.61.66:9008/modules/dsmCheckTheRecord/addDsm?"), uri = new StringBuilder();
  773 + HttpURLConnection con = null;
  774 + try {
  775 + uri.append("ddyName=").append(URLEncoder.encode(user == null ? "admin" : user.getUserName(), "UTF-8"));
  776 + uri.append("&checkTime=").append(URLEncoder.encode(fmt.print(System.currentTimeMillis()), "UTF-8"));
  777 + uri.append("&nbbm=").append(URLEncoder.encode(param.get("nbbm").toString(), "UTF-8"));
  778 + uri.append("&starttime=").append(URLEncoder.encode(fmt.print(Long.parseLong(param.get("ts").toString())), "UTF-8"));
  779 + url.append(uri);
  780 + con = (HttpURLConnection)new URL(url.toString()).openConnection();
  781 + con.setDoInput(true);
  782 + con.setRequestMethod("POST");
  783 + con.setConnectTimeout(5000);
  784 + con.setReadTimeout(5000);
  785 + con.setRequestProperty("keep-alive", "true");
  786 + con.setRequestProperty("accept", "*/*");
  787 + con.setRequestProperty("content-type", "application/x-www-form-urlencoded");
  788 + con.connect();
  789 +
  790 + if (con.getResponseCode() == 200) {
  791 + in = con.getInputStream();
  792 + ByteArrayOutputStream bout = new ByteArrayOutputStream();
  793 + IOUtils.copy(in, bout);
  794 + Map<String, Object> map = new ObjectMapper().readValue(bout.toByteArray(), Map.class);
  795 + System.out.println(map);
  796 + }
  797 + } catch (MalformedURLException e) {
  798 + // TODO Auto-generated catch block
  799 + e.printStackTrace();
  800 + } catch (IOException e) {
  801 + // TODO Auto-generated catch block
  802 + e.printStackTrace();
  803 + } finally {
  804 + if (con != null) {
  805 + con.disconnect();
  806 + }
  807 + }
  808 +
  809 + return res;
  810 + }
  811 +
  812 + @RequestMapping(value = "exportPlan", method = RequestMethod.GET)
  813 + public Map<String, Object> exportPlan(@RequestParam String date){
  814 + Map<String, Object> res = new HashMap<>();
  815 + DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm");
  816 + Connection conn = null;
  817 + PreparedStatement ps = null;
  818 + ResultSet rs = null;
  819 +
  820 + List<Map<String, Object>> list = new ArrayList<>();
  821 + 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'";
  822 + try{
  823 + conn = DBUtils_control.getConnection();
  824 + ps = conn.prepareStatement(sql);
  825 + ps.setString(1, date);
  826 + rs = ps.executeQuery();
  827 + ObjectMapper mapper = new ObjectMapper();
  828 +
  829 + while (rs.next()) {
  830 + SchedulePlan schedulePlan = new SchedulePlan();
  831 + schedulePlan.setXlName(rs.getString("xl_name"));
  832 + schedulePlan.setXlDir(rs.getInt("xl_dir"));
  833 + Date scheduleDate = rs.getDate("schedule_date");
  834 + schedulePlan.setScheduleDate(new DateTime(scheduleDate.getTime()).toString("yyyy-MM-dd"));
  835 + String fcsj = rs.getString("fcsj");
  836 + int bcsj = rs.getInt("bcsj");
  837 + DateTime fcsjDt = dateTimeFormatter.parseDateTime(schedulePlan.getScheduleDate() + " " + fcsj);
  838 + schedulePlan.setFcsj(fcsjDt.toString("HH:mm:00"));
  839 + DateTime ddsjDt = fcsjDt.plusMinutes(bcsj);
  840 + schedulePlan.setDdsj(ddsjDt.toString("HH:mm:00"));
  841 + schedulePlan.setSjdStart(fcsjDt.toString("HH:00:00"));
  842 + DateTime endDt = fcsjDt.plusHours(1);
  843 + schedulePlan.setSjdEnd(endDt.toString("HH:00:00"));
  844 + schedulePlan.setClZbh(rs.getString("cl_zbh"));
  845 + schedulePlan.setJsy(rs.getString("j_name"));
  846 + schedulePlan.setBcsj(bcsj);
  847 +
  848 + list.add(mapper.readValue(mapper.writeValueAsString(schedulePlan), HashMap.class));
  849 + }
  850 + List<Iterator<?>> iterators = new ArrayList<Iterator<?>>();
  851 + iterators.add(list.iterator());
  852 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  853 + String sourcePath = path + "mould/schedulePlan.xls";
  854 +
  855 + new ReportUtils().excelReplace(iterators, new Object[]{}, sourcePath, path + "export/" + date + "-花博会专线班次.xls");
  856 +
  857 + res.put("status", ResponseCode.SUCCESS);
  858 + res.put("msg", "成功");
  859 + } catch (Exception e) {
  860 + res.put("status", ResponseCode.ERROR);
  861 + res.put("msg", e.getMessage());
  862 + } finally {
  863 + DBUtils_control.close(rs, ps, conn);
  864 + }
  865 +
  866 + return res;
  867 + }
  868 +
  869 + public final static class SchedulePlan {
  870 + private String company = "浦东公司[46]";
  871 +
  872 + private String xlName = "";
  873 +
  874 + private int xlDir;
  875 +
  876 + private String xlDirStr = "";
  877 +
  878 + private String scheduleDate = "";
  879 +
  880 + private String sjdStart = "";
  881 +
  882 + private String sjdEnd = "";
  883 +
  884 + private String fcsj = "";
  885 +
  886 + private int bcsj;
  887 +
  888 + private String ddsj = "";
  889 +
  890 + private int yys = 25;
  891 +
  892 + private String clZbh = "";
  893 +
  894 + private String cph = "";
  895 +
  896 + private String color = "绿牌";
  897 +
  898 + private String jsy = "";
  899 +
  900 + private String jsydh = "";
  901 +
  902 + private int pj = 10;
  903 +
  904 + public String getCompany() {
  905 + return company;
  906 + }
  907 +
  908 + public void setCompany(String company) {
  909 + this.company = company;
  910 + }
  911 +
  912 + public String getXlName() {
  913 + return xlName;
  914 + }
  915 +
  916 + public void setXlName(String xlName) {
  917 + this.xlName = xlName;
  918 + }
  919 +
  920 + public int getXlDir() {
  921 + return xlDir;
  922 + }
  923 +
  924 + public void setXlDir(int xlDir) {
  925 + this.xlDir = xlDir;
  926 + }
  927 +
  928 + public String getXlDirStr() {
  929 + xlDirStr = "";
  930 + if (xlDir == 0) {
  931 + xlDirStr = "上行";
  932 + } else if (xlDir == 1) {
  933 + xlDirStr = "下行";
  934 + }
  935 + return xlDirStr;
  936 + }
  937 +
  938 + public void setXlDirStr(String xlDirStr) {
  939 + this.xlDirStr = xlDirStr;
  940 + }
  941 +
  942 + public String getScheduleDate() {
  943 + return scheduleDate;
  944 + }
  945 +
  946 + public void setScheduleDate(String scheduleDate) {
  947 + this.scheduleDate = scheduleDate;
  948 + }
  949 +
  950 + public String getSjdStart() {
  951 + return sjdStart;
  952 + }
  953 +
  954 + public void setSjdStart(String sjdStart) {
  955 + this.sjdStart = sjdStart;
  956 + }
  957 +
  958 + public String getSjdEnd() {
  959 + return sjdEnd;
  960 + }
  961 +
  962 + public void setSjdEnd(String sjdEnd) {
  963 + this.sjdEnd = sjdEnd;
  964 + }
  965 +
  966 + public String getFcsj() {
  967 + return fcsj;
  968 + }
  969 +
  970 + public void setFcsj(String fcsj) {
  971 + this.fcsj = fcsj;
  972 + }
  973 +
  974 + public int getBcsj() {
  975 + return bcsj;
  976 + }
  977 +
  978 + public void setBcsj(int bcsj) {
  979 + this.bcsj = bcsj;
  980 + }
  981 +
  982 + public String getDdsj() {
  983 + return ddsj;
  984 + }
  985 +
  986 + public void setDdsj(String ddsj) {
  987 + this.ddsj = ddsj;
  988 + }
  989 +
  990 + public int getYys() {
  991 + return yys;
  992 + }
  993 +
  994 + public void setYys(int yys) {
  995 + this.yys = yys;
  996 + }
  997 +
  998 + public String getClZbh() {
  999 + return clZbh;
  1000 + }
  1001 +
  1002 + public void setClZbh(String clZbh) {
  1003 + this.clZbh = clZbh;
  1004 + }
  1005 +
  1006 + public String getCph() {
  1007 + cph = BasicData.nbbmCompanyPlateMap.get(clZbh);
  1008 + if (cph == null) {
  1009 + cph = "";
  1010 + }
  1011 + return cph;
  1012 + }
  1013 +
  1014 + public void setCph(String cph) {
  1015 + this.cph = cph;
  1016 + }
  1017 +
  1018 + public String getColor() {
  1019 + return color;
  1020 + }
  1021 +
  1022 + public void setColor(String color) {
  1023 + this.color = color;
  1024 + }
  1025 +
  1026 + public String getJsy() {
  1027 + return jsy;
  1028 + }
  1029 +
  1030 + public void setJsy(String jsy) {
  1031 + this.jsy = jsy;
  1032 + }
  1033 +
  1034 + public String getJsydh() {
  1035 + return jsydh;
  1036 + }
  1037 +
  1038 + public void setJsydh(String jsydh) {
  1039 + this.jsydh = jsydh;
  1040 + }
  1041 +
  1042 + public int getPj() {
  1043 + return pj;
  1044 + }
  1045 +
  1046 + public void setPj(int pj) {
  1047 + this.pj = pj;
  1048 + }
  1049 + }
  1050 +}
src/main/java/com/bsth/controller/report/ReportController.java
@@ -304,6 +304,12 @@ public class ReportController { @@ -304,6 +304,12 @@ public class ReportController {
304 return service.userList(map); 304 return service.userList(map);
305 } 305 }
306 306
  307 + @RequestMapping(value="/countMileageSum")
  308 + public List<Map<String,Object>> countMileageSum(@RequestParam Map<String, Object> map){
  309 +
  310 + return service.countMileageSum(map);
  311 + }
  312 +
307 @RequestMapping(value="/countLineMileage") 313 @RequestMapping(value="/countLineMileage")
308 public List<Map<String,Object>> countLineMileage(@RequestParam Map<String, Object> map){ 314 public List<Map<String,Object>> countLineMileage(@RequestParam Map<String, Object> map){
309 315
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
@@ -889,6 +889,16 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer @@ -889,6 +889,16 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
889 if (type != null && type.length() != 0 && type.equals("exportAll")) { 889 if (type != null && type.length() != 0 && type.equals("exportAll")) {
890 List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); 890 List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
891 Map<String, Map<String, Object>> tempMap = new HashMap<String, Map<String, Object>>(); 891 Map<String, Map<String, Object>> tempMap = new HashMap<String, Map<String, Object>>();
  892 + List<Map<String, Object>> removeList = new ArrayList<Map<String, Object>>();
  893 + for(Map<String, Object> m : mapList){
  894 + if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0
  895 + && m.get("gsName").toString().trim().contains("临港")){
  896 + removeList.add(m);
  897 + }
  898 + }
  899 + for(Map<String, Object> m : removeList){
  900 + mapList.remove(m);
  901 + }
892 for(Map<String, Object> m : mapList){ 902 for(Map<String, Object> m : mapList){
893 if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0){ 903 if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0){
894 String gsName = m.get("gsName").toString().trim(); 904 String gsName = m.get("gsName").toString().trim();
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
@@ -118,6 +118,8 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L @@ -118,6 +118,8 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
118 118
119 List<Map<String,Object>> statisticsDaily(String line, String date, String xlName, String type); 119 List<Map<String,Object>> statisticsDaily(String line, String date, String xlName, String type);
120 120
  121 + List<Map<String,Object>> dispatchDailySum(String date, String nature, String type);
  122 +
121 List<Map<String,Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type,String nature); 123 List<Map<String,Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, String xlName, String type,String nature);
122 124
123 //用于实时数据与统计数据合并查询 125 //用于实时数据与统计数据合并查询
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -2952,6 +2952,189 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2952,6 +2952,189 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2952 } 2952 }
2953 return map; 2953 return map;
2954 } 2954 }
  2955 +
  2956 + @Override
  2957 + public List<Map<String, Object>> dispatchDailySum(String date, String nature, String type) {
  2958 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  2959 +
  2960 + List<Map<String, Object>> list = statisticsDailyTj("", "", "", date, date, "", "query", nature);
  2961 +
  2962 + Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>();
  2963 + Map<String, Object> temp = new HashMap<String, Object>();
  2964 + temp.put("gsName", "杨高");temp.put("fgsName", "杨高分");temp.put("key", "05_5");
  2965 + resList.add(temp);keyMap.put("05_5", temp);
  2966 + temp = new HashMap<String, Object>();
  2967 + temp.put("gsName", "杨高");temp.put("fgsName", "金桥分");temp.put("key", "05_2");
  2968 + resList.add(temp);keyMap.put("05_2", temp);
  2969 + temp = new HashMap<String, Object>();
  2970 + temp.put("gsName", "杨高");temp.put("fgsName", "川沙分");temp.put("key", "05_1");
  2971 + resList.add(temp);keyMap.put("05_1", temp);
  2972 + temp = new HashMap<String, Object>();
  2973 + temp.put("gsName", "杨高");temp.put("fgsName", "周浦分");temp.put("key", "05_6");
  2974 + resList.add(temp);keyMap.put("05_6", temp);
  2975 + temp = new HashMap<String, Object>();
  2976 + temp.put("gsName", "杨高");temp.put("fgsName", "小计");temp.put("key", "05_sum");
  2977 + resList.add(temp);keyMap.put("05_sum", temp);
  2978 +
  2979 + temp = new HashMap<String, Object>();
  2980 + temp.put("gsName", "上南");temp.put("fgsName", "一分");temp.put("key", "55_4");
  2981 + resList.add(temp);keyMap.put("55_4", temp);
  2982 + temp = new HashMap<String, Object>();
  2983 + temp.put("gsName", "上南");temp.put("fgsName", "二分");temp.put("key", "55_1");
  2984 + resList.add(temp);keyMap.put("55_1", temp);
  2985 + temp = new HashMap<String, Object>();
  2986 + temp.put("gsName", "上南");temp.put("fgsName", "三分");temp.put("key", "55_2");
  2987 + resList.add(temp);keyMap.put("55_2", temp);
  2988 + temp = new HashMap<String, Object>();
  2989 + temp.put("gsName", "上南");temp.put("fgsName", "六分");temp.put("key", "55_3");
  2990 + resList.add(temp);keyMap.put("55_3", temp);
  2991 + temp = new HashMap<String, Object>();
  2992 + temp.put("gsName", "上南");temp.put("fgsName", "小计");temp.put("key", "55_sum");
  2993 + resList.add(temp);keyMap.put("55_sum", temp);
  2994 +
  2995 + temp = new HashMap<String, Object>();
  2996 + temp.put("gsName", "金高");temp.put("fgsName", "一分");temp.put("key", "22_5");
  2997 + resList.add(temp);keyMap.put("22_5", temp);
  2998 + temp = new HashMap<String, Object>();
  2999 + temp.put("gsName", "金高");temp.put("fgsName", "二分");temp.put("key", "22_2");
  3000 + resList.add(temp);keyMap.put("22_2", temp);
  3001 + temp = new HashMap<String, Object>();
  3002 + temp.put("gsName", "金高");temp.put("fgsName", "三分");temp.put("key", "22_3");
  3003 + resList.add(temp);keyMap.put("22_3", temp);
  3004 + temp = new HashMap<String, Object>();
  3005 + temp.put("gsName", "金高");temp.put("fgsName", "四分");temp.put("key", "22_1");
  3006 + resList.add(temp);keyMap.put("22_1", temp);
  3007 + temp = new HashMap<String, Object>();
  3008 + temp.put("gsName", "金高");temp.put("fgsName", "小计");temp.put("key", "22_sum");
  3009 + resList.add(temp);keyMap.put("22_sum", temp);
  3010 +
  3011 + temp = new HashMap<String, Object>();
  3012 + temp.put("gsName", "南汇");temp.put("fgsName", "一分");temp.put("key", "26_1");
  3013 + resList.add(temp);keyMap.put("26_1", temp);
  3014 + temp = new HashMap<String, Object>();
  3015 + temp.put("gsName", "南汇");temp.put("fgsName", "二分");temp.put("key", "26_2");
  3016 + resList.add(temp);keyMap.put("26_2", temp);
  3017 + temp = new HashMap<String, Object>();
  3018 + temp.put("gsName", "南汇");temp.put("fgsName", "三分");temp.put("key", "26_3");
  3019 + resList.add(temp);keyMap.put("26_3", temp);
  3020 + temp = new HashMap<String, Object>();
  3021 + temp.put("gsName", "南汇");temp.put("fgsName", "六分");temp.put("key", "26_6");
  3022 + resList.add(temp);keyMap.put("26_6", temp);
  3023 + temp = new HashMap<String, Object>();
  3024 + temp.put("gsName", "南汇");temp.put("fgsName", "小计");temp.put("key", "26_sum");
  3025 + resList.add(temp);keyMap.put("26_sum", temp);
  3026 +
  3027 + temp = new HashMap<String, Object>();
  3028 + temp.put("gsName", "浦交");temp.put("fgsName", " ");temp.put("key", "88");
  3029 + resList.add(temp);keyMap.put("88", temp);
  3030 +
  3031 + for(Map<String, Object> m : list){
  3032 + if(m.get("gsBm") != null && m.get("fgsBm") != null
  3033 + && m.get("gsBm").toString().trim().length() > 0
  3034 + && m.get("fgsBm").toString().trim().length() > 0){
  3035 + String gsBm = m.get("gsBm").toString().trim();
  3036 + String fgsBm = m.get("fgsBm").toString().trim();
  3037 + String key = gsBm + "_" + fgsBm;
  3038 + if(keyMap.containsKey(key)){
  3039 + Map<String, Object> t = keyMap.get(key);
  3040 + for(String s : m.keySet()){
  3041 + if("gsName,fgsName,key".contains(s)){
  3042 + continue;
  3043 + }
  3044 + try {
  3045 + if(t.containsKey(s)){
  3046 + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString())));
  3047 + } else {
  3048 + t.put(s, m.get(s).toString());
  3049 + }
  3050 + } catch (Exception e) {
  3051 + // TODO: handle exception
  3052 + continue;
  3053 + }
  3054 + }
  3055 + }
  3056 + }
  3057 + }
  3058 +
  3059 + for(Map<String, Object> m : resList){
  3060 + String key = m.get("key").toString();
  3061 + if(key.contains("_sum") || key.equals("88")){
  3062 + continue;
  3063 + }
  3064 +
  3065 + Map<String, Object> t = keyMap.get(key.split("_")[0] + "_sum");
  3066 + for(String s : m.keySet()){
  3067 + if("gsName,fgsName,key".contains(s)){
  3068 + continue;
  3069 + }
  3070 + try {
  3071 + if(t.containsKey(s)){
  3072 + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString())));
  3073 + } else {
  3074 + t.put(s, m.get(s).toString());
  3075 + }
  3076 + } catch (Exception e) {
  3077 + // TODO: handle exception
  3078 + continue;
  3079 + }
  3080 + }
  3081 +
  3082 + t = keyMap.get("88");
  3083 + for(String s : m.keySet()){
  3084 + if("gsName,fgsName,key".contains(s)){
  3085 + continue;
  3086 + }
  3087 + try {
  3088 + if(t.containsKey(s)){
  3089 + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString())));
  3090 + } else {
  3091 + t.put(s, m.get(s).toString());
  3092 + }
  3093 + } catch (Exception e) {
  3094 + // TODO: handle exception
  3095 + continue;
  3096 + }
  3097 + }
  3098 + }
  3099 +
  3100 + for(Map<String, Object> m : resList){
  3101 + try {
  3102 + m.put("ljzgl", new BigDecimal(m.get("ljgl").toString()).add(new BigDecimal(m.get("ljks").toString())));
  3103 + } catch (Exception e) {
  3104 + // TODO: handle exception
  3105 + m.put("ljzgl", "");
  3106 + continue;
  3107 + }
  3108 + }
  3109 +
  3110 + if (type != null && type.length() != 0 && type.equals("export")) {
  3111 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  3112 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  3113 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  3114 + Map<String, Object> m = new HashMap<String, Object>();
  3115 + m.put("date", date);
  3116 + ReportUtils ee = new ReportUtils();
  3117 + try {
  3118 + String dateTime = "";
  3119 +// if (date.equals(date2)) {
  3120 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  3121 +// } else {
  3122 +// dateTime = sdfSimple.format(sdfMonth.parse(date))
  3123 +// + "-" + sdfSimple.format(sdfMonth.parse(date2));
  3124 +// }
  3125 + listI.add(resList.iterator());
  3126 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  3127 + ee.excelReplace(listI, new Object[]{m}, path + "mould/dispatchDailySum.xls",
  3128 + path + "export/" + dateTime + "-调度日报汇总表.xls");
  3129 + } catch (Exception e) {
  3130 + // TODO: handle exception
  3131 + //e.printStackTrace();
  3132 + logger.info("", e);
  3133 + }
  3134 + }
  3135 +
  3136 + return resList;
  3137 + }
2955 3138
2956 @Override 3139 @Override
2957 public List<Map<String, Object>> statisticsDailyTj(String gsdm, String fgsdm, String line, String date, String date2, 3140 public List<Map<String, Object>> statisticsDailyTj(String gsdm, String fgsdm, String line, String date, String date2,
@@ -3182,6 +3365,16 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3182,6 +3365,16 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3182 if (type != null && type.length() != 0 && type.equals("exportAll")) { 3365 if (type != null && type.length() != 0 && type.equals("exportAll")) {
3183 List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); 3366 List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
3184 Map<String, Map<String, Object>> tempMap = new HashMap<String, Map<String, Object>>(); 3367 Map<String, Map<String, Object>> tempMap = new HashMap<String, Map<String, Object>>();
  3368 + List<Map<String, Object>> removeList = new ArrayList<Map<String, Object>>();
  3369 + for(Map<String, Object> m : lMap){
  3370 + if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0
  3371 + && m.get("gsName").toString().trim().contains("临港")){
  3372 + removeList.add(m);
  3373 + }
  3374 + }
  3375 + for(Map<String, Object> m : removeList){
  3376 + lMap.remove(m);
  3377 + }
3185 for(Map<String, Object> m : lMap){ 3378 for(Map<String, Object> m : lMap){
3186 if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0){ 3379 if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0){
3187 String gsName = m.get("gsName").toString().trim(); 3380 String gsName = m.get("gsName").toString().trim();
src/main/java/com/bsth/service/report/ReportService.java
@@ -49,6 +49,8 @@ public interface ReportService { @@ -49,6 +49,8 @@ public interface ReportService {
49 49
50 List<Map<String, String>> userList(Map<String, Object> map); 50 List<Map<String, String>> userList(Map<String, Object> map);
51 51
  52 + List<Map<String, Object>> countMileageSum(Map<String, Object> map);
  53 +
52 List<Map<String, Object>> countByList(Map<String, Object> map); 54 List<Map<String, Object>> countByList(Map<String, Object> map);
53 List<Map<String, Object>> countByList2(Map<String, Object> map); 55 List<Map<String, Object>> countByList2(Map<String, Object> map);
54 56
src/main/java/com/bsth/service/report/impl/CalcSheetServiceImpl.java
@@ -1193,6 +1193,16 @@ public class CalcSheetServiceImpl extends BaseServiceImpl&lt;CalcSheet, Integer&gt; im @@ -1193,6 +1193,16 @@ public class CalcSheetServiceImpl extends BaseServiceImpl&lt;CalcSheet, Integer&gt; im
1193 if (type.equals("exportAll")) { 1193 if (type.equals("exportAll")) {
1194 List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); 1194 List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
1195 Map<String, Map<String, Object>> tempKeyMap = new HashMap<String, Map<String, Object>>(); 1195 Map<String, Map<String, Object>> tempKeyMap = new HashMap<String, Map<String, Object>>();
  1196 + List<Map<String, Object>> removeList = new ArrayList<Map<String, Object>>();
  1197 + for(Map<String, Object> m : list){
  1198 + if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0
  1199 + && m.get("gsName").toString().trim().contains("临港")){
  1200 + removeList.add(m);
  1201 + }
  1202 + }
  1203 + for(Map<String, Object> m : removeList){
  1204 + list.remove(m);
  1205 + }
1196 for(Map<String, Object> m : list){ 1206 for(Map<String, Object> m : list){
1197 if(m.get("gsName")!=null && m.get("gsName").toString().trim().length() > 0){ 1207 if(m.get("gsName")!=null && m.get("gsName").toString().trim().length() > 0){
1198 Map<String, Object> temp = new HashMap<String, Object>(); 1208 Map<String, Object> temp = new HashMap<String, Object>();
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
@@ -17,6 +17,7 @@ import com.bsth.entity.sys.Interval; @@ -17,6 +17,7 @@ import com.bsth.entity.sys.Interval;
17 import com.bsth.repository.LineRepository; 17 import com.bsth.repository.LineRepository;
18 import com.bsth.repository.StationRouteRepository; 18 import com.bsth.repository.StationRouteRepository;
19 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 19 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  20 +import com.bsth.service.LineService;
20 import com.bsth.service.calc.CalcWaybillService; 21 import com.bsth.service.calc.CalcWaybillService;
21 import com.bsth.service.report.CulateMileageService; 22 import com.bsth.service.report.CulateMileageService;
22 import com.bsth.service.report.ReportService; 23 import com.bsth.service.report.ReportService;
@@ -38,6 +39,7 @@ import org.springframework.jdbc.core.RowMapper; @@ -38,6 +39,7 @@ import org.springframework.jdbc.core.RowMapper;
38 import org.springframework.stereotype.Service; 39 import org.springframework.stereotype.Service;
39 40
40 import java.io.FileOutputStream; 41 import java.io.FileOutputStream;
  42 +import java.math.BigDecimal;
41 import java.sql.Connection; 43 import java.sql.Connection;
42 import java.sql.PreparedStatement; 44 import java.sql.PreparedStatement;
43 import java.sql.ResultSet; 45 import java.sql.ResultSet;
@@ -72,6 +74,8 @@ public class ReportServiceImpl implements ReportService{ @@ -72,6 +74,8 @@ public class ReportServiceImpl implements ReportService{
72 @Autowired 74 @Autowired
73 CulateMileageService culateService; 75 CulateMileageService culateService;
74 @Autowired 76 @Autowired
  77 + LineService lineService;
  78 + @Autowired
75 LineRepository lineRepository; 79 LineRepository lineRepository;
76 @Autowired 80 @Autowired
77 StationRouteRepository stationRouteRepository; 81 StationRouteRepository stationRouteRepository;
@@ -2509,6 +2513,197 @@ public class ReportServiceImpl implements ReportService{ @@ -2509,6 +2513,197 @@ public class ReportServiceImpl implements ReportService{
2509 List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd); 2513 List<StationRoute> listStation= stationRouteRepository.findByLine(line,zd);
2510 return listStation; 2514 return listStation;
2511 } 2515 }
  2516 +
  2517 + @Override
  2518 + public List<Map<String, Object>> countMileageSum(Map<String, Object> map) {
  2519 + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
  2520 +
  2521 + String date="";
  2522 + if(map.get("date")!=null){
  2523 + date=map.get("date").toString();
  2524 + }
  2525 + String nature="0";
  2526 + if(map.get("nature")!=null){
  2527 + nature=map.get("nature").toString();
  2528 + }
  2529 + String type="";
  2530 + if(map.get("type")!=null){
  2531 + type=map.get("type").toString();
  2532 + }
  2533 + Map<String, Object> param = new HashMap<String, Object>();
  2534 + param.put("date", date);
  2535 + param.put("date2", date);
  2536 + param.put("nature", nature);
  2537 + param.put("type", "query");
  2538 + List<Map<String, Object>> list = countByList(param);
  2539 +
  2540 + Map<String, Map<String, Object>> keyMap = new HashMap<String, Map<String, Object>>();
  2541 + Map<String, Object> temp = new HashMap<String, Object>();
  2542 + temp.put("gsName", "杨高");temp.put("fgsName", "杨高分");temp.put("key", "05_5");
  2543 + resList.add(temp);keyMap.put("05_5", temp);
  2544 + temp = new HashMap<String, Object>();
  2545 + temp.put("gsName", "杨高");temp.put("fgsName", "金桥分");temp.put("key", "05_2");
  2546 + resList.add(temp);keyMap.put("05_2", temp);
  2547 + temp = new HashMap<String, Object>();
  2548 + temp.put("gsName", "杨高");temp.put("fgsName", "川沙分");temp.put("key", "05_1");
  2549 + resList.add(temp);keyMap.put("05_1", temp);
  2550 + temp = new HashMap<String, Object>();
  2551 + temp.put("gsName", "杨高");temp.put("fgsName", "周浦分");temp.put("key", "05_6");
  2552 + resList.add(temp);keyMap.put("05_6", temp);
  2553 + temp = new HashMap<String, Object>();
  2554 + temp.put("gsName", "杨高");temp.put("fgsName", "小计");temp.put("key", "05_sum");
  2555 + resList.add(temp);keyMap.put("05_sum", temp);
  2556 +
  2557 + temp = new HashMap<String, Object>();
  2558 + temp.put("gsName", "上南");temp.put("fgsName", "一分");temp.put("key", "55_4");
  2559 + resList.add(temp);keyMap.put("55_4", temp);
  2560 + temp = new HashMap<String, Object>();
  2561 + temp.put("gsName", "上南");temp.put("fgsName", "二分");temp.put("key", "55_1");
  2562 + resList.add(temp);keyMap.put("55_1", temp);
  2563 + temp = new HashMap<String, Object>();
  2564 + temp.put("gsName", "上南");temp.put("fgsName", "三分");temp.put("key", "55_2");
  2565 + resList.add(temp);keyMap.put("55_2", temp);
  2566 + temp = new HashMap<String, Object>();
  2567 + temp.put("gsName", "上南");temp.put("fgsName", "六分");temp.put("key", "55_3");
  2568 + resList.add(temp);keyMap.put("55_3", temp);
  2569 + temp = new HashMap<String, Object>();
  2570 + temp.put("gsName", "上南");temp.put("fgsName", "小计");temp.put("key", "55_sum");
  2571 + resList.add(temp);keyMap.put("55_sum", temp);
  2572 +
  2573 + temp = new HashMap<String, Object>();
  2574 + temp.put("gsName", "金高");temp.put("fgsName", "一分");temp.put("key", "22_5");
  2575 + resList.add(temp);keyMap.put("22_5", temp);
  2576 + temp = new HashMap<String, Object>();
  2577 + temp.put("gsName", "金高");temp.put("fgsName", "二分");temp.put("key", "22_2");
  2578 + resList.add(temp);keyMap.put("22_2", temp);
  2579 + temp = new HashMap<String, Object>();
  2580 + temp.put("gsName", "金高");temp.put("fgsName", "三分");temp.put("key", "22_3");
  2581 + resList.add(temp);keyMap.put("22_3", temp);
  2582 + temp = new HashMap<String, Object>();
  2583 + temp.put("gsName", "金高");temp.put("fgsName", "四分");temp.put("key", "22_1");
  2584 + resList.add(temp);keyMap.put("22_1", temp);
  2585 + temp = new HashMap<String, Object>();
  2586 + temp.put("gsName", "金高");temp.put("fgsName", "小计");temp.put("key", "22_sum");
  2587 + resList.add(temp);keyMap.put("22_sum", temp);
  2588 +
  2589 + temp = new HashMap<String, Object>();
  2590 + temp.put("gsName", "南汇");temp.put("fgsName", "一分");temp.put("key", "26_1");
  2591 + resList.add(temp);keyMap.put("26_1", temp);
  2592 + temp = new HashMap<String, Object>();
  2593 + temp.put("gsName", "南汇");temp.put("fgsName", "二分");temp.put("key", "26_2");
  2594 + resList.add(temp);keyMap.put("26_2", temp);
  2595 + temp = new HashMap<String, Object>();
  2596 + temp.put("gsName", "南汇");temp.put("fgsName", "三分");temp.put("key", "26_3");
  2597 + resList.add(temp);keyMap.put("26_3", temp);
  2598 + temp = new HashMap<String, Object>();
  2599 + temp.put("gsName", "南汇");temp.put("fgsName", "六分");temp.put("key", "26_6");
  2600 + resList.add(temp);keyMap.put("26_6", temp);
  2601 + temp = new HashMap<String, Object>();
  2602 + temp.put("gsName", "南汇");temp.put("fgsName", "小计");temp.put("key", "26_sum");
  2603 + resList.add(temp);keyMap.put("26_sum", temp);
  2604 +
  2605 + temp = new HashMap<String, Object>();
  2606 + temp.put("gsName", "浦交");temp.put("fgsName", " ");temp.put("key", "88");
  2607 + resList.add(temp);keyMap.put("88", temp);
  2608 +
  2609 + for(Map<String, Object> m : list){
  2610 + if(m.get("gsBm") != null && m.get("fgsBm") != null
  2611 + && m.get("gsBm").toString().trim().length() > 0
  2612 + && m.get("fgsBm").toString().trim().length() > 0){
  2613 + String gsBm = m.get("gsBm").toString().trim();
  2614 + String fgsBm = m.get("fgsBm").toString().trim();
  2615 + String key = gsBm + "_" + fgsBm;
  2616 + if(keyMap.containsKey(key)){
  2617 + Map<String, Object> t = keyMap.get(key);
  2618 + for(String s : m.keySet()){
  2619 + if("gsName,fgsName,key".contains(s)){
  2620 + continue;
  2621 + }
  2622 + try {
  2623 + if(t.containsKey(s)){
  2624 + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString())));
  2625 + } else {
  2626 + t.put(s, m.get(s).toString());
  2627 + }
  2628 + } catch (Exception e) {
  2629 + // TODO: handle exception
  2630 + continue;
  2631 + }
  2632 + }
  2633 + }
  2634 + }
  2635 + }
  2636 +
  2637 + for(Map<String, Object> m : resList){
  2638 + String key = m.get("key").toString();
  2639 + if(key.contains("_sum") || key.equals("88")){
  2640 + continue;
  2641 + }
  2642 +
  2643 + Map<String, Object> t = keyMap.get(key.split("_")[0] + "_sum");
  2644 + for(String s : m.keySet()){
  2645 + if("gsName,fgsName,key".contains(s)){
  2646 + continue;
  2647 + }
  2648 + try {
  2649 + if(t.containsKey(s)){
  2650 + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString())));
  2651 + } else {
  2652 + t.put(s, m.get(s).toString());
  2653 + }
  2654 + } catch (Exception e) {
  2655 + // TODO: handle exception
  2656 + continue;
  2657 + }
  2658 + }
  2659 +
  2660 + t = keyMap.get("88");
  2661 + for(String s : m.keySet()){
  2662 + if("gsName,fgsName,key".contains(s)){
  2663 + continue;
  2664 + }
  2665 + try {
  2666 + if(t.containsKey(s)){
  2667 + t.put(s, new BigDecimal(t.get(s).toString()).add(new BigDecimal(m.get(s).toString())));
  2668 + } else {
  2669 + t.put(s, m.get(s).toString());
  2670 + }
  2671 + } catch (Exception e) {
  2672 + // TODO: handle exception
  2673 + continue;
  2674 + }
  2675 + }
  2676 + }
  2677 +
  2678 + if(type.equals("export")){
  2679 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  2680 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  2681 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  2682 + Map<String, Object> m = new HashMap<String, Object>();
  2683 + m.put("date", date);
  2684 + String xls="countMileageSum.xls";
  2685 + ReportUtils ee = new ReportUtils();
  2686 + try {
  2687 + String dateTime = "";
  2688 +// if(date.equals(date2)){
  2689 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  2690 +// } else {
  2691 +// dateTime = sdfSimple.format(sdfMonth.parse(date))
  2692 +// +"-"+sdfSimple.format(sdfMonth.parse(date2));
  2693 +// }
  2694 + listI.add(resList.iterator());
  2695 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  2696 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  2697 + path + "export/"+dateTime+"-审计公里汇总表.xls");
  2698 + } catch (Exception e) {
  2699 + // TODO: handle exception
  2700 + e.printStackTrace();
  2701 + }
  2702 + }
  2703 +
  2704 + return resList;
  2705 + }
  2706 +
2512 @Override 2707 @Override
2513 public List<Map<String, Object>> countByList(Map<String, Object> map) { 2708 public List<Map<String, Object>> countByList(Map<String, Object> map) {
2514 // TODO Auto-generated method stub 2709 // TODO Auto-generated method stub
@@ -2538,6 +2733,10 @@ public class ReportServiceImpl implements ReportService{ @@ -2538,6 +2733,10 @@ public class ReportServiceImpl implements ReportService{
2538 if(map.get("xlName")!=null){ 2733 if(map.get("xlName")!=null){
2539 xlName=map.get("xlName").toString(); 2734 xlName=map.get("xlName").toString();
2540 } 2735 }
  2736 + String nature="0";
  2737 + if(map.get("nature")!=null){
  2738 + nature=map.get("nature").toString();
  2739 + }
2541 String type=""; 2740 String type="";
2542 if(map.get("type")!=null){ 2741 if(map.get("type")!=null){
2543 type=map.get("type").toString(); 2742 type=map.get("type").toString();
@@ -2545,7 +2744,9 @@ public class ReportServiceImpl implements ReportService{ @@ -2545,7 +2744,9 @@ public class ReportServiceImpl implements ReportService{
2545 //所有班次信息 2744 //所有班次信息
2546 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); 2745 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
2547 line =line.trim(); 2746 line =line.trim();
2548 - if(line.equals("")){ 2747 + if(gsdm.equals("") && fgsdm.equals("") && line.equals("")){
  2748 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj3(date, date2);
  2749 + } else if(line.equals("")){
2549 //查询所有线路 2750 //查询所有线路
2550 list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm); 2751 list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
2551 }else{ 2752 }else{
@@ -2553,20 +2754,28 @@ public class ReportServiceImpl implements ReportService{ @@ -2553,20 +2754,28 @@ public class ReportServiceImpl implements ReportService{
2553 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); 2754 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
2554 } 2755 }
2555 2756
  2757 + Map<String, Boolean> lineMap = lineService.lineNature();
  2758 +
  2759 + List<String> objList = new ArrayList<String>();
2556 String sql="select r.xl_bm" 2760 String sql="select r.xl_bm"
2557 + " from bsth_c_s_sp_info_real r where" 2761 + " from bsth_c_s_sp_info_real r where"
2558 - + " r.schedule_date_str BETWEEN '"+date+"' and '"+date2+"'";  
2559 -  
2560 -  
2561 - if(line.equals("")){  
2562 - sql +="and r.gs_bm='"+gsdm+"' "  
2563 - + " and r.fgs_bm='"+fgsdm+"'"; 2762 + + " r.schedule_date_str BETWEEN ? and ?";
  2763 + objList.add(date);
  2764 + objList.add(date2);
  2765 + if("".equals(gsdm.trim()) && "".equals(fgsdm.trim()) && "".equals(line.trim())){
  2766 +
  2767 + } else if(line.equals("")){
  2768 + sql +=" and r.gs_bm=?"
  2769 + + " and r.fgs_bm like CONCAT('%',?,'%')";
  2770 + objList.add(gsdm);
  2771 + objList.add(fgsdm);
2564 }else{ 2772 }else{
2565 - sql += " and r.xl_bm = '"+line+"'"; 2773 + sql += " and r.xl_bm = ?";
  2774 + objList.add(line);
2566 } 2775 }
2567 sql += " group by r.xl_bm"; 2776 sql += " group by r.xl_bm";
2568 2777
2569 - List<String> listLine=jdbcTemplate.query(sql, new RowMapper<String>() { 2778 + List<String> listLine=jdbcTemplate.query(sql, objList.toArray(), new RowMapper<String>() {
2570 @Override 2779 @Override
2571 public String mapRow(ResultSet arg0, int arg1) throws SQLException { 2780 public String mapRow(ResultSet arg0, int arg1) throws SQLException {
2572 String ve = arg0.getString("xl_bm"); 2781 String ve = arg0.getString("xl_bm");
@@ -2576,6 +2785,18 @@ public class ReportServiceImpl implements ReportService{ @@ -2576,6 +2785,18 @@ public class ReportServiceImpl implements ReportService{
2576 for (int i = 0; i < listLine.size(); i++) { 2785 for (int i = 0; i < listLine.size(); i++) {
2577 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); 2786 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2578 String lineStr=listLine.get(i); 2787 String lineStr=listLine.get(i);
  2788 + if("0".equals(nature)){ // 全部
  2789 +
  2790 + } else if("1".equals(nature)){ // 营运
  2791 + if(!(lineMap.containsKey(lineStr) && lineMap.get(lineStr))){
  2792 + continue;
  2793 + }
  2794 + } else { // 非营运
  2795 + if(lineMap.containsKey(lineStr) && lineMap.get(lineStr)){
  2796 + continue;
  2797 + }
  2798 + }
  2799 +
2579 for (int j = 0; j < list.size(); j++) { 2800 for (int j = 0; j < list.size(); j++) {
2580 ScheduleRealInfo s=list.get(j); 2801 ScheduleRealInfo s=list.get(j);
2581 if(s.getXlBm().equals(lineStr)){ 2802 if(s.getXlBm().equals(lineStr)){
@@ -2756,6 +2977,8 @@ public class ReportServiceImpl implements ReportService{ @@ -2756,6 +2977,8 @@ public class ReportServiceImpl implements ReportService{
2756 map.put("fgs", ""); 2977 map.put("fgs", "");
2757 }else{ 2978 }else{
2758 map.put("xlName", list.get(0).getXlName()); 2979 map.put("xlName", list.get(0).getXlName());
  2980 + map.put("gsBm", list.get(0).getGsBm());
  2981 + map.put("fgsBm", list.get(0).getFgsBm());
2759 map.put("gs", list.get(0).getGsName()); 2982 map.put("gs", list.get(0).getGsName());
2760 map.put("fgs", list.get(0).getFgsName()); 2983 map.put("fgs", list.get(0).getFgsName());
2761 map.put("jGh", list.get(0).getjGh()); 2984 map.put("jGh", list.get(0).getjGh());
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
@@ -1973,6 +1973,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1973,6 +1973,16 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1973 } else if(type.equals("exportAll")){ 1973 } else if(type.equals("exportAll")){
1974 List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>(); 1974 List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
1975 Map<String, Map<String, Object>> tempKeyMap = new HashMap<String, Map<String, Object>>(); 1975 Map<String, Map<String, Object>> tempKeyMap = new HashMap<String, Map<String, Object>>();
  1976 + List<Map<String, Object>> removeList = new ArrayList<Map<String, Object>>();
  1977 + for(Map<String, Object> m : resList){
  1978 + if(m.get("gsName") != null && m.get("gsName").toString().trim().length() > 0
  1979 + && m.get("gsName").toString().trim().contains("临港")){
  1980 + removeList.add(m);
  1981 + }
  1982 + }
  1983 + for(Map<String, Object> m : removeList){
  1984 + resList.remove(m);
  1985 + }
1976 for(Map<String, Object> m : resList){ 1986 for(Map<String, Object> m : resList){
1977 if(m.get("company")!=null && m.get("company").toString().trim().length() > 0){ 1987 if(m.get("company")!=null && m.get("company").toString().trim().length() > 0){
1978 Map<String, Object> temp = new HashMap<String, Object>(); 1988 Map<String, Object> temp = new HashMap<String, Object>();
src/main/resources/static/pages/forms/mould/countMileageSum.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/mould/dispatchDailySum.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/dispatchDailySum.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +
  18 + #forms > thead > tr> td >span{
  19 + width: 5px;
  20 + word-wrap: break-word;
  21 + letter-spacing: 20px;
  22 + }
  23 +
  24 + #forms > thead > tr> td >label{
  25 + word-break: keep-all;white-space:nowrap;
  26 + }
  27 +</style>
  28 +
  29 +<div class="page-head">
  30 + <div class="page-title">
  31 + <h1>调度日报汇总表</h1>
  32 + </div>
  33 +</div>
  34 +
  35 +<!-- <div class="row"> -->
  36 + <div class="col-md-12 portlet light porttlet-fit bordered" style="height:calc(100% - 56px)">
  37 +<!-- <div> -->
  38 + <div class="portlet-title">
  39 + <form class="form-inline" action="">
  40 + <div style="display: inline-block;">
  41 + <span class="item-label" style="width: 80px;">线路性质: </span>
  42 + <select
  43 + class="form-control" name="nature" id="nature"
  44 + style="width: 180px;">
  45 + <option value="0">全部线路</option>
  46 + <option value="1" selected="selected">营运线路</option>
  47 + <option value="2">非营运线路</option>
  48 + </select>
  49 + </div>
  50 + <div style="display: inline-block;margin-left: 15px;">
  51 + <span class="item-label" style="width: 80px;">营运日期: </span>
  52 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  53 + </div>
  54 + <div class="form-group">
  55 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  56 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  57 + </div>
  58 + </form>
  59 + </div>
  60 + <div class="portlet-body" id="tjrbBody" style="overflow:auto;height: calc(100% - 80px)">
  61 + <div class="table-container" style="margin-top: 10px;min-width: 906px">
  62 + <label>日期:<span id="rqxs"></span>&nbsp;&nbsp;&nbsp;&nbsp;早高峰:6:31~8:30&nbsp;&nbsp;&nbsp;&nbsp;晚高峰:16:01~18:00</label>
  63 + <table class="table table-bordered table-hover table-checkable" id="forms">
  64 + <thead>
  65 + <tr>
  66 + <th colspan="45"><label id="tjrq"></label> 调度日报汇总表</th>
  67 + </tr>
  68 + <tr>
  69 + <td rowspan="3"><span >公司</span></td>
  70 + <td rowspan="3"><span >分公司</span></td>
  71 + <td colspan="21">全日营运里程(公里)</td>
  72 + <td colspan="15">全日营运班次</td>
  73 + <td colspan="9">大间隔情况</td>
  74 + </tr>
  75 + <tr>
  76 + <td rowspan="2"><label>计划总<br/>公里</label></td>
  77 + <td rowspan="2"><label>计划营</label><label>运公里</label></td>
  78 + <td rowspan="2"><label>计划空</label><label>驶公里</label></td>
  79 + <td rowspan="2"><label>实际</label><label>总公里</label></td>
  80 + <td rowspan="2"><label>实际营</label><label>运公里</label></td>
  81 + <td rowspan="2"><label>实际空</label><label>驶公里</label></td>
  82 + <td rowspan="2"><span>少驶班次</span></td>
  83 + <td rowspan="2"><span>少驶公里</span></td>
  84 + <td colspan="11">少驶原因(公里)</td>
  85 + <td colspan="2">临加公里</td>
  86 + <td colspan="3">计划班次</td>
  87 + <td colspan="3">实际班次</td>
  88 + <td colspan="3">临加班次</td>
  89 + <td colspan="3">放站班次</td>
  90 + <td colspan="3">调头班次</td>
  91 + <td colspan="3">发生次数</td>
  92 + <td rowspan="2">最大间隔时间(分)</td>
  93 + <td rowspan="2">原因</td>
  94 + </tr>
  95 + <tr>
  96 + <td><span>路阻</span></td>
  97 + <td><span>吊慢</span></td>
  98 + <td><span>故障</span></td>
  99 + <td><span>纠纷</span></td>
  100 + <td><span>肇事</span></td>
  101 + <td><span>缺人</span></td>
  102 + <td><span>缺车</span></td>
  103 + <td><span>客稀</span></td>
  104 + <td><span>气候</span></td>
  105 + <td><span>援外</span></td>
  106 + <td><span>其他</span></td>
  107 + <td><span>营运</span></td>
  108 + <td><span>空驶</span></td>
  109 + <td><span>全日</span></td>
  110 + <td><span>早高峰</span></td>
  111 + <td><span>晚高峰</span></td>
  112 + <td><span>全日</span></td>
  113 + <td><span>早高峰</span></td>
  114 + <td><span>晚高峰</span></td>
  115 + <td><span>全日</span></td>
  116 + <td><span>早高峰</span></td>
  117 + <td><span>晚高峰</span></td>
  118 + <td><span>全日</span></td>
  119 + <td><span>早高峰</span></td>
  120 + <td><span>晚高峰</span></td>
  121 + <td><span>全日</span></td>
  122 + <td><span>早高峰</span></td>
  123 + <td><span>晚高峰</span></td>
  124 + <td><span>全日</span></td>
  125 + <td><span>早高峰</span></td>
  126 + <td><span>晚高峰</span></td>
  127 + </tr>
  128 + </thead>
  129 + <tbody class="dispatch_daily_sum">
  130 +
  131 + </tbody>
  132 + </table>
  133 + </div>
  134 + </div>
  135 + </div>
  136 +
  137 +<script>
  138 + $(function(){
  139 +// $('#export').attr('disabled', "true");
  140 +
  141 + // 关闭左侧栏
  142 + if (!$('body').hasClass('page-sidebar-closed'))
  143 + $('.menu-toggler.sidebar-toggler').click();
  144 + var d = new Date();
  145 + var year = d.getFullYear();
  146 + var month = d.getMonth() + 1;
  147 + var day = d.getDate();
  148 + if(month < 10)
  149 + month = "0" + month;
  150 + if(day < 10)
  151 + day = "0" + day;
  152 +
  153 + var dateTime=year + "-" + month + "-" + day;
  154 + $("#date").val(dateTime);
  155 +// $("#date2").val(dateTime);
  156 + $("#date").datetimepicker({
  157 + format : 'YYYY-MM-DD',
  158 + locale : 'zh-cn',
  159 + maxDate : dateTime
  160 + });
  161 +
  162 + var date = "";
  163 + var nature="";
  164 + var time1="";
  165 + var time2="";
  166 + $("#query").on("click",function(){
  167 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  168 + layer.msg("请选择日期!");
  169 + return;
  170 + }
  171 + date = $("#date").val();
  172 + nature=$("#nature").val();
  173 +// time1 = Date.parse(new Date(date));
  174 +// time2 = Date.parse(new Date(date2));
  175 +// if(date==null || date =="" ||date2==null || date2 ==""){
  176 +// layer.msg('请选择时间段.');
  177 +// }else if(time2<time1){
  178 +// layer.msg('结束日期不能小于开始日期.');
  179 +// }else{
  180 +// if((time2-time1)>2678400000){
  181 +// layer.msg('查询超过一个月请点击【统计查询】.');
  182 +// }else{
  183 + $("#tjrq").html(date);
  184 + $("#rqxs").html(date);
  185 + var params = {};
  186 + params['date'] = date;
  187 + params['nature'] = nature;
  188 + params['type'] = "query";
  189 + var i = layer.load(2);
  190 + $get('/realSchedule/dispatchDailySum',params,function(result){
  191 + // 把数据填充到模版中
  192 + var tbodyHtml = template('dispatch_daily_sum',{list:result});
  193 + // 把渲染好的模版html文本追加到表格中
  194 + $('#forms .dispatch_daily_sum').html(tbodyHtml);
  195 + layer.close(i);
  196 +
  197 + if(result.length == 0){
  198 + $("#export").attr('disabled',"true");
  199 + }else{
  200 + $("#export").removeAttr("disabled");
  201 + }
  202 + });
  203 +// }
  204 +// }
  205 + });
  206 +
  207 +// $("#tjrbBody").height($(window).height()-100);
  208 + $("#export").on("click",function(){
  209 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  210 + layer.msg("请选择时间!");
  211 + return;
  212 + }
  213 + date = $("#date").val();
  214 + nature=$("#nature").val();
  215 + var params = {};
  216 + params['date'] = date;
  217 + params['nature'] = nature;
  218 + params['type'] = "export";
  219 +// if((time2-time1)>2678400000){
  220 +// layer.msg('查询超过一个月请点击【统计查询】.');
  221 +// }else{
  222 + var i = layer.load(2);
  223 + $get('/realSchedule/dispatchDailySum',params,function(result){
  224 + var dateTime = "";
  225 +// if(date == date2){
  226 + dateTime = moment(date).format("YYYYMMDD");
  227 +// } else {
  228 +// dateTime = moment(date).format("YYYYMMDD")
  229 +// +"-"+moment(date2).format("YYYYMMDD");
  230 +// }
  231 + window.open("/downloadFile/download?fileName="
  232 + +dateTime+"-调度日报汇总表");
  233 + layer.close(i);
  234 + });
  235 +// }
  236 + });
  237 +
  238 +
  239 + });
  240 +</script>
  241 +<script type="text/html" id="dispatch_daily_sum">
  242 + {{each list as obj i}}
  243 + <tr {{if obj.zt==1}}style='color: red'{{/if}}>
  244 + <td>{{obj.gsName}}</td>
  245 + <td>{{obj.fgsName}}</td>
  246 + <td>{{obj.jhzlc}}</td>
  247 + <td>{{obj.jhlc}}</td>
  248 + <td>{{obj.jcclc}}</td>
  249 + <td>{{obj.sjzgl}}</td>
  250 + <td>{{obj.sjgl}}</td>
  251 + <td>{{obj.sjksgl}}</td>
  252 + <td>{{obj.ssbc}}</td>
  253 + <td>{{obj.ssgl}}</td>
  254 + <td>{{obj.ssgl_lz}}</td>
  255 + <td>{{obj.ssgl_dm}}</td>
  256 + <td>{{obj.ssgl_gz}}</td>
  257 + <td>{{obj.ssgl_jf}}</td>
  258 + <td>{{obj.ssgl_zs}}</td>
  259 + <td>{{obj.ssgl_qr}}</td>
  260 + <td>{{obj.ssgl_qc}}</td>
  261 + <td>{{obj.ssgl_kx}}</td>
  262 + <td>{{obj.ssgl_qh}}</td>
  263 + <td>{{obj.ssgl_yw}}</td>
  264 + <td>{{obj.ssgl_other}}</td>
  265 + <td>{{obj.ljgl}}</td>
  266 + <td>{{obj.ljks}}</td>
  267 + <td>{{obj.jhbc}}</td>
  268 + <td>{{obj.jhbc_m}}</td>
  269 + <td>{{obj.jhbc_a}}</td>
  270 + <td>{{obj.sjbc}}</td>
  271 + <td>{{obj.sjbc_m}}</td>
  272 + <td>{{obj.sjbc_a}}</td>
  273 + <td>{{obj.ljbc}}</td>
  274 + <td>{{obj.ljbc_m}}</td>
  275 + <td>{{obj.ljbc_a}}</td>
  276 + <td>{{obj.fzbc}}</td>
  277 + <td>{{obj.fzbc_m}}</td>
  278 + <td>{{obj.fzbc_a}}</td>
  279 + <td>{{obj.dtbc}}</td>
  280 + <td>{{obj.dtbc_m}}</td>
  281 + <td>{{obj.dtbc_a}}</td>
  282 + <td>{{obj.djg}}</td>
  283 + <td>{{obj.djg_m}}</td>
  284 + <td>{{obj.djg_a}}</td>
  285 + <td>{{obj.djg_time}}</td>
  286 + <td>&nbsp;</td>
  287 + </tr>
  288 + {{/each}}
  289 + {{if list.length == 0}}
  290 + <tr>
  291 + <td colspan="44"><h6 class="muted">没有找到相关数据</h6></td>
  292 + </tr>
  293 + {{/if}}
  294 +</script>
0 \ No newline at end of file 295 \ No newline at end of file
src/main/resources/static/pages/report/countMileage/countLine/countMileageSum.html 0 → 100644
  1 +<style type="text/css">
  2 + .table-bordered {
  3 + border: 1px solid; }
  4 + .table-bordered > thead > tr > th,
  5 + .table-bordered > thead > tr > td,
  6 + .table-bordered > tbody > tr > th,
  7 + .table-bordered > tbody > tr > td,
  8 + .table-bordered > tfoot > tr > th,
  9 + .table-bordered > tfoot > tr > td {
  10 + border: 1px solid; }
  11 + .table-bordered > thead > tr > th,
  12 + .table-bordered > thead > tr > td {
  13 + border-bottom-width: 2px; }
  14 +
  15 + .table > tbody + tbody {
  16 + border-top: 1px solid; }
  17 +
  18 + #forms > thead > tr> td >span{
  19 + width: 5px;
  20 + word-wrap: break-word;
  21 + letter-spacing: 20px;
  22 + }
  23 +
  24 + #forms > thead > tr> td >label{
  25 + word-break: keep-all;white-space:nowrap;
  26 + }
  27 +</style>
  28 +
  29 +<div class="page-head">
  30 + <div class="page-title">
  31 + <h1>审计公里汇总表</h1>
  32 + </div>
  33 +</div>
  34 +
  35 +<div class="row">
  36 + <div class="col-md-12">
  37 + <div class="portlet light porttlet-fit bordered">
  38 + <div class="portlet-title">
  39 + <form class="form-inline" action="">
  40 + <div style="display: inline-block;">
  41 + <span class="item-label" style="width: 80px;">线路性质: </span>
  42 + <select
  43 + class="form-control" name="nature" id="nature"
  44 + style="width: 180px;">
  45 + <option value="0">全部线路</option>
  46 + <option value="1" selected="selected">营运线路</option>
  47 + <option value="2">非营运线路</option>
  48 + </select>
  49 + </div>
  50 + <div style="display: inline-block;margin-left: 15px;">
  51 + <span class="item-label" style="width: 80px;">营运日期: </span>
  52 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  53 + </div>
  54 + <div class="form-group">
  55 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  56 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  57 + </div>
  58 + </form>
  59 + </div>
  60 + <div class="portlet-body">
  61 + <div class="table-container" id="countLine" style="margin-top: 10px;overflow:auto;min-width: 906px">
  62 + <table class="table table-bordered table-hover table-checkable" id="forms">
  63 + <thead>
  64 + <tr>
  65 + <th colspan="30"><label id="datetodate"></label> 审计公里汇总表</th>
  66 + </tr>
  67 + <tr>
  68 + <td rowspan="2"><span>公司</span></td>
  69 + <td rowspan="2"><span>分公司</span></td>
  70 + <td rowspan="2"><label>计划</label><label>总公里</label></td>
  71 + <td rowspan="2"><label>计划营</label><label>运公里</label></td>
  72 + <td rowspan="2"><label>计划空</label><label>驶公里</label></td>
  73 + <td rowspan="2"><label>实际</label><label>总公里</label></td>
  74 + <td colspan="2"><label>实际营</label><label>运公里</label></td>
  75 + <td colspan="6"><label>实际空</label><label>驶公里</label></td>
  76 + <td rowspan="2"><label>少驶营</label><label>运里程</label></td>
  77 + <td colspan="11">少驶原因(公里)</td>
  78 + <td colspan="3">临加公里</td>
  79 + </tr>
  80 + <tr>
  81 + <td><label>计划内</label><label>营运</label><label>里程</label></td>
  82 + <td><label>临时性</label><label>多样化</label><label>调度营</label><label>运里程</label></td>
  83 + <td><label>计划内</label><label>进出场</label><label>空驶</label></td>
  84 + <td><label>计划外</label><label>进出场</label><label>空驶</label></td>
  85 + <td><label>故障</label><label>进出场</label><label>空驶</label></td>
  86 + <td><label>肇事</label><label>进出场</label><label>空驶</label></td>
  87 + <td><label>纠纷</label><label>进出场</label><label>空驶</label></td>
  88 + <td><label>空放 </label><label>空驶</label></td>
  89 + <td><span>路阻</span></td>
  90 + <td><span>吊慢</span></td>
  91 + <td><span>故障</span></td>
  92 + <td><span>纠纷</span></td>
  93 + <td><span>肇事</span></td>
  94 + <td><span>缺人</span></td>
  95 + <td><span>缺车</span></td>
  96 + <td><span>客稀</span></td>
  97 + <td><span>气候</span></td>
  98 + <td><span>援外</span></td>
  99 + <td><span>其他</span></td>
  100 + <td><label>临加营</label><label>运公里</label></td>
  101 + <td><label>临加进出</label><label>场空驶</label></td>
  102 + <td><label>临加</label><label>空放</label><label>空驶</label></td>
  103 + </tr>
  104 +
  105 + </thead>
  106 + <tbody class="count_mileage_sum">
  107 +
  108 + </tbody>
  109 + </table>
  110 + </div>
  111 + </div>
  112 + </div>
  113 + </div>
  114 +</div>
  115 +
  116 +<script>
  117 + $(function(){
  118 +// $('#export').attr('disabled', "true");
  119 +
  120 + // 关闭左侧栏
  121 + if (!$('body').hasClass('page-sidebar-closed'))
  122 + $('.menu-toggler.sidebar-toggler').click();
  123 +
  124 + $("#date").datetimepicker({
  125 + format : 'YYYY-MM-DD',
  126 + locale : 'zh-cn'
  127 + });
  128 +
  129 + var d = new Date();
  130 + var year = d.getFullYear();
  131 + var month = d.getMonth() + 1;
  132 + var day = d.getDate();
  133 + if(month < 10)
  134 + month = "0" + month;
  135 + if(day < 10)
  136 + day = "0" + day;
  137 + $("#date").val(year + "-" + month + "-" + day);
  138 +
  139 + var date = "";
  140 + var nature="";
  141 + $("#query").on("click",function(){
  142 + $("#countLine").height($(window).height()-280);
  143 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  144 + layer.msg("请选择日期!");
  145 + return;
  146 + }
  147 + date = $("#date").val();
  148 +// if(date==null || date =="" ||date2==null || date2 ==""){
  149 +// layer.msg('请选择时间段.');
  150 +// }else{
  151 + nature = $("#nature").val();
  152 + var params = {};
  153 + params['date'] = date;
  154 + params['nature'] = nature;
  155 + params['type'] = "query";
  156 + var i = layer.load(2);
  157 + $get('/report/countMileageSum',params,function(result){
  158 + layer.close(i);
  159 + $("#datetodate").html(date);
  160 + // 把数据填充到模版中
  161 + var tbodyHtml = template('count_mileage_sum',{list:result});
  162 + // 把渲染好的模版html文本追加到表格中
  163 + $('#forms .count_mileage_sum').html(tbodyHtml);
  164 +
  165 + if(result.length == 0)
  166 + $("#export").attr('disabled',"true");
  167 + else
  168 + $("#export").removeAttr("disabled");
  169 + });
  170 +// }
  171 +
  172 + });
  173 +
  174 + $("#countLine").height($(window).height()-280);
  175 + $("#export").on("click",function(){
  176 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  177 + layer.msg("请选择日期!");
  178 + return;
  179 + }
  180 + date = $("#date").val();
  181 + nature = $("#nature").val();
  182 + var params = {};
  183 + params['date'] = date;
  184 + params['nature'] = nature;
  185 + params['type'] = "export";
  186 + params['by']='sj';
  187 + var i = layer.load(2);
  188 + $get('/report/countMileageSum',params,function(result){
  189 + var dateTime = "";
  190 +// if(date == date2){
  191 + dateTime = moment(date).format("YYYYMMDD");
  192 +// } else {
  193 +// dateTime = moment(date).format("YYYYMMDD")
  194 +// +"-"+moment(date2).format("YYYYMMDD");
  195 +// }
  196 + window.open("/downloadFile/download?fileName="
  197 + +dateTime+"-审计公里汇总表");
  198 + layer.close(i);
  199 + });
  200 + });
  201 + });
  202 +</script>
  203 +<script type="text/html" id="count_mileage_sum">
  204 + {{each list as obj i}}
  205 + <tr>
  206 + <td>{{obj.gsName}}</td>
  207 + <td>{{obj.fgsName}}</td>
  208 + <td>{{obj.jhzlc}}</td>
  209 + <td>{{obj.jhlc}}</td>
  210 + <td>{{obj.jcclc}}</td>
  211 + <td>{{obj.sjzgl}}</td>
  212 + <td>{{obj.jhnlc}}</td>
  213 + <td>{{obj.jhwlc}}</td>
  214 + <td>{{obj.jhnjcclc}}</td>
  215 + <td>{{obj.jhwjcclc_z}}</td>
  216 + <td>{{obj.zrwjcclc}}</td>
  217 + <td>{{obj.zrwjcclc1}}</td>
  218 + <td>{{obj.zrwjcclc2}}</td>
  219 + <td>{{obj.kfks}}</td>
  220 + <td>{{obj.lbss}}</td>
  221 + <td>{{obj.ssgl_lz}}</td>
  222 + <td>{{obj.ssgl_dm}}</td>
  223 + <td>{{obj.ssgl_gz}}</td>
  224 + <td>{{obj.ssgl_jf}}</td>
  225 + <td>{{obj.ssgl_zs}}</td>
  226 + <td>{{obj.ssgl_qr}}</td>
  227 + <td>{{obj.ssgl_qc}}</td>
  228 + <td>{{obj.ssgl_kx}}</td>
  229 + <td>{{obj.ssgl_qh}}</td>
  230 + <td>{{obj.ssgl_yw}}</td>
  231 + <td>{{obj.ssgl_other}}</td>
  232 + <td>{{obj.ljyy}}</td>
  233 + <td>{{obj.ljjcc}}</td>
  234 + <td>{{obj.ljkfks}}</td>
  235 + </tr>
  236 + {{/each}}
  237 + {{if list.length == 0}}
  238 + <tr>
  239 + <td colspan="30"><h6 class="muted">没有找到相关数据</h6></td>
  240 + </tr>
  241 + {{/if}}
  242 +</script>
0 \ No newline at end of file 243 \ No newline at end of file