Commit 1008b078bd2dda862825a9a62bfc5cc34aef88d8

Authored by 游瑞烽
2 parents 59a7d519 c33e25aa

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

Showing 96 changed files with 6875 additions and 2286 deletions
src/main/java/com/bsth/controller/calc/CalcWaybillController.java
... ... @@ -39,6 +39,9 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer>
39 39 }
40 40  
41 41 Map<String, Object> m = new HashMap<String, Object>();
  42 + m.put("date", date);
  43 + m.put("line", line);
  44 + m.put("key", key);
42 45 try {
43 46  
44 47 m = calcWaybillService.generateNew(date, line);
... ... @@ -53,7 +56,6 @@ public class CalcWaybillController extends BaseController&lt;CalcWaybill, Integer&gt;
53 56 m.put("status", ResponseCode.ERROR);
54 57 return m;
55 58 }
56   -
57 59 return m;
58 60 }
59 61  
... ... @@ -101,6 +103,8 @@ public class CalcWaybillController extends BaseController&lt;CalcWaybill, Integer&gt;
101 103 }
102 104  
103 105 Map<String, Object> m = new HashMap<String, Object>();
  106 + m.put("date", date);
  107 + m.put("line", line);
104 108 try {
105 109  
106 110 m.put("status", calcWaybillService.calcDaily(date, line));
... ... @@ -147,4 +151,130 @@ public class CalcWaybillController extends BaseController&lt;CalcWaybill, Integer&gt;
147 151 return calcWaybillService.calcStatisticsDaily(gsdm,fgsdm,line,date,date2,xlName,type);
148 152 }
149 153  
  154 + @RequestMapping(value="/generateLineMileage")
  155 + public Map<String, Object> generateLineMileage(@RequestParam Map<String, Object> map) throws Exception{
  156 + Map<String, Object> m = new HashMap<String, Object>();
  157 + String date = "", line = "";
  158 + try {
  159 +
  160 + if(map.containsKey("date") && map.get("date")!=null){
  161 + date=map.get("date").toString().trim();
  162 + }
  163 + if(map.containsKey("line") && map.get("line")!=null){
  164 + line=map.get("line").toString().trim();
  165 + }
  166 +
  167 +
  168 + return calcWaybillService.calcLineMileage(date, line);
  169 +
  170 + } catch (Exception e) {
  171 + // TODO: handle exception
  172 + e.printStackTrace();
  173 + m.put("status", ResponseCode.ERROR);
  174 + m.put("date", date);
  175 + m.put("line", line);
  176 + return m;
  177 + }
  178 + }
  179 +
  180 + @RequestMapping(value="/generateBusMileage")
  181 + public Map<String, Object> generateBusMileage(@RequestParam Map<String, Object> map) throws Exception{
  182 + Map<String, Object> m = new HashMap<String, Object>();
  183 + String date = "", line = "";
  184 + try {
  185 +
  186 + if(map.containsKey("date") && map.get("date")!=null){
  187 + date=map.get("date").toString().trim();
  188 + }
  189 + if(map.containsKey("line") && map.get("line")!=null){
  190 + line=map.get("line").toString().trim();
  191 + }
  192 +
  193 +
  194 + return calcWaybillService.calcBusMileage(date, line);
  195 +
  196 + } catch (Exception e) {
  197 + // TODO: handle exception
  198 + e.printStackTrace();
  199 + m.put("status", ResponseCode.ERROR);
  200 + m.put("date", date);
  201 + m.put("line", line);
  202 + return m;
  203 + }
  204 + }
  205 +
  206 + @RequestMapping(value="/getLineMileage")
  207 + public List<Map<String, Object>> getLineMileage(@RequestParam Map<String, Object> map){
  208 + String gsdm="";
  209 + if(map.get("gsdm")!=null){
  210 + gsdm=map.get("gsdm").toString().trim();
  211 + }
  212 + String fgsdm="";
  213 + if(map.get("fgsdm")!=null){
  214 + fgsdm=map.get("fgsdm").toString().trim();
  215 + }
  216 + String line="";
  217 + if(map.get("line")!=null){
  218 + line=map.get("line").toString().trim();
  219 + }
  220 + String date="";
  221 + if(map.get("date")!=null){
  222 + date=map.get("date").toString().trim();
  223 + }
  224 + String date2="";
  225 + if(map.get("date2")!=null){
  226 + date2=map.get("date2").toString().trim();
  227 + }
  228 + String xlName="";
  229 + if(map.get("xlName")!=null){
  230 + xlName=map.get("xlName").toString().trim();
  231 + }
  232 + String zt="";
  233 + if(map.get("zt")!=null){
  234 + zt=map.get("zt").toString();
  235 + }
  236 + String by="";
  237 + if(map.get("by")!=null){
  238 + by=map.get("by").toString();
  239 + }
  240 + String type="";
  241 + if(map.get("type")!=null){
  242 + type=map.get("type").toString().trim();
  243 + }
  244 + return calcWaybillService.getLineMileage(gsdm, fgsdm, line, date, date2, xlName, zt, by, type);
  245 + }
  246 +
  247 + @RequestMapping(value="/getBusMileage")
  248 + public List<Map<String, Object>> getBusMileage(@RequestParam Map<String, Object> map){
  249 + String line="";
  250 + if(map.get("line")!=null){
  251 + line=map.get("line").toString().trim();
  252 + }
  253 + String date="";
  254 + if(map.get("date")!=null){
  255 + date=map.get("date").toString().trim();
  256 + }
  257 + String date2="";
  258 + if(map.get("date2")!=null){
  259 + date2=map.get("date2").toString().trim();
  260 + }
  261 + String xlName="";
  262 + if(map.get("xlName")!=null){
  263 + xlName=map.get("xlName").toString().trim();
  264 + }
  265 + String zt="";
  266 + if(map.get("zt")!=null){
  267 + zt=map.get("zt").toString();
  268 + }
  269 + String by="";
  270 + if(map.get("by")!=null){
  271 + by=map.get("by").toString();
  272 + }
  273 + String type="";
  274 + if(map.get("type")!=null){
  275 + type=map.get("type").toString().trim();
  276 + }
  277 + return calcWaybillService.getBusMileage(line, date, date2, xlName, zt, by, type);
  278 + }
  279 +
150 280 }
... ...
src/main/java/com/bsth/controller/forms/ExportController.java
... ... @@ -46,7 +46,8 @@ public class ExportController {
46 46 @RequestMapping(value = "/waybilldayExport", method = RequestMethod.POST)
47 47 public List<Waybillday> waybilldayExport(@RequestParam Map<String, Object> map) {
48 48 List<Waybillday> waybillday = formsService.waybillday(map);
49   - exportService.waybillday(map.get("date").toString(), waybillday);
  49 + exportService.waybillday(map.get("date").toString(),
  50 + map.get("lineName").toString(), waybillday);
50 51 return waybillday;
51 52 }
52 53  
... ... @@ -85,7 +86,8 @@ public class ExportController {
85 86 // 班次车辆人员日统计
86 87 @RequestMapping(value = "/shifdayExport", method = RequestMethod.GET)
87 88 public List<Map<String, Object>> shifdayExport(@RequestParam Map<String, Object> map) {
88   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
  89 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  90 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
89 91 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
90 92 Map<String, Object> map2 = new HashMap<String, Object>();
91 93 ReportUtils ee = new ReportUtils();
... ... @@ -117,10 +119,14 @@ public class ExportController {
117 119 }
118 120  
119 121 try {
  122 + String lineName = "";
  123 + if(map.containsKey("lineName"))
  124 + lineName = map.get("lineName").toString();
120 125 listI.add(resList.iterator());
121 126 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
122 127 ee.excelReplace(listI, new Object[] { map2 }, path + "mould/shifday.xls",
123   - path + "export/班次车辆人员日报表" + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls");
  128 + path + "export/" + sdfSimple.format(sdfMonth.parse(map.get("date").toString()))
  129 + + "-" + lineName + "-班次车辆人员日报表.xls");
124 130 } catch (Exception e) {
125 131 e.printStackTrace();
126 132 }
... ... @@ -130,7 +136,8 @@ public class ExportController {
130 136 // 班次车辆人员月统计
131 137 @RequestMapping(value = "/shiftuehiclemanthExport", method = RequestMethod.GET)
132 138 public List<Map<String, Object>> shiftuehiclemanthExport(@RequestParam Map<String, Object> map) {
133   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
  139 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  140 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
134 141 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
135 142 ReportUtils ee = new ReportUtils();
136 143 List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth(map);
... ... @@ -153,7 +160,20 @@ public class ExportController {
153 160 }
154 161  
155 162 try {
156   - String mouldurl = null;
  163 + String mouldurl = null, lineName = "", dateTime = ""
  164 + , startDate = "", endDate = "";
  165 + if(map.containsKey("lineName"))
  166 + lineName = map.get("lineName").toString();
  167 + if(map.containsKey("startDate"))
  168 + startDate = map.get("startDate").toString();
  169 + if(map.containsKey("endDate"))
  170 + endDate = map.get("endDate").toString();
  171 + if(startDate.equals(endDate)){
  172 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  173 + } else {
  174 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  175 + +"-"+sdfSimple.format(sdfMonth.parse(endDate));
  176 + }
157 177 if(map.get("empnames").equals("驾驶员")){
158 178 mouldurl="mould/shiftuehiclemanth.xls";
159 179 }else if(map.get("empnames").equals("售票员")){
... ... @@ -164,7 +184,7 @@ public class ExportController {
164 184 listI.add(resList.iterator());
165 185 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
166 186 ee.excelReplace(listI, new Object[] { map }, path +mouldurl,
167   - path + "export/班次车辆人员月报表" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
  187 + path + "export/" + dateTime + "-" + lineName + "-班次车辆人员月报表.xls");
168 188 } catch (Exception e) {
169 189 e.printStackTrace();
170 190 }
... ... @@ -304,7 +324,8 @@ public class ExportController {
304 324 }
305 325 @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET)
306 326 public List<Map<String, Object>> singledataExportTj(@RequestParam Map<String, Object> map) {
307   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
  327 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  328 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
308 329 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
309 330 ReportUtils ee = new ReportUtils();
310 331 List<Singledata> singledata = formsService.singledatatj(map);
... ... @@ -333,10 +354,16 @@ public class ExportController {
333 354 }
334 355  
335 356 try {
  357 + String startDate = "", lineName = "";
  358 + if(map.containsKey("startDate"))
  359 + startDate = map.get("startDate").toString();
  360 + if(map.containsKey("lineName"))
  361 + lineName = map.get("lineName").toString();
336 362 listI.add(resList.iterator());
337 363 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
338 364 ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls",
339   - path + "export/路单数据" + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
  365 + path + "export/" + sdfSimple.format(sdfMonth.parse(startDate))
  366 + + "-" + lineName + "-路单数据.xls");
340 367 } catch (Exception e) {
341 368 e.printStackTrace();
342 369 }
... ... @@ -388,7 +415,8 @@ public class ExportController {
388 415 // 车辆加注
389 416 @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET)
390 417 public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) {
391   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
  418 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  419 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
392 420 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
393 421 ReportUtils ee = new ReportUtils();
394 422 List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(),
... ... @@ -414,10 +442,15 @@ public class ExportController {
414 442 }
415 443  
416 444 try {
  445 + String date = "", lineName = "";
  446 + if(map.containsKey("data"))
  447 + date = map.get("data").toString();
  448 + if(map.containsKey("lineName"))
  449 + lineName = map.get("lineName").toString();
417 450 listI.add(resList.iterator());
418 451 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
419 452 ee.excelReplace(listI, new Object[] { map }, path + "mould/vehicleloading.xls",
420   - path + "export/车辆加注" + sdfSimple.format(sdfMonth.parse(map.get("data").toString())) + ".xls");
  453 + path + "export/" + sdfSimple.format(sdfMonth.parse(date)) + "-" + lineName + "-车辆加注.xls");
421 454 } catch (Exception e) {
422 455 e.printStackTrace();
423 456 }
... ... @@ -447,10 +480,23 @@ public class ExportController {
447 480 }
448 481  
449 482 try {
  483 + String dateTime = "", startDate = "", endDate = "", lineName = "";
  484 + if(map.containsKey("startDate"))
  485 + startDate = map.get("startDate").toString();
  486 + if(map.containsKey("endDate"))
  487 + endDate = map.get("endDate").toString();
  488 + if(map.containsKey("lineName"))
  489 + lineName = map.get("lineName").toString();
  490 + if(startDate.equals(endDate)){
  491 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  492 + } else {
  493 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  494 + +"-"+sdfSimple.format(sdfMonth.parse(endDate));
  495 + }
450 496 listI.add(resList.iterator());
451 497 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
452   - ee.excelReplace(listI, new Object[] { map }, path + "mould/operationservice.xls", path + "export/运营服务阶段报表"
453   - + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
  498 + ee.excelReplace(listI, new Object[] { map }, path + "mould/operationservice.xls", path + "export/"
  499 + + dateTime + "-" + lineName + "-运营服务阶段报表.xls");
454 500 } catch (Exception e) {
455 501 e.printStackTrace();
456 502 }
... ... @@ -460,7 +506,8 @@ public class ExportController {
460 506 // 换人换车情况日统计
461 507 @RequestMapping(value = "/changetochangeExport", method = RequestMethod.POST)
462 508 public List<Map<String, Object>> changetochangeExport(@RequestParam Map<String, Object> map) {
463   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
  509 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  510 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
464 511 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
465 512 ReportUtils ee = new ReportUtils();
466 513 List<Changetochange> changetochange = formsService.changetochange(map);
... ... @@ -484,10 +531,23 @@ public class ExportController {
484 531 }
485 532  
486 533 try {
  534 + String dateTime = "", startDate = "", endDate = "", lineName = "";
  535 + if(map.containsKey("startDate"))
  536 + startDate = map.get("startDate").toString();
  537 + if(map.containsKey("endDate"))
  538 + endDate = map.get("endDate").toString();
  539 + if(map.containsKey("lineName"))
  540 + lineName = map.get("lineName").toString();
  541 + if(startDate.equals(endDate)){
  542 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  543 + } else {
  544 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  545 + +"-"+sdfSimple.format(sdfMonth.parse(endDate));
  546 + }
487 547 listI.add(resList.iterator());
488 548 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
489   - ee.excelReplace(listI, new Object[] { map }, path + "mould/changetochange.xls", path + "export/换人换车情况日统计"
490   - + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
  549 + ee.excelReplace(listI, new Object[] { map }, path + "mould/changetochange.xls", path + "export/"
  550 + + dateTime + "-" + lineName + "-换人换车情况日统计.xls");
491 551 } catch (Exception e) {
492 552 e.printStackTrace();
493 553 }
... ... @@ -497,7 +557,8 @@ public class ExportController {
497 557 // 营运线路出车率统计表
498 558 @RequestMapping(value = "/turnoutrateExport", method = RequestMethod.POST)
499 559 public List<Map<String, Object>> turnoutrateExport(@RequestParam Map<String, Object> map) {
500   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd");
  560 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  561 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
501 562 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
502 563 ReportUtils ee = new ReportUtils();
503 564 Map<String, Object> map1 = new HashMap<String, Object>();
... ... @@ -517,10 +578,23 @@ public class ExportController {
517 578 resList.remove(m);
518 579  
519 580 try {
  581 + String dateTime = "", startDate = "", endDate = "", lineName = "";
  582 + if(map.containsKey("startDate"))
  583 + startDate = map.get("startDate").toString();
  584 + if(map.containsKey("endDate"))
  585 + endDate = map.get("endDate").toString();
  586 + if(map.containsKey("lineName"))
  587 + lineName = map.get("lineName").toString();
  588 + if(startDate.equals(endDate)){
  589 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  590 + } else {
  591 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  592 + +"-"+sdfSimple.format(sdfMonth.parse(endDate));
  593 + }
520 594 listI.add(resList.iterator());
521 595 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
522   - ee.excelReplace(listI, new Object[] { map1 }, path + "mould/turnoutrate.xls", path + "export/营运线路出车率统计表"
523   - + sdfSimple.format(sdfMonth.parse(map.get("startDate").toString())) + ".xls");
  596 + ee.excelReplace(listI, new Object[] { map1 }, path + "mould/turnoutrate.xls", path + "export/"
  597 + + dateTime + "-" + lineName + "-营运线路出车率统计表.xls");
524 598 } catch (Exception e) {
525 599 e.printStackTrace();
526 600 }
... ... @@ -713,10 +787,13 @@ public class ExportController {
713 787 m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString()));
714 788 m.put("date", map.get("date").toString());
715 789 try {
  790 + String lineName = map.get("lineName").toString();
  791 + String date = map.get("date").toString();
716 792 listI.add(resList.iterator());
717 793 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
718   - ee.excelReplace(listI, new Object[] { m }, path + "mould/daily.xls", path + "export/班次日报表"
719   - + sdfSimple.format(sdfMonth.parse(map.get("date").toString())) + ".xls");
  794 + ee.excelReplace(listI, new Object[] { m }, path + "mould/daily.xls",
  795 + path + "export/" + sdfSimple.format(sdfMonth.parse(date))
  796 + + "-" + lineName + "-班次日报表.xls");
720 797 } catch (Exception e) {
721 798 e.printStackTrace();
722 799 }
... ...
src/main/java/com/bsth/controller/report/ReportController.java
1 1 package com.bsth.controller.report;
2 2  
  3 +import java.text.SimpleDateFormat;
3 4 import java.util.ArrayList;
4 5 import java.util.HashMap;
5 6 import java.util.Iterator;
... ... @@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
15 16  
16 17 import com.alibaba.fastjson.JSONArray;
17 18 import com.alibaba.fastjson.JSONObject;
  19 +import com.bsth.data.BasicData;
18 20 import com.bsth.entity.StationRoute;
19 21 import com.bsth.entity.excep.ArrivalInfo;
20 22 import com.bsth.entity.realcontrol.ScheduleRealInfo;
... ... @@ -51,6 +53,7 @@ public class ReportController {
51 53 Map<String, Object> m = new HashMap<String, Object>();
52 54 m.put("i", i);
53 55 m.put("nbbm", a.getNbbm());
  56 + m.put("pzh", a.getPzh());
54 57 m.put("stopName", a.getStopName());
55 58 m.put("jzsj", a.getJzsj());
56 59 m.put("czsj", a.getCzsj());
... ... @@ -65,13 +68,15 @@ public class ReportController {
65 68 resList.add(m);
66 69 i++;
67 70 }
68   -
69 71 try {
  72 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  73 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
70 74 Map<String, Object> map=new HashMap<String, Object>();
71 75 listI.add(resList.iterator());
72 76 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
73 77 ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls",
74   - path + "export/班次到离站.xls");
  78 + path + "export/"+sdfSimple.format(sdfMonth.parse(date))
  79 + +"-"+clzbh+"-班次到离站.xls");
75 80 } catch (Exception e) {
76 81 e.printStackTrace();
77 82 }
... ... @@ -138,11 +143,23 @@ public class ReportController {
138 143 }
139 144  
140 145 try {
  146 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  147 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  148 + String lineName = BasicData.lineCode2NameMap.get(line);
  149 + String dateTime = "", startDate = "", endDate = "";
  150 + startDate = fcsj.substring(0, 10);
  151 + endDate = ddsj.substring(0, 10);
  152 + if(startDate.equals(endDate)){
  153 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  154 + } else {
  155 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  156 + +"-"+sdfSimple.format(sdfMonth.parse(endDate));
  157 + }
141 158 Map<String, Object> map=new HashMap<String, Object>();
142 159 listI.add(resList.iterator());
143 160 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
144 161 ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls",
145   - path + "export/班次到离站.xls");
  162 + path + "export/"+dateTime+"-"+lineName+"-班次到离站.xls");
146 163 } catch (Exception e) {
147 164 e.printStackTrace();
148 165 }
... ... @@ -186,11 +203,14 @@ public class ReportController {
186 203 lgqlList.add(newMap);
187 204 }
188 205 try {
  206 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  207 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
189 208 listI.add(fwqlList.iterator());
190 209 listI.add(lgqlList.iterator());
191 210 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
192 211 ee.excelReplace(listI, new Object[] { map }, path + "mould/jobSummary.xls",
193   - path + "export/调度员工作汇总日报.xls");
  212 + path + "export/"+sdfSimple.format(sdfMonth.parse(date))
  213 + +"-"+lineName+"-调度员工作汇总日报.xls");
194 214 } catch (Exception e) {
195 215 e.printStackTrace();
196 216 }
... ...
src/main/java/com/bsth/controller/schedule/core/TTInfoDetailController.java
... ... @@ -8,6 +8,7 @@ import com.bsth.service.schedule.datatools.TTInfoDetailForEdit;
8 8 import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData;
9 9 import com.bsth.service.schedule.timetable.ExcelFormatType;
10 10 import com.bsth.service.schedule.utils.DataToolsFile;
  11 +import com.bsth.service.schedule.utils.DataToolsFileType;
11 12 import org.springframework.beans.factory.annotation.Autowired;
12 13 import org.springframework.web.bind.annotation.*;
13 14  
... ... @@ -128,11 +129,19 @@ public class TTInfoDetailController extends BController&lt;TTInfoDetail, Long&gt; {
128 129 }
129 130  
130 131  
131   - @RequestMapping(value = "/exportDTDFile", method = RequestMethod.POST)
  132 + @RequestMapping(value = "/exportDTDFile/{type}", method = RequestMethod.POST)
132 133 public void exportFile(
133   - @RequestBody TTinfoDetailDynamicData.DTInfos dtInfos,
  134 + @RequestBody TTinfoDetailDynamicData.DTInfos dtInfos, @PathVariable("type") String type,
134 135 HttpServletResponse response) throws Exception {
135   - DataToolsFile dataToolsFile = ttInfoDetailService.exportDynamicTTinfo(dtInfos);
  136 + DataToolsFile dataToolsFile = null;
  137 + if ("xls".equals(type)) {
  138 + dataToolsFile = ttInfoDetailService.exportDynamicTTinfo(dtInfos, DataToolsFileType.XLS);
  139 + } else if ("xlsx".equals(type)) {
  140 + dataToolsFile = ttInfoDetailService.exportDynamicTTinfo(dtInfos, DataToolsFileType.XLSX);
  141 + } else {
  142 + throw new Exception("未知的导出格式==>" + type);
  143 + }
  144 +
136 145 // 流输出导出文件
137 146 response.setHeader("content-type", "application/octet-stream");
138 147 response.setHeader("Content-Disposition", "attachment; filename=" + dataToolsFile.getFile().getName());
... ...
src/main/java/com/bsth/data/BasicData.java
... ... @@ -28,7 +28,7 @@ public class BasicData {
28 28 //公司代码和公司名对照(K: 公司编码,V:公司名)
29 29 public static Map<String, String> businessCodeNameMap;
30 30  
31   - //分公司公司代码和分公司公司名对照(K: 公司编码_分公司编码,V:分公司公司名)
  31 + //分公司公司代码和分公司公司名对照(K: 分公司编码_公司编码,V:分公司公司名)
32 32 public static Map<String, String> businessFgsCodeNameMap;
33 33  
34 34 //设备号和车辆自编号 (K: 设备编码 ,V:车辆自编号)
... ... @@ -37,7 +37,7 @@ public class BasicData {
37 37 //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码)
38 38 public static Map<String, String> nbbm2CompanyCodeMap;
39 39  
40   - //车辆自编号和分公司代码对照 (K: 车辆自编号 ,V:公司代码_分公司代码)
  40 + //车辆自编号和分公司代码对照 (K: 车辆自编号 ,V:分公司编码_公司编码)
41 41 public static Map<String, String> nbbm2FgsCompanyCodeMap;
42 42  
43 43 //车辆自编号和牌照号对照 (K: 车辆自编号 ,V:牌照号)
... ... @@ -206,7 +206,7 @@ public class BasicData {
206 206 car = carIterator.next();
207 207 deviceId2Nbbm.put(car.getEquipmentCode(), car.getInsideCode());
208 208 nbbm2CompanyCode.put(car.getInsideCode(), car.getBusinessCode());
209   - nbbm2FgsCompanyCode.put(car.getInsideCode(), car.getBusinessCode() + "_" + car.getBrancheCompanyCode());
  209 + nbbm2FgsCompanyCode.put(car.getInsideCode(), car.getBrancheCompanyCode() + "_" + car.getBusinessCode() );
210 210 nbbmCompanyPlate.put(car.getInsideCode(), car.getCarPlate());
211 211 }
212 212  
... ... @@ -256,6 +256,8 @@ public class BasicData {
256 256 CarConfigInfo cci;
257 257 while (allIterator.hasNext()) {
258 258 cci = allIterator.next();
  259 + if(cci.getIsCancel())
  260 + continue;//排除已经报废的
259 261 ccMap.put(cci.getCl().getInsideCode(), cci.getXl());
260 262 }
261 263 nbbm2LineMap = ccMap;
... ...
src/main/java/com/bsth/data/directive/DirectivesPstThread.java
... ... @@ -142,7 +142,7 @@ public class DirectivesPstThread extends Thread {
142 142  
143 143 tran.commit(status);
144 144  
145   - logger.info("64 入库成功: " + d64s.size());
  145 + //logger.info("64 入库成功: " + d64s.size());
146 146 }catch (Exception e){
147 147 tran.rollback(status);
148 148 logger.error("", e);
... ... @@ -192,7 +192,7 @@ public class DirectivesPstThread extends Thread {
192 192  
193 193 tran.commit(status);
194 194  
195   - logger.info("60 更新成功: " + d60s.size());
  195 + //logger.info("60 更新成功: " + d60s.size());
196 196 }catch (Exception e){
197 197 tran.rollback(status);
198 198 logger.error("", e);
... ... @@ -266,7 +266,7 @@ public class DirectivesPstThread extends Thread {
266 266  
267 267 tran.commit(status);
268 268  
269   - logger.info("60 入库成功: " + d60s.size());
  269 + //logger.info("60 入库成功: " + d60s.size());
270 270 }catch (Exception e){
271 271 tran.rollback(status);
272 272 logger.error("", e);
... ...
src/main/java/com/bsth/data/gpsdata_v2/cache/GeoCacheData.java
... ... @@ -21,6 +21,8 @@ import org.springframework.stereotype.Component;
21 21 import java.sql.ResultSet;
22 22 import java.sql.SQLException;
23 23 import java.util.*;
  24 +import java.util.concurrent.ConcurrentHashMap;
  25 +import java.util.concurrent.ConcurrentMap;
24 26  
25 27 /**
26 28 * 空间数据缓存
... ... @@ -38,7 +40,7 @@ public class GeoCacheData {
38 40 /**
39 41 * 路段编码和名称对照
40 42 */
41   - private static Map<String, String> sectionCode2Name;
  43 + private static ConcurrentMap<String, String> sectionCode2Name;
42 44 /**
43 45 * 线路站点路由
44 46 */
... ... @@ -50,15 +52,15 @@ public class GeoCacheData {
50 52 /**
51 53 * 线路_上下行_站点编码 ——> 站点
52 54 */
53   - private static Map<String, StationRoute> routeCodeMap;
  55 + private static ConcurrentMap<String, StationRoute> routeCodeMap;
54 56 /**
55 57 * 停车场
56 58 */
57   - public static Map<String, Polygon> tccMap;
  59 + public static ConcurrentMap<String, Polygon> tccMap;
58 60 /**
59 61 * 线路限速信息
60 62 */
61   - private static Map<String, Double> speedLimitMap;
  63 + private static ConcurrentMap<String, Double> speedLimitMap;
62 64  
63 65 @Autowired
64 66 JdbcTemplate jdbcTemplate;
... ... @@ -118,7 +120,7 @@ public class GeoCacheData {
118 120 //按线路和走向分组
119 121 if (routeList.size() > 0) {
120 122 ArrayListMultimap<String, StationRoute> tempMap = ArrayListMultimap.create();
121   - Map<String, StationRoute> codeMap = new HashMap<>(routeList.size());
  123 + ConcurrentMap<String, StationRoute> codeMap = new ConcurrentHashMap<>(routeList.size());
122 124 for (StationRoute sr : routeList) {
123 125 tempMap.put(sr.getLineCode() + "_" + sr.getDirections(), sr);
124 126 //站点编码 ——> 和路由顺序对照
... ... @@ -141,7 +143,7 @@ public class GeoCacheData {
141 143 //加载停车场数据
142 144 String sql = "select PARK_CODE, ST_AsText(G_PARK_POINT) as G_PARK_POINT from bsth_c_car_park where park_code is not null and b_park_point is not null and destroy=0";
143 145 List<Map<String, Object>> tccList = jdbcTemplate.queryForList(sql);
144   - Map<String, Polygon> tccTempMap = new HashMap<>();
  146 + ConcurrentMap<String, Polygon> tccTempMap = new ConcurrentHashMap<>();
145 147  
146 148 Polygon polygon;
147 149 for (Map<String, Object> tMap : tccList) {
... ... @@ -163,7 +165,7 @@ public class GeoCacheData {
163 165 //加载线路限速信息
164 166 String sql = "select l.LINE_CODE,i.SPEEDING from bsth_c_line_information i left join bsth_c_line l on i.line=l.id where i.speed_limit is not null";
165 167 List<Map<String, Object>> speedMap = jdbcTemplate.queryForList(sql);
166   - Map<String, Double> speedTempMap = new HashMap<>();
  168 + ConcurrentMap<String, Double> speedTempMap = new ConcurrentHashMap();
167 169 for (Map<String, Object> tMap : speedMap) {
168 170 try {
169 171 speedTempMap.put(tMap.get("LINE_CODE").toString(), Double.parseDouble(tMap.get("SPEEDING").toString()));
... ... @@ -208,7 +210,7 @@ public class GeoCacheData {
208 210 if(sectionCacheTempMap.size() > 0)
209 211 sectionCacheMap = sectionCacheTempMap;
210 212  
211   - Map<String, String> sectionCode2NameTemp = new HashMap<>();
  213 + ConcurrentMap<String, String> sectionCode2NameTemp = new ConcurrentHashMap<>();
212 214  
213 215 //加载全量路段编码和名称对照
214 216 sql = "select SECTION_CODE,SECTION_NAME,CROSES_ROAD from bsth_c_section";
... ...
src/main/java/com/bsth/data/safe_driv/SafeDrivDataLoadThread.java
... ... @@ -37,8 +37,8 @@ public class SafeDrivDataLoadThread extends Thread{
37 37 httpClient = HttpClients.createDefault();
38 38 get = new HttpGet(url);
39 39 requestConfig = RequestConfig.custom()
40   - .setConnectTimeout(2500).setConnectionRequestTimeout(2000)
41   - .setSocketTimeout(2500).build();
  40 + .setConnectTimeout(5500).setConnectionRequestTimeout(5000)
  41 + .setSocketTimeout(5500).build();
42 42 get.setConfig(requestConfig);
43 43 }
44 44  
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -38,6 +38,7 @@ import java.text.SimpleDateFormat;
38 38 import java.util.*;
39 39 import java.util.concurrent.ConcurrentHashMap;
40 40 import java.util.concurrent.ConcurrentLinkedQueue;
  41 +import java.util.concurrent.ConcurrentMap;
41 42  
42 43 /**
43 44 * @author PanZhao
... ... @@ -63,10 +64,10 @@ public class DayOfSchedule {
63 64 private static ArrayListMultimap<String, ScheduleRealInfo> lpScheduleMap;
64 65  
65 66 // 班次主键映射
66   - private static Map<Long, ScheduleRealInfo> id2SchedulMap;
  67 + private static ConcurrentMap<Long, ScheduleRealInfo> id2SchedulMap;
67 68  
68 69 //车辆 ——> 当前执行班次
69   - private static Map<String, ScheduleRealInfo> carExecutePlanMap;
  70 + private static ConcurrentMap<String, ScheduleRealInfo> carExecutePlanMap;
70 71  
71 72 // 持久化
72 73 public static ConcurrentLinkedQueue<ScheduleRealInfo> pstBuffer;
... ... @@ -1098,7 +1099,7 @@ public class DayOfSchedule {
1098 1099 */
1099 1100 public int reCalcIdMaps(){
1100 1101 Collection<ScheduleRealInfo> all = findAll();
1101   - Map<Long, ScheduleRealInfo> id2SchedulMapCopy = new ConcurrentHashMap<>();
  1102 + ConcurrentMap<Long, ScheduleRealInfo> id2SchedulMapCopy = new ConcurrentHashMap<>();
1102 1103  
1103 1104 for(ScheduleRealInfo sch : all){
1104 1105 id2SchedulMapCopy.put(sch.getId(), sch);
... ...
src/main/java/com/bsth/data/schedule/e_state_check/ScheduleStationCodeChecker.java
... ... @@ -32,13 +32,17 @@ public class ScheduleStationCodeChecker {
32 32 @Autowired
33 33 JdbcTemplate jdbcTemplate;
34 34  
35   - Logger logger = LoggerFactory.getLogger(this.getClass());
  35 + static Logger logger = LoggerFactory.getLogger(ScheduleStationCodeChecker.class);
36 36  
37 37 public static List<SCodeInfo> findByLineIdx(List<String> lineArray){
38 38 List<SCodeInfo> rs = new ArrayList<>();
39 39  
40   - for(String coed : lineArray){
41   - rs.addAll(multimap.get(coed));
  40 + try{
  41 + for(String coed : lineArray){
  42 + rs.addAll(multimap.get(coed));
  43 + }
  44 + }catch (Exception e){
  45 + logger.error("", e);
42 46 }
43 47 return rs;
44 48 }
... ... @@ -116,13 +120,13 @@ public class ScheduleStationCodeChecker {
116 120  
117 121  
118 122 private Map<String, SCodeInfo> allRealCodeInfo() {
119   - String sql = "select line_code,directions as up_down,station_code as real_station_code,station_name from bsth_c_stationroute where line in (select id from bsth_c_line where destroy=0)";
  123 + String sql = "select line_code,directions as up_down,station_code as real_station_code,station_name from bsth_c_stationroute where line in (select id from bsth_c_line where destroy=0) and destroy=0";
120 124 List<SCodeInfo> realList = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SCodeInfo.class));
121 125 Map<String, SCodeInfo> realMap = new HashMap<>();
122 126  
123 127 for (SCodeInfo sci : realList) {
124 128 realMap.put(sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getStationName(), sci);
125   - realMap.put(sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getStationCode(), sci);
  129 + realMap.put(sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getRealStationCode(), sci);
126 130 }
127 131  
128 132 return realMap;
... ...
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
... ... @@ -9,6 +9,7 @@ import com.bsth.entity.realcontrol.ScheduleRealInfo;
9 9 import com.bsth.util.Arith;
10 10 import com.bsth.websocket.handler.SendUtils;
11 11 import com.google.common.collect.ArrayListMultimap;
  12 +import org.apache.commons.lang3.StringUtils;
12 13 import org.slf4j.Logger;
13 14 import org.slf4j.LoggerFactory;
14 15 import org.springframework.beans.BeansException;
... ... @@ -64,12 +65,14 @@ public class LateAdjustHandle implements ApplicationContextAware{
64 65 && sch.getDfsj().compareTo(config.getYjtkEnd()) <= 0){
65 66  
66 67 ScheduleRealInfo old = popLateSch(sch);
67   - if(null != old){
  68 +
  69 + //班次被压入
  70 + if(lateSchMaps.containsEntry(sch.getClZbh(), sch)){
  71 +
  72 + logger.info("【应发未到 -多个("+lateSchMaps.get(sch.getClZbh()).size()+")】班次 " + sch.getClZbh() + " -" + sch.getDfsj() + " -id: " + sch.getId() + " -加入误点调整!");
68 73 //通知客户端
69 74 sch.setLate2(true);
70 75 sendUtils.sendAutoWdtz(sch, old);
71   -
72   - logger.info("【应发未到】班次 " + sch.getClZbh() + " -" + sch.getDfsj() + " -id: " + sch.getId() + " -加入误点调整!");
73 76 }
74 77 }
75 78  
... ... @@ -84,15 +87,17 @@ public class LateAdjustHandle implements ApplicationContextAware{
84 87 * @return 返回被移除的误点班次
85 88 */
86 89 private static ScheduleRealInfo popLateSch(ScheduleRealInfo sch) {
87   - List<ScheduleRealInfo> list = lateSchMaps.get(sch.getXlBm());
  90 + List<ScheduleRealInfo> list = lateSchMaps.get(sch.getClZbh());
88 91  
89 92 if(null == list || list.size() == 0)
90 93 lateSchMaps.put(sch.getClZbh(), sch);
91 94 else {
92 95 ScheduleRealInfo old = findExistQdz(list, sch.getQdzCode(), sch.getQdzName());
93 96  
94   - //同一个起点,保留时间最大的班次
95   - if(null == old || old.getDfsjT() < sch.getDfsjT()){
  97 + if(null == old)
  98 + lateSchMaps.put(sch.getClZbh(), sch);
  99 + else if(old.getDfsjT() < sch.getDfsjT()){
  100 + //同一个起点,保留时间最大的班次
96 101 lateSchMaps.remove(old.getClZbh(), old);
97 102 lateSchMaps.put(sch.getClZbh(), sch);
98 103  
... ... @@ -155,8 +160,12 @@ public class LateAdjustHandle implements ApplicationContextAware{
155 160 return;
156 161  
157 162 String key = gps.getStopNo();
158   - if(gps.getInstation()==1)//站点名称
159   - key = gps.getLineId() + "_" + gps.getUpDown() + "_" + gps.getStopNo();
  163 + if(gps.getInstation()==1){
  164 + if(StringUtils.isNotEmpty(gps.getCarparkNo()))
  165 + key = gps.getCarparkNo();//停车场名称
  166 + else
  167 + key = gps.getLineId() + "_" + gps.getUpDown() + "_" + gps.getStopNo();//站点名称
  168 + }
160 169  
161 170 gps.setStationName(BasicData.stationCode2NameMap.get(key));
162 171 //根据起点站获取误点班次
... ...
src/main/java/com/bsth/data/schedule/thread/SubmitToTrafficManage.java
... ... @@ -25,36 +25,48 @@ public class SubmitToTrafficManage extends Thread{
25 25 @Override
26 26 public void run() {
27 27 logger.info("开始提交数据到运管处...");
28   -
29   - try {
30   - //路单
31   - trafficManageService.setLD();
32   - } catch (Exception e) {
33   - logger.error("提交路单到运管处失败", e);
  28 + boolean isContinue = true;
  29 + // 上传路单,如果接口异常,会自动重传
  30 + while (isContinue){
  31 + try {
  32 + //路单
  33 + trafficManageService.setLD();
  34 + isContinue = false;
  35 + } catch (Exception e) {
  36 + logger.error("提交路单到运管处失败", e);
  37 + try {
  38 + // 如果出现异常,程序暂停60分钟后再重新执行
  39 + Thread.sleep(60 * 60 * 1000);
  40 + } catch (Exception ex) { }
  41 + }
34 42 }
35   - try {
36   - //车辆里程、油耗
37   - trafficManageService.setLCYH();
38   - } catch (Exception e) {
39   - logger.error("提交车辆里程、油耗到运管处失败", e);
40   - }
41   - try {
42   - //线路调度日报
43   - trafficManageService.setDDRB();
44   - } catch (Exception e) {
45   - logger.error("提交线路调度日报到运管处失败", e);
46   - }
47   - try {
48   - //线路计划班次表
49   - trafficManageService.setJHBC();
50   - } catch (Exception e) {
51   - logger.error("提交线路计划班次表到运管处失败", e);
52   - }
53   - try {
54   - // 运管处基础数据更新
55   - ygcBasicDataService.updateYgcBasicData();
56   - } catch (Exception e) {
57   - logger.error("运管处基础数据更新失败", e);
  43 +
  44 + // 路单上传成功后,再上传其他数据
  45 + if(!isContinue){
  46 + try {
  47 + //车辆里程、油耗
  48 + trafficManageService.setLCYH();
  49 + } catch (Exception e) {
  50 + logger.error("提交车辆里程、油耗到运管处失败", e);
  51 + }
  52 + try {
  53 + //线路调度日报
  54 + trafficManageService.setDDRB();
  55 + } catch (Exception e) {
  56 + logger.error("提交线路调度日报到运管处失败", e);
  57 + }
  58 + try {
  59 + //线路计划班次表
  60 + trafficManageService.setJHBC();
  61 + } catch (Exception e) {
  62 + logger.error("提交线路计划班次表到运管处失败", e);
  63 + }
  64 + try {
  65 + // 运管处基础数据更新
  66 + ygcBasicDataService.updateYgcBasicData();
  67 + } catch (Exception e) {
  68 + logger.error("运管处基础数据更新失败", e);
  69 + }
58 70 }
59 71 logger.info("提交数据到运管处结束!");
60 72 }
... ...
src/main/java/com/bsth/entity/calc/CalcBusMileage.java 0 → 100644
  1 +package com.bsth.entity.calc;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +@Entity
  11 +@Table(name = "calc_bus_mileage")
  12 +public class CalcBusMileage {
  13 + /* 主键*/
  14 + @Id
  15 + @GeneratedValue
  16 + private Long id;
  17 + /* 日期*/
  18 + private Date date;
  19 + /* 日期字符串*/
  20 + private String dateStr;
  21 + /* 线路编码*/
  22 + private String xl;
  23 + /* 线路名称*/
  24 + private String xlName;
  25 + /* 公司代码*/
  26 + private String gsdm;
  27 + /* 公司名称*/
  28 + private String gsName;
  29 + /* 分公司代码*/
  30 + private String fgsdm;
  31 + /* 分公司名称*/
  32 + private String fgsName;
  33 + /* 车号*/
  34 + private String nbbm;
  35 + /* 司机职号*/
  36 + private String jGh;
  37 + /* 司机姓名*/
  38 + private String jName;
  39 + /* 售票员职号*/
  40 + private String sGh;
  41 + /* 售票员姓名*/
  42 + private String sName;
  43 + /* 行驶里程(包括空放)*/
  44 + private Double zlc;
  45 + /* 计划内营运里程*/
  46 + private Double jhnlc;
  47 + /* 临时性多样化调度营运里程*/
  48 + private Double jhwlc;
  49 + /* 计划内进出场空驶*/
  50 + private Double jhnjcclc;
  51 + /* 计划外进出场空驶*/
  52 + private Double jhwjcclc;
  53 + /* 计划外进出场空驶_*/
  54 + private Double jhwjcclcz;
  55 + /* 空放空驶*/
  56 + private Double kfks;
  57 + /* 故障进出场空驶*/
  58 + private Double zrwjcclc;
  59 + /* 肇事进出场空驶*/
  60 + private Double zrwjcclc1;
  61 + /* 纠纷进出场空驶*/
  62 + private Double zrwjcclc2;
  63 + /* 其他进出场空驶*/
  64 + private Double zrwjcclcqt;
  65 + /* 临加营运公里*/
  66 + private Double ljyy;
  67 + /* 临加进出场空驶*/
  68 + private Double ljjcc;
  69 + /* 临加空放空驶*/
  70 + private Double ljkfks;
  71 + /* 电耗量*/
  72 + private Double dhl;
  73 + /* 加电量*/
  74 + private Double cdl;
  75 + /* 耗油量*/
  76 + private Double yhl;
  77 + /* 加注量*/
  78 + private Double jzl;
  79 + /* 非营业用油*/
  80 + private Double hyl;
  81 + /* 计划总公里*/
  82 + private Double jhzlc;
  83 + /* 备注*/
  84 + private String remark;
  85 + /* 创建时间*/
  86 + private Date createDate;
  87 +
  88 + public Long getId() {
  89 + return id;
  90 + }
  91 + public void setId(Long id) {
  92 + this.id = id;
  93 + }
  94 + public Date getDate() {
  95 + return date;
  96 + }
  97 + public void setDate(Date date) {
  98 + this.date = date;
  99 + }
  100 + public String getDateStr() {
  101 + return dateStr;
  102 + }
  103 + public void setDateStr(String dateStr) {
  104 + this.dateStr = dateStr;
  105 + }
  106 + public String getXl() {
  107 + return xl;
  108 + }
  109 + public void setXl(String xl) {
  110 + this.xl = xl;
  111 + }
  112 + public String getXlName() {
  113 + return xlName;
  114 + }
  115 + public void setXlName(String xlName) {
  116 + this.xlName = xlName;
  117 + }
  118 + public String getGsdm() {
  119 + return gsdm;
  120 + }
  121 + public void setGsdm(String gsdm) {
  122 + this.gsdm = gsdm;
  123 + }
  124 + public String getGsName() {
  125 + return gsName;
  126 + }
  127 + public void setGsName(String gsName) {
  128 + this.gsName = gsName;
  129 + }
  130 + public String getFgsdm() {
  131 + return fgsdm;
  132 + }
  133 + public void setFgsdm(String fgsdm) {
  134 + this.fgsdm = fgsdm;
  135 + }
  136 + public String getFgsName() {
  137 + return fgsName;
  138 + }
  139 + public void setFgsName(String fgsName) {
  140 + this.fgsName = fgsName;
  141 + }
  142 + public String getNbbm() {
  143 + return nbbm;
  144 + }
  145 + public void setNbbm(String nbbm) {
  146 + this.nbbm = nbbm;
  147 + }
  148 + public String getjGh() {
  149 + return jGh;
  150 + }
  151 + public void setjGh(String jGh) {
  152 + this.jGh = jGh;
  153 + }
  154 + public String getjName() {
  155 + return jName;
  156 + }
  157 + public void setjName(String jName) {
  158 + this.jName = jName;
  159 + }
  160 + public String getsGh() {
  161 + return sGh;
  162 + }
  163 + public void setsGh(String sGh) {
  164 + this.sGh = sGh;
  165 + }
  166 + public String getsName() {
  167 + return sName;
  168 + }
  169 + public void setsName(String sName) {
  170 + this.sName = sName;
  171 + }
  172 + public Double getZlc() {
  173 + return zlc;
  174 + }
  175 + public void setZlc(Double zlc) {
  176 + this.zlc = zlc;
  177 + }
  178 + public Double getJhnlc() {
  179 + return jhnlc;
  180 + }
  181 + public void setJhnlc(Double jhnlc) {
  182 + this.jhnlc = jhnlc;
  183 + }
  184 + public Double getJhwlc() {
  185 + return jhwlc;
  186 + }
  187 + public void setJhwlc(Double jhwlc) {
  188 + this.jhwlc = jhwlc;
  189 + }
  190 + public Double getJhnjcclc() {
  191 + return jhnjcclc;
  192 + }
  193 + public void setJhnjcclc(Double jhnjcclc) {
  194 + this.jhnjcclc = jhnjcclc;
  195 + }
  196 + public Double getJhwjcclc() {
  197 + return jhwjcclc;
  198 + }
  199 + public void setJhwjcclc(Double jhwjcclc) {
  200 + this.jhwjcclc = jhwjcclc;
  201 + }
  202 + public Double getJhwjcclcz() {
  203 + return jhwjcclcz;
  204 + }
  205 + public void setJhwjcclcz(Double jhwjcclcz) {
  206 + this.jhwjcclcz = jhwjcclcz;
  207 + }
  208 + public Double getKfks() {
  209 + return kfks;
  210 + }
  211 + public void setKfks(Double kfks) {
  212 + this.kfks = kfks;
  213 + }
  214 + public Double getZrwjcclc() {
  215 + return zrwjcclc;
  216 + }
  217 + public void setZrwjcclc(Double zrwjcclc) {
  218 + this.zrwjcclc = zrwjcclc;
  219 + }
  220 + public Double getZrwjcclc1() {
  221 + return zrwjcclc1;
  222 + }
  223 + public void setZrwjcclc1(Double zrwjcclc1) {
  224 + this.zrwjcclc1 = zrwjcclc1;
  225 + }
  226 + public Double getZrwjcclc2() {
  227 + return zrwjcclc2;
  228 + }
  229 + public void setZrwjcclc2(Double zrwjcclc2) {
  230 + this.zrwjcclc2 = zrwjcclc2;
  231 + }
  232 + public Double getZrwjcclcqt() {
  233 + return zrwjcclcqt;
  234 + }
  235 + public void setZrwjcclcqt(Double zrwjcclcqt) {
  236 + this.zrwjcclcqt = zrwjcclcqt;
  237 + }
  238 + public Double getLjyy() {
  239 + return ljyy;
  240 + }
  241 + public void setLjyy(Double ljyy) {
  242 + this.ljyy = ljyy;
  243 + }
  244 + public Double getLjjcc() {
  245 + return ljjcc;
  246 + }
  247 + public void setLjjcc(Double ljjcc) {
  248 + this.ljjcc = ljjcc;
  249 + }
  250 + public Double getLjkfks() {
  251 + return ljkfks;
  252 + }
  253 + public void setLjkfks(Double ljkfks) {
  254 + this.ljkfks = ljkfks;
  255 + }
  256 + public Double getDhl() {
  257 + return dhl;
  258 + }
  259 + public void setDhl(Double dhl) {
  260 + this.dhl = dhl;
  261 + }
  262 + public Double getCdl() {
  263 + return cdl;
  264 + }
  265 + public void setCdl(Double cdl) {
  266 + this.cdl = cdl;
  267 + }
  268 + public Double getYhl() {
  269 + return yhl;
  270 + }
  271 + public void setYhl(Double yhl) {
  272 + this.yhl = yhl;
  273 + }
  274 + public Double getJzl() {
  275 + return jzl;
  276 + }
  277 + public void setJzl(Double jzl) {
  278 + this.jzl = jzl;
  279 + }
  280 + public Double getHyl() {
  281 + return hyl;
  282 + }
  283 + public void setHyl(Double hyl) {
  284 + this.hyl = hyl;
  285 + }
  286 + public Double getJhzlc() {
  287 + return jhzlc;
  288 + }
  289 + public void setJhzlc(Double jhzlc) {
  290 + this.jhzlc = jhzlc;
  291 + }
  292 + public String getRemark() {
  293 + return remark;
  294 + }
  295 + public void setRemark(String remark) {
  296 + this.remark = remark;
  297 + }
  298 + public Date getCreateDate() {
  299 + return createDate;
  300 + }
  301 + public void setCreateDate(Date createDate) {
  302 + this.createDate = createDate;
  303 + }
  304 +
  305 +}
... ...
src/main/java/com/bsth/entity/calc/CalcLineMileage.java 0 → 100644
  1 +package com.bsth.entity.calc;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import javax.persistence.Entity;
  6 +import javax.persistence.GeneratedValue;
  7 +import javax.persistence.Id;
  8 +import javax.persistence.Table;
  9 +
  10 +@Entity
  11 +@Table(name = "calc_line_mileage")
  12 +public class CalcLineMileage {
  13 + /* 主键*/
  14 + @Id
  15 + @GeneratedValue
  16 + private Long id;
  17 + /* 日期*/
  18 + private Date date;
  19 + /* 日期字符串*/
  20 + private String dateStr;
  21 + /* 线路编码*/
  22 + private String xl;
  23 + /* 线路名称*/
  24 + private String xlName;
  25 + /* 公司代码*/
  26 + private String gsdm;
  27 + /* 公司名称*/
  28 + private String gsName;
  29 + /* 分公司代码*/
  30 + private String fgsdm;
  31 + /* 分公司名称*/
  32 + private String fgsName;
  33 + /* 计划总里程*/
  34 + private Double jhzlc;
  35 + /* 计划营运程*/
  36 + private Double jhlc;
  37 + /* 计划空驶程*/
  38 + private Double jcclc;
  39 + /* 实际总里程*/
  40 + private Double sjzgl;
  41 + /* 计划内里程*/
  42 + private Double jhnlc;
  43 + /* 计划外里程*/
  44 + private Double jhwlc;
  45 + /* 计划内进出场空驶*/
  46 + private Double jhnjcclc;
  47 + /* 计划外进出场空驶*/
  48 + private Double jhwjcclc;
  49 + /* 计划外进出场空驶_*/
  50 + private Double jhwjcclcz;
  51 + /* 故障进出场空驶*/
  52 + private Double zrwjcclc;
  53 + /* 肇事进出场空驶*/
  54 + private Double zrwjcclc1;
  55 + /* 纠纷进出场空驶*/
  56 + private Double zrwjcclc2;
  57 + /* 其他进出场空驶*/
  58 + private Double zrwjcclcqt;
  59 + /* 空放 空驶*/
  60 + private Double kfks;
  61 + /* 少驶营运里程*/
  62 + private Double lbss;
  63 + /* 少驶 路阻*/
  64 + private Double ssglLz;
  65 + /* 少驶 吊慢*/
  66 + private Double ssglDm;
  67 + /* 少驶 故障*/
  68 + private Double ssglGz;
  69 + /* 少驶 纠纷*/
  70 + private Double ssglJf;
  71 + /* 少驶 肇事*/
  72 + private Double ssglZs;
  73 + /* 少驶 缺人*/
  74 + private Double ssglQr;
  75 + /* 少驶 缺车*/
  76 + private Double ssglQc;
  77 + /* 少驶 客稀*/
  78 + private Double ssglKx;
  79 + /* 少驶 气候*/
  80 + private Double ssglQh;
  81 + /* 少驶 援外*/
  82 + private Double ssglYw;
  83 + /* 少驶 其他*/
  84 + private Double ssglOther;
  85 + /* 临加营运公里*/
  86 + private Double ljyy;
  87 + /* 临加进出场空驶*/
  88 + private Double ljjcc;
  89 + /* 临加空放空驶*/
  90 + private Double ljkfks;
  91 + /* 备注*/
  92 + private String remark;
  93 + /* 创建时间*/
  94 + private Date createDate;
  95 +
  96 + public Long getId() {
  97 + return id;
  98 + }
  99 + public void setId(Long id) {
  100 + this.id = id;
  101 + }
  102 + public Date getDate() {
  103 + return date;
  104 + }
  105 + public void setDate(Date date) {
  106 + this.date = date;
  107 + }
  108 + public String getDateStr() {
  109 + return dateStr;
  110 + }
  111 + public void setDateStr(String dateStr) {
  112 + this.dateStr = dateStr;
  113 + }
  114 + public String getXl() {
  115 + return xl;
  116 + }
  117 + public void setXl(String xl) {
  118 + this.xl = xl;
  119 + }
  120 + public String getXlName() {
  121 + return xlName;
  122 + }
  123 + public void setXlName(String xlName) {
  124 + this.xlName = xlName;
  125 + }
  126 + public String getGsdm() {
  127 + return gsdm;
  128 + }
  129 + public void setGsdm(String gsdm) {
  130 + this.gsdm = gsdm;
  131 + }
  132 + public String getGsName() {
  133 + return gsName;
  134 + }
  135 + public void setGsName(String gsName) {
  136 + this.gsName = gsName;
  137 + }
  138 + public String getFgsdm() {
  139 + return fgsdm;
  140 + }
  141 + public void setFgsdm(String fgsdm) {
  142 + this.fgsdm = fgsdm;
  143 + }
  144 + public String getFgsName() {
  145 + return fgsName;
  146 + }
  147 + public void setFgsName(String fgsName) {
  148 + this.fgsName = fgsName;
  149 + }
  150 + public Double getJhzlc() {
  151 + return jhzlc;
  152 + }
  153 + public void setJhzlc(Double jhzlc) {
  154 + this.jhzlc = jhzlc;
  155 + }
  156 + public Double getJhlc() {
  157 + return jhlc;
  158 + }
  159 + public void setJhlc(Double jhlc) {
  160 + this.jhlc = jhlc;
  161 + }
  162 + public Double getJcclc() {
  163 + return jcclc;
  164 + }
  165 + public void setJcclc(Double jcclc) {
  166 + this.jcclc = jcclc;
  167 + }
  168 + public Double getSjzgl() {
  169 + return sjzgl;
  170 + }
  171 + public void setSjzgl(Double sjzgl) {
  172 + this.sjzgl = sjzgl;
  173 + }
  174 + public Double getJhnlc() {
  175 + return jhnlc;
  176 + }
  177 + public void setJhnlc(Double jhnlc) {
  178 + this.jhnlc = jhnlc;
  179 + }
  180 + public Double getJhwlc() {
  181 + return jhwlc;
  182 + }
  183 + public void setJhwlc(Double jhwlc) {
  184 + this.jhwlc = jhwlc;
  185 + }
  186 + public Double getJhnjcclc() {
  187 + return jhnjcclc;
  188 + }
  189 + public void setJhnjcclc(Double jhnjcclc) {
  190 + this.jhnjcclc = jhnjcclc;
  191 + }
  192 + public Double getJhwjcclc() {
  193 + return jhwjcclc;
  194 + }
  195 + public void setJhwjcclc(Double jhwjcclc) {
  196 + this.jhwjcclc = jhwjcclc;
  197 + }
  198 + public Double getJhwjcclcz() {
  199 + return jhwjcclcz;
  200 + }
  201 + public void setJhwjcclcz(Double jhwjcclcz) {
  202 + this.jhwjcclcz = jhwjcclcz;
  203 + }
  204 + public Double getZrwjcclc() {
  205 + return zrwjcclc;
  206 + }
  207 + public void setZrwjcclc(Double zrwjcclc) {
  208 + this.zrwjcclc = zrwjcclc;
  209 + }
  210 + public Double getZrwjcclc1() {
  211 + return zrwjcclc1;
  212 + }
  213 + public void setZrwjcclc1(Double zrwjcclc1) {
  214 + this.zrwjcclc1 = zrwjcclc1;
  215 + }
  216 + public Double getZrwjcclc2() {
  217 + return zrwjcclc2;
  218 + }
  219 + public void setZrwjcclc2(Double zrwjcclc2) {
  220 + this.zrwjcclc2 = zrwjcclc2;
  221 + }
  222 + public Double getZrwjcclcqt() {
  223 + return zrwjcclcqt;
  224 + }
  225 + public void setZrwjcclcqt(Double zrwjcclcqt) {
  226 + this.zrwjcclcqt = zrwjcclcqt;
  227 + }
  228 + public Double getKfks() {
  229 + return kfks;
  230 + }
  231 + public void setKfks(Double kfks) {
  232 + this.kfks = kfks;
  233 + }
  234 + public Double getLbss() {
  235 + return lbss;
  236 + }
  237 + public void setLbss(Double lbss) {
  238 + this.lbss = lbss;
  239 + }
  240 + public Double getSsglLz() {
  241 + return ssglLz;
  242 + }
  243 + public void setSsglLz(Double ssglLz) {
  244 + this.ssglLz = ssglLz;
  245 + }
  246 + public Double getSsglDm() {
  247 + return ssglDm;
  248 + }
  249 + public void setSsglDm(Double ssglDm) {
  250 + this.ssglDm = ssglDm;
  251 + }
  252 + public Double getSsglGz() {
  253 + return ssglGz;
  254 + }
  255 + public void setSsglGz(Double ssglGz) {
  256 + this.ssglGz = ssglGz;
  257 + }
  258 + public Double getSsglJf() {
  259 + return ssglJf;
  260 + }
  261 + public void setSsglJf(Double ssglJf) {
  262 + this.ssglJf = ssglJf;
  263 + }
  264 + public Double getSsglZs() {
  265 + return ssglZs;
  266 + }
  267 + public void setSsglZs(Double ssglZs) {
  268 + this.ssglZs = ssglZs;
  269 + }
  270 + public Double getSsglQr() {
  271 + return ssglQr;
  272 + }
  273 + public void setSsglQr(Double ssglQr) {
  274 + this.ssglQr = ssglQr;
  275 + }
  276 + public Double getSsglQc() {
  277 + return ssglQc;
  278 + }
  279 + public void setSsglQc(Double ssglQc) {
  280 + this.ssglQc = ssglQc;
  281 + }
  282 + public Double getSsglKx() {
  283 + return ssglKx;
  284 + }
  285 + public void setSsglKx(Double ssglKx) {
  286 + this.ssglKx = ssglKx;
  287 + }
  288 + public Double getSsglQh() {
  289 + return ssglQh;
  290 + }
  291 + public void setSsglQh(Double ssglQh) {
  292 + this.ssglQh = ssglQh;
  293 + }
  294 + public Double getSsglYw() {
  295 + return ssglYw;
  296 + }
  297 + public void setSsglYw(Double ssglYw) {
  298 + this.ssglYw = ssglYw;
  299 + }
  300 + public Double getSsglOther() {
  301 + return ssglOther;
  302 + }
  303 + public void setSsglOther(Double ssglOther) {
  304 + this.ssglOther = ssglOther;
  305 + }
  306 + public Double getLjyy() {
  307 + return ljyy;
  308 + }
  309 + public void setLjyy(Double ljyy) {
  310 + this.ljyy = ljyy;
  311 + }
  312 + public Double getLjjcc() {
  313 + return ljjcc;
  314 + }
  315 + public void setLjjcc(Double ljjcc) {
  316 + this.ljjcc = ljjcc;
  317 + }
  318 + public Double getLjkfks() {
  319 + return ljkfks;
  320 + }
  321 + public void setLjkfks(Double ljkfks) {
  322 + this.ljkfks = ljkfks;
  323 + }
  324 + public String getRemark() {
  325 + return remark;
  326 + }
  327 + public void setRemark(String remark) {
  328 + this.remark = remark;
  329 + }
  330 + public Date getCreateDate() {
  331 + return createDate;
  332 + }
  333 + public void setCreateDate(Date createDate) {
  334 + this.createDate = createDate;
  335 + }
  336 +
  337 +}
... ...
src/main/java/com/bsth/repository/calc/CalcBusMileageRepository.java 0 → 100644
  1 +package com.bsth.repository.calc;
  2 +
  3 +import java.util.List;
  4 +
  5 +import javax.transaction.Transactional;
  6 +
  7 +import com.bsth.entity.calc.CalcBusMileage;
  8 +import com.bsth.repository.BaseRepository;
  9 +
  10 +import org.springframework.data.jpa.repository.Modifying;
  11 +import org.springframework.data.jpa.repository.Query;
  12 +import org.springframework.stereotype.Repository;
  13 +
  14 +/**
  15 + *
  16 + */
  17 +@Repository
  18 +public interface CalcBusMileageRepository extends BaseRepository<CalcBusMileage, Integer>{
  19 +
  20 + //按照时间段统计,公司下线路
  21 + @Query(value="select DISTINCT c from CalcBusMileage c where c.xl like %?1% and c.dateStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.id")
  22 + List<CalcBusMileage> selectByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm);
  23 +
  24 + //按照时间段统计,单条线路
  25 + @Query(value="select DISTINCT c from CalcBusMileage c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.id")
  26 + List<CalcBusMileage> selectByDateAndLineTj2(String line,String date,String date2);
  27 +
  28 + //按照日期和线路删除数据
  29 + @Modifying
  30 + @Transactional
  31 + @Query(value = "delete CalcBusMileage c where c.dateStr=?1 and c.xl=?2")
  32 + void deleteByDateAndLine(String date, String line);
  33 +
  34 + //按照日期删除数据
  35 + @Modifying
  36 + @Transactional
  37 + @Query(value = "delete CalcBusMileage c where c.dateStr=?1")
  38 + void deleteByDate(String date);
  39 +
  40 +}
... ...
src/main/java/com/bsth/repository/calc/CalcLineMileageRepository.java 0 → 100644
  1 +package com.bsth.repository.calc;
  2 +
  3 +import java.util.List;
  4 +
  5 +import javax.transaction.Transactional;
  6 +
  7 +import com.bsth.entity.calc.CalcLineMileage;
  8 +import com.bsth.repository.BaseRepository;
  9 +
  10 +import org.springframework.data.jpa.repository.Modifying;
  11 +import org.springframework.data.jpa.repository.Query;
  12 +import org.springframework.stereotype.Repository;
  13 +
  14 +/**
  15 + *
  16 + */
  17 +@Repository
  18 +public interface CalcLineMileageRepository extends BaseRepository<CalcLineMileage, Integer>{
  19 +
  20 + //按照时间段统计,公司下线路
  21 + @Query(value="select DISTINCT c from CalcLineMileage c where c.xl like %?1% and c.dateStr between ?2 and ?3 and c.gsdm like %?4% and c.fgsdm like %?5% order by c.id")
  22 + List<CalcLineMileage> selectByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm);
  23 +
  24 + //按照时间段统计,单条线路
  25 + @Query(value="select DISTINCT c from CalcLineMileage c where c.xl = ?1 and c.dateStr between ?2 and ?3 order by c.id")
  26 + List<CalcLineMileage> selectByDateAndLineTj2(String line,String date,String date2);
  27 +
  28 + //按照日期和线路删除数据
  29 + @Modifying
  30 + @Transactional
  31 + @Query(value = "delete CalcLineMileage c where c.dateStr=?1 and c.xl=?2")
  32 + void deleteByDateAndLine(String date, String line);
  33 +
  34 + //按照日期删除数据
  35 + @Modifying
  36 + @Transactional
  37 + @Query(value = "delete CalcLineMileage c where c.dateStr=?1")
  38 + void deleteByDate(String date);
  39 +
  40 +}
... ...
src/main/java/com/bsth/security/WebSecurityConfig.java
... ... @@ -59,8 +59,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
59 59 .and().csrf().disable()
60 60 //禁用匿名用户功能
61 61 .anonymous().disable()
62   - //允许同源 iframe
63   - .headers().frameOptions().sameOrigin().httpStrictTransportSecurity().disable();
  62 + //允许 iframe
  63 + .headers().frameOptions().disable();
64 64  
65 65 // 同时只保持一个回话
66 66 http.sessionManagement().maximumSessions(1)
... ...
src/main/java/com/bsth/service/calc/CalcWaybillService.java
... ... @@ -3,6 +3,8 @@ package com.bsth.service.calc;
3 3 import java.util.List;
4 4 import java.util.Map;
5 5  
  6 +import com.bsth.entity.calc.CalcBusMileage;
  7 +import com.bsth.entity.calc.CalcLineMileage;
6 8 import com.bsth.entity.calc.CalcStatistics;
7 9 import com.bsth.entity.calc.CalcWaybill;
8 10 import com.bsth.service.BaseService;
... ... @@ -13,7 +15,7 @@ import com.bsth.service.BaseService;
13 15 public interface CalcWaybillService extends BaseService<CalcWaybill, Integer> {
14 16  
15 17 /**
16   - * @param date 格式如:2018-03-30(留空""默认当前日期两天前
  18 + * @param date 格式如:2018-03-30(留空""默认当前日期前第四天
17 19 * @param line (留空""默认全部线路)
18 20 */
19 21 Map<String, Object> autoGenerate(String date, String line) throws Exception;
... ... @@ -23,10 +25,19 @@ public interface CalcWaybillService extends BaseService&lt;CalcWaybill, Integer&gt; {
23 25 List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type);
24 26  
25 27 /**
26   - * @param rq 格式如:2018-03-22(留空""默认当前日期前天)
  28 + * @param rq 格式如:2018-03-22(留空""默认当前日期前天)
27 29 * @param line (留空""默认全部线路)
28 30 */
29 31 String calcDaily(String rq, String line) throws Exception;
30 32  
31 33 List<CalcStatistics> calcStatisticsDaily(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type);
  34 +
  35 + Map<String, Object> calcLineMileage(String date, String line);
  36 +
  37 + Map<String, Object> calcBusMileage(String date, String line);
  38 +
  39 + List<Map<String, Object>> getLineMileage(String gsdm, String fgsdm, String line, String date, String date2, String xlName, String zt, String by, String type);
  40 +
  41 + List<Map<String, Object>> getBusMileage(String line, String date, String date2, String xlName, String zt, String by, String type);
  42 +
32 43 }
... ...
src/main/java/com/bsth/service/calc/impl/CalcWaybillServiceImpl.java
... ... @@ -18,13 +18,19 @@ import java.util.Set;
18 18 import javax.transaction.Transactional;
19 19  
20 20 import com.bsth.common.ResponseCode;
  21 +import com.bsth.entity.Line;
  22 +import com.bsth.entity.calc.CalcBusMileage;
21 23 import com.bsth.entity.calc.CalcInterval;
  24 +import com.bsth.entity.calc.CalcLineMileage;
22 25 import com.bsth.entity.calc.CalcStatistics;
23 26 import com.bsth.entity.calc.CalcWaybill;
24 27 import com.bsth.entity.realcontrol.ChildTaskPlan;
25 28 import com.bsth.entity.realcontrol.ScheduleRealInfo;
26 29 import com.bsth.entity.sys.Interval;
  30 +import com.bsth.repository.LineRepository;
  31 +import com.bsth.repository.calc.CalcBusMileageRepository;
27 32 import com.bsth.repository.calc.CalcIntervalRepository;
  33 +import com.bsth.repository.calc.CalcLineMileageRepository;
28 34 import com.bsth.repository.calc.CalcStatisticsRepository;
29 35 import com.bsth.repository.calc.CalcWaybillRepository;
30 36 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
... ... @@ -32,6 +38,7 @@ import com.bsth.service.calc.CalcToolService;
32 38 import com.bsth.service.calc.CalcWaybillService;
33 39 import com.bsth.service.impl.BaseServiceImpl;
34 40 import com.bsth.service.report.CulateMileageService;
  41 +import com.bsth.service.report.ReportService;
35 42 import com.bsth.util.Arith;
36 43 import com.bsth.util.BatchSaveUtils;
37 44 import com.bsth.util.ReportUtils;
... ... @@ -62,6 +69,12 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
62 69 private CalcStatisticsRepository calcStatisticsRepository;
63 70  
64 71 @Autowired
  72 + private CalcLineMileageRepository calcLineMileageRepository;
  73 +
  74 + @Autowired
  75 + private CalcBusMileageRepository calcBusMileageRepository;
  76 +
  77 + @Autowired
65 78 private CalcToolService calcToolService;
66 79  
67 80 @Autowired
... ... @@ -69,7 +82,13 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
69 82  
70 83 @Autowired
71 84 private ScheduleRealInfoRepository scheduleRealInfoRepository;
  85 +
  86 + @Autowired
  87 + private LineRepository lineRepository;
72 88  
  89 + @Autowired
  90 + private ReportService reportService;
  91 +
73 92 @Autowired
74 93 JdbcTemplate jdbcTemplate;
75 94  
... ... @@ -83,20 +102,56 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
83 102 Date d = new Date();
84 103 d.setTime(d.getTime() - (4 * 1000 * 60 * 60 * 24));
85 104 date = sdf.format(d);
  105 + } else {
  106 + date = date.trim();
86 107 }
87 108 if(line == null || line.trim().length() == 0){
88 109 line = "";
  110 + } else {
  111 + line = line.trim();
89 112 }
90   - return generateNew(date, line);
  113 +
  114 + Map<String, Object> m = new HashMap<String, Object>();
  115 + try {
  116 + Map<String, Object> generateNew = generateNew(date, line);
  117 + m.put("generateNew", generateNew);
  118 + } catch (Exception e) {
  119 + // TODO: handle exception
  120 + logger.info("重新统计保存失败!");
  121 + }
  122 + try {
  123 + Map<String, Object> calcLineMileage = calcLineMileage(date, line);
  124 + m.put("lineMileage", calcLineMileage);
  125 + } catch (Exception e) {
  126 + // TODO: handle exception
  127 + logger.info("线路公里审计保存失败!");
  128 + }
  129 + try {
  130 + Map<String, Object> calcBusMileage = calcBusMileage(date, line);
  131 + m.put("busMileage", calcBusMileage);
  132 + } catch (Exception e) {
  133 + // TODO: handle exception
  134 + logger.info("路单数据审计保存失败!");
  135 + }
  136 +
  137 + return m;
91 138 }
92 139  
93 140 @Transactional
94 141 @Override
95 142 public Map<String, Object> generateNew(String date, String line) throws Exception {
96 143 Map<String, Object> newMap = new HashMap<String, Object>();
97   -
98 144 try {
99   -
  145 + if(date == null){
  146 + date = "";
  147 + } else {
  148 + date = date.trim();
  149 + }
  150 + if(line == null){
  151 + line = "";
  152 + } else {
  153 + line = line.trim();
  154 + }
100 155 if(date.length() != 0 && line.length() != 0){
101 156 calcRepository.deleteByDateAndLine(date, line);
102 157 calcIntervalRepository.deleteByDateAndLine(date, line);
... ... @@ -414,11 +469,37 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
414 469 resList.add(m);
415 470 }
416 471  
  472 + if (type != null && type.length() != 0 && type.equals("export")) {
  473 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  474 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  475 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  476 + Map<String, Object> m = new HashMap<String, Object>();
  477 + m.put("date", date+"至"+date2);
  478 + ReportUtils ee = new ReportUtils();
  479 + try {
  480 + String dateTime = "";
  481 + if(date.equals(date2)){
  482 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  483 + } else {
  484 + dateTime = sdfSimple.format(sdfMonth.parse(date))
  485 + +"-"+sdfSimple.format(sdfMonth.parse(date2));
  486 + }
  487 + listI.add(resList.iterator());
  488 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  489 + ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_.xls",
  490 + path + "export/" + dateTime + "-" + xlName + "-统计日报.xls");
  491 + } catch (Exception e) {
  492 + // TODO: handle exception
  493 + //e.printStackTrace();
  494 + logger.info("" , e);
  495 + }
  496 + }
  497 +
417 498 return resList;
418 499 }
419 500  
420 501 /**
421   - * @param rq 格式如:2018-03-22(留空""默认当前日期前天)
  502 + * @param rq 格式如:2018-03-22(留空""默认当前日期前天)
422 503 * @param line (留空""默认全部线路)
423 504 */
424 505 @Transactional
... ... @@ -432,7 +513,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
432 513 Date dBefore = new Date();
433 514 Calendar calendar = Calendar.getInstance(); //得到日历
434 515 calendar.setTime(dNow);//把当前时间赋给日历
435   - calendar.add(Calendar.DAY_OF_MONTH, -2); //设置为前一天
  516 + calendar.add(Calendar.DAY_OF_MONTH, -4); //设置为前一天
436 517 dBefore = calendar.getTime(); //得到前一天的时间
437 518 rq = sdf.format(dBefore);
438 519 } else {
... ... @@ -448,11 +529,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
448 529 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
449 530 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
450 531  
451   - String xlSql="select gs_bm, fgs_bm from bsth_c_s_sp_info_real where schedule_date_str = '"+rq+"'";
  532 + String gsSql="select gs_bm, fgs_bm from bsth_c_s_sp_info_real where schedule_date_str = '"+rq+"'";
452 533 if(line.trim().length() > 0)
453   - xlSql += " and xl_bm = '"+line+"'";
454   - xlSql += " group by gs_bm, fgs_bm";
455   - List<Map<String, String>> gsList=jdbcTemplate.query(xlSql, new RowMapper<Map<String, String>>() {
  534 + gsSql += " and xl_bm = '"+line+"'";
  535 + gsSql += " group by gs_bm, fgs_bm";
  536 + List<Map<String, String>> gsList=jdbcTemplate.query(gsSql, new RowMapper<Map<String, String>>() {
456 537 @Override
457 538 public Map<String, String> mapRow(ResultSet arg0, int arg1) throws SQLException {
458 539 Map<String, String> m = new HashMap<String, String>();
... ... @@ -695,6 +776,78 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
695 776 resList.add(temp);
696 777 }
697 778  
  779 + List<Map<String, Object>> mapList = new ArrayList<Map<String, Object>>();
  780 + for(CalcStatistics c : resList){
  781 + Map<String, Object> m = new HashMap<String, Object>();
  782 + m.put("xlName", c.getXlName());
  783 + m.put("jhzlc", c.getJhzlc());
  784 + m.put("jhlc", c.getJhyylc());
  785 + m.put("jcclc", c.getJhkslc());
  786 + m.put("sjzgl", c.getSjzlc());
  787 + m.put("sjgl", c.getSjyylc());
  788 + m.put("sjksgl", c.getSjkslc());
  789 + m.put("ssgl", c.getSslc());
  790 + m.put("ssbc", c.getSsbc());
  791 + m.put("ssgl_lz", c.getLzlc());
  792 + m.put("ssgl_dm", c.getDmlc());
  793 + m.put("ssgl_gz", c.getGzlc());
  794 + m.put("ssgl_jf", c.getJflc());
  795 + m.put("ssgl_zs", c.getZslc());
  796 + m.put("ssgl_qr", c.getQrlc());
  797 + m.put("ssgl_qc", c.getQclc());
  798 + m.put("ssgl_kx", c.getKxlc());
  799 + m.put("ssgl_qh", c.getQhlc());
  800 + m.put("ssgl_yw", c.getYwlc());
  801 + m.put("ssgl_other", c.getQtlc());
  802 + m.put("ljgl", c.getLjlc());
  803 + m.put("jhbc", c.getJhbcq());
  804 + m.put("jhbc_m", c.getJhbcz());
  805 + m.put("jhbc_a", c.getJhbcw());
  806 + m.put("sjbc", c.getSjbcq());
  807 + m.put("sjbc_m", c.getSjbcz());
  808 + m.put("sjbc_a", c.getSjbcw());
  809 + m.put("ljbc", c.getLjbcq());
  810 + m.put("ljbc_m", c.getLjbcz());
  811 + m.put("ljbc_a", c.getLjbcw());
  812 + m.put("fzbc", c.getFzbcq());
  813 + m.put("fzbc_m", c.getFzbcz());
  814 + m.put("fzbc_a", c.getFzbcw());
  815 + m.put("dtbc", c.getDtbcq());
  816 + m.put("dtbc_m", c.getDtbcz());
  817 + m.put("dtbc_a", c.getDtbcw());
  818 + m.put("djg", c.getDjgq());
  819 + m.put("djg_m", c.getDjgz());
  820 + m.put("djg_a", c.getDjgw());
  821 + m.put("djg_time", c.getDjgsj());
  822 + mapList.add(m);
  823 + }
  824 +
  825 + if (type != null && type.length() != 0 && type.equals("export")) {
  826 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  827 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  828 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  829 + Map<String, Object> m = new HashMap<String, Object>();
  830 + m.put("date", date+"至"+date2);
  831 + ReportUtils ee = new ReportUtils();
  832 + try {
  833 + String dateTime = "";
  834 + if(date.equals(date2)){
  835 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  836 + } else {
  837 + dateTime = sdfSimple.format(sdfMonth.parse(date))
  838 + +"-"+sdfSimple.format(sdfMonth.parse(date2));
  839 + }
  840 + listI.add(mapList.iterator());
  841 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  842 + ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_.xls",
  843 + path + "export/" + dateTime + "-" + xlName + "-统计日报.xls");
  844 + } catch (Exception e) {
  845 + // TODO: handle exception
  846 + //e.printStackTrace();
  847 + logger.info("" , e);
  848 + }
  849 + }
  850 +
698 851 return resList;
699 852 }
700 853  
... ... @@ -740,5 +893,572 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl&lt;CalcWaybill, Integer
740 893 s.setDjgsj(s.getDjgsj()>s_.getDjgsj()?s.getDjgsj():s_.getDjgsj());
741 894 return s;
742 895 }
  896 +
  897 + @Transactional
  898 + @Override
  899 + public Map<String, Object> calcLineMileage(String date, String line) {
  900 + Map<String, Object> resMap = new HashMap<String, Object>();
  901 +
  902 + if(date.length() == 0){
  903 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  904 + Date d = new Date();
  905 + d.setTime(d.getTime() - 4 * 1000 * 60 * 60 * 24);
  906 + date = sdf.format(d);
  907 + }
  908 +
  909 + resMap.put("date", date);
  910 + resMap.put("line", line);
  911 + if(date == null || date.trim().length() == 0){
  912 + resMap.put("status", ResponseCode.ERROR);
  913 + resMap.put("remark", "日期不正确或为空");
  914 + return resMap;
  915 + } else {
  916 + date = date.trim();
  917 + }
  918 + if(line == null){
  919 + line = "";
  920 + } else {
  921 + line = line.trim();
  922 + }
  923 +
  924 + Map<String, Object> map = new HashMap<String, Object>();
  925 + List<CalcLineMileage> list = new ArrayList<CalcLineMileage>();
  926 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  927 + Date dateTime = new Date();
  928 +
  929 + try {
  930 +
  931 + String gsSql="select gs_bm, fgs_bm from bsth_c_s_sp_info_real where schedule_date_str = '"+date+"'";
  932 + if(line.trim().length() > 0)
  933 + gsSql += " and xl_bm = '"+line+"'";
  934 + gsSql += " group by gs_bm, fgs_bm";
  935 + List<Map<String, String>> gsList=jdbcTemplate.query(gsSql, new RowMapper<Map<String, String>>() {
  936 + @Override
  937 + public Map<String, String> mapRow(ResultSet arg0, int arg1) throws SQLException {
  938 + Map<String, String> m = new HashMap<String, String>();
  939 + m.put("gsdm", arg0.getString("gs_bm"));
  940 + m.put("fgsdm", arg0.getString("fgs_bm"));
  941 + return m;
  942 + }});
  943 +
  944 + map.put("date", date);
  945 + map.put("date2", date);
  946 + for(Map<String, String> tempMap : gsList){
  947 + map.put("gsdm", tempMap.get("gsdm").toString());
  948 + map.put("fgsdm", tempMap.get("fgsdm").toString());
  949 + List<Map<String, Object>> countByList = reportService.countByList(map);
  950 + for(Map<String, Object> m : countByList){
  951 + if(!m.containsKey("xlName") || m.get("xlName")==null
  952 + || m.get("xlName").toString().equals("合计"))
  953 + continue;
  954 + CalcLineMileage c = new CalcLineMileage();
  955 + c.setDate(sdf.parse(date));
  956 + c.setDateStr(date);
  957 + c.setGsdm(map.get("gsdm").toString());
  958 + c.setGsName(m.get("gs").toString());
  959 + c.setFgsdm(map.get("fgsdm").toString());
  960 + c.setFgsName(m.get("fgs").toString());
  961 + c.setXl(m.get("line").toString());
  962 + c.setXlName(m.get("xlName").toString());
  963 + c.setJhzlc(Double.valueOf(m.get("jhzlc").toString()));
  964 + c.setJhlc(Double.valueOf(m.get("jhlc").toString()));
  965 + c.setJcclc(Double.valueOf(m.get("jcclc").toString()));
  966 + c.setSjzgl(Double.valueOf(m.get("sjzgl").toString()));
  967 + c.setJhnlc(Double.valueOf(m.get("jhnlc").toString()));
  968 + c.setJhwlc(Double.valueOf(m.get("jhwlc").toString()));
  969 + c.setJhnjcclc(Double.valueOf(m.get("jhnjcclc").toString()));
  970 + c.setJhwjcclc(Double.valueOf(m.get("jhwjcclc").toString()));
  971 + c.setJhwjcclcz(Double.valueOf(m.get("jhwjcclc_z").toString()));
  972 + c.setZrwjcclc(Double.valueOf(m.get("zrwjcclc").toString()));
  973 + c.setZrwjcclc1(Double.valueOf(m.get("zrwjcclc1").toString()));
  974 + c.setZrwjcclc2(Double.valueOf(m.get("zrwjcclc2").toString()));
  975 + c.setZrwjcclcqt(Double.valueOf(m.get("zrwjcclcqt").toString()));
  976 + c.setKfks(Double.valueOf(m.get("kfks").toString()));
  977 + c.setLbss(Double.valueOf(m.get("lbss").toString()));
  978 + c.setSsglLz(Double.valueOf(m.get("ssgl_lz").toString()));
  979 + c.setSsglDm(Double.valueOf(m.get("ssgl_dm").toString()));
  980 + c.setSsglGz(Double.valueOf(m.get("ssgl_gz").toString()));
  981 + c.setSsglJf(Double.valueOf(m.get("ssgl_jf").toString()));
  982 + c.setSsglZs(Double.valueOf(m.get("ssgl_zs").toString()));
  983 + c.setSsglQr(Double.valueOf(m.get("ssgl_qr").toString()));
  984 + c.setSsglQc(Double.valueOf(m.get("ssgl_qc").toString()));
  985 + c.setSsglKx(Double.valueOf(m.get("ssgl_kx").toString()));
  986 + c.setSsglQh(Double.valueOf(m.get("ssgl_qh").toString()));
  987 + c.setSsglYw(Double.valueOf(m.get("ssgl_yw").toString()));
  988 + c.setSsglOther(Double.valueOf(m.get("ssgl_other").toString()));
  989 + c.setLjyy(Double.valueOf(m.get("ljyy").toString()));
  990 + c.setLjjcc(Double.valueOf(m.get("ljjcc").toString()));
  991 + c.setLjkfks(Double.valueOf(m.get("ljkfks").toString()));
  992 + c.setCreateDate(dateTime);
  993 + list.add(c);
  994 + }
  995 + }
  996 +
  997 + if(line.length() > 0){
  998 + calcLineMileageRepository.deleteByDateAndLine(date, line);
  999 + } else {
  1000 + calcLineMileageRepository.deleteByDate(date);
  1001 + }
  1002 + calcLineMileageRepository.save(list);
  1003 +
  1004 + resMap.put("status", ResponseCode.SUCCESS);
  1005 + } catch (Exception e) {
  1006 + // TODO: handle exception
  1007 + resMap.put("status", ResponseCode.ERROR);
  1008 + logger.error("save erro.", e);
  1009 + e.printStackTrace();
  1010 + }
  1011 + return resMap;
  1012 + }
  1013 +
  1014 + @Transactional
  1015 + @Override
  1016 + public Map<String, Object> calcBusMileage(String date, String line) {
  1017 + Map<String, Object> resMap = new HashMap<String, Object>();
  1018 +
  1019 + if(date.length() == 0){
  1020 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  1021 + Date d = new Date();
  1022 + d.setTime(d.getTime() - 4 * 1000 * 60 * 60 * 24);
  1023 + date = sdf.format(d);
  1024 + }
  1025 +
  1026 + resMap.put("date", date);
  1027 + resMap.put("line", line);
  1028 + if(date == null || date.trim().length() == 0){
  1029 + resMap.put("status", ResponseCode.ERROR);
  1030 + resMap.put("remark", "日期不正确或为空");
  1031 + return resMap;
  1032 + } else {
  1033 + date = date.trim();
  1034 + }
  1035 + if(line == null){
  1036 + line = "";
  1037 + } else {
  1038 + line = line.trim();
  1039 + }
  1040 +
  1041 + Map<String, Object> map = new HashMap<String, Object>();
  1042 + Map<String, Object> xlmap = new HashMap<String, Object>();
  1043 + List<CalcBusMileage> list = new ArrayList<CalcBusMileage>();
  1044 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  1045 + Date dateTime = new Date();
  1046 +
  1047 + try {
  1048 +
  1049 + String gsSql="select gs_bm, max(gs_name) gs_name, fgs_bm from bsth_c_s_sp_info_real"
  1050 + + " where schedule_date_str = '"+date+"'";
  1051 + if(line.trim().length() > 0)
  1052 + gsSql += " and xl_bm = '"+line+"'";
  1053 + gsSql += " group by gs_bm, fgs_bm";
  1054 + List<Map<String, String>> gsList=jdbcTemplate.query(gsSql, new RowMapper<Map<String, String>>() {
  1055 + @Override
  1056 + public Map<String, String> mapRow(ResultSet arg0, int arg1) throws SQLException {
  1057 + Map<String, String> m = new HashMap<String, String>();
  1058 + m.put("gsdm", arg0.getString("gs_bm"));
  1059 + m.put("gsName", arg0.getString("gs_name"));
  1060 + m.put("fgsdm", arg0.getString("fgs_bm"));
  1061 + return m;
  1062 + }});
  1063 +
  1064 + List<Line> xlList = lineRepository.findAllService();
  1065 + for(Line l : xlList){
  1066 + xlmap.put(l.getName(), l.getLineCode());
  1067 + }
  1068 +
  1069 + map.put("date", date);
  1070 + map.put("date2", date);
  1071 + map.put("zs", "js");
  1072 + for(Map<String, String> tempMap : gsList){
  1073 + map.put("gsdm", tempMap.get("gsdm").toString());
  1074 + map.put("fgsdm", tempMap.get("fgsdm").toString());
  1075 + List<Map<String, Object>> countByList = reportService.countByBusList(map);
  1076 + for(Map<String, Object> m : countByList){
  1077 + if(!m.containsKey("xlName") || m.get("xlName")==null
  1078 + || m.get("xlName").toString().equals("合计"))
  1079 + continue;
  1080 + CalcBusMileage c = new CalcBusMileage();
  1081 + c.setDate(sdf.parse(date));
  1082 + c.setDateStr(date);
  1083 + c.setGsdm(map.get("gsdm").toString());
  1084 + c.setGsName(tempMap.get("gsName").toString());
  1085 + c.setFgsdm(map.get("fgsdm").toString());
  1086 + c.setFgsName(m.get("fgs").toString());
  1087 + c.setXl(xlmap.get(m.get("xlName").toString()).toString());
  1088 + c.setXlName(m.get("xlName").toString());
  1089 + c.setNbbm(m.get("nbbm").toString());
  1090 + c.setjGh(m.get("jGh").toString());
  1091 + c.setjName(m.get("jName").toString());
  1092 + c.setsGh(m.get("sGh").toString());
  1093 + c.setsName(m.get("sName").toString());
  1094 + c.setZlc(Double.valueOf(m.get("zlc").toString()));
  1095 + c.setJhnlc(Double.valueOf(m.get("jhnlc").toString()));
  1096 + c.setJhwlc(Double.valueOf(m.get("jhwlc").toString()));
  1097 + c.setJhnjcclc(Double.valueOf(m.get("jhnjcclc").toString()));
  1098 + c.setJhwjcclc(Double.valueOf(m.get("jhwjcclc").toString()));
  1099 + c.setJhwjcclcz(Double.valueOf(m.get("jhwjcclc_z").toString()));
  1100 + c.setKfks(Double.valueOf(m.get("kfks").toString()));
  1101 + c.setZrwjcclc(Double.valueOf(m.get("zrwjcclc").toString()));
  1102 + c.setZrwjcclc1(Double.valueOf(m.get("zrwjcclc1").toString()));
  1103 + c.setZrwjcclc2(Double.valueOf(m.get("zrwjcclc2").toString()));
  1104 + c.setZrwjcclcqt(Double.valueOf(m.get("zrwjcclcqt").toString()));
  1105 + c.setLjyy(Double.valueOf(m.get("ljyy").toString()));
  1106 + c.setLjjcc(Double.valueOf(m.get("ljjcc").toString()));
  1107 + if(m.containsKey("ljkfks") && m.get("ljkfks") != null){
  1108 + c.setLjkfks(Double.valueOf(m.get("ljkfks").toString()));
  1109 + } else {
  1110 + c.setLjkfks(0d);
  1111 + }
  1112 + c.setDhl(Double.valueOf(m.get("dhl").toString()));
  1113 + c.setCdl(Double.valueOf(m.get("cdl").toString()));
  1114 + c.setYhl(Double.valueOf(m.get("yhl").toString()));
  1115 + c.setJzl(Double.valueOf(m.get("jzl").toString()));
  1116 + c.setHyl(Double.valueOf(m.get("hyl").toString()));
  1117 + c.setJhzlc(Double.valueOf(m.get("jhzlc").toString()));
  1118 + c.setCreateDate(dateTime);
  1119 + list.add(c);
  1120 + }
  1121 + }
  1122 +
  1123 + if(line.length() > 0){
  1124 + calcBusMileageRepository.deleteByDateAndLine(date, line);
  1125 + } else {
  1126 + calcBusMileageRepository.deleteByDate(date);
  1127 + }
  1128 + calcBusMileageRepository.save(list);
  1129 +
  1130 + resMap.put("status", ResponseCode.SUCCESS);
  1131 + } catch (Exception e) {
  1132 + // TODO: handle exception
  1133 + resMap.put("status", ResponseCode.ERROR);
  1134 + logger.error("save erro.", e);
  1135 + e.printStackTrace();
  1136 + }
  1137 + return resMap;
  1138 + }
  1139 +
  1140 + @Override
  1141 + public List<Map<String, Object>> getLineMileage(String gsdm, String fgsdm, String line,
  1142 + String date, String date2, String xlName, String zt, String by, String type) {
  1143 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  1144 + List<CalcLineMileage> resList = new ArrayList<CalcLineMileage>();
  1145 + List<CalcLineMileage> list = new ArrayList<CalcLineMileage>();
  1146 + List<CalcLineMileage> calcs = new ArrayList<CalcLineMileage>();
  1147 + List<String> keyList = new ArrayList<String>();
  1148 + Map<String, List<CalcLineMileage>> keyMap = new HashMap<String, List<CalcLineMileage>>();
  1149 +
  1150 + if(line == null || line.trim().length() == 0){
  1151 + list = calcLineMileageRepository.selectByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  1152 + } else {
  1153 + list = calcLineMileageRepository.selectByDateAndLineTj2(line, date, date2);
  1154 + }
  1155 +
  1156 + for(CalcLineMileage c : list){
  1157 + String key = c.getXlName();
  1158 + if(!keyMap.containsKey(key)){
  1159 + keyMap.put(key, new ArrayList<CalcLineMileage>());
  1160 + keyList.add(key);
  1161 + }
  1162 + keyMap.get(key).add(c);
  1163 + }
  1164 +
  1165 + for(String key : keyList){
  1166 + CalcLineMileage c1 = keyMap.get(key).get(0);
  1167 + for(int i = 1; i < keyMap.get(key).size(); i++){
  1168 + CalcLineMileage c2 = keyMap.get(key).get(i);
  1169 + c1 = addLineMileage(c1, c2);
  1170 + }
  1171 + calcs.add(c1);
  1172 + }
  1173 +
  1174 + CalcLineMileage temp = new CalcLineMileage();
  1175 + temp.setXlName("合计");
  1176 + for(CalcLineMileage c : calcs){
  1177 + temp = addLineMileage(temp, c);
  1178 + resList.add(c);
  1179 + }
  1180 + if(resList.size() > 0)
  1181 + resList.add(temp);
  1182 +
  1183 + for(CalcLineMileage c : resList){
  1184 + Map<String, Object> m = new HashMap<String, Object>();
  1185 + if(c.getXlName().equals("合计")){
  1186 + m.put("gsdm", "");
  1187 + m.put("gs", "");
  1188 + m.put("fgsdm", "");
  1189 + m.put("fgs", "");
  1190 + } else {
  1191 + m.put("gsdm", c.getGsdm());
  1192 + m.put("gs", c.getGsName());
  1193 + m.put("fgsdm", c.getFgsdm());
  1194 + m.put("fgs", c.getFgsName());
  1195 + }
  1196 + m.put("xlName", c.getXlName());
  1197 + m.put("jhzlc", c.getJhzlc());
  1198 + m.put("jhlc", c.getJhlc());
  1199 + m.put("jcclc", c.getJcclc());
  1200 + m.put("sjzgl", c.getSjzgl());
  1201 + m.put("jhnlc", c.getJhnlc());
  1202 + m.put("jhwlc", c.getJhwlc());
  1203 + m.put("jhnjcclc", c.getJhnjcclc());
  1204 + m.put("jhwjcclc", c.getJhwjcclc());
  1205 + m.put("jhwjcclc_z", c.getJhwjcclcz());
  1206 + m.put("zrwjcclc", c.getZrwjcclc());
  1207 + m.put("zrwjcclc1", c.getZrwjcclc1());
  1208 + m.put("zrwjcclc2", c.getZrwjcclc2());
  1209 + m.put("zrwjcclcqt", c.getZrwjcclcqt());
  1210 + m.put("kfks", c.getKfks());
  1211 + m.put("lbss", c.getLbss());
  1212 + m.put("ssgl_lz", c.getSsglLz());
  1213 + m.put("ssgl_dm", c.getSsglDm());
  1214 + m.put("ssgl_gz", c.getSsglGz());
  1215 + m.put("ssgl_jf", c.getSsglJf());
  1216 + m.put("ssgl_zs", c.getSsglZs());
  1217 + m.put("ssgl_qr", c.getSsglQr());
  1218 + m.put("ssgl_qc", c.getSsglQc());
  1219 + m.put("ssgl_kx", c.getSsglKx());
  1220 + m.put("ssgl_qh", c.getSsglQh());
  1221 + m.put("ssgl_yw", c.getSsglYw());
  1222 + m.put("ssgl_other", c.getSsglOther());
  1223 + m.put("ljyy", c.getLjyy());
  1224 + m.put("ljjcc", c.getLjjcc());
  1225 + m.put("ljkfks", c.getLjkfks());
  1226 + lMap.add(m);
  1227 + }
  1228 +
  1229 + if(type.equals("export")){
  1230 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  1231 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  1232 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1233 + Map<String, Object> m = new HashMap<String, Object>();
  1234 + m.put("date", date);
  1235 + m.put("date1", date2);
  1236 +// String by=map.get("by").toString();
  1237 + String xls="";
  1238 + if(by.equals("sj")){
  1239 + xls="countByLine.xls";
  1240 + }else{
  1241 + xls="countByLines.xls";
  1242 + }
  1243 + ReportUtils ee = new ReportUtils();
  1244 + try {
  1245 + String dateTime = "";
  1246 + if(date.equals(date2)){
  1247 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  1248 + } else {
  1249 + dateTime = sdfSimple.format(sdfMonth.parse(date))
  1250 + +"-"+sdfSimple.format(sdfMonth.parse(date2));
  1251 + }
  1252 + listI.add(lMap.iterator());
  1253 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1254 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  1255 + path + "export/"+dateTime+"-"+xlName+"-线路公里统计表.xls");
  1256 + } catch (Exception e) {
  1257 + // TODO: handle exception
  1258 + e.printStackTrace();
  1259 + }
  1260 + }
  1261 +
  1262 + return lMap;
  1263 + }
  1264 +
  1265 + @Override
  1266 + public List<Map<String, Object>> getBusMileage(String line, String date,
  1267 + String date2, String xlName, String zt, String by, String type) {
  1268 + List<CalcBusMileage> resList = new ArrayList<CalcBusMileage>();
  1269 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  1270 + List<CalcBusMileage> list = calcBusMileageRepository.selectByDateAndLineTj2(line, date, date2);
  1271 +
  1272 + if(zt.equals("zbh")){
  1273 + List<String> keyList = new ArrayList<String>();
  1274 + Map<String, List<CalcBusMileage>> keyMap = new HashMap<>();
  1275 + for(CalcBusMileage c : list){
  1276 + String nbbm = c.getNbbm();
  1277 + if(!keyMap.containsKey(nbbm)){
  1278 + keyMap.put(nbbm, new ArrayList<CalcBusMileage>());
  1279 + keyList.add(nbbm);
  1280 + }
  1281 + keyMap.get(nbbm).add(c);
  1282 + }
  1283 + for(String key : keyList){
  1284 + CalcBusMileage c1 = keyMap.get(key).get(0);
  1285 + for(int i = 1; i < keyMap.get(key).size(); i++){
  1286 + CalcBusMileage c2 = keyMap.get(key).get(i);
  1287 + c1.setZlc(Arith.add(c1.getZlc(), c2.getZlc()));
  1288 + c1.setJhnlc(Arith.add(c1.getJhnlc(), c2.getJhnlc()));
  1289 + c1.setJhwlc(Arith.add(c1.getJhwlc(), c2.getJhwlc()));
  1290 + c1.setJhnjcclc(Arith.add(c1.getJhnjcclc(), c2.getJhnjcclc()));
  1291 + c1.setJhwjcclc(Arith.add(c1.getJhwjcclc(), c2.getJhwjcclc()));
  1292 + c1.setKfks(Arith.add(c1.getKfks(), c2.getKfks()));
  1293 + c1.setZrwjcclc(Arith.add(c1.getZrwjcclc(), c2.getZrwjcclc()));
  1294 + c1.setZrwjcclc1(Arith.add(c1.getZrwjcclc1(), c2.getZrwjcclc1()));
  1295 + c1.setZrwjcclc2(Arith.add(c1.getZrwjcclc2(), c2.getZrwjcclc2()));
  1296 + c1.setZrwjcclcqt(Arith.add(c1.getZrwjcclcqt(), c2.getZrwjcclcqt()));
  1297 + c1.setLjyy(Arith.add(c1.getLjyy(), c2.getLjyy()));
  1298 + c1.setLjjcc(Arith.add(c1.getLjjcc(), c2.getLjjcc()));
  1299 + c1.setLjkfks(Arith.add(c1.getLjkfks(), c2.getLjkfks()));
  1300 + c1.setDhl(Arith.add(c1.getDhl(), c2.getDhl()));
  1301 + c1.setCdl(Arith.add(c1.getCdl(), c2.getCdl()));
  1302 + c1.setYhl(Arith.add(c1.getYhl(), c2.getYhl()));
  1303 + c1.setJzl(Arith.add(c1.getJzl(), c2.getJzl()));
  1304 + c1.setHyl(Arith.add(c1.getHyl(), c2.getHyl()));
  1305 + c1.setJhzlc(Arith.add(c1.getJhzlc(), c2.getJhzlc()));
  1306 + }
  1307 + resList.add(c1);
  1308 + }
  1309 + } else {
  1310 + List<String> keyList = new ArrayList<String>();
  1311 + Map<String, List<CalcBusMileage>> keyMap = new HashMap<>();
  1312 + for(CalcBusMileage c : list){
  1313 + String key = c.getNbbm() + c.getjGh() + c.getjName() + c.getsGh() + c.getsName();
  1314 + if(!keyMap.containsKey(key)){
  1315 + keyMap.put(key, new ArrayList<CalcBusMileage>());
  1316 + keyList.add(key);
  1317 + }
  1318 + keyMap.get(key).add(c);
  1319 + }
  1320 + for(String key : keyList){
  1321 + CalcBusMileage c1 = keyMap.get(key).get(0);
  1322 + for(int i = 1; i < keyMap.get(key).size(); i++){
  1323 + CalcBusMileage c2 = keyMap.get(key).get(i);
  1324 + c1.setZlc(Arith.add(c1.getZlc(), c2.getZlc()));
  1325 + c1.setJhnlc(Arith.add(c1.getJhnlc(), c2.getJhnlc()));
  1326 + c1.setJhwlc(Arith.add(c1.getJhwlc(), c2.getJhwlc()));
  1327 + c1.setJhnjcclc(Arith.add(c1.getJhnjcclc(), c2.getJhnjcclc()));
  1328 + c1.setJhwjcclc(Arith.add(c1.getJhwjcclc(), c2.getJhwjcclc()));
  1329 + c1.setKfks(Arith.add(c1.getKfks(), c2.getKfks()));
  1330 + c1.setZrwjcclc(Arith.add(c1.getZrwjcclc(), c2.getZrwjcclc()));
  1331 + c1.setZrwjcclc1(Arith.add(c1.getZrwjcclc1(), c2.getZrwjcclc1()));
  1332 + c1.setZrwjcclc2(Arith.add(c1.getZrwjcclc2(), c2.getZrwjcclc2()));
  1333 + c1.setZrwjcclcqt(Arith.add(c1.getZrwjcclcqt(), c2.getZrwjcclcqt()));
  1334 + c1.setLjyy(Arith.add(c1.getLjyy(), c2.getLjyy()));
  1335 + c1.setLjjcc(Arith.add(c1.getLjjcc(), c2.getLjjcc()));
  1336 + c1.setLjkfks(Arith.add(c1.getLjkfks(), c2.getLjkfks()));
  1337 + c1.setDhl(Arith.add(c1.getDhl(), c2.getDhl()));
  1338 + c1.setCdl(Arith.add(c1.getCdl(), c2.getCdl()));
  1339 + c1.setYhl(Arith.add(c1.getYhl(), c2.getYhl()));
  1340 + c1.setJzl(Arith.add(c1.getJzl(), c2.getJzl()));
  1341 + c1.setHyl(Arith.add(c1.getHyl(), c2.getHyl()));
  1342 + c1.setJhzlc(Arith.add(c1.getJhzlc(), c2.getJhzlc()));
  1343 + }
  1344 + resList.add(c1);
  1345 + }
  1346 + }
  1347 +
  1348 + for(CalcBusMileage c : resList){
  1349 + Map<String, Object> m = new HashMap<String, Object>();
  1350 + if(date.equals(date2)){
  1351 + m.put("rq", date);
  1352 + } else {
  1353 + m.put("rq", date + "至" + date2);
  1354 + }
  1355 + m.put("fgs", c.getFgsName());
  1356 + m.put("xlName", c.getXlName());
  1357 + m.put("nbbm", c.getNbbm());
  1358 + m.put("jGh", c.getjGh());
  1359 + m.put("jName", c.getjName());
  1360 + m.put("sGh", c.getsGh());
  1361 + m.put("sName", c.getsName());
  1362 + m.put("zlc", c.getZlc());
  1363 + m.put("jhnlc", c.getJhnlc());
  1364 + m.put("jhwlc", c.getJhwlc());
  1365 + m.put("jhnjcclc", c.getJhnjcclc());
  1366 + m.put("jhwjcclc", c.getJhwjcclc());
  1367 + m.put("jhwjcclc_z", c.getJhwjcclcz());
  1368 + m.put("kfks", c.getKfks());
  1369 + m.put("zrwjcclc", c.getZrwjcclc());
  1370 + m.put("zrwjcclc1", c.getZrwjcclc1());
  1371 + m.put("zrwjcclc2", c.getZrwjcclc2());
  1372 + m.put("zrwjcclcqt", c.getZrwjcclcqt());
  1373 + m.put("ljyy", c.getLjyy());
  1374 + m.put("ljjcc", c.getLjjcc());
  1375 + m.put("ljkfks", c.getLjkfks());
  1376 + m.put("dhl", c.getDhl());
  1377 + m.put("cdl", c.getCdl());
  1378 + m.put("yhl", c.getYhl());
  1379 + m.put("jzl", c.getJzl());
  1380 + m.put("hyl", c.getYhl());
  1381 + m.put("jhzlc", c.getJhzlc());
  1382 + lMap.add(m);
  1383 + }
  1384 +
  1385 + if(type.equals("export")){
  1386 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  1387 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  1388 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  1389 + Map<String, Object> m = new HashMap<String, Object>();
  1390 + m.put("date", date);
  1391 + m.put("date1", date2);
  1392 + String xls="";
  1393 +// String by=map.get("by").toString();
  1394 +
  1395 + if(zt.equals("zbh")){
  1396 + if(by.equals("sj")){
  1397 + xls="countByBus1.xls";
  1398 + }else{
  1399 + xls="countByBus1s.xls";
  1400 + }
  1401 + }else{
  1402 +
  1403 + if(by.equals("sj")){
  1404 + xls="countByBus2.xls";
  1405 + }else{
  1406 + xls="countByBus2s.xls";
  1407 + }
  1408 + }
  1409 + ReportUtils ee = new ReportUtils();
  1410 + try {
  1411 + String dateTime = "";
  1412 + if(date.equals(date2)){
  1413 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  1414 + } else {
  1415 + dateTime = sdfSimple.format(sdfMonth.parse(date))
  1416 + +"-"+sdfSimple.format(sdfMonth.parse(date2));
  1417 + }
  1418 + listI.add(lMap.iterator());
  1419 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  1420 + ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
  1421 + path + "export/"+dateTime+"-"+xlName+"-路单数据统计表.xls");
  1422 + } catch (Exception e) {
  1423 + // TODO: handle exception
  1424 + e.printStackTrace();
  1425 + }
  1426 + }
  1427 +
  1428 + return lMap;
  1429 + }
743 1430  
  1431 + public CalcLineMileage addLineMileage(CalcLineMileage temp, CalcLineMileage c){
  1432 + temp.setJhzlc(Arith.add(temp.getJhzlc()!=null?temp.getJhzlc():0, c.getJhzlc()));
  1433 + temp.setJhlc(Arith.add(temp.getJhlc()!=null?temp.getJhlc():0, c.getJhlc()));
  1434 + temp.setJcclc(Arith.add(temp.getJcclc()!=null?temp.getJcclc():0, c.getJcclc()));
  1435 + temp.setSjzgl(Arith.add(temp.getSjzgl()!=null?temp.getSjzgl():0, c.getSjzgl()));
  1436 + temp.setJhnlc(Arith.add(temp.getJhnlc()!=null?temp.getJhnlc():0, c.getJhnlc()));
  1437 + temp.setJhwlc(Arith.add(temp.getJhwlc()!=null?temp.getJhwlc():0, c.getJhwlc()));
  1438 + temp.setJhnjcclc(Arith.add(temp.getJhnjcclc()!=null?temp.getJhnjcclc():0, c.getJhnjcclc()));
  1439 + temp.setJhwjcclc(Arith.add(temp.getJhwjcclc()!=null?temp.getJhwjcclc():0, c.getJhwjcclc()));
  1440 + temp.setJhwjcclcz(Arith.add(temp.getJhwjcclcz()!=null?temp.getJhwjcclcz():0, c.getJhwjcclcz()));
  1441 + temp.setZrwjcclc(Arith.add(temp.getZrwjcclc()!=null?temp.getZrwjcclc():0, c.getZrwjcclc()));
  1442 + temp.setZrwjcclc1(Arith.add(temp.getZrwjcclc1()!=null?temp.getZrwjcclc1():0, c.getZrwjcclc1()));
  1443 + temp.setZrwjcclc2(Arith.add(temp.getZrwjcclc2()!=null?temp.getZrwjcclc2():0, c.getZrwjcclc2()));
  1444 + temp.setZrwjcclcqt(Arith.add(temp.getZrwjcclcqt()!=null?temp.getZrwjcclcqt():0, c.getZrwjcclcqt()));
  1445 + temp.setKfks(Arith.add(temp.getKfks()!=null?temp.getKfks():0, c.getKfks()));
  1446 + temp.setLbss(Arith.add(temp.getLbss()!=null?temp.getLbss():0, c.getLbss()));
  1447 + temp.setSsglLz(Arith.add(temp.getSsglLz()!=null?temp.getSsglLz():0, c.getSsglLz()));
  1448 + temp.setSsglDm(Arith.add(temp.getSsglDm()!=null?temp.getSsglDm():0, c.getSsglDm()));
  1449 + temp.setSsglGz(Arith.add(temp.getSsglGz()!=null?temp.getSsglGz():0, c.getSsglGz()));
  1450 + temp.setSsglJf(Arith.add(temp.getSsglJf()!=null?temp.getSsglJf():0, c.getSsglJf()));
  1451 + temp.setSsglZs(Arith.add(temp.getSsglZs()!=null?temp.getSsglZs():0, c.getSsglZs()));
  1452 + temp.setSsglQr(Arith.add(temp.getSsglQr()!=null?temp.getSsglQr():0, c.getSsglQr()));
  1453 + temp.setSsglQc(Arith.add(temp.getSsglQc()!=null?temp.getSsglQc():0, c.getSsglQc()));
  1454 + temp.setSsglKx(Arith.add(temp.getSsglKx()!=null?temp.getSsglKx():0, c.getSsglKx()));
  1455 + temp.setSsglQh(Arith.add(temp.getSsglQh()!=null?temp.getSsglQh():0, c.getSsglQh()));
  1456 + temp.setSsglYw(Arith.add(temp.getSsglYw()!=null?temp.getSsglYw():0, c.getSsglYw()));
  1457 + temp.setSsglOther(Arith.add(temp.getSsglOther()!=null?temp.getSsglOther():0, c.getSsglOther()));
  1458 + temp.setLjyy(Arith.add(temp.getLjyy()!=null?temp.getLjyy():0, c.getLjyy()));
  1459 + temp.setLjjcc(Arith.add(temp.getLjjcc()!=null?temp.getLjjcc():0, c.getLjjcc()));
  1460 + temp.setLjkfks(Arith.add(temp.getLjkfks()!=null?temp.getLjkfks():0, c.getLjkfks()));
  1461 + return temp;
  1462 + }
  1463 +
744 1464 }
... ...
src/main/java/com/bsth/service/forms/ExportService.java
... ... @@ -13,7 +13,7 @@ import com.bsth.entity.mcy_forms.Waybillday;
13 13  
14 14 public interface ExportService {
15 15  
16   - public void waybillday(String date, List<Waybillday> resList);
  16 + public void waybillday(String date, String linaName, List<Waybillday> resList);
17 17  
18 18 public void linepasswengerflow(String date,List<Linepasswengerflow> resList);
19 19  
... ...
src/main/java/com/bsth/service/forms/impl/ExportServiceImpl.java
... ... @@ -24,7 +24,7 @@ public class ExportServiceImpl implements ExportService{
24 24  
25 25 //行车路单日报表
26 26 @Override
27   - public void waybillday(String date, List<Waybillday> list) {
  27 + public void waybillday(String date, String lineName, List<Waybillday> list) {
28 28  
29 29 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
30 30 sdfSimple = new SimpleDateFormat("yyyyMMdd");
... ... @@ -50,7 +50,8 @@ public class ExportServiceImpl implements ExportService{
50 50 listI.add(resList.iterator());
51 51 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
52 52 ee.excelReplace(listI, new Object[] { map }, path+"mould/waybillday.xls",
53   - path+"export/行车路单日报表.xls");
  53 + path+"export/"+sdfSimple.format(sdfMonth.parse(date))
  54 + +"-"+lineName+"-行车路单日报表.xls");
54 55 } catch (Exception e) {
55 56 e.printStackTrace();
56 57 }
... ...
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
... ... @@ -703,17 +703,26 @@ public class BusIntervalServiceImpl implements BusIntervalService {
703 703 }
704 704  
705 705 if(type != null && type.length() != 0 && type.equals("export")){
  706 + String lineName = "";
  707 + if(map.containsKey("lineName"))
  708 + lineName = map.get("lineName").toString();
706 709 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
707 710 sdfSimple = new SimpleDateFormat("yyyyMMdd");
708 711 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
709 712 Map<String, Object> m = new HashMap<String, Object>();
710 713 ReportUtils ee = new ReportUtils();
711 714 try {
  715 + String dateTime = "";
  716 + if(startDate.equals(endDate)){
  717 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  718 + } else {
  719 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  720 + + "-" + sdfSimple.format(sdfMonth.parse(endDate));
  721 + }
712 722 listI.add(resList.iterator());
713 723 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
714 724 ee.excelReplace(listI, new Object[] { m }, path+"mould/busInterval"+statu+".xls",
715   - path+"export/班次间隔统计表" + sdfSimple.format(sdfMonth.parse(startDate))
716   - + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls");
  725 + path+"export/" + dateTime + "-" + lineName + "-班次间隔统计表.xls");
717 726 } catch (Exception e) {
718 727 // TODO: handle exception
719 728 e.printStackTrace();
... ... @@ -1441,6 +1450,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1441 1450 }
1442 1451  
1443 1452 if(type != null && type.length() != 0 && type.equals("export")){
  1453 + String lineName = "";
  1454 + if(map.containsKey("lineName"))
  1455 + lineName = map.get("lineName").toString();
1444 1456 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
1445 1457 sdfSimple = new SimpleDateFormat("yyyyMMdd");
1446 1458 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -1450,11 +1462,17 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1450 1462 else if(statu.equals("1"))
1451 1463 modelMap.put("lpType", "路牌名");
1452 1464 try {
  1465 + String dateTime = "";
  1466 + if(startDate.equals(endDate)){
  1467 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  1468 + } else {
  1469 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  1470 + + "-" + sdfSimple.format(sdfMonth.parse(endDate));
  1471 + }
1453 1472 listI.add(((List<Map<String, Object>>)modelMap.get("dataList")).iterator());
1454 1473 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
1455 1474 ee.excelReplace(listI, new Object[] { modelMap }, path+"mould/timeAndSpeed.xls",
1456   - path+"export/行驶时间及车速统计表" + sdfSimple.format(sdfMonth.parse(startDate))
1457   - + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls");
  1475 + path+"export/" + dateTime + "-" + lineName + "-行驶时间及车速统计表.xls");
1458 1476 } catch (Exception e) {
1459 1477 // TODO: handle exception
1460 1478 e.printStackTrace();
... ... @@ -2006,6 +2024,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2006 2024 }
2007 2025  
2008 2026 if(type != null && type.length() != 0 && type.equals("export")){
  2027 + String lineName = "";
  2028 + if(map.containsKey("lineName"))
  2029 + lineName = map.get("lineName").toString();
2009 2030 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
2010 2031 sdfSimple = new SimpleDateFormat("yyyyMMdd");
2011 2032 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -2015,8 +2036,9 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2015 2036 listI.add(resList.iterator());
2016 2037 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
2017 2038 ee.excelReplace(listI, new Object[] { m }, path+"mould/lbStatuAnaly.xls",
2018   - path+"export/烂班情况分析表" + sdfSimple.format(sdfMonth.parse(startDate))
2019   - + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls");
  2039 + path+"export/" + sdfSimple.format(sdfMonth.parse(startDate))
  2040 + + "-" + sdfSimple.format(sdfMonth.parse(endDate))
  2041 + + "-" + lineName + "-烂班情况分析表.xls");
2020 2042 } catch (Exception e) {
2021 2043 // TODO: handle exception
2022 2044 e.printStackTrace();
... ... @@ -2408,6 +2430,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2408 2430 public Map<String, Object> exportWaybillMore(Map<String, Object> map) {
2409 2431 String date = map.get("date").toString();
2410 2432 String line = map.get("line").toString();
  2433 + String lineName = map.get("lineName").toString();
2411 2434 ReportUtils ee = new ReportUtils();
2412 2435 List<List> strs = JSON.parseArray(map.get("strs").toString(), List.class);
2413 2436 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/export/";
... ... @@ -2417,7 +2440,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
2417 2440 File file = null;
2418 2441 try {
2419 2442 while (true) {
2420   - String fileUrl = path + "行车路单" + sdfSimple.format(sdfMonth.parse(date));
  2443 + String fileUrl = path + sdfSimple.format(sdfMonth.parse(date))+"-"+lineName+"-行车路单";
2421 2444 // file = new File(fileUrl + (num == 0 ? "/" : "(" + num + ")/")); //新建文件夹
2422 2445 file = new File(fileUrl + (num == 0 ? ".xls" : "(" + num + ").xls")); //新建excel文件
2423 2446 if (file.exists()) { //判断是否已存在重名
... ... @@ -3009,19 +3032,28 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3009 3032 }
3010 3033  
3011 3034 if(map.containsKey("type") && map.get("type").toString().equals("export")){
  3035 + String lineName = "";
  3036 + if(map.containsKey("lineName"))
  3037 + lineName = map.get("lineName").toString();
3012 3038 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
3013 3039 sdfSimple = new SimpleDateFormat("yyyyMMdd");
3014 3040 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
3015 3041 Map<String,Object> m = new HashMap<String, Object>();
3016 3042 ReportUtils ee = new ReportUtils();
3017 3043 try {
  3044 + String dateTime = "";
  3045 + if(startDate.equals(endDate)){
  3046 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  3047 + } else {
  3048 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  3049 + +"-"+sdfSimple.format(sdfMonth.parse(endDate));
  3050 + }
3018 3051 listI.add(resList.iterator());
3019 3052 m.put("date1", startDate);
3020 3053 m.put("date2", endDate);
3021 3054 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
3022 3055 ee.excelReplace(listI, new Object[] { m }, path+"mould/onTime.xls",
3023   - path+"export/发车到站准点率" + sdfSimple.format(sdfMonth.parse(startDate)) +
3024   - (startDate.equals(endDate)?"":"-"+sdfSimple.format(sdfMonth.parse(endDate))) + ".xls");
  3056 + path+"export/" + dateTime + "-" + lineName + "-发车到站准点率.xls");
3025 3057 } catch (Exception e) {
3026 3058 // TODO: handle exception
3027 3059 e.printStackTrace();
... ... @@ -3058,18 +3090,28 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3058 3090 }
3059 3091  
3060 3092 if(map.containsKey("type") && map.get("type").toString().equals("export")){
  3093 + String lineName = "";
  3094 + if(map.containsKey("lineName"))
  3095 + lineName = map.get("lineName").toString();
3061 3096 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
3062 3097 sdfSimple = new SimpleDateFormat("yyyyMMdd");
3063 3098 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
3064 3099 Map<String,Object> m = new HashMap<String, Object>();
3065 3100 ReportUtils ee = new ReportUtils();
3066 3101 try {
  3102 + String dateTime = "";
  3103 + if(startDate.equals(endDate)){
  3104 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  3105 + } else {
  3106 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  3107 + +"-"+sdfSimple.format(sdfMonth.parse(endDate));
  3108 + }
3067 3109 listI.add(resList.iterator());
3068 3110 m.put("date1", startDate);
3069 3111 m.put("date2", endDate);
3070 3112 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
3071 3113 ee.excelReplace(listI, new Object[] { m }, path+"mould/onTime1.xls",
3072   - path+"export/发车到站准点率明细.xls");
  3114 + path+"export/"+dateTime+"-"+lineName+"-发车到站准点率明细.xls");
3073 3115 } catch (Exception e) {
3074 3116 // TODO: handle exception
3075 3117 e.printStackTrace();
... ... @@ -3093,18 +3135,29 @@ public class BusIntervalServiceImpl implements BusIntervalService {
3093 3135 }
3094 3136  
3095 3137 if(map.containsKey("type") && map.get("type").toString().equals("export")){
  3138 + String lineName = "";
  3139 + if(map.containsKey("lineName"))
  3140 + lineName = map.get("lineName").toString();
3096 3141 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
3097 3142 sdfSimple = new SimpleDateFormat("yyyyMMdd");
3098 3143 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
3099 3144 Map<String,Object> m = new HashMap<String, Object>();
3100 3145 ReportUtils ee = new ReportUtils();
3101 3146 try {
  3147 + String dateTime = "";
  3148 + if(startDate.equals(endDate)){
  3149 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  3150 + } else {
  3151 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  3152 + +"-"+sdfSimple.format(sdfMonth.parse(endDate));
  3153 + }
3102 3154 listI.add(resList.iterator());
3103 3155 m.put("date", startDate);
3104 3156 m.put("line", line);
3105 3157 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
3106 3158 ee.excelReplace(listI, new Object[] { m }, path+"mould/onTime2.xls",
3107   - path+"export/发车到站准点率详细"+sdfSimple.format(sdfMonth.parse(startDate))+".xls");
  3159 + path+"export/"+sdfSimple.format(sdfMonth.parse(startDate))
  3160 + +"-"+lineName+"-发车到站准点率详细.xls");
3108 3161 } catch (Exception e) {
3109 3162 // TODO: handle exception
3110 3163 e.printStackTrace();
... ...
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
... ... @@ -1047,10 +1047,14 @@ public class YlbServiceImpl extends BaseServiceImpl&lt;Ylb,Integer&gt; implements YlbS
1047 1047 m.put("fyyyhj", fyyyhj);
1048 1048 ReportUtils ee = new ReportUtils();
1049 1049 try {
  1050 + String lineName = "";
  1051 + if(map.containsKey("lineName"))
  1052 + lineName = map.get("lineName").toString();
1050 1053 listI.add(mapList.iterator());
1051 1054 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
1052 1055 ee.excelReplace(listI, new Object[] { m }, path+"mould/oilListMonth.xls",
1053   - path+"export/月存油报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  1056 + path+"export/" + sdfSimple.format(sdfMonth.parse(date))
  1057 + + "-" + lineName + "-月存油报表.xls");
1054 1058 } catch (Exception e) {
1055 1059 // TODO: handle exception
1056 1060 e.printStackTrace();
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -141,7 +141,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
141 141  
142 142 @Autowired
143 143 YlbRepository ylbRepository;
144   -
  144 +
145 145 @Autowired
146 146 DlbRepository dlbRepository;
147 147  
... ... @@ -156,7 +156,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
156 156  
157 157 @Autowired
158 158 DirectiveService directiveService;
159   -
  159 +
160 160 @Autowired
161 161 CarDeviceRepository carDeviceRepository;
162 162  
... ... @@ -170,19 +170,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
170 170  
171 171 /**
172 172 * 校验人车 和 班次的公司和分公司归属
  173 + *
173 174 * @param schId
174 175 * @param jsy
175 176 * @param spy
176 177 * @param nbbm
177   - * @return
178   - * -2 跨营运公司,校验不过
  178 + * @return -2 跨营运公司,校验不过
179 179 * -1 跨分公司,二次确认
180 180 * 1 校验通过
181 181 */
182 182 @Override
183 183 public Map<String, Object> checkPCFgsAscription(Long schId, String jGh, String sGh, String nbbm) {
184 184 Map<String, Object> rs = new HashMap<>();
185   - try{
  185 + try {
186 186 rs.put("status", ResponseCode.SUCCESS);
187 187 rs.put("checkStatus", -2);
188 188  
... ... @@ -192,22 +192,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
192 192  
193 193 //校验运营公司
194 194 Personnel jsy = BasicData.perMap.get(gsbm + "-" + jGh);
195   - if(null == jsy){
196   - msg = "【驾驶员】:" + sch.getGsName() + "暂无工号为" + "【"+jGh+"】的人员";
  195 + if (null == jsy) {
  196 + msg = "【驾驶员】:" + sch.getGsName() + "暂无工号为" + "【" + jGh + "】的人员";
197 197 rs.put("msg", msg);
198 198 return rs;
199 199 }
200   - if(!carExist(gsbm, nbbm)){
201   - msg = sch.getGsName() + "没有自编号为" + "["+nbbm+"]的车辆";
  200 + if (!carExist(gsbm, nbbm)) {
  201 + msg = sch.getGsName() + "没有自编号为" + "[" + nbbm + "]的车辆";
202 202 rs.put("msg", msg);
203 203 return rs;
204 204 }
205 205  
  206 + if (!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(nbbm))) {
  207 + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + nbbm + "】的车辆");
  208 + return rs;
  209 + }
  210 +
206 211 Personnel spy = null;
207   - if(StringUtils.isNotEmpty(sGh)){
  212 + if (StringUtils.isNotEmpty(sGh)) {
208 213 spy = BasicData.perMap.get(gsbm + "-" + sGh);
209   - if(null == spy){
210   - msg = "【售票员】: " + sch.getGsName() + "暂无工号为" + "【"+sGh+"】的人员";
  214 + if (null == spy) {
  215 + msg = "【售票员】: " + sch.getGsName() + "暂无工号为" + "【" + sGh + "】的人员";
211 216 rs.put("msg", msg);
212 217 return rs;
213 218 }
... ... @@ -215,15 +220,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
215 220  
216 221  
217 222 //校验分公司
218   - if(null != jsy && !fgsbm.equals(jsy.getBrancheCompanyCode())){
  223 + if (null != jsy && !fgsbm.equals(jsy.getBrancheCompanyCode())) {
219 224 msg = ("【驾驶员】:" + jGh + "/" + jsy.getPersonnelName() + "是" + jsy.getBrancheCompany() + "的人员");
220 225 rs.put("msg", msg);
221 226 rs.put("checkStatus", -1);
222 227 return rs;
223 228 }
224 229  
225   - if(StringUtils.isNotEmpty(sGh)){
226   - if(null != spy && !fgsbm.equals(spy.getBrancheCompanyCode())){
  230 + if (StringUtils.isNotEmpty(sGh)) {
  231 + if (null != spy && !fgsbm.equals(spy.getBrancheCompanyCode())) {
227 232 msg = ("【售票员】: " + jGh + "/" + spy.getPersonnelName() + "是" + spy.getBrancheCompany() + "的人员");
228 233 rs.put("msg", msg);
229 234 rs.put("checkStatus", -1);
... ... @@ -231,15 +236,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
231 236 }
232 237 }
233 238  
234   - if(!(gsbm + "_" + fgsbm).equals(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm))){
235   - msg = ("【" + nbbm + "】" + "是" + sch.getFgsName() + "的车辆!");
  239 + if (!(fgsbm + "_" + gsbm).equals(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm))) {
  240 +
  241 + String clFgsName = BasicData.businessFgsCodeNameMap.get(BasicData.nbbm2FgsCompanyCodeMap.get(nbbm));
  242 +
  243 + msg = ("【" + nbbm + "】" + "是" + clFgsName + "的车辆!");
236 244 rs.put("msg", msg);
237 245 rs.put("checkStatus", -1);
238 246 return rs;
239 247 }
240 248  
241 249 rs.put("checkStatus", 1);
242   - }catch (Exception e){
  250 + } catch (Exception e) {
243 251 logger.error("", e);
244 252 rs.put("status", ResponseCode.ERROR);
245 253 }
... ... @@ -249,21 +257,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
249 257  
250 258 /**
251 259 * 车辆是否存在
  260 + *
252 261 * @param gsbm 公司编码
253 262 * @param nbbm 车辆自编号
254 263 * @return
255 264 */
256   - private boolean carExist(String gsbm, String nbbm){
257   - return BasicData.deviceId2NbbmMap.inverse().containsKey(nbbm);
  265 + private boolean carExist(String gsbm, String nbbm) {
  266 + return BasicData.nbbm2CompanyCodeMap.containsKey(nbbm);
258 267 }
259 268  
260 269 /**
261 270 * 获取人员姓名
  271 + *
262 272 * @param gsbm 公司编码
263   - * @param gh 人员工号
  273 + * @param gh 人员工号
264 274 * @return
265 275 */
266   - private String getPersonName(String gsbm, String gh){
  276 + private String getPersonName(String gsbm, String gh) {
267 277 return BasicData.allPerson.get(gsbm + '-' + gh);
268 278 }
269 279  
... ... @@ -275,12 +285,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
275 285 DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm");
276 286 //计算时间戳
277 287 ScheduleRealInfo sch;
278   - while(iterator.hasNext()){
  288 + while (iterator.hasNext()) {
279 289 sch = iterator.next();
280 290 //待发时间戳
281 291 sch.setDfsjT(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getDfsj()));
282 292 //实发时间戳
283   - if(StringUtils.isNotEmpty(sch.getFcsjActual())){
  293 + if (StringUtils.isNotEmpty(sch.getFcsjActual())) {
284 294 sch.setFcsjActualTime(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getFcsjActual()));
285 295 }
286 296 set.add(sch);
... ... @@ -314,7 +324,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
314 324  
315 325 ScheduleRealInfo schedule = dayOfSchedule.get(id);
316 326  
317   - if(schedule.getStatus() > 0){
  327 + if (schedule.getStatus() > 0) {
318 328 map.put("status", ResponseCode.SUCCESS);
319 329 map.put("flag", "4008");
320 330 map.put("t", schedule);
... ... @@ -330,11 +340,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
330 340 }
331 341  
332 342 //记录日志
333   - ScheduleModifyLogger.dftz(schedule,opType, schedule.getDfsj(),dfsj,remarks, userId);
  343 + ScheduleModifyLogger.dftz(schedule, opType, schedule.getDfsj(), dfsj, remarks, userId);
334 344  
335 345 schedule.setDfsjAll(dfsj);
336 346 schedule.setDfAuto(false);
337   - if("1".equals(opType))
  347 + if ("1".equals(opType))
338 348 schedule.setRemarks(remarks);
339 349  
340 350 List<ScheduleRealInfo> ts = new ArrayList<>();
... ... @@ -349,9 +359,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
349 359  
350 360 //调整班次类型
351 361 if (StringUtils.isNotEmpty(bcType) && !bcType.equals(schedule.getBcType())) {
352   - if((schedule.getBcType().equals("major")
  362 + if ((schedule.getBcType().equals("major")
353 363 || schedule.getBcType().equals("venting"))
354   - && bcType.equals("normal")){
  364 + && bcType.equals("normal")) {
355 365 //清空备注
356 366 schedule.setRemarks("");
357 367 }
... ... @@ -361,8 +371,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
361 371 //如果正在执行该班次
362 372 //ScheduleRealInfo exec = dayOfSchedule.executeCurr(schedule.getClZbh());
363 373 //if(exec != null && exec == schedule){
364   - //重新计算正在执行班次
365   - dayOfSchedule.reCalcExecPlan(schedule.getClZbh());
  374 + //重新计算正在执行班次
  375 + dayOfSchedule.reCalcExecPlan(schedule.getClZbh());
366 376 //}
367 377  
368 378 //重新计算是否误点
... ... @@ -374,11 +384,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
374 384 //}
375 385  
376 386 try {
377   - if(!schedule.getDirectiveState().equals(-1) && schedule.getStatus()==0){
  387 + if (!schedule.getDirectiveState().equals(-1) && schedule.getStatus() == 0) {
378 388 //重新下发调度指令
379 389 directiveService.send60Dispatch(schedule.getId(), "待发@系统");
380 390 }
381   - }catch (Exception e){
  391 + } catch (Exception e) {
382 392 logger.error("", e);
383 393 }
384 394  
... ... @@ -504,6 +514,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
504 514  
505 515 /**
506 516 * 添加到历史库
  517 + *
507 518 * @param t
508 519 * @return
509 520 */
... ... @@ -532,28 +543,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
532 543 t.setjGh(t.getjGh().split("-")[1]);
533 544 }
534 545 //检查驾驶员工号
535   - String jName = getPersonName(t.getGsBm() ,t.getjGh());
536   - if(StringUtils.isEmpty(jName)){
  546 + String jName = getPersonName(t.getGsBm(), t.getjGh());
  547 + if (StringUtils.isEmpty(jName)) {
537 548 rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员");
538 549 rs.put("status", ResponseCode.ERROR);
539 550 return rs;
540   - }
541   - else if(StringUtils.isEmpty(t.getjName())){
  551 + } else if (StringUtils.isEmpty(t.getjName())) {
542 552 t.setjName(jName);//补上驾驶员名称
543 553 }
544 554  
545 555 //有售票员
546   - if(StringUtils.isNotEmpty(t.getsGh())){
547   - String sName = getPersonName(t.getGsBm() , t.getsGh());
548   - if(StringUtils.isEmpty(sName)){
  556 + if (StringUtils.isNotEmpty(t.getsGh())) {
  557 + String sName = getPersonName(t.getGsBm(), t.getsGh());
  558 + if (StringUtils.isEmpty(sName)) {
549 559 rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员");
550 560 rs.put("status", ResponseCode.ERROR);
551 561 return rs;
552   - }else if(StringUtils.isEmpty(t.getsName())){
  562 + } else if (StringUtils.isEmpty(t.getsName())) {
553 563 t.setsName(sName);//补上售票员名称
554 564 }
555   - }
556   - else{
  565 + } else {
557 566 t.setsGh("");
558 567 t.setsName("");
559 568 }
... ... @@ -627,28 +636,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
627 636 t.setjGh(t.getjGh().split("-")[1]);
628 637 }
629 638 //检查驾驶员工号
630   - String jName = getPersonName(t.getGsBm() ,t.getjGh());
631   - if(StringUtils.isEmpty(jName)){
  639 + String jName = getPersonName(t.getGsBm(), t.getjGh());
  640 + if (StringUtils.isEmpty(jName)) {
632 641 rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员");
633 642 rs.put("status", ResponseCode.ERROR);
634 643 return rs;
635   - }
636   - else if(StringUtils.isEmpty(t.getjName())){
  644 + } else if (StringUtils.isEmpty(t.getjName())) {
637 645 t.setjName(jName);//补上驾驶员名称
638 646 }
639 647  
640 648 //有售票员
641   - if(StringUtils.isNotEmpty(t.getsGh())){
642   - String sName = getPersonName(t.getGsBm() , t.getsGh());
643   - if(StringUtils.isEmpty(sName)){
  649 + if (StringUtils.isNotEmpty(t.getsGh())) {
  650 + String sName = getPersonName(t.getGsBm(), t.getsGh());
  651 + if (StringUtils.isEmpty(sName)) {
644 652 rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员");
645 653 rs.put("status", ResponseCode.ERROR);
646 654 return rs;
647   - }else if(StringUtils.isEmpty(t.getsName())){
  655 + } else if (StringUtils.isEmpty(t.getsName())) {
648 656 t.setsName(sName);//补上售票员名称
649 657 }
650   - }
651   - else{
  658 + } else {
652 659 t.setsGh("");
653 660 t.setsName("");
654 661 }
... ... @@ -680,7 +687,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
680 687  
681 688 //处理计达跨24点
682 689 LineConfig conf = lineConfigData.get(t.getXlBm());
683   - if(t.getZdsj().compareTo(conf.getStartOpt()) < 0){
  690 + if (t.getZdsj().compareTo(conf.getStartOpt()) < 0) {
684 691 t.setZdsjT(sdfyyyyMMddHHmm.parse(t.getScheduleDateStr() + t.getZdsj()).getTime() + (1000 * 60 * 60 * 24));
685 692 }
686 693  
... ... @@ -719,6 +726,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
719 726  
720 727 /**
721 728 * 删除历史表临加班次
  729 + *
722 730 * @param id
723 731 * @return
724 732 */
... ... @@ -744,7 +752,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
744 752  
745 753 //数据库删除
746 754 rs = super.delete(id);
747   - }catch (Exception e){
  755 + } catch (Exception e) {
748 756 logger.error("", e);
749 757 rs.put("msg", e.getMessage());
750 758 }
... ... @@ -776,16 +784,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
776 784  
777 785 //数据库删除
778 786 rs = super.delete(id);
779   - if(rs.get("status").equals(ResponseCode.SUCCESS)){
  787 + if (rs.get("status").equals(ResponseCode.SUCCESS)) {
780 788 dayOfSchedule.delete(sch);
781 789 //更新起点应到时间
782 790 List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch);
783 791 rs.put("ts", ts);
784 792 rs.put("delete", sch);
785   - }
786   - else
  793 + } else
787 794 sch.setDeleted(false);
788   - }catch (Exception e){
  795 + } catch (Exception e) {
789 796 logger.error("", e);
790 797 rs.put("msg", e.getMessage());
791 798 sch.setDeleted(false);
... ... @@ -866,28 +873,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
866 873 state = state + "+1";
867 874 type = "ASC";
868 875 }
869   - String minfcsj="02:00";
870   - List<Line> lineList=lineRepository.findLineByCode(line);
871   - if(lineList.size()>0){
872   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
873   - + " id = ("
874   - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
875   - + ")";
876   - minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
877   - }
878   - String sqlPlan ="select * from (select * from ("
879   - + " select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, "
880   - + " s.lp_Name as lpName,s.j_Name as jName,max(s.schedule_date_str) as dateStr ,"
881   - + " min(s.fcsj) as fcsj,1 as px from bsth_c_s_sp_info_real s where "
882   - + " s.xl_Bm = '"+line+"' and s.schedule_date_str ='"+date+"'"
883   - + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name ) x where x.fcsj >'"+minfcsj+"'"
884   - + " UNION "
885   - + " select * from ( select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, "
886   - + " s.lp_Name as lpName,s.j_Name as jName, max(s.schedule_date_str) as dateStr,"
887   - + " min(s.fcsj) as fcsj,2 as px from bsth_c_s_sp_info_real s "
888   - + " where s.xl_Bm = '"+line+"' and s.schedule_date_str ='"+date+"'"
889   - + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name "
890   - + " ) y where y.fcsj <='"+minfcsj+"') z order by (" + state + "),dateStr,px,fcsj " + type;
  876 + String minfcsj = "02:00";
  877 + List<Line> lineList = lineRepository.findLineByCode(line);
  878 + if (lineList.size() > 0) {
  879 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  880 + + " id = ("
  881 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  882 + + ")";
  883 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  884 + }
  885 + String sqlPlan = "select * from (select * from ("
  886 + + " select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, "
  887 + + " s.lp_Name as lpName,s.j_Name as jName,max(s.schedule_date_str) as dateStr ,"
  888 + + " min(s.fcsj) as fcsj,1 as px from bsth_c_s_sp_info_real s where "
  889 + + " s.xl_Bm = '" + line + "' and s.schedule_date_str ='" + date + "'"
  890 + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name ) x where x.fcsj >'" + minfcsj + "'"
  891 + + " UNION "
  892 + + " select * from ( select min(s.id) as id,s.j_Gh as jGh,s.cl_Zbh as clZbh, "
  893 + + " s.lp_Name as lpName,s.j_Name as jName, max(s.schedule_date_str) as dateStr,"
  894 + + " min(s.fcsj) as fcsj,2 as px from bsth_c_s_sp_info_real s "
  895 + + " where s.xl_Bm = '" + line + "' and s.schedule_date_str ='" + date + "'"
  896 + + " GROUP BY s.j_Gh,s.cl_Zbh,s.lp_Name ,s.j_Name "
  897 + + " ) y where y.fcsj <='" + minfcsj + "') z order by (" + state + "),dateStr,px,fcsj " + type;
891 898 List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan,
892 899 new RowMapper<ScheduleRealInfo>() {
893 900 @Override
... ... @@ -955,78 +962,79 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
955 962 List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
956 963 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
957 964 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);
958   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  965 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
959 966 for (int i = 0; i < scheduleRealInfos.size(); i++) {
960   - ScheduleRealInfo s=scheduleRealInfos.get(i);
  967 + ScheduleRealInfo s = scheduleRealInfos.get(i);
961 968 Set<ChildTaskPlan> cts = s.getcTasks();
962   - if(cts != null && cts.size() > 0){
963   - lists.add(s);
964   - }else{
965   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
966   - lists.add(s);
967   - }
  969 + if (cts != null && cts.size() > 0) {
  970 + lists.add(s);
  971 + } else {
  972 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  973 + lists.add(s);
  974 + }
968 975 }
969 976 }
970 977 DecimalFormat format = new DecimalFormat("0.00");
971 978 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
972 979 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
973 980 //计算里程和班次数,并放入Map里
974   - Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
  981 + Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
975 982  
976   - map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos)));
977   - map.put("remMileage",culateMieageService.culateLbgl(scheduleRealInfos));
  983 + map.put("jhlc", Arith.add(culateMieageService.culateJhgl(scheduleRealInfos), culateMieageService.culateJhJccgl(scheduleRealInfos)));
  984 + map.put("remMileage", culateMieageService.culateLbgl(scheduleRealInfos));
978 985 map.put("addMileage", culateMieageService.culateLjgl(lists));
979   - double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists));
  986 + double yygl = Arith.add(culateMieageService.culateSjgl(lists), culateMieageService.culateLjgl(lists));
980 987 map.put("yygl", yygl);
981   - double ksgl=Arith.add(culateMieageService.culateKsgl(scheduleRealInfos),culateMieageService.culateJccgl(lists));
982   - map.put("ksgl",ksgl);
983   - map.put("realMileage", Arith.add(yygl ,ksgl));
984   - map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,""));
  988 + double ksgl = Arith.add(culateMieageService.culateKsgl(scheduleRealInfos), culateMieageService.culateJccgl(lists));
  989 + map.put("ksgl", ksgl);
  990 + map.put("realMileage", Arith.add(yygl, ksgl));
  991 + map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos, ""));
985 992 map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos));
986 993 map.put("ljbc", culateMieageService.culateLjbc(lists, ""));
987   - int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, "");
  994 + int sjbc = culateMieageService.culateLjbc(lists, "") + culateMieageService.culateSjbc(lists, "");
988 995 map.put("sjbc", sjbc);
989 996 // map=new HashMap<String,Object>();
990   -
991   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
992   - String minfcsj="02:00";
993   - List<Line> lineList=lineRepository.findLineByCode(line);
994   - if(lineList.size()>0){
995   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
996   - + " id = ("
997   - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
998   - + ")";
999   - minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
1000   - }
1001   - String[] minSjs = minfcsj.split(":");
1002   - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
1003   -
1004   -
  997 +
  998 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  999 + String minfcsj = "02:00";
  1000 + List<Line> lineList = lineRepository.findLineByCode(line);
  1001 + if (lineList.size() > 0) {
  1002 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  1003 + + " id = ("
  1004 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  1005 + + ")";
  1006 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  1007 + }
  1008 + String[] minSjs = minfcsj.split(":");
  1009 + Long minSj = Long.parseLong(minSjs[0]) * 60 + Long.parseLong(minSjs[1]);
  1010 +
  1011 +
1005 1012 for (int i = 0; i < scheduleRealInfos.size(); i++) {
1006   - ScheduleRealInfo s=scheduleRealInfos.get(i);
1007   - String[] fcsj= s.getFcsj().split(":");
1008   - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
  1013 + ScheduleRealInfo s = scheduleRealInfos.get(i);
  1014 + String[] fcsj = s.getFcsj().split(":");
  1015 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
1009 1016  
1010   - Long fscjT=0L;
1011   - if(fcsjL<minSj){
1012   - Calendar calendar = new GregorianCalendar();
  1017 + Long fscjT = 0L;
  1018 + if (fcsjL < minSj) {
  1019 + Calendar calendar = new GregorianCalendar();
1013 1020 calendar.setTime(s.getScheduleDate());
1014   - calendar.add(calendar.DATE,1);
  1021 + calendar.add(calendar.DATE, 1);
1015 1022 s.setScheduleDate(calendar.getTime());
1016 1023 try {
1017   - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
  1024 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
1018 1025 } catch (ParseException e) {
1019 1026 // TODO Auto-generated catch block
1020 1027 e.printStackTrace();
1021 1028 }
1022 1029  
1023   - }else{
  1030 + } else {
1024 1031 try {
1025   - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
  1032 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
1026 1033 } catch (ParseException e) {
1027 1034 // TODO Auto-generated catch block
1028 1035 e.printStackTrace();
1029   - };
  1036 + }
  1037 + ;
1030 1038 }
1031 1039 s.setFcsjT(fscjT);
1032 1040 }
... ... @@ -1059,7 +1067,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1059 1067 //计算营运里程,空驶里程
1060 1068 if (!childTaskPlans.isEmpty()) {
1061 1069 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
1062   - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  1070 + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans);
1063 1071 Collections.sort(listit, new ComparableChild());
1064 1072 for (int j = 0; j < listit.size(); j++) {
1065 1073 ScheduleRealInfo t = new ScheduleRealInfo();
... ... @@ -1096,27 +1104,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1096 1104 String zdsj = scheduleRealInfo.getZdsj();
1097 1105 String zdsjActual = scheduleRealInfo.getZdsjActual();
1098 1106 if (zdsj != null && zdsjActual != null &&
1099   - !zdsj.equals(zdsjActual) &&
1100   - !zdsj.equals("")&&
  1107 + !zdsj.equals(zdsjActual) &&
  1108 + !zdsj.equals("") &&
1101 1109 !zdsjActual.equals("")) {
1102   - int zdsjT = Integer.valueOf(zdsj.split(":")[0])*60 + Integer.valueOf(zdsj.split(":")[1]);
1103   - int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0])*60 + Integer.valueOf(zdsjActual.split(":")[1]);
  1110 + int zdsjT = Integer.valueOf(zdsj.split(":")[0]) * 60 + Integer.valueOf(zdsj.split(":")[1]);
  1111 + int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0]) * 60 + Integer.valueOf(zdsjActual.split(":")[1]);
1104 1112 if (zdsj.compareTo(zdsjActual) > 0) {
1105   - if(zdsjT - zdsjAT > 1000){
1106   - maps.put("fast", "");
1107   - maps.put("slow", zdsjAT - zdsjT + 1440);
1108   - } else {
1109   - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
1110   - maps.put("slow", "");
1111   - }
  1113 + if (zdsjT - zdsjAT > 1000) {
  1114 + maps.put("fast", "");
  1115 + maps.put("slow", zdsjAT - zdsjT + 1440);
  1116 + } else {
  1117 + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  1118 + maps.put("slow", "");
  1119 + }
1112 1120 } else {
1113   - if(zdsjAT - zdsjT > 1000){
1114   - maps.put("fast", zdsjT - zdsjAT + 1440);
1115   - maps.put("slow", "");
1116   - } else {
1117   - maps.put("fast", "");
1118   - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
1119   - }
  1121 + if (zdsjAT - zdsjT > 1000) {
  1122 + maps.put("fast", zdsjT - zdsjAT + 1440);
  1123 + maps.put("slow", "");
  1124 + } else {
  1125 + maps.put("fast", "");
  1126 + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  1127 + }
1120 1128 }
1121 1129 } else {
1122 1130 maps.put("fast", "");
... ... @@ -1128,18 +1136,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1128 1136 }
1129 1137 }
1130 1138  
1131   - String xls="";
1132   - if(map.get("type").toString().equals("0")){
1133   - xls="waybill_minhang.xls";
1134   - }else{
1135   - xls="waybill_minhang_dl.xls";
  1139 + String xls = "";
  1140 + if (map.get("type").toString().equals("0")) {
  1141 + xls = "waybill_minhang.xls";
  1142 + } else {
  1143 + xls = "waybill_minhang_dl.xls";
1136 1144 }
1137 1145  
1138 1146  
1139 1147 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
1140 1148  
1141 1149 list.add(listMap.iterator());
1142   - ee.excelReplace(list, new Object[]{scheduleRealInfos.get(0),map}, path + "mould/"+xls,
  1150 + ee.excelReplace(list, new Object[]{scheduleRealInfos.get(0), map}, path + "mould/" + xls,
1143 1151 path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
1144 1152 return scheduleRealInfos;
1145 1153 }
... ... @@ -1189,7 +1197,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1189 1197 @Override
1190 1198 public List<Object[]> historyMessage(String line, String date, String code, String type) {
1191 1199 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1192   -
  1200 +
1193 1201 long d = 0;
1194 1202 long t = 0;
1195 1203 if (date.length() > 0) {
... ... @@ -1202,36 +1210,37 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1202 1210 }
1203 1211  
1204 1212 }
1205   - String device="";
1206   - if(!code.equals("")){
1207   - device=BasicData.deviceId2NbbmMap.inverse().get(code);
  1213 + String device = "";
  1214 + if (!code.equals("")) {
  1215 + device = BasicData.deviceId2NbbmMap.inverse().get(code);
1208 1216 }
1209 1217 List<Object[]> list = scheduleRealInfoRepository.historyMessage(line, d, t, device);
1210 1218 for (Object[] obj : list) {
1211 1219 if (obj != null) {
1212   -
1213   - if(BasicData.deviceId2NbbmMap.get(obj[0].toString())==null){
1214   - List<CarDevice> carDeviceList=new ArrayList<CarDevice>();
1215   - try {
1216   - carDeviceList = carDeviceRepository.findCarDevice(obj[0].toString(), new Date(Long.parseLong(obj[3].toString())));
1217   - } catch (Exception e) {
1218   - // TODO Auto-generated catch block
1219   - e.printStackTrace();
1220   - }
1221   - if(carDeviceList.size()>0){
1222   - obj[0] =carDeviceList.get(0).getClZbh();
1223   - }else{
1224   - obj[0] =BasicData.deviceId2NbbmMap.get(obj[0].toString());
1225   - }
1226   - }else{
1227   - obj[0] =BasicData.deviceId2NbbmMap.get(obj[0].toString());
1228   - }
  1220 +
  1221 + if (BasicData.deviceId2NbbmMap.get(obj[0].toString()) == null) {
  1222 + List<CarDevice> carDeviceList = new ArrayList<CarDevice>();
  1223 + try {
  1224 + carDeviceList = carDeviceRepository.findCarDevice(obj[0].toString(), new Date(Long.parseLong(obj[3].toString())));
  1225 + } catch (Exception e) {
  1226 + // TODO Auto-generated catch block
  1227 + e.printStackTrace();
  1228 + }
  1229 + if (carDeviceList.size() > 0) {
  1230 + obj[0] = carDeviceList.get(0).getClZbh();
  1231 + } else {
  1232 + obj[0] = BasicData.deviceId2NbbmMap.get(obj[0].toString());
  1233 + }
  1234 + } else {
  1235 + obj[0] = BasicData.deviceId2NbbmMap.get(obj[0].toString());
  1236 + }
1229 1237 obj[3] = sdf.format(new Date(Long.parseLong(obj[3].toString())));
1230 1238 obj[4] = BasicData.lineCode2NameMap.get(line);
1231 1239 }
1232 1240 }
1233 1241  
1234 1242 if (type != null && type.length() != 0 && type.equals("export")) {
  1243 + String lineName = BasicData.lineCode2NameMap.get(line);
1235 1244 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
1236 1245 sdfSimple = new SimpleDateFormat("yyyyMMdd");
1237 1246 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -1253,7 +1262,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1253 1262 listI.add(newList.iterator());
1254 1263 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
1255 1264 ee.excelReplace(listI, new Object[]{m}, path + "mould/historyMessage.xls",
1256   - path + "export/调度历史消息" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  1265 + path + "export/" + sdfSimple.format(sdfMonth.parse(date))
  1266 + + "-" + lineName + "-调度历史消息.xls");
1257 1267 } catch (Exception e) {
1258 1268 // TODO: handle exception
1259 1269 e.printStackTrace();
... ... @@ -1321,8 +1331,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1321 1331 sch.setRemarks(remarks);
1322 1332 sch.calcStatus();
1323 1333 //if(sch.isLate2()){
1324   - //取消应发未到标记
1325   - // sch.setLate2(false);
  1334 + //取消应发未到标记
  1335 + // sch.setLate2(false);
1326 1336 LateAdjustHandle.remove(sch);
1327 1337 //}
1328 1338  
... ... @@ -1435,7 +1445,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1435 1445 //调整待发
1436 1446 tempRs = outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null, "3", null);
1437 1447  
1438   - if(null != tempRs && tempRs.get("ts") != null)
  1448 + if (null != tempRs && tempRs.get("ts") != null)
1439 1449 tempTs = (List<ScheduleRealInfo>) tempRs.get("ts");
1440 1450  
1441 1451 ts.addAll(tempTs);
... ... @@ -1465,7 +1475,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1465 1475  
1466 1476 ScheduleRealInfo sch = dayOfSchedule.get(id);
1467 1477  
1468   - if(null == sch){
  1478 + if (null == sch) {
1469 1479 rs.put("status", ResponseCode.ERROR);
1470 1480 rs.put("msg", "不存在的班次!");
1471 1481 return rs;
... ... @@ -1476,19 +1486,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1476 1486  
1477 1487 String clZbh = map.get("clZbh");
1478 1488 String jsy = map.get("jsy");
1479   - if(!clZbh.equals(sch.getClZbh())
  1489 + if (!clZbh.equals(sch.getClZbh())
1480 1490 || !jsy.equals(sch.getjGh() + "/" + sch.getjName()))
1481 1491 schModifyLog.saveChangetochange(sch, clZbh, jsy);//为换人换车情况表写入数据
1482 1492 /**
1483 1493 * 换车
1484 1494 */
1485   - if (StringUtils.isNotEmpty(clZbh)) {
  1495 + if (StringUtils.isNotEmpty(clZbh) && !clZbh.equals(sch.getClZbh())) {
1486 1496 //换车
1487 1497 if (!carExist(sch.getGsBm(), clZbh)) {
1488 1498 rs.put("status", ResponseCode.ERROR);
1489 1499 rs.put("msg", "车辆 " + clZbh + " 不存在!");
1490 1500 return rs;
1491   - } else if(!clZbh.equals(sch.getClZbh())){
  1501 + } else if (!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(clZbh))) {
  1502 + rs.put("status", ResponseCode.ERROR);
  1503 + rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + clZbh + "】的车辆");
  1504 + return rs;
  1505 + } else {
1492 1506 fLog.log("换车", sch.getClZbh(), clZbh);
1493 1507 dayOfSchedule.changeCar(sch, clZbh);
1494 1508 }
... ... @@ -1500,12 +1514,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1500 1514 if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) {
1501 1515 String jGh = jsy.split("/")[0];
1502 1516 String jName = getPersonName(sch.getGsBm(), jGh);
1503   - if(StringUtils.isEmpty(jName)){
  1517 + if (StringUtils.isEmpty(jName)) {
1504 1518 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员");
1505 1519 rs.put("status", ResponseCode.ERROR);
1506 1520 return rs;
1507   - }
1508   - else if(!jGh.equals(sch.getjGh())){
  1521 + } else if (!jGh.equals(sch.getjGh())) {
1509 1522 fLog.log("换驾驶员", sch.getjGh() + "/" + sch.getjName(), jsy);
1510 1523 persoChange(sch, jGh);
1511 1524 }
... ... @@ -1518,17 +1531,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1518 1531 if (StringUtils.isNotEmpty(spy) && spy.indexOf("/") != -1 && !spy.equals("/")) {
1519 1532 String sGh = spy.split("/")[0];
1520 1533 String sName = getPersonName(sch.getGsBm(), sGh);
1521   - if(StringUtils.isEmpty(sName)){
  1534 + if (StringUtils.isEmpty(sName)) {
1522 1535 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sGh + "】的售票员");
1523 1536 rs.put("status", ResponseCode.ERROR);
1524 1537 return rs;
1525   - }
1526   - else if(!sGh.equals(sch.getsGh())){
  1538 + } else if (!sGh.equals(sch.getsGh())) {
1527 1539 fLog.log("换售票员", sch.getsGh() + "/" + sch.getsName(), spy);
1528 1540 persoChangeSPY(sch, sGh);
1529 1541 }
1530   - }
1531   - else if(StringUtils.isNotEmpty(sch.getsGh())){
  1542 + } else if (StringUtils.isNotEmpty(sch.getsGh())) {
1532 1543 fLog.log("撤销售票员");
1533 1544 sch.setsGh("");
1534 1545 sch.setsName("");
... ... @@ -1555,9 +1566,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1555 1566 //取消应发未到标记
1556 1567 //if(sch.isLate2()){
1557 1568 // sch.setLate2(false);
1558   - LateAdjustHandle.remove(sch);
  1569 + LateAdjustHandle.remove(sch);
1559 1570 //}
1560   - } else if (StringUtils.isNotEmpty(sch.getFcsjActual()) && StringUtils.isEmpty(fcsjActual)){
  1571 + } else if (StringUtils.isNotEmpty(sch.getFcsjActual()) && StringUtils.isEmpty(fcsjActual)) {
1561 1572 fLog.log("撤销实发时间", sch.getFcsjActual(), "");
1562 1573 //撤销实发
1563 1574 revokeRealOutgo(sch.getId());
... ... @@ -1587,7 +1598,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1587 1598 dayOfSchedule.reCalcExecPlan(sch.getClZbh());
1588 1599 //取消应发未到标记
1589 1600 LateAdjustHandle.remove(sch);
1590   - } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){
  1601 + } else if (StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)) {
1591 1602 //清除实达时间
1592 1603 fLog.log("撤销实达时间", sch.getZdsjActual(), "");
1593 1604 sch.clearZdsjActual();
... ... @@ -1622,15 +1633,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1622 1633 if (StringUtils.isNotEmpty(jhlc)) {
1623 1634 double jhlcNum = Double.parseDouble(jhlc);
1624 1635 //烂班
1625   - if(jhlcNum == 0 && sch.getJhlcOrig() != 0 && !sch._isInout() && !sch.isDestroy()){
  1636 + if (jhlcNum == 0 && sch.getJhlcOrig() != 0 && !sch._isInout() && !sch.isDestroy()) {
1626 1637 destroy(sch.getId() + "", "", map.get("adjustExps").toString(), null);
1627 1638 fLog.log("里程设置为0,自动烂班");
1628   - }
1629   - else if(jhlcNum != sch.getJhlc()){
  1639 + } else if (jhlcNum != sch.getJhlc()) {
1630 1640 fLog.log("设置里程", sch.getJhlc(), jhlcNum);
1631 1641 sch.setJhlc(jhlcNum);
1632 1642 //临加班次,实际计划一起改
1633   - if(sch.isSflj())
  1643 + if (sch.isSflj())
1634 1644 sch.setJhlcOrig(jhlcNum);
1635 1645 }
1636 1646 }
... ... @@ -1678,7 +1688,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1678 1688 id = jsonObj.getLong("id");
1679 1689 schedule = dayOfSchedule.get(id);
1680 1690  
1681   - if(schedule != null)
  1691 + if (schedule != null)
1682 1692 outgoAdjust(id, null, dfsj, null, "2", null);
1683 1693 }
1684 1694  
... ... @@ -1796,7 +1806,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1796 1806  
1797 1807 @Override
1798 1808 public Map<String, Object> findKMBC2(String jName, String clZbh, String date) {
1799   - List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill3(jName, clZbh, date,"","");
  1809 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybill3(jName, clZbh, date, "", "");
1800 1810  
1801 1811 DecimalFormat format = new DecimalFormat("0.00");
1802 1812 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
... ... @@ -1865,47 +1875,47 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1865 1875 public Map<String, Object> findKMBC(String jGh, String clZbh,
1866 1876 String lpName, String date, String line) {
1867 1877 Map<String, Object> map = new HashMap<String, Object>();
1868   - List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);
1869   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  1878 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);
  1879 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
1870 1880 for (int i = 0; i < list.size(); i++) {
1871   - ScheduleRealInfo s=list.get(i);
  1881 + ScheduleRealInfo s = list.get(i);
1872 1882 Set<ChildTaskPlan> cts = s.getcTasks();
1873   - if(cts != null && cts.size() > 0){
1874   - lists.add(s);
1875   - }else{
1876   - if(s.getFcsjActual() !=null&&s.getZdsjActual()!=null){
1877   - lists.add(s);
1878   - }
  1883 + if (cts != null && cts.size() > 0) {
  1884 + lists.add(s);
  1885 + } else {
  1886 + if (s.getFcsjActual() != null && s.getZdsjActual() != null) {
  1887 + lists.add(s);
  1888 + }
1879 1889 }
1880 1890 }
1881   - map.put("jhbc", culateService.culateJhbc(list,""));//计划班次
  1891 + map.put("jhbc", culateService.culateJhbc(list, ""));//计划班次
1882 1892 map.put("jhlc", Arith.add(culateService.culateJhgl(list),
1883   - culateService.culateJhJccgl(list))); //计划总里程
  1893 + culateService.culateJhJccgl(list))); //计划总里程
1884 1894 map.put("cjbc", culateService.culateLbbc(list));//烂班班次
1885 1895 map.put("remMileage", culateService.culateLbgl(list)); //烂班公里
1886   - map.put("ljbc", culateService.culateLjbc(lists,""));//临加班次
1887   - double ljgl=culateService.culateLjgl(lists);
  1896 + map.put("ljbc", culateService.culateLjbc(lists, ""));//临加班次
  1897 + double ljgl = culateService.culateLjgl(lists);
1888 1898 map.put("addMileage", ljgl); //临加公里
1889   - map.put("sjbc", culateService.culateSjbc(lists,"") + culateService.culateLjbc(lists,""));
1890   - double ksgl=culateService.culateKsgl(list);//子任务空驶公里
1891   - double jccgl=culateService.culateJccgl(lists);//空驶班次公里
  1899 + map.put("sjbc", culateService.culateSjbc(lists, "") + culateService.culateLjbc(lists, ""));
  1900 + double ksgl = culateService.culateKsgl(list);//子任务空驶公里
  1901 + double jccgl = culateService.culateJccgl(lists);//空驶班次公里
1892 1902 map.put("ksgl", ksgl);//空驶公里
1893   - double sjgl=culateService.culateSjgl(lists);//实际营运公里
1894   - map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl)));//总公里
1895   - map.put("zkslc", Arith.add(ksgl,jccgl));
  1903 + double sjgl = culateService.culateSjgl(lists);//实际营运公里
  1904 + map.put("realMileage", Arith.add(Arith.add(ksgl, jccgl), Arith.add(sjgl, ljgl)));//总公里
  1905 + map.put("zkslc", Arith.add(ksgl, jccgl));
1896 1906 map.put("jcclc", jccgl);
1897   - map.put("yygl",Arith.add(sjgl,ljgl)); //总营运公里
  1907 + map.put("yygl", Arith.add(sjgl, ljgl)); //总营运公里
1898 1908 return map;
1899 1909 }
1900 1910  
1901 1911 public Map<String, Object> findKMBC_mh_2(String jGh, String clZbh,
1902   - String lpName, String date, String line) {
  1912 + String lpName, String date, String line) {
1903 1913 Map<String, Object> map = new HashMap<String, Object>();
1904   - List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);
1905   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  1914 + List<ScheduleRealInfo> list = scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);
  1915 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
1906 1916 for (int i = 0; i < list.size(); i++) {
1907   - ScheduleRealInfo s=list.get(i);
1908   - if(s.isDestroy() && s.isReissue()){
  1917 + ScheduleRealInfo s = list.get(i);
  1918 + if (s.isDestroy() && s.isReissue()) {
1909 1919 s.setRemark("");
1910 1920 s.setFcsjActual(s.getDfsj());
1911 1921 s.setZdsjActual(s.getZdsj());
... ... @@ -1914,32 +1924,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1914 1924 }
1915 1925  
1916 1926 Set<ChildTaskPlan> cts = s.getcTasks();
1917   - if(cts != null && cts.size() > 0){
  1927 + if (cts != null && cts.size() > 0) {
1918 1928 lists.add(s);
1919   - }else{
1920   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  1929 + } else {
  1930 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
1921 1931 lists.add(s);
1922 1932 }
1923 1933 }
1924 1934 }
1925   - double ksgl=culateService.culateKsgl(list);
1926   - double sjgl=culateService.culateSjgl(lists);
1927   - double jccgl=culateService.culateJccgl(lists);
1928   - double ljgl=culateService.culateLjgl(lists);
  1935 + double ksgl = culateService.culateKsgl(list);
  1936 + double sjgl = culateService.culateSjgl(lists);
  1937 + double jccgl = culateService.culateJccgl(lists);
  1938 + double ljgl = culateService.culateLjgl(lists);
1929 1939  
1930   - map.put("jhlc", Arith.add(culateService.culateJhgl(list),culateService.culateJhJccgl(list))); //计划里程
  1940 + map.put("jhlc", Arith.add(culateService.culateJhgl(list), culateService.culateJhJccgl(list))); //计划里程
1931 1941 map.put("remMileage", culateService.culateLbgl(list)); //烂班公里
1932 1942 map.put("addMileage", ljgl); //临加公里
1933   - map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里
  1943 + map.put("yygl", Arith.add(sjgl, ljgl)); //实际公里
1934 1944 map.put("ksgl", ksgl);//空驶公里
1935   - map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl)));
  1945 + map.put("realMileage", Arith.add(Arith.add(ksgl, jccgl), Arith.add(sjgl, ljgl)));
1936 1946 // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage));
1937   - map.put("jhbc", culateService.culateJhbc(list,""));
  1947 + map.put("jhbc", culateService.culateJhbc(list, ""));
1938 1948 map.put("cjbc", culateService.culateLbbc(list));
1939   - map.put("ljbc", culateService.culateLjbc(lists,""));
1940   - map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,""));
  1949 + map.put("ljbc", culateService.culateLjbc(lists, ""));
  1950 + map.put("sjbc", culateService.culateJhbc(lists, "") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists, ""));
1941 1951 map.put("jcclc", jccgl);
1942   - map.put("zkslc", Arith.add(ksgl,jccgl));
  1952 + map.put("zkslc", Arith.add(ksgl, jccgl));
1943 1953 // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc));
1944 1954 return map;
1945 1955 }
... ... @@ -1947,86 +1957,87 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1947 1957  
1948 1958 @Override
1949 1959 public List<Map<String, Object>> accountPx(String line, String date,
1950   - String code, String xlName, String px) {
  1960 + String code, String xlName, String px) {
1951 1961 // List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px);
1952 1962 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
1953   - if(!code.trim().equals("")){
1954   - code=BasicData.deviceId2NbbmMap.inverse().get(code);
1955   - }
1956   - String fgs="";
1957   - List<Line> lineList= lineRepository.findLineByCode(line);
1958   - if(lineList.size()>0){
1959   - Line l=lineList.get(0);
1960   - fgs=BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany()+"_"+l.getCompany());
1961   - }
  1963 + if (!code.trim().equals("")) {
  1964 + code = BasicData.deviceId2NbbmMap.inverse().get(code);
  1965 + }
  1966 + String fgs = "";
  1967 + List<Line> lineList = lineRepository.findLineByCode(line);
  1968 + if (lineList.size() > 0) {
  1969 + Line l = lineList.get(0);
  1970 + fgs = BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany() + "_" + l.getCompany());
  1971 + }
1962 1972 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
1963   - String sql= "SELECT request_code,FROM_UNIXTIME(TIMESTAMP / 1000,'%Y-%m-%d %T') as TIMESTAMP ,"
1964   - + " device_id FROM bsth_v_report_80 WHERE "
1965   - + " FROM_UNIXTIME( TIMESTAMP / 1000,'%Y-%m-%d') = '"+date+"' AND"
1966   - + " line_id = '"+line+"' and device_id like '%"+code+"%'";
  1973 + String sql = "SELECT request_code,FROM_UNIXTIME(TIMESTAMP / 1000,'%Y-%m-%d %T') as TIMESTAMP ,"
  1974 + + " device_id FROM bsth_v_report_80 WHERE "
  1975 + + " FROM_UNIXTIME( TIMESTAMP / 1000,'%Y-%m-%d') = '" + date + "' AND"
  1976 + + " line_id = '" + line + "' and device_id like '%" + code + "%'";
1967 1977 Map<String, Object> map;
1968 1978 List<Object[]> lsitObj = jdbcTemplate.query(sql,
1969 1979 new RowMapper<Object[]>() {
1970 1980 @Override
1971 1981 public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException {
1972   - Object[] t = new Object[3];
1973   - t[0]=rs.getString("request_code");
1974   - t[1]=rs.getString("TIMESTAMP");
1975   - t[2]=rs.getString("device_id");
  1982 + Object[] t = new Object[3];
  1983 + t[0] = rs.getString("request_code");
  1984 + t[1] = rs.getString("TIMESTAMP");
  1985 + t[2] = rs.getString("device_id");
1976 1986 return t;
1977 1987 }
1978 1988 });
1979 1989 int i = 1;
1980 1990 for (Object[] obj : lsitObj) {
1981 1991 if (obj != null) {
1982   - map = new HashMap<String, Object>();
1983   - map.put("num", i++);
1984   - map.put("xlName", xlName);
1985   - if(BasicData.deviceId2NbbmMap.get(obj[2])==null){
1986   - List<CarDevice> carDeviceList=new ArrayList<CarDevice>();
1987   - try {
1988   - carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(obj[1].toString()));
1989   - } catch (Exception e) {
1990   - // TODO Auto-generated catch block
1991   - e.printStackTrace();
1992   - }
1993   - if(carDeviceList.size()>0){
1994   - map.put("clZbh", carDeviceList.get(0).getClZbh());
1995   -
1996   - }else{
1997   - map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
1998   - }
1999   - }else{
2000   - map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
2001   -
2002   - }
2003   - map.put("company",fgs);
2004   - map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
2005   - map.put("requestTime", obj[1]);
2006   - listMap.add(map);
2007   - }
2008   - }
2009   - if(listMap.size()>1){
2010   - if(px.equals("asc")){
2011   - Collections.sort(listMap,new AccountMap());
2012   - }else{
2013   - Collections.sort(listMap,new AccountMap2());
2014   - }
  1992 + map = new HashMap<String, Object>();
  1993 + map.put("num", i++);
  1994 + map.put("xlName", xlName);
  1995 + if (BasicData.deviceId2NbbmMap.get(obj[2]) == null) {
  1996 + List<CarDevice> carDeviceList = new ArrayList<CarDevice>();
  1997 + try {
  1998 + carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(obj[1].toString()));
  1999 + } catch (Exception e) {
  2000 + // TODO Auto-generated catch block
  2001 + e.printStackTrace();
  2002 + }
  2003 + if (carDeviceList.size() > 0) {
  2004 + map.put("clZbh", carDeviceList.get(0).getClZbh());
  2005 +
  2006 + } else {
  2007 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  2008 + }
  2009 + } else {
  2010 + map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
  2011 +
  2012 + }
  2013 + map.put("company", fgs);
  2014 + map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
  2015 + map.put("requestTime", obj[1]);
  2016 + listMap.add(map);
  2017 + }
  2018 + }
  2019 + if (listMap.size() > 1) {
  2020 + if (px.equals("asc")) {
  2021 + Collections.sort(listMap, new AccountMap());
  2022 + } else {
  2023 + Collections.sort(listMap, new AccountMap2());
  2024 + }
2015 2025 }
2016 2026 return listMap;
2017 2027 }
  2028 +
2018 2029 @Override
2019 2030 public List<Map<String, Object>> account(String line, String date,
2020 2031 String code, String xlName, String type) {
2021   - if(!code.trim().equals("")){
2022   - code=BasicData.deviceId2NbbmMap.inverse().get(code);
2023   - }
2024   - String fgs="";
2025   - List<Line> lineList= lineRepository.findLineByCode(line);
2026   - if(lineList.size()>0){
2027   - Line l=lineList.get(0);
2028   - fgs=BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany()+"_"+l.getCompany());
2029   - }
  2032 + if (!code.trim().equals("")) {
  2033 + code = BasicData.deviceId2NbbmMap.inverse().get(code);
  2034 + }
  2035 + String fgs = "";
  2036 + List<Line> lineList = lineRepository.findLineByCode(line);
  2037 + if (lineList.size() > 0) {
  2038 + Line l = lineList.get(0);
  2039 + fgs = BasicData.businessFgsCodeNameMap.get(l.getBrancheCompany() + "_" + l.getCompany());
  2040 + }
2030 2041 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2031 2042 List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code);
2032 2043 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
... ... @@ -2037,25 +2048,25 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2037 2048 map = new HashMap<String, Object>();
2038 2049 map.put("num", i++);
2039 2050 map.put("xlName", xlName);
2040   - if(BasicData.deviceId2NbbmMap.get(obj[2])==null){
2041   - List<CarDevice> carDeviceList=new ArrayList<CarDevice>();
2042   - try {
2043   - carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(obj[1].toString()));
2044   - } catch (Exception e) {
2045   - // TODO Auto-generated catch block
2046   - e.printStackTrace();
2047   - }
2048   - if(carDeviceList.size()>0){
  2051 + if (BasicData.deviceId2NbbmMap.get(obj[2]) == null) {
  2052 + List<CarDevice> carDeviceList = new ArrayList<CarDevice>();
  2053 + try {
  2054 + carDeviceList = carDeviceRepository.findCarDevice(obj[2].toString(), sdf.parse(obj[1].toString()));
  2055 + } catch (Exception e) {
  2056 + // TODO Auto-generated catch block
  2057 + e.printStackTrace();
  2058 + }
  2059 + if (carDeviceList.size() > 0) {
2049 2060 map.put("clZbh", carDeviceList.get(0).getClZbh());
2050 2061  
2051   - }else{
  2062 + } else {
2052 2063 map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
2053   - }
2054   - }else{
  2064 + }
  2065 + } else {
2055 2066 map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2]));
2056 2067  
2057   - }
2058   - map.put("company",fgs);
  2068 + }
  2069 + map.put("company", fgs);
2059 2070 map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase());
2060 2071 map.put("requestTime", obj[1]);
2061 2072 listMap.add(map);
... ... @@ -2086,7 +2097,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2086 2097 listI.add(listMap.iterator());
2087 2098 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2088 2099 ee.excelReplace(listI, new Object[]{m}, path + "mould/account.xls",
2089   - path + "export/驾驶员请求台账" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  2100 + path + "export/" + sdfSimple.format(sdfMonth.parse(date))
  2101 + + "-" + xlName + "-驾驶员请求台账.xls");
2090 2102 } catch (Exception e) {
2091 2103 // TODO: handle exception
2092 2104 e.printStackTrace();
... ... @@ -2095,189 +2107,193 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2095 2107  
2096 2108 return listMap;
2097 2109 }
2098   -
  2110 +
2099 2111 @Override
2100   - public List<SchEditInfoDto> correctForm(String line,String date,String endDate,
2101   - String lpName,String code, String type,String changType) {
2102   -
  2112 + public List<SchEditInfoDto> correctForm(String line, String date, String endDate,
  2113 + String lpName, String code, String type, String changType) {
  2114 +
2103 2115 // var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班',
2104 2116 // 'CXZX': '撤销执行', 'CXSF': '撤销实发', 'SFTZ': '实发调整', 'TZRC': '调整人车'};
2105   - Map<String, Object> map=new HashMap<String,Object>();
2106   - map.put("DFTZ", "待发调整");
2107   - map.put("FCXXWT", "发车信息微调");
2108   - map.put("JHLB", "计划烂班");
2109   - map.put("CXLB", "撤销烂班");
2110   - map.put("CXZX","撤销执行");
2111   - map.put("CXSF", "撤销实发");
2112   - map.put("SFTZ", "实发调整");
2113   - map.put("TZRC", "调整人车");
2114   -
2115   - SimpleDateFormat sdf1=new SimpleDateFormat("HH:mm");
2116   - SimpleDateFormat sdf2=new SimpleDateFormat("yyyy-MM-dd HH:mm");
2117   - String cont = "";
2118   - cont = " and xl_bm ='"+line +"'";
2119   - if(!lpName.equals("")){
2120   - cont +=" and lp_name = '"+lpName+"'";
2121   - }
2122   - if(!code.equals("")){
2123   - cont +=" and cl_zbh ='"+code+"'";
2124   - }
2125   - String sql = "select t1.*, t2.real_exec_date,"
2126   - + "t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name,"
2127   - + "t2.xl_dir,t2.real_exec_date from (select * from "
2128   - + "logger_sch_modify where rq BETWEEN ? and ? and line_code=? )"
2129   - + " t1 INNER JOIN bsth_c_s_sp_info_real t2 on "
2130   - + "t1.sch_id=t2.id where 1=1 " + cont;
2131   -
2132   - List<SchEditInfoDto> list = jdbcTemplate.query(sql,
2133   - new BeanPropertyRowMapper(SchEditInfoDto.class),date,endDate, line);
2134   - List<SchEditInfoDto> lists=new ArrayList<SchEditInfoDto>();
2135   - for (int i = 0; i < list.size(); i++) {
2136   - Long fcsjs=0l;
2137   - Long updsj=0l;
2138   - SchEditInfoDto t=list.get(i);
2139   - if(map.get(t.getType())!=null){
2140   -
2141   - if(changType.equals("")){
2142   - t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";");
2143   - }else{
2144   - String fcsj="";
2145   - String updtime="";
2146   - try {
2147   - fcsj= sdf1.format(sdf1.parse(t.getFcsj()));
2148   - updtime=sdf1.format(sdf1.parse(t.getTimeStr()));
2149   - fcsjs=sdf2.parse(t.getRealExecDate()+" "+fcsj).getTime();
2150   - updsj=sdf2.parse(t.getRq()+" "+updtime).getTime();
2151   - } catch (ParseException e) {
2152   - // TODO Auto-generated catch block
2153   - e.printStackTrace();
2154   - }
2155   - if(changType.equals("1")){
2156   - if(fcsjs>updsj){
2157   - t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";");
2158   - }else{
2159   - t.setType2("");
2160   - }
2161   - }else if(changType.equals("2")){
2162   - if(fcsjs<updsj){
2163   - t.setType2(t.getUser()+"于"+t.getTimeStr()+"进行"+map.get(t.getType()).toString()+";");
2164   - }else{
2165   - t.setType2("");
2166   - }
2167   - }
2168   - }
2169   - }else{
2170   - t.setType2("");
2171   - }
2172   - boolean fage=true;
2173   - for (int j = 0; j < lists.size(); j++) {
2174   - SchEditInfoDto s=lists.get(j);
2175   - if(s.getSchId()==t.getSchId()){
2176   - s.setType2(s.getType2()+" "+t.getType2());
2177   - fage=false;
2178   - }
2179   - }
2180   -
2181   - if(fage){
2182   - if(changType.equals("")){
2183   - lists.add(t);
2184   - } else {
2185   - if (changType.equals("1")) {
2186   - if (fcsjs > updsj) {
2187   - lists.add(t);
2188   - }
2189   - } else if (changType.equals("2")) {
2190   - if (fcsjs < updsj) {
2191   - lists.add(t);
2192   - }
2193   - }
2194   - }
2195   - }
2196   - }
2197   -
2198   - if (type != null && type.length() != 0 && type.equals("export")) {
2199   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
2200   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
2201   - List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
2202   - Map<String, Object> m = new HashMap<String, Object>();
2203   - m.put("dates",date);
2204   - ReportUtils ee = new ReportUtils();
2205   - List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
2206   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2207   - for (SchEditInfoDto d : lists) {
2208   - Map<String, Object> tempMap = new HashMap<String, Object>();
2209   - tempMap.put("lpName", d.getLpName());
2210   - tempMap.put("rq", d.getRq());
2211   - tempMap.put("clZbh", d.getClZbh());
2212   - tempMap.put("jName", d.getjName()+"/"+d.getjGh());
2213   - tempMap.put("fcsj", d.getFcsj());
2214   - tempMap.put("type", d.getType2());
2215   - tempList.add(tempMap);
2216   - }
2217   - try {
2218   - listI.add(tempList.iterator());
2219   - String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2220   - ee.excelReplace(listI, new Object[]{m}, path + "mould/correctForm.xls",
2221   - path + "export/修正报表" + date+ ".xls");
2222   - } catch (Exception e) {
2223   - // TODO: handle exception
2224   - e.printStackTrace();
2225   - }
  2117 + Map<String, Object> map = new HashMap<String, Object>();
  2118 + map.put("DFTZ", "待发调整");
  2119 + map.put("FCXXWT", "发车信息微调");
  2120 + map.put("JHLB", "计划烂班");
  2121 + map.put("CXLB", "撤销烂班");
  2122 + map.put("CXZX", "撤销执行");
  2123 + map.put("CXSF", "撤销实发");
  2124 + map.put("SFTZ", "实发调整");
  2125 + map.put("TZRC", "调整人车");
  2126 +
  2127 + SimpleDateFormat sdf1 = new SimpleDateFormat("HH:mm");
  2128 + SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2129 + String cont = "";
  2130 + cont = " and xl_bm ='" + line + "'";
  2131 + if (!lpName.equals("")) {
  2132 + cont += " and lp_name = '" + lpName + "'";
  2133 + }
  2134 + if (!code.equals("")) {
  2135 + cont += " and cl_zbh ='" + code + "'";
  2136 + }
  2137 + String sql = "select t1.*, t2.real_exec_date,"
  2138 + + "t2.fcsj,t2.lp_name,t2.cl_zbh,t2.j_gh,t2.j_name,"
  2139 + + "t2.xl_dir,t2.real_exec_date from (select * from "
  2140 + + "logger_sch_modify where rq BETWEEN ? and ? and line_code=? )"
  2141 + + " t1 INNER JOIN bsth_c_s_sp_info_real t2 on "
  2142 + + "t1.sch_id=t2.id where 1=1 " + cont;
  2143 +
  2144 + List<SchEditInfoDto> list = jdbcTemplate.query(sql,
  2145 + new BeanPropertyRowMapper(SchEditInfoDto.class), date, endDate, line);
  2146 + List<SchEditInfoDto> lists = new ArrayList<SchEditInfoDto>();
  2147 + for (int i = 0; i < list.size(); i++) {
  2148 + Long fcsjs = 0l;
  2149 + Long updsj = 0l;
  2150 + SchEditInfoDto t = list.get(i);
  2151 + if (map.get(t.getType()) != null) {
  2152 +
  2153 + if (changType.equals("")) {
  2154 + t.setType2(t.getUser() + "于" + t.getTimeStr() + "进行" + map.get(t.getType()).toString() + ";");
  2155 + } else {
  2156 + String fcsj = "";
  2157 + String updtime = "";
  2158 + try {
  2159 + fcsj = sdf1.format(sdf1.parse(t.getFcsj()));
  2160 + updtime = sdf1.format(sdf1.parse(t.getTimeStr()));
  2161 + fcsjs = sdf2.parse(t.getRealExecDate() + " " + fcsj).getTime();
  2162 + updsj = sdf2.parse(t.getRq() + " " + updtime).getTime();
  2163 + } catch (ParseException e) {
  2164 + // TODO Auto-generated catch block
  2165 + e.printStackTrace();
  2166 + }
  2167 + if (changType.equals("1")) {
  2168 + if (fcsjs > updsj) {
  2169 + t.setType2(t.getUser() + "于" + t.getTimeStr() + "进行" + map.get(t.getType()).toString() + ";");
  2170 + } else {
  2171 + t.setType2("");
  2172 + }
  2173 + } else if (changType.equals("2")) {
  2174 + if (fcsjs < updsj) {
  2175 + t.setType2(t.getUser() + "于" + t.getTimeStr() + "进行" + map.get(t.getType()).toString() + ";");
  2176 + } else {
  2177 + t.setType2("");
  2178 + }
  2179 + }
  2180 + }
  2181 + } else {
  2182 + t.setType2("");
  2183 + }
  2184 + boolean fage = true;
  2185 + for (int j = 0; j < lists.size(); j++) {
  2186 + SchEditInfoDto s = lists.get(j);
  2187 + if (s.getSchId() == t.getSchId()) {
  2188 + s.setType2(s.getType2() + " " + t.getType2());
  2189 + fage = false;
  2190 + }
  2191 + }
  2192 +
  2193 + if (fage) {
  2194 + if (changType.equals("")) {
  2195 + lists.add(t);
  2196 + } else {
  2197 + if (changType.equals("1")) {
  2198 + if (fcsjs > updsj) {
  2199 + lists.add(t);
  2200 + }
  2201 + } else if (changType.equals("2")) {
  2202 + if (fcsjs < updsj) {
  2203 + lists.add(t);
  2204 + }
  2205 + }
  2206 + }
  2207 + }
  2208 + }
  2209 +
  2210 + if (type != null && type.length() != 0 && type.equals("export")) {
  2211 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  2212 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  2213 + List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  2214 + Map<String, Object> m = new HashMap<String, Object>();
  2215 + m.put("dates", date);
  2216 + ReportUtils ee = new ReportUtils();
  2217 + List<Map<String, Object>> tempList = new ArrayList<Map<String, Object>>();
  2218 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  2219 + for (SchEditInfoDto d : lists) {
  2220 + Map<String, Object> tempMap = new HashMap<String, Object>();
  2221 + tempMap.put("lpName", d.getLpName());
  2222 + tempMap.put("rq", d.getRq());
  2223 + tempMap.put("clZbh", d.getClZbh());
  2224 + tempMap.put("jName", d.getjName() + "/" + d.getjGh());
  2225 + tempMap.put("fcsj", d.getFcsj());
  2226 + tempMap.put("type", d.getType2());
  2227 + tempList.add(tempMap);
  2228 + }
  2229 + try {
  2230 + String dateTime = sdfSimple.format(sdfMonth.parse(date));
  2231 + String lineName = BasicData.lineCode2NameMap.get(line);
  2232 + listI.add(tempList.iterator());
  2233 + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
  2234 + ee.excelReplace(listI, new Object[]{m}, path + "mould/correctForm.xls",
  2235 + path + "export/" + dateTime + "-" + lineName + "-修正报表.xls");
  2236 + } catch (Exception e) {
  2237 + // TODO: handle exception
  2238 + e.printStackTrace();
  2239 + }
2226 2240 // Map<String, Object> maps = tempList.get(tempList.size() - 1);
2227   - }
  2241 + }
2228 2242 return lists;
2229 2243 }
  2244 +
2230 2245 @Override
2231 2246 public List<ScheduleRealInfo> queryListWaybill(String jName, String clZbh,
2232 2247 String lpName, String date, String line) {
2233 2248 List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
2234 2249 List<ScheduleRealInfo> list = null;
2235 2250 list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
2236   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
2237   - String minfcsj="02:00";
2238   - List<Line> lineList=lineRepository.findLineByCode(line);
2239   - if(lineList.size()>0){
2240   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
2241   - + " id = ("
2242   - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
2243   - + ")";
2244   - minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class);
2245   - }
2246   - String[] minSjs = minfcsj.split(":");
2247   - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
2248   -
  2251 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2252 + String minfcsj = "02:00";
  2253 + List<Line> lineList = lineRepository.findLineByCode(line);
  2254 + if (lineList.size() > 0) {
  2255 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  2256 + + " id = ("
  2257 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  2258 + + ")";
  2259 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  2260 + }
  2261 + String[] minSjs = minfcsj.split(":");
  2262 + Long minSj = Long.parseLong(minSjs[0]) * 60 + Long.parseLong(minSjs[1]);
  2263 +
2249 2264 for (int i = 0; i < list.size(); i++) {
2250   - ScheduleRealInfo s=list.get(i);
2251   - if(s.getBcType().equals("out")){
2252   - s.setRemark("1");
2253   - }else if(s.getBcType().equals("in")){
2254   - s.setRemark("3");
2255   - }else{
2256   - s.setRemark("2");
2257   - }
2258   - String[] fcsj= s.getFcsj().split(":");
2259   - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
2260   -
2261   - Long fscjT=0L;
2262   - if(fcsjL<minSj){
2263   - Calendar calendar = new GregorianCalendar();
  2265 + ScheduleRealInfo s = list.get(i);
  2266 + if (s.getBcType().equals("out")) {
  2267 + s.setRemark("1");
  2268 + } else if (s.getBcType().equals("in")) {
  2269 + s.setRemark("3");
  2270 + } else {
  2271 + s.setRemark("2");
  2272 + }
  2273 + String[] fcsj = s.getFcsj().split(":");
  2274 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
  2275 +
  2276 + Long fscjT = 0L;
  2277 + if (fcsjL < minSj) {
  2278 + Calendar calendar = new GregorianCalendar();
2264 2279 calendar.setTime(s.getScheduleDate());
2265   - calendar.add(calendar.DATE,1);
  2280 + calendar.add(calendar.DATE, 1);
2266 2281 s.setScheduleDate(calendar.getTime());
2267 2282 try {
2268   - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
  2283 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
2269 2284 } catch (ParseException e) {
2270 2285 // TODO Auto-generated catch block
2271 2286 e.printStackTrace();
2272 2287 }
2273 2288  
2274   - }else{
  2289 + } else {
2275 2290 try {
2276   - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
  2291 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
2277 2292 } catch (ParseException e) {
2278 2293 // TODO Auto-generated catch block
2279 2294 e.printStackTrace();
2280   - };
  2295 + }
  2296 + ;
2281 2297 }
2282 2298 s.setFcsjT(fscjT);
2283 2299 }
... ... @@ -2309,28 +2325,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2309 2325 //计算营运里程,空驶里程
2310 2326 if (!childTaskPlans.isEmpty()) {
2311 2327 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
2312   - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  2328 + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans);
2313 2329 Collections.sort(listit, new ComparableChild());
2314 2330 for (int j = 0; j < listit.size(); j++) {
2315 2331 ScheduleRealInfo t = new ScheduleRealInfo();
2316 2332 ChildTaskPlan childTaskPlan = listit.get(j);
2317   - if(childTaskPlan.getCcId()==null){
2318   - if (childTaskPlan.isDestroy()) {
2319   - t.setFcsjActual("");
2320   - t.setZdsjActual("");
2321   - t.setJhlc(0.0);
2322   - } else {
2323   - t.setFcsjActual(childTaskPlan.getStartDate());
2324   - t.setZdsjActual(childTaskPlan.getEndDate());
2325   - t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
2326   - }
2327   - t.setFcsj(childTaskPlan.getStartDate());
2328   - t.setZdsj(childTaskPlan.getEndDate());
2329   - t.setQdzName(childTaskPlan.getStartStationName());
2330   - t.setZdzName(childTaskPlan.getEndStationName());
2331   - t.setRemarks(childTaskPlan.getRemarks());
2332   - t.setAdjustExps("子");
2333   - listSchedule.add(t);
  2333 + if (childTaskPlan.getCcId() == null) {
  2334 + if (childTaskPlan.isDestroy()) {
  2335 + t.setFcsjActual("");
  2336 + t.setZdsjActual("");
  2337 + t.setJhlc(0.0);
  2338 + } else {
  2339 + t.setFcsjActual(childTaskPlan.getStartDate());
  2340 + t.setZdsjActual(childTaskPlan.getEndDate());
  2341 + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  2342 + }
  2343 + t.setFcsj(childTaskPlan.getStartDate());
  2344 + t.setZdsj(childTaskPlan.getEndDate());
  2345 + t.setQdzName(childTaskPlan.getStartStationName());
  2346 + t.setZdzName(childTaskPlan.getEndStationName());
  2347 + t.setRemarks(childTaskPlan.getRemarks());
  2348 + t.setAdjustExps("子");
  2349 + listSchedule.add(t);
2334 2350 }
2335 2351 }
2336 2352 }
... ... @@ -2341,48 +2357,49 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2341 2357  
2342 2358 @Override
2343 2359 public List<ScheduleRealInfo> queryListWaybill2(String jName, String clZbh,
2344   - String lpName, String date, String line) {
  2360 + String lpName, String date, String line) {
2345 2361 List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
2346 2362 List<ScheduleRealInfo> list = null;
2347 2363 list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
2348   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
2349   - String minfcsj="02:00";
2350   - List<Line> lineList=lineRepository.findLineByCode(line);
2351   - if(lineList.size()>0){
2352   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
2353   - + " id = ("
2354   - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
2355   - + ")";
2356   - minfcsj= jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  2364 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  2365 + String minfcsj = "02:00";
  2366 + List<Line> lineList = lineRepository.findLineByCode(line);
  2367 + if (lineList.size() > 0) {
  2368 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  2369 + + " id = ("
  2370 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  2371 + + ")";
  2372 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
2357 2373 }
2358 2374 String[] minSjs = minfcsj.split(":");
2359   - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
  2375 + Long minSj = Long.parseLong(minSjs[0]) * 60 + Long.parseLong(minSjs[1]);
2360 2376  
2361 2377 for (int i = 0; i < list.size(); i++) {
2362   - ScheduleRealInfo s=list.get(i);
2363   - String[] fcsj= s.getFcsj().split(":");
2364   - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
  2378 + ScheduleRealInfo s = list.get(i);
  2379 + String[] fcsj = s.getFcsj().split(":");
  2380 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
2365 2381  
2366   - Long fscjT=0L;
2367   - if(fcsjL<minSj){
2368   - Calendar calendar = new GregorianCalendar();
  2382 + Long fscjT = 0L;
  2383 + if (fcsjL < minSj) {
  2384 + Calendar calendar = new GregorianCalendar();
2369 2385 calendar.setTime(s.getScheduleDate());
2370   - calendar.add(calendar.DATE,1);
  2386 + calendar.add(calendar.DATE, 1);
2371 2387 s.setScheduleDate(calendar.getTime());
2372 2388 try {
2373   - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
  2389 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
2374 2390 } catch (ParseException e) {
2375 2391 // TODO Auto-generated catch block
2376 2392 e.printStackTrace();
2377 2393 }
2378 2394  
2379   - }else{
  2395 + } else {
2380 2396 try {
2381   - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
  2397 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
2382 2398 } catch (ParseException e) {
2383 2399 // TODO Auto-generated catch block
2384 2400 e.printStackTrace();
2385   - };
  2401 + }
  2402 + ;
2386 2403 }
2387 2404 s.setFcsjT(fscjT);
2388 2405 }
... ... @@ -2403,14 +2420,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2403 2420 }
2404 2421  
2405 2422 if (s.isDestroy()) {
2406   - if(s.isReissue()){
  2423 + if (s.isReissue()) {
2407 2424 s.setFcsjActual(s.getDfsj());
2408 2425 s.setZdsjActual(s.getZdsj());
2409 2426 s.setRemarks("");
2410 2427 s.setStatus(2);
2411 2428 s.setJhlc(s.getJhlcOrig());
2412   - }
2413   - else{
  2429 + } else {
2414 2430 s.setFcsjActual("");
2415 2431 s.setZdsjActual("");
2416 2432 s.setJhlc(0.0);
... ... @@ -2423,7 +2439,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2423 2439 //计算营运里程,空驶里程
2424 2440 if (!childTaskPlans.isEmpty()) {
2425 2441 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
2426   - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  2442 + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans);
2427 2443 Collections.sort(listit, new ComparableChild());
2428 2444 for (int j = 0; j < listit.size(); j++) {
2429 2445 ScheduleRealInfo t = new ScheduleRealInfo();
... ... @@ -2466,29 +2482,30 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2466 2482 }
2467 2483 return rs;
2468 2484 }
  2485 +
2469 2486 @Override
2470 2487 public List<Map<String, Object>> statisticsDaily(String line, String date,
2471 2488 String xlName, String type) {
2472   - List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>();
2473   - List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
2474   - List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>();
  2489 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  2490 + List<ScheduleRealInfo> list_s = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  2491 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2475 2492 for (int i = 0; i < list_s.size(); i++) {
2476   - ScheduleRealInfo s=list_s.get(i);
  2493 + ScheduleRealInfo s = list_s.get(i);
2477 2494 Set<ChildTaskPlan> cts = s.getcTasks();
2478   - if(cts != null && cts.size() > 0){
2479   - lists.add(s);
2480   - }else{
2481   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
2482   - lists.add(s);
2483   - }
  2495 + if (cts != null && cts.size() > 0) {
  2496 + lists.add(s);
  2497 + } else {
  2498 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  2499 + lists.add(s);
  2500 + }
2484 2501 }
2485 2502 }
2486 2503 Map<String, Object> map = new HashMap<String, Object>();
2487 2504 map.put("xlName", xlName);
2488   - double jhlc=culateService.culateJhgl(list_s);
2489   - map.put("jhlc",jhlc);
2490   - map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));
2491   - double lbgl=culateService.culateLbgl(list_s);
  2505 + double jhlc = culateService.culateJhgl(list_s);
  2506 + map.put("jhlc", jhlc);
  2507 + map.put("sjgl", Arith.add(culateService.culateSjgl(lists), culateService.culateLjgl(lists)));
  2508 + double lbgl = culateService.culateLbgl(list_s);
2492 2509 map.put("ssgl", lbgl);
2493 2510 map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻"));
2494 2511 map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢"));
... ... @@ -2500,70 +2517,70 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2500 2517 map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀"));
2501 2518 map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候"));
2502 2519 map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外"));
2503   - double ssgl_pc=culateService.culateCJLC(list_s, "配车");
2504   - double ssgl_by=culateService.culateCJLC(list_s, "保养");
2505   - double ssgl_cj=culateService.culateCJLC(list_s, "抽减");
2506   - double ssgl_qt=culateService.culateCJLC(list_s, "其他");
2507   - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
  2520 + double ssgl_pc = culateService.culateCJLC(list_s, "配车");
  2521 + double ssgl_by = culateService.culateCJLC(list_s, "保养");
  2522 + double ssgl_cj = culateService.culateCJLC(list_s, "抽减");
  2523 + double ssgl_qt = culateService.culateCJLC(list_s, "其他");
  2524 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj, ssgl_qt)));
2508 2525 map.put("ssbc", culateService.culateLbbc(list_s));
2509   - double ljgl=culateService.culateLjgl(lists);
  2526 + double ljgl = culateService.culateLjgl(lists);
2510 2527 map.put("ljgl", ljgl);
2511   - map.put("jhbc", culateService.culateJhbc(list_s,""));
  2528 + map.put("jhbc", culateService.culateJhbc(list_s, ""));
2512 2529 map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf"));
2513 2530 map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf"));
2514   - map.put("sjbc", culateService.culateSjbc(lists,""));
2515   - map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));
2516   - map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));
2517   - map.put("ljbc", culateService.culateLjbc(lists,""));
2518   - map.put("ljbc_m", culateService.culateLjbc(lists,"zgf"));
2519   - map.put("ljbc_a", culateService.culateLjbc(lists,"wgf"));
  2531 + map.put("sjbc", culateService.culateSjbc(lists, ""));
  2532 + map.put("sjbc_m", culateService.culateSjbc(lists, "zgf"));
  2533 + map.put("sjbc_a", culateService.culateSjbc(lists, "wgf"));
  2534 + map.put("ljbc", culateService.culateLjbc(lists, ""));
  2535 + map.put("ljbc_m", culateService.culateLjbc(lists, "zgf"));
  2536 + map.put("ljbc_a", culateService.culateLjbc(lists, "wgf"));
2520 2537 map.put("fzbc", culateService.culateFzbc(lists, ""));
2521 2538 map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));
2522   - map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
  2539 + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
2523 2540 map.put("dtbc", 0);
2524 2541 map.put("dtbc_m", 0);
2525 2542 map.put("dtbc_a", 0);
2526   - Map<String, Object> m=culateService.culateDjg(list_s, line);
  2543 + Map<String, Object> m = culateService.culateDjg(list_s, line);
2527 2544 map.put("djg", m.get("djgcsq"));
2528 2545 map.put("djg_m", m.get("djgcsz"));
2529 2546 map.put("djg_a", m.get("djgcsw"));
2530 2547 map.put("djg_time", m.get("djgsj"));
2531 2548 map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl));
2532 2549 lMap.add(map);
2533   -
2534   - if(date.length() == 10){
2535   - List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(line, date + "00:01", date + "23:59");
2536   - String dbdp = "";
2537   - try {
2538   - for (int i = 0; i < list.size(); i++) {
2539   - DutyEmployee t = list.get(i);
2540   - if(dbdp.indexOf(t.getuName()) == -1){
2541   - if(!(dbdp.length()>0)){
2542   - dbdp =t.getuName();
2543   - }else{
2544   - dbdp +=","+t.getuName();
2545   - }
2546   - }
2547   - }
2548   - } catch (Exception e) {
2549   - // TODO: handle exception
2550   - e.printStackTrace();
2551   - }
2552   - map.put("dbdp", dbdp);
2553   - }
2554   -
  2550 +
  2551 + if (date.length() == 10) {
  2552 + List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(line, date + "00:01", date + "23:59");
  2553 + String dbdp = "";
  2554 + try {
  2555 + for (int i = 0; i < list.size(); i++) {
  2556 + DutyEmployee t = list.get(i);
  2557 + if (dbdp.indexOf(t.getuName()) == -1) {
  2558 + if (!(dbdp.length() > 0)) {
  2559 + dbdp = t.getuName();
  2560 + } else {
  2561 + dbdp += "," + t.getuName();
  2562 + }
  2563 + }
  2564 + }
  2565 + } catch (Exception e) {
  2566 + // TODO: handle exception
  2567 + e.printStackTrace();
  2568 + }
  2569 + map.put("dbdp", dbdp);
  2570 + }
  2571 +
2555 2572 return lMap;
2556 2573 }
2557 2574  
2558 2575 @Override
2559 2576 public List<Map<String, Object>> statisticsDaily_mh_2(String line, String date,
2560   - String xlName, String type) {
2561   - List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>();
2562   - List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
2563   - List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>();
  2577 + String xlName, String type) {
  2578 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  2579 + List<ScheduleRealInfo> list_s = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  2580 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2564 2581 for (int i = 0; i < list_s.size(); i++) {
2565   - ScheduleRealInfo s=list_s.get(i);
2566   - if(s.isDestroy() && s.isReissue()){
  2582 + ScheduleRealInfo s = list_s.get(i);
  2583 + if (s.isDestroy() && s.isReissue()) {
2567 2584 s.setRemark("");
2568 2585 s.setFcsjActual(s.getDfsj());
2569 2586 s.setZdsjActual(s.getZdsj());
... ... @@ -2572,20 +2589,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2572 2589 }
2573 2590  
2574 2591 Set<ChildTaskPlan> cts = s.getcTasks();
2575   - if(cts != null && cts.size() > 0){
  2592 + if (cts != null && cts.size() > 0) {
2576 2593 lists.add(s);
2577   - }else{
2578   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
  2594 + } else {
  2595 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
2579 2596 lists.add(s);
2580 2597 }
2581 2598 }
2582 2599 }
2583 2600 Map<String, Object> map = new HashMap<String, Object>();
2584 2601 map.put("xlName", xlName);
2585   - double jhlc=culateService.culateJhgl(list_s);
2586   - map.put("jhlc",jhlc);
2587   - map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));
2588   - double lbgl=culateService.culateLbgl(list_s);
  2602 + double jhlc = culateService.culateJhgl(list_s);
  2603 + map.put("jhlc", jhlc);
  2604 + map.put("sjgl", Arith.add(culateService.culateSjgl(lists), culateService.culateLjgl(lists)));
  2605 + double lbgl = culateService.culateLbgl(list_s);
2589 2606 map.put("ssgl", lbgl);
2590 2607 map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻"));
2591 2608 map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢"));
... ... @@ -2597,26 +2614,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2597 2614 map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀"));
2598 2615 map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候"));
2599 2616 map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外"));
2600   - double ssgl_pc=culateService.culateCJLC(list_s, "配车");
2601   - double ssgl_by=culateService.culateCJLC(list_s, "保养");
2602   - double ssgl_cj=culateService.culateCJLC(list_s, "抽减");
2603   - double ssgl_qt=culateService.culateCJLC(list_s, "其他");
2604   - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
  2617 + double ssgl_pc = culateService.culateCJLC(list_s, "配车");
  2618 + double ssgl_by = culateService.culateCJLC(list_s, "保养");
  2619 + double ssgl_cj = culateService.culateCJLC(list_s, "抽减");
  2620 + double ssgl_qt = culateService.culateCJLC(list_s, "其他");
  2621 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj, ssgl_qt)));
2605 2622 map.put("ssbc", culateService.culateLbbc(list_s));
2606   - double ljgl=culateService.culateLjgl(lists);
  2623 + double ljgl = culateService.culateLjgl(lists);
2607 2624 map.put("ljgl", ljgl);
2608   - map.put("jhbc", culateService.culateJhbc(list_s,""));
  2625 + map.put("jhbc", culateService.culateJhbc(list_s, ""));
2609 2626 map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf"));
2610 2627 map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf"));
2611   - map.put("sjbc", culateService.culateSjbc(lists,""));
2612   - map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));
2613   - map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));
2614   - map.put("ljbc", culateService.culateLjbc(lists,""));
2615   - map.put("ljbc_m", culateService.culateLjbc(lists,"zgf"));
2616   - map.put("ljbc_a", culateService.culateLjbc(lists,"wgf"));
  2628 + map.put("sjbc", culateService.culateSjbc(lists, ""));
  2629 + map.put("sjbc_m", culateService.culateSjbc(lists, "zgf"));
  2630 + map.put("sjbc_a", culateService.culateSjbc(lists, "wgf"));
  2631 + map.put("ljbc", culateService.culateLjbc(lists, ""));
  2632 + map.put("ljbc_m", culateService.culateLjbc(lists, "zgf"));
  2633 + map.put("ljbc_a", culateService.culateLjbc(lists, "wgf"));
2617 2634 map.put("fzbc", culateService.culateFzbc(lists, ""));
2618 2635 map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));
2619   - map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
  2636 + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
2620 2637 map.put("dtbc", 0);
2621 2638 map.put("dtbc_m", 0);
2622 2639 map.put("dtbc_a", 0);
... ... @@ -2629,175 +2646,175 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2629 2646 return lMap;
2630 2647 }
2631 2648  
2632   - public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){
2633   -
2634   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
2635   - for(int i=0;i<list.size();i++){
2636   - ScheduleRealInfo s=list.get(i);
  2649 + public final Map<String, Object> staticTj(List<ScheduleRealInfo> list) {
  2650 +
  2651 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
  2652 + for (int i = 0; i < list.size(); i++) {
  2653 + ScheduleRealInfo s = list.get(i);
2637 2654 Set<ChildTaskPlan> cts = s.getcTasks();
2638   - if(cts != null && cts.size() > 0){
2639   - lists.add(s);
2640   - }else{
2641   - if(s.getZdsjActual()!=null&& s.getFcsjActual()!=null){
2642   - lists.add(s);
2643   - }
  2655 + if (cts != null && cts.size() > 0) {
  2656 + lists.add(s);
  2657 + } else {
  2658 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  2659 + lists.add(s);
  2660 + }
2644 2661 }
2645 2662 }
2646 2663 Map<String, Object> map = new HashMap<String, Object>();
2647   - if(list.size()>0){
2648   - map.put("xlName", list.get(0).getXlName());
2649   - try {
2650   - map.put("xlNamePy", PinyinHelper.convertToPinyinString(list.get(0).getXlName(), "" , PinyinFormat.WITHOUT_TONE));
2651   - } catch (PinyinException e) {
2652   - // TODO Auto-generated catch block
2653   - e.printStackTrace();
2654   - }
2655   - double jhyygl=culateService.culateJhgl(list);//计划营运公里
2656   - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
2657   - map.put("jhlc", jhyygl);
2658   - map.put("jcclc", jhjcclc);
2659   - map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
2660   -
2661   - double ljgl= culateService.culateLjgl(lists);
2662   - double sjyygl= culateService.culateSjgl(lists);
2663   - double zyygl= Arith.add(sjyygl,ljgl);
2664   -
2665   - double sjjccgl=culateService.culateJccgl(lists);
2666   - double sjksgl=culateService.culateKsgl(lists);
2667   - double zksgl=Arith.add(sjjccgl, sjksgl);
2668   - map.put("sjzgl", Arith.add(zyygl, zksgl));
2669   - map.put("sjgl",zyygl);
2670   - map.put("sjksgl", zksgl);
2671   - double ssgl= culateService.culateLbgl(list);
2672   - map.put("ssgl", ssgl);
2673   -
2674   - //计划+临加-少驶=实驶
2675   - double jl=Arith.sub(Arith.add(jhyygl, ljgl),ssgl);
2676   - if(jl==zyygl){
2677   - map.put("zt", 0);
2678   - }else{
2679   - map.put("zt", 1);
2680   - }
2681   -
2682   - map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
2683   - map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
2684   - map.put("ssgl_gz", culateService.culateCJLC(list, "故障"));
2685   - map.put("ssgl_jf", culateService.culateCJLC(list, "纠纷"));
2686   - map.put("ssgl_zs", culateService.culateCJLC(list, "肇事"));
2687   - map.put("ssgl_qr", culateService.culateCJLC(list, "缺人"));
2688   - map.put("ssgl_qc", culateService.culateCJLC(list, "缺车"));
2689   - map.put("ssgl_kx", culateService.culateCJLC(list, "客稀"));
2690   - map.put("ssgl_qh", culateService.culateCJLC(list, "气候"));
2691   - map.put("ssgl_yw", culateService.culateCJLC(list, "援外"));
2692   - double ssgl_pc=culateService.culateCJLC(list, "配车");
2693   - double ssgl_by=culateService.culateCJLC(list, "保养");
2694   - double ssgl_cj=culateService.culateCJLC(list, "抽减");
2695   - double ssgl_qt=culateService.culateCJLC(list, "其他");
2696   - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
2697   - map.put("ssbc", culateService.culateLbbc(list));
2698   - map.put("ljgl", ljgl);
2699   - map.put("jhbc", culateService.culateJhbc(list,""));
2700   - map.put("jhbc_m", culateService.culateJhbc(list, "zgf"));
2701   - map.put("jhbc_a", culateService.culateJhbc(list, "wgf"));
2702   - map.put("sjbc", culateService.culateSjbc(lists,""));
2703   - map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));
2704   - map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));
2705   - map.put("ljbc", culateService.culateLjbc(lists,""));
2706   - map.put("ljbc_m", culateService.culateLjbc(lists,"zgf"));
2707   - map.put("ljbc_a", culateService.culateLjbc(lists,"wgf"));
2708   - map.put("fzbc", culateService.culateFzbc(lists, ""));
2709   - map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));
2710   - map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
2711   - map.put("dtbc", 0);
2712   - map.put("dtbc_m", 0);
2713   - map.put("dtbc_a", 0);
2714   - Map<String, Object> m_=culateService.culateDjg(lists, list.get(0).getXlBm());
2715   - map.put("djg", m_.get("djgcsq"));
2716   - map.put("djg_m", m_.get("djgcsz"));
2717   - map.put("djg_a", m_.get("djgcsw"));
2718   - map.put("djg_time", m_.get("djgsj"));
2719   - }
  2664 + if (list.size() > 0) {
  2665 + map.put("xlName", list.get(0).getXlName());
  2666 + try {
  2667 + map.put("xlNamePy", PinyinHelper.convertToPinyinString(list.get(0).getXlName(), "", PinyinFormat.WITHOUT_TONE));
  2668 + } catch (PinyinException e) {
  2669 + // TODO Auto-generated catch block
  2670 + e.printStackTrace();
  2671 + }
  2672 + double jhyygl = culateService.culateJhgl(list);//计划营运公里
  2673 + double jhjcclc = culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
  2674 + map.put("jhlc", jhyygl);
  2675 + map.put("jcclc", jhjcclc);
  2676 + map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
  2677 +
  2678 + double ljgl = culateService.culateLjgl(lists);
  2679 + double sjyygl = culateService.culateSjgl(lists);
  2680 + double zyygl = Arith.add(sjyygl, ljgl);
  2681 +
  2682 + double sjjccgl = culateService.culateJccgl(lists);
  2683 + double sjksgl = culateService.culateKsgl(lists);
  2684 + double zksgl = Arith.add(sjjccgl, sjksgl);
  2685 + map.put("sjzgl", Arith.add(zyygl, zksgl));
  2686 + map.put("sjgl", zyygl);
  2687 + map.put("sjksgl", zksgl);
  2688 + double ssgl = culateService.culateLbgl(list);
  2689 + map.put("ssgl", ssgl);
  2690 +
  2691 + //计划+临加-少驶=实驶
  2692 + double jl = Arith.sub(Arith.add(jhyygl, ljgl), ssgl);
  2693 + if (jl == zyygl) {
  2694 + map.put("zt", 0);
  2695 + } else {
  2696 + map.put("zt", 1);
  2697 + }
  2698 +
  2699 + map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
  2700 + map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
  2701 + map.put("ssgl_gz", culateService.culateCJLC(list, "故障"));
  2702 + map.put("ssgl_jf", culateService.culateCJLC(list, "纠纷"));
  2703 + map.put("ssgl_zs", culateService.culateCJLC(list, "肇事"));
  2704 + map.put("ssgl_qr", culateService.culateCJLC(list, "缺人"));
  2705 + map.put("ssgl_qc", culateService.culateCJLC(list, "缺车"));
  2706 + map.put("ssgl_kx", culateService.culateCJLC(list, "客稀"));
  2707 + map.put("ssgl_qh", culateService.culateCJLC(list, "气候"));
  2708 + map.put("ssgl_yw", culateService.culateCJLC(list, "援外"));
  2709 + double ssgl_pc = culateService.culateCJLC(list, "配车");
  2710 + double ssgl_by = culateService.culateCJLC(list, "保养");
  2711 + double ssgl_cj = culateService.culateCJLC(list, "抽减");
  2712 + double ssgl_qt = culateService.culateCJLC(list, "其他");
  2713 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj, ssgl_qt)));
  2714 + map.put("ssbc", culateService.culateLbbc(list));
  2715 + map.put("ljgl", ljgl);
  2716 + map.put("jhbc", culateService.culateJhbc(list, ""));
  2717 + map.put("jhbc_m", culateService.culateJhbc(list, "zgf"));
  2718 + map.put("jhbc_a", culateService.culateJhbc(list, "wgf"));
  2719 + map.put("sjbc", culateService.culateSjbc(lists, ""));
  2720 + map.put("sjbc_m", culateService.culateSjbc(lists, "zgf"));
  2721 + map.put("sjbc_a", culateService.culateSjbc(lists, "wgf"));
  2722 + map.put("ljbc", culateService.culateLjbc(lists, ""));
  2723 + map.put("ljbc_m", culateService.culateLjbc(lists, "zgf"));
  2724 + map.put("ljbc_a", culateService.culateLjbc(lists, "wgf"));
  2725 + map.put("fzbc", culateService.culateFzbc(lists, ""));
  2726 + map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));
  2727 + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
  2728 + map.put("dtbc", 0);
  2729 + map.put("dtbc_m", 0);
  2730 + map.put("dtbc_a", 0);
  2731 + Map<String, Object> m_ = culateService.culateDjg(lists, list.get(0).getXlBm());
  2732 + map.put("djg", m_.get("djgcsq"));
  2733 + map.put("djg_m", m_.get("djgcsz"));
  2734 + map.put("djg_a", m_.get("djgcsw"));
  2735 + map.put("djg_time", m_.get("djgsj"));
  2736 + }
2720 2737 return map;
2721 2738 }
2722 2739  
2723 2740 @Override
2724   - public List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2,
  2741 + public List<Map<String, Object>> statisticsDailyTj(String gsdm, String fgsdm, String line, String date, String date2,
2725 2742 String xlName, String type) {
2726 2743 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
2727 2744 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
2728 2745 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2729   - line =line.trim();
2730   - if(line.equals("")){
  2746 + line = line.trim();
  2747 + if (line.equals("")) {
2731 2748 //查询所有线路
2732   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
2733   - }else{
  2749 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date, date2, gsdm, fgsdm);
  2750 + } else {
2734 2751 //查询单条线路
2735   - list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
  2752 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date, date2);
2736 2753 }
2737 2754 for (int i = 0; i < list.size(); i++) {
2738   - ScheduleRealInfo s=list.get(i);
  2755 + ScheduleRealInfo s = list.get(i);
2739 2756 Set<ChildTaskPlan> cts = s.getcTasks();
2740   - if(cts != null && cts.size() > 0){
2741   - list_s.add(s);
2742   - }else{
2743   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
2744   - list_s.add(s);
2745   - }
  2757 + if (cts != null && cts.size() > 0) {
  2758 + list_s.add(s);
  2759 + } else {
  2760 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  2761 + list_s.add(s);
  2762 + }
2746 2763 }
2747 2764 }
2748 2765 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
2749 2766 for (int i = 0; i < list.size(); i++) {
2750   - if(i<list.size()-1){
2751   - if(list.get(i+1).getXlBm().equals(list.get(i).getXlBm())){
  2767 + if (i < list.size() - 1) {
  2768 + if (list.get(i + 1).getXlBm().equals(list.get(i).getXlBm())) {
2752 2769 lists.add(list.get(i));
2753   - }else{
  2770 + } else {
2754 2771 lists.add(list.get(i));
2755   - Map<String, Object> map=staticTj(lists);
  2772 + Map<String, Object> map = staticTj(lists);
2756 2773 lMap.add(map);
2757   - lists=new ArrayList<ScheduleRealInfo>();
  2774 + lists = new ArrayList<ScheduleRealInfo>();
2758 2775 }
2759   - }else{
2760   - if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){
  2776 + } else {
  2777 + if (list.get(i).getXlBm().equals(list.get(i - 1).getXlBm())) {
2761 2778 lists.add(list.get(i));
2762   - Map<String, Object> map=staticTj(lists);
  2779 + Map<String, Object> map = staticTj(lists);
2763 2780 lMap.add(map);
2764   - }else{
2765   - lists=new ArrayList<ScheduleRealInfo>();
  2781 + } else {
  2782 + lists = new ArrayList<ScheduleRealInfo>();
2766 2783 lists.add(list.get(i));
2767   - Map<String, Object> map=staticTj(lists);
  2784 + Map<String, Object> map = staticTj(lists);
2768 2785 lMap.add(map);
2769 2786 }
2770 2787 }
2771 2788 }
2772   -
2773   - Collections.sort(lMap,new AccountXlbm());
  2789 +
  2790 + Collections.sort(lMap, new AccountXlbm());
2774 2791 Map<String, Object> map = new HashMap<String, Object>();
2775 2792 map.put("xlName", "合计");
2776   - double jhyygl=culateService.culateJhgl(list);//计划营运公里
2777   - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
  2793 + double jhyygl = culateService.culateJhgl(list);//计划营运公里
  2794 + double jhjcclc = culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
2778 2795 map.put("jhlc", jhyygl);
2779 2796 map.put("jcclc", jhjcclc);
2780 2797 map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
2781 2798  
2782   - double ljgl= culateService.culateLjgl(list_s);
2783   - double sjyygl= culateService.culateSjgl(list_s);
2784   - double zyygl= Arith.add(sjyygl,ljgl);
  2799 + double ljgl = culateService.culateLjgl(list_s);
  2800 + double sjyygl = culateService.culateSjgl(list_s);
  2801 + double zyygl = Arith.add(sjyygl, ljgl);
2785 2802  
2786   - double sjjccgl=culateService.culateJccgl(list_s);
2787   - double sjksgl=culateService.culateKsgl(list_s);
2788   - double zksgl=Arith.add(sjjccgl, sjksgl);
  2803 + double sjjccgl = culateService.culateJccgl(list_s);
  2804 + double sjksgl = culateService.culateKsgl(list_s);
  2805 + double zksgl = Arith.add(sjjccgl, sjksgl);
2789 2806 map.put("sjzgl", Arith.add(zyygl, zksgl));
2790   - map.put("sjgl",zyygl);
  2807 + map.put("sjgl", zyygl);
2791 2808 map.put("sjksgl", zksgl);
2792   -
2793   - double ssgl= culateService.culateLbgl(list);
  2809 +
  2810 + double ssgl = culateService.culateLbgl(list);
2794 2811 map.put("ssgl", ssgl);
2795 2812 //计划+临加-少驶=实驶
2796   - double jl=Arith.sub(Arith.add(jhyygl, ljgl),ssgl);
2797   - if(jl==zyygl){
2798   - map.put("zt", 0);
2799   - }else{
2800   - map.put("zt", 1);
  2813 + double jl = Arith.sub(Arith.add(jhyygl, ljgl), ssgl);
  2814 + if (jl == zyygl) {
  2815 + map.put("zt", 0);
  2816 + } else {
  2817 + map.put("zt", 1);
2801 2818 }
2802 2819 map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
2803 2820 map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
... ... @@ -2809,40 +2826,58 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2809 2826 map.put("ssgl_kx", culateService.culateCJLC(list, "客稀"));
2810 2827 map.put("ssgl_qh", culateService.culateCJLC(list, "气候"));
2811 2828 map.put("ssgl_yw", culateService.culateCJLC(list, "援外"));
2812   - double ssgl_pc=culateService.culateCJLC(list, "配车");
2813   - double ssgl_by=culateService.culateCJLC(list, "保养");
2814   - double ssgl_cj=culateService.culateCJLC(list, "抽减");
2815   - double ssgl_qt=culateService.culateCJLC(list, "其他");
2816   - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
2817   -
  2829 + double ssgl_pc = culateService.culateCJLC(list, "配车");
  2830 + double ssgl_by = culateService.culateCJLC(list, "保养");
  2831 + double ssgl_cj = culateService.culateCJLC(list, "抽减");
  2832 + double ssgl_qt = culateService.culateCJLC(list, "其他");
  2833 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by), Arith.add(ssgl_cj, ssgl_qt)));
  2834 +
2818 2835 map.put("ssbc", culateService.culateLbbc(list));
2819 2836 map.put("ljgl", ljgl);
2820   - map.put("jhbc", culateService.culateJhbc(list,""));
  2837 + map.put("jhbc", culateService.culateJhbc(list, ""));
2821 2838 map.put("jhbc_m", culateService.culateJhbc(list, "zgf"));
2822 2839 map.put("jhbc_a", culateService.culateJhbc(list, "wgf"));
2823   - map.put("sjbc", culateService.culateSjbc(list_s,""));
2824   - map.put("sjbc_m", culateService.culateSjbc(list_s,"zgf"));
2825   - map.put("sjbc_a", culateService.culateSjbc(list_s,"wgf"));
2826   - map.put("ljbc", culateService.culateLjbc(list_s,""));
2827   - map.put("ljbc_m", culateService.culateLjbc(list_s,"zgf"));
2828   - map.put("ljbc_a", culateService.culateLjbc(list_s,"wgf"));
  2840 + map.put("sjbc", culateService.culateSjbc(list_s, ""));
  2841 + map.put("sjbc_m", culateService.culateSjbc(list_s, "zgf"));
  2842 + map.put("sjbc_a", culateService.culateSjbc(list_s, "wgf"));
  2843 + map.put("ljbc", culateService.culateLjbc(list_s, ""));
  2844 + map.put("ljbc_m", culateService.culateLjbc(list_s, "zgf"));
  2845 + map.put("ljbc_a", culateService.culateLjbc(list_s, "wgf"));
2829 2846 map.put("fzbc", culateService.culateFzbc(list_s, ""));
2830 2847 map.put("fzbc_m", culateService.culateFzbc(list_s, "zgf"));
2831   - map.put("fzbc_a", culateService.culateFzbc(list_s, "wgf"));
  2848 + map.put("fzbc_a", culateService.culateFzbc(list_s, "wgf"));
2832 2849 map.put("dtbc", 0);
2833 2850 map.put("dtbc_m", 0);
2834 2851 map.put("dtbc_a", 0);
2835   - if(list.size()>0){
2836   - Map<String, Object> m_=culateService.culateDjg(list_s, list.get(0).getXlBm());
2837   - map.put("djg", m_.get("djgcsq"));
2838   - map.put("djg_m", m_.get("djgcsz"));
2839   - map.put("djg_a", m_.get("djgcsw"));
2840   - map.put("djg_time", m_.get("djgsj"));
2841   - }else{
2842   - map.put("djg", "0");
2843   - map.put("djg_m", "0");
2844   - map.put("djg_a", "0");
2845   - map.put("djg_time", "0");
  2852 + if (list.size() > 0) {
  2853 + int djg = 0, djg_m = 0, djg_a = 0, djg_time = 0;
  2854 + for (Map<String, Object> m : lMap) {
  2855 + if (m.containsKey("djg") && m.get("djg") != null)
  2856 + djg += Integer.valueOf(m.get("djg").toString());
  2857 + if (m.containsKey("djg_m") && m.get("djg_m") != null)
  2858 + djg_m += Integer.valueOf(m.get("djg_m").toString());
  2859 + if (m.containsKey("djg_a") && m.get("djg_a") != null)
  2860 + djg_a += Integer.valueOf(m.get("djg_a").toString());
  2861 + if (m.containsKey("djg_time") && m.get("djg_time") != null) {
  2862 + int t = Integer.valueOf(m.get("djg_time").toString());
  2863 + if (t > djg_time)
  2864 + djg_time = t;
  2865 + }
  2866 + }
  2867 + map.put("djg", djg);
  2868 + map.put("djg_m", djg_m);
  2869 + map.put("djg_a", djg_a);
  2870 + map.put("djg_time", djg_time);
  2871 +// Map<String, Object> m_=culateService.culateDjg(list_s, list.get(0).getXlBm());
  2872 +// map.put("djg", m_.get("djgcsq"));
  2873 +// map.put("djg_m", m_.get("djgcsz"));
  2874 +// map.put("djg_a", m_.get("djgcsw"));
  2875 +// map.put("djg_time", m_.get("djgsj"));
  2876 + } else {
  2877 + map.put("djg", "0");
  2878 + map.put("djg_m", "0");
  2879 + map.put("djg_a", "0");
  2880 + map.put("djg_time", "0");
2846 2881 }
2847 2882 lMap.add(map);
2848 2883 if (type != null && type.length() != 0 && type.equals("export")) {
... ... @@ -2850,17 +2885,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2850 2885 sdfSimple = new SimpleDateFormat("yyyyMMdd");
2851 2886 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
2852 2887 Map<String, Object> m = new HashMap<String, Object>();
2853   - m.put("date", date+"至"+date2);
  2888 + m.put("date", date + "至" + date2);
2854 2889 ReportUtils ee = new ReportUtils();
2855 2890 try {
  2891 + String dateTime = "";
  2892 + if (date.equals(date2)) {
  2893 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  2894 + } else {
  2895 + dateTime = sdfSimple.format(sdfMonth.parse(date))
  2896 + + "-" + sdfSimple.format(sdfMonth.parse(date2));
  2897 + }
2856 2898 listI.add(lMap.iterator());
2857 2899 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2858 2900 ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_.xls",
2859   - path + "export/统计日报" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  2901 + path + "export/" + dateTime + "-" + xlName + "-统计日报.xls");
2860 2902 } catch (Exception e) {
2861 2903 // TODO: handle exception
2862 2904 //e.printStackTrace();
2863   - logger.info("" , e);
  2905 + logger.info("", e);
2864 2906 }
2865 2907 }
2866 2908  
... ... @@ -3046,17 +3088,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3046 3088 }
3047 3089 }
3048 3090 }
3049   -
  3091 +
3050 3092 for (int i = 0; i < newList.size(); i++) {
3051   - ScheduleRealInfo t1=newList.get(i);
3052   - String reamrks1=t1.getRemarks()==null?"":t1.getRemarks();
3053   - if(reamrks1.length()>4){
3054   - t1.setRemarks(reamrks1.substring(0,4));
3055   - t1.setRemark(reamrks1);
3056   - }else{
3057   - t1.setRemark(reamrks1);
3058   - }
3059   - }
  3093 + ScheduleRealInfo t1 = newList.get(i);
  3094 + String reamrks1 = t1.getRemarks() == null ? "" : t1.getRemarks();
  3095 + if (reamrks1.length() > 4) {
  3096 + t1.setRemarks(reamrks1.substring(0, 4));
  3097 + t1.setRemark(reamrks1);
  3098 + } else {
  3099 + t1.setRemark(reamrks1);
  3100 + }
  3101 + }
3060 3102 return newList;
3061 3103 }
3062 3104  
... ... @@ -3070,8 +3112,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3070 3112 String zdsjActual1 = "";
3071 3113 List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date);
3072 3114  
3073   - for(ScheduleRealInfo s : listInfo){
3074   - if(s.isDestroy() && s.isReissue()){
  3115 + for (ScheduleRealInfo s : listInfo) {
  3116 + if (s.isDestroy() && s.isReissue()) {
3075 3117 s.setRemark("");
3076 3118 s.setFcsjActual(s.getDfsj());
3077 3119 s.setZdsjActual(s.getZdsj());
... ... @@ -3187,66 +3229,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3187 3229 return list;
3188 3230 }
3189 3231  
3190   - public List<Map<String, Object>> yesterdayDataList(String line, String date,String gsbm,String fgsbm,String jGh,String nbbm) {
  3232 + public List<Map<String, Object>> yesterdayDataList(String line, String date, String gsbm, String fgsbm, String jGh, String nbbm) {
3191 3233 List<Map<String, Object>> yesterdayDataList = new ArrayList<Map<String, Object>>();
3192   - if(line.equals("")){
3193   - yesterdayDataList=scheduleRealInfoRepository.yesterdayDataList(line, date,gsbm,fgsbm,nbbm);
3194   - }else{
3195   - yesterdayDataList=scheduleRealInfoRepository.yesterdayDataList_eq(line, date,gsbm,fgsbm,nbbm);
  3234 + if (line.equals("")) {
  3235 + yesterdayDataList = scheduleRealInfoRepository.yesterdayDataList(line, date, gsbm, fgsbm, nbbm);
  3236 + } else {
  3237 + yesterdayDataList = scheduleRealInfoRepository.yesterdayDataList_eq(line, date, gsbm, fgsbm, nbbm);
3196 3238 }
3197   - List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm);
  3239 + List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date, gsbm, fgsbm);
3198 3240 for (int x = 0; x < yesterdayDataList.size(); x++) {
3199 3241 String jName = yesterdayDataList.get(x).get("jGh").toString();
3200 3242 String clZbh = yesterdayDataList.get(x).get("clZbh").toString();
3201   - String xlbm = yesterdayDataList.get(x).get("xlBm").toString();
3202   - String lp =yesterdayDataList.get(x).get("lpName").toString();
  3243 + String xlbm = yesterdayDataList.get(x).get("xlBm").toString();
  3244 + String lp = yesterdayDataList.get(x).get("lpName").toString();
3203 3245 Map<String, Object> map = new HashMap<String, Object>();
3204 3246 boolean fage = true;
3205   - String company="";
3206   - String bCompany="";
3207   - List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>();
  3247 + String company = "";
  3248 + String bCompany = "";
  3249 + List<ScheduleRealInfo> listS = new ArrayList<ScheduleRealInfo>();
3208 3250 for (ScheduleRealInfo scheduleRealInfo : lists) {
3209   - if(scheduleRealInfo.getjGh().equals(jName)
3210   - && scheduleRealInfo.getClZbh().equals(clZbh)
3211   - && scheduleRealInfo.getXlBm().equals(xlbm)
3212   - && scheduleRealInfo.getLpName().equals(lp)){
  3251 + if (scheduleRealInfo.getjGh().equals(jName)
  3252 + && scheduleRealInfo.getClZbh().equals(clZbh)
  3253 + && scheduleRealInfo.getXlBm().equals(xlbm)
  3254 + && scheduleRealInfo.getLpName().equals(lp)) {
3213 3255 if (fage) {
3214 3256 //根据线路代码获取公司
3215   - company=scheduleRealInfo.getGsBm();
3216   - bCompany=scheduleRealInfo.getFgsBm();
  3257 + company = scheduleRealInfo.getGsBm();
  3258 + bCompany = scheduleRealInfo.getFgsBm();
3217 3259 fage = false;
3218 3260 }
3219   - Set<ChildTaskPlan> cts = scheduleRealInfo.getcTasks();
3220   - if(cts != null && cts.size() > 0){
3221   - listS.add(scheduleRealInfo);
3222   - }else{
3223   - if(scheduleRealInfo.getZdsjActual()!=null && scheduleRealInfo.getFcsjActual()!=null){
3224   - listS.add(scheduleRealInfo);
3225   - }
  3261 + Set<ChildTaskPlan> cts = scheduleRealInfo.getcTasks();
  3262 + if (cts != null && cts.size() > 0) {
  3263 + listS.add(scheduleRealInfo);
  3264 + } else {
  3265 + if (scheduleRealInfo.getZdsjActual() != null && scheduleRealInfo.getFcsjActual() != null) {
  3266 + listS.add(scheduleRealInfo);
  3267 + }
3226 3268 }
3227 3269 }
3228 3270 }
3229 3271 yesterdayDataList.get(x).put("company", company);
3230 3272 yesterdayDataList.get(x).put("bCompany", bCompany);
3231   - Double ljgl=culateMieageService.culateLjgl(listS);
3232   - Double sjgl=culateMieageService.culateSjgl(listS);
3233   - Double ksgl=culateMieageService.culateKsgl(listS);
3234   - Double jccgl=culateMieageService.culateJccgl(listS);
3235   - Double zyygl=Arith.add(sjgl, ljgl);
3236   - Double zksgl=Arith.add(ksgl, jccgl);
3237   - Double zlc=Arith.add(zyygl, zksgl);
  3273 + Double ljgl = culateMieageService.culateLjgl(listS);
  3274 + Double sjgl = culateMieageService.culateSjgl(listS);
  3275 + Double ksgl = culateMieageService.culateKsgl(listS);
  3276 + Double jccgl = culateMieageService.culateJccgl(listS);
  3277 + Double zyygl = Arith.add(sjgl, ljgl);
  3278 + Double zksgl = Arith.add(ksgl, jccgl);
  3279 + Double zlc = Arith.add(zyygl, zksgl);
3238 3280 yesterdayDataList.get(x).put("totalKilometers", zlc);
3239 3281  
3240 3282 }
3241 3283 //增加顺序号
3242 3284 for (int i = 0; i < yesterdayDataList.size(); i++) {
3243 3285 if (i == 0) {
3244   - yesterdayDataList.get(i).put("seqNumber", 1);
  3286 + yesterdayDataList.get(i).put("seqNumber", 1);
3245 3287 } else {
3246 3288 if (yesterdayDataList.get(i - 1).get("clZbh").equals(yesterdayDataList.get(i).get("clZbh"))) {
3247   - yesterdayDataList.get(i).put("seqNumber", 1 + (int) yesterdayDataList.get(i - 1).get("seqNumber"));
  3289 + yesterdayDataList.get(i).put("seqNumber", 1 + (int) yesterdayDataList.get(i - 1).get("seqNumber"));
3248 3290 } else {
3249   - yesterdayDataList.get(i).put("seqNumber", 1);
  3291 + yesterdayDataList.get(i).put("seqNumber", 1);
3250 3292 }
3251 3293 }
3252 3294 }
... ... @@ -3265,7 +3307,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3265 3307 ScheduleRealInfo sch;
3266 3308 //StringBuilder sb = new StringBuilder();
3267 3309  
3268   - String jGh = null,jName,sGh,sName;
  3310 + String jGh = null, jName, sGh, sName;
3269 3311 for (ChangePersonCar cpc : cpcs) {
3270 3312 //sb = new StringBuilder();
3271 3313  
... ... @@ -3274,12 +3316,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3274 3316 continue;
3275 3317  
3276 3318 if (cpc.getClZbh() != null) {
3277   - if(!carExist(sch.getGsBm(), cpc.getClZbh())) {
  3319 + if (!carExist(sch.getGsBm(), cpc.getClZbh())) {
3278 3320 rs.put("msg", "车辆 " + cpc.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!");
3279 3321 rs.put("status", ResponseCode.ERROR);
3280 3322 return rs;
3281   - }
3282   - else if(!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(cpc.getClZbh()))){
  3323 + } else if (!sch.getGsBm().equals(BasicData.nbbm2CompanyCodeMap.get(cpc.getClZbh()))) {
3283 3324 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + cpc.getClZbh() + "】的车辆");
3284 3325 rs.put("status", ResponseCode.ERROR);
3285 3326 return rs;
... ... @@ -3289,7 +3330,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3289 3330 if (StringUtils.isNotEmpty(cpc.getJsy())) {
3290 3331 jGh = cpc.getJsy().split("/")[0];
3291 3332 jName = getPersonName(sch.getGsBm(), jGh);
3292   - if(StringUtils.isEmpty(jName)){
  3333 + if (StringUtils.isEmpty(jName)) {
3293 3334 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员");
3294 3335 rs.put("status", ResponseCode.ERROR);
3295 3336 return rs;
... ... @@ -3306,17 +3347,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3306 3347 /*if(!jGh.equals(sch.getjGh()))
3307 3348 sb.append(sch.getjGh() + " 换 " + jGh + ";");*/
3308 3349 //换驾驶员
3309   - if(persoChange(sch, jGh))
  3350 + if (persoChange(sch, jGh))
3310 3351 set.add(sch);
3311 3352 }
3312 3353  
3313 3354 //换售票员
3314 3355 if (StringUtils.isNotEmpty(cpc.getSpy())
3315   - && cpc.getSpy().indexOf("/")!=-1
  3356 + && cpc.getSpy().indexOf("/") != -1
3316 3357 && cpc.getSpy().length() > 1) {
3317 3358 sGh = cpc.getSpy().split("/")[0];
3318 3359 sName = getPersonName(sch.getGsBm(), sGh);
3319   - if(StringUtils.isEmpty(sName)){
  3360 + if (StringUtils.isEmpty(sName)) {
3320 3361 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sGh + "】的售票员");
3321 3362 rs.put("status", ResponseCode.ERROR);
3322 3363 return rs;
... ... @@ -3324,10 +3365,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3324 3365  
3325 3366 /*if(!sGh.equals(sch.getsGh()))
3326 3367 sb.append(sch.getsGh() + " 换 " + sGh + ";");*/
3327   - if(persoChangeSPY(sch, sGh))
  3368 + if (persoChangeSPY(sch, sGh))
3328 3369 set.add(sch);
3329   - }
3330   - else if(StringUtils.isNotEmpty(sch.getsGh())){
  3370 + } else if (StringUtils.isNotEmpty(sch.getsGh())) {
3331 3371 sch.setsGh("");
3332 3372 sch.setsName("");
3333 3373 }
... ... @@ -3358,7 +3398,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3358 3398 public boolean persoChange(ScheduleRealInfo sch, String jGh) {
3359 3399 if (sch.getjGh().equals(jGh))
3360 3400 return false;
3361   - String jName = getPersonName(sch.getGsBm() , jGh);
  3401 + String jName = getPersonName(sch.getGsBm(), jGh);
3362 3402 if (StringUtils.isNotEmpty(jName)) {
3363 3403  
3364 3404 if (jGh.indexOf("-") != -1)
... ... @@ -3379,7 +3419,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3379 3419 public boolean persoChangeSPY(ScheduleRealInfo sch, String sGh) {
3380 3420 if (sch.getsGh().equals(sGh))
3381 3421 return false;
3382   - String sName = getPersonName(sch.getGsBm() , sGh);
  3422 + String sName = getPersonName(sch.getGsBm(), sGh);
3383 3423 if (StringUtils.isNotEmpty(sName)) {
3384 3424 if (sGh.indexOf("-") != -1)
3385 3425 sch.setsGh(sGh.substring(sGh.indexOf("-") + 1));
... ... @@ -3500,7 +3540,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3500 3540 rs.put("status", ResponseCode.SUCCESS);
3501 3541 rs.put("t", sch);
3502 3542  
3503   - if("major".equals(bcType)){
  3543 + if ("major".equals(bcType)) {
3504 3544 sch.setMajorStationName(majorStationName);
3505 3545 }
3506 3546  
... ... @@ -3525,10 +3565,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3525 3565  
3526 3566 //换车
3527 3567 if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) {
3528   - if (!carExist(oldSch.getGsBm(),sch.getClZbh())) {
  3568 + if (!carExist(oldSch.getGsBm(), sch.getClZbh())) {
3529 3569 rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!");
3530 3570 return rs;
3531   - } else{
  3571 + } else {
3532 3572 aflog.log("换车", oldSch.getClZbh(), sch.getClZbh());
3533 3573 oldSch.setClZbh(sch.getClZbh());
3534 3574 }
... ... @@ -3537,22 +3577,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3537 3577 //换驾驶员
3538 3578 if (StringUtils.isNotEmpty(sch.getjGh()) && !oldSch.getjGh().equals(sch.getjGh())) {
3539 3579 String jName = getPersonName(oldSch.getGsBm(), sch.getjGh());
3540   - if(StringUtils.isEmpty(jName)){
  3580 + if (StringUtils.isEmpty(jName)) {
3541 3581 rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员");
3542 3582 return rs;
3543 3583 }
3544   - aflog.log("换驾驶员", oldSch.getjGh()+"/"+ oldSch.getjName(), sch.getjGh()+"/"+ sch.getjName());
  3584 + aflog.log("换驾驶员", oldSch.getjGh() + "/" + oldSch.getjName(), sch.getjGh() + "/" + sch.getjName());
3545 3585 persoChange(oldSch, sch.getjGh());
3546 3586 }
3547 3587  
3548 3588 //换售票员
3549 3589 if (StringUtils.isNotEmpty(sch.getsGh()) && !oldSch.getsGh().equals(sch.getsGh())) {
3550 3590 String sName = getPersonName(oldSch.getGsBm(), sch.getsGh());
3551   - if(StringUtils.isEmpty(sName)){
  3591 + if (StringUtils.isEmpty(sName)) {
3552 3592 rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员");
3553 3593 return rs;
3554 3594 }
3555   - aflog.log("换售票员", oldSch.getsGh()+"/"+ oldSch.getsName(), sch.getsGh()+"/"+ sch.getsName());
  3595 + aflog.log("换售票员", oldSch.getsGh() + "/" + oldSch.getsName(), sch.getsGh() + "/" + sch.getsName());
3556 3596 persoChangeSPY(oldSch, sch.getsGh());
3557 3597 }
3558 3598  
... ... @@ -3562,8 +3602,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3562 3602 if (!dest1 && dest2) {
3563 3603 oldSch.destroy();
3564 3604 aflog.log("烂班");
3565   - }
3566   - else if(dest1 && !dest2){
  3605 + } else if (dest1 && !dest2) {
3567 3606 //撤销烂班
3568 3607 oldSch.setJhlc(oldSch.getJhlcOrig());
3569 3608 oldSch.setStatus(0);
... ... @@ -3581,34 +3620,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3581 3620 double jhlcNum = sch.getJhlc();
3582 3621 aflog.log("修改班次里程", oldSch.getJhlc(), jhlcNum);
3583 3622 //烂班
3584   - if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0)
  3623 + if (jhlcNum == 0 && oldSch.getJhlcOrig() != 0)
3585 3624 oldSch.destroy();
3586 3625 else {
3587 3626 oldSch.setJhlc(jhlcNum);
3588 3627 //临加班次,实际计划一起改
3589   - if(oldSch.isSflj())
  3628 + if (oldSch.isSflj())
3590 3629 oldSch.setJhlcOrig(jhlcNum);
3591 3630 }
3592 3631 }
3593 3632  
3594 3633 //待发时间
3595   - if(!CustomStringUtils.equals(oldSch.getDfsj(), sch.getDfsj())){
  3634 + if (!CustomStringUtils.equals(oldSch.getDfsj(), sch.getDfsj())) {
3596 3635 aflog.log("修改待发时间", oldSch.getDfsj(), sch.getDfsj());
3597 3636 oldSch.setDfsj(sch.getDfsj());
3598 3637 }
3599 3638 //实发时间
3600   - if(!CustomStringUtils.equals(oldSch.getFcsjActual(), sch.getFcsjActual())){
  3639 + if (!CustomStringUtils.equals(oldSch.getFcsjActual(), sch.getFcsjActual())) {
3601 3640 aflog.log("修改实发时间", oldSch.getFcsjActual(), sch.getFcsjActual());
3602 3641 oldSch.setFcsjActual(sch.getFcsjActual());
3603 3642 }
3604 3643 //实际终点
3605   - if(!CustomStringUtils.equals(oldSch.getZdsjActual(), sch.getZdsjActual())){
  3644 + if (!CustomStringUtils.equals(oldSch.getZdsjActual(), sch.getZdsjActual())) {
3606 3645 aflog.log("修改实达时间", oldSch.getZdsjActual(), sch.getZdsjActual());
3607 3646 oldSch.setZdsjActual(sch.getZdsjActual());
3608 3647 }
3609 3648  
3610 3649 //备注
3611   - if(!CustomStringUtils.equals(oldSch.getRemarks(), sch.getRemarks())){
  3650 + if (!CustomStringUtils.equals(oldSch.getRemarks(), sch.getRemarks())) {
3612 3651 aflog.log("修改备注", oldSch.getRemarks(), sch.getRemarks());
3613 3652 oldSch.setRemarks(sch.getRemarks());
3614 3653 }
... ... @@ -3728,8 +3767,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3728 3767 if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out")
3729 3768 ) {
3730 3769 jcclc += tempJhlc;
3731   - }
3732   - else {
  3770 + } else {
3733 3771 if (scheduleRealInfo.getStatus() != -1) {
3734 3772 if (scheduleRealInfo.isSflj()) {
3735 3773 addMileage += tempJhlc;
... ... @@ -3793,24 +3831,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3793 3831 String zdsjActual = scheduleRealInfo.getZdsjActual();
3794 3832 if (zdsj != null && zdsjActual != null &&
3795 3833 !zdsj.equals(zdsjActual)) {
3796   - int zdsjT = Integer.valueOf(zdsj.split(":")[0])*60 + Integer.valueOf(zdsj.split(":")[1]);
3797   - int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0])*60 + Integer.valueOf(zdsjActual.split(":")[1]);
  3834 + int zdsjT = Integer.valueOf(zdsj.split(":")[0]) * 60 + Integer.valueOf(zdsj.split(":")[1]);
  3835 + int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0]) * 60 + Integer.valueOf(zdsjActual.split(":")[1]);
3798 3836 if (zdsj.compareTo(zdsjActual) > 0) {
3799   - if(zdsjT - zdsjAT > 1000){
3800   - map.put("fast", "");
3801   - map.put("slow", zdsjAT - zdsjT + 1440);
3802   - } else {
3803   - map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
3804   - map.put("slow", "");
3805   - }
  3837 + if (zdsjT - zdsjAT > 1000) {
  3838 + map.put("fast", "");
  3839 + map.put("slow", zdsjAT - zdsjT + 1440);
  3840 + } else {
  3841 + map.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  3842 + map.put("slow", "");
  3843 + }
3806 3844 } else {
3807   - if(zdsjAT - zdsjT > 1000){
3808   - map.put("fast", zdsjT - zdsjAT + 1440);
3809   - map.put("slow", "");
3810   - } else {
3811   - map.put("fast", "");
3812   - map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
3813   - }
  3845 + if (zdsjAT - zdsjT > 1000) {
  3846 + map.put("fast", zdsjT - zdsjAT + 1440);
  3847 + map.put("slow", "");
  3848 + } else {
  3849 + map.put("fast", "");
  3850 + map.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  3851 + }
3814 3852 }
3815 3853 } else {
3816 3854 map.put("fast", "");
... ... @@ -3856,7 +3894,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3856 3894 // map.put("sjbc", jhbc - cjbc + ljbc);
3857 3895 // map.put("zgl", format.format(yygl + ksgl + jcclc));
3858 3896 // map.put("ljbc", ljbc);
3859   -
  3897 +
3860 3898 String zdp = "", zwdp = "", wdp = "";
3861 3899 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
3862 3900 List<DutyEmployee> listDtuy = dutyEmployeeService.getDutyEmployee(line, date + "00:00", date + "23:59");
... ... @@ -3904,34 +3942,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3904 3942 DecimalFormat format = new DecimalFormat("0.00");
3905 3943 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
3906 3944 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
3907   - int jhbc = 0, cjbc = 0, ljbc = 0,sjbc=0;
3908   - double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0,ljjcclc=0,jhjcclc=0;
  3945 + int jhbc = 0, cjbc = 0, ljbc = 0, sjbc = 0;
  3946 + double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0, ljjcclc = 0, jhjcclc = 0;
3909 3947 double addMileage = 0, remMileage = 0, addgl = 0, remgl = 0;
3910 3948 Map<String, Object> map = new HashMap<String, Object>();
3911   - jhlc=culateMieageService.culateJhgl(lists);
3912   - jcclc=culateMieageService.culateJccgl(lists);
3913   - jhjcclc=culateMieageService.culateJhJccgl(lists);
3914   - remMileage=culateMieageService.culateLbgl(lists);
3915   - ksgl=culateMieageService.culateKsgl(lists);
3916   - yygl=culateMieageService.culateSjgl(lists);
3917   - jhbc=culateMieageService.culateJhbc(lists, "");
3918   - addMileage=culateMieageService.culateLjgl(lists);
3919   - cjbc=culateMieageService.culateLbbc(lists);
3920   - sjbc=culateMieageService.culateSjbc(lists, "");
3921   - ljbc=culateMieageService.culateLjbc(lists, "");
3922   - double zyygl=Arith.add(yygl,addMileage);
3923   - double zksgl=Arith.add(ksgl, jcclc);
3924   - map.put("jhlc", Arith.add(jhlc , jhjcclc));
  3949 + jhlc = culateMieageService.culateJhgl(lists);
  3950 + jcclc = culateMieageService.culateJccgl(lists);
  3951 + jhjcclc = culateMieageService.culateJhJccgl(lists);
  3952 + remMileage = culateMieageService.culateLbgl(lists);
  3953 + ksgl = culateMieageService.culateKsgl(lists);
  3954 + yygl = culateMieageService.culateSjgl(lists);
  3955 + jhbc = culateMieageService.culateJhbc(lists, "");
  3956 + addMileage = culateMieageService.culateLjgl(lists);
  3957 + cjbc = culateMieageService.culateLbbc(lists);
  3958 + sjbc = culateMieageService.culateSjbc(lists, "");
  3959 + ljbc = culateMieageService.culateLjbc(lists, "");
  3960 + double zyygl = Arith.add(yygl, addMileage);
  3961 + double zksgl = Arith.add(ksgl, jcclc);
  3962 + map.put("jhlc", Arith.add(jhlc, jhjcclc));
3925 3963 map.put("yygljh", jhlc);
3926 3964 map.put("ssgl", remMileage);
3927 3965 map.put("ksgl", ksgl);
3928   - map.put("yyglsj", Arith.add(yygl,addMileage));
  3966 + map.put("yyglsj", Arith.add(yygl, addMileage));
3929 3967 map.put("jcclc", jcclc);
3930 3968 map.put("jhbc", jhbc);
3931   - map.put("ljgl",addMileage);
  3969 + map.put("ljgl", addMileage);
3932 3970 map.put("ssbc", cjbc);
3933   - map.put("ysgl", Arith.add(yygl,addMileage));
3934   - map.put("sjbc",sjbc);
  3971 + map.put("ysgl", Arith.add(yygl, addMileage));
  3972 + map.put("sjbc", sjbc);
3935 3973 map.put("zgl", Arith.add(zyygl, zksgl));
3936 3974 map.put("ljbc", ljbc);
3937 3975  
... ... @@ -3965,7 +4003,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3965 4003 }
3966 4004  
3967 4005 if (!c.isDestroy()) {
3968   - if(c.getMileageType().equals("service")){
  4006 + if (c.getMileageType().equals("service")) {
3969 4007 sjlc += c.getMileage() == null ? 0 : c.getMileage();
3970 4008 }
3971 4009 }
... ... @@ -3987,140 +4025,140 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3987 4025 }
3988 4026  
3989 4027 @Override
3990   - public Map<String, Object> MapById(Long id) {
3991   - // TODO Auto-generated method stub
3992   - Map<String, Object> map = new HashMap<String, Object>();
3993   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
3994   - ScheduleRealInfo s = scheduleRealInfoRepository.scheduleById(id);
3995   - String xlbm = s.getXlBm();
3996   - String fcrq = s.getScheduleDateStr();
3997   -
3998   - int type = 2;
3999   - Double ccyl = 0.0;
4000   - Double jcyl = 0.0;
4001   - Double yh = 0.0;
4002   - Double jzl = 0.0;
4003   - Double zlc = 0.0;
4004   - List<Cars> listCars = carsRepository.findCarsByCode(s.getClZbh());
4005   - if (listCars.size() > 0) {
4006   - if(listCars.get(0).getSfdc()!=null){
4007   - if (listCars.get(0).getSfdc()) {
4008   - List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
4009   - type = 1;
4010   - for (int i = 0; i < listDlb.size(); i++) {
4011   - Dlb d = listDlb.get(i);
4012   - if (d.getLp() == null) {
4013   - ccyl = Arith.add(ccyl, d.getCzcd());
4014   - jcyl = Arith.add(jcyl, d.getJzcd());
4015   - yh = Arith.add(yh, d.getHd());
4016   - jzl = Arith.add(jzl, d.getCdl());
4017   - zlc = Arith.add(zlc, d.getZlc());
4018   - } else {
4019   - if (d.getLp().equals(s.getLpName())) {
4020   - ccyl = Arith.add(ccyl, d.getCzcd());
4021   - jcyl = Arith.add(jcyl, d.getJzcd());
4022   - yh = Arith.add(yh, d.getHd());
4023   - jzl = Arith.add(jzl, d.getCdl());
4024   - zlc = Arith.add(zlc, d.getZlc());
4025   - }
4026   - }
4027   -
4028   - }
4029   - } else {
4030   - List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
4031   - type = 0;
4032   - for (int i = 0; i < listYlb.size(); i++) {
4033   - Ylb y = listYlb.get(i);
4034   - if (y.getLp() == null) {
4035   - ccyl = Arith.add(ccyl, y.getCzyl());
4036   - jcyl = Arith.add(jcyl, y.getJzyl());
4037   - yh = Arith.add(yh, y.getYh());
4038   - jzl = Arith.add(jzl, y.getJzl());
4039   - zlc = Arith.add(zlc, y.getZlc());
4040   - } else {
4041   - if (y.getLp().equals(s.getLpName())) {
4042   - ccyl = Arith.add(ccyl, y.getCzyl());
4043   - jcyl = Arith.add(jcyl, y.getJzyl());
4044   - yh = Arith.add(yh, y.getYh());
4045   - jzl = Arith.add(jzl, y.getJzl());
4046   - zlc = Arith.add(zlc, y.getZlc());
4047   - }
4048   - }
4049   - }
4050   - }
4051   - }
4052   - }
4053   -
4054   - map.put("jzl", jzl);
4055   - map.put("yh", yh);
4056   - map.put("ccyl", ccyl);
4057   - map.put("jcyl", jcyl);
4058   - map.put("type", type);
4059   - map.put("zlc", zlc);
4060   - map.put("xlName", s.getXlName());
4061   - map.put("clZbh", s.getClZbh());
4062   - map.put("plate", BasicData.nbbmCompanyPlateMap.get(s.getClZbh()));
4063   - map.put("fcsjActual", s.getFcsjActual());
4064   - map.put("zdzName", s.getZdzName());
4065   - map.put("scheduleDate", s.getScheduleDateStr());
4066   - map.put("lpName", s.getLpName());
4067   - String zdp = "", zwdp = "", wdp = "";
4068   - String zdpT = "", zwdpT = "", wdpT = "";
4069   - String dbdp = "";
4070   - List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
4071   - try {
4072   - Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
4073   - Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
4074   - Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
4075   - for (int i = 0; i < list.size(); i++) {
4076   - DutyEmployee t = list.get(i);
4077   - if (dbdp.indexOf(t.getuName()) == -1) {
4078   - if (!(dbdp.length() > 0)) {
4079   - dbdp = t.getuName();
4080   - } else {
4081   - dbdp += "," + t.getuName();
4082   - }
4083   - }
4084   - Long ts = t.getTs();
4085   - if (ts > fcsj1 && ts < fcsj2) {
4086   - if (zdp.indexOf(t.getuName()) == -1) {
4087   - if (!(zdp.length() > 0)) {
4088   - zdpT = t.getuName() + "...";
4089   - }
4090   - zdp += t.getuName() + ",";
4091   -
4092   - }
4093   - } else if (ts > fcsj2 && ts < fcsj3) {
4094   - if (zwdp.indexOf(t.getuName()) == -1) {
4095   - if (!(zwdp.length() > 0)) {
4096   - zwdpT = t.getuName() + "...";
4097   - }
4098   - zwdp += t.getuName() + ",";
4099   - }
4100   - } else {
4101   - if (wdp.indexOf(t.getuName()) == -1) {
4102   - if (!(wdp.length() > 0)) {
4103   - wdpT = t.getuName() + "...";
4104   - }
4105   - wdp += t.getuName() + ",";
4106   - }
4107   - }
4108   - }
4109   - } catch (ParseException e) {
4110   - // TODO Auto-generated catch block
4111   - e.printStackTrace();
4112   - }
4113   - map.put("zdp", zdp);
4114   - map.put("zwdp", zwdp);
4115   - map.put("wdp", wdp);
4116   - map.put("zdpT", zdpT);
4117   - map.put("zwdpT", zwdpT);
4118   - map.put("wdpT", wdpT);
4119   - map.put("dbdp", dbdp);
4120   - return map;
4121   - }
4122   -
4123   - @Override
  4028 + public Map<String, Object> MapById(Long id) {
  4029 + // TODO Auto-generated method stub
  4030 + Map<String, Object> map = new HashMap<String, Object>();
  4031 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  4032 + ScheduleRealInfo s = scheduleRealInfoRepository.scheduleById(id);
  4033 + String xlbm = s.getXlBm();
  4034 + String fcrq = s.getScheduleDateStr();
  4035 +
  4036 + int type = 2;
  4037 + Double ccyl = 0.0;
  4038 + Double jcyl = 0.0;
  4039 + Double yh = 0.0;
  4040 + Double jzl = 0.0;
  4041 + Double zlc = 0.0;
  4042 + List<Cars> listCars = carsRepository.findCarsByCode(s.getClZbh());
  4043 + if (listCars.size() > 0) {
  4044 + if (listCars.get(0).getSfdc() != null) {
  4045 + if (listCars.get(0).getSfdc()) {
  4046 + List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
  4047 + type = 1;
  4048 + for (int i = 0; i < listDlb.size(); i++) {
  4049 + Dlb d = listDlb.get(i);
  4050 + if (d.getLp() == null) {
  4051 + ccyl = Arith.add(ccyl, d.getCzcd());
  4052 + jcyl = Arith.add(jcyl, d.getJzcd());
  4053 + yh = Arith.add(yh, d.getHd());
  4054 + jzl = Arith.add(jzl, d.getCdl());
  4055 + zlc = Arith.add(zlc, d.getZlc());
  4056 + } else {
  4057 + if (d.getLp().equals(s.getLpName())) {
  4058 + ccyl = Arith.add(ccyl, d.getCzcd());
  4059 + jcyl = Arith.add(jcyl, d.getJzcd());
  4060 + yh = Arith.add(yh, d.getHd());
  4061 + jzl = Arith.add(jzl, d.getCdl());
  4062 + zlc = Arith.add(zlc, d.getZlc());
  4063 + }
  4064 + }
  4065 +
  4066 + }
  4067 + } else {
  4068 + List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(), xlbm);
  4069 + type = 0;
  4070 + for (int i = 0; i < listYlb.size(); i++) {
  4071 + Ylb y = listYlb.get(i);
  4072 + if (y.getLp() == null) {
  4073 + ccyl = Arith.add(ccyl, y.getCzyl());
  4074 + jcyl = Arith.add(jcyl, y.getJzyl());
  4075 + yh = Arith.add(yh, y.getYh());
  4076 + jzl = Arith.add(jzl, y.getJzl());
  4077 + zlc = Arith.add(zlc, y.getZlc());
  4078 + } else {
  4079 + if (y.getLp().equals(s.getLpName())) {
  4080 + ccyl = Arith.add(ccyl, y.getCzyl());
  4081 + jcyl = Arith.add(jcyl, y.getJzyl());
  4082 + yh = Arith.add(yh, y.getYh());
  4083 + jzl = Arith.add(jzl, y.getJzl());
  4084 + zlc = Arith.add(zlc, y.getZlc());
  4085 + }
  4086 + }
  4087 + }
  4088 + }
  4089 + }
  4090 + }
  4091 +
  4092 + map.put("jzl", jzl);
  4093 + map.put("yh", yh);
  4094 + map.put("ccyl", ccyl);
  4095 + map.put("jcyl", jcyl);
  4096 + map.put("type", type);
  4097 + map.put("zlc", zlc);
  4098 + map.put("xlName", s.getXlName());
  4099 + map.put("clZbh", s.getClZbh());
  4100 + map.put("plate", BasicData.nbbmCompanyPlateMap.get(s.getClZbh()));
  4101 + map.put("fcsjActual", s.getFcsjActual());
  4102 + map.put("zdzName", s.getZdzName());
  4103 + map.put("scheduleDate", s.getScheduleDateStr());
  4104 + map.put("lpName", s.getLpName());
  4105 + String zdp = "", zwdp = "", wdp = "";
  4106 + String zdpT = "", zwdpT = "", wdpT = "";
  4107 + String dbdp = "";
  4108 + List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
  4109 + try {
  4110 + Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
  4111 + Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
  4112 + Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
  4113 + for (int i = 0; i < list.size(); i++) {
  4114 + DutyEmployee t = list.get(i);
  4115 + if (dbdp.indexOf(t.getuName()) == -1) {
  4116 + if (!(dbdp.length() > 0)) {
  4117 + dbdp = t.getuName();
  4118 + } else {
  4119 + dbdp += "," + t.getuName();
  4120 + }
  4121 + }
  4122 + Long ts = t.getTs();
  4123 + if (ts > fcsj1 && ts < fcsj2) {
  4124 + if (zdp.indexOf(t.getuName()) == -1) {
  4125 + if (!(zdp.length() > 0)) {
  4126 + zdpT = t.getuName() + "...";
  4127 + }
  4128 + zdp += t.getuName() + ",";
  4129 +
  4130 + }
  4131 + } else if (ts > fcsj2 && ts < fcsj3) {
  4132 + if (zwdp.indexOf(t.getuName()) == -1) {
  4133 + if (!(zwdp.length() > 0)) {
  4134 + zwdpT = t.getuName() + "...";
  4135 + }
  4136 + zwdp += t.getuName() + ",";
  4137 + }
  4138 + } else {
  4139 + if (wdp.indexOf(t.getuName()) == -1) {
  4140 + if (!(wdp.length() > 0)) {
  4141 + wdpT = t.getuName() + "...";
  4142 + }
  4143 + wdp += t.getuName() + ",";
  4144 + }
  4145 + }
  4146 + }
  4147 + } catch (ParseException e) {
  4148 + // TODO Auto-generated catch block
  4149 + e.printStackTrace();
  4150 + }
  4151 + map.put("zdp", zdp);
  4152 + map.put("zwdp", zwdp);
  4153 + map.put("wdp", wdp);
  4154 + map.put("zdpT", zdpT);
  4155 + map.put("zwdpT", zwdpT);
  4156 + map.put("wdpT", wdpT);
  4157 + map.put("dbdp", dbdp);
  4158 + return map;
  4159 + }
  4160 +
  4161 + @Override
4124 4162 public Map<String, Object> MapByIdQp(Long id) {
4125 4163 // TODO Auto-generated method stub
4126 4164 Map<String, Object> map = new HashMap<String, Object>();
... ... @@ -4129,12 +4167,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4129 4167 String xlbm = s.getXlBm();
4130 4168 String fcrq = s.getScheduleDateStr();
4131 4169  
4132   - int type=0;
  4170 + int type = 0;
4133 4171 Double ccyl = 0.0;
4134 4172 Double jcyl = 0.0;
4135 4173 Double yh = 0.0;
4136 4174 Double jzl = 0.0;
4137   - Double zlc=0.0;
  4175 + Double zlc = 0.0;
4138 4176 // List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
4139 4177 // List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(),xlbm);
4140 4178 // if(listYlb.size()>0){
... ... @@ -4180,12 +4218,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4180 4218 //
4181 4219 // }
4182 4220 // }
4183   -
4184   - List<Ylxxb> listylxxb=ylxxbRepository.queryListYlxxb(s.getClZbh(), fcrq);
  4221 +
  4222 + List<Ylxxb> listylxxb = ylxxbRepository.queryListYlxxb(s.getClZbh(), fcrq);
4185 4223 for (int i = 0; i < listylxxb.size(); i++) {
4186   - Ylxxb t=listylxxb.get(i);
4187   - jzl =Arith.add(jzl, t.getJzl());
4188   - }
  4224 + Ylxxb t = listylxxb.get(i);
  4225 + jzl = Arith.add(jzl, t.getJzl());
  4226 + }
4189 4227 map.put("jzl", jzl);
4190 4228 map.put("yh", yh);
4191 4229 map.put("ccyl", ccyl);
... ... @@ -4201,7 +4239,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4201 4239 map.put("lpName", s.getLpName());
4202 4240 String zdp = "", zwdp = "", wdp = "";
4203 4241 String zdpT = "", zwdpT = "", wdpT = "";
4204   - String dbdp="";
  4242 + String dbdp = "";
4205 4243 List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59");
4206 4244 try {
4207 4245 Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime();
... ... @@ -4209,11 +4247,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4209 4247 Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
4210 4248 for (int i = 0; i < list.size(); i++) {
4211 4249 DutyEmployee t = list.get(i);
4212   - if(dbdp.indexOf(t.getuName()) == -1){
4213   - if(!(dbdp.length()>0)){
4214   - dbdp =t.getuName();
4215   - }else{
4216   - dbdp +=","+t.getuName();
  4250 + if (dbdp.indexOf(t.getuName()) == -1) {
  4251 + if (!(dbdp.length() > 0)) {
  4252 + dbdp = t.getuName();
  4253 + } else {
  4254 + dbdp += "," + t.getuName();
4217 4255 }
4218 4256 }
4219 4257 Long ts = t.getTs();
... ... @@ -4298,8 +4336,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4298 4336  
4299 4337 if (scheduleRealInfo.getsGh() != null) {
4300 4338 if (!scheduleRealInfo.getsGh().equals(sgh)) {
4301   - sgh = scheduleRealInfo.getsGh()==null?"":scheduleRealInfo.getsGh();
4302   - if(!sgh.equals("")){
  4339 + sgh = scheduleRealInfo.getsGh() == null ? "" : scheduleRealInfo.getsGh();
  4340 + if (!sgh.equals("")) {
4303 4341 if (map.get("sjb1") != null) {
4304 4342 if (map.get("sjb2") != null) {
4305 4343 map.put("sjb3", scheduleRealInfo.getsGh() + "/" +
... ... @@ -4408,8 +4446,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4408 4446 List<ScheduleRealInfo> list2 = this.queryUserInfo(line, date, state);
4409 4447 List<ScheduleRealInfo> list3 = this.realScheduleList(line, date);
4410 4448  
4411   - Map<String, Object> nMap=new HashMap<String, Object>();
4412   - nMap.put("date", xlName+date);
  4449 + Map<String, Object> nMap = new HashMap<String, Object>();
  4450 + nMap.put("date", xlName + date);
4413 4451 nMap.put("jls", list1.get(0).get("jls"));
4414 4452 nMap.put("sjgl", list1.get(0).get("sjgl"));
4415 4453 for (Map<String, Object> m : list1) {
... ... @@ -4506,72 +4544,72 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4506 4544 }
4507 4545 }
4508 4546 */
4509   -
  4547 +
4510 4548 size = 0;
4511 4549 tempMap = new HashMap<String, Object>();
4512 4550 for (ScheduleRealInfo schedule : list3) {
4513   - int x=size%3;
4514   - if(x==0 && size>0){
4515   - dataList3.add(tempMap);
4516   - tempMap = new HashMap<String, Object>();
4517   - }
4518   - tempMap.put("lpName" + x, schedule.getLpName());
4519   - tempMap.put("qdzName" + x, schedule.getQdzName());
4520   - tempMap.put("zdsj" + x, schedule.getZdsj());
4521   - String zdsjActual=schedule.getZdsjActual() != null ? schedule.getZdsjActual() : "";
4522   - tempMap.put("zdsjActual" + x, zdsjActual);
4523   -
4524   - String zdsjk="";
4525   - String zdsjm="";
4526   - if(!zdsjActual.equals("")){
4527   - String[] zdsj_s=schedule.getZdsj().split(":");
4528   - String[] zdsjActual_s=zdsjActual.split(":");
4529   - Long zdsj_=Long.parseLong(zdsj_s[0])*60+Long.parseLong(zdsj_s[1]);
4530   - Long zdsjActual_=Long.parseLong(zdsjActual_s[0])*60+Long.parseLong(zdsjActual_s[1]);
4531   - if((zdsj_-zdsjActual_)>0){
4532   - zdsjk =String.valueOf(zdsj_-zdsjActual_);
4533   - }else{
4534   - zdsjm =String.valueOf(zdsjActual_-zdsj_);
4535   - }
4536   - }
4537   - tempMap.put("zdsjk" + x, zdsjk);
4538   - tempMap.put("zdsjm" + x, zdsjm);
4539   - tempMap.put("fcsj" + x, schedule.getFcsj());
4540   - String fcsjActural=schedule.getFcsjActual() != null ? schedule.getFcsjActual() : "";
4541   - String bcType=schedule.getBcType()!=null?schedule.getBcType():"";
4542   - String fcsjActuralstr="";
4543   - if(bcType.equals("in")){
4544   - fcsjActuralstr=fcsjActural+"(进)";
4545   - }else if(bcType.equals("out")){
4546   - fcsjActuralstr=fcsjActural+"(出)";
4547   - }else{
4548   - fcsjActuralstr=fcsjActural;
4549   - }
4550   - tempMap.put("fcsjActual" + x, fcsjActuralstr);
4551   - String fcsjk="";
4552   - String fcsjm="";
4553   - if(!fcsjActural.equals("")){
4554   - String[] zdsj_s=schedule.getFcsj().split(":");
4555   - String[] fcsjActural_s=fcsjActural.split(":");
4556   - Long zdsj_=Long.parseLong(zdsj_s[0])*60+Long.parseLong(zdsj_s[1]);
4557   - Long fcsjActural_=Long.parseLong(fcsjActural_s[0])*60+Long.parseLong(fcsjActural_s[1]);
4558   - if((zdsj_-fcsjActural_)>0){
4559   - fcsjk =String.valueOf(zdsj_-fcsjActural_);
4560   - }else{
4561   - fcsjm =String.valueOf(fcsjActural_-zdsj_);
4562   - }
4563   - }
4564   - tempMap.put("fcsjk" + x, fcsjk);
4565   - tempMap.put("fcsjm" + x, fcsjm);
4566   - tempMap.put("remarks" + x, schedule.getRemark() != null ? schedule.getRemark() : "");
4567   -
4568   - size++;
4569   - }
4570   - if(tempMap.get("lpName0")!=null){
4571   - if(tempMap.get("lpName1")==null){
4572   - tempMap.put("lpName1" , "");
4573   - tempMap.put("qdzName1" , "");
4574   - tempMap.put("zdsj1" , "");
  4551 + int x = size % 3;
  4552 + if (x == 0 && size > 0) {
  4553 + dataList3.add(tempMap);
  4554 + tempMap = new HashMap<String, Object>();
  4555 + }
  4556 + tempMap.put("lpName" + x, schedule.getLpName());
  4557 + tempMap.put("qdzName" + x, schedule.getQdzName());
  4558 + tempMap.put("zdsj" + x, schedule.getZdsj());
  4559 + String zdsjActual = schedule.getZdsjActual() != null ? schedule.getZdsjActual() : "";
  4560 + tempMap.put("zdsjActual" + x, zdsjActual);
  4561 +
  4562 + String zdsjk = "";
  4563 + String zdsjm = "";
  4564 + if (!zdsjActual.equals("")) {
  4565 + String[] zdsj_s = schedule.getZdsj().split(":");
  4566 + String[] zdsjActual_s = zdsjActual.split(":");
  4567 + Long zdsj_ = Long.parseLong(zdsj_s[0]) * 60 + Long.parseLong(zdsj_s[1]);
  4568 + Long zdsjActual_ = Long.parseLong(zdsjActual_s[0]) * 60 + Long.parseLong(zdsjActual_s[1]);
  4569 + if ((zdsj_ - zdsjActual_) > 0) {
  4570 + zdsjk = String.valueOf(zdsj_ - zdsjActual_);
  4571 + } else {
  4572 + zdsjm = String.valueOf(zdsjActual_ - zdsj_);
  4573 + }
  4574 + }
  4575 + tempMap.put("zdsjk" + x, zdsjk);
  4576 + tempMap.put("zdsjm" + x, zdsjm);
  4577 + tempMap.put("fcsj" + x, schedule.getFcsj());
  4578 + String fcsjActural = schedule.getFcsjActual() != null ? schedule.getFcsjActual() : "";
  4579 + String bcType = schedule.getBcType() != null ? schedule.getBcType() : "";
  4580 + String fcsjActuralstr = "";
  4581 + if (bcType.equals("in")) {
  4582 + fcsjActuralstr = fcsjActural + "(进)";
  4583 + } else if (bcType.equals("out")) {
  4584 + fcsjActuralstr = fcsjActural + "(出)";
  4585 + } else {
  4586 + fcsjActuralstr = fcsjActural;
  4587 + }
  4588 + tempMap.put("fcsjActual" + x, fcsjActuralstr);
  4589 + String fcsjk = "";
  4590 + String fcsjm = "";
  4591 + if (!fcsjActural.equals("")) {
  4592 + String[] zdsj_s = schedule.getFcsj().split(":");
  4593 + String[] fcsjActural_s = fcsjActural.split(":");
  4594 + Long zdsj_ = Long.parseLong(zdsj_s[0]) * 60 + Long.parseLong(zdsj_s[1]);
  4595 + Long fcsjActural_ = Long.parseLong(fcsjActural_s[0]) * 60 + Long.parseLong(fcsjActural_s[1]);
  4596 + if ((zdsj_ - fcsjActural_) > 0) {
  4597 + fcsjk = String.valueOf(zdsj_ - fcsjActural_);
  4598 + } else {
  4599 + fcsjm = String.valueOf(fcsjActural_ - zdsj_);
  4600 + }
  4601 + }
  4602 + tempMap.put("fcsjk" + x, fcsjk);
  4603 + tempMap.put("fcsjm" + x, fcsjm);
  4604 + tempMap.put("remarks" + x, schedule.getRemark() != null ? schedule.getRemark() : "");
  4605 +
  4606 + size++;
  4607 + }
  4608 + if (tempMap.get("lpName0") != null) {
  4609 + if (tempMap.get("lpName1") == null) {
  4610 + tempMap.put("lpName1", "");
  4611 + tempMap.put("qdzName1", "");
  4612 + tempMap.put("zdsj1", "");
4575 4613 tempMap.put("zdsjActual1", "");
4576 4614 tempMap.put("zdsjk1", "");
4577 4615 tempMap.put("zdsjm1", "");
... ... @@ -4580,9 +4618,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4580 4618 tempMap.put("fcsjk1", "");
4581 4619 tempMap.put("fcsjm1", "");
4582 4620 tempMap.put("remarks1", "");
4583   - }
4584   - if(tempMap.get("lpName2")==null){
4585   - tempMap.put("lpName2", "");
  4621 + }
  4622 + if (tempMap.get("lpName2") == null) {
  4623 + tempMap.put("lpName2", "");
4586 4624 tempMap.put("qdzName2", "");
4587 4625 tempMap.put("zdsj2", "");
4588 4626 tempMap.put("zdsjActual2", "");
... ... @@ -4593,35 +4631,35 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4593 4631 tempMap.put("fcsjk2", "");
4594 4632 tempMap.put("fcsjm2", "");
4595 4633 tempMap.put("remarks2", "");
4596   - }
4597   - dataList3.add(tempMap);
4598   - }
4599   -
4600   - if(date.length() == 10){
4601   - List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(line, date + "00:01", date + "23:59");
4602   - String dbdp = "";
4603   - try {
4604   - for (int i = 0; i < list.size(); i++) {
4605   - DutyEmployee t = list.get(i);
4606   - if(dbdp.indexOf(t.getuName()) == -1){
4607   - if(!(dbdp.length()>0)){
4608   - dbdp =t.getuName();
4609   - }else{
4610   - dbdp +=","+t.getuName();
4611   - }
4612   - }
4613   - }
4614   - } catch (Exception e) {
4615   - // TODO: handle exception
4616   - e.printStackTrace();
4617   - }
4618   - nMap.put("dbdp", dbdp);
  4634 + }
  4635 + dataList3.add(tempMap);
  4636 + }
  4637 +
  4638 + if (date.length() == 10) {
  4639 + List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(line, date + "00:01", date + "23:59");
  4640 + String dbdp = "";
  4641 + try {
  4642 + for (int i = 0; i < list.size(); i++) {
  4643 + DutyEmployee t = list.get(i);
  4644 + if (dbdp.indexOf(t.getuName()) == -1) {
  4645 + if (!(dbdp.length() > 0)) {
  4646 + dbdp = t.getuName();
  4647 + } else {
  4648 + dbdp += "," + t.getuName();
  4649 + }
  4650 + }
  4651 + }
  4652 + } catch (Exception e) {
  4653 + // TODO: handle exception
  4654 + e.printStackTrace();
  4655 + }
  4656 + nMap.put("dbdp", dbdp);
4619 4657 }
4620 4658  
4621 4659 if (type.equals("export")) {
4622   - String lineName = "";
4623   - if(map.containsKey("lineName"))
4624   - lineName = "-" + map.get("lineName").toString() + "-";
  4660 + String lineName = "";
  4661 + if (map.containsKey("lineName"))
  4662 + lineName = "-" + map.get("lineName").toString() + "-";
4625 4663 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
4626 4664 sdfSimple = new SimpleDateFormat("yyyyMMdd");
4627 4665 Map<String, Object> m = new HashMap<String, Object>();
... ... @@ -4639,7 +4677,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4639 4677 sourcePath = path + "mould/scheduleDaily_m.xls";
4640 4678 }
4641 4679 ee.excelReplace(listI, new Object[]{nMap}, sourcePath,
4642   - path + "export/调度日报"+ lineName + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  4680 + path + "export/" + sdfSimple.format(sdfMonth.parse(date)) + lineName + "调度日报.xls");
4643 4681 } catch (Exception e) {
4644 4682 // TODO: handle exception
4645 4683 e.printStackTrace();
... ... @@ -4650,197 +4688,198 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4650 4688 }
4651 4689  
4652 4690 public void exportWaybill_pl(List<ScheduleRealInfo> listpl,
4653   - String date, String jName, String clZbh, String lpName) {
  4691 + String date, String jName, String clZbh, String lpName) {
4654 4692 ReportUtils ee = new ReportUtils();
4655 4693 ReportRelatedUtils rru = new ReportRelatedUtils();
4656 4694 List<Iterator<?>> list = new ArrayList<Iterator<?>>();
4657 4695 List<ScheduleRealInfo> scheduleRealInfos = listpl;
4658 4696 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
4659 4697 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);
4660   - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
4661   - for (int i = 0; i < scheduleRealInfos.size(); i++) {
4662   - ScheduleRealInfo s=scheduleRealInfos.get(i);
4663   - Set<ChildTaskPlan> cts = s.getcTasks();
4664   - if(cts != null && cts.size() > 0){
4665   - lists.add(s);
4666   - }else{
4667   - if(s.getZdsjActual()!=null && s.getFcsjActual()!=null){
4668   - lists.add(s);
4669   - }
4670   - }
4671   - }
4672   - DecimalFormat format = new DecimalFormat("0.00");
  4698 + List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
  4699 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4700 + ScheduleRealInfo s = scheduleRealInfos.get(i);
  4701 + Set<ChildTaskPlan> cts = s.getcTasks();
  4702 + if (cts != null && cts.size() > 0) {
  4703 + lists.add(s);
  4704 + } else {
  4705 + if (s.getZdsjActual() != null && s.getFcsjActual() != null) {
  4706 + lists.add(s);
  4707 + }
  4708 + }
  4709 + }
  4710 + DecimalFormat format = new DecimalFormat("0.00");
4673 4711 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
4674 4712 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
4675   - //计算里程和班次数,并放入Map里
4676   - Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
4677   -
4678   - map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos)));
4679   - map.put("remMileage",culateMieageService.culateLbgl(scheduleRealInfos));
4680   - map.put("addMileage", culateMieageService.culateLjgl(lists));
4681   - double yygl=Arith.add(culateMieageService.culateSjgl(lists),culateMieageService.culateLjgl(lists));
4682   - map.put("yygl", yygl);
4683   - double ksgl=Arith.add(culateMieageService.culateKsgl(scheduleRealInfos),culateMieageService.culateJccgl(lists));
4684   - map.put("ksgl",ksgl);
4685   - map.put("realMileage", Arith.add(yygl ,ksgl));
4686   - map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos,""));
4687   - map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos));
4688   - map.put("ljbc", culateMieageService.culateLjbc(lists, ""));
4689   - int sjbc =culateMieageService.culateLjbc(lists, "")+culateMieageService.culateSjbc(lists, "");
4690   - map.put("sjbc", sjbc);
  4713 + //计算里程和班次数,并放入Map里
  4714 + Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
  4715 +
  4716 + map.put("jhlc", Arith.add(culateMieageService.culateJhgl(scheduleRealInfos), culateMieageService.culateJhJccgl(scheduleRealInfos)));
  4717 + map.put("remMileage", culateMieageService.culateLbgl(scheduleRealInfos));
  4718 + map.put("addMileage", culateMieageService.culateLjgl(lists));
  4719 + double yygl = Arith.add(culateMieageService.culateSjgl(lists), culateMieageService.culateLjgl(lists));
  4720 + map.put("yygl", yygl);
  4721 + double ksgl = Arith.add(culateMieageService.culateKsgl(scheduleRealInfos), culateMieageService.culateJccgl(lists));
  4722 + map.put("ksgl", ksgl);
  4723 + map.put("realMileage", Arith.add(yygl, ksgl));
  4724 + map.put("jhbc", culateMieageService.culateJhbc(scheduleRealInfos, ""));
  4725 + map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos));
  4726 + map.put("ljbc", culateMieageService.culateLjbc(lists, ""));
  4727 + int sjbc = culateMieageService.culateLjbc(lists, "") + culateMieageService.culateSjbc(lists, "");
  4728 + map.put("sjbc", sjbc);
4691 4729 // map=new HashMap<String,Object>();
4692   -
4693   - SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
4694   - String minfcsj="02:00";
4695   - List<Line> lineList=lineRepository.findLineByCode(listpl.get(0).getXlBm());
4696   - if(lineList.size()>0){
4697   - String sqlMinYysj="select start_opt from bsth_c_line_config where "
4698   - + " id = ("
4699   - + "select max(id) from bsth_c_line_config where line ='"+lineList.get(0).getId() +"'"
4700   - + ")";
4701   - minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
4702   - }
4703   - String[] minSjs = minfcsj.split(":");
4704   - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
4705   -
4706   -
4707   - for (int i = 0; i < scheduleRealInfos.size(); i++) {
4708   - ScheduleRealInfo s=scheduleRealInfos.get(i);
4709   - String[] fcsj= s.getFcsj().split(":");
4710   - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
4711   -
4712   - Long fscjT=0L;
4713   - if(fcsjL<minSj){
4714   - Calendar calendar = new GregorianCalendar();
4715   - calendar.setTime(s.getScheduleDate());
4716   - calendar.add(calendar.DATE,1);
4717   - s.setScheduleDate(calendar.getTime());
4718   - try {
4719   - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
4720   - } catch (ParseException e) {
4721   - // TODO Auto-generated catch block
4722   - e.printStackTrace();
4723   - }
4724   -
4725   - }else{
4726   - try {
4727   - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
4728   - } catch (ParseException e) {
4729   - // TODO Auto-generated catch block
4730   - e.printStackTrace();
4731   - };
4732   - }
4733   - s.setFcsjT(fscjT);
4734   - }
4735   - List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
4736   - Collections.sort(scheduleRealInfos, new ComparableReal());
4737   - for (int i = 0; i < scheduleRealInfos.size(); i++) {
4738   - ScheduleRealInfo s = scheduleRealInfos.get(i);
4739   - s.setAdjustExps(i + 1 + "");
4740   - String remarks = "";
4741   - if (s.getRemarks() != null) {
4742   - remarks += s.getRemarks();
4743   - }
4744   -
4745   - Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
4746   - if (!childTaskPlans.isEmpty()) {
4747   - s.setFcsjActual("");
4748   - s.setZdsjActual("");
4749   - s.setJhlc(0.0);
4750   - }
4751   -
4752   - if (s.isDestroy()) {
4753   - s.setFcsjActual("");
4754   - s.setZdsjActual("");
4755   - s.setJhlc(0.0);
4756   - remarks += "(烂班)";
4757   - s.setRemarks(remarks);
4758   - }
4759   -
4760   - listSchedule.add(s);
4761   - //计算营运里程,空驶里程
4762   - if (!childTaskPlans.isEmpty()) {
  4730 +
  4731 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
  4732 + String minfcsj = "02:00";
  4733 + List<Line> lineList = lineRepository.findLineByCode(listpl.get(0).getXlBm());
  4734 + if (lineList.size() > 0) {
  4735 + String sqlMinYysj = "select start_opt from bsth_c_line_config where "
  4736 + + " id = ("
  4737 + + "select max(id) from bsth_c_line_config where line ='" + lineList.get(0).getId() + "'"
  4738 + + ")";
  4739 + minfcsj = jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  4740 + }
  4741 + String[] minSjs = minfcsj.split(":");
  4742 + Long minSj = Long.parseLong(minSjs[0]) * 60 + Long.parseLong(minSjs[1]);
  4743 +
  4744 +
  4745 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4746 + ScheduleRealInfo s = scheduleRealInfos.get(i);
  4747 + String[] fcsj = s.getFcsj().split(":");
  4748 + Long fcsjL = Long.parseLong(fcsj[0]) * 60 + Long.parseLong(fcsj[1]);
  4749 +
  4750 + Long fscjT = 0L;
  4751 + if (fcsjL < minSj) {
  4752 + Calendar calendar = new GregorianCalendar();
  4753 + calendar.setTime(s.getScheduleDate());
  4754 + calendar.add(calendar.DATE, 1);
  4755 + s.setScheduleDate(calendar.getTime());
  4756 + try {
  4757 + fscjT = sdf.parse(sdf.format(s.getScheduleDate()) + " " + s.getFcsj()).getTime();
  4758 + } catch (ParseException e) {
  4759 + // TODO Auto-generated catch block
  4760 + e.printStackTrace();
  4761 + }
  4762 +
  4763 + } else {
  4764 + try {
  4765 + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime();
  4766 + } catch (ParseException e) {
  4767 + // TODO Auto-generated catch block
  4768 + e.printStackTrace();
  4769 + }
  4770 + ;
  4771 + }
  4772 + s.setFcsjT(fscjT);
  4773 + }
  4774 + List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>();
  4775 + Collections.sort(scheduleRealInfos, new ComparableReal());
  4776 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4777 + ScheduleRealInfo s = scheduleRealInfos.get(i);
  4778 + s.setAdjustExps(i + 1 + "");
  4779 + String remarks = "";
  4780 + if (s.getRemarks() != null) {
  4781 + remarks += s.getRemarks();
  4782 + }
  4783 +
  4784 + Set<ChildTaskPlan> childTaskPlans = s.getcTasks();
  4785 + if (!childTaskPlans.isEmpty()) {
  4786 + s.setFcsjActual("");
  4787 + s.setZdsjActual("");
  4788 + s.setJhlc(0.0);
  4789 + }
  4790 +
  4791 + if (s.isDestroy()) {
  4792 + s.setFcsjActual("");
  4793 + s.setZdsjActual("");
  4794 + s.setJhlc(0.0);
  4795 + remarks += "(烂班)";
  4796 + s.setRemarks(remarks);
  4797 + }
  4798 +
  4799 + listSchedule.add(s);
  4800 + //计算营运里程,空驶里程
  4801 + if (!childTaskPlans.isEmpty()) {
4763 4802 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
4764   - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
4765   - Collections.sort(listit, new ComparableChild());
4766   - for (int j = 0; j < listit.size(); j++) {
4767   - ScheduleRealInfo t = new ScheduleRealInfo();
4768   - ChildTaskPlan childTaskPlan = listit.get(j);
4769   - if (childTaskPlan.isDestroy()) {
4770   - t.setFcsjActual("");
4771   - t.setZdsjActual("");
4772   - t.setJhlc(0.0);
4773   - } else {
4774   - t.setFcsjActual(childTaskPlan.getStartDate());
4775   - t.setZdsjActual(childTaskPlan.getEndDate());
4776   - t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
4777   - }
4778   - t.setQdzName(childTaskPlan.getStartStationName());
4779   - t.setZdzName(childTaskPlan.getEndStationName());
4780   - t.setRemarks(childTaskPlan.getRemarks());
4781   - t.setAdjustExps("子");
4782   - t.setjGh("");
4783   - t.setjName("");
4784   - t.setsGh("");
4785   - t.setsName("");
4786   - listSchedule.add(t);
4787   - }
4788   - }
4789   - }
4790   - Map<String, Object> maps;
4791   - for (ScheduleRealInfo scheduleRealInfo : listSchedule) {
4792   - maps = new HashMap<String, Object>();
4793   - try {
4794   - scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
4795   - scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
4796   - maps = rru.getMapValue(scheduleRealInfo);
4797   - maps.put("bcs", scheduleRealInfo.getAdjustExps());
4798   - String zdsj = scheduleRealInfo.getZdsj();
4799   - String zdsjActual = scheduleRealInfo.getZdsjActual();
4800   - if (zdsj != null && zdsjActual != null &&
4801   - !zdsj.equals(zdsjActual) &&
4802   - !zdsj.equals("")&&
4803   - !zdsjActual.equals("")) {
4804   - int zdsjT = Integer.valueOf(zdsj.split(":")[0])*60 + Integer.valueOf(zdsj.split(":")[1]);
4805   - int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0])*60 + Integer.valueOf(zdsjActual.split(":")[1]);
4806   - if (zdsj.compareTo(zdsjActual) > 0) {
4807   - if(zdsjT - zdsjAT > 1000){
4808   - maps.put("fast", "");
4809   - maps.put("slow", zdsjAT - zdsjT + 1440);
4810   - } else {
4811   - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
4812   - maps.put("slow", "");
4813   - }
4814   - } else {
4815   - if(zdsjAT - zdsjT > 1000){
4816   - maps.put("fast", zdsjT - zdsjAT + 1440);
4817   - maps.put("slow", "");
4818   - } else {
4819   - maps.put("fast", "");
4820   - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
4821   - }
4822   - }
4823   - } else {
4824   - maps.put("fast", "");
4825   - maps.put("slow", "");
4826   - }
4827   - listMap.add(maps);
4828   - } catch (Exception e) {
4829   - e.printStackTrace();
4830   - }
4831   - }
  4803 + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans);
  4804 + Collections.sort(listit, new ComparableChild());
  4805 + for (int j = 0; j < listit.size(); j++) {
  4806 + ScheduleRealInfo t = new ScheduleRealInfo();
  4807 + ChildTaskPlan childTaskPlan = listit.get(j);
  4808 + if (childTaskPlan.isDestroy()) {
  4809 + t.setFcsjActual("");
  4810 + t.setZdsjActual("");
  4811 + t.setJhlc(0.0);
  4812 + } else {
  4813 + t.setFcsjActual(childTaskPlan.getStartDate());
  4814 + t.setZdsjActual(childTaskPlan.getEndDate());
  4815 + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  4816 + }
  4817 + t.setQdzName(childTaskPlan.getStartStationName());
  4818 + t.setZdzName(childTaskPlan.getEndStationName());
  4819 + t.setRemarks(childTaskPlan.getRemarks());
  4820 + t.setAdjustExps("子");
  4821 + t.setjGh("");
  4822 + t.setjName("");
  4823 + t.setsGh("");
  4824 + t.setsName("");
  4825 + listSchedule.add(t);
  4826 + }
  4827 + }
  4828 + }
  4829 + Map<String, Object> maps;
  4830 + for (ScheduleRealInfo scheduleRealInfo : listSchedule) {
  4831 + maps = new HashMap<String, Object>();
  4832 + try {
  4833 + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
  4834 + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
  4835 + maps = rru.getMapValue(scheduleRealInfo);
  4836 + maps.put("bcs", scheduleRealInfo.getAdjustExps());
  4837 + String zdsj = scheduleRealInfo.getZdsj();
  4838 + String zdsjActual = scheduleRealInfo.getZdsjActual();
  4839 + if (zdsj != null && zdsjActual != null &&
  4840 + !zdsj.equals(zdsjActual) &&
  4841 + !zdsj.equals("") &&
  4842 + !zdsjActual.equals("")) {
  4843 + int zdsjT = Integer.valueOf(zdsj.split(":")[0]) * 60 + Integer.valueOf(zdsj.split(":")[1]);
  4844 + int zdsjAT = Integer.valueOf(zdsjActual.split(":")[0]) * 60 + Integer.valueOf(zdsjActual.split(":")[1]);
  4845 + if (zdsj.compareTo(zdsjActual) > 0) {
  4846 + if (zdsjT - zdsjAT > 1000) {
  4847 + maps.put("fast", "");
  4848 + maps.put("slow", zdsjAT - zdsjT + 1440);
  4849 + } else {
  4850 + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  4851 + maps.put("slow", "");
  4852 + }
  4853 + } else {
  4854 + if (zdsjAT - zdsjT > 1000) {
  4855 + maps.put("fast", zdsjT - zdsjAT + 1440);
  4856 + maps.put("slow", "");
  4857 + } else {
  4858 + maps.put("fast", "");
  4859 + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  4860 + }
  4861 + }
  4862 + } else {
  4863 + maps.put("fast", "");
  4864 + maps.put("slow", "");
  4865 + }
  4866 + listMap.add(maps);
  4867 + } catch (Exception e) {
  4868 + e.printStackTrace();
  4869 + }
  4870 + }
4832 4871  
4833 4872  
4834 4873 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
4835 4874 list.add(listMap.iterator());
4836   - String xls="";
4837   - if(map.get("type").toString().equals("0")){
4838   - xls="waybill_minhang.xls";
4839   - }else{
4840   - xls="waybill_minhang_dl.xls";
  4875 + String xls = "";
  4876 + if (map.get("type").toString().equals("0")) {
  4877 + xls = "waybill_minhang.xls";
  4878 + } else {
  4879 + xls = "waybill_minhang_dl.xls";
4841 4880 }
4842 4881 map.put("sheetName", jName + "-" + clZbh + "-" + lpName);
4843   - ee.excelReplace(list, new Object[]{map}, path + "mould/"+xls,
  4882 + ee.excelReplace(list, new Object[]{map}, path + "mould/" + xls,
4844 4883 path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
4845 4884 }
4846 4885  
... ... @@ -4859,25 +4898,25 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4859 4898 while (true) {
4860 4899 String fileUrl = path + "行车路单" + sdfSimple.format(sdfMonth.parse(date));
4861 4900 // file = new File(fileUrl + (num == 0 ? "/" : "(" + num + ")/")); //新建文件夹
4862   - file = new File(fileUrl + (num == 0 ? ".xls" : "(" + num + ").xls")); //新建excel文件
4863   - if (file.exists()) { //判断是否已存在重名
  4901 + file = new File(fileUrl + (num == 0 ? ".xls" : "(" + num + ").xls")); //新建excel文件
  4902 + if (file.exists()) { //判断是否已存在重名
4864 4903 num++;
4865 4904 } else {
4866 4905 break;
4867 4906 }
4868 4907 }
4869 4908 // file.mkdirs(); //创建
4870   - List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
  4909 + List<ScheduleRealInfo> lists_line = scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
4871 4910 List<File> files = new ArrayList<File>();
4872   - for (List<String> list : lists){
4873   - List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
  4911 + for (List<String> list : lists) {
  4912 + List<ScheduleRealInfo> newList = new ArrayList<ScheduleRealInfo>();
4874 4913 String jName = list.get(0);
4875 4914 String clZbh = list.get(1);
4876 4915 String lpName = list.get(2);
4877   - String jGh =list.get(3);
  4916 + String jGh = list.get(3);
4878 4917 for (int i = 0; i < lists_line.size(); i++) {
4879   - ScheduleRealInfo s=lists_line.get(i);
4880   - if(s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){
  4918 + ScheduleRealInfo s = lists_line.get(i);
  4919 + if (s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)) {
4881 4920 newList.add(s);
4882 4921 }
4883 4922 }
... ... @@ -4886,10 +4925,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4886 4925 String fileName = file.getName();
4887 4926 files.add(temp);
4888 4927 }
4889   - for(int i = 1; i < files.size(); i++){
4890   - File file1 = files.get(0);
4891   - File file2 = files.get(i);
4892   - ee.copySheetByFile(file2, file1, 0, 145);
  4928 + for (int i = 1; i < files.size(); i++) {
  4929 + File file1 = files.get(0);
  4930 + File file2 = files.get(i);
  4931 + ee.copySheetByFile(file2, file1, 0, 145);
4893 4932 }
4894 4933 File newFile = files.get(0);
4895 4934 newFile.renameTo(file);
... ... @@ -4971,7 +5010,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4971 5010 if (i < smallList.size()) {
4972 5011 rightSch = smallList.get(i);
4973 5012 ts.add(rightSch);
4974   - } else{
  5013 + } else {
4975 5014 //不对称时多出来的
4976 5015 lpChangeByLeft(leftSch, largeList.get(i - 1), type);
4977 5016 ts.add(leftSch);
... ... @@ -4988,7 +5027,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4988 5027 }
4989 5028  
4990 5029 //重新计算路牌的起点应到时间
4991   - for(String lpName : lpSet){
  5030 + for (String lpName : lpSet) {
4992 5031 ts.addAll(dayOfSchedule.updateQdzTimePlan(lpName));
4993 5032 }
4994 5033  
... ... @@ -5018,7 +5057,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5018 5057 @Override
5019 5058 public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) {
5020 5059 //释放班次映射
5021   - if(type > 0) {
  5060 + if (type > 0) {
5022 5061 dayOfSchedule.removeNbbm2SchMapp(leftSch);
5023 5062 dayOfSchedule.removeNbbm2SchMapp(rightSch);
5024 5063 }
... ... @@ -5030,7 +5069,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5030 5069 leftData.appendTo(rightSch, type);
5031 5070 rightData.appendTo(leftSch, type);
5032 5071  
5033   - if(type > 0){
  5072 + if (type > 0) {
5034 5073 //重新映射
5035 5074 dayOfSchedule.addNbbm2SchMapp(leftSch);
5036 5075 dayOfSchedule.addNbbm2SchMapp(rightSch);
... ... @@ -5039,20 +5078,21 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5039 5078  
5040 5079 /**
5041 5080 * 更换左边班次的路牌,右边不变
  5081 + *
5042 5082 * @param leftSch
5043 5083 * @param rightSch
5044 5084 * @param type
5045 5085 */
5046 5086 public void lpChangeByLeft(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) {
5047 5087 //释放班次映射
5048   - if(type > 0)
  5088 + if (type > 0)
5049 5089 dayOfSchedule.removeNbbm2SchMapp(leftSch);
5050 5090  
5051 5091 LpData rightData = new LpData(rightSch);
5052 5092 rightData.appendTo(leftSch, type);
5053 5093  
5054 5094 //重新映射
5055   - if(type > 0)
  5095 + if (type > 0)
5056 5096 dayOfSchedule.addNbbm2SchMapp(leftSch);
5057 5097  
5058 5098 }
... ... @@ -5106,16 +5146,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5106 5146 List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx);
5107 5147  
5108 5148 ScheduleRealInfo sch;
5109   - for(String id : ids){
  5149 + for (String id : ids) {
5110 5150 sch = dayOfSchedule.get(Long.parseLong(id));
5111   - if(sch != null && sch.getStatus() == 0){
5112   - if(minute > 0){
  5151 + if (sch != null && sch.getStatus() == 0) {
  5152 + if (minute > 0) {
5113 5153 sch.setLateMinute(minute);
5114   - }
5115   - else if(minute == 0){
  5154 + } else if (minute == 0) {
5116 5155 LateAdjustHandle.remove(sch);
5117 5156 }
5118   - count ++;
  5157 + count++;
5119 5158 list.add(sch);
5120 5159 }
5121 5160 }
... ... @@ -5123,7 +5162,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5123 5162 rs.put("status", ResponseCode.SUCCESS);
5124 5163 rs.put("count", count);
5125 5164 rs.put("ts", list);
5126   - }catch (Exception e){
  5165 + } catch (Exception e) {
5127 5166 logger.error("", e);
5128 5167 rs.put("status", ResponseCode.ERROR);
5129 5168 rs.put("msg", e.getMessage());
... ... @@ -5138,36 +5177,36 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5138 5177 List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx);
5139 5178  
5140 5179 Collection<ScheduleRealInfo> all = LateAdjustHandle.allLateSch();
5141   - for(ScheduleRealInfo sch : all){
5142   - if(ids.indexOf(sch.getXlBm()) != -1){
  5180 + for (ScheduleRealInfo sch : all) {
  5181 + if (ids.indexOf(sch.getXlBm()) != -1) {
5143 5182 rs.add(sch);
5144 5183 }
5145 5184 }
5146 5185 return rs;
5147 5186 }
5148   -
5149   -
5150   - @Override
5151   - public List<Map<String, Object>> mileageReport(String gsdm,
5152   - String fgsdm, String line, String date, String date2) {
5153   -
5154   - String sql = "select * from calc_mileage where 1=1 " ;
5155   - if (!line.equals(" ")) {
5156   - sql = sql+" and line_code='"+ line+"' ";
5157   - }
5158   - sql = sql+" and DATE_FORMAT(rq,'%Y-%m-%d') between '"+ date+"' and '"+ date2+"'";
5159   - if (!gsdm.equals(" ")) {
5160   - sql = sql+" and company_id="+gsdm;
5161   - }
5162   - if (!gsdm.equals(" ")) {
5163   - sql = sql+" and sub_company_id="+fgsdm;
5164   - }
5165   - sql = sql+" order by line_code";
5166   - List<MileageReport> list = jdbcTemplate.query(sql,
  5187 +
  5188 +
  5189 + @Override
  5190 + public List<Map<String, Object>> mileageReport(String gsdm,
  5191 + String fgsdm, String line, String date, String date2) {
  5192 +
  5193 + String sql = "select * from calc_mileage where 1=1 ";
  5194 + if (!line.equals(" ")) {
  5195 + sql = sql + " and line_code='" + line + "' ";
  5196 + }
  5197 + sql = sql + " and DATE_FORMAT(rq,'%Y-%m-%d') between '" + date + "' and '" + date2 + "'";
  5198 + if (!gsdm.equals(" ")) {
  5199 + sql = sql + " and company_id=" + gsdm;
  5200 + }
  5201 + if (!gsdm.equals(" ")) {
  5202 + sql = sql + " and sub_company_id=" + fgsdm;
  5203 + }
  5204 + sql = sql + " order by line_code";
  5205 + List<MileageReport> list = jdbcTemplate.query(sql,
5167 5206 new RowMapper<MileageReport>() {
5168 5207 @Override
5169 5208 public MileageReport mapRow(ResultSet rs, int rowNum) throws SQLException {
5170   - MileageReport mr = new MileageReport();
  5209 + MileageReport mr = new MileageReport();
5171 5210 mr.setCompanyName(rs.getString("company_name"));
5172 5211 mr.setSubCompanyName(rs.getString("sub_company_name"));
5173 5212 mr.setLineName(rs.getString("line_name"));
... ... @@ -5185,189 +5224,189 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
5185 5224 return mr;
5186 5225 }
5187 5226 });
5188   - List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
5189   - double sjyygl = 0.0;
5190   - double sjksgl = 0.0;
5191   - double zgl = 0.0;
5192   - double sddfgl = 0.0;
5193   - double zddfgl = 0.0;
5194   - double wqwxhgl = 0.0;
5195   - double bfwxhgl = 0.0;
5196   - double pygl = 0.0;
5197   - double ljgl = 0.0;
5198   - double zrwgl = 0.0;
5199   - for(MileageReport mr:list) {
5200   - Map<String, Object> resMap = new HashMap<String, Object>();
5201   - resMap.put("gsName", mr.getCompanyName());
5202   - resMap.put("fgsName", mr.getSubCompanyName());
5203   - resMap.put("xlName", mr.getLineName());
5204   - resMap.put("sjyygl", mr.getSjyygl());
5205   - resMap.put("sjksgl", mr.getSjksgl());
5206   - resMap.put("zgl", mr.getZgl());
5207   - resMap.put("sddfgl", mr.getSddfgl());
5208   - resMap.put("zddfgl", mr.getZddfgl());
5209   - resMap.put("wqwxhgl", mr.getWqwxhgl());
5210   - resMap.put("bfwxhgl", mr.getBfwxhgl());
5211   - resMap.put("pygl", mr.getPygl());
5212   - resMap.put("ljgl", mr.getLjgl());
5213   - resMap.put("zrwgl", mr.getZrwgl());
5214   - resMap.put("other", mr.getOther());
5215   - lMap.add(resMap);
5216   - sjyygl = Arith.add(sjyygl,mr.getSjyygl());
5217   - sjksgl = Arith.add(sjksgl,mr.getSjksgl());
5218   - zgl = Arith.add(zgl,mr.getZgl());
5219   - sddfgl = Arith.add(sddfgl,mr.getSddfgl());
5220   - zddfgl = Arith.add(zddfgl,mr.getZddfgl());
5221   - wqwxhgl = Arith.add(wqwxhgl,mr.getWqwxhgl());
5222   - bfwxhgl = Arith.add(bfwxhgl,mr.getBfwxhgl());
5223   - pygl = Arith.add(pygl,mr.getPygl());
5224   - ljgl = Arith.add(ljgl,mr.getLjgl());
5225   - zrwgl = Arith.add(zrwgl,mr.getZrwgl());
5226   - }
5227   - Map<String, Object> resMap = new HashMap<String, Object>();
5228   - resMap.put("xlName", "合计");
5229   - resMap.put("sjyygl", sjyygl);
5230   - resMap.put("sjksgl", sjksgl);
5231   - resMap.put("zgl", zgl);
5232   - resMap.put("sddfgl", sddfgl);
5233   - resMap.put("zddfgl", zddfgl);
5234   - resMap.put("wqwxhgl", wqwxhgl);
5235   - resMap.put("bfwxhgl", bfwxhgl);
5236   - resMap.put("pygl", pygl);
5237   - resMap.put("ljgl", ljgl);
5238   - resMap.put("zrwgl", zrwgl);
5239   - resMap.put("other", null);
5240   - lMap.add(resMap);
5241   - return lMap;
5242   - }
5243   -
5244   - @Override
5245   - public List<Map<String, Object>> scheduleCorrectionReport(String gsdm,
5246   - String fgsdm, String line, String date, String date2) {
5247   -
5248   - String sql = "select * from calc_schedule where 1=1 " ;
5249   - if (!line.equals(" ")) {
5250   - sql = sql+" and line_code='"+ line+"' ";
5251   - }
5252   - sql = sql+" and DATE_FORMAT(rq,'%Y-%m-%d') between '"+ date+"' and '"+ date2+"'";
5253   - if (!gsdm.equals(" ")) {
5254   - sql = sql+" and company_id="+gsdm;
5255   - }
5256   - if (!gsdm.equals(" ")) {
5257   - sql = sql+" and sub_company_id="+fgsdm;
5258   - }
5259   - sql = sql+" order by line_code";
5260   - List<ScheduleCorrectionReport> list = jdbcTemplate.query(sql,
5261   - new RowMapper<ScheduleCorrectionReport>() {
5262   - @Override
5263   - public ScheduleCorrectionReport mapRow(ResultSet rs, int rowNum) throws SQLException {
5264   - ScheduleCorrectionReport sReport = new ScheduleCorrectionReport();
5265   - sReport.setCompanyName(rs.getString("company_name"));
5266   - sReport.setSubCompanyName(rs.getString("sub_company_name"));
5267   - sReport.setLineName(rs.getString("line_name"));
5268   - sReport.setSjyybc(rs.getInt("sjyybc"));
5269   - sReport.setSjksbc(rs.getInt("sjksbc"));
5270   - sReport.setZbc(rs.getInt("zyybc"));
5271   - sReport.setZddfbc(rs.getInt("zddfbc"));
5272   - sReport.setSddfbc(rs.getInt("sddfbc"));
5273   - sReport.setWqwxhbc(rs.getInt("wqwxhbc"));
5274   - sReport.setBfwxhbc(rs.getInt("bfwxhbc"));
5275   - sReport.setPybc(rs.getInt("pybc"));
5276   - sReport.setLjbc(rs.getInt("ljbc"));
5277   - sReport.setZrwbc(rs.getInt("zrwbc"));
5278   - sReport.setOther(rs.getString("other"));
5279   - return sReport;
5280   - }
5281   - });
5282   - List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
5283   - int sjyybc = 0;
5284   - int sjksbc = 0;
5285   - int zbc = 0;
5286   - int sddfbc = 0;
5287   - int zddfbc = 0;
5288   - int wqwxhbc = 0;
5289   - int bfwxhbc = 0;
5290   - int pybc = 0;
5291   - int ljbc = 0;
5292   - int zrwbc = 0;
5293   - for(ScheduleCorrectionReport sReport:list) {
5294   - Map<String, Object> resMap = new HashMap<String, Object>();
5295   - resMap.put("gsName", sReport.getCompanyName());
5296   - resMap.put("fgsName", sReport.getSubCompanyName());
5297   - resMap.put("xlName", sReport.getLineName());
5298   - resMap.put("sjyybc", sReport.getSjyybc());
5299   - resMap.put("sjksbc", sReport.getSjksbc());
5300   - resMap.put("zbc", sReport.getZbc());
5301   - resMap.put("sddfbc", sReport.getSddfbc());
5302   - resMap.put("zddfbc", sReport.getZddfbc());
5303   - resMap.put("wqwxhbc", sReport.getWqwxhbc());
5304   - resMap.put("bfwxhbc", sReport.getBfwxhbc());
5305   - resMap.put("pybc", sReport.getPybc());
5306   - resMap.put("ljbc", sReport.getLjbc());
5307   - resMap.put("zrwbc", sReport.getZrwbc());
5308   - resMap.put("other", sReport.getOther());
5309   - lMap.add(resMap);
5310   - sjyybc = sjyybc + sReport.getSjyybc();
5311   - sjksbc = sjksbc + sReport.getSjksbc();
5312   - zbc = zbc + sReport.getZbc();
5313   - sddfbc = sddfbc + sReport.getSddfbc();
5314   - zddfbc = zddfbc + sReport.getZddfbc();
5315   - wqwxhbc = wqwxhbc + sReport.getWqwxhbc();
5316   - bfwxhbc = bfwxhbc + sReport.getBfwxhbc();
5317   - pybc = pybc + sReport.getPybc();
5318   - ljbc = ljbc + sReport.getLjbc();
5319   - zrwbc = zrwbc + sReport.getZrwbc();
5320   - }
5321   - Map<String, Object> resMap = new HashMap<String, Object>();
5322   - resMap.put("xlName", "合计");
5323   - resMap.put("sjyybc", sjyybc);
5324   - resMap.put("sjksbc", sjksbc);
5325   - resMap.put("zbc", zbc);
5326   - resMap.put("sddfbc", sddfbc);
5327   - resMap.put("zddfbc", zddfbc);
5328   - resMap.put("wqwxhbc", wqwxhbc);
5329   - resMap.put("bfwxhbc", bfwxhbc);
5330   - resMap.put("pybc", pybc);
5331   - resMap.put("ljbc", ljbc);
5332   - resMap.put("zrwbc", zrwbc);
5333   - resMap.put("other", null);
5334   - lMap.add(resMap);
5335   - return lMap;
5336   - }
  5227 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  5228 + double sjyygl = 0.0;
  5229 + double sjksgl = 0.0;
  5230 + double zgl = 0.0;
  5231 + double sddfgl = 0.0;
  5232 + double zddfgl = 0.0;
  5233 + double wqwxhgl = 0.0;
  5234 + double bfwxhgl = 0.0;
  5235 + double pygl = 0.0;
  5236 + double ljgl = 0.0;
  5237 + double zrwgl = 0.0;
  5238 + for (MileageReport mr : list) {
  5239 + Map<String, Object> resMap = new HashMap<String, Object>();
  5240 + resMap.put("gsName", mr.getCompanyName());
  5241 + resMap.put("fgsName", mr.getSubCompanyName());
  5242 + resMap.put("xlName", mr.getLineName());
  5243 + resMap.put("sjyygl", mr.getSjyygl());
  5244 + resMap.put("sjksgl", mr.getSjksgl());
  5245 + resMap.put("zgl", mr.getZgl());
  5246 + resMap.put("sddfgl", mr.getSddfgl());
  5247 + resMap.put("zddfgl", mr.getZddfgl());
  5248 + resMap.put("wqwxhgl", mr.getWqwxhgl());
  5249 + resMap.put("bfwxhgl", mr.getBfwxhgl());
  5250 + resMap.put("pygl", mr.getPygl());
  5251 + resMap.put("ljgl", mr.getLjgl());
  5252 + resMap.put("zrwgl", mr.getZrwgl());
  5253 + resMap.put("other", mr.getOther());
  5254 + lMap.add(resMap);
  5255 + sjyygl = Arith.add(sjyygl, mr.getSjyygl());
  5256 + sjksgl = Arith.add(sjksgl, mr.getSjksgl());
  5257 + zgl = Arith.add(zgl, mr.getZgl());
  5258 + sddfgl = Arith.add(sddfgl, mr.getSddfgl());
  5259 + zddfgl = Arith.add(zddfgl, mr.getZddfgl());
  5260 + wqwxhgl = Arith.add(wqwxhgl, mr.getWqwxhgl());
  5261 + bfwxhgl = Arith.add(bfwxhgl, mr.getBfwxhgl());
  5262 + pygl = Arith.add(pygl, mr.getPygl());
  5263 + ljgl = Arith.add(ljgl, mr.getLjgl());
  5264 + zrwgl = Arith.add(zrwgl, mr.getZrwgl());
  5265 + }
  5266 + Map<String, Object> resMap = new HashMap<String, Object>();
  5267 + resMap.put("xlName", "合计");
  5268 + resMap.put("sjyygl", sjyygl);
  5269 + resMap.put("sjksgl", sjksgl);
  5270 + resMap.put("zgl", zgl);
  5271 + resMap.put("sddfgl", sddfgl);
  5272 + resMap.put("zddfgl", zddfgl);
  5273 + resMap.put("wqwxhgl", wqwxhgl);
  5274 + resMap.put("bfwxhgl", bfwxhgl);
  5275 + resMap.put("pygl", pygl);
  5276 + resMap.put("ljgl", ljgl);
  5277 + resMap.put("zrwgl", zrwgl);
  5278 + resMap.put("other", null);
  5279 + lMap.add(resMap);
  5280 + return lMap;
  5281 + }
  5282 +
  5283 + @Override
  5284 + public List<Map<String, Object>> scheduleCorrectionReport(String gsdm,
  5285 + String fgsdm, String line, String date, String date2) {
  5286 +
  5287 + String sql = "select * from calc_schedule where 1=1 ";
  5288 + if (!line.equals(" ")) {
  5289 + sql = sql + " and line_code='" + line + "' ";
  5290 + }
  5291 + sql = sql + " and DATE_FORMAT(rq,'%Y-%m-%d') between '" + date + "' and '" + date2 + "'";
  5292 + if (!gsdm.equals(" ")) {
  5293 + sql = sql + " and company_id=" + gsdm;
  5294 + }
  5295 + if (!gsdm.equals(" ")) {
  5296 + sql = sql + " and sub_company_id=" + fgsdm;
  5297 + }
  5298 + sql = sql + " order by line_code";
  5299 + List<ScheduleCorrectionReport> list = jdbcTemplate.query(sql,
  5300 + new RowMapper<ScheduleCorrectionReport>() {
  5301 + @Override
  5302 + public ScheduleCorrectionReport mapRow(ResultSet rs, int rowNum) throws SQLException {
  5303 + ScheduleCorrectionReport sReport = new ScheduleCorrectionReport();
  5304 + sReport.setCompanyName(rs.getString("company_name"));
  5305 + sReport.setSubCompanyName(rs.getString("sub_company_name"));
  5306 + sReport.setLineName(rs.getString("line_name"));
  5307 + sReport.setSjyybc(rs.getInt("sjyybc"));
  5308 + sReport.setSjksbc(rs.getInt("sjksbc"));
  5309 + sReport.setZbc(rs.getInt("zyybc"));
  5310 + sReport.setZddfbc(rs.getInt("zddfbc"));
  5311 + sReport.setSddfbc(rs.getInt("sddfbc"));
  5312 + sReport.setWqwxhbc(rs.getInt("wqwxhbc"));
  5313 + sReport.setBfwxhbc(rs.getInt("bfwxhbc"));
  5314 + sReport.setPybc(rs.getInt("pybc"));
  5315 + sReport.setLjbc(rs.getInt("ljbc"));
  5316 + sReport.setZrwbc(rs.getInt("zrwbc"));
  5317 + sReport.setOther(rs.getString("other"));
  5318 + return sReport;
  5319 + }
  5320 + });
  5321 + List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
  5322 + int sjyybc = 0;
  5323 + int sjksbc = 0;
  5324 + int zbc = 0;
  5325 + int sddfbc = 0;
  5326 + int zddfbc = 0;
  5327 + int wqwxhbc = 0;
  5328 + int bfwxhbc = 0;
  5329 + int pybc = 0;
  5330 + int ljbc = 0;
  5331 + int zrwbc = 0;
  5332 + for (ScheduleCorrectionReport sReport : list) {
  5333 + Map<String, Object> resMap = new HashMap<String, Object>();
  5334 + resMap.put("gsName", sReport.getCompanyName());
  5335 + resMap.put("fgsName", sReport.getSubCompanyName());
  5336 + resMap.put("xlName", sReport.getLineName());
  5337 + resMap.put("sjyybc", sReport.getSjyybc());
  5338 + resMap.put("sjksbc", sReport.getSjksbc());
  5339 + resMap.put("zbc", sReport.getZbc());
  5340 + resMap.put("sddfbc", sReport.getSddfbc());
  5341 + resMap.put("zddfbc", sReport.getZddfbc());
  5342 + resMap.put("wqwxhbc", sReport.getWqwxhbc());
  5343 + resMap.put("bfwxhbc", sReport.getBfwxhbc());
  5344 + resMap.put("pybc", sReport.getPybc());
  5345 + resMap.put("ljbc", sReport.getLjbc());
  5346 + resMap.put("zrwbc", sReport.getZrwbc());
  5347 + resMap.put("other", sReport.getOther());
  5348 + lMap.add(resMap);
  5349 + sjyybc = sjyybc + sReport.getSjyybc();
  5350 + sjksbc = sjksbc + sReport.getSjksbc();
  5351 + zbc = zbc + sReport.getZbc();
  5352 + sddfbc = sddfbc + sReport.getSddfbc();
  5353 + zddfbc = zddfbc + sReport.getZddfbc();
  5354 + wqwxhbc = wqwxhbc + sReport.getWqwxhbc();
  5355 + bfwxhbc = bfwxhbc + sReport.getBfwxhbc();
  5356 + pybc = pybc + sReport.getPybc();
  5357 + ljbc = ljbc + sReport.getLjbc();
  5358 + zrwbc = zrwbc + sReport.getZrwbc();
  5359 + }
  5360 + Map<String, Object> resMap = new HashMap<String, Object>();
  5361 + resMap.put("xlName", "合计");
  5362 + resMap.put("sjyybc", sjyybc);
  5363 + resMap.put("sjksbc", sjksbc);
  5364 + resMap.put("zbc", zbc);
  5365 + resMap.put("sddfbc", sddfbc);
  5366 + resMap.put("zddfbc", zddfbc);
  5367 + resMap.put("wqwxhbc", wqwxhbc);
  5368 + resMap.put("bfwxhbc", bfwxhbc);
  5369 + resMap.put("pybc", pybc);
  5370 + resMap.put("ljbc", ljbc);
  5371 + resMap.put("zrwbc", zrwbc);
  5372 + resMap.put("other", null);
  5373 + lMap.add(resMap);
  5374 + return lMap;
  5375 + }
5337 5376 }
5338 5377  
5339   -class AccountMap implements Comparator<Map<String, Object>>{
5340   - @Override
5341   - public int compare(Map<String, Object> o1, Map<String, Object> o2) {
5342   - // TODO Auto-generated method stub
5343   - return o1.get("clZbh").toString().compareTo(o2.get("clZbh").toString());
5344   - }
  5378 +class AccountMap implements Comparator<Map<String, Object>> {
  5379 + @Override
  5380 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  5381 + // TODO Auto-generated method stub
  5382 + return o1.get("clZbh").toString().compareTo(o2.get("clZbh").toString());
  5383 + }
5345 5384 }
5346 5385  
5347   -class AccountMap2 implements Comparator<Map<String, Object>>{
5348   - @Override
5349   - public int compare(Map<String, Object> o1, Map<String, Object> o2) {
5350   - // TODO Auto-generated method stub
5351   - return o2.get("clZbh").toString().compareTo(o1.get("clZbh").toString());
5352   - }
  5386 +class AccountMap2 implements Comparator<Map<String, Object>> {
  5387 + @Override
  5388 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  5389 + // TODO Auto-generated method stub
  5390 + return o2.get("clZbh").toString().compareTo(o1.get("clZbh").toString());
  5391 + }
5353 5392 }
5354 5393  
5355   -class AccountXlbm implements Comparator<Map<String, Object>>{
5356   - @Override
5357   - public int compare(Map<String, Object> o1, Map<String, Object> o2) {
5358   - // TODO Auto-generated method stub
  5394 +class AccountXlbm implements Comparator<Map<String, Object>> {
  5395 + @Override
  5396 + public int compare(Map<String, Object> o1, Map<String, Object> o2) {
  5397 + // TODO Auto-generated method stub
5359 5398 // PinyinHelper.convertToPinyinString(ppy.getName(),
5360 5399 // "" , PinyinFormat.WITHOUT_TONE)
5361   - return o1.get("xlNamePy").toString().compareTo(
5362   - o2.get("xlNamePy").toString());
5363   - }
  5400 + return o1.get("xlNamePy").toString().compareTo(
  5401 + o2.get("xlNamePy").toString());
  5402 + }
5364 5403 }
5365 5404  
5366   -class compareFcsjType implements Comparator<ScheduleRealInfo>{
5367   - @Override
5368   - public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
5369   - // TODO Auto-generated method stub
5370   - return (o1.getFcsjT()+o1.getRemark()).compareTo(o2.getFcsjT()+o2.getRemark());
5371   - }
  5405 +class compareFcsjType implements Comparator<ScheduleRealInfo> {
  5406 + @Override
  5407 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  5408 + // TODO Auto-generated method stub
  5409 + return (o1.getFcsjT() + o1.getRemark()).compareTo(o2.getFcsjT() + o2.getRemark());
  5410 + }
5372 5411  
5373 5412 }
... ...
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
... ... @@ -1321,17 +1321,19 @@ public class CulateMileageServiceImpl implements CulateMileageService{
1321 1321 for (int j = 0; j < list.size(); j++) {
1322 1322 ScheduleRealInfo sinfo=list.get(j);
1323 1323 try {
1324   - if(sinfo.getXlBm().equals(lineCode)){
1325   - ScheduleRealInfo s=checkBc(sinfo);
1326   - String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual();
1327   - if(!fcsj.equals("")){
1328   - Long fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime();
1329   - s.setFcsjActualTime(fcsjAcual);
1330   - s.setFcsjActual(fcsj);
1331   - listInfo.add(s);
  1324 + if(!sinfo.getBcType().equals("in")&&!sinfo.getBcType().equals("out")&&!sinfo.getBcType().equals("ldks")){
  1325 + if(sinfo.getXlBm().equals(lineCode)){
  1326 + ScheduleRealInfo s=checkBc(sinfo);
  1327 + String fcsj=s.getFcsjActual()==null?"":s.getFcsjActual();
  1328 + if(!fcsj.equals("")){
  1329 + Long fcsjAcual = sdf.parse(s.getRealExecDate() + " " + s.getFcsjActual()).getTime();
  1330 + s.setFcsjActualTime(fcsjAcual);
  1331 + s.setFcsjActual(fcsj);
  1332 + listInfo.add(s);
  1333 + }
  1334 +
  1335 + }
1332 1336 }
1333   -
1334   - }
1335 1337 } catch (ParseException e) {
1336 1338 // TODO Auto-generated catch block
1337 1339 e.printStackTrace();
... ... @@ -1384,7 +1386,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
1384 1386 if(s.getXlDir().equals("0")){
1385 1387 listInfo0.add(s);
1386 1388 }else{
1387   - listInfo0.add(s);
  1389 + listInfo1.add(s);
1388 1390 }
1389 1391  
1390 1392 }
... ... @@ -1394,76 +1396,80 @@ public class CulateMileageServiceImpl implements CulateMileageService{
1394 1396 int djgcsq=0;
1395 1397 long djcsj=0l;
1396 1398 for (int i = 0; i < listInfo0.size(); i++) {
1397   - ScheduleRealInfo s=listInfo.get(i);
  1399 + ScheduleRealInfo s=listInfo0.get(i);
1398 1400 Long fcsjTime=s.getFcsjActualTime();
1399 1401 String time=s.getFcsjActual();
1400 1402 String[] fcsjStr = time.split(":");
1401 1403 long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
1402   - if(i<listInfo.size()-1){
  1404 + if(i<listInfo0.size()-1){
1403 1405 Long djg=0l;
1404   - Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
1405   - if((fcsj>=zgf1&&fcsj<=zgf2)){
1406   - djg = (long) (peak*60*1000);
1407   - if(fscjNext-fcsjTime>djg){
1408   - djgcsz ++;
1409   - djgcsq ++;
1410   - if(fscjNext-fcsjTime>djcsj){
1411   - djcsj=(fscjNext-fcsjTime)/60000;
  1406 + if(s.getScheduleDateStr().equals(listInfo0.get(i+1).getScheduleDateStr())){
  1407 + Long fscjNext=listInfo0.get(i+1).getFcsjActualTime();
  1408 + if((fcsj>=zgf1&&fcsj<=zgf2)){
  1409 + djg = (long) (peak*60*1000);
  1410 + if(fscjNext-fcsjTime>djg){
  1411 + djgcsz ++;
  1412 + djgcsq ++;
  1413 + if((fscjNext-fcsjTime)/60000>djcsj){
  1414 + djcsj=(fscjNext-fcsjTime)/60000;
  1415 + }
1412 1416 }
1413   - }
1414   - }else if((fcsj>=wgf1&&fcsj<=wgf2)){
1415   - djg = (long) (peak*60*1000);
1416   - if(fscjNext-fcsjTime>djg){
1417   - djgcsw ++;
1418   - djgcsq ++;
1419   - if(fscjNext-fcsjTime>djcsj){
1420   - djcsj=(fscjNext-fcsjTime)/60000;
  1417 + }else if((fcsj>=wgf1&&fcsj<=wgf2)){
  1418 + djg = (long) (peak*60*1000);
  1419 + if(fscjNext-fcsjTime>djg){
  1420 + djgcsw ++;
  1421 + djgcsq ++;
  1422 + if((fscjNext-fcsjTime)/60000>djcsj){
  1423 + djcsj=(fscjNext-fcsjTime)/60000;
  1424 + }
1421 1425 }
1422   - }
1423   - }else{
1424   - djg = (long) (trough*60*1000);
1425   - if(fscjNext-fcsjTime>djg){
1426   - djgcsq ++;
1427   - if(fscjNext-fcsjTime>djcsj){
1428   - djcsj=(fscjNext-fcsjTime)/60000;
  1426 + }else{
  1427 + djg = (long) (trough*60*1000);
  1428 + if(fscjNext-fcsjTime>djg){
  1429 + djgcsq ++;
  1430 + if((fscjNext-fcsjTime)/60000>djcsj){
  1431 + djcsj=(fscjNext-fcsjTime)/60000;
  1432 + }
1429 1433 }
1430 1434 }
1431 1435 }
1432 1436 }
1433 1437 }
1434 1438 for (int i = 0; i < listInfo1.size(); i++) {
1435   - ScheduleRealInfo s=listInfo.get(i);
  1439 + ScheduleRealInfo s=listInfo1.get(i);
1436 1440 Long fcsjTime=s.getFcsjActualTime();
1437 1441 String time=s.getFcsjActual();
1438 1442 String[] fcsjStr = time.split(":");
1439 1443 long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
1440   - if(i<listInfo.size()-1){
  1444 + if(i<listInfo1.size()-1){
1441 1445 Long djg=0l;
1442   - Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
1443   - if(fcsj>=zgf1&&fcsj<=zgf2){
1444   - djg = (long) (peak*60*1000);
1445   - if(fscjNext-fcsjTime>djg){
1446   - djgcsz ++;
1447   - djgcsq ++;
1448   - if(fscjNext-fcsjTime>djcsj){
1449   - djcsj=(fscjNext-fcsjTime)/60000;
  1446 + if(s.getScheduleDateStr().equals(listInfo1.get(i+1).getScheduleDateStr())){
  1447 + Long fscjNext=listInfo1.get(i+1).getFcsjActualTime();
  1448 + if(fcsj>=zgf1&&fcsj<=zgf2){
  1449 + djg = (long) (peak*60*1000);
  1450 + if(fscjNext-fcsjTime>djg){
  1451 + djgcsz ++;
  1452 + djgcsq ++;
  1453 + if((fscjNext-fcsjTime)/60000>djcsj){
  1454 + djcsj=(fscjNext-fcsjTime)/60000;
  1455 + }
1450 1456 }
1451   - }
1452   - }else if(fcsj>=wgf1&&fcsj<=wgf2){
1453   - djg = (long) (peak*60*1000);
1454   - if(fscjNext-fcsjTime>djg){
1455   - djgcsw ++;
1456   - djgcsq ++;
1457   - if(fscjNext-fcsjTime>djcsj){
1458   - djcsj=(fscjNext-fcsjTime)/60000;
  1457 + }else if(fcsj>=wgf1&&fcsj<=wgf2){
  1458 + djg = (long) (peak*60*1000);
  1459 + if(fscjNext-fcsjTime>djg){
  1460 + djgcsw ++;
  1461 + djgcsq ++;
  1462 + if((fscjNext-fcsjTime)/60000>djcsj){
  1463 + djcsj=(fscjNext-fcsjTime)/60000;
  1464 + }
1459 1465 }
1460   - }
1461   - }else{
1462   - djg = (long) (trough*60*1000);
1463   - if(fscjNext-fcsjTime>djg){
1464   - djgcsq ++;
1465   - if(fscjNext-fcsjTime>djcsj){
1466   - djcsj=(fscjNext-fcsjTime)/60000;
  1466 + }else{
  1467 + djg = (long) (trough*60*1000);
  1468 + if(fscjNext-fcsjTime>djg){
  1469 + djgcsq ++;
  1470 + if((fscjNext-fcsjTime)/60000>djcsj){
  1471 + djcsj=(fscjNext-fcsjTime)/60000;
  1472 + }
1467 1473 }
1468 1474 }
1469 1475 }
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -229,7 +229,7 @@ public class ReportServiceImpl implements ReportService{
229 229  
230 230  
231 231 public List<ArrivalInfo> load2(String line,Long date1,Long date2,Date dates1,Date dates2,String zd,String zdlx,String fcsj){
232   - List<ArrivalInfo> list = null;
  232 + List<ArrivalInfo> list = new ArrayList<ArrivalInfo>();
233 233 Calendar cal = Calendar.getInstance();
234 234 cal.setTime(dates1);
235 235 //周数,表分区字段
... ... @@ -295,6 +295,7 @@ public class ReportServiceImpl implements ReportService{
295 295 }
296 296  
297 297 if (type != null && type.length() != 0 && type.equals("export_msg")) {
  298 + String lineName = BasicData.lineCode2NameMap.get(line);
298 299 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
299 300 sdfSimple = new SimpleDateFormat("yyyyMMdd");
300 301 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -316,7 +317,8 @@ public class ReportServiceImpl implements ReportService{
316 317 listI.add(newList.iterator());
317 318 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
318 319 ee.excelReplace(listI, new Object[]{m}, path + "mould/message.xls",
319   - path + "export/调度消息分析" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  320 + path + "export/" + sdfSimple.format(sdfMonth.parse(date))
  321 + + "-" + lineName + "-调度消息分析.xls");
320 322 } catch (Exception e) {
321 323 // TODO: handle exception
322 324 e.printStackTrace();
... ... @@ -2482,6 +2484,8 @@ public class ReportServiceImpl implements ReportService{
2482 2484 lMap.add(newMap);
2483 2485 }
2484 2486 if(type.equals("export")){
  2487 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  2488 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
2485 2489 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
2486 2490 Map<String, Object> m = new HashMap<String, Object>();
2487 2491 m.put("date", date);
... ... @@ -2495,10 +2499,17 @@ public class ReportServiceImpl implements ReportService{
2495 2499 }
2496 2500 ReportUtils ee = new ReportUtils();
2497 2501 try {
  2502 + String dateTime = "";
  2503 + if(date.equals(date2)){
  2504 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  2505 + } else {
  2506 + dateTime = sdfSimple.format(sdfMonth.parse(date))
  2507 + +"-"+sdfSimple.format(sdfMonth.parse(date2));
  2508 + }
2498 2509 listI.add(lMap.iterator());
2499 2510 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2500 2511 ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
2501   - path + "export/线路公里统计表.xls");
  2512 + path + "export/"+dateTime+"-"+xlName+"-线路公里统计表.xls");
2502 2513 } catch (Exception e) {
2503 2514 // TODO: handle exception
2504 2515 e.printStackTrace();
... ... @@ -2962,6 +2973,8 @@ public class ReportServiceImpl implements ReportService{
2962 2973  
2963 2974 }
2964 2975 if(type.equals("export")){
  2976 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  2977 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
2965 2978 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
2966 2979 Map<String, Object> m = new HashMap<String, Object>();
2967 2980 m.put("date", date);
... ... @@ -2986,10 +2999,17 @@ public class ReportServiceImpl implements ReportService{
2986 2999 }
2987 3000 ReportUtils ee = new ReportUtils();
2988 3001 try {
  3002 + String dateTime = "";
  3003 + if(date.equals(date2)){
  3004 + dateTime = sdfSimple.format(sdfMonth.parse(date));
  3005 + } else {
  3006 + dateTime = sdfSimple.format(sdfMonth.parse(date))
  3007 + +"-"+sdfSimple.format(sdfMonth.parse(date2));
  3008 + }
2989 3009 listI.add(lMap.iterator());
2990 3010 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
2991 3011 ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls,
2992   - path + "export/路单数据统计表.xls");
  3012 + path + "export/"+dateTime+"-"+xlName+"-路单数据统计表.xls");
2993 3013 } catch (Exception e) {
2994 3014 // TODO: handle exception
2995 3015 e.printStackTrace();
... ... @@ -3304,7 +3324,7 @@ public class ReportServiceImpl implements ReportService{
3304 3324 if(s.getXlDir().equals("0")){
3305 3325 listInfo0.add(s);
3306 3326 }else{
3307   - listInfo0.add(s);
  3327 + listInfo1.add(s);
3308 3328 }
3309 3329  
3310 3330 }
... ... @@ -3317,14 +3337,14 @@ public class ReportServiceImpl implements ReportService{
3317 3337 int djgcs=0;
3318 3338 List<Map<String, Object>> mapList=new ArrayList<Map<String, Object>>();
3319 3339 for (int i = 0; i < listInfo0.size(); i++) {
3320   - ScheduleRealInfo s=listInfo.get(i);
  3340 + ScheduleRealInfo s=listInfo0.get(i);
3321 3341 Long fcsjTime=s.getFcsjActualTime();
3322 3342 String time=s.getFcsjActual();
3323 3343 String[] fcsjStr = time.split(":");
3324 3344 long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
3325   - if(i<listInfo.size()-1){
  3345 + if(i<listInfo0.size()-1){
3326 3346 Long djg=0l;
3327   - Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
  3347 + Long fscjNext=listInfo0.get(i+1).getFcsjActualTime();
3328 3348 if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){
3329 3349 djg = (long) (peak*60*1000);
3330 3350 if(fscjNext-fcsjTime>djg){
... ... @@ -3335,8 +3355,8 @@ public class ReportServiceImpl implements ReportService{
3335 3355 m.put("djgde", grade);
3336 3356 m.put("qJh", s.getFcsj());
3337 3357 m.put("qSj", time);
3338   - m.put("hJh", listInfo.get(i+1).getFcsj());
3339   - m.put("hSj", listInfo.get(i+1).getFcsjActual());
  3358 + m.put("hJh", listInfo0.get(i+1).getFcsj());
  3359 + m.put("hSj", listInfo0.get(i+1).getFcsjActual());
3340 3360 m.put("djgsj", peak);
3341 3361 m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
3342 3362 mapList.add(m);
... ... @@ -3351,8 +3371,8 @@ public class ReportServiceImpl implements ReportService{
3351 3371 m.put("djgde", grade);
3352 3372 m.put("qJh", s.getFcsj());
3353 3373 m.put("qSj", time);
3354   - m.put("hJh", listInfo.get(i+1).getFcsj());
3355   - m.put("hSj", listInfo.get(i+1).getFcsjActual());
  3374 + m.put("hJh", listInfo0.get(i+1).getFcsj());
  3375 + m.put("hSj", listInfo0.get(i+1).getFcsjActual());
3356 3376 m.put("djgsj", trough);
3357 3377 m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
3358 3378 mapList.add(m);
... ... @@ -3362,14 +3382,14 @@ public class ReportServiceImpl implements ReportService{
3362 3382 }
3363 3383  
3364 3384 for (int i = 0; i < listInfo1.size(); i++) {
3365   - ScheduleRealInfo s=listInfo.get(i);
  3385 + ScheduleRealInfo s=listInfo1.get(i);
3366 3386 Long fcsjTime=s.getFcsjActualTime();
3367 3387 String time=s.getFcsjActual();
3368 3388 String[] fcsjStr = time.split(":");
3369 3389 long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]);
3370   - if(i<listInfo.size()-1){
  3390 + if(i<listInfo1.size()-1){
3371 3391 Long djg=0l;
3372   - Long fscjNext=listInfo.get(i+1).getFcsjActualTime();
  3392 + Long fscjNext=listInfo1.get(i+1).getFcsjActualTime();
3373 3393 if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){
3374 3394 djg = (long) (peak*60*1000);
3375 3395 if(fscjNext-fcsjTime>djg){
... ... @@ -3380,8 +3400,8 @@ public class ReportServiceImpl implements ReportService{
3380 3400 m.put("djgde", grade);
3381 3401 m.put("qJh", s.getFcsj());
3382 3402 m.put("qSj", time);
3383   - m.put("hJh", listInfo.get(i+1).getFcsj());
3384   - m.put("hSj", listInfo.get(i+1).getFcsjActual());
  3403 + m.put("hJh", listInfo1.get(i+1).getFcsj());
  3404 + m.put("hSj", listInfo1.get(i+1).getFcsjActual());
3385 3405 m.put("djgsj", peak);
3386 3406 m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
3387 3407 mapList.add(m);
... ... @@ -3396,8 +3416,8 @@ public class ReportServiceImpl implements ReportService{
3396 3416 m.put("djgde", grade);
3397 3417 m.put("qJh", s.getFcsj());
3398 3418 m.put("qSj", time);
3399   - m.put("hJh", listInfo.get(i+1).getFcsj());
3400   - m.put("hSj", listInfo.get(i+1).getFcsjActual());
  3419 + m.put("hJh", listInfo1.get(i+1).getFcsj());
  3420 + m.put("hSj", listInfo1.get(i+1).getFcsjActual());
3401 3421 m.put("djgsj", trough);
3402 3422 m.put("bcjgsj", (fscjNext-fcsjTime)/60000);
3403 3423 mapList.add(m);
... ...
src/main/java/com/bsth/service/report/impl/SheetServiceImpl.java
... ... @@ -614,16 +614,26 @@ public class SheetServiceImpl extends BaseServiceImpl&lt;Sheet, Integer&gt; implements
614 614 }
615 615  
616 616 if(map.containsKey("type") && map.get("type").toString().equals("export")){
  617 + String lineName = "";
  618 + if(map.containsKey("lineName"))
  619 + lineName = map.get("lineName").toString();
617 620 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
618 621 Map<String, Object> m = new HashMap<String, Object>();
619 622 m.put("date", date);
620 623 m.put("endDate", endDate);
621 624 ReportUtils ee = new ReportUtils();
622 625 try {
  626 + String dateTime = "";
  627 + if(date.equals(endDate)){
  628 + dateTime = date.replaceAll("-", "");
  629 + } else {
  630 + dateTime = date.replaceAll("-", "")+"-"+
  631 + endDate.replaceAll("-", "");
  632 + }
623 633 listI.add(listmap.iterator());
624 634 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
625 635 ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "sheetList.xls",
626   - path + "export/发车准点率"+date.replaceAll("-", "")+"-"+endDate.replaceAll("-", "")+".xls");
  636 + path + "export/"+dateTime+"-"+lineName+"-发车准点率.xls");
627 637 } catch (Exception e) {
628 638 // TODO: handle exception
629 639 e.printStackTrace();
... ...
src/main/java/com/bsth/service/schedule/TTInfoDetailService.java
... ... @@ -6,6 +6,7 @@ import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData;
6 6 import com.bsth.service.schedule.exception.ScheduleException;
7 7 import com.bsth.service.schedule.timetable.ExcelFormatType;
8 8 import com.bsth.service.schedule.utils.DataToolsFile;
  9 +import com.bsth.service.schedule.utils.DataToolsFileType;
9 10  
10 11 import java.util.List;
11 12 import java.util.Map;
... ... @@ -30,7 +31,7 @@ public interface TTInfoDetailService extends BService&lt;TTInfoDetail, Long&gt; {
30 31 * @return
31 32 * @throws ScheduleException
32 33 */
33   - DataToolsFile exportDynamicTTinfo(TTinfoDetailDynamicData.DTInfos dtInfos) throws ScheduleException;
  34 + DataToolsFile exportDynamicTTinfo(TTinfoDetailDynamicData.DTInfos dtInfos, DataToolsFileType type) throws ScheduleException;
34 35  
35 36 /**
36 37 * 获取时刻表最大发车顺序号
... ...
src/main/java/com/bsth/service/schedule/datatools/Excel2003PoiOperator.java 0 → 100644
  1 +package com.bsth.service.schedule.datatools;
  2 +
  3 +import org.apache.poi.hssf.usermodel.*;
  4 +import org.apache.poi.ss.usermodel.*;
  5 +import org.apache.poi.ss.util.WorkbookUtil;
  6 +import org.apache.poi.xssf.usermodel.XSSFColor;
  7 +
  8 +import java.awt.Color;
  9 +import java.io.File;
  10 +import java.io.FileOutputStream;
  11 +import java.util.Date;
  12 +
  13 +/**
  14 + * Excel2003表格Poi操作类。
  15 + * TODO:2003里面还有很多和2007不通的样式设定方式,以后再改
  16 + */
  17 +public class Excel2003PoiOperator implements ExcelPoiOperator {
  18 + @Override
  19 + public Cell createCell(
  20 + Workbook workbook, Row row, short columnIndex,
  21 + Object value, int valueType,
  22 + HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment,
  23 + BorderStyle borderStyle, Color borderColor,
  24 + short fontSize, Color fontColor, String fontName,
  25 + Color backgroudColor, FillPatternType fillPatternType) {
  26 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  27 + HSSFRow hssfRow = (HSSFRow) row;
  28 +
  29 + CreationHelper creationHelper = hssfWorkbook.getCreationHelper();
  30 +
  31 + // 1、创建单元格对象
  32 + HSSFCell hssfCell = hssfRow.createCell((int) columnIndex);
  33 +
  34 + // 2、设定样式
  35 + HSSFCellStyle hssfCellStyle = hssfWorkbook.createCellStyle();
  36 +
  37 + // 设定值及数据格式
  38 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  39 + if (valueType == HSSFCell.CELL_TYPE_STRING) {
  40 + hssfCellStyle.setDataFormat(dataFormat.getFormat("@"));
  41 + hssfCell.setCellValue(creationHelper.createRichTextString(String.valueOf(value)));
  42 + } else if (valueType == HSSFCell.CELL_TYPE_NUMERIC) {
  43 + if (value instanceof Date) { // 日期
  44 + hssfCellStyle.setDataFormat(dataFormat.getFormat("yyyy-mm-dd"));
  45 + hssfCell.setCellValue((Date) value);
  46 + } else if (value instanceof Double) {
  47 + hssfCellStyle.setDataFormat(dataFormat.getFormat("0.00"));
  48 + hssfCell.setCellValue((Double) value);
  49 + } else if (value instanceof Integer) {
  50 + hssfCellStyle.setDataFormat(dataFormat.getFormat("0"));
  51 + hssfCell.setCellValue(Double.valueOf(value.toString()));
  52 + } else {
  53 + throw new RuntimeException("Excel2003 只支持 String Date Double Integer 单元格类型");
  54 + }
  55 + } else if (valueType == HSSFCell.CELL_TYPE_BLANK) {
  56 + hssfCell.setCellType(HSSFCell.CELL_TYPE_BLANK);
  57 + } else {
  58 + throw new RuntimeException("暂时不支持字符串、日期、数字以外的类型");
  59 + }
  60 +
  61 + // 对齐方式
  62 + hssfCellStyle.setAlignment((short) horizontalAlignment.ordinal());
  63 + hssfCellStyle.setVerticalAlignment((short) verticalAlignment.ordinal());
  64 +
  65 + // 边框样式
  66 + hssfCellStyle.setBorderTop((short) borderStyle.ordinal());
  67 + hssfCellStyle.setTopBorderColor(new XSSFColor(borderColor).getIndexed());
  68 + hssfCellStyle.setBorderBottom((short) borderStyle.ordinal());
  69 + hssfCellStyle.setBottomBorderColor(new XSSFColor(borderColor).getIndexed());
  70 + hssfCellStyle.setBorderLeft((short) borderStyle.ordinal());
  71 + hssfCellStyle.setLeftBorderColor(new XSSFColor(borderColor).getIndexed());
  72 + hssfCellStyle.setBorderRight((short) borderStyle.ordinal());
  73 + hssfCellStyle.setRightBorderColor(new XSSFColor(borderColor).getIndexed());
  74 +
  75 + // 字体颜色
  76 +// HSSFFont font = hssfWorkbook.createFont();
  77 +// font.setColor(new XSSFColor(fontColor).getIndexed());
  78 +// font.setFontHeightInPoints(fontSize);
  79 +// font.setFontName(fontName);
  80 +// hssfCellStyle.setFont(font);
  81 +
  82 +
  83 + // 单元背景色
  84 + hssfCellStyle.setFillForegroundColor(new XSSFColor(backgroudColor).getIndexed());
  85 +// hssfCellStyle.setFillPattern((short) fillPatternType.ordinal());
  86 +
  87 + // TODO
  88 +
  89 + hssfCell.setCellStyle(hssfCellStyle);
  90 + return hssfCell;
  91 + }
  92 +
  93 + @Override
  94 + public Cell createStringCell(
  95 + Workbook workbook, Row row, short columnIndex,
  96 + String value) {
  97 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  98 + HSSFRow hssfRow = (HSSFRow) row;
  99 +
  100 + HSSFCell hssfCell = (HSSFCell) createCell(
  101 + hssfWorkbook, hssfRow, columnIndex,
  102 + value, HSSFCell.CELL_TYPE_STRING,
  103 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  104 + BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
  105 + (short) 13, new java.awt.Color(0x2765A7), "宋体",
  106 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  107 + );
  108 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  109 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  110 + return hssfCell;
  111 + }
  112 +
  113 + @Override
  114 + public Cell createStringCell(
  115 + Workbook workbook, Row row, short columnIndex,
  116 + String value,
  117 + Color backgroudColor) {
  118 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  119 + HSSFRow hssfRow = (HSSFRow) row;
  120 +
  121 + HSSFCell hssfCell = (HSSFCell) createCell(
  122 + hssfWorkbook, hssfRow, columnIndex,
  123 + value, HSSFCell.CELL_TYPE_STRING,
  124 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  125 + BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
  126 + (short) 13, new java.awt.Color(0x2765A7), "宋体",
  127 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  128 + );
  129 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  130 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  131 + return hssfCell;
  132 + }
  133 +
  134 + @Override
  135 + public Cell createIntegerCell(
  136 + Workbook workbook, Row row, short columnIndex,
  137 + Integer value) {
  138 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  139 + HSSFRow hssfRow = (HSSFRow) row;
  140 +
  141 + HSSFCell hssfCell = (HSSFCell) createCell(
  142 + hssfWorkbook, hssfRow, columnIndex,
  143 + value, HSSFCell.CELL_TYPE_NUMERIC,
  144 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  145 + BorderStyle.MEDIUM, new Color(0xdedede),
  146 + (short) 13, new Color(0x2765A7), "宋体",
  147 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  148 + );
  149 +
  150 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  151 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
  152 + return hssfCell;
  153 + }
  154 +
  155 + @Override
  156 + public Cell createIntegerCell(
  157 + Workbook workbook, Row row, short columnIndex,
  158 + Integer value,
  159 + Color backgroudColor) {
  160 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  161 + HSSFRow hssfRow = (HSSFRow) row;
  162 +
  163 + HSSFCell hssfCell = (HSSFCell) createCell(
  164 + hssfWorkbook, hssfRow, columnIndex,
  165 + value, HSSFCell.CELL_TYPE_NUMERIC,
  166 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  167 + BorderStyle.MEDIUM, new Color(0xdedede),
  168 + (short) 13, new Color(0x2765A7), "宋体",
  169 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  170 + );
  171 +
  172 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  173 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
  174 + return hssfCell;
  175 + }
  176 +
  177 + @Override
  178 + public Cell createDoubleCell(
  179 + Workbook workbook, Row row, short columnIndex,
  180 + Double value) {
  181 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  182 + HSSFRow hssfRow = (HSSFRow) row;
  183 +
  184 + HSSFCell hssfCell = (HSSFCell) createCell(
  185 + hssfWorkbook, hssfRow, columnIndex,
  186 + value, HSSFCell.CELL_TYPE_NUMERIC,
  187 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  188 + BorderStyle.MEDIUM, new Color(0xdedede),
  189 + (short) 13, new Color(0x2765A7), "宋体",
  190 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  191 + );
  192 +
  193 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  194 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
  195 + return hssfCell;
  196 + }
  197 +
  198 + @Override
  199 + public Cell createDoubleCell(
  200 + Workbook workbook, Row row, short columnIndex,
  201 + Double value,
  202 + Color backgroudColor) {
  203 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  204 + HSSFRow hssfRow = (HSSFRow) row;
  205 +
  206 + HSSFCell hssfCell = (HSSFCell) createCell(
  207 + hssfWorkbook, hssfRow, columnIndex,
  208 + value, HSSFCell.CELL_TYPE_NUMERIC,
  209 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  210 + BorderStyle.MEDIUM, new Color(0xdedede),
  211 + (short) 13, new Color(0x2765A7), "宋体",
  212 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  213 + );
  214 +
  215 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  216 + hssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
  217 + return hssfCell;
  218 + }
  219 +
  220 + @Override
  221 + public Cell createBlankCell(Workbook workbook, Row row, short columnIndex) {
  222 + return createCell(
  223 + workbook, row, columnIndex,
  224 + null, HSSFCell.CELL_TYPE_BLANK,
  225 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  226 + BorderStyle.MEDIUM, new Color(0xdedede),
  227 + (short) 13, new Color(0x2765A7), "宋体",
  228 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  229 + );
  230 + }
  231 +
  232 + @Override
  233 + public Cell setCellDataFormat(Workbook workbook, Cell cell, String fmt) {
  234 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  235 + DataFormat dataFormat = hssfWorkbook.createDataFormat();
  236 + cell.getCellStyle().setDataFormat(dataFormat.getFormat("fmt"));
  237 + return cell;
  238 + }
  239 +
  240 + @Override
  241 + public Cell setCellBackground(Cell cell, Color color) {
  242 + HSSFCell hssfCell = (HSSFCell) cell;
  243 + hssfCell.getCellStyle().setFillForegroundColor(new XSSFColor(color).getIndexed());
  244 + return cell;
  245 + }
  246 +
  247 + @Override
  248 + public Workbook createWorkBook() {
  249 + return new HSSFWorkbook();
  250 + }
  251 +
  252 + @Override
  253 + public Sheet createWorkBookSheet(Workbook workbook, String sheetName) {
  254 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  255 + return hssfWorkbook.createSheet(WorkbookUtil.createSafeSheetName(sheetName));
  256 + }
  257 +
  258 + @Override
  259 + public Row createSheetRow(Sheet sheet, int rowIndex) {
  260 + HSSFSheet hssfSheet = (HSSFSheet) sheet;
  261 + return hssfSheet.createRow(rowIndex);
  262 + }
  263 +
  264 + @Override
  265 + public void writeExcel(File excelFile, Workbook workbook) {
  266 + try {
  267 + HSSFWorkbook hssfWorkbook = (HSSFWorkbook) workbook;
  268 + FileOutputStream fileOutputStream = new FileOutputStream(excelFile);
  269 + hssfWorkbook.write(fileOutputStream);
  270 + } catch (Exception exp) {
  271 + throw new RuntimeException(exp);
  272 + }
  273 + }
  274 +}
... ...
src/main/java/com/bsth/service/schedule/datatools/Excel2007PoiOperator.java 0 → 100644
  1 +package com.bsth.service.schedule.datatools;
  2 +
  3 +import org.apache.poi.ss.usermodel.*;
  4 +import org.apache.poi.ss.util.WorkbookUtil;
  5 +import org.apache.poi.xssf.usermodel.*;
  6 +
  7 +import java.awt.Color;
  8 +import java.io.File;
  9 +import java.io.FileOutputStream;
  10 +import java.util.Date;
  11 +
  12 +/**
  13 + * Excel2007表格Poi操作类。
  14 + * TODO:以后测style需要重用
  15 + */
  16 +public class Excel2007PoiOperator implements ExcelPoiOperator {
  17 + @Override
  18 + public Cell createCell(
  19 + Workbook workbook, Row row, short columnIndex,
  20 + Object value, int valueType,
  21 + HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment,
  22 + BorderStyle borderStyle, java.awt.Color borderColor,
  23 + short fontSize, java.awt.Color fontColor, String fontName,
  24 + java.awt.Color backgroudColor, FillPatternType fillPatternType) {
  25 +
  26 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  27 + XSSFRow xssfRow = (XSSFRow) row;
  28 +
  29 + CreationHelper creationHelper = xssfWorkbook.getCreationHelper();
  30 +
  31 + // 1、创建单元格对象
  32 + XSSFCell xssfCell = xssfRow.createCell(columnIndex);
  33 +
  34 + // 2、设定样式
  35 + XSSFCellStyle xssfCellStyle = xssfWorkbook.createCellStyle();
  36 +
  37 + // 设定值及数据格式
  38 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  39 + if (valueType == XSSFCell.CELL_TYPE_STRING) {
  40 + xssfCellStyle.setDataFormat(dataFormat.getFormat("@"));
  41 + xssfCell.setCellValue(creationHelper.createRichTextString(String.valueOf(value)));
  42 + } else if (valueType == XSSFCell.CELL_TYPE_NUMERIC) {
  43 + if (value instanceof Date) { // 日期
  44 + xssfCellStyle.setDataFormat(dataFormat.getFormat("yyyy-mm-dd"));
  45 + xssfCell.setCellValue((Date) value);
  46 + } else if (value instanceof Double) {
  47 + xssfCellStyle.setDataFormat(dataFormat.getFormat("0.00"));
  48 + xssfCell.setCellValue((Double) value);
  49 + } else if (value instanceof Integer) {
  50 + xssfCellStyle.setDataFormat(dataFormat.getFormat("0"));
  51 + xssfCell.setCellValue(Double.valueOf(value.toString()));
  52 + } else {
  53 + throw new RuntimeException("Excel2007 只支持 String Date Double Integer 单元格类型");
  54 + }
  55 + } else if (valueType == XSSFCell.CELL_TYPE_BLANK) {
  56 + xssfCell.setCellType(Cell.CELL_TYPE_BLANK);
  57 + } else {
  58 + throw new RuntimeException("暂时不支持字符串、日期、数字以外的类型");
  59 + }
  60 +
  61 + // 对齐方式
  62 + xssfCellStyle.setAlignment(horizontalAlignment);
  63 + xssfCellStyle.setVerticalAlignment(verticalAlignment);
  64 +
  65 + // 边框样式
  66 + xssfCellStyle.setBorderTop(borderStyle);
  67 + xssfCellStyle.setTopBorderColor(new XSSFColor(borderColor));
  68 + xssfCellStyle.setBorderBottom(borderStyle);
  69 + xssfCellStyle.setBottomBorderColor(new XSSFColor(borderColor));
  70 + xssfCellStyle.setBorderLeft(borderStyle);
  71 + xssfCellStyle.setLeftBorderColor(new XSSFColor(borderColor));
  72 + xssfCellStyle.setBorderRight(borderStyle);
  73 + xssfCellStyle.setRightBorderColor(new XSSFColor(borderColor));
  74 +
  75 + // 字体颜色
  76 + XSSFFont font = xssfWorkbook.createFont();
  77 + font.setColor(new XSSFColor(fontColor));
  78 + font.setFontHeightInPoints(fontSize);
  79 + font.setFontName(fontName);
  80 + xssfCellStyle.setFont(font);
  81 +
  82 +
  83 + // 单元背景色
  84 + xssfCellStyle.setFillForegroundColor(new XSSFColor(backgroudColor));
  85 + xssfCellStyle.setFillPattern(fillPatternType);
  86 +
  87 + // TODO
  88 +
  89 + xssfCell.setCellStyle(xssfCellStyle);
  90 + return xssfCell;
  91 + }
  92 +
  93 + @Override
  94 + public Cell createStringCell(
  95 + Workbook workbook, Row row, short columnIndex,
  96 + String value) {
  97 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  98 + XSSFRow xssfRow = (XSSFRow) row;
  99 +
  100 + XSSFCell xssfCell = (XSSFCell) createCell(
  101 + xssfWorkbook, xssfRow, columnIndex,
  102 + value, XSSFCell.CELL_TYPE_STRING,
  103 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  104 + BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
  105 + (short) 13, new java.awt.Color(0x2765A7), "宋体",
  106 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  107 + );
  108 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  109 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  110 + return xssfCell;
  111 + }
  112 +
  113 + @Override
  114 + public Cell createStringCell(
  115 + Workbook workbook, Row row, short columnIndex,
  116 + String value,
  117 + Color backgroudColor) {
  118 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  119 + XSSFRow xssfRow = (XSSFRow) row;
  120 +
  121 + XSSFCell xssfCell = (XSSFCell) createCell(
  122 + xssfWorkbook, xssfRow, columnIndex,
  123 + value, XSSFCell.CELL_TYPE_STRING,
  124 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  125 + BorderStyle.MEDIUM, new java.awt.Color(0xdedede),
  126 + (short) 13, new java.awt.Color(0x2765A7), "宋体",
  127 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  128 + );
  129 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  130 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("@"));
  131 + return xssfCell;
  132 + }
  133 +
  134 + @Override
  135 + public Cell createIntegerCell(
  136 + Workbook workbook, Row row, short columnIndex,
  137 + Integer value) {
  138 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  139 + XSSFRow xssfRow = (XSSFRow) row;
  140 +
  141 + XSSFCell xssfCell = (XSSFCell) createCell(
  142 + xssfWorkbook, xssfRow, columnIndex,
  143 + value, XSSFCell.CELL_TYPE_NUMERIC,
  144 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  145 + BorderStyle.MEDIUM, new Color(0xdedede),
  146 + (short) 13, new Color(0x2765A7), "宋体",
  147 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  148 + );
  149 +
  150 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  151 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
  152 + return xssfCell;
  153 + }
  154 +
  155 + @Override
  156 + public Cell createIntegerCell(
  157 + Workbook workbook, Row row, short columnIndex,
  158 + Integer value,
  159 + Color backgroudColor) {
  160 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  161 + XSSFRow xssfRow = (XSSFRow) row;
  162 +
  163 + XSSFCell xssfCell = (XSSFCell) createCell(
  164 + xssfWorkbook, xssfRow, columnIndex,
  165 + value, XSSFCell.CELL_TYPE_NUMERIC,
  166 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  167 + BorderStyle.MEDIUM, new Color(0xdedede),
  168 + (short) 13, new Color(0x2765A7), "宋体",
  169 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  170 + );
  171 +
  172 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  173 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0"));
  174 + return xssfCell;
  175 + }
  176 +
  177 + @Override
  178 + public Cell createDoubleCell(
  179 + Workbook workbook, Row row, short columnIndex,
  180 + Double value) {
  181 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  182 + XSSFRow xssfRow = (XSSFRow) row;
  183 +
  184 + XSSFCell xssfCell = (XSSFCell) createCell(
  185 + xssfWorkbook, xssfRow, columnIndex,
  186 + value, XSSFCell.CELL_TYPE_NUMERIC,
  187 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  188 + BorderStyle.MEDIUM, new Color(0xdedede),
  189 + (short) 13, new Color(0x2765A7), "宋体",
  190 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  191 + );
  192 +
  193 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  194 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
  195 + return xssfCell;
  196 + }
  197 +
  198 + @Override
  199 + public Cell createDoubleCell(
  200 + Workbook workbook, Row row, short columnIndex,
  201 + Double value,
  202 + Color backgroudColor) {
  203 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  204 + XSSFRow xssfRow = (XSSFRow) row;
  205 +
  206 + XSSFCell xssfCell = (XSSFCell) createCell(
  207 + xssfWorkbook, xssfRow, columnIndex,
  208 + value, XSSFCell.CELL_TYPE_NUMERIC,
  209 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  210 + BorderStyle.MEDIUM, new Color(0xdedede),
  211 + (short) 13, new Color(0x2765A7), "宋体",
  212 + backgroudColor, FillPatternType.SOLID_FOREGROUND
  213 + );
  214 +
  215 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  216 + xssfCell.getCellStyle().setDataFormat(dataFormat.getFormat("0.00"));
  217 + return xssfCell;
  218 + }
  219 +
  220 + @Override
  221 + public Cell createBlankCell(
  222 + Workbook workbook, Row row, short columnIndex) {
  223 + return createCell(
  224 + workbook, row, columnIndex,
  225 + null, XSSFCell.CELL_TYPE_BLANK,
  226 + HorizontalAlignment.CENTER, VerticalAlignment.CENTER,
  227 + BorderStyle.MEDIUM, new Color(0xdedede),
  228 + (short) 13, new Color(0x2765A7), "宋体",
  229 + new Color(0xffffff), FillPatternType.SOLID_FOREGROUND
  230 + );
  231 + }
  232 +
  233 + @Override
  234 + public Cell setCellDataFormat(Workbook workbook, Cell cell, String fmt) {
  235 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  236 + DataFormat dataFormat = xssfWorkbook.createDataFormat();
  237 + cell.getCellStyle().setDataFormat(dataFormat.getFormat(fmt));
  238 + return cell;
  239 + }
  240 +
  241 + @Override
  242 + public Cell setCellBackground(Cell cell, Color color) {
  243 + XSSFCell xssfCell = (XSSFCell) cell;
  244 + xssfCell.getCellStyle().setFillForegroundColor(new XSSFColor(color));
  245 + return cell;
  246 + }
  247 +
  248 + @Override
  249 + public Workbook createWorkBook() {
  250 + return new XSSFWorkbook();
  251 + }
  252 +
  253 + @Override
  254 + public Sheet createWorkBookSheet(Workbook workbook, String sheetName) {
  255 + return workbook.createSheet(WorkbookUtil.createSafeSheetName(sheetName));
  256 + }
  257 +
  258 + @Override
  259 + public Row createSheetRow(Sheet sheet, int rowIndex) {
  260 + XSSFSheet xssfSheet = (XSSFSheet) sheet;
  261 + return xssfSheet.createRow(rowIndex);
  262 + }
  263 +
  264 + @Override
  265 + public void writeExcel(File excelFile, Workbook workbook) {
  266 + try {
  267 + XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
  268 + FileOutputStream fileOutputStream = new FileOutputStream(excelFile);
  269 + xssfWorkbook.write(fileOutputStream);
  270 + } catch (Exception exp) {
  271 + throw new RuntimeException(exp);
  272 + }
  273 +
  274 + }
  275 +}
... ...
src/main/java/com/bsth/service/schedule/datatools/ExcelPoiOperator.java 0 → 100644
  1 +package com.bsth.service.schedule.datatools;
  2 +
  3 +import org.apache.poi.ss.usermodel.*;
  4 +
  5 +import java.awt.Color;
  6 +import java.io.File;
  7 +
  8 +/**
  9 + * Excel表格Poi操作接口。
  10 + */
  11 +public interface ExcelPoiOperator {
  12 +
  13 +
  14 + //---------------- 创建单元格 ---------------//
  15 +
  16 + Cell createCell(
  17 + Workbook workbook, Row row, short columnIndex,
  18 + Object value, int valueType,
  19 + HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment,
  20 + BorderStyle borderStyle, java.awt.Color borderColor,
  21 + short fontSize, java.awt.Color fontColor, String fontName,
  22 + java.awt.Color backgroudColor, FillPatternType fillPatternType
  23 + );
  24 +
  25 + Cell createStringCell(
  26 + Workbook workbook, Row row, short columnIndex,
  27 + String value
  28 + );
  29 +
  30 + Cell createStringCell(
  31 + Workbook workbook, Row row, short columnIndex,
  32 + String value,
  33 + java.awt.Color backgroudColor
  34 + );
  35 +
  36 + Cell createIntegerCell(
  37 + Workbook workbook, Row row, short columnIndex,
  38 + Integer value
  39 + );
  40 +
  41 + Cell createIntegerCell(
  42 + Workbook workbook, Row row, short columnIndex,
  43 + Integer value,
  44 + java.awt.Color backgroudColor
  45 + );
  46 +
  47 + Cell createDoubleCell(
  48 + Workbook workbook, Row row, short columnIndex,
  49 + Double value
  50 + );
  51 +
  52 + Cell createDoubleCell(
  53 + Workbook workbook, Row row, short columnIndex,
  54 + Double value,
  55 + java.awt.Color backgroudColor
  56 + );
  57 +
  58 + Cell createBlankCell(
  59 + Workbook workbook, Row row, short columnIndex
  60 + );
  61 +
  62 + //---------------- 创建单元格数据格式 ---------------//
  63 +
  64 + Cell setCellDataFormat(Workbook workbook, Cell cell, String fmt);
  65 +
  66 + Cell setCellBackground(Cell cell, Color color);
  67 +
  68 + //---------------- 创建workbook,sheet,row ---------------//
  69 + Workbook createWorkBook();
  70 + Sheet createWorkBookSheet(Workbook workbook, String sheetName);
  71 + Row createSheetRow(Sheet sheet, int rowIndex);
  72 +
  73 + //---------------- 生成文件 ---------------//
  74 + void writeExcel(File excelFile, Workbook workbook);
  75 +}
... ...
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
... ... @@ -14,10 +14,6 @@ import org.apache.commons.lang3.StringUtils;
14 14 import org.apache.poi.ss.usermodel.Cell;
15 15 import org.apache.poi.ss.usermodel.Row;
16 16 import org.apache.poi.ss.util.CellRangeAddress;
17   -import org.apache.poi.ss.util.WorkbookUtil;
18   -import org.apache.poi.xssf.usermodel.XSSFCell;
19   -import org.apache.poi.xssf.usermodel.XSSFRow;
20   -import org.apache.poi.xssf.usermodel.XSSFSheet;
21 17 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
22 18 import org.joda.time.DateTime;
23 19 import org.joda.time.LocalTime;
... ... @@ -31,7 +27,6 @@ import org.springframework.stereotype.Service;
31 27  
32 28 import java.awt.*;
33 29 import java.io.File;
34   -import java.io.FileOutputStream;
35 30 import java.io.PrintWriter;
36 31 import java.io.StringWriter;
37 32 import java.util.*;
... ... @@ -438,14 +433,14 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
438 433 }
439 434 }
440 435  
441   - private void createDynamicTTinfoStatSheet(XSSFWorkbook wb, DTInfos dtInfos) {
442   - XSSFSheet sheet = wb.createSheet(WorkbookUtil.createSafeSheetName("时刻表信息_统计"));
  436 + private void createDynamicTTinfoStatSheet(org.apache.poi.ss.usermodel.Workbook wb, DTInfos dtInfos, ExcelPoiOperator excelPoiOperator) {
  437 + org.apache.poi.ss.usermodel.Sheet sheet = excelPoiOperator.createWorkBookSheet(wb, "时刻表信息_统计");
443 438  
444 439 //-------------------------------- 1、路牌班次数据 -------------------------------//
445 440 List<LpObj> lpObjList = dtInfos.getLpObjList();
446 441  
447 442 // 构建第一行数据
448   - XSSFRow lpHeadRow = sheet.createRow((short) 0);
  443 + Row lpHeadRow = excelPoiOperator.createSheetRow(sheet, 0);
449 444 if (lpObjList.size() == 0) {
450 445 throw new RuntimeException("没有班次数据!");
451 446 }
... ... @@ -455,40 +450,36 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
455 450 }
456 451  
457 452 // 构造表头
458   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short)0, "路牌", new Color(0x96b9d7));
  453 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) 0, "路牌", new Color(0x96b9d7));
  454 +
459 455 StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1());
460 456 StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2());
461 457 for (int i = 0; i < groupCount; i++) {
462   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 1),
463   - station1.getStationName(), new Color(0x96b9d7));
464   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 2),
465   - station2.getStationName(), new Color(0x96b9d7));
  458 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 1), station1.getStationName(), new Color(0x96b9d7));
  459 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 2), station2.getStationName(), new Color(0x96b9d7));
466 460 }
467   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 1),
468   - "路牌工时", new Color(0x96b9d7));
469   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 2),
470   - "营运班次数", new Color(0x96b9d7));
  461 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (groupCount * 2 + 1), "路牌工时", new Color(0x96b9d7));
  462 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (groupCount * 2 + 2), "营运班次数", new Color(0x96b9d7));
471 463  
472 464 // 构建每个路牌的班次数据
473 465 for (int i = 0; i < lpObjList.size(); i++) {
474 466 LpObj lpObj = lpObjList.get(i);
475   - XSSFRow lpRow = sheet.createRow((short) (i + 1));
476   - PoiUtils.createStringXSSFCell(wb, lpRow, (short) 0, lpObj.getLpname());
  467 + Row lpRow = excelPoiOperator.createSheetRow(sheet, i + 1);
  468 + excelPoiOperator.createStringCell(wb, lpRow, (short) 0, lpObj.getLpname());
477 469 for (int j = 0; j < groupCount; j++) {
478   - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 1));
479   - PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 2));
  470 + excelPoiOperator.createBlankCell(wb, lpRow, (short) (j * 2 + 1));
  471 + excelPoiOperator.createBlankCell(wb, lpRow, (short) (j * 2 + 2));
480 472 }
481 473 for (BcObj bcObj : lpObj.getBcObjList()) {
482 474 if (bcObj.getBcType() == BcType.NORMAL) {
483   - Cell cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 1));
484   - cell.setCellValue(bcObj.getFcsjDesc());
  475 + lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 1)).setCellValue(bcObj.getFcsjDesc());
485 476 }
486 477 }
487 478 // 路牌工时/班次数
488   - PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 1),
  479 + excelPoiOperator.createDoubleCell(wb, lpRow, (short) (groupCount * 2 + 1),
489 480 lpObj.getZgs() / 60);
490 481 // 营运班次数
491   - PoiUtils.createIntegerXSSFCell(wb, lpRow, (short) (groupCount * 2 + 2),
  482 + excelPoiOperator.createIntegerCell(wb, lpRow, (short) (groupCount * 2 + 2),
492 483 lpObj.getZbc());
493 484 }
494 485  
... ... @@ -514,9 +505,9 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
514 505  
515 506 int startrow = lpObjList.size() + 3;
516 507 for (int i = startrow; i <= startrow + 22; i++) {
517   - XSSFRow xssfRow = sheet.createRow(i);
  508 + Row row = excelPoiOperator.createSheetRow(sheet, i);
518 509 for (int j = 0; j < 10; j++) {
519   - PoiUtils.createStringXSSFCell(wb, xssfRow, (short) j, "");
  510 + excelPoiOperator.createStringCell(wb, row, (short) j, "");
520 511  
521 512 }
522 513 }
... ... @@ -537,27 +528,27 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
537 528 StatInfo statInfo = statInfos.get(i);
538 529  
539 530 // 1、统计序号
540   - PoiUtils.setIntegerStyleXSSFCellStyle(wb, sheet.getRow(startrow + 2 + i).getCell(0));
  531 + excelPoiOperator.setCellDataFormat(wb, sheet.getRow(startrow + 2 + i).getCell(0), "0");
541 532 sheet.getRow(startrow + 2 + i).getCell(0).setCellValue(i);
542 533  
543 534 // 2、统计项目
544 535 sheet.getRow(startrow + 2 + i).getCell(1).setCellValue(statInfo.getStatItem());
545 536  
546 537 // 3、统计数值
547   - PoiUtils.setDoubleStyleXSSFCellStyle(wb, sheet.getRow(startrow + 2 + i).getCell(9));
  538 + excelPoiOperator.setCellDataFormat(wb, sheet.getRow(startrow + 2 + i).getCell(9), "0.00");
548 539 sheet.getRow(startrow + 2 + i).getCell(9).setCellValue(statInfo.getStatValue());
549 540 }
550 541  
551 542 }
552 543  
553   - private void createDynamicTTinfoSheet(XSSFWorkbook wb, DTInfos dtInfos) {
554   - XSSFSheet sheet = wb.createSheet(WorkbookUtil.createSafeSheetName("时刻表信息"));
  544 + private void createDynamicTTinfoSheet(org.apache.poi.ss.usermodel.Workbook wb, DTInfos dtInfos, ExcelPoiOperator excelPoiOperator) {
  545 + org.apache.poi.ss.usermodel.Sheet sheet = excelPoiOperator.createWorkBookSheet(wb, "时刻表信息");
555 546  
556 547 //-------------------------------- 1、路牌班次数据 -------------------------------//
557 548 List<LpObj> lpObjList = dtInfos.getLpObjList();
558 549  
559 550 // 构建第一行数据
560   - XSSFRow lpHeadRow = sheet.createRow((short) 0);
  551 + Row lpHeadRow = excelPoiOperator.createSheetRow(sheet, 0);
561 552 if (lpObjList.size() == 0) {
562 553 throw new RuntimeException("没有班次数据!");
563 554 }
... ... @@ -567,72 +558,61 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
567 558 }
568 559  
569 560 // 构造表头,添加一个进场,添加一个出场
570   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short)0, "路牌", new Color(0x96b9d7));
  561 +
  562 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) 0, "路牌", new Color(0x96b9d7));
  563 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) 1, "报到", new Color(0x96b9d7));
  564 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) 2, "出场", new Color(0x96b9d7));
  565 +
  566 +
571 567 StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1());
572 568 StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2());
573   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (1),
574   - "报到", new Color(0x96b9d7));
575   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (2),
576   - "出场", new Color(0x96b9d7));
577 569 for (int i = 1; i <= groupCount; i++) {
578   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 1),
579   - station1.getStationName(), new Color(0x96b9d7));
580   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (i * 2 + 2),
581   - station2.getStationName(), new Color(0x96b9d7));
  570 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 1), station1.getStationName(), new Color(0x96b9d7));
  571 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 2), station2.getStationName(), new Color(0x96b9d7));
582 572 }
583 573  
584 574 // 最后一个进场需要变成三个班次
585 575 // 1个分班进场班次插入到前面的班次
586 576 // 后面添加两个班次,1个到场班次,1个离场班次
587   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 3),
588   - "到场", new Color(0x96b9d7));
589   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 4),
590   - "离场", new Color(0x96b9d7));
  577 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (groupCount * 2 + 3), "到场", new Color(0x96b9d7));
  578 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (groupCount * 2 + 4), "离场", new Color(0x96b9d7));
591 579  
592 580 // 路牌统计字段
593   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 5),
594   - "总公里", new Color(0x96b9d7));
595   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 6),
596   - "营业公里", new Color(0x96b9d7));
597   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 7),
598   - "空驶公里", new Color(0x96b9d7));
599   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 8),
600   - "总工时", new Color(0x96b9d7));
601   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 9),
602   - "营业工时", new Color(0x96b9d7));
603   - PoiUtils.createStringXSSFCell(wb, lpHeadRow, (short) (groupCount * 2 + 10),
604   - "营运班次", new Color(0x96b9d7));
  581 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (groupCount * 2 + 5), "总公里", new Color(0x96b9d7));
  582 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (groupCount * 2 + 6), "营业公里", new Color(0x96b9d7));
  583 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (groupCount * 2 + 7), "空驶公里", new Color(0x96b9d7));
  584 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (groupCount * 2 + 8), "总工时", new Color(0x96b9d7));
  585 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (groupCount * 2 + 9), "营业工时", new Color(0x96b9d7));
  586 + excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (groupCount * 2 + 10), "营运班次", new Color(0x96b9d7));
605 587  
606 588 // 构建每个路牌的班次数据
  589 + Cell cell = null;
607 590 for (int i = 0; i < lpObjList.size(); i++) {
608 591 LpObj lpObj = lpObjList.get(i);
609   - XSSFRow lpRow = sheet.createRow((short) (i + 1));
610   - PoiUtils.createStringXSSFCell(wb, lpRow, (short) 0, lpObj.getLpname());
  592 + Row lpRow = excelPoiOperator.createSheetRow(sheet, i + 1);
  593 + excelPoiOperator.createStringCell(wb, lpRow, (short) 0, lpObj.getLpname());
611 594  
612 595 // 创建空白单元格,并设置字符串格式
613   - XSSFCell xssfCell = null;
  596 + cell = excelPoiOperator.createBlankCell(wb, lpRow, (short) 1);
  597 + excelPoiOperator.setCellDataFormat(wb, cell, "@");
614 598  
615   - xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (1));
616   - PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
617   -
618   - xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (2));
619   - PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
  599 + cell = excelPoiOperator.createBlankCell(wb, lpRow, (short) 2);
  600 + excelPoiOperator.setCellDataFormat(wb, cell, "@");
620 601  
621 602 for (int j = 1; j <= groupCount; j++) {
622   - xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 1));
623   - PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
624   - xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (j * 2 + 2));
625   - PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
  603 + cell = excelPoiOperator.createBlankCell(wb, lpRow, (short) (j * 2 + 1));
  604 + excelPoiOperator.setCellDataFormat(wb, cell, "@");
  605 + cell = excelPoiOperator.createBlankCell(wb, lpRow, (short) (j * 2 + 2));
  606 + excelPoiOperator.setCellDataFormat(wb, cell, "@");
626 607 }
627 608  
628   - xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (groupCount * 2 + 3));
629   - PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
630   - xssfCell = PoiUtils.createBlankXSSFCell(wb, lpRow, (short) (groupCount * 2 + 4));
631   - PoiUtils.setStringStyleXSSFCellStyle(wb, xssfCell);
  609 + cell = excelPoiOperator.createBlankCell(wb, lpRow, (short) (groupCount * 2 + 3));
  610 + excelPoiOperator.setCellDataFormat(wb, cell, "@");
  611 + cell = excelPoiOperator.createBlankCell(wb, lpRow, (short) (groupCount * 2 + 4));
  612 + excelPoiOperator.setCellDataFormat(wb, cell, "@");
632 613  
633 614 for (int j = 0; j < lpObj.getBcObjList().size(); j++) {
634 615 BcObj bcObj = lpObj.getBcObjList().get(j); // 当前班次
635   - Cell cell = null; // 待处理的单元格
636 616  
637 617 switch (bcObj.getBcType()) {
638 618 case BD: // 报到班次
... ... @@ -680,14 +660,16 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
680 660 }
681 661  
682 662 // 路牌统计字段
683   - PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 5), lpObj.getZlc());
684   - PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 6), lpObj.getYylc());
685   - PoiUtils.createDoubleXSSFCell(wb, lpRow, (short) (groupCount * 2 + 7), lpObj.getKslc());
686   - PoiUtils.createStringXSSFCell(wb, lpRow, (short) (groupCount * 2 + 8),
  663 + excelPoiOperator.createDoubleCell(wb, lpRow, (short) (groupCount * 2 + 5), lpObj.getZlc());
  664 + excelPoiOperator.createDoubleCell(wb, lpRow, (short) (groupCount * 2 + 6), lpObj.getYylc());
  665 + excelPoiOperator.createDoubleCell(wb, lpRow, (short) (groupCount * 2 + 7), lpObj.getKslc());
  666 + cell = excelPoiOperator.createStringCell(wb, lpRow, (short) (groupCount * 2 + 8),
687 667 String.format("%d%s%d", (int) (lpObj.getZgs() / 60), ":", (int) (lpObj.getZgs() % 60)));
688   - PoiUtils.createStringXSSFCell(wb, lpRow, (short) (groupCount * 2 + 9),
  668 + excelPoiOperator.setCellDataFormat(wb, cell, "[h]:mm");
  669 + cell = excelPoiOperator.createStringCell(wb, lpRow, (short) (groupCount * 2 + 9),
689 670 String.format("%d%s%d", (int) (lpObj.getYygs() / 60), ":", (int) (lpObj.getYygs() % 60)));
690   - PoiUtils.createIntegerXSSFCell(wb, lpRow, (short) (groupCount * 2 + 10), lpObj.getYybc());
  671 + excelPoiOperator.setCellDataFormat(wb, cell, "[h]:mm");
  672 + excelPoiOperator.createIntegerCell(wb, lpRow, (short) (groupCount * 2 + 10), lpObj.getYybc());
691 673  
692 674 }
693 675  
... ... @@ -710,24 +692,33 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail
710 692 }
711 693  
712 694 @Override
713   - public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos) throws ScheduleException {
  695 + public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos, DataToolsFileType type) throws ScheduleException {
714 696 try {
  697 + ExcelPoiOperator excelPoiOperator;
  698 + if (type == DataToolsFileType.XLS) {
  699 + excelPoiOperator = new Excel2003PoiOperator();
  700 + } else if (type == DataToolsFileType.XLSX) {
  701 + excelPoiOperator = new Excel2007PoiOperator();
  702 + } else {
  703 + throw new RuntimeException("未知的导出格式==>" + type);
  704 + }
  705 +
715 706 // 使用POI,创建xlsx文件
716   - XSSFWorkbook wb = new XSSFWorkbook();
717   - this.createDynamicTTinfoSheet(wb, dtInfos);
718   - this.createDynamicTTinfoStatSheet(wb, dtInfos);
  707 + org.apache.poi.ss.usermodel.Workbook wb = excelPoiOperator.createWorkBook();
  708 + this.createDynamicTTinfoSheet(wb, dtInfos, excelPoiOperator);
  709 + this.createDynamicTTinfoStatSheet(wb, dtInfos, excelPoiOperator);
719 710  
720 711 // wb内存写入文件
721 712 String filepath = dataToolsProperties.getFileoutputDir() +
722 713 File.separator +
723 714 "动态时刻表-" +
724 715 new DateTime().toString("yyyyMMddHHmmss") + ".xlsx";
725   - FileOutputStream fileOut = new FileOutputStream(filepath);
726   - wb.write(fileOut);
  716 + File file = new File(filepath);
  717 + excelPoiOperator.writeExcel(file, wb);
727 718  
728 719 DataToolsFile dataToolsFile = new DataToolsFile();
729 720 dataToolsFile.setFileType(DataToolsFileType.XLSX);
730   - dataToolsFile.setFile(new File(filepath));
  721 + dataToolsFile.setFile(file);
731 722  
732 723 return dataToolsFile;
733 724  
... ...
src/main/java/com/bsth/service/schedule/datatools/TTinfoDetailDynamicData.java
... ... @@ -2,6 +2,7 @@ package com.bsth.service.schedule.datatools;
2 2  
3 3 import com.bsth.service.schedule.exception.ScheduleException;
4 4 import com.bsth.service.schedule.utils.DataToolsFile;
  5 +import com.bsth.service.schedule.utils.DataToolsFileType;
5 6 import com.fasterxml.jackson.annotation.JsonCreator;
6 7 import com.fasterxml.jackson.annotation.JsonValue;
7 8  
... ... @@ -374,5 +375,5 @@ public interface TTinfoDetailDynamicData {
374 375 * @return
375 376 * @throws ScheduleException
376 377 */
377   - public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos) throws ScheduleException;
378   -}
379 378 \ No newline at end of file
  379 + public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos, DataToolsFileType type) throws ScheduleException;
  380 +}
... ...
src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
... ... @@ -293,6 +293,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
293 293 }
294 294  
295 295 if(type.equals("export")){
  296 + String lineName = "";
  297 + if(map.containsKey("lineName"))
  298 + lineName = map.get("lineName").toString();
296 299 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
297 300 sdfSimple = new SimpleDateFormat("yyyyMMdd");
298 301 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -302,7 +305,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
302 305 listI.add(resList.iterator());
303 306 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
304 307 ee.excelReplace(listI, new Object[] { m }, path+"mould/peoCarPlan.xls",
305   - path+"export/计划车辆班次人员" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  308 + path+"export/" + sdfSimple.format(sdfMonth.parse(date))
  309 + +"-"+lineName+"-计划车辆班次人员.xls");
306 310 } catch (Exception e) {
307 311 // TODO: handle exception
308 312 e.printStackTrace();
... ... @@ -341,7 +345,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
341 345 keyMap.get(key).add(schedule);
342 346 }
343 347  
344   - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-ddHH:mm");
  348 +// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-ddHH:mm");
345 349 Long zgfBegin = 0l;
346 350 Long zgfEnd = 0l;
347 351 Long wgfBegin = 0l;
... ... @@ -513,6 +517,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
513 517 }
514 518  
515 519 if(type.equals("export")){
  520 + String lineName = "";
  521 + if(map.containsKey("lineName"))
  522 + lineName = map.get("lineName").toString();
516 523 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
517 524 sdfSimple = new SimpleDateFormat("yyyyMMdd");
518 525 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -522,7 +529,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
522 529 listI.add(resList.iterator());
523 530 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
524 531 ee.excelReplace(listI, new Object[] { m }, path+"mould/workDaily.xls",
525   - path+"export/营运服务日报表"+ sdfSimple.format(sdfMonth.parse(date))+".xls");
  532 + path+"export/"+ sdfSimple.format(sdfMonth.parse(date))+"-"+lineName
  533 + +"-营运服务日报表.xls");
526 534 } catch (Exception e) {
527 535 // TODO: handle exception
528 536 e.printStackTrace();
... ... @@ -810,6 +818,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
810 818  
811 819 //导出
812 820 if(type.equals("export")){
  821 + String lineName = "";
  822 + if(map.containsKey("lineName"))
  823 + lineName = map.get("lineName").toString();
813 824 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
814 825 sdfSimple = new SimpleDateFormat("yyyyMMdd");
815 826 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -819,7 +830,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
819 830 listI.add(resList.iterator());
820 831 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
821 832 ee.excelReplace(listI, new Object[] { m }, path+"mould/scheduleAnaly.xls",
822   - path+"export/时刻表分析" + sdfSimple.format(sdfMonth.parse(startDate)) + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls");
  833 + path+"export/"
  834 + + sdfSimple.format(sdfMonth.parse(startDate)) + "-"
  835 + + sdfSimple.format(sdfMonth.parse(endDate)) + "-"
  836 + +lineName+"-时刻表分析.xls");
823 837 } catch (Exception e) {
824 838 // TODO: handle exception
825 839 e.printStackTrace();
... ... @@ -1110,16 +1124,26 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1110 1124  
1111 1125 //导出
1112 1126 if(type.equals("export")){
  1127 + String lineName_ = "";
  1128 + if(map.containsKey("lineName"))
  1129 + lineName_ = map.get("lineName").toString();
1113 1130 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
1114 1131 sdfSimple = new SimpleDateFormat("yyyyMMdd");
1115 1132 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
1116 1133 Map<String,Object> m = new HashMap<String, Object>();
1117 1134 ReportUtils ee = new ReportUtils();
1118 1135 try {
  1136 + String dateTime = "";
  1137 + if(startDate.equals(endDate)){
  1138 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  1139 + } else {
  1140 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  1141 + +"-"+sdfSimple.format(sdfMonth.parse(endDate));
  1142 + }
1119 1143 listI.add(tempList.iterator());
1120 1144 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
1121 1145 ee.excelReplace(listI, new Object[] { m }, path+"mould/scheduleAnaly_sum.xls",
1122   - path+"export/时刻表分析(汇总)" + sdfSimple.format(sdfMonth.parse(startDate)) + "-" + sdfSimple.format(sdfMonth.parse(endDate)) + ".xls");
  1146 + path+"export/" + dateTime + "-" + lineName + "-时刻表分析(汇总).xls");
1123 1147 } catch (Exception e) {
1124 1148 // TODO: handle exception
1125 1149 e.printStackTrace();
... ... @@ -1370,6 +1394,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1370 1394 }
1371 1395  
1372 1396 if(type.equals("export")){
  1397 + String lineName = "";
  1398 + if(map.containsKey("lineName"))
  1399 + lineName = map.get("lineName").toString();
1373 1400 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
1374 1401 sdfSimple = new SimpleDateFormat("yyyyMMdd");
1375 1402 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -1379,7 +1406,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1379 1406 listI.add(resList.iterator());
1380 1407 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
1381 1408 ee.excelReplace(listI, new Object[] { m }, path+"mould/firstAndLastBus.xls",
1382   - path+"export/线路首末班" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  1409 + path+"export/" + sdfSimple.format(sdfMonth.parse(date))
  1410 + + "-" + lineName + "-线路首末班.xls");
1383 1411 } catch (Exception e) {
1384 1412 // TODO: handle exception
1385 1413 e.printStackTrace();
... ... @@ -1723,10 +1751,24 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1723 1751 if(!type.equals("export"))
1724 1752 resList.add(tempMap);
1725 1753 }
1726   -
  1754 +
  1755 + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
  1756 + sdfSimple = new SimpleDateFormat("yyyyMMdd");
  1757 + String dateTime = "", lineName = "";
  1758 + try {
  1759 + if(startDate.equals(endDate)){
  1760 + dateTime = sdfSimple.format(sdfMonth.parse(startDate));
  1761 + } else {
  1762 + dateTime = sdfSimple.format(sdfMonth.parse(startDate))
  1763 + +"-"+sdfSimple.format(sdfMonth.parse(endDate));
  1764 + }
  1765 + if(map.containsKey("lineName"))
  1766 + lineName = map.get("lineName").toString();
  1767 + } catch (Exception e) {
  1768 + // TODO: handle exception
  1769 + e.printStackTrace();
  1770 + }
1727 1771 if(type.equals("export")){
1728   - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
1729   - sdfSimple = new SimpleDateFormat("yyyyMMdd");
1730 1772 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
1731 1773 Map<String,Object> m = new HashMap<String, Object>();
1732 1774 ReportUtils ee = new ReportUtils();
... ... @@ -1734,8 +1776,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1734 1776 listI.add(resList.iterator());
1735 1777 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
1736 1778 ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_sum.xls",
1737   - path+"export/线路首末班准点率" + sdfSimple.format(sdfMonth.parse(startDate)) +
1738   - (startDate.equals(endDate)?"":"-"+sdfSimple.format(sdfMonth.parse(endDate))) + ".xls");
  1779 + path+"export/" + dateTime + "-" + lineName + "-线路首末班准点率.xls");
1739 1780 } catch (Exception e) {
1740 1781 // TODO: handle exception
1741 1782 e.printStackTrace();
... ... @@ -1750,7 +1791,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1750 1791 listI.add(resList.iterator());
1751 1792 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
1752 1793 ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_map.xls",
1753   - path+"export/线路首末班明细.xls");
  1794 + path+"export/" + dateTime + "-" + lineName + "-线路首末班明细.xls");
1754 1795 } catch (Exception e) {
1755 1796 // TODO: handle exception
1756 1797 e.printStackTrace();
... ... @@ -1765,7 +1806,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1765 1806 listI.add(resList.iterator());
1766 1807 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
1767 1808 ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_delay.xls",
1768   - path+"export/首末班误点班次.xls");
  1809 + path+"export/" + dateTime + "-" + lineName + "-首末班误点班次.xls");
1769 1810 } catch (Exception e) {
1770 1811 // TODO: handle exception
1771 1812 e.printStackTrace();
... ... @@ -2008,11 +2049,23 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2008 2049 // TODO Auto-generated catch block
2009 2050 e.printStackTrace();
2010 2051 }
  2052 +
  2053 + long min = 0, max = 0;
  2054 + for(Map<String, Object> m : list){
  2055 + long l = Long.valueOf(m.get("id").toString());
  2056 + if(min == 0 || l < min){
  2057 + min = l;
  2058 + }
  2059 + if(l > max){
  2060 + max = l;
  2061 + }
  2062 + }
2011 2063  
2012 2064 sql="SELECT sch,TIMESTAMP,reply46,reply47,reply46time,reply47time"
2013 2065 + " FROM bsth_v_directive_60 WHERE is_dispatch = 1 AND sch is not null"
2014 2066 + " AND TIMESTAMP >= "+(dateTime.getTime())
2015   - + " AND TIMESTAMP < "+(dateTime.getTime() + 1000*60*60*24);
  2067 + + " AND TIMESTAMP < "+(dateTime.getTime() + 1000*60*60*24)
  2068 + + " AND sch >= "+min+" AND sch <= "+max;
2016 2069  
2017 2070 List<Map<String, Object>> list2 = jdbcTemplate.query(sql,
2018 2071 new RowMapper<Map<String, Object>>(){
... ... @@ -2125,6 +2178,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2125 2178 }
2126 2179  
2127 2180 if(type.equals("export")){
  2181 + String lineName = "";
  2182 + if(map.containsKey("lineName"))
  2183 + lineName = map.get("lineName").toString();
2128 2184 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
2129 2185 sdfSimple = new SimpleDateFormat("yyyyMMdd");
2130 2186 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -2134,7 +2190,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2134 2190 listI.add(list_.iterator());
2135 2191 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
2136 2192 ee.excelReplace(listI, new Object[] { m }, path+"mould/commandState.xls",
2137   - path+"export/指令状态分析" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  2193 + path+"export/" + sdfSimple.format(sdfMonth.parse(date))
  2194 + + "-" + lineName + "-指令状态分析.xls");
2138 2195 } catch (Exception e) {
2139 2196 // TODO: handle exception
2140 2197 e.printStackTrace();
... ... @@ -2187,11 +2244,23 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2187 2244 // TODO Auto-generated catch block
2188 2245 e.printStackTrace();
2189 2246 }
  2247 +
  2248 + long min = 0, max = 0;
  2249 + for(Map<String, Object> m : list){
  2250 + long l = Long.valueOf(m.get("id").toString());
  2251 + if(min == 0 || l < min){
  2252 + min = l;
  2253 + }
  2254 + if(l > max){
  2255 + max = l;
  2256 + }
  2257 + }
2190 2258  
2191 2259 sql="SELECT sch,TIMESTAMP,reply46,reply47,reply46time,reply47time"
2192 2260 + " FROM bsth_v_directive_60 WHERE is_dispatch = 1 AND sch is not null"
2193 2261 + " AND TIMESTAMP >= "+(dateTime.getTime())
2194   - + " AND TIMESTAMP < "+(dateTime.getTime() + 1000*60*60*24);
  2262 + + " AND TIMESTAMP < "+(dateTime.getTime() + 1000*60*60*24)
  2263 + + " AND sch >= "+min+" AND sch <= "+max;
2195 2264  
2196 2265 List<Map<String, Object>> list2 = jdbcTemplate.query(sql,
2197 2266 new RowMapper<Map<String, Object>>(){
... ... @@ -2309,6 +2378,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2309 2378  
2310 2379  
2311 2380 if(type.equals("export")){
  2381 + String lineName = "";
  2382 + if(map.containsKey("lineName"))
  2383 + lineName = map.get("lineName").toString();
2312 2384 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
2313 2385 sdfSimple = new SimpleDateFormat("yyyyMMdd");
2314 2386 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -2319,7 +2391,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2319 2391 listI.add(list_.iterator());
2320 2392 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
2321 2393 ee.excelReplace(listI, new Object[] { m }, path+"mould/commandState1.xls",
2322   - path+"export/线路指令状态分析" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  2394 + path+"export/" + sdfSimple.format(sdfMonth.parse(date))
  2395 + + "-" + lineName + "-线路指令状态分析.xls");
2323 2396 } catch (Exception e) {
2324 2397 // TODO: handle exception
2325 2398 e.printStackTrace();
... ... @@ -2337,7 +2410,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2337 2410 String date = map.get("date").toString();
2338 2411 String jgh = map.get("jgh").toString();
2339 2412 // String code = map.get("code").toString();
2340   - String type = map.get("type").toString();
  2413 + String type = "";
  2414 + if(map.containsKey("type"))
  2415 + type = map.get("type").toString().trim();
2341 2416  
2342 2417 String sql_="select * from bsth_c_s_sp_info_real "
2343 2418 + " WHERE schedule_date_str = '"+date+"' and j_gh = '"+jgh+"'";
... ... @@ -2409,6 +2484,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2409 2484 }
2410 2485  
2411 2486 if(type.equals("export")){
  2487 + String jName = map.get("jName").toString();
2412 2488 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
2413 2489 sdfSimple = new SimpleDateFormat("yyyyMMdd");
2414 2490 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
... ... @@ -2418,7 +2494,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
2418 2494 listI.add(list_.iterator());
2419 2495 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
2420 2496 ee.excelReplace(listI, new Object[] { m }, path+"mould/commandState2.xls",
2421   - path+"export/指令状态明细" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  2497 + path+"export/" + sdfSimple.format(sdfMonth.parse(date))
  2498 + + "-" + jName + "-指令状态明细.xls");
2422 2499 } catch (Exception e) {
2423 2500 // TODO: handle exception
2424 2501 e.printStackTrace();
... ...
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
... ... @@ -145,8 +145,8 @@ public class TTInfoDetailServiceImpl extends BServiceImpl&lt;TTInfoDetail, Long&gt; im
145 145 }
146 146  
147 147 @Override
148   - public DataToolsFile exportDynamicTTinfo(TTinfoDetailDynamicData.DTInfos dtInfos) throws ScheduleException {
149   - return tTinfoDetailDynamicData.exportDynamicTTinfo(dtInfos);
  148 + public DataToolsFile exportDynamicTTinfo(TTinfoDetailDynamicData.DTInfos dtInfos, DataToolsFileType type) throws ScheduleException {
  149 + return tTinfoDetailDynamicData.exportDynamicTTinfo(dtInfos, type);
150 150 }
151 151  
152 152 @Override
... ...
src/main/resources/fatso/package.json
1   -{
2   - "name": "fatso",
3   - "version": "1.0.0",
4   - "description": "子页面js检查、合并、压缩等处理",
5   - "main": "start.js",
6   - "scripts": {
7   - "test": "echo \"Error: no test specified\" && exit 1"
8   - },
9   - "author": "panzhaov5",
10   - "license": "ISC",
11   - "dependencies": {
12   - "cheerio": "^0.20.0",
13   - "clean-css": "^4.0.12",
14   - "colors": "^1.1.2",
15   - "eventproxy": "^0.3.4",
16   - "uglify-js": "^2.6.2"
17   - }
18   -}
  1 +{
  2 + "name": "fatso",
  3 + "version": "1.0.0",
  4 + "description": "子页面js检查、合并、压缩等处理",
  5 + "main": "start.js",
  6 + "scripts": {
  7 + "test": "echo \"Error: no test specified\" && exit 1"
  8 + },
  9 + "author": "panzhaov5",
  10 + "license": "ISC",
  11 + "dependencies": {
  12 + "cheerio": "^0.20.0",
  13 + "clean-css": "^4.0.12",
  14 + "colors": "^1.1.2",
  15 + "eventproxy": "^0.3.4",
  16 + "uglify-js": "^2.6.2"
  17 + }
  18 +}
19 19 \ No newline at end of file
... ...
src/main/resources/static/pages/base/timesmodel/gantt.html
... ... @@ -50,9 +50,31 @@
50 50 <!--<div class="btn-group btn-group-devided checkbtn" data-toggle="buttons">-->
51 51 <!--<a class="btn btn-circle blue checkAdd" href="javascript:;" data-pjax><i class="fa fa-check"></i> 保存数据</a>-->
52 52 <!--</div>-->
53   - <div class="btn-group btn-group-devided exportbtn" data-toggle="buttons">
54   - <!--<a class="btn btn-circle blue exportAdd" href="javascript:;" data-pjax><i class="fa fa-file-excel-o"></i> 导出数据</a>-->
  53 +
  54 + <div class="btn-group exportbtn">
  55 + <a href="javascript:" class="btn red btn-outline btn-circle exportAdd" data-toggle="dropdown">
  56 + <i class="fa fa-file-excel-o"></i>
  57 + <span class="exportAddSpan">导出数据</span>
  58 + <i class="fa fa-angle-down"></i>
  59 + </a>
  60 + <ul class="dropdown-menu pull-right">
  61 + <li>
  62 + <a href="javascript:" class="tool-action exportAddXls">
  63 + <i class="fa fa-file-excel-o"></i>
  64 + Excel97 xls
  65 + </a>
  66 + </li>
  67 + <li>
  68 + <a href="javascript:" class="tool-action exportAddXlsx">
  69 + <i class="fa fa-file-excel-o"></i>
  70 + Excel2007 xlsx
  71 + </a>
  72 + </li>
  73 + </ul>
55 74 </div>
  75 +
  76 +
  77 +
56 78 <div class="btn-group checkbtn">
57 79 <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown" aria-expanded="false">
58 80 <i class="fa fa-cog"></i>
... ...
src/main/resources/static/pages/base/timesmodel/js/gantt.js
... ... @@ -83,7 +83,6 @@
83 83 // TODO:绘制gantt图表
84 84 // TODO:var seDate = getksjssj(null,seMap.s); 关联参数必须设置
85 85 // TODO:CSMap.maxCar 之后要设定一下的
86   - $(".exportbtn").html("<a class=\"btn btn-circle blue exportAdd\" href=\"javascript:;\" data-pjax><i class=\"fa fa-file-excel-o\"></i> 导出数据</a>");
87 86 data = Main_v2.BXPplaceClassesTime03(_paramObj, CSMap.maxCar);
88 87 Main_v2.exportDataConfig(data.aInternalLpObj);
89 88 }
... ...
src/main/resources/static/pages/base/timesmodel/js/v2/core/InternalScheduleObj.js
... ... @@ -1548,6 +1548,8 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) {
1548 1548 oLp.fnGetBcChainInfo(0)["e_q"],
1549 1549 oLp.fnGetBcChainInfo(0)["e_b"]
1550 1550 );
  1551 + oEndBc.fnSetIsLastBc(false); // 有可能最后一个班次是吃饭班次,重置
  1552 + oEndBc.fnSetEatTime(0); // 有可能最后一个班次是吃饭班次,重置
1551 1553 aOtherBc.push(_factory.createBcObj(
1552 1554 oLp, "in", true, 1,
1553 1555 oEndBc.getArrTimeObj(),
... ...
src/main/resources/static/pages/base/timesmodel/js/v2/main_v2.js
... ... @@ -821,7 +821,7 @@ var Main_v2 = function() {
821 821 * @param aInternalLpObj 内部路牌对象列表
822 822 */
823 823 exportDataConfig: function(aInternalLpObj) {
824   - $('.exportAdd').on('click',function() {
  824 + $('.exportAddXls').on('click', function() {
825 825 var aInfos = {
826 826 "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表
827 827 "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj) // 统计项目列表
... ... @@ -830,12 +830,12 @@ var Main_v2 = function() {
830 830 console.log(aInfos);
831 831  
832 832 $(".exportAdd").addClass("disabled");
833   - $(".exportAdd").html("<i class=\"fa fa-spinner\" aria-hidden=\"true\"></i>" + " 正在导出...");
  833 + $(".exportAddSpan").html("正在导出...");
834 834  
835 835 // 提交
836 836 $.ajax({
837 837 type: 'POST',
838   - url: "/tidc/exportDTDFile",
  838 + url: "/tidc/exportDTDFile/xls",
839 839 dataType: 'binary',
840 840 contentType: "application/json",
841 841 data: JSON.stringify(aInfos),
... ... @@ -843,16 +843,48 @@ var Main_v2 = function() {
843 843 Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xls");
844 844  
845 845 $(".exportAdd").removeClass("disabled");
846   - $(".exportAdd").html("<i class=\"fa fa-file-excel-o\"></i>" + " 导出数据");
  846 + $(".exportAddSpan").html(" 导出数据");
847 847 },
848 848 error: function(xhr, type){
849 849 alert('错误:TODO');
850 850  
851 851 $(".exportAdd").removeClass("disabled");
852   - $(".exportAdd").html("<i class=\"fa fa-file-excel-o\"></i>" + " 导出数据");
  852 + $(".exportAddSpan").html(" 导出数据");
853 853 }
854 854 });
  855 + });
  856 +
  857 + $('.exportAddXlsx').on('click', function() {
  858 + var aInfos = {
  859 + "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表
  860 + "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj) // 统计项目列表
  861 + };
  862 +
  863 + console.log(aInfos);
  864 +
  865 + $(".exportAdd").addClass("disabled");
  866 + $(".exportAddSpan").html("正在导出...");
  867 +
  868 + // 提交
  869 + $.ajax({
  870 + type: 'POST',
  871 + url: "/tidc/exportDTDFile/xlsx",
  872 + dataType: 'binary',
  873 + contentType: "application/json",
  874 + data: JSON.stringify(aInfos),
  875 + success: function(data){
  876 + Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xlsx");
855 877  
  878 + $(".exportAdd").removeClass("disabled");
  879 + $(".exportAddSpan").html(" 导出数据");
  880 + },
  881 + error: function(xhr, type){
  882 + alert('错误:TODO');
  883 +
  884 + $(".exportAdd").removeClass("disabled");
  885 + $(".exportAddSpan").html(" 导出数据");
  886 + }
  887 + });
856 888 });
857 889 },
858 890  
... ...
src/main/resources/static/pages/base/timesmodel/paramadd.html
1 1 <!-- 统计数据 -->
  2 +<style>
  3 + .form-control:focus {
  4 + border-color: #53ced9;
  5 + }
  6 + .tagsDiv {
  7 + border: 1px solid #c2cad8;
  8 + margin-left: 15px;
  9 + padding: 4px 15px 4px 15px;
  10 + width: 50%;
  11 + }
  12 +</style>
2 13 <div class="modal fade" id="paramadd_mobal" tabindex="-1" role="basic" aria-hidden="true">
3   - <div class="modal-dialog" style="margin-left: 200px;">
4   - <div class="modal-content" style="width: 900px;">
  14 + <div class="modal-dialog" style="margin-left: 100px;">
  15 + <div class="modal-content" style="width: 1000px;">
5 16 <div class="modal-header">
6 17 <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
7 18 <h4 class="modal-title">参数数据 </h4>
... ... @@ -318,6 +329,54 @@
318 329 </div>
319 330 </div>
320 331  
  332 + <div class="form-group">
  333 + <div class="col-md-6">
  334 + <label class="control-label col-md-5"><span class="required"> * </span>停站类型 :</label>
  335 + <div class="col-md-5 tagsDiv">
  336 + <div class="row" style="margin-left: 15px;">
  337 + <input type="text" value="{{map.stt}}" name="stt" id="stoptype_tagsinput" style="display: none;">
  338 + </div>
  339 +
  340 + <div class="row" style="margin-top: 10px;">
  341 + <label class="control-label col-md-4">停站类型:</label>
  342 + <div class="col-md-8">
  343 + <select name="stopType" class="form-control" id="stopType_id">
  344 + <option value="">-- 请选择停站类型 --</option>
  345 + <option value="0">主站停站</option>
  346 + <option value="1">双向停站</option>
  347 + </select>
  348 + </div>
  349 + </div>
  350 +
  351 + <div class="row" style="margin-top: 10px;">
  352 + <label class="control-label col-md-4">主站:</label>
  353 + <div class="col-md-8">
  354 + <select name="masterStop" class="form-control" id="masterStop_id">
  355 + <option value="">请选择...</option>
  356 + <option value="0">{{map.startStationName}}</option>
  357 + <option value="1">{{map.endStationName}}</option>
  358 + </select>
  359 + </div>
  360 + </div>
  361 +
  362 + <div class="row" style="margin-top: 10px;margin-left: 116px;">
  363 + <a href="javascript:" class="btn red" id="stoptype_tagsinput_add">添加</a>
  364 + </div>
  365 + </div>
  366 +
  367 + </div>
  368 +
  369 + <div class="col-md-6">
  370 + <label class="control-label col-md-5">
  371 + <span class="required"> * </span> 建议高峰配车数 :</label>
  372 + <div class="col-md-5">
  373 + <input type="text" class="form-control" placeholder="车辆数" name="gfjypcs"
  374 + id="gfjypcsInput" min="1" value="{{map.gfjypcs}}">
  375 + </div>
  376 + </div>
  377 +
  378 + </div>
  379 +
321 380 <!-- 隐藏字段-时间 -->
322 381 <input type="hidden" name="skbName" value="{{map.skbName}}" id="skbName_id"/>
323 382 <input type="hidden" name="skbmc" value="{{map.skbmc}}" id="skbmc_id"/>
... ... @@ -423,6 +482,8 @@
423 482 // 1、 获取表单内容,并序列化
424 483 var fp = form.serializeJSON();
425 484  
  485 + console.log(fp);
  486 +
426 487 // 2、重新刷新表单数据
427 488 var ganttMap = JSON.parse(window.localStorage.Gantt_AgursData);
428 489 var key;
... ... @@ -431,6 +492,8 @@
431 492 if (ganttMap[key] != fp[key]) {
432 493 ganttMap[key] = fp[key];
433 494 }
  495 + } else {
  496 + ganttMap[key] = fp[key];
434 497 }
435 498 }
436 499 window.localStorage.setItem("Gantt_AgursData",JSON.stringify(ganttMap));
... ... @@ -440,7 +503,7 @@
440 503 var paramObj = pp[0];
441 504 var dataMap = pp[1];
442 505 var csMap = getCSMap(paramObj);
443   - console.log(graph);
  506 + // console.log(graph);
444 507 var data = Main_v2.BXPplaceClassesTime03(paramObj, csMap.maxCar);
445 508 Main_v2.exportDataConfig(data.aInternalLpObj);
446 509  
... ... @@ -491,6 +554,8 @@
491 554 opt.push("<option value='1'>" + d.stationName + "</option>");
492 555 }
493 556 });
  557 + initTagsinput(opt.join(","));
  558 +
494 559 opt.push("<option value='allYes'>起终点站都可以</option>");
495 560 $('#cfdd_id').html(opt.join(""));
496 561 $('#cfdd_id').val(param.cfdd);
... ... @@ -524,10 +589,62 @@
524 589 $('#lateStartTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
525 590 $('#lateEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'});
526 591  
  592 + });
  593 + });
  594 +
  595 + function initTagsinput(htmlStr) {
  596 + $('#masterStop_id').html(htmlStr);
  597 +
  598 + var elt = $('#stoptype_tagsinput');
  599 + var value = elt.val();
  600 + var stoptype = value.split("/")[0];
  601 + var masterstop = value.split("/")[1];
  602 +
  603 + $('#stopType_id').val(stoptype);
  604 + $('#masterStop_id').val(masterstop);
527 605  
  606 + elt.tagsinput({
  607 + tagClass: function(item) {
  608 + return 'label label-danger label-important';
  609 + },
  610 + itemValue: 'value',
  611 + itemText: 'text'
  612 + });
528 613  
  614 + $('#stoptype_tagsinput').on('beforeItemAdd', function(event) {
  615 + // TODO:这里可以做一些逻辑判定
529 616 });
530   - });
  617 +
  618 + $('#stoptype_tagsinput_add').on('click', function(){
  619 + var stoptype = $("#stopType_id").val();
  620 + var masterstop = $("#masterStop_id").val();
  621 + var masterstop_text = $("#masterStop_id option:selected").text();
  622 +
  623 + if (stoptype && stoptype != "") {
  624 + if (stoptype == "0" && masterstop && masterstop != "") {
  625 + elt.tagsinput('add', {
  626 + "value": stoptype + '/' + masterstop,
  627 + "text": "主站停站" + "/" + masterstop_text
  628 + });
  629 + } else {
  630 + elt.tagsinput('add', {
  631 + "value": 1,
  632 + "text": "双向停站"
  633 + });
  634 + }
  635 + }
  636 + });
  637 +
  638 + if (stoptype && stoptype != "") {
  639 + elt.tagsinput('add', {
  640 + "value": stoptype + '/' + masterstop,
  641 + "text":
  642 + $("#stopType_id option:selected").text() + "/" +
  643 + $("#masterStop_id option:selected").text()
  644 + });
  645 + }
  646 +
  647 + }
531 648  
532 649 function getMinDate(d1,d2) {
533 650 // 1、定义返回字符串.
... ...
src/main/resources/static/pages/calc/company/countBusMileage.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;margin-left: 28px; " id="gsdmDiv">
  41 + <span class="item-label" style="width: 80px;">公司: </span>
  42 + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
  43 + </div>
  44 + <div style="display: inline-block; margin-left: 29px;" id="fgsdmDiv">
  45 + <span class="item-label" style="width: 80px;">分公司: </span>
  46 + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
  47 + </div>
  48 + <div style="display: inline-block;margin-left: 43px;">
  49 + <span class="item-label" style="width: 80px;">线路: </span>
  50 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  51 + </div>
  52 + <div style="margin-top: 2px"></div>
  53 +
  54 + <div style="display: inline-block;">
  55 + <span class="item-label" style="width: 80px;">开始时间: </span>
  56 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  57 + </div>
  58 + <div style="display: inline-block;margin-left: 15px;">
  59 + <span class="item-label" style="width: 80px;">结束时间: </span>
  60 + <input class="form-control" type="text" id="date2" style="width: 180px;"/>
  61 + </div>
  62 + <div style="display: inline-block;margin-left: 15px;">
  63 + <span class="item-label" style="width: 80px;">显示分类: </span>
  64 + <select class="form-control" style="width: 120px;" id="zt">
  65 + <option value="zbh">车辆</option>
  66 + <option value="js">驾/售</option>
  67 + </select>
  68 + </div>
  69 + <div class="form-group" style="margin-left: 55px;">
  70 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  71 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  72 + </div>
  73 + </form>
  74 + </div>
  75 + <div class="portlet-body">
  76 + <div class="table-container" id="countLine" style="margin-top: 10px;overflow:auto;min-width: 906px">
  77 + <table class="table table-bordered table-hover table-checkable" id="forms">
  78 +
  79 +
  80 + </table>
  81 + </div>
  82 + </div>
  83 + </div>
  84 + </div>
  85 +</div>
  86 +
  87 +<script>
  88 + $(function(){
  89 + $('#export').attr('disabled', "true");
  90 +
  91 + // 关闭左侧栏
  92 + if (!$('body').hasClass('page-sidebar-closed'))
  93 + $('.menu-toggler.sidebar-toggler').click();
  94 +
  95 + var d = new Date();
  96 + d.setTime(d.getTime() - 4*1000*60*60*24);
  97 + var year = d.getFullYear();
  98 + var month = d.getMonth() + 1;
  99 + var day = d.getDate();
  100 + if(month < 10)
  101 + month = "0" + month;
  102 + if(day < 10)
  103 + day = "0" + day;
  104 + var dateTime = year + "-" + month + "-" + day;
  105 + $("#date").datetimepicker({
  106 + format : 'YYYY-MM-DD',
  107 + locale : 'zh-cn',
  108 + maxDate : dateTime
  109 + });
  110 + $("#date2").datetimepicker({
  111 + format : 'YYYY-MM-DD',
  112 + locale : 'zh-cn',
  113 + maxDate : dateTime
  114 + });
  115 + $("#date").val(dateTime);
  116 + $("#date2").val(dateTime);
  117 +
  118 + var fage=false;
  119 + var obj = [];
  120 + var xlList;
  121 + $.get('/report/lineList',function(result){
  122 + xlList=result;
  123 + $.get('/user/companyData', function(result){
  124 + obj = result;
  125 + var options = '';
  126 + for(var i = 0; i < obj.length; i++){
  127 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  128 + }
  129 +
  130 + if(obj.length ==0){
  131 + $("#gsdmDiv").css('display','none');
  132 + }else if(obj.length ==1){
  133 + $("#gsdmDiv").css('display','none');
  134 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  135 + $('#fgsdmDiv').css('display','none');
  136 + }
  137 + $('#gsdm').html(options);
  138 + updateCompany();
  139 + });
  140 + })
  141 + $("#gsdm").on("change",updateCompany);
  142 + function updateCompany(){
  143 + var company = $('#gsdm').val();
  144 + var options = '';
  145 + for(var i = 0; i < obj.length; i++){
  146 + if(obj[i].companyCode == company){
  147 + var children = obj[i].children;
  148 + for(var j = 0; j < children.length; j++){
  149 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  150 + }
  151 + }
  152 + }
  153 + $('#fgsdm').html(options);
  154 + }
  155 +
  156 +
  157 + var tempData = {};
  158 + $.get('/report/lineList',function(xlList){
  159 + var data = [];
  160 +// data.push({id: " ", text: "全部线路"});
  161 + $.get('/user/companyData', function(result){
  162 + for(var i = 0; i < result.length; i++){
  163 + var companyCode = result[i].companyCode;
  164 + var children = result[i].children;
  165 + for(var j = 0; j < children.length; j++){
  166 + var code = children[j].code;
  167 + for(var k=0;k < xlList.length;k++ ){
  168 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  169 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  170 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  171 + }
  172 + }
  173 + }
  174 + }
  175 + initPinYinSelect2('#line',data,'');
  176 +
  177 + });
  178 + });
  179 +
  180 + $("#line").on("change", function(){
  181 + if($("#line").val() == " "){
  182 + $("#gsdm").attr("disabled", false);
  183 + $("#fgsdm").attr("disabled", false);
  184 + } else {
  185 + var temp = tempData[$("#line").val()].split(":");
  186 + $("#gsdm").val(temp[0]);
  187 + updateCompany();
  188 + $("#fgsdm").val(temp[1]);
  189 + $("#gsdm").attr("disabled", true);
  190 + $("#fgsdm").attr("disabled", true);
  191 + }
  192 + });
  193 +
  194 + var line ="";
  195 + var xlName ="";
  196 + var date = "";
  197 + var date2 ="";
  198 + var gsdm="";
  199 + var fgsdm="";
  200 + var zt="";
  201 + $("#countLine").height($(window).height()-280);
  202 + $("#query").on("click",function(){
  203 + $("#countLine").height($(window).height()-280);
  204 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  205 + layer.msg("请选择时间范围!");
  206 + return;
  207 + }
  208 + if($("#date2").val() == null || $("#date2").val().trim().length == 0){
  209 + layer.msg("请选择时间范围!");
  210 + return;
  211 + }
  212 + line = $("#line").val();
  213 + date = $("#date").val();
  214 + date2 =$("#date2").val();
  215 + gsdm =$("#gsdm").val();
  216 + fgsdm=$("#fgsdm").val();
  217 + zt=$("#zt").val();
  218 + xlName = $("#select2-line-container").html();
  219 + if(xlName == "全部线路")
  220 + xlName = $('#fgsdm option:selected').text();
  221 + if(line=="请选择"){
  222 + line="";
  223 + }
  224 + if(date==null || date =="" ||date2==null || date2 ==""){
  225 + layer.msg('请选择时间段.');
  226 + }else{
  227 + var params = {};
  228 + params['gsdm'] = gsdm;
  229 + params['fgsdm'] =fgsdm ;
  230 + params['line'] = line;
  231 + params['date'] = date;
  232 + params['date2'] = date2;
  233 + params['xlName'] = xlName;
  234 + params['zt']=zt;
  235 + params['type'] = "query";
  236 + var tbodyHtml = template('countBusDailyGs',{list:""});
  237 + var i = layer.load(2);
  238 + $get('/calcWaybill/getBusMileage',params,function(result){
  239 + layer.close(i);
  240 + // 把数据填充到模版中
  241 + var tbodyHtml = template('countBusDailyGs',{list:result,zt:zt});
  242 + // 把渲染好的模版html文本追加到表格中
  243 + $('#forms').html(tbodyHtml);
  244 +
  245 + if(result.length == 0)
  246 + $("#export").attr('disabled',"true");
  247 + else
  248 + $("#export").removeAttr("disabled");
  249 + });
  250 + }
  251 +
  252 + });
  253 +
  254 + $("#export").on("click",function(){
  255 + var params = {};
  256 + params['gsdm'] = gsdm;
  257 + params['fgsdm'] =fgsdm;
  258 + params['line'] = line;
  259 + params['date'] = date;
  260 + params['date2'] = date2;
  261 + params['xlName'] = xlName;
  262 + params['zt']=zt;
  263 + params['type'] = "export";
  264 + params['by']='gs';
  265 + var i = layer.load(2);
  266 + $get('/calcWaybill/getBusMileage',params,function(result){
  267 + var dateTime = "";
  268 + if(date == date2){
  269 + dateTime = moment(date).format("YYYYMMDD");
  270 + } else {
  271 + dateTime = moment(date).format("YYYYMMDD")
  272 + +"-"+moment(date2).format("YYYYMMDD");
  273 + }
  274 + window.open("/downloadFile/download?fileName="
  275 + +dateTime+"-"+xlName+"-路单数据统计表");
  276 + layer.close(i);
  277 + });
  278 + });
  279 +
  280 + });
  281 +</script>
  282 +<script type="text/html" id="countBusDailyGs">
  283 + <thead>
  284 + <tr>
  285 + <th colspan="31">路单数据统计表</th>
  286 + </tr>
  287 + <tr>
  288 + <td>序号</td>
  289 + <td>日期</td>
  290 + <td>所属公司</td>
  291 + <td>线路</td>
  292 + <td>车号</td>
  293 + {{if zt=='js'}}
  294 + <td>司机职号</td>
  295 + <td>司机姓名</td>
  296 + <td>售票员职号</td>
  297 + <td>售票员姓名</td>
  298 + {{/if}}
  299 + <td>行驶里程(包括空放)</td>
  300 + <td>计划内营运里程</td>
  301 + <td><label>临时性</label><label>多样化</label><label>调度营</label><label>运里程</label></td>
  302 + <td><label>计划内</label><label>进出场</label><label>空驶</label></td>
  303 + <td><label>计划外</label><label>进出场</label><label>空驶</label></td>
  304 + <td>空放空驶</td>
  305 + <td><label>故障</label><label>进出场</label><label>空驶</label></td>
  306 + <td><label>肇事</label><label>进出场</label><label>空驶</label></td>
  307 + <td><label>纠纷</label><label>进出场</label><label>空驶</label></td>
  308 + <td><label>其他</label><label>进出场</label><label>空驶</label></td>
  309 + <td>临加营运公里</td>
  310 + <td>临加进出场空驶</td>
  311 + <td>临加空放空驶</td>
  312 + <td>电耗量</td>
  313 + <td>加电量</td>
  314 + <td>耗油量</td>
  315 + <td>加注量</td>
  316 + <td>非营业用油</td>
  317 + <td>计划总公里</td>
  318 + </tr>
  319 + </thead>
  320 + <tbody >
  321 + {{each list as obj i}}
  322 + <tr>
  323 + <td>{{i+1}}</td>
  324 + <td>{{obj.rq}}</td>
  325 + <td>{{obj.fgs}}</td>
  326 + <td>{{obj.xlName}}</td>
  327 + <td>{{obj.nbbm}}</td>
  328 + {{if zt=='js'}}
  329 + <td>{{obj.jGh}}</td>
  330 + <td>{{obj.jName}}</td>
  331 + <td>{{obj.sGh}}</td>
  332 + <td>{{obj.sName}}</td>
  333 + {{/if}}
  334 + <td>{{obj.zlc}}</td>
  335 + <td>{{obj.jhnlc}}</td>
  336 + <td>{{obj.jhwlc}}</td>
  337 + <td>{{obj.jhnjcclc}}</td>
  338 + <td>{{obj.jhwjcclc}}</td>
  339 + <td>{{obj.kfks}}</td>
  340 + <td>{{obj.zrwjcclc}}</td>
  341 + <td>{{obj.zrwjcclc1}}</td>
  342 + <td>{{obj.zrwjcclc2}}</td>
  343 + <td>{{obj.zrwjcclcqt}}</td>
  344 + <td>{{obj.ljyy}}</td>
  345 + <td>{{obj.ljjcc}}</td>
  346 + <td>{{obj.ljkfks}}</td>
  347 + <td>{{obj.dhl}}</td>
  348 + <td>{{obj.cdl}}</td>
  349 + <td>{{obj.yhl}}</td>
  350 + <td>{{obj.jzl}}</td>
  351 + <td>{{obj.hyl}}</td>
  352 + <td>{{obj.jhzlc}}</td>
  353 + </tr>
  354 + {{/each}}
  355 + {{if list.length == 0}}
  356 + <tr>
  357 + <td colspan="28"><h6 class="muted">没有找到相关数据</h6></td>
  358 + </tr>
  359 + {{/if}}
  360 +</tbody>
  361 +</script>
0 362 \ No newline at end of file
... ...
src/main/resources/static/pages/calc/company/countLineMileage.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; " id="gsdmDiv">
  41 + <span class="item-label" style="width: 80px;">公司: </span>
  42 + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
  43 + </div>
  44 + <div style="display: inline-block; margin-left: 29px;" id="fgsdmDiv">
  45 + <span class="item-label" style="width: 80px;">分公司: </span>
  46 + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
  47 + </div>
  48 + <div style="margin-top: 2px"></div>
  49 + <div style="display: inline-block;">
  50 + <span class="item-label" style="width: 80px;">线路: </span>
  51 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  52 + </div>
  53 + <div style="display: inline-block;margin-left: 15px;">
  54 + <span class="item-label" style="width: 80px;">开始时间: </span>
  55 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  56 + </div>
  57 + <div style="display: inline-block;margin-left: 15px;">
  58 + <span class="item-label" style="width: 80px;">结束时间: </span>
  59 + <input class="form-control" type="text" id="date2" style="width: 180px;"/>
  60 + </div>
  61 + <div class="form-group">
  62 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  63 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  64 + </div>
  65 + </form>
  66 + </div>
  67 + <div class="portlet-body">
  68 + <div class="table-container" id="countLine" style="margin-top: 10px;overflow:auto;min-width: 906px">
  69 + <table class="table table-bordered table-hover table-checkable" id="forms">
  70 + <thead>
  71 + <tr>
  72 + <th colspan="31"><label id="datetodate"></label>线路公里统计表</th>
  73 + </tr>
  74 + <tr>
  75 + <td rowspan="2"><span>公司</span></td>
  76 + <td rowspan="2"><span>分公司</span></td>
  77 + <td rowspan="2"><span>路线别</span></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 colspan="2"><label>实际营</label><label>运公里</label></td>
  83 + <td colspan="7"><label>实际空</label><label>驶公里</label></td>
  84 + <td rowspan="2"><label>少驶营</label><label>运里程</label></td>
  85 + <td colspan="11">少驶原因(公里)</td>
  86 + <td colspan="3">临加公里</td>
  87 + </tr>
  88 + <tr>
  89 + <td><label>计划内</label><label>营运</label><label>里程</label></td>
  90 + <td><label>临时性</label><label>多样化</label><label>调度营</label><label>运里程</label></td>
  91 + <td><label>计划内</label><label>进出场</label><label>空驶</label></td>
  92 + <td><label>计划外</label><label>进出场</label><label>空驶</label></td>
  93 + <td><label>故障</label><label>进出场</label><label>空驶</label></td>
  94 + <td><label>肇事</label><label>进出场</label><label>空驶</label></td>
  95 + <td><label>纠纷</label><label>进出场</label><label>空驶</label></td>
  96 + <td><label>其他</label><label>进出场</label><label>空驶</label></td>
  97 + <td><label>空放 </label><label>空驶</label></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><label>临加营</label><label>运公里</label></td>
  110 + <td><label>临加进出</label><label>场空驶</label></td>
  111 + <td><label>临加</label><label>空放</label><label>空驶</label></td>
  112 + </tr>
  113 +
  114 + </thead>
  115 + <tbody class="countLineNb">
  116 +
  117 + </tbody>
  118 + </table>
  119 + </div>
  120 + </div>
  121 + </div>
  122 + </div>
  123 +</div>
  124 +
  125 +<script>
  126 + $(function(){
  127 + $('#export').attr('disabled', "true");
  128 +
  129 + // 关闭左侧栏
  130 + if (!$('body').hasClass('page-sidebar-closed'))
  131 + $('.menu-toggler.sidebar-toggler').click();
  132 +
  133 + var d = new Date();
  134 + d.setTime(d.getTime() - 4*1000*60*60*24);
  135 + var year = d.getFullYear();
  136 + var month = d.getMonth() + 1;
  137 + var day = d.getDate();
  138 + if(month < 10)
  139 + month = "0" + month;
  140 + if(day < 10)
  141 + day = "0" + day;
  142 + var dateTime = year + "-" + month + "-" + day;
  143 + $("#date").datetimepicker({
  144 + format : 'YYYY-MM-DD',
  145 + locale : 'zh-cn',
  146 + maxDate : dateTime
  147 + });
  148 + $("#date2").datetimepicker({
  149 + format : 'YYYY-MM-DD',
  150 + locale : 'zh-cn',
  151 + maxDate : dateTime
  152 + });
  153 + $("#date").val(dateTime);
  154 + $("#date2").val(dateTime);
  155 +
  156 + var fage=false;
  157 + var obj = [];
  158 + var xlList;
  159 + $.get('/report/lineList',function(result){
  160 + xlList=result;
  161 + $.get('/user/companyData', function(result){
  162 + obj = result;
  163 + var options = '';
  164 + for(var i = 0; i < obj.length; i++){
  165 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  166 + }
  167 +
  168 + if(obj.length ==0){
  169 + $("#gsdmDiv").css('display','none');
  170 + }else if(obj.length ==1){
  171 + $("#gsdmDiv").css('display','none');
  172 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  173 + $('#fgsdmDiv').css('display','none');
  174 + }
  175 + $('#gsdm').html(options);
  176 + updateCompany();
  177 + });
  178 + })
  179 + $("#gsdm").on("change",updateCompany);
  180 + function updateCompany(){
  181 + var company = $('#gsdm').val();
  182 + var options = '';
  183 + for(var i = 0; i < obj.length; i++){
  184 + if(obj[i].companyCode == company){
  185 + var children = obj[i].children;
  186 + for(var j = 0; j < children.length; j++){
  187 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  188 + }
  189 + }
  190 + }
  191 + $('#fgsdm').html(options);
  192 + }
  193 +
  194 +
  195 + var tempData = {};
  196 + $.get('/report/lineList',function(xlList){
  197 + var data = [];
  198 + data.push({id: " ", text: "全部线路"});
  199 + $.get('/user/companyData', function(result){
  200 + for(var i = 0; i < result.length; i++){
  201 + var companyCode = result[i].companyCode;
  202 + var children = result[i].children;
  203 + for(var j = 0; j < children.length; j++){
  204 + var code = children[j].code;
  205 + for(var k=0;k < xlList.length;k++ ){
  206 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  207 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  208 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  209 + }
  210 + }
  211 + }
  212 + }
  213 + initPinYinSelect2('#line',data,'');
  214 +
  215 + });
  216 + });
  217 +
  218 + $("#line").on("change", function(){
  219 + if($("#line").val() == " "){
  220 + $("#gsdm").attr("disabled", false);
  221 + $("#fgsdm").attr("disabled", false);
  222 + } else {
  223 + var temp = tempData[$("#line").val()].split(":");
  224 + $("#gsdm").val(temp[0]);
  225 + updateCompany();
  226 + $("#fgsdm").val(temp[1]);
  227 + $("#gsdm").attr("disabled", true);
  228 + $("#fgsdm").attr("disabled", true);
  229 + }
  230 + });
  231 +
  232 + var line ="";
  233 + var xlName ="";
  234 + var date = "";
  235 + var date2 ="";
  236 + var gsdm="";
  237 + var fgsdm="";
  238 + $("#query").on("click",function(){
  239 + $("#countLine").height($(window).height()-280);
  240 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  241 + layer.msg("请选择时间范围!");
  242 + return;
  243 + }
  244 + if($("#date2").val() == null || $("#date2").val().trim().length == 0){
  245 + layer.msg("请选择时间范围!");
  246 + return;
  247 + }
  248 + line = $("#line").val();
  249 + date = $("#date").val();
  250 + date2 =$("#date2").val();
  251 + gsdm =$("#gsdm").val();
  252 + fgsdm=$("#fgsdm").val();
  253 + xlName = $("#select2-line-container").html();
  254 + if(xlName == "全部线路")
  255 + xlName = $('#fgsdm option:selected').text();
  256 + if(line=="请选择"){
  257 + line="";
  258 + }
  259 + if(date==null || date =="" ||date2==null || date2 ==""){
  260 + layer.msg('请选择时间段.');
  261 + }else{
  262 + var params = {};
  263 + params['gsdm'] = gsdm;
  264 + params['fgsdm'] =fgsdm ;
  265 + params['line'] = line;
  266 + params['date'] = date;
  267 + params['date2'] = date2;
  268 + params['xlName'] = xlName;
  269 + params['type'] = "query";
  270 + var i = layer.load(2);
  271 + $get('/calcWaybill/getLineMileage',params,function(result){
  272 + layer.close(i);
  273 + $("#datetodate").html(date+"至"+date2);
  274 + // 把数据填充到模版中
  275 + var tbodyHtml = template('countLineListGs',{list:result});
  276 + // 把渲染好的模版html文本追加到表格中
  277 + $('#forms .countLineNb').html(tbodyHtml);
  278 +
  279 + if(result.length == 0)
  280 + $("#export").attr('disabled',"true");
  281 + else
  282 + $("#export").removeAttr("disabled");
  283 + });
  284 + }
  285 +
  286 + });
  287 + $("#countLine").height($(window).height()-280);
  288 + $("#export").on("click",function(){
  289 + var params = {};
  290 + params['gsdm'] = gsdm;
  291 + params['fgsdm'] =fgsdm;
  292 + params['line'] = line;
  293 + params['date'] = date;
  294 + params['date2'] = date2;
  295 + params['xlName'] = xlName;
  296 + params['type'] = "export";
  297 + params['by']='gs';
  298 + var i = layer.load(2);
  299 + $get('/calcWaybill/getLineMileage',params,function(result){
  300 + var dateTime = "";
  301 + if(date == date2){
  302 + dateTime = moment(date).format("YYYYMMDD");
  303 + } else {
  304 + dateTime = moment(date).format("YYYYMMDD")
  305 + +"-"+moment(date2).format("YYYYMMDD");
  306 + }
  307 + window.open("/downloadFile/download?fileName="
  308 + +dateTime+"-"+xlName+"-线路公里统计表");
  309 + layer.close(i);
  310 + });
  311 + });
  312 + });
  313 +</script>
  314 +<script type="text/html" id="countLineListGs">
  315 + {{each list as obj i}}
  316 + <tr>
  317 + <td>{{obj.gs}}</td>
  318 + <td>{{obj.fgs}}</td>
  319 + <td>{{obj.xlName}}</td>
  320 + <td>{{obj.jhzlc}}</td>
  321 + <td>{{obj.jhlc}}</td>
  322 + <td>{{obj.jcclc}}</td>
  323 + <td>{{obj.sjzgl}}</td>
  324 + <td>{{obj.jhnlc}}</td>
  325 + <td>{{obj.jhwlc}}</td>
  326 + <td>{{obj.jhnjcclc}}</td>
  327 + <td>{{obj.jhwjcclc}}</td>
  328 + <td>{{obj.zrwjcclc}}</td>
  329 + <td>{{obj.zrwjcclc1}}</td>
  330 + <td>{{obj.zrwjcclc2}}</td>
  331 + <td>{{obj.zrwjcclcqt}}</td>
  332 + <td>{{obj.kfks}}</td>
  333 + <td>{{obj.lbss}}</td>
  334 + <td>{{obj.ssgl_lz}}</td>
  335 + <td>{{obj.ssgl_dm}}</td>
  336 + <td>{{obj.ssgl_gz}}</td>
  337 + <td>{{obj.ssgl_jf}}</td>
  338 + <td>{{obj.ssgl_zs}}</td>
  339 + <td>{{obj.ssgl_qr}}</td>
  340 + <td>{{obj.ssgl_qc}}</td>
  341 + <td>{{obj.ssgl_kx}}</td>
  342 + <td>{{obj.ssgl_qh}}</td>
  343 + <td>{{obj.ssgl_yw}}</td>
  344 + <td>{{obj.ssgl_other}}</td>
  345 + <td>{{obj.ljyy}}</td>
  346 + <td>{{obj.ljjcc}}</td>
  347 + <td>{{obj.ljkfks}}</td>
  348 + </tr>
  349 + {{/each}}
  350 + {{if list.length == 0}}
  351 + <tr>
  352 + <td colspan="30"><h6 class="muted">没有找到相关数据</h6></td>
  353 + </tr>
  354 + {{/if}}
  355 +</script>
0 356 \ No newline at end of file
... ...
src/main/resources/static/pages/calc/countBusMileage.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;margin-left: 28px; " id="gsdmDiv">
  41 + <span class="item-label" style="width: 80px;">公司: </span>
  42 + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
  43 + </div>
  44 + <div style="display: inline-block; margin-left: 29px;" id="fgsdmDiv">
  45 + <span class="item-label" style="width: 80px;">分公司: </span>
  46 + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
  47 + </div>
  48 + <div style="display: inline-block;margin-left: 43px;">
  49 + <span class="item-label" style="width: 80px;">线路: </span>
  50 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  51 + </div>
  52 + <div style="margin-top: 2px"></div>
  53 +
  54 + <div style="display: inline-block;">
  55 + <span class="item-label" style="width: 80px;">开始时间: </span>
  56 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  57 + </div>
  58 + <div style="display: inline-block;margin-left: 15px;">
  59 + <span class="item-label" style="width: 80px;">结束时间: </span>
  60 + <input class="form-control" type="text" id="date2" style="width: 180px;"/>
  61 + </div>
  62 + <div style="display: inline-block;margin-left: 15px;">
  63 + <span class="item-label" style="width: 80px;">显示分类: </span>
  64 + <select class="form-control" style="width: 120px;" id="zt">
  65 + <option value="zbh">车辆</option>
  66 + <option value="js">驾/售</option>
  67 + </select>
  68 + </div>
  69 + <div class="form-group" style="margin-left: 55px;">
  70 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  71 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  72 + </div>
  73 + </form>
  74 + </div>
  75 + <div class="portlet-body">
  76 + <div class="table-container" id="countLine" style="margin-top: 10px;overflow:auto;min-width: 906px">
  77 + <table class="table table-bordered table-hover table-checkable" id="forms">
  78 +
  79 +
  80 + </table>
  81 + </div>
  82 + </div>
  83 + </div>
  84 + </div>
  85 +</div>
  86 +
  87 +<script>
  88 + $(function(){
  89 + $('#export').attr('disabled', "true");
  90 +
  91 + // 关闭左侧栏
  92 + if (!$('body').hasClass('page-sidebar-closed'))
  93 + $('.menu-toggler.sidebar-toggler').click();
  94 +
  95 + var d = new Date();
  96 + d.setTime(d.getTime() - 4*1000*60*60*24);
  97 + var year = d.getFullYear();
  98 + var month = d.getMonth() + 1;
  99 + var day = d.getDate();
  100 + if(month < 10)
  101 + month = "0" + month;
  102 + if(day < 10)
  103 + day = "0" + day;
  104 + var dateTime = year + "-" + month + "-" + day;
  105 + $("#date").datetimepicker({
  106 + format : 'YYYY-MM-DD',
  107 + locale : 'zh-cn',
  108 + maxDate : dateTime
  109 + });
  110 + $("#date2").datetimepicker({
  111 + format : 'YYYY-MM-DD',
  112 + locale : 'zh-cn',
  113 + maxDate : dateTime
  114 + });
  115 + $("#date").val(dateTime);
  116 + $("#date2").val(dateTime);
  117 +
  118 + var fage=false;
  119 + var obj = [];
  120 + var xlList;
  121 + $.get('/report/lineList',function(result){
  122 + xlList=result;
  123 + $.get('/user/companyData', function(result){
  124 + obj = result;
  125 + var options = '';
  126 + for(var i = 0; i < obj.length; i++){
  127 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  128 + }
  129 +
  130 + if(obj.length ==0){
  131 + $("#gsdmDiv").css('display','none');
  132 + }else if(obj.length ==1){
  133 + $("#gsdmDiv").css('display','none');
  134 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  135 + $('#fgsdmDiv').css('display','none');
  136 + }
  137 + $('#gsdm').html(options);
  138 + updateCompany();
  139 + });
  140 + })
  141 + $("#gsdm").on("change",updateCompany);
  142 + function updateCompany(){
  143 + var company = $('#gsdm').val();
  144 + var options = '';
  145 + for(var i = 0; i < obj.length; i++){
  146 + if(obj[i].companyCode == company){
  147 + var children = obj[i].children;
  148 + for(var j = 0; j < children.length; j++){
  149 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  150 + }
  151 + }
  152 + }
  153 + $('#fgsdm').html(options);
  154 + }
  155 +
  156 +
  157 + var tempData = {};
  158 + $.get('/report/lineList',function(xlList){
  159 + var data = [];
  160 +// data.push({id: " ", text: "全部线路"});
  161 + $.get('/user/companyData', function(result){
  162 + for(var i = 0; i < result.length; i++){
  163 + var companyCode = result[i].companyCode;
  164 + var children = result[i].children;
  165 + for(var j = 0; j < children.length; j++){
  166 + var code = children[j].code;
  167 + for(var k=0;k < xlList.length;k++ ){
  168 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  169 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  170 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  171 + }
  172 + }
  173 + }
  174 + }
  175 + initPinYinSelect2('#line',data,'');
  176 +
  177 + });
  178 + });
  179 +
  180 + $("#line").on("change", function(){
  181 + if($("#line").val() == " "){
  182 + $("#gsdm").attr("disabled", false);
  183 + $("#fgsdm").attr("disabled", false);
  184 + } else {
  185 + var temp = tempData[$("#line").val()].split(":");
  186 + $("#gsdm").val(temp[0]);
  187 + updateCompany();
  188 + $("#fgsdm").val(temp[1]);
  189 + $("#gsdm").attr("disabled", true);
  190 + $("#fgsdm").attr("disabled", true);
  191 + }
  192 + });
  193 +
  194 + var line ="";
  195 + var xlName ="";
  196 + var date = "";
  197 + var date2 ="";
  198 + var gsdm="";
  199 + var fgsdm="";
  200 + var zt="";
  201 + $("#countLine").height($(window).height()-280);
  202 + $("#query").on("click",function(){
  203 + $("#countLine").height($(window).height()-280);
  204 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  205 + layer.msg("请选择时间范围!");
  206 + return;
  207 + }
  208 + if($("#date2").val() == null || $("#date2").val().trim().length == 0){
  209 + layer.msg("请选择时间范围!");
  210 + return;
  211 + }
  212 + line = $("#line").val();
  213 + date = $("#date").val();
  214 + date2 =$("#date2").val();
  215 + gsdm =$("#gsdm").val();
  216 + fgsdm=$("#fgsdm").val();
  217 + zt=$("#zt").val();
  218 + xlName = $("#select2-line-container").html();
  219 + if(xlName == "全部线路")
  220 + xlName = $('#fgsdm option:selected').text();
  221 + if(line=="请选择"){
  222 + line="";
  223 + }
  224 + if(date==null || date =="" ||date2==null || date2 ==""){
  225 + layer.msg('请选择时间段.');
  226 + }else{
  227 + var params = {};
  228 + params['gsdm'] = gsdm;
  229 + params['fgsdm'] =fgsdm ;
  230 + params['line'] = line;
  231 + params['date'] = date;
  232 + params['date2'] = date2;
  233 + params['xlName'] = xlName;
  234 + params['zt']=zt;
  235 + params['type'] = "query";
  236 + var tbodyHtml = template('countBusDailySj',{list:""});
  237 + var i = layer.load(2);
  238 + $get('/calcWaybill/getBusMileage',params,function(result){
  239 + layer.close(i);
  240 + // 把数据填充到模版中
  241 + var tbodyHtml = template('countBusDailySj',{list:result,zt:zt});
  242 + // 把渲染好的模版html文本追加到表格中
  243 + $('#forms').html(tbodyHtml);
  244 +
  245 + if(result.length == 0)
  246 + $("#export").attr('disabled',"true");
  247 + else
  248 + $("#export").removeAttr("disabled");
  249 + });
  250 + }
  251 +
  252 + });
  253 +
  254 + $("#export").on("click",function(){
  255 + var params = {};
  256 + params['gsdm'] = gsdm;
  257 + params['fgsdm'] =fgsdm;
  258 + params['line'] = line;
  259 + params['date'] = date;
  260 + params['date2'] = date2;
  261 + params['xlName'] = xlName;
  262 + params['zt']=zt;
  263 + params['type'] = "export";
  264 + params['by']='sj';
  265 + var i = layer.load(2);
  266 + $get('/calcWaybill/getBusMileage',params,function(result){
  267 + var dateTime = "";
  268 + if(date == date2){
  269 + dateTime = moment(date).format("YYYYMMDD");
  270 + } else {
  271 + dateTime = moment(date).format("YYYYMMDD")
  272 + +"-"+moment(date2).format("YYYYMMDD");
  273 + }
  274 + window.open("/downloadFile/download?fileName="
  275 + +dateTime+"-"+xlName+"-路单数据统计表");
  276 + layer.close(i);
  277 + });
  278 + });
  279 +
  280 + });
  281 +</script>
  282 +<script type="text/html" id="countBusDailySj">
  283 + <thead>
  284 + <tr>
  285 + <th colspan="31">路单数据统计表</th>
  286 + </tr>
  287 + <tr>
  288 + <td>序号</td>
  289 + <td>日期</td>
  290 + <td>所属公司</td>
  291 + <td>线路</td>
  292 + <td>车号</td>
  293 + {{if zt=='js'}}
  294 + <td>司机职号</td>
  295 + <td>司机姓名</td>
  296 + <td>售票员职号</td>
  297 + <td>售票员姓名</td>
  298 + {{/if}}
  299 + <td>行驶里程(包括空放)</td>
  300 + <td>计划内营运里程</td>
  301 + <td><label>临时性</label><label>多样化</label><label>调度营</label><label>运里程</label></td>
  302 + <td><label>计划内</label><label>进出场</label><label>空驶</label></td>
  303 + <td><label>计划外</label><label>进出场</label><label>空驶</label></td>
  304 + <td>空放空驶</td>
  305 + <td><label>故障</label><label>进出场</label><label>空驶</label></td>
  306 + <td><label>肇事</label><label>进出场</label><label>空驶</label></td>
  307 + <td><label>纠纷</label><label>进出场</label><label>空驶</label></td>
  308 + <td>临加营运公里</td>
  309 + <td>临加进出场空驶</td>
  310 + <td>临加空放空驶</td>
  311 + <td>电耗量</td>
  312 + <td>加电量</td>
  313 + <td>耗油量</td>
  314 + <td>加注量</td>
  315 + <td>非营业用油</td>
  316 + <td>计划总公里</td>
  317 + </tr>
  318 + </thead>
  319 + <tbody >
  320 + {{each list as obj i}}
  321 + <tr>
  322 + <td>{{i+1}}</td>
  323 + <td>{{obj.rq}}</td>
  324 + <td>{{obj.fgs}}</td>
  325 + <td>{{obj.xlName}}</td>
  326 + <td>{{obj.nbbm}}</td>
  327 + {{if zt=='js'}}
  328 + <td>{{obj.jGh}}</td>
  329 + <td>{{obj.jName}}</td>
  330 + <td>{{obj.sGh}}</td>
  331 + <td>{{obj.sName}}</td>
  332 + {{/if}}
  333 + <td>{{obj.zlc}}</td>
  334 + <td>{{obj.jhnlc}}</td>
  335 + <td>{{obj.jhwlc}}</td>
  336 + <td>{{obj.jhnjcclc}}</td>
  337 + <td>{{obj.jhwjcclc_z}}</td>
  338 + <td>{{obj.kfks}}</td>
  339 + <td>{{obj.zrwjcclc}}</td>
  340 + <td>{{obj.zrwjcclc1}}</td>
  341 + <td>{{obj.zrwjcclc2}}</td>
  342 + <td>{{obj.ljyy}}</td>
  343 + <td>{{obj.ljjcc}}</td>
  344 + <td>{{obj.ljkfks}}</td>
  345 + <td>{{obj.dhl}}</td>
  346 + <td>{{obj.cdl}}</td>
  347 + <td>{{obj.yhl}}</td>
  348 + <td>{{obj.jzl}}</td>
  349 + <td>{{obj.hyl}}</td>
  350 + <td>{{obj.jhzlc}}</td>
  351 + </tr>
  352 + {{/each}}
  353 + {{if list.length == 0}}
  354 + <tr>
  355 + <td colspan="26"><h6 class="muted">没有找到相关数据</h6></td>
  356 + </tr>
  357 + {{/if}}
  358 +</tbody>
  359 +</script>
0 360 \ No newline at end of file
... ...
src/main/resources/static/pages/calc/countLineMileage.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; " id="gsdmDiv">
  41 + <span class="item-label" style="width: 80px;">公司: </span>
  42 + <select class="form-control" name="company" id="gsdm" style="width: 180px;"></select>
  43 + </div>
  44 + <div style="display: inline-block; margin-left: 29px;" id="fgsdmDiv">
  45 + <span class="item-label" style="width: 80px;">分公司: </span>
  46 + <select class="form-control" name="subCompany" id="fgsdm" style="width: 180px;"></select>
  47 + </div>
  48 + <div style="margin-top: 2px"></div>
  49 + <div style="display: inline-block;">
  50 + <span class="item-label" style="width: 80px;">线路: </span>
  51 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  52 + </div>
  53 + <div style="display: inline-block;margin-left: 15px;">
  54 + <span class="item-label" style="width: 80px;">开始时间: </span>
  55 + <input class="form-control" type="text" id="date" style="width: 180px;"/>
  56 + </div>
  57 + <div style="display: inline-block;margin-left: 15px;">
  58 + <span class="item-label" style="width: 80px;">结束时间: </span>
  59 + <input class="form-control" type="text" id="date2" style="width: 180px;"/>
  60 + </div>
  61 + <div class="form-group">
  62 + <input class="btn btn-default" type="button" id="query" value="查询"/>
  63 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  64 + </div>
  65 + </form>
  66 + </div>
  67 + <div class="portlet-body">
  68 + <div class="table-container" id="countLine" style="margin-top: 10px;overflow:auto;min-width: 906px">
  69 + <table class="table table-bordered table-hover table-checkable" id="forms">
  70 + <thead>
  71 + <tr>
  72 + <th colspan="30"><label id="datetodate"></label>线路公里统计表</th>
  73 + </tr>
  74 + <tr>
  75 + <td rowspan="2"><span>公司</span></td>
  76 + <td rowspan="2"><span>分公司</span></td>
  77 + <td rowspan="2"><span>路线别</span></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 colspan="2"><label>实际营</label><label>运公里</label></td>
  83 + <td colspan="6"><label>实际空</label><label>驶公里</label></td>
  84 + <td rowspan="2"><label>少驶营</label><label>运里程</label></td>
  85 + <td colspan="11">少驶原因(公里)</td>
  86 + <td colspan="3">临加公里</td>
  87 + </tr>
  88 + <tr>
  89 + <td><label>计划内</label><label>营运</label><label>里程</label></td>
  90 + <td><label>临时性</label><label>多样化</label><label>调度营</label><label>运里程</label></td>
  91 + <td><label>计划内</label><label>进出场</label><label>空驶</label></td>
  92 + <td><label>计划外</label><label>进出场</label><label>空驶</label></td>
  93 + <td><label>故障</label><label>进出场</label><label>空驶</label></td>
  94 + <td><label>肇事</label><label>进出场</label><label>空驶</label></td>
  95 + <td><label>纠纷</label><label>进出场</label><label>空驶</label></td>
  96 + <td><label>空放 </label><label>空驶</label></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><label>临加营</label><label>运公里</label></td>
  109 + <td><label>临加进出</label><label>场空驶</label></td>
  110 + <td><label>临加</label><label>空放</label><label>空驶</label></td>
  111 + </tr>
  112 +
  113 + </thead>
  114 + <tbody class="countLineSj">
  115 +
  116 + </tbody>
  117 + </table>
  118 + </div>
  119 + </div>
  120 + </div>
  121 + </div>
  122 +</div>
  123 +
  124 +<script>
  125 + $(function(){
  126 + $('#export').attr('disabled', "true");
  127 +
  128 + // 关闭左侧栏
  129 + if (!$('body').hasClass('page-sidebar-closed'))
  130 + $('.menu-toggler.sidebar-toggler').click();
  131 +
  132 + var d = new Date();
  133 + d.setTime(d.getTime() - 4*1000*60*60*24);
  134 + var year = d.getFullYear();
  135 + var month = d.getMonth() + 1;
  136 + var day = d.getDate();
  137 + if(month < 10)
  138 + month = "0" + month;
  139 + if(day < 10)
  140 + day = "0" + day;
  141 + var dateTime = year + "-" + month + "-" + day;
  142 + $("#date").datetimepicker({
  143 + format : 'YYYY-MM-DD',
  144 + locale : 'zh-cn',
  145 + maxDate : dateTime
  146 + });
  147 + $("#date2").datetimepicker({
  148 + format : 'YYYY-MM-DD',
  149 + locale : 'zh-cn',
  150 + maxDate : dateTime
  151 + });
  152 + $("#date").val(dateTime);
  153 + $("#date2").val(dateTime);
  154 +
  155 + var fage=false;
  156 + var obj = [];
  157 + var xlList;
  158 + $.get('/report/lineList',function(result){
  159 + xlList=result;
  160 + $.get('/user/companyData', function(result){
  161 + obj = result;
  162 + var options = '';
  163 + for(var i = 0; i < obj.length; i++){
  164 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  165 + }
  166 +
  167 + if(obj.length ==0){
  168 + $("#gsdmDiv").css('display','none');
  169 + }else if(obj.length ==1){
  170 + $("#gsdmDiv").css('display','none');
  171 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  172 + $('#fgsdmDiv').css('display','none');
  173 + }
  174 + $('#gsdm').html(options);
  175 + updateCompany();
  176 + });
  177 + })
  178 + $("#gsdm").on("change",updateCompany);
  179 + function updateCompany(){
  180 + var company = $('#gsdm').val();
  181 + var options = '';
  182 + for(var i = 0; i < obj.length; i++){
  183 + if(obj[i].companyCode == company){
  184 + var children = obj[i].children;
  185 + for(var j = 0; j < children.length; j++){
  186 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  187 + }
  188 + }
  189 + }
  190 + $('#fgsdm').html(options);
  191 + }
  192 +
  193 +
  194 + var tempData = {};
  195 + $.get('/report/lineList',function(xlList){
  196 + var data = [];
  197 + data.push({id: " ", text: "全部线路"});
  198 + $.get('/user/companyData', function(result){
  199 + for(var i = 0; i < result.length; i++){
  200 + var companyCode = result[i].companyCode;
  201 + var children = result[i].children;
  202 + for(var j = 0; j < children.length; j++){
  203 + var code = children[j].code;
  204 + for(var k=0;k < xlList.length;k++ ){
  205 + if(xlList[k]["fgsbm"]==code && xlList[k]["gsbm"]==companyCode){
  206 + data.push({id: xlList[k]["xlbm"], text: xlList[k]["xlname"]});
  207 + tempData[xlList[k]["xlbm"]] = companyCode+":"+code;
  208 + }
  209 + }
  210 + }
  211 + }
  212 + initPinYinSelect2('#line',data,'');
  213 +
  214 + });
  215 + });
  216 +
  217 + $("#line").on("change", function(){
  218 + if($("#line").val() == " "){
  219 + $("#gsdm").attr("disabled", false);
  220 + $("#fgsdm").attr("disabled", false);
  221 + } else {
  222 + var temp = tempData[$("#line").val()].split(":");
  223 + $("#gsdm").val(temp[0]);
  224 + updateCompany();
  225 + $("#fgsdm").val(temp[1]);
  226 + $("#gsdm").attr("disabled", true);
  227 + $("#fgsdm").attr("disabled", true);
  228 + }
  229 + });
  230 +
  231 + var line ="";
  232 + var xlName ="";
  233 + var date = "";
  234 + var date2 ="";
  235 + var gsdm="";
  236 + var fgsdm="";
  237 + $("#query").on("click",function(){
  238 + $("#countLine").height($(window).height()-280);
  239 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  240 + layer.msg("请选择时间范围!");
  241 + return;
  242 + }
  243 + if($("#date2").val() == null || $("#date2").val().trim().length == 0){
  244 + layer.msg("请选择时间范围!");
  245 + return;
  246 + }
  247 + line = $("#line").val();
  248 + date = $("#date").val();
  249 + date2 =$("#date2").val();
  250 + gsdm =$("#gsdm").val();
  251 + fgsdm=$("#fgsdm").val();
  252 + xlName = $("#select2-line-container").html();
  253 + if(xlName == "全部线路")
  254 + xlName = $('#fgsdm option:selected').text();
  255 + if(line=="请选择"){
  256 + line="";
  257 + }
  258 + if(date==null || date =="" ||date2==null || date2 ==""){
  259 + layer.msg('请选择时间段.');
  260 + }else{
  261 + var params = {};
  262 + params['gsdm'] = gsdm;
  263 + params['fgsdm'] =fgsdm ;
  264 + params['line'] = line;
  265 + params['date'] = date;
  266 + params['date2'] = date2;
  267 + params['xlName'] = xlName;
  268 + params['type'] = "query";
  269 + var i = layer.load(2);
  270 + $get('/calcWaybill/getLineMileage',params,function(result){
  271 + $("#datetodate").html(date+"至"+date2);
  272 + layer.close(i);
  273 + // 把数据填充到模版中
  274 + var tbodyHtml = template('countLineListSj',{list:result});
  275 + // 把渲染好的模版html文本追加到表格中
  276 + $('#forms .countLineSj').html(tbodyHtml);
  277 +
  278 + if(result.length == 0)
  279 + $("#export").attr('disabled',"true");
  280 + else
  281 + $("#export").removeAttr("disabled");
  282 + });
  283 + }
  284 +
  285 + });
  286 + $("#countLine").height($(window).height()-280);
  287 + $("#export").on("click",function(){
  288 + var params = {};
  289 + params['gsdm'] = gsdm;
  290 + params['fgsdm'] =fgsdm ;
  291 + params['line'] = line;
  292 + params['date'] = date;
  293 + params['date2'] = date2;
  294 + params['xlName'] = xlName;
  295 + params['type'] = "export";
  296 + params['by']='sj';
  297 + $get('/calcWaybill/getLineMileage',params,function(result){
  298 + var dateTime = "";
  299 + if(date == date2){
  300 + dateTime = moment(date).format("YYYYMMDD");
  301 + } else {
  302 + dateTime = moment(date).format("YYYYMMDD")
  303 + +"-"+moment(date2).format("YYYYMMDD");
  304 + }
  305 + window.open("/downloadFile/download?fileName="
  306 + +dateTime+"-"+xlName+"-线路公里统计表");
  307 + });
  308 + });
  309 + });
  310 +</script>
  311 +<script type="text/html" id="countLineListSj">
  312 + {{each list as obj i}}
  313 + <tr>
  314 + <td>{{obj.gs}}</td>
  315 + <td>{{obj.fgs}}</td>
  316 + <td>{{obj.xlName}}</td>
  317 + <td>{{obj.jhzlc}}</td>
  318 + <td>{{obj.jhlc}}</td>
  319 + <td>{{obj.jcclc}}</td>
  320 + <td>{{obj.sjzgl}}</td>
  321 + <td>{{obj.jhnlc}}</td>
  322 + <td>{{obj.jhwlc}}</td>
  323 + <td>{{obj.jhnjcclc}}</td>
  324 + <td>{{obj.jhwjcclc_z}}</td>
  325 + <td>{{obj.zrwjcclc}}</td>
  326 + <td>{{obj.zrwjcclc1}}</td>
  327 + <td>{{obj.zrwjcclc2}}</td>
  328 + <td>{{obj.kfks}}</td>
  329 + <td>{{obj.lbss}}</td>
  330 + <td>{{obj.ssgl_lz}}</td>
  331 + <td>{{obj.ssgl_dm}}</td>
  332 + <td>{{obj.ssgl_gz}}</td>
  333 + <td>{{obj.ssgl_jf}}</td>
  334 + <td>{{obj.ssgl_zs}}</td>
  335 + <td>{{obj.ssgl_qr}}</td>
  336 + <td>{{obj.ssgl_qc}}</td>
  337 + <td>{{obj.ssgl_kx}}</td>
  338 + <td>{{obj.ssgl_qh}}</td>
  339 + <td>{{obj.ssgl_yw}}</td>
  340 + <td>{{obj.ssgl_other}}</td>
  341 + <td>{{obj.ljyy}}</td>
  342 + <td>{{obj.ljjcc}}</td>
  343 + <td>{{obj.ljkfks}}</td>
  344 + </tr>
  345 + {{/each}}
  346 + {{if list.length == 0}}
  347 + <tr>
  348 + <td colspan="30"><h6 class="muted">没有找到相关数据</h6></td>
  349 + </tr>
  350 + {{/if}}
  351 +</script>
0 352 \ No newline at end of file
... ...
src/main/resources/static/pages/control/ddyerror_log/ddyerror_wrap.html 0 → 100644
  1 +<!-- 调度员异常操作 -->
  2 +<iframe id="e_ddy_error_frame" frameborder="0" style="height: 100%;width: 100%;"></iframe>
  3 +
  4 +<script>
  5 + (function () {
  6 + var url;
  7 + var userName = $('#indexTopUName').text();
  8 +
  9 + var prefix = userName.substr(0, 2);
  10 +
  11 + if(prefix=='nh' || prefix=='NH')
  12 + url = 'http://116.236.141.38:8082/pages/monitoring/form/ddyerror_nh.html';
  13 + else //if(prefix=='jg' || prefix=='JG')
  14 + url = 'http://180.168.57.114:8082/pages/monitoring/form/ddyerror_v3.html';
  15 + //else{
  16 + //alert('') 默认就金高吧
  17 +
  18 + //}
  19 +
  20 + var psw = md5(userName + '123');
  21 + url = (url + "?ddy=" + userName + "&psw=" + psw);
  22 + $('#e_ddy_error_frame').attr('src', url);
  23 +
  24 + function md5(string) {
  25 + function md5_RotateLeft(lValue, iShiftBits) {
  26 + return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits));
  27 + }
  28 + function md5_AddUnsigned(lX, lY) {
  29 + var lX4, lY4, lX8, lY8, lResult;
  30 + lX8 = (lX & 0x80000000);
  31 + lY8 = (lY & 0x80000000);
  32 + lX4 = (lX & 0x40000000);
  33 + lY4 = (lY & 0x40000000);
  34 + lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
  35 + if (lX4 & lY4) {
  36 + return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
  37 + }
  38 + if (lX4 | lY4) {
  39 + if (lResult & 0x40000000) {
  40 + return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
  41 + } else {
  42 + return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
  43 + }
  44 + } else {
  45 + return (lResult ^ lX8 ^ lY8);
  46 + }
  47 + }
  48 + function md5_F(x, y, z) {
  49 + return (x & y) | ((~x) & z);
  50 + }
  51 + function md5_G(x, y, z) {
  52 + return (x & z) | (y & (~z));
  53 + }
  54 + function md5_H(x, y, z) {
  55 + return (x ^ y ^ z);
  56 + }
  57 + function md5_I(x, y, z) {
  58 + return (y ^ (x | (~z)));
  59 + }
  60 + function md5_FF(a, b, c, d, x, s, ac) {
  61 + a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_F(b, c, d), x), ac));
  62 + return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  63 + };
  64 + function md5_GG(a, b, c, d, x, s, ac) {
  65 + a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_G(b, c, d), x), ac));
  66 + return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  67 + };
  68 + function md5_HH(a, b, c, d, x, s, ac) {
  69 + a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_H(b, c, d), x), ac));
  70 + return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  71 + };
  72 + function md5_II(a, b, c, d, x, s, ac) {
  73 + a = md5_AddUnsigned(a, md5_AddUnsigned(md5_AddUnsigned(md5_I(b, c, d), x), ac));
  74 + return md5_AddUnsigned(md5_RotateLeft(a, s), b);
  75 + };
  76 + function md5_ConvertToWordArray(string) {
  77 + var lWordCount;
  78 + var lMessageLength = string.length;
  79 + var lNumberOfWords_temp1 = lMessageLength + 8;
  80 + var lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64;
  81 + var lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16;
  82 + var lWordArray = Array(lNumberOfWords - 1);
  83 + var lBytePosition = 0;
  84 + var lByteCount = 0;
  85 + while (lByteCount < lMessageLength) {
  86 + lWordCount = (lByteCount - (lByteCount % 4)) / 4;
  87 + lBytePosition = (lByteCount % 4) * 8;
  88 + lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
  89 + lByteCount++;
  90 + }
  91 + lWordCount = (lByteCount - (lByteCount % 4)) / 4;
  92 + lBytePosition = (lByteCount % 4) * 8;
  93 + lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
  94 + lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
  95 + lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
  96 + return lWordArray;
  97 + };
  98 + function md5_WordToHex(lValue) {
  99 + var WordToHexValue = "",
  100 + WordToHexValue_temp = "",
  101 + lByte, lCount;
  102 + for (lCount = 0; lCount <= 3; lCount++) {
  103 + lByte = (lValue >>> (lCount * 8)) & 255;
  104 + WordToHexValue_temp = "0" + lByte.toString(16);
  105 + WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
  106 + }
  107 + return WordToHexValue;
  108 + };
  109 + function md5_Utf8Encode(string) {
  110 + string = string.replace(/\r\n/g, "\n");
  111 + var utftext = "";
  112 + for (var n = 0; n < string.length; n++) {
  113 + var c = string.charCodeAt(n);
  114 + if (c < 128) {
  115 + utftext += String.fromCharCode(c);
  116 + } else if ((c > 127) && (c < 2048)) {
  117 + utftext += String.fromCharCode((c >> 6) | 192);
  118 + utftext += String.fromCharCode((c & 63) | 128);
  119 + } else {
  120 + utftext += String.fromCharCode((c >> 12) | 224);
  121 + utftext += String.fromCharCode(((c >> 6) & 63) | 128);
  122 + utftext += String.fromCharCode((c & 63) | 128);
  123 + }
  124 + }
  125 + return utftext;
  126 + };
  127 + var x = Array();
  128 + var k, AA, BB, CC, DD, a, b, c, d;
  129 + var S11 = 7,
  130 + S12 = 12,
  131 + S13 = 17,
  132 + S14 = 22;
  133 + var S21 = 5,
  134 + S22 = 9,
  135 + S23 = 14,
  136 + S24 = 20;
  137 + var S31 = 4,
  138 + S32 = 11,
  139 + S33 = 16,
  140 + S34 = 23;
  141 + var S41 = 6,
  142 + S42 = 10,
  143 + S43 = 15,
  144 + S44 = 21;
  145 + string = md5_Utf8Encode(string);
  146 + x = md5_ConvertToWordArray(string);
  147 + a = 0x67452301;
  148 + b = 0xEFCDAB89;
  149 + c = 0x98BADCFE;
  150 + d = 0x10325476;
  151 + for (k = 0; k < x.length; k += 16) {
  152 + AA = a;
  153 + BB = b;
  154 + CC = c;
  155 + DD = d;
  156 + a = md5_FF(a, b, c, d, x[k + 0], S11, 0xD76AA478);
  157 + d = md5_FF(d, a, b, c, x[k + 1], S12, 0xE8C7B756);
  158 + c = md5_FF(c, d, a, b, x[k + 2], S13, 0x242070DB);
  159 + b = md5_FF(b, c, d, a, x[k + 3], S14, 0xC1BDCEEE);
  160 + a = md5_FF(a, b, c, d, x[k + 4], S11, 0xF57C0FAF);
  161 + d = md5_FF(d, a, b, c, x[k + 5], S12, 0x4787C62A);
  162 + c = md5_FF(c, d, a, b, x[k + 6], S13, 0xA8304613);
  163 + b = md5_FF(b, c, d, a, x[k + 7], S14, 0xFD469501);
  164 + a = md5_FF(a, b, c, d, x[k + 8], S11, 0x698098D8);
  165 + d = md5_FF(d, a, b, c, x[k + 9], S12, 0x8B44F7AF);
  166 + c = md5_FF(c, d, a, b, x[k + 10], S13, 0xFFFF5BB1);
  167 + b = md5_FF(b, c, d, a, x[k + 11], S14, 0x895CD7BE);
  168 + a = md5_FF(a, b, c, d, x[k + 12], S11, 0x6B901122);
  169 + d = md5_FF(d, a, b, c, x[k + 13], S12, 0xFD987193);
  170 + c = md5_FF(c, d, a, b, x[k + 14], S13, 0xA679438E);
  171 + b = md5_FF(b, c, d, a, x[k + 15], S14, 0x49B40821);
  172 + a = md5_GG(a, b, c, d, x[k + 1], S21, 0xF61E2562);
  173 + d = md5_GG(d, a, b, c, x[k + 6], S22, 0xC040B340);
  174 + c = md5_GG(c, d, a, b, x[k + 11], S23, 0x265E5A51);
  175 + b = md5_GG(b, c, d, a, x[k + 0], S24, 0xE9B6C7AA);
  176 + a = md5_GG(a, b, c, d, x[k + 5], S21, 0xD62F105D);
  177 + d = md5_GG(d, a, b, c, x[k + 10], S22, 0x2441453);
  178 + c = md5_GG(c, d, a, b, x[k + 15], S23, 0xD8A1E681);
  179 + b = md5_GG(b, c, d, a, x[k + 4], S24, 0xE7D3FBC8);
  180 + a = md5_GG(a, b, c, d, x[k + 9], S21, 0x21E1CDE6);
  181 + d = md5_GG(d, a, b, c, x[k + 14], S22, 0xC33707D6);
  182 + c = md5_GG(c, d, a, b, x[k + 3], S23, 0xF4D50D87);
  183 + b = md5_GG(b, c, d, a, x[k + 8], S24, 0x455A14ED);
  184 + a = md5_GG(a, b, c, d, x[k + 13], S21, 0xA9E3E905);
  185 + d = md5_GG(d, a, b, c, x[k + 2], S22, 0xFCEFA3F8);
  186 + c = md5_GG(c, d, a, b, x[k + 7], S23, 0x676F02D9);
  187 + b = md5_GG(b, c, d, a, x[k + 12], S24, 0x8D2A4C8A);
  188 + a = md5_HH(a, b, c, d, x[k + 5], S31, 0xFFFA3942);
  189 + d = md5_HH(d, a, b, c, x[k + 8], S32, 0x8771F681);
  190 + c = md5_HH(c, d, a, b, x[k + 11], S33, 0x6D9D6122);
  191 + b = md5_HH(b, c, d, a, x[k + 14], S34, 0xFDE5380C);
  192 + a = md5_HH(a, b, c, d, x[k + 1], S31, 0xA4BEEA44);
  193 + d = md5_HH(d, a, b, c, x[k + 4], S32, 0x4BDECFA9);
  194 + c = md5_HH(c, d, a, b, x[k + 7], S33, 0xF6BB4B60);
  195 + b = md5_HH(b, c, d, a, x[k + 10], S34, 0xBEBFBC70);
  196 + a = md5_HH(a, b, c, d, x[k + 13], S31, 0x289B7EC6);
  197 + d = md5_HH(d, a, b, c, x[k + 0], S32, 0xEAA127FA);
  198 + c = md5_HH(c, d, a, b, x[k + 3], S33, 0xD4EF3085);
  199 + b = md5_HH(b, c, d, a, x[k + 6], S34, 0x4881D05);
  200 + a = md5_HH(a, b, c, d, x[k + 9], S31, 0xD9D4D039);
  201 + d = md5_HH(d, a, b, c, x[k + 12], S32, 0xE6DB99E5);
  202 + c = md5_HH(c, d, a, b, x[k + 15], S33, 0x1FA27CF8);
  203 + b = md5_HH(b, c, d, a, x[k + 2], S34, 0xC4AC5665);
  204 + a = md5_II(a, b, c, d, x[k + 0], S41, 0xF4292244);
  205 + d = md5_II(d, a, b, c, x[k + 7], S42, 0x432AFF97);
  206 + c = md5_II(c, d, a, b, x[k + 14], S43, 0xAB9423A7);
  207 + b = md5_II(b, c, d, a, x[k + 5], S44, 0xFC93A039);
  208 + a = md5_II(a, b, c, d, x[k + 12], S41, 0x655B59C3);
  209 + d = md5_II(d, a, b, c, x[k + 3], S42, 0x8F0CCC92);
  210 + c = md5_II(c, d, a, b, x[k + 10], S43, 0xFFEFF47D);
  211 + b = md5_II(b, c, d, a, x[k + 1], S44, 0x85845DD1);
  212 + a = md5_II(a, b, c, d, x[k + 8], S41, 0x6FA87E4F);
  213 + d = md5_II(d, a, b, c, x[k + 15], S42, 0xFE2CE6E0);
  214 + c = md5_II(c, d, a, b, x[k + 6], S43, 0xA3014314);
  215 + b = md5_II(b, c, d, a, x[k + 13], S44, 0x4E0811A1);
  216 + a = md5_II(a, b, c, d, x[k + 4], S41, 0xF7537E82);
  217 + d = md5_II(d, a, b, c, x[k + 11], S42, 0xBD3AF235);
  218 + c = md5_II(c, d, a, b, x[k + 2], S43, 0x2AD7D2BB);
  219 + b = md5_II(b, c, d, a, x[k + 9], S44, 0xEB86D391);
  220 + a = md5_AddUnsigned(a, AA);
  221 + b = md5_AddUnsigned(b, BB);
  222 + c = md5_AddUnsigned(c, CC);
  223 + d = md5_AddUnsigned(d, DD);
  224 + }
  225 + return (md5_WordToHex(a) + md5_WordToHex(b) + md5_WordToHex(c) + md5_WordToHex(d)).toLowerCase();
  226 + }
  227 + })();
  228 +</script>
0 229 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/mould/changetochange.xls
No preview for this file type
src/main/resources/static/pages/forms/statement/account.html
... ... @@ -224,7 +224,9 @@
224 224 $("#export").on("click",function(){
225 225 var type = "export";
226 226 $get('/realSchedule/account', {line:line,date:date,code:code,xlName:xlName,type:type}, function(result){
227   - window.open("/downloadFile/download?fileName=驾驶员请求台账"+moment(date).format("YYYYMMDD"));
  227 + window.open("/downloadFile/download?fileName="
  228 + +moment(date).format("YYYYMMDD")
  229 + +"-"+xlName+"-驾驶员请求台账");
228 230 });
229 231 });
230 232  
... ...
src/main/resources/static/pages/forms/statement/busInterval.html
... ... @@ -137,49 +137,6 @@
137 137 $("#times1").attr("disabled", true);
138 138 $("#times2").attr("disabled", true);
139 139  
140   -// var obj = [];
141   -// $.get('/user/companyData', function(result){
142   -// obj = result;
143   -// var options = '';
144   -// for(var i = 0; i < obj.length; i++){
145   -// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
146   -// }
147   -// if(obj.length == 1){
148   -// $('#company1').hide();
149   -// if(obj[0].children.length == 1)
150   -// $('#subCompany1').hide();
151   -// }
152   -// $('#company').html(options);
153   -// updateCompany();
154   -// });
155   -// $("#company").on("change",updateCompany);
156   -// function updateCompany(){
157   -// var company = $('#company').val();
158   -// var options = '';
159   -// for(var i = 0; i < obj.length; i++){
160   -// if(obj[i].companyCode == company){
161   -// var children = obj[i].children;
162   -// for(var j = 0; j < children.length; j++){
163   -// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
164   -// }
165   -// }
166   -// }
167   -// $('#subCompany').html(options);
168   -// }
169   -
170   -// $.get('/basic/lineCode2Name',function(result){
171   -// var data=[];
172   -// // data.push({id:" ", text:"全部线路"});
173   -// for(var code in result){
174   -// data.push({id: code, text: result[code]});
175   -// }
176   -// console.log(data);
177   -// initPinYinSelect2('#line',data,'');
178   -
179   -// // line = "";
180   -// line = data[0].id;
181   -// updateModel();
182   -// })
183 140 var fage=false;
184 141 var xlList;
185 142 var obj = [];
... ... @@ -276,6 +233,7 @@
276 233 var times2 = $("#times2").val();
277 234 var company = $("#company").val();
278 235 var subCompany = $("#subCompany").val();
  236 + var lineName = $('#line option:selected').text();
279 237 function jsDoQuery(pagination){
280 238 if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
281 239 layer.msg("请选择日期");
... ... @@ -294,6 +252,9 @@
294 252 times2 = $("#times2").val();
295 253 company = $("#company").val();
296 254 subCompany = $("#subCompany").val();
  255 + lineName = $('#line option:selected').text();
  256 + if(lineName == "全部线路")
  257 + lineName = $('#subCompany option:selected').text();
297 258 params['line'] = line;
298 259 params['sfqr'] = sfqr;
299 260 params['statu'] = statu;
... ... @@ -343,11 +304,18 @@
343 304 params['company'] = company;
344 305 params['subCompany'] = subCompany;
345 306 params['type'] = "export";
  307 + params['lineName'] = lineName;
346 308 var i = layer.load(2);
347 309 $get('/busInterval/interval', params, function(result){
348   - window.open("/downloadFile/download?fileName=班次间隔统计表"
349   - +moment(startDate).format("YYYYMMDD")+"-"
350   - +moment(endDate).format("YYYYMMDD"));
  310 + var dateTime = "";
  311 + if(startDate == endDate){
  312 + dateTime = moment(startDate).format("YYYYMMDD");
  313 + } else {
  314 + dateTime = moment(startDate).format("YYYYMMDD")
  315 + +"-"+moment(endDate).format("YYYYMMDD");
  316 + }
  317 + window.open("/downloadFile/download?fileName="
  318 + +dateTime+"-"+lineName+"-班次间隔统计表");
351 319 layer.close(i);
352 320 });
353 321 });
... ...
src/main/resources/static/pages/forms/statement/commandState.html
... ... @@ -266,6 +266,7 @@
266 266 var code = $("#code").val();
267 267 var company = $("#company").val();
268 268 var subCompany = $("#subCompany").val();
  269 + var lineName = $('#line option:selected').text();
269 270 function jsDoQuery(pagination){
270 271 $("#export").removeAttr("disabled");
271 272 if($("#date").val() == null || $("#date").val().trim().length == 0){
... ... @@ -280,6 +281,9 @@
280 281 code = $("#code").val();
281 282 company = $("#company").val();
282 283 subCompany = $("#subCompany").val();
  284 + lineName = $('#line option:selected').text();
  285 + if(lineName == "全部线路")
  286 + lineName = $('#subCompany option:selected').text();
283 287 params['line'] = line;
284 288 params['date'] = date;
285 289 params['code'] = code;
... ... @@ -287,31 +291,36 @@
287 291 params['company'] = company;
288 292 params['subCompany'] = subCompany;
289 293 $("#forms .hidden").removeClass("hidden");
  294 + var i = layer.load(2);
290 295 $get('/pcpc/commandState', params, function(result){
291 296 // 把数据填充到模版中
292 297 var tbodyHtml = template('list_commandState',{list:result});
293 298 // 把渲染好的模版html文本追加到表格中
294 299 $('#forms tbody').html(tbodyHtml);
  300 + layer.close(i);
295 301  
296 302 $('.btn-command').on('click', openCommandByLine);
297 303  
298 304 });
299 305 }
300 306  
301   - var xlbm="";
  307 + var xlbm="", lineName1="";
302 308 function openCommandByLine(){
303 309 var id = $(this).data('id');
304 310 date = $("#date").val();
305 311 xlbm=id;
  312 + lineName1 = $(this).html();
306 313 var params = {};
307 314 params['line'] = id;
308 315 params['date'] = date;
309 316 params['type'] = "query";
310 317 $("#works .hidden").removeClass("hidden");
311 318 $("#works_hidden").removeClass("hidden");
  319 + var i = layer.load(2);
312 320 $get('/pcpc/commandByLineList',params,function(result){
313 321 var commandByLine = template('list_workList',{list:result});
314 322 $('#works tbody').html(commandByLine);
  323 + layer.close(i);
315 324  
316 325 $('.btn-command-line').on('click', openCommand);
317 326 $("html,body").animate({scrollTop:$("#works").offset().top},1000);
... ... @@ -325,6 +334,8 @@
325 334 params['jgh'] = id;
326 335 params['date'] = date;
327 336 params['line'] =xlbm;
  337 + var jName = $(this).html();
  338 + params['jName'] = lineName1+"-"+jName.replace("/", "_");
328 339 $.get('/pages/forms/statement/commandStateByLine.html', function (content) {
329 340 layer.open({
330 341 type: 1,
... ... @@ -348,8 +359,13 @@
348 359 params['type'] = "export";
349 360 params['company'] = company;
350 361 params['subCompany'] = subCompany;
  362 + params['lineName'] = lineName;
  363 + var i = layer.load(2);
351 364 $get('/pcpc/commandState', params, function(result){
352   - window.open("/downloadFile/download?fileName=指令状态分析"+moment(date).format("YYYYMMDD"));
  365 + window.open("/downloadFile/download?fileName="
  366 + +moment(date).format("YYYYMMDD")
  367 + +"-"+lineName+"-指令状态分析");
  368 + layer.close(i);
353 369 });
354 370 });
355 371  
... ... @@ -358,8 +374,13 @@
358 374 params['line'] = xlbm;
359 375 params['date'] = date;
360 376 params['type'] = "export";
  377 + params['lineName'] = lineName1;
  378 + var i = layer.load(2);
361 379 $get('/pcpc/commandByLineList', params, function(result){
362   - window.open("/downloadFile/download?fileName=线路指令状态分析"+moment(date).format("YYYYMMDD"));
  380 + window.open("/downloadFile/download?fileName="
  381 + +moment(date).format("YYYYMMDD")
  382 + +"-"+lineName1+"-线路指令状态分析");
  383 + layer.close(i);
363 384 });
364 385 });
365 386  
... ...
src/main/resources/static/pages/forms/statement/commandStateByLine.html
... ... @@ -60,18 +60,21 @@
60 60 $('.menu-toggler.sidebar-toggler').click();
61 61 var params_;
62 62 $("#commandByLineList").on('init', function (e, params) {
63   - params['type']='export';
64 63 params_=params;
65   - console.log(params.date);
66 64 $get('/pcpc/commandByJghList',params,function(result){
67 65 var commandByLine = template('commandByLine',{list:result});
68 66 $('#forms_1 tbody').html(commandByLine);
69 67 });
70 68 })
71   - $("#exportList").on('click',function(){
72   - $get('/pcpc/commandByLineList', params_, function(result){
73   - window.open("/downloadFile/download?fileName=指令状态明细"+moment(params_.date).format("YYYYMMDD"));
74   - });
  69 + $("#exportList").on('click',function(){
  70 + var params;
  71 + params = params_;
  72 + params['type']='export';
  73 + $get('/pcpc/commandByJghList', params, function(result){
  74 + window.open("/downloadFile/download?fileName="
  75 + +moment(params.date).format("YYYYMMDD")
  76 + +"-"+params.jName+"-指令状态明细");
  77 + });
75 78 });
76 79  
77 80  
... ...
src/main/resources/static/pages/forms/statement/correctForm.html
... ... @@ -33,11 +33,11 @@
33 33 </div>
34 34 <div style="display: inline-block;margin-left: 15px;">
35 35 <span class="item-label" style="width: 80px;">开始时间: </span>
36   - <input class="form-control" type="text" id="date" style="width: 160px;"/>
  36 + <input class="form-control" type="text" id="date" style="width: 160px;" />
37 37 </div>
38 38 <div style="display: inline-block;margin-left: 15px;">
39 39 <span class="item-label" style="width: 80px;">结束时间: </span>
40   - <input class="form-control" type="text" id="endDate" style="width: 160px;"/>
  40 + <input class="form-control" type="text" id="endDate" style="width: 160px;" />
41 41 </div>
42 42 <div style="margin-top: 10px"></div>
43 43 <div style="display: inline-block;">
... ... @@ -97,20 +97,12 @@
97 97 $(function(){
98 98 $("#export").attr('disabled',"true");
99 99  
100   -
101 100 // 关闭左侧栏
102 101 if (!$('body').hasClass('page-sidebar-closed'))
103 102 $('.menu-toggler.sidebar-toggler').click();
104   -
105   - $("#date").datetimepicker({
106   - format : 'YYYY-MM-DD',
107   - locale : 'zh-cn'
108   - });
109   - $("#endDate").datetimepicker({
110   - format : 'YYYY-MM-DD',
111   - locale : 'zh-cn'
112   - });
  103 +
113 104 var d = new Date();
  105 + d.setTime(d.getTime() - 1*1000*60*60*24);
114 106 var year = d.getFullYear();
115 107 var month = d.getMonth() + 1;
116 108 var day = d.getDate();
... ... @@ -118,8 +110,19 @@
118 110 month = "0" + month;
119 111 if(day < 10)
120 112 day = "0" + day;
121   - $("#date").val(year + "-" + month + "-" + day);
122   - $("#endDate").val(year + "-" + month + "-" + day);
  113 + var dateTime = year + "-" + month + "-" + day;
  114 + $("#date").datetimepicker({
  115 + format : 'YYYY-MM-DD',
  116 + locale : 'zh-cn',
  117 + maxDate : dateTime
  118 + });
  119 + $("#endDate").datetimepicker({
  120 + format : 'YYYY-MM-DD',
  121 + locale : 'zh-cn',
  122 + maxDate : dateTime
  123 + });
  124 + $("#date").val(dateTime);
  125 + $("#endDate").val(dateTime);
123 126  
124 127 $.get('/report/lineList',function(xlList){
125 128 var data = [];
... ... @@ -230,6 +233,7 @@
230 233 var endDate = $("#endDate").val();
231 234 var code = $("#code").val();
232 235 var changType=$("#changType").val();
  236 + var lineName = $('#line option:selected').text();
233 237 $("#query").on("click",function(){
234 238 line = $("#line").val();
235 239 date = $("#date").val();
... ... @@ -237,6 +241,9 @@
237 241 code = $("#code").val();
238 242 endDate = $("#endDate").val();
239 243 changType=$("#changType").val();
  244 + lineName = $('#line option:selected').text();
  245 + if(lineName == "全部线路")
  246 + lineName = $('#subCompany option:selected').text();
240 247 var type = "query";
241 248 $get("/realSchedule/correctForm",{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){
242 249 var list_correctForm = template('list_correctForm',{list:result});
... ... @@ -257,7 +264,15 @@
257 264 $("#export").on("click",function(){
258 265 var type = "export";
259 266 $get('/realSchedule/correctForm',{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){
260   - window.open("/downloadFile/download?fileName=修正报表"+date);
  267 + var dateTime = "";
  268 + if(date == endDate){
  269 + dateTime = moment(date).format("YYYYMMDD");
  270 + } else {
  271 + dateTime = moment(date).format("YYYYMMDD")+"-"+
  272 + moment(endDate).format("YYYYMMDD");
  273 + }
  274 + window.open("/downloadFile/download?fileName="
  275 + +dateTime+"-"+lineName+"-修正报表");
261 276 });
262 277 });
263 278  
... ...
src/main/resources/static/pages/forms/statement/daily.html
... ... @@ -139,43 +139,8 @@
139 139 }
140 140 }
141 141 $('#fgsdmDaily').html(options);
142   -// initXl();
143 142 }
144 143  
145   - /* $.get('/basic/lineCode2Name',function(result){
146   - var data=[];
147   -
148   - for(var code in result){
149   - data.push({id: code, text: result[code]});
150   - }
151   - initPinYinSelect2('#line',data,'');
152   -
153   - }) */
154   -
155   - /* $("#fgsdmDaily").on("change",initXl);
156   - function initXl(){
157   - var data=[];
158   - if(fage){
159   - $("#line").select2("destroy").html('');
160   - }
161   - var fgs=$('#fgsdmDaily').val();
162   - var gs=$('#gsdmDaily').val();
163   - for(var i=0;i<xlList.length;i++){
164   - if(gs!=""){
165   - if(fgs!=""){
166   - if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
167   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
168   - }
169   - }else{
170   - if(xlList[i]["gsbm"]==gs){
171   - data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
172   - }
173   - }
174   - }
175   - }
176   - initPinYinSelect2('#line',data,'');
177   - fage=true;
178   - } */
179 144 var tempData = {};
180 145 $.get('/report/lineList',function(xlList){
181 146 var data = [];
... ... @@ -218,17 +183,18 @@
218 183 var date;
219 184 var gsdmDaily;
220 185 var fgsdmDaily;
  186 + var lineName=$("#select2-line-container").html();
221 187 $("#query").on("click",function(){
222 188 if($("#date").val() == null || $("#date").val().trim().length == 0){
223 189 layer.msg("请选择时间");
224 190 return;
225 191 }
226 192 line = $("#line").val();
227   - var lineName=$("#select2-line-container").html();
228 193 date = $("#date").val();
229 194 gsdmDaily=$("#gsdmDaily").val();
230 195 fgsdmDaily = $("#fgsdmDaily").val();
231   -
  196 + lineName=$("#select2-line-container").html();
  197 + var i = layer.load(2);
232 198 $get('/mcy_forms/daily',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily, line:line,date:date,type:'query'},function(result){
233 199 $("#form_line").text(lineName);
234 200 $("#form_date").text(date);
... ... @@ -236,8 +202,9 @@
236 202 var tbodyHtml = template('dailyInfo',{list:result});
237 203 // 把渲染好的模版html文本追加到表格中
238 204 $('#tbody').html(tbodyHtml);
  205 + layer.close(i);
  206 +
239 207 line = $("#line").val();
240   -
241 208 startDate = $("#startDate").val();
242 209 endDate = $("#endDate").val();
243 210 $("#sDate").text(startDate);
... ... @@ -272,12 +239,20 @@
272 239 });
273 240  
274 241 $("#export").on("click",function(){
  242 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  243 + layer.msg("请选择时间");
  244 + return;
  245 + }
275 246 line = $("#line").val();
276 247 date = $("#date").val();
277 248 gsdmDaily=$("#gsdmDaily").val();
278 249 fgsdmDaily = $("#fgsdmDaily").val();
279   - $post('/mcy_export/dailyExport',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily,line:line,date:date,type:'export'},function(result){
280   - window.open("/downloadFile/download?fileName=班次日报表"+moment(date).format("YYYYMMDD"));
  250 + lineName=$("#select2-line-container").html();
  251 + var i = layer.load(2);
  252 + $post('/mcy_export/dailyExport',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily,line:line,date:date,type:'export',lineName:lineName},function(result){
  253 + window.open("/downloadFile/download?fileName="
  254 + +moment(date).format("YYYYMMDD")+"-"+lineName+"-班次日报表");
  255 + layer.close(i);
281 256 });
282 257 });
283 258 });
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
... ... @@ -229,6 +229,7 @@
229 229 var subCompany = $("#subCompany").val();
230 230 var line = $("#line").val();
231 231 var date = $("#date").val();
  232 + var lineName = $('#line option:selected').text();
232 233 function jsDoQuery(pagination){
233 234 if($("#date").val() == null || $("#date").val().trim().length == 0){
234 235 layer.msg("请选择时间!");
... ... @@ -239,6 +240,9 @@
239 240 subCompany = $("#subCompany").val();
240 241 line = $("#line").val();
241 242 date = $("#date").val();
  243 + lineName = $('#line option:selected').text();
  244 + if(lineName == "全部线路")
  245 + lineName = $('#subCompany option:selected').text();
242 246 if(line == " ")
243 247 line = "";
244 248 params['company'] = company;
... ... @@ -247,11 +251,13 @@
247 251 params['date'] = date;
248 252 params['type'] = "query";
249 253 $(".hidden").removeClass("hidden");
  254 + var i = layer.load(2);
250 255 $get('/pcpc/firstAndLastBus', params, function(result){
251 256 // 把数据填充到模版中
252 257 var tbodyHtml = template('list_firstAndLastBus',{list:result});
253 258 // 把渲染好的模版html文本追加到表格中
254 259 $('#forms tbody').html(tbodyHtml);
  260 + layer.close(i);
255 261  
256 262 if(result.length == 0)
257 263 $("#export").attr('disabled',"true");
... ... @@ -271,8 +277,13 @@
271 277 params['line'] = line;
272 278 params['date'] = date;
273 279 params['type'] = "export";
  280 + params['lineName'] = lineName;
  281 + var i = layer.load(2);
274 282 $get('/pcpc/firstAndLastBus', params, function(result){
275   - window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD"));
  283 + window.open("/downloadFile/download?fileName="
  284 + +moment(date).format("YYYYMMDD")
  285 + +"-"+lineName+"-线路首末班");
  286 + layer.close(i);
276 287 });
277 288 });
278 289  
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus_delay.html
... ... @@ -191,6 +191,7 @@
191 191 var line = $("#line").val();
192 192 var startDate = $("#startDate").val();
193 193 var endDate = $("#endDate").val();
  194 + var lineName = $('#line option:selected').text();
194 195 function jsDoQuery(pagination){
195 196 if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
196 197 layer.msg("请选择时间!");
... ... @@ -207,6 +208,9 @@
207 208 line = $("#line").val();
208 209 startDate = $("#startDate").val();
209 210 endDate = $("#endDate").val();
  211 + lineName = $('#line option:selected').text();
  212 + if(lineName == "全部线路")
  213 + lineName = $('#subCompany option:selected').text();
210 214 if(line == " ")
211 215 line = "";
212 216 params['company'] = company;
... ... @@ -240,14 +244,6 @@
240 244 }
241 245  
242 246 $("#export").on("click",function(){
243   -// $("#forms").table2excel({
244   -// exclue: ".noExl",
245   -// name: "Excel Document Name.xlsx",
246   -// filename: "首末班误点班次",
247   -// exclude_img: true,
248   -// exclude_links: true,
249   -// exclude_inputs: true
250   -// });
251 247 var i = layer.load(2);
252 248 var params = {};
253 249 company = $("#company").val();
... ... @@ -263,8 +259,17 @@
263 259 params['startDate'] = startDate;
264 260 params['endDate'] = endDate;
265 261 params['type'] = "delay_export";
  262 + params['lineName'] = lineName;
266 263 $get('/pcpc/firstAndLastBus_sum', params, function(result){
267   - window.open("/downloadFile/download?fileName=首末班误点班次");
  264 + var dateTime = "";
  265 + if(startDate == endDate){
  266 + dateTime = moment(startDate).format("YYYYMMDD");
  267 + } else {
  268 + dateTime = moment(startDate).format("YYYYMMDD")
  269 + +"-"+moment(endDate).format("YYYYMMDD");
  270 + }
  271 + window.open("/downloadFile/download?fileName="
  272 + +dateTime+"-"+lineName+"-首末班误点班次");
268 273 layer.close(i);
269 274 });
270 275 });
... ...
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
... ... @@ -240,12 +240,14 @@
240 240  
241 241 var list;
242 242 var tempLine;
  243 + var lineName1;
243 244 $("#forms tbody").on("click","a",function(){
244 245 var index = $(this).parent().parent().index();
245 246 if(index < list.length - 1){
246 247 $.each(list, function(i, g){
247 248 if(index == i){
248 249 tempLine = g.xlbm;
  250 + lineName1 = g.line;
249 251 var tbodyHtml = template('list_maps',{list:g.map});
250 252 $('#map tbody').html(tbodyHtml);
251 253 $("#sumMap tr").addClass("hidden");
... ... @@ -264,7 +266,8 @@
264 266 $("#map tr").addClass("hidden");
265 267 $("#exportMap").addClass("hidden");
266 268 $("#sumMap .hidden").removeClass("hidden");
267   - $("#exportSumMap").removeClass("hidden");
  269 + if(g.map.length > 0)
  270 + $("#exportSumMap").removeClass("hidden");
268 271 $("html,body").animate({scrollTop:$("#sumMap").offset().top},1000);
269 272 }
270 273 });
... ... @@ -278,6 +281,7 @@
278 281 var line = $("#line").val();
279 282 var startDate = $("#startDate").val();
280 283 var endDate = $("#endDate").val();
  284 + var lineName = $('#line option:selected').text();
281 285 function jsDoQuery(pagination){
282 286 if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
283 287 layer.msg("请选择时间!");
... ... @@ -293,6 +297,9 @@
293 297 line = $("#line").val();
294 298 startDate = $("#startDate").val();
295 299 endDate = $("#endDate").val();
  300 + lineName = $('#line option:selected').text();
  301 + if(lineName == "全部线路")
  302 + lineName = $('#subCompany option:selected').text();
296 303 if(line == " ")
297 304 line = "";
298 305 params['company'] = company;
... ... @@ -331,22 +338,23 @@
331 338 params['startDate'] = startDate;
332 339 params['endDate'] = endDate;
333 340 params['type'] = "export";
  341 + params['lineName'] = lineName;
334 342 var i = layer.load(2);
335 343 $get('/pcpc/firstAndLastBus_sum', params, function(result){
336   - window.open("/downloadFile/download?fileName=线路首末班准点率"+moment(startDate).format("YYYYMMDD")+(startDate==endDate?"":("-"+moment(endDate).format("YYYYMMDD"))));
  344 + var dateTime = "";
  345 + if(startDate == endDate){
  346 + dateTime = moment(startDate).format("YYYYMMDD");
  347 + } else {
  348 + dateTime = moment(startDate).format("YYYYMMDD")
  349 + +"-"+moment(endDate).format("YYYYMMDD");
  350 + }
  351 + window.open("/downloadFile/download?fileName="
  352 + +dateTime+"-"+lineName+"-线路首末班准点率");
337 353 layer.close(i);
338 354 });
339 355 });
340 356  
341 357 $("#exportMap").on("click",function(){
342   -// $("#map").table2excel({
343   -// exclue: ".noExl",
344   -// name: "Excel Document Name.xlsx",
345   -// filename: "线路首末班",
346   -// exclude_img: true,
347   -// exclude_links: true,
348   -// exclude_inputs: true
349   -// });
350 358 var i = layer.load(2);
351 359 var params = {};
352 360 params['company'] = company;
... ... @@ -355,21 +363,22 @@
355 363 params['startDate'] = startDate;
356 364 params['endDate'] = endDate;
357 365 params['type'] = "exportMap";
  366 + params['lineName'] = lineName1;
358 367 $get('/pcpc/firstAndLastBus_sum', params, function(result){
359   - window.open("/downloadFile/download?fileName=线路首末班明细");
  368 + var dateTime = "";
  369 + if(startDate == endDate){
  370 + dateTime = moment(startDate).format("YYYYMMDD");
  371 + } else {
  372 + dateTime = moment(startDate).format("YYYYMMDD")
  373 + +"-"+moment(endDate).format("YYYYMMDD");
  374 + }
  375 + window.open("/downloadFile/download?fileName="
  376 + +dateTime+"-"+lineName1+"-线路首末班明细");
360 377 layer.close(i);
361 378 });
362 379 });
363 380  
364 381 $("#exportSumMap").on("click",function(){
365   -// $("#sumMap").table2excel({
366   -// exclue: ".noExl",
367   -// name: "Excel Document Name.xlsx",
368   -// filename: "首末班误点班次",
369   -// exclude_img: true,
370   -// exclude_links: true,
371   -// exclude_inputs: true
372   -// });
373 382 var i = layer.load(2);
374 383 var params = {};
375 384 params['company'] = company;
... ... @@ -378,8 +387,17 @@
378 387 params['startDate'] = startDate;
379 388 params['endDate'] = endDate;
380 389 params['type'] = "delay_export";
  390 + params['lineName'] = lineName;
381 391 $get('/pcpc/firstAndLastBus_sum', params, function(result){
382   - window.open("/downloadFile/download?fileName=首末班误点班次");
  392 + var dateTime = "";
  393 + if(startDate == endDate){
  394 + dateTime = moment(startDate).format("YYYYMMDD");
  395 + } else {
  396 + dateTime = moment(startDate).format("YYYYMMDD")
  397 + +"-"+moment(endDate).format("YYYYMMDD");
  398 + }
  399 + window.open("/downloadFile/download?fileName="
  400 + +dateTime+"-"+lineName+"-首末班误点班次");
383 401 layer.close(i);
384 402 });
385 403 });
... ...
src/main/resources/static/pages/forms/statement/historyMessage.html
... ... @@ -21,20 +21,20 @@
21 21 <h1>调度历史消息</h1>
22 22 </div>
23 23 </div>
24   -
25   -<div class="row">
26   - <div class="col-md-12">
27   - <div class="portlet light porttlet-fit bordered">
28   - <div class="portlet-title">
29   - <form id="history" class="form-inline" action="">
30   - <div style="display: inline-block;">
31   - <span class="item-label" style="width: 80px;">线路: </span>
32   - <select class="form-control" name="line" id="line" style="width: 180px;"></select>
33   - </div>
  24 +
  25 +<div class="row">
  26 + <div class="col-md-12">
  27 + <div class="portlet light porttlet-fit bordered">
  28 + <div class="portlet-title">
  29 + <form id="history" class="form-inline" action="">
  30 + <div style="display: inline-block;">
  31 + <span class="item-label" style="width: 80px;">线路: </span>
  32 + <select class="form-control" name="line" id="line" style="width: 180px;"></select>
  33 + </div>
34 34 <div style="display: inline-block;margin-left: 15px;">
35 35 <span class="item-label" style="width: 80px;">时间: </span>
36 36 <input class="form-control" type="text" id="date" style="width: 180px;"/>
37   - </div>
  37 + </div>
38 38 <div style="display: inline-block;margin-left: 15px">
39 39 <span class="item-label" style="width: 140px;">内部编码: </span>
40 40 <select class="form-control" name="code" id="code" style="width: 180px;"></select>
... ... @@ -42,10 +42,10 @@
42 42 <div class="form-group">
43 43 <input class="btn btn-default" type="button" id="query" value="筛选"/>
44 44 <input class="btn btn-default" type="button" id="export" value="导出"/>
45   - </div>
46   - </form>
47   - </div>
48   - <div class="portlet-body">
  45 + </div>
  46 + </form>
  47 + </div>
  48 + <div class="portlet-body">
49 49 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;">
50 50 <table class="table table-bordered table-hover table-checkable" id="forms">
51 51 <thead>
... ... @@ -62,23 +62,23 @@
62 62  
63 63 </tbody>
64 64 </table>
65   - </div>
66   - </div>
67   - </div>
68   - </div>
69   -</div>
70   -
71   -<script>
  65 + </div>
  66 + </div>
  67 + </div>
  68 + </div>
  69 +</div>
  70 +
  71 +<script>
72 72 $(function(){
73 73 $('#export').attr('disabled', "true");
74   -
75   - // 关闭左侧栏
76   - if (!$('body').hasClass('page-sidebar-closed'))
  74 +
  75 + // 关闭左侧栏
  76 + if (!$('body').hasClass('page-sidebar-closed'))
77 77 $('.menu-toggler.sidebar-toggler').click();
78   -
79   - $("#date").datetimepicker({
80   - format : 'YYYY-MM-DD',
81   - locale : 'zh-cn'
  78 +
  79 + $("#date").datetimepicker({
  80 + format : 'YYYY-MM-DD',
  81 + locale : 'zh-cn'
82 82 });
83 83  
84 84 $.get('/report/lineList',function(xlList){
... ... @@ -146,6 +146,7 @@
146 146 var line = $("#line").val();
147 147 var date = $("#date").val();
148 148 var code = $("#code").val();
  149 + var lineName = $('#line option:selected').text();
149 150 $("#query").on("click",function(){
150 151 if($("#date").val() == null || $("#date").val().trim().length == 0){
151 152 layer.msg("请选择时间");
... ... @@ -154,13 +155,16 @@
154 155 line = $("#line").val();
155 156 date = $("#date").val();
156 157 code = $("#code").val();
  158 + lineName = $('#line option:selected').text();
157 159 var type = "query";
158 160 $(".hidden").removeClass("hidden");
  161 + var i = layer.load(2);
159 162 $get('/realSchedule/historyMessage',{line:line,date:date,code:code,type:type},function(result){
160 163 // 把数据填充到模版中
161 164 var tbodyHtml = template('list_history',{list:result});
162 165 // 把渲染好的模版html文本追加到表格中
163 166 $('#forms tbody').html(tbodyHtml);
  167 + layer.close(i);
164 168  
165 169 if(result.length == 0)
166 170 $("#export").attr('disabled',"true");
... ... @@ -172,27 +176,31 @@
172 176  
173 177 $("#export").on("click",function(){
174 178 var type = "export";
  179 + var i = layer.load(2);
175 180 $get('/realSchedule/historyMessage', {line:line,date:date,code:code,type:type}, function(result){
176   - window.open("/downloadFile/download?fileName=调度历史消息"+moment(date).format("YYYYMMDD"));
  181 + window.open("/downloadFile/download?fileName="
  182 + +moment(date).format("YYYYMMDD")
  183 + +"-"+lineName+"-调度历史消息");
  184 + layer.close(i);
177 185 });
178 186 });
179   -
180   - });
181   -</script>
182   -<script type="text/html" id="list_history">
183   - {{each list as obj i}}
184   - <tr>
  187 +
  188 + });
  189 +</script>
  190 +<script type="text/html" id="list_history">
  191 + {{each list as obj i}}
  192 + <tr>
185 193 <td>{{i+1}}</td>
186 194 <td>{{obj[4]}}</td>
187 195 <td>{{obj[0]}}</td>
188 196 <td>{{obj[1]}}</td>
189 197 <td>{{obj[3]}}</td>
190 198 <td>{{obj[2]}}</td>
191   - </tr>
  199 + </tr>
192 200 {{/each}}
193 201 {{if list.length == 0}}
194 202 <tr>
195 203 <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
196 204 </tr>
197   - {{/if}}
  205 + {{/if}}
198 206 </script>
199 207 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/jobSummary.html
... ... @@ -254,6 +254,7 @@
254 254 }else{
255 255 $("#xlid").html(lineName);
256 256 $("#dateid").html(date);
  257 + var i = layer.load(2);
257 258 $get('/report/jobFwqk',{line:line,date:date},function(result){
258 259 console.log(result);
259 260 var list_lbqk = template('list_lbqk',{list:result});
... ... @@ -263,6 +264,7 @@
263 264 $('#forms .list_lbqk').rowspan(1);
264 265 $('#forms .list_lbqk').rowspan(2);
265 266 $('#forms .list_lbqk').rowspan(3);
  267 + layer.close(i);
266 268  
267 269 })
268 270  
... ... @@ -270,6 +272,7 @@
270 272 var list_ljqk = template('list_ljqk',{list:result});
271 273 // 把渲染好的模版html文本追加到表格中
272 274 $('#forms .list_ljqk').html(list_ljqk);
  275 + layer.close(i);
273 276 })
274 277  
275 278 $get('/report/jobHzxx',{line:line,date:date},function(result){
... ... @@ -282,6 +285,7 @@
282 285 $("#lbgls").html(result.lbgl)
283 286 var list_xxsj=template('list_xxsj',result);
284 287 $('#forms .list_xxsj').html(list_xxsj);
  288 + layer.close(i);
285 289  
286 290 })
287 291  
... ... @@ -298,8 +302,12 @@
298 302 }else if(date==""||date==null){
299 303 layer.msg('请选择日期.');
300 304 }else{
  305 + var i = layer.load(2);
301 306 $get('/report/jobSummaryExport',{line:line,date:date,lineName:lineName},function(result){
302   - window.open("/downloadFile/download?fileName=调度员工作汇总日报");
  307 + window.open("/downloadFile/download?fileName="
  308 + +moment(date).format("YYYYMMDD")
  309 + +"-"+lineName+"-调度员工作汇总日报");
  310 + layer.close(i);
303 311 });
304 312 }
305 313 });
... ...
src/main/resources/static/pages/forms/statement/lbStatuAnaly.html
... ... @@ -119,14 +119,6 @@
119 119 if (!$('body').hasClass('page-sidebar-closed'))
120 120 $('.menu-toggler.sidebar-toggler').click();
121 121  
122   - $("#startDate").datetimepicker({
123   - format : 'YYYY-MM-DD',
124   - locale : 'zh-cn'
125   - });
126   - $("#endDate").datetimepicker({
127   - format : 'YYYY-MM-DD',
128   - locale : 'zh-cn'
129   - });
130 122 $("#times1").datetimepicker({
131 123 format : 'HH:mm',
132 124 locale : 'zh-cn'
... ... @@ -137,6 +129,7 @@
137 129 });
138 130  
139 131 var d = new Date();
  132 + d.setTime(d.getTime() - 1*1000*60*60*24);
140 133 var year = d.getFullYear();
141 134 var month = d.getMonth() + 1;
142 135 var day = d.getDate();
... ... @@ -144,8 +137,19 @@
144 137 month = "0" + month;
145 138 if(day < 10)
146 139 day = "0" + day;
147   - $("#startDate").val(year + "-" + month + "-" + day);
148   - $("#endDate").val(year + "-" + month + "-" + day);
  140 + var dateTime = year + "-" + month + "-" + day;
  141 + $("#startDate").datetimepicker({
  142 + format : 'YYYY-MM-DD',
  143 + locale : 'zh-cn',
  144 + maxDate : dateTime
  145 + });
  146 + $("#endDate").datetimepicker({
  147 + format : 'YYYY-MM-DD',
  148 + locale : 'zh-cn',
  149 + maxDate : dateTime
  150 + });
  151 + $("#startDate").val(dateTime);
  152 + $("#endDate").val(dateTime);
149 153  
150 154 $("#times1").val("05:00");
151 155 $("#times2").val("23:00");
... ... @@ -308,6 +312,7 @@
308 312 var times = $("#times1").val() + "-" + $("#times2").val();
309 313 var company = $("#company").val();
310 314 var subCompany = $("#subCompany").val();
  315 + var lineName = $('#line option:selected').text();
311 316 function jsDoQuery(pagination){
312 317 if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
313 318 layer.msg("请选择日期");
... ... @@ -337,12 +342,18 @@
337 342 params['company'] = company;
338 343 params['subCompany'] = subCompany;
339 344 params['type'] = "query";
  345 + lineName = $('#line option:selected').text();
  346 + if(lineName == "全部线路")
  347 + lineName = $('#subCompany option:selected').text();
  348 + var i = layer.load(2);
340 349 // $(".hidden").removeClass("hidden");
341 350 $get('/busInterval/lbStatuAnaly', params, function(result){
342 351 // 把数据填充到模版中
343 352 var tbodyHtml = template('list_lbAnaly',{list:result, reason:reason, lb:lb});
344 353 // 把渲染好的模版html文本追加到表格中
345 354 $('#forms').html(tbodyHtml);
  355 + layer.close(i);
  356 +
346 357 _w_table_rowspan("#forms", 1);
347 358 _w_table_rowspan("#forms", 2);
348 359 _w_table_rowspan("#forms", 3);
... ... @@ -381,10 +392,14 @@
381 392 params['company'] = company;
382 393 params['subCompany'] = subCompany;
383 394 params['type'] = "export";
  395 + params['lineName'] = lineName;
  396 + var i = layer.load(2);
384 397 $get('/busInterval/lbStatuAnaly', params, function(result){
385   - window.open("/downloadFile/download?fileName=烂班情况分析表"
  398 + window.open("/downloadFile/download?fileName="
386 399 + moment(startDate).format("YYYYMMDD")
387   - +"-"+ moment(endDate).format("YYYYMMDD"));
  400 + +"-"+ moment(endDate).format("YYYYMMDD")
  401 + +"-"+lineName+"-烂班情况分析表");
  402 + layer.close(i);
388 403 });
389 404 });
390 405  
... ...
src/main/resources/static/pages/forms/statement/lineTimeAnaly.html
... ... @@ -206,60 +206,6 @@
206 206 $("#times1").val("05:00");
207 207 $("#times2").val("23:00");
208 208  
209   -// var obj = [];
210   -// $.get('/user/companyData', function(result){
211   -// obj = result;
212   -// var options = '';
213   -// for(var i = 0; i < obj.length; i++){
214   -// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
215   -// }
216   -// if(obj.length == 1){
217   -// $('#company1').hide();
218   -// if(obj[0].children.length == 1)
219   -// $('#subCompany1').hide();
220   -// }
221   -// $('#company').html(options);
222   -// updateCompany();
223   -// });
224   -// $("#company").on("change",updateCompany);
225   -// function updateCompany(){
226   -// var company = $('#company').val();
227   -// var options = '';
228   -// for(var i = 0; i < obj.length; i++){
229   -// if(obj[i].companyCode == company){
230   -// var children = obj[i].children;
231   -// for(var j = 0; j < children.length; j++){
232   -// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
233   -// }
234   -// }
235   -// }
236   -// $('#subCompany').html(options);
237   -// }
238   -
239   -// $.get('/basic/lineCode2Name',function(result){
240   -// var data=[];
241   -
242   -// data.push({id: " ", text:"全部路线"});
243   -// for(var code in result){
244   -// data.push({id: code, text: result[code]});
245   -// }
246   -// console.log(data);
247   -// initPinYinSelect2('#line',data,'');
248   -
249   -// line = "";
250   -// updateModel();
251   -
252   -// var params = {};
253   -// params['line'] = line;
254   -// $get('/busInterval/getDir', params, function(result){
255   -// dirData = createTreeData(result);
256   -// var options = '<option value="">全部方向</option>';
257   -// $.each(dirData, function(i, g){
258   -// options += '<option value="'+g.name+'">'+g.name+'</option>';
259   -// });
260   -// $('#upDown').html(options);
261   -// });
262   -// });
263 209 var fage=false;
264 210 var xlList;
265 211 var obj = [];
... ...
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
... ... @@ -183,6 +183,7 @@
183 183 var date = $("#date").val();
184 184 var company = $("#company").val();
185 185 var subCompany = $("#subCompany").val();
  186 + var lineName = $('#line option:selected').text();
186 187 function jsDoQuery(pagination){
187 188 if($("#date").val() == null || $("#date").val().trim().length == 0){
188 189 layer.msg("请选择时间");
... ... @@ -193,6 +194,9 @@
193 194 subCompany = $("#subCompany").val();
194 195 line = $("#line").val();
195 196 date = $("#date").val();
  197 + lineName = $('#line option:selected').text();
  198 + if(lineName == "全部线路")
  199 + lineName = $('#subCompany option:selected').text();
196 200 if(line == " ")
197 201 line = "";
198 202 params['company'] = company;
... ... @@ -221,8 +225,11 @@
221 225 params['line'] = line;
222 226 params['date'] = date;
223 227 params['type'] = "export";
  228 + params['lineName'] = lineName;
224 229 $get('/pcpc/queryPeopleCar', params, function(result){
225   - window.open("/downloadFile/download?fileName=计划车辆班次人员"+moment(date).format("YYYYMMDD"));
  230 + window.open("/downloadFile/download?fileName="
  231 + +moment(date).format("YYYYMMDD")
  232 + +"-"+lineName+"-计划车辆班次人员");
226 233 });
227 234 });
228 235  
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly.html
... ... @@ -226,6 +226,7 @@
226 226 var bcType = $('#bcType').val();
227 227 var company = $("#company").val();
228 228 var subCompany = $("#subCompany").val();
  229 + var lineName = $('#line option:selected').text();
229 230 function jsDoQuery(pagination){
230 231 if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
231 232 layer.msg("请选择时间范围!");
... ... @@ -243,6 +244,9 @@
243 244 bcType = $("#bcType").val();
244 245 company = $("#company").val();
245 246 subCompany = $("#subCompany").val();
  247 + lineName = $('#line option:selected').text();
  248 + if(lineName == "全部线路")
  249 + lineName = $('#subCompany option:selected').text();
246 250 params['page'] = page;
247 251 params['line'] = line;
248 252 params['startDate'] = startDate;
... ... @@ -298,9 +302,13 @@
298 302 params['subCompany'] = subCompany;
299 303 params['bcType'] = bcType;
300 304 params['type'] = "export";
  305 + params['lineName'] = lineName;
301 306 var i = layer.load(2);
302 307 $get('/pcpc/scheduleAnaly', params, function(result){
303   - window.open("/downloadFile/download?fileName=时刻表分析"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  308 + window.open("/downloadFile/download?fileName="
  309 + +moment(startDate).format("YYYYMMDD")+
  310 + "-"+moment(endDate).format("YYYYMMDD")
  311 + +"-"+lineName+"-时刻表分析");
304 312 layer.close(i);
305 313 });
306 314 });
... ...
src/main/resources/static/pages/forms/statement/scheduleAnaly_sum.html
... ... @@ -113,17 +113,9 @@
113 113 if (!$('body').hasClass('page-sidebar-closed'))
114 114 $('.menu-toggler.sidebar-toggler').click();
115 115  
116   - $("#startDate").datetimepicker({
117   - format : 'YYYY-MM-DD',
118   - locale : 'zh-cn'
119   - });
120   -
121   - $("#endDate").datetimepicker({
122   - format : 'YYYY-MM-DD',
123   - locale : 'zh-cn'
124   - });
125 116  
126 117 var d = new Date();
  118 + d.setTime(d.getTime() - 1*1000*60*60*24);
127 119 var year = d.getFullYear();
128 120 var month = d.getMonth() + 1;
129 121 var day = d.getDate();
... ... @@ -131,8 +123,19 @@
131 123 month = "0" + month;
132 124 if(day < 10)
133 125 day = "0" + day;
134   - $("#startDate").val(year + "-" + month + "-" + day);
135   - $("#endDate").val(year + "-" + month + "-" + day);
  126 + var dateTime = year + "-" + month + "-" + day;
  127 + $("#startDate").datetimepicker({
  128 + format : 'YYYY-MM-DD',
  129 + locale : 'zh-cn',
  130 + maxDate : dateTime
  131 + });
  132 + $("#endDate").datetimepicker({
  133 + format : 'YYYY-MM-DD',
  134 + locale : 'zh-cn',
  135 + maxDate : dateTime
  136 + });
  137 + $("#startDate").val(dateTime);
  138 + $("#endDate").val(dateTime);
136 139  
137 140 var fage=false;
138 141 var xlList;
... ... @@ -226,6 +229,7 @@
226 229 var nbbm = "";
227 230 var company = $("#company").val();
228 231 var subCompany = $("#subCompany").val();
  232 + var lineName = $('#line option:selected').text();
229 233 function jsDoQuery(pagination){
230 234 if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
231 235 layer.msg("请选择时间范围!");
... ... @@ -244,6 +248,9 @@
244 248 nbbm = $("#nbbm").val()!=null?$("#nbbm").val():"";
245 249 company = $("#company").val();
246 250 subCompany = $("#subCompany").val();
  251 + lineName = $('#line option:selected').text();
  252 + if(lineName == "全部线路")
  253 + lineName = $('#subCompany option:selected').text();
247 254 params['page'] = page;
248 255 params['line'] = line;
249 256 params['startDate'] = startDate;
... ... @@ -255,11 +262,13 @@
255 262 params['nbbm'] = nbbm;
256 263 params['type'] = "query";
257 264 $(".hidden").removeClass("hidden");
  265 + var i = layer.load(2);
258 266 $get('/pcpc/scheduleAnaly_sum', params, function(result){
259 267 // 把数据填充到模版中
260 268 var tbodyHtml = template('list_scheduleAnaly_sum',{list:result.dataList, companyName:companyName, subCompanyName:subCompanyName});
261 269 // 把渲染好的模版html文本追加到表格中
262 270 $('#forms tbody').html(tbodyHtml);
  271 + layer.close(i);
263 272  
264 273 if(result.dataList.length == 0)
265 274 $("#export").attr('disabled',"true");
... ... @@ -289,8 +298,19 @@
289 298 params['subCompany'] = subCompany;
290 299 params['nbbm'] = nbbm;
291 300 params['type'] = "export";
  301 + params['lineName'] = lineName;
  302 + var i = layer.load(2);
292 303 $get('/pcpc/scheduleAnaly_sum', params, function(result){
293   - window.open("/downloadFile/download?fileName=时刻表分析(汇总)"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  304 + var dateTime = "";
  305 + if(startDate == endDate){
  306 + dateTime = moment(startDate).format("YYYYMMDD");
  307 + } else {
  308 + dateTime = moment(startDate).format("YYYYMMDD")
  309 + +"-"+moment(endDate).format("YYYYMMDD");
  310 + }
  311 + window.open("/downloadFile/download?fileName="
  312 + +dateTime+"-"+lineName+"-时刻表分析(汇总)");
  313 + layer.close(i);
294 314 });
295 315 });
296 316  
... ...
src/main/resources/static/pages/forms/statement/scheduleDaily.html
... ... @@ -431,6 +431,7 @@
431 431 // $("#ddrbBody").height($(window).height()-300);
432 432 $("c").html("全日");
433 433 $("#export").removeAttr("disabled");
  434 + var i = layer.load(2);
434 435 $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName,type:"query"},function(result){
435 436 var scheduleDaily_1 = template('scheduleDaily_1',{list:result});
436 437 $("#jls").html(result[0].jls);
... ... @@ -452,6 +453,7 @@
452 453 divFrom1 = window.document.getElementById('forms');
453 454 divFrom3 = window.document.getElementById('forms_2');
454 455 divFrom3.style.width=divFrom1.offsetWidth+"px";
  456 + layer.close(i);
455 457 });
456 458  
457 459 });
... ... @@ -492,9 +494,9 @@
492 494 params['state'] = '2';
493 495 $get('/realSchedule/scheduleDailyExport', params, function(result){
494 496 if(date.length == 10)
495   - window.open("/downloadFile/download?fileName=调度日报-"+lineName+"-"+moment(date).format("YYYYMMDD"));
  497 + window.open("/downloadFile/download?fileName="+moment(date).format("YYYYMMDD")+"-"+lineName+"-调度日报");
496 498 else
497   - window.open("/downloadFile/download?fileName=调度日报"+moment(date).format("YYYYMM"));
  499 + window.open("/downloadFile/download?fileName="+moment(date).format("YYYYMM")+"-"+lineName+"-调度日报");
498 500 });
499 501 });
500 502  
... ...
src/main/resources/static/pages/forms/statement/statisticsDaily.html
... ... @@ -148,7 +148,7 @@
148 148 // 关闭左侧栏
149 149 if (!$('body').hasClass('page-sidebar-closed'))
150 150 $('.menu-toggler.sidebar-toggler').click();
151   -
  151 +
152 152 $("#date").datetimepicker({
153 153 format : 'YYYY-MM-DD',
154 154 locale : 'zh-cn'
... ... @@ -264,11 +264,13 @@
264 264 }
265 265 // $("#tjrbBody").height($(window).height()-100);
266 266 line = $("#line").val();
267   - xlName = $("#select2-line-container").html();
268 267 date = $("#date").val();
269 268 date2 =$("#date2").val();
270 269 gsdm =$("#gsdm").val();
271 270 fgsdm=$("#fgsdm").val();
  271 + xlName = $("#select2-line-container").html();
  272 + if(xlName == "全部线路")
  273 + xlName = $('#fgsdm option:selected').text();
272 274 if(line=="请选择"){
273 275 line="";
274 276 }
... ... @@ -284,11 +286,13 @@
284 286 params['date2'] = date2;
285 287 params['xlName'] = xlName;
286 288 params['type'] = "query";
  289 + var i = layer.load(2);
287 290 $get('/realSchedule/statisticsDailyTj',params,function(result){
288 291 // 把数据填充到模版中
289 292 var tbodyHtml = template('statisticsDaily',{list:result});
290 293 // 把渲染好的模版html文本追加到表格中
291 294 $('#forms .statisticsDaily').html(tbodyHtml);
  295 + layer.close(i);
292 296  
293 297 if(result.length == 0)
294 298 $("#export").attr('disabled',"true");
... ... @@ -302,14 +306,24 @@
302 306 $("#export").on("click",function(){
303 307 var params = {};
304 308 params['gsdm'] = gsdm;
305   - params['fgsdm'] =fgsdm ;
  309 + params['fgsdm'] =fgsdm;
306 310 params['line'] = line;
307 311 params['date'] = date;
308 312 params['date2'] = date2;
309 313 params['xlName'] = xlName;
310 314 params['type'] = "export";
  315 + var i = layer.load(2);
311 316 $get('/realSchedule/statisticsDailyTj',params,function(result){
312   - window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD"));
  317 + var dateTime = "";
  318 + if(date == date2){
  319 + dateTime = moment(date).format("YYYYMMDD");
  320 + } else {
  321 + dateTime = moment(date).format("YYYYMMDD")
  322 + +"-"+moment(date2).format("YYYYMMDD");
  323 + }
  324 + window.open("/downloadFile/download?fileName="
  325 + +dateTime+"-"+xlName+"-统计日报");
  326 + layer.close(i);
313 327 });
314 328 });
315 329  
... ... @@ -358,7 +372,7 @@
358 372 <td>{{obj.djg_m}}</td>
359 373 <td>{{obj.djg_a}}</td>
360 374 <td>{{obj.djg_time}}</td>
361   - <td>&nbsp;</td>
  375 + <td>&nbsp;</td>
362 376 </tr>
363 377 {{/each}}
364 378 {{if list.length == 0}}
... ...
src/main/resources/static/pages/forms/statement/statisticsDailyCalc.html
... ... @@ -150,7 +150,7 @@
150 150 $('.menu-toggler.sidebar-toggler').click();
151 151  
152 152 var d = new Date();
153   - d.setTime(d.getTime() - 1*1000*60*60*24);
  153 + d.setTime(d.getTime() - 4*1000*60*60*24);
154 154 var year = d.getFullYear();
155 155 var month = d.getMonth() + 1;
156 156 var day = d.getDate();
... ... @@ -267,11 +267,13 @@
267 267 }
268 268 // $("#tjrbBody").height($(window).height()-100);
269 269 line = $("#line").val();
270   - xlName = $("#select2-line-container").html();
271 270 date = $("#date").val();
272 271 date2 =$("#date2").val();
273 272 gsdm =$("#gsdm").val();
274 273 fgsdm=$("#fgsdm").val();
  274 + xlName = $("#select2-line-container").html();
  275 + if(xlName == "全部线路")
  276 + xlName = $('#fgsdm option:selected').text();
275 277 if(line=="请选择"){
276 278 line="";
277 279 }
... ... @@ -314,8 +316,19 @@
314 316 params['date2'] = date2;
315 317 params['xlName'] = xlName;
316 318 params['type'] = "export";
317   - $get('/realSchedule/statisticsDailyTj',params,function(result){
318   - window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD"));
  319 + var i = layer.load(2);
  320 +// $get('/realSchedule/statisticsDailyTj',params,function(result){
  321 + $get('/calcWaybill/statisticsDailyTj',params,function(result){
  322 + var dateTime = "";
  323 + if(date == date2){
  324 + dateTime = moment(date).format("YYYYMMDD");
  325 + } else {
  326 + dateTime = moment(date).format("YYYYMMDD")
  327 + +"-"+moment(date2).format("YYYYMMDD");
  328 + }
  329 + window.open("/downloadFile/download?fileName="
  330 + +dateTime+"-"+xlName+"-统计日报");
  331 + layer.close(i);
319 332 });
320 333 });
321 334  
... ...
src/main/resources/static/pages/forms/statement/statisticsDailyCalc2.html
... ... @@ -150,7 +150,7 @@
150 150 $('.menu-toggler.sidebar-toggler').click();
151 151  
152 152 var d = new Date();
153   - d.setTime(d.getTime() - 1*1000*60*60*24);
  153 + d.setTime(d.getTime() - 4*1000*60*60*24);
154 154 var year = d.getFullYear();
155 155 var month = d.getMonth() + 1;
156 156 var day = d.getDate();
... ... @@ -267,11 +267,13 @@
267 267 }
268 268 // $("#tjrbBody").height($(window).height()-100);
269 269 line = $("#line").val();
270   - xlName = $("#select2-line-container").html();
271 270 date = $("#date").val();
272 271 date2 =$("#date2").val();
273 272 gsdm =$("#gsdm").val();
274 273 fgsdm=$("#fgsdm").val();
  274 + xlName = $("#select2-line-container").html();
  275 + if(xlName == "全部线路")
  276 + xlName = $('#fgsdm option:selected').text();
275 277 if(line=="请选择"){
276 278 line="";
277 279 }
... ... @@ -314,8 +316,19 @@
314 316 params['date2'] = date2;
315 317 params['xlName'] = xlName;
316 318 params['type'] = "export";
317   - $get('/realSchedule/statisticsDailyTj',params,function(result){
318   - window.open("/downloadFile/download?fileName=统计日报"+moment(date).format("YYYYMMDD"));
  319 + var i = layer.load(2);
  320 +// $get('/realSchedule/statisticsDailyTj',params,function(result){
  321 + $get('/calcWaybill/calcStatisticsDaily',params,function(result){
  322 + var dateTime = "";
  323 + if(date == date2){
  324 + dateTime = moment(date).format("YYYYMMDD");
  325 + } else {
  326 + dateTime = moment(date).format("YYYYMMDD")
  327 + +"-"+moment(date2).format("YYYYMMDD");
  328 + }
  329 + window.open("/downloadFile/download?fileName="
  330 + +dateTime+"-"+xlName+"-统计日报");
  331 + layer.close(i);
319 332 });
320 333 });
321 334  
... ...
src/main/resources/static/pages/forms/statement/timeAndSpeed.html
... ... @@ -159,49 +159,6 @@
159 159 $("#times1").attr("disabled", true);
160 160 $("#times2").attr("disabled", true);
161 161  
162   -// var obj = [];
163   -// $.get('/user/companyData', function(result){
164   -// obj = result;
165   -// var options = '';
166   -// for(var i = 0; i < obj.length; i++){
167   -// options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
168   -// }
169   -// if(obj.length == 1){
170   -// $('#company1').hide();
171   -// if(obj[0].children.length == 1)
172   -// $('#subCompany1').hide();
173   -// }
174   -// $('#company').html(options);
175   -// updateCompany();
176   -// });
177   -// $("#company").on("change",updateCompany);
178   -// function updateCompany(){
179   -// var company = $('#company').val();
180   -// var options = '';
181   -// for(var i = 0; i < obj.length; i++){
182   -// if(obj[i].companyCode == company){
183   -// var children = obj[i].children;
184   -// for(var j = 0; j < children.length; j++){
185   -// options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
186   -// }
187   -// }
188   -// }
189   -// $('#subCompany').html(options);
190   -// }
191   -
192   -// $.get('/basic/lineCode2Name',function(result){
193   -// var data=[];
194   -
195   -// for(var code in result){
196   -// data.push({id: code, text: result[code]});
197   -// }
198   -// initPinYinSelect2('#line',data,'');
199   -
200   -// line = data[0].id;
201   -
202   -// updateModel();
203   -// updateLp("");
204   -// })
205 162 var fage=false;
206 163 var xlList;
207 164 var obj = [];
... ... @@ -301,6 +258,7 @@
301 258 var company = $("#company").val();
302 259 var subCompany = $("#subCompany").val();
303 260 var lp = $("#lp").val();
  261 + var lineName = $('#line option:selected').text();
304 262 function jsDoQuery(pagination){
305 263 if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){
306 264 layer.msg("请选择日期");
... ... @@ -320,6 +278,9 @@
320 278 company = $("#company").val();
321 279 subCompany = $("#subCompany").val();
322 280 lp = $("#lp").val();
  281 + lineName = $('#line option:selected').text();
  282 + if(lineName == "全部线路")
  283 + lineName = $('#subCompany option:selected').text();
323 284 params['lp'] = lp;
324 285 params['line'] = line;
325 286 params['sfqr'] = sfqr;
... ... @@ -394,11 +355,17 @@
394 355 params['company'] = company;
395 356 params['subCompany'] = subCompany;
396 357 params['type'] = "export";
  358 + params['lineName'] = lineName;
397 359 var i = layer.load(2);
398 360 $get('/busInterval/timeAndSpeed', params, function(result){
399   - window.open("/downloadFile/download?fileName=行驶时间及车速统计表"
400   - +moment(startDate).format("YYYYMMDD")+"-"
401   - +moment(endDate).format("YYYYMMDD"));
  361 + var dateTime = "";
  362 + if(startDate == endDate){
  363 + dateTime = moment(startDate).format("YYYYMMDD");
  364 + } else {
  365 + dateTime = moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD");
  366 + }
  367 + window.open("/downloadFile/download?fileName="
  368 + +dateTime+"-"+lineName+"-行驶时间及车速统计表");
402 369 layer.close(i);
403 370 });
404 371 });
... ...
src/main/resources/static/pages/forms/statement/waybill.html
... ... @@ -227,10 +227,12 @@
227 227 });
228 228 var date = '';
229 229 var line = '';
  230 + var lineName;
230 231 $("#query").on("click",function(){
231 232 $("#left_height").height($(window).height()-100);
232 233 line = $("#line").val();
233 234 date = $("#date").val();
  235 + lineName = $('#line option:selected').text();
234 236 $(".hidden").removeClass("hidden");
235 237 $get('/realSchedule/queryUserInfo',{line:line,date:date,state:2},function(result){
236 238 // 把数据填充到模版中
... ... @@ -363,7 +365,7 @@
363 365 });
364 366 // $get('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){
365 367 // window.open("/downloadFile/downloadList?fileName="+result.fileName); //下载压缩包
366   - $get('/busInterval/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){
  368 + $get('/busInterval/exportWaybillMore',{date:date,line:line,lineName:lineName,strs:JSON.stringify(param)},function(result){
367 369 window.open("/downloadFile/download?fileName="+result.fileName);
368 370 layer.close(i);
369 371 });
... ...
src/main/resources/static/pages/forms/statement/workDaily.html
... ... @@ -116,7 +116,7 @@
116 116 var xlList;
117 117 var obj = [];
118 118  
119   -
  119 +
120 120 $.get('/report/lineList',function(result){
121 121 xlList=result;
122 122 $.get('/user/companyData', function(result){
... ... @@ -198,6 +198,7 @@
198 198 var date = $("#date").val();
199 199 var company = $("#company").val();
200 200 var subCompany = $("#subCompany").val();
  201 + var lineName = $('#line option:selected').text();
201 202 function jsDoQuery(pagination){
202 203 if($("#date").val() == null || $("#date").val().trim().length == 0){
203 204 layer.msg("请选择时间");
... ... @@ -208,6 +209,9 @@
208 209 date = $("#date").val();
209 210 company = $("#company").val();
210 211 subCompany = $("#subCompany").val();
  212 + lineName = $('#line option:selected').text();
  213 + if(lineName == "全部线路")
  214 + lineName = $('#subCompany option:selected').text();
211 215 if(line == " ")
212 216 line = "";
213 217 params['line'] = line;
... ... @@ -216,11 +220,13 @@
216 220 params['company'] = company;
217 221 params['subCompany'] = subCompany;
218 222 $(".hidden").removeClass("hidden");
  223 + var i = layer.load(2);
219 224 $get('/pcpc/workDaily', params, function(result){
220 225 // 把数据填充到模版中
221 226 var tbodyHtml = template('list_workDaily',{list:result});
222 227 // 把渲染好的模版html文本追加到表格中
223 228 $('#forms tbody').html(tbodyHtml);
  229 + layer.close(i);
224 230  
225 231 if(result.length == 0)
226 232 $("#export").attr('disabled',"true");
... ... @@ -236,8 +242,11 @@
236 242 params['type'] = "export";
237 243 params['company'] = company;
238 244 params['subCompany'] = subCompany;
  245 + params['lineName'] = lineName;
239 246 $get('/pcpc/workDaily', params, function(result){
240   - window.open("/downloadFile/download?fileName=营运服务日报表"+moment(date).format("YYYYMMDD"));
  247 + window.open("/downloadFile/download?fileName="
  248 + +moment(date).format("YYYYMMDD")
  249 + +"-"+lineName+"-营运服务日报表");
241 250 });
242 251 });
243 252  
... ...
src/main/resources/static/pages/home.html
... ... @@ -59,38 +59,16 @@
59 59 }
60 60 </style>
61 61 <div class="system_change_log">
62   - <h2 style="text-indent: 35px;margin: 10px 0 5px;">2018-02-06 更新说明 Changelog</h2>
  62 + <h2 style="text-indent: 35px;margin: 10px 0 5px;">2018-04-12 更新说明 Changelog</h2>
  63 + <br><br>
63 64 <ul >
64   - <li class="sub_title"><h6>基础信息</h6></li>
65   - <li><span class="label s_c_add">新增</span>1、新增站点间双路段生成功能。</li>
66   - <li><span class="label s_c_change">修复</span>2、修复一个bug,在线路编辑页面初始化线路的系统规划功能,百度地图上缺少的线路会显示一直加载。</li>
67   - <li><span class="label s_c_change">修改</span>3、修改站点位置修改。</li>
68   - <li><span class="label s_c_add">新增</span>4、新增线路删除功能,可以删除已撤销的线路,仅用于剔除录入错误的数据,如出现误操作,请联系管理员恢复数据。</li>
69   - <li class="sub_title"><h6>用油和报表</h6></li>
70   - <li><span class="label s_c_add">新增</span>5、油量,电量记录操作日志。</li>
71   - <li><span class="label s_c_change">修复</span>6、修正获取加存油信息特殊情况下获取不到前一天的进场值。</li>
72   - <li><span class="label s_c_change">修复</span>7、行车路单批量导出,由之前导出成多个压缩文件改为导出成一个文件</li>
73   - <li><span class="label s_c_add">新增</span>8、新增班次准点率统计导出。</li>
74   - <li><span class="label s_c_change">修复</span>9、修复一个bug,这个bug导致在更换设备号后,驾驶员请求台账出现车辆字段为空的情况。</li>
75 65 <li class="sub_title"><h6>计划调度</h6></li>
76   - <li><span class="label s_c_add">新增</span>10、时刻表自动生成,根据时间间隔自动时刻表生成,导出生成的时刻表数据。</li>
77   - <li><span class="label s_c_add">新增</span>11、时刻表版本导入,导入时刻表可选版本,编辑时间表带版本。</li>
78   - <li><span class="label s_c_add">新增</span>12、添加车辆报废功能,释放报废的车辆所持有的设备编号。</li>
79   - <li><span class="label s_c_change">修复</span>13、车辆设备管理,启用日期精确到时间分钟。</li>
  66 + <li><span class="label s_c_change">修复</span>1、控制相同线路并发生成计划可能重复班次的问题。</li>
80 67 <li class="sub_title"><h6>线调</h6></li>
81   - <li><span class="label s_c_change">修复</span>14、修复一个轨迹回放的bug,这个bug导致在车辆更换设备号之后,无法回放更换设备之前的数据。</li>
82   - <li><span class="label s_c_change">修复</span>15、修复驾驶员请求信使,无法点击不同意的问题。</li>
83   - <li><span class="label s_c_add">新增</span>16、新增异常提示,当子任务公里与计划不等时,子任务 badge 将会显示为红色,相等则为绿色。</li>
84   - <li><span class="label s_c_add">新增</span>17、新增子任务修改功能。</li>
85   - <li><span class="label s_c_add">新增</span>18、新增点击路牌单元格时,信使框下方弹出tip,显示路牌公里。</li>
86   - <li><span class="label s_c_add">新增</span>19、新增车辆状态标记,如果车辆在套跑其他线路班次,在车辆单元格右上角会出现一个 icon 显示车辆当前执行的线路。</li>
87   - <li><span class="label s_c_add">新增</span>20、新增双击车辆单元格展开全部车辆面板,显示所有的计划用车和实际的车载信号。</li>
88   - <li><span class="label s_c_add">新增</span>21、新增超速提醒,地图模块左下角。</li>
89   - <li><span class="label s_c_remove">删除</span>22、移除了表格渐变色。</li>
90   - <li><span class="label s_c_add">新增</span>23、模拟图车辆展开的tip上,显示司售信息。</li>
91   - <li><span class="label s_c_add">新增</span>24、轨迹回放窗口打开时,点击班次,会自动将班次车辆时间写入轨迹搜索表单。</li>
92   - <li><span class="label s_c_add">新增</span>25、已撤销的线路也可以进入线调(线路授权、选择线路、线调tab 等页面均以红色区分撤销的线路)。</li>
93   - <li><span class="label s_c_add">新增</span>26、轨迹回放点击搜索后,车辆输入框后面会显示设备号,悬停展示该设备号的更换时间。</li>
94   - <li><span class="label s_c_add">新增</span>27、轨迹回放的停车场下拉列表新增搜索功能。</li>
  68 + <li><span class="label s_c_change">修复</span>2、修正“误点自动待发调整功能”在某些特定场景下失效的问题。</li>
  69 + <li><span class="label s_c_change">修复</span>3、修正“轨迹回放”页面,车辆“选择”展开的“线路配车”数据列表里,没有排除已报废配车数据的问题。</li>
  70 + <li><span class="label s_c_add">新增</span>4、线路配置里的“场既是站”设置,现在可以设置多个停车场。</li>
  71 + <li><span class="label s_c_add">新增</span>5、换人换车时,如果跨分公司换人换车,系统会弹出提示,需确认后才能调换。</li>
  72 + <li><span class="label s_c_add">新增</span>6、如果“班次站点编码”和当前线路版本的“实际站点编码”不符,班次表格上会出现提示。</li>
95 73 </ul>
96 74 </div>
... ...
src/main/resources/static/pages/mforms/changetochanges/changetochange.html
... ... @@ -137,10 +137,22 @@
137 137 if (!$('body').hasClass('page-sidebar-closed'))
138 138 $('.menu-toggler.sidebar-toggler').click();
139 139  
  140 + var d = new Date();
  141 + d.setTime(d.getTime() - 1*1000*60*60*24);
  142 + var year = d.getFullYear();
  143 + var month = d.getMonth() + 1;
  144 + var day = d.getDate();
  145 + if(month < 10)
  146 + month = "0" + month;
  147 + if(day < 10)
  148 + day = "0" + day;
  149 + var dateTime = year + "-" + month + "-" + day;
140 150 $("#startDate,#endDate").datetimepicker({
141 151 format : 'YYYY-MM-DD',
142   - locale : 'zh-cn'
  152 + locale : 'zh-cn',
  153 + maxDate : dateTime
143 154 });
  155 + $("#startDate,#endDate").val(dateTime);
144 156  
145 157 var fage=false;
146 158 var xlList;
... ... @@ -233,6 +245,7 @@
233 245 var gsdmChange= $("#gsdmChange").val();
234 246 var fgsdmChange= $("#fgsdmChange").val();
235 247 if (startDate1 != '' && endDate1 != '') {
  248 + var i = layer.load(2);
236 249 $get('/mcy_forms/changetochange', {
237 250 sel : sel,
238 251 line : line,
... ... @@ -248,6 +261,7 @@
248 261 });
249 262 // 把渲染好的模版html文本追加到表格中
250 263 $('#forms tbody').html(tbodyHtml);
  264 + layer.close(i);
251 265 })
252 266  
253 267 } else {
... ... @@ -258,23 +272,37 @@
258 272 $("#export").on(
259 273 "click",
260 274 function() {
  275 + line = $("#line").val();
261 276 var sel = $("#sel").val();
262 277 var startDate = $("#startDate").val();
263 278 var endDate = $("#endDate").val();
264 279 var lpName = $("#lpName").val();
265 280 var gsdmChange= $("#gsdmChange").val();
266 281 var fgsdmChange= $("#fgsdmChange").val();
  282 + var lineName = $('#line option:selected').text();
  283 + if(lineName == "全部线路")
  284 + lineName = $('#fgsdmChange option:selected').text();
  285 + var i = layer.load(2);
267 286 $post('/mcy_export/changetochangeExport', {
268 287 sel:sel,
269 288 line:line,
270   - gsdmChange:gsdmChange,
271   - fgsdmChange:fgsdmChange,
  289 + gsdm:gsdmChange,
  290 + fgsdm:fgsdmChange,
272 291 startDate : startDate,
273 292 endDate : endDate,
274   - type : 'export'
  293 + type : 'export',
  294 + lineName : lineName
275 295 }, function(result) {
276   - window.open("/downloadFile/download?fileName=换人换车情况日统计"
277   - + moment(startDate).format("YYYYMMDD"));
  296 + var dateTime = "";
  297 + if(startDate == endDate){
  298 + dateTime = moment(startDate).format("YYYYMMDD");
  299 + } else {
  300 + dateTime = moment(startDate).format("YYYYMMDD")
  301 + +"-"+moment(endDate).format("YYYYMMDD");
  302 + }
  303 + window.open("/downloadFile/download?fileName="
  304 + +dateTime+"-"+lineName+"-换人换车情况日统计");
  305 + layer.close(i);
278 306 });
279 307 });
280 308 });
... ...
src/main/resources/static/pages/mforms/operationservices/operationservice.html
... ... @@ -202,6 +202,7 @@
202 202 var lpName = $("#lpName").val();
203 203 var gsdmOperat = $("#gsdmOperat").val();
204 204 var fgsdmOperat = $("#fgsdmOperat").val();
  205 + var i = layer.load(2);
205 206 $get("/mcy_forms/operationservice", {
206 207 gsdmOperat : gsdmOperat,
207 208 fgsdmOperat : fgsdmOperat,
... ... @@ -230,6 +231,7 @@
230 231 });
231 232 // 把渲染好的模版html文本追加到表格中
232 233 $('#forms tbody').html(operationservice);
  234 + layer.close(i);
233 235  
234 236 });
235 237 });
... ... @@ -239,30 +241,43 @@
239 241 endDate=$("#endDate").val();
240 242 gsdmOperat=$("#gsdmOperat").val();
241 243 fgsdmOperat=$("#fgsdmOperat").val();
242   - $get('/mcy_export/operationserviceExport',{gsdmOperat:gsdmOperat,fgsdmOperat:fgsdmOperat,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
243   - window.open("/downloadFile/download?fileName=运营服务阶段报表"+moment(startDate).format("YYYYMMDD"));
  244 + var lineName = $('#line option:selected').text();
  245 + if(lineName == "全部线路")
  246 + lineName = $('#fgsdmOperat option:selected').text();
  247 + var i = layer.load(2);
  248 + $get('/mcy_export/operationserviceExport',{gsdmOperat:gsdmOperat,fgsdmOperat:fgsdmOperat,line:line,startDate:startDate,endDate:endDate,type:'export',lineName:lineName},function(result){
  249 + var dateTime = "";
  250 + if(startDate == endDate){
  251 + dateTime = moment(startDate).format("YYYYMMDD");
  252 + } else {
  253 + dateTime = moment(startDate).format("YYYYMMDD")
  254 + +"-"+moment(endDate).format("YYYYMMDD");
  255 + }
  256 + window.open("/downloadFile/download?fileName="
  257 + +dateTime+"-"+lineName+"-运营服务阶段报表");
  258 + layer.close(i);
244 259 });
245 260 });
246 261  
247 262  
248 263 });
249 264 </script>
250   -<script type="text/html" id="operationservice">
251   - {{each list as obj i}}
  265 +<script type="text/html" id="operationservice">
  266 + {{each list as obj i}}
252 267 <tr>
253   - <td>{{i+1}}</td>
  268 + <td>{{i+1}}</td>
254 269 <td>{{obj.xlName}}</td>
255 270 <td>{{obj.jzl}}</td>
256 271 <td>{{obj.xhl}}</td>
257 272 <td>{{obj.xsgl}}</td>
258 273 <td>{{obj.emptMileage}}</td>
259 274 <td>{{obj.sjbc}}</td>
260   - </tr>
  275 + </tr>
261 276 {{/each}}
262 277 {{if list.length == 0}}
263 278 <tr>
264 279 <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td>
265 280 </tr>
266   - {{/if}}
  281 + {{/if}}
267 282 </script>
268 283 </script>
269 284 \ No newline at end of file
... ...
src/main/resources/static/pages/mforms/shifdays/shifday.html
... ... @@ -218,6 +218,7 @@ $(function(){
218 218 if(date=="" || date ==null){
219 219 layer.msg('请选择日期.');
220 220 }else{
  221 + var i = layer.load(2);
221 222 $get('/mcy_forms/shifday',params,function(result){
222 223 if(type=="desc"){
223 224 type ="asc";
... ... @@ -231,6 +232,7 @@ $(function(){
231 232 var tbodyHtml = template('shifday',{list:result});
232 233 // 把渲染好的模版html文本追加到表格中
233 234 $('#forms tbody').html(tbodyHtml);
  235 + layer.close(i);
234 236 });
235 237 }
236 238 })
... ... @@ -250,6 +252,7 @@ $(function(){
250 252 if(date=="" || date ==null){
251 253 layer.msg('请选择日期.');
252 254 }else{
  255 + var i = layer.load(2);
253 256 $get('/mcy_forms/shifday',params,function(result){
254 257 if(type=="desc"){
255 258 type ="asc";
... ... @@ -263,6 +266,7 @@ $(function(){
263 266 var tbodyHtml = template('shifday',{list:result});
264 267 // 把渲染好的模版html文本追加到表格中
265 268 $('#forms tbody').html(tbodyHtml);
  269 + layer.close(i);
266 270 });
267 271 }
268 272 })
... ... @@ -282,6 +286,7 @@ $(function(){
282 286 if(date=="" || date ==null){
283 287 layer.msg('请选择日期.');
284 288 }else{
  289 + var i = layer.load(2);
285 290 $get('/mcy_forms/shifday',params,function(result){
286 291 type ='asc';
287 292 $.each(result, function(i, obj) {
... ... @@ -291,6 +296,7 @@ $(function(){
291 296 var tbodyHtml = template('shifday',{list:result});
292 297 // 把渲染好的模版html文本追加到表格中
293 298 $('#forms tbody').html(tbodyHtml);
  299 + layer.close(i);
294 300 });
295 301 }
296 302 });
... ... @@ -299,15 +305,19 @@ $(function(){
299 305 var line = $("#line").val();
300 306 var date = $("#date").val();
301 307 var gsdmShif = $("#gsdmShif").val();
302   - var fgsdmShif = $("#fgsdmShif").val();
  308 + var fgsdmShif = $("#fgsdmShif").val();
  309 + var lineName = $('#line option:selected').text();
303 310 var params = {};
304 311 params.fgsdmShif =fgsdmShif;
305 312 params.date =date;
306 313 params.gsdmShif =gsdmShif;
307 314 params.line =line;
308 315 params.type='export';
  316 + params.lineName =lineName;
309 317 $get('/mcy_export/shifdayExport',params,function(result){
310   - window.open("/downloadFile/download?fileName=班次车辆人员日报表"+moment(date).format("YYYYMMDD"));
  318 + window.open("/downloadFile/download?fileName="
  319 + +moment(date).format("YYYYMMDD")+
  320 + "-"+lineName+"-班次车辆人员日报表");
311 321 });
312 322 });
313 323 });
... ...
src/main/resources/static/pages/mforms/shiftuehiclemanths/shiftuehiclemanth.html
... ... @@ -99,11 +99,8 @@
99 99 if (!$('body').hasClass('page-sidebar-closed'))
100 100 $('.menu-toggler.sidebar-toggler').click();
101 101  
102   - $("#startDate,#endDate").datetimepicker({
103   - format : 'YYYY-MM-DD',
104   - locale : 'zh-cn'
105   - });
106 102 var d = new Date();
  103 + d.setTime(d.getTime() - 1*1000*60*60*24);
107 104 var year = d.getFullYear();
108 105 var month = d.getMonth() + 1;
109 106 var day = d.getDate();
... ... @@ -111,6 +108,12 @@
111 108 month = "0" + month;
112 109 if(day < 10)
113 110 day = "0" + day;
  111 + var dateTime = year + "-" + month + "-" + day;
  112 + $("#startDate,#endDate").datetimepicker({
  113 + format : 'YYYY-MM-DD',
  114 + locale : 'zh-cn',
  115 + maxDate : dateTime
  116 + });
114 117 $("#startDate,#endDate").val(year + "-" + month + "-" + day);
115 118  
116 119 var fage=false;
... ... @@ -207,6 +210,7 @@
207 210 params.lpName = $("#lpName").val();
208 211 params.gsdmManth= $("#gsdmManth").val();
209 212 params.fgsdmManth= $("#fgsdmManth").val();
  213 + var i = layer.load(2);
210 214 $get("/mcy_forms/shiftuehiclemanth",params,function(result){
211 215 $("#sDate").text(startDate);
212 216 $("#eDate").text(endDate);
... ... @@ -223,11 +227,15 @@
223 227 var list_shiftuehiclemanth = template('list_shiftuehiclemanth',{list:result});
224 228 // 把渲染好的模版html文本追加到表格中
225 229 $('#forms tbody').html(list_shiftuehiclemanth);
  230 + layer.close(i);
226 231  
227 232 });
228 233 });
229 234  
230 235 $("#export").on("click",function(){
  236 + var lineName = $('#line option:selected').text();
  237 + var startDate = $("#startDate").val();
  238 + var endDate = $("#endDate").val();
231 239 var params={};
232 240 params.empnames=$("#empnames").val();
233 241 params.line = $("#line").val();
... ... @@ -236,9 +244,20 @@
236 244 params.lpName = $("#lpName").val();
237 245 params.gsdmManth= $("#gsdmManth").val();
238 246 params.fgsdmManth= $("#fgsdmManth").val();
  247 + params.lineName = lineName;
239 248 params.type='export';
  249 + var i = layer.load(2);
240 250 $get('/mcy_export/shiftuehiclemanthExport',params,function(result){
241   - window.open("/downloadFile/download?fileName=班次车辆人员月报表"+moment($("#startDate").val()).format("YYYYMMDD"));
  251 + var dateTime = "";
  252 + if(startDate == endDate){
  253 + dateTime = moment(startDate).format("YYYYMMDD");
  254 + } else {
  255 + dateTime = moment(startDate).format("YYYYMMDD")
  256 + +"-"+moment(endDate).format("YYYYMMDD");
  257 + }
  258 + window.open("/downloadFile/download?fileName="
  259 + +dateTime+"-"+lineName+"-班次车辆人员月报表");
  260 + layer.close(i);
242 261 });
243 262 });
244 263  
... ...
src/main/resources/static/pages/mforms/singledatas/singledata.html
... ... @@ -226,9 +226,16 @@
226 226 var gsdmSing = $("#gsdmSing").val();
227 227 var fgsdmSing = $("#fgsdmSing").val();
228 228 var tjtype=$("#tjtype").val();
  229 + var lineName = $('#line option:selected').text();
  230 + if(lineName == "全部线路")
  231 + lineName = $('#fgsdmSing option:selected').text();
  232 + var i = layer.load(2);
229 233 // if(tjtype=='jsy'){
230   - $get('/mcy_export/singledataExportTj',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,type:'export'},function(result){
231   - window.open("/downloadFile/download?fileName=路单数据"+moment(startDate).format("YYYYMMDD"));
  234 + $get('/mcy_export/singledataExportTj',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,type:'export',lineName:lineName},function(result){
  235 + window.open("/downloadFile/download?fileName="
  236 + +moment(startDate).format("YYYYMMDD")
  237 + +"-"+lineName+"-路单数据");
  238 + layer.close(i);
232 239 });
233 240 // }else{
234 241 // $get('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,type:'export'},function(result){
... ...
src/main/resources/static/pages/mforms/turnoutrates/turnoutrate.html
... ... @@ -119,12 +119,9 @@
119 119 if (!$('body').hasClass('page-sidebar-closed'))
120 120 $('.menu-toggler.sidebar-toggler').click();
121 121  
122   - $("#startDate,#endDate").datetimepicker({
123   - format : 'YYYY-MM-DD',
124   - locale : 'zh-cn'
125   - });
126 122  
127 123 var d = new Date();
  124 + d.setTime(d.getTime() - 1*1000*60*60*24);
128 125 var year = d.getFullYear();
129 126 var month = d.getMonth() + 1;
130 127 var day = d.getDate();
... ... @@ -132,8 +129,14 @@
132 129 month = "0" + month;
133 130 if(day < 10)
134 131 day = "0" + day;
135   - $("#startDate").val(year + "-" + month + "-" + day);
136   - $("#endDate").val(year + "-" + month + "-" + day);
  132 + var dateTime = year + "-" + month + "-" + day;
  133 + $("#startDate,#endDate").datetimepicker({
  134 + format : 'YYYY-MM-DD',
  135 + locale : 'zh-cn',
  136 + maxDate : dateTime
  137 + });
  138 + $("#startDate").val(dateTime);
  139 + $("#endDate").val(dateTime);
137 140  
138 141 var fage=false;
139 142 var xlList;
... ... @@ -224,6 +227,7 @@
224 227 gsdmTurn=$("#gsdmTurn").val();
225 228 fgsdmTurn=$("#fgsdmTurn").val();
226 229 if(startDate!=''&&endDate!=''){
  230 + var i = layer.load(2);
227 231 $post('/mcy_forms/turnoutrate',
228 232 { gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn, line:line,startDate:startDate,endDate:endDate,type:'query'},function(result){
229 233 // var result=[];
... ... @@ -231,6 +235,8 @@
231 235 var tbodyHtml = template('turnoutrate',{list:result});
232 236 // 把渲染好的模版html文本追加到表格中
233 237 $('#tbody').html(tbodyHtml);
  238 + layer.close(i);
  239 +
234 240 line = $("#line").val();
235 241 startDate = $("#startDate").val();
236 242 endDate = $("#endDate").val();
... ... @@ -291,8 +297,21 @@
291 297 endDate=$("#endDate").val();
292 298 gsdmTurn=$("#gsdmTurn").val();
293 299 fgsdmTurn=$("#fgsdmTurn").val();
294   - $post('/mcy_export/turnoutrateExport',{gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn,line:line,startDate:startDate,endDate:endDate,type:'export'},function(result){
295   - window.open("/downloadFile/download?fileName=营运线路出车率统计表"+moment(startDate).format("YYYYMMDD"));
  300 + var lineName = $('#line option:selected').text();
  301 + if(lineName == "全部线路")
  302 + lineName = $('#fgsdmTurn option:selected').text();
  303 + var i = layer.load(2);
  304 + $post('/mcy_export/turnoutrateExport',{gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn,line:line,startDate:startDate,endDate:endDate,type:'export',lineName:lineName},function(result){
  305 + var dateTime = "";
  306 + if(startDate == endDate){
  307 + dateTime = moment(startDate).format("YYYYMMDD");
  308 + } else {
  309 + dateTime = moment(startDate).format("YYYYMMDD")
  310 + +"-"+moment(endDate).format("YYYYMMDD");
  311 + }
  312 + window.open("/downloadFile/download?fileName="
  313 + +dateTime+"-"+lineName+"-营运线路出车率统计表");
  314 + layer.close(i);
296 315 });
297 316 });
298 317 });
... ...
src/main/resources/static/pages/mforms/vehicleloadings/vehicleloading.html
... ... @@ -178,11 +178,13 @@
178 178 date = $("#date").val();
179 179 // gsdmVehic = $("#gsdmVehic").val();
180 180 // fgsdmVehic = $("#fgsdmVehic").val();
  181 + var i = layer.load(2);
181 182 $get('/mcy_forms/vehicleloading',{line:line,data:date},function(result){
182 183 // 把数据填充到模版中
183 184 var tbodyHtml = template('vehicleloading',{list:result});
184 185 // 把渲染好的模版html文本追加到表格中
185 186 $('#forms tbody').html(tbodyHtml);
  187 + layer.close(i);
186 188 });
187 189 });
188 190  
... ... @@ -191,8 +193,13 @@
191 193 date = $("#date").val();
192 194 gsdmVehic = $("#gsdmVehic").val();
193 195 fgsdmVehic = $("#fgsdmVehic").val();
194   - $get('/mcy_export/vehicleloadingExport',{line:line,data:date,gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic,type:'export'},function(result){
195   - window.open("/downloadFile/download?fileName=车辆加注"+moment(date).format("YYYYMMDD"));
  196 + var lineName = $('#line option:selected').text();
  197 + var i = layer.load(2);
  198 + $get('/mcy_export/vehicleloadingExport',{line:line,data:date,gsdmVehic: gsdmVehic,fgsdmVehic:fgsdmVehic,type:'export',lineName:lineName},function(result){
  199 + window.open("/downloadFile/download?fileName="
  200 + +moment(date).format("YYYYMMDD")
  201 + +"-"+lineName+"-车辆加注");
  202 + layer.close(i);
196 203 });
197 204 });
198 205 });
... ...
src/main/resources/static/pages/mforms/waybilldays/waybillday.html
... ... @@ -183,6 +183,7 @@
183 183 if(date=="" || date ==null){
184 184 layer.msg('请选择日期.');
185 185 }else{
  186 + var i = layer.load(2);
186 187 $post('/mcy_forms/waybillday',{line:line,date:date,type:'query'},function(result){
187 188 $.each(result, function(i, obj) {
188 189 obj.requestType = reqCodeMap[obj.requestType];
... ... @@ -191,6 +192,7 @@
191 192 var tbodyHtml = template('waybillday',{list:result});
192 193 // 把渲染好的模版html文本追加到表格中
193 194 $('#forms tbody').html(tbodyHtml);
  195 + layer.close(i);
194 196 });
195 197 }
196 198 });
... ... @@ -198,10 +200,13 @@
198 200 $("#export").on("click",function(){
199 201 line = $("#line").val();
200 202 date = $("#date").val();
  203 + lineName = $('#line option:selected').text();
201 204 gsdmWaybillday=$("#gsdmWaybillday").val();
202 205 fgsdmWaybillday = $("#fgsdmWaybillday").val();
203   - $post('/mcy_export/waybilldayExport',{gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday,line:line,date:date,type:'export'},function(result){
204   - window.open("/downloadFile/download?fileName=行车路单日报表");
  206 + $post('/mcy_export/waybilldayExport',{gsdmWaybillday:gsdmWaybillday,fgsdmWaybillday:fgsdmWaybillday,line:line,date:date,lineName:lineName,type:'export'},function(result){
  207 + window.open("/downloadFile/download?fileName="
  208 + +moment(date).format("YYYYMMDD")
  209 + +"-"+lineName+"-行车路单日报表");
205 210 });
206 211 });
207 212 });
... ...
src/main/resources/static/pages/permission/user/edit.html
... ... @@ -157,7 +157,6 @@
157 157 },
158 158  
159 159 submitHandler : function(f) {
160   - debugger
161 160 var params = form.serializeJSON();
162 161 error.hide();
163 162 console.log(params);
... ...
src/main/resources/static/pages/permission/user/list.html
... ... @@ -55,8 +55,8 @@
55 55 <td>
56 56 <select class="form-control form-filter " name="enabled_eq">
57 57 <option value="">请选择...</option>
58   - <option value="1">可用</option>
59   - <option value="0">禁用</option>
  58 + <option value="true">可用</option>
  59 + <option value="false">禁用</option>
60 60 </select>
61 61 </td>
62 62 <td></td>
... ...
src/main/resources/static/pages/punctual/list.html
... ... @@ -75,21 +75,14 @@
75 75 });
76 76 });
77 77 $("#exportList").on('click',function(){
78   -// $("#forms_2").table2excel({
79   -// // 不被导出的表格行的CSS class类
80   -// exclude: ".noExl",
81   -// // 导出的Excel文档的名称,(没看到作用)
82   -// name: "Excel Document Name.xlsx",
83   -// // Excel文件的名称
84   -// filename: "发车到站准点率"
85   -// });
86 78 var date = no.split("_")[0];
87 79 var endDate = date;
88 80 var line = no.split("_")[1];
89 81 var fgs=$('#fgsdm').val();
90 82 var gs=$('#gsdm').val();
91   - $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs,flag:2,type:"export"},function(result){
92   - window.open("/downloadFile/download?fileName=发车到站准点率详细"+moment(date).format("YYYYMMDD"));
  83 + $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs,flag:2,type:"export",lineName:no.split("_")[2]},function(result){
  84 + window.open("/downloadFile/download?fileName="
  85 + +moment(date).format("YYYYMMDD")+"-"+no.split("_")[2]+"-发车到站准点率详细");
93 86 });
94 87  
95 88 });
... ...
src/main/resources/static/pages/punctual/onTime.html
... ... @@ -262,6 +262,9 @@
262 262 var endDate = $("#endDate").val();
263 263 var fgs=$('#fgsdm').val();
264 264 var gs=$('#gsdm').val();
  265 + var lineName = $('#line option:selected').text();
  266 + if(lineName == "全部线路")
  267 + lineName = $('#subCompany option:selected').text();
265 268 var i = layer.load(2);
266 269 $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs},function(result){
267 270 var onTime = template('onTime',{list:result});
... ... @@ -277,9 +280,12 @@
277 280 $("#export").removeAttr("disabled");
278 281 });
279 282 });
  283 +
280 284 var line1;
  285 + var lineName1;
281 286 function showSheetList(){
282 287 line1 = $(this).data('id');
  288 + lineName1 = $(this).parent().parent().children()[2].innerHTML;
283 289 var date = $("#date").val();
284 290 var endDate = $("#endDate").val();
285 291 var fgs=$('#fgsdm').val();
... ... @@ -320,44 +326,45 @@
320 326 });
321 327 }
322 328 $("#export").on("click",function(){
323   -// $("#forms_h").table2excel({
324   -// // 不被导出的表格行的CSS class类
325   -// exclude: ".noExl",
326   -// // 导出的Excel文档的名称,(没看到作用)
327   -// name: "Excel Document Name.xlsx",
328   -// // Excel文件的名称
329   -// filename: date+"-"+endDate+"发车到站准点率"
330   -// });
331 329 var line = $("#line").val();
332 330 var date = $("#date").val();
333 331 var endDate = $("#endDate").val();
334 332 var fgs=$('#fgsdm').val();
335 333 var gs=$('#gsdm').val();
  334 + var lineName = $('#line option:selected').text();
  335 + if(lineName == "全部线路")
  336 + lineName = $('#fgsdm option:selected').text();
336 337 var i = layer.load(2);
337   - $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs,type:"export"},function(result){
338   - window.open("/downloadFile/download?fileName=发车到站准点率"+moment(date).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  338 + $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs,type:"export",lineName:lineName},function(result){
  339 + var dateTime = "";
  340 + if(date == endDate){
  341 + dateTime = moment(date).format("YYYYMMDD");
  342 + } else {
  343 + dateTime = moment(date).format("YYYYMMDD")+"-"+
  344 + moment(endDate).format("YYYYMMDD");
  345 + }
  346 + window.open("/downloadFile/download?fileName="
  347 + +dateTime+"-"+lineName+"-发车到站准点率");
339 348 layer.close(i);
340 349 });
341 350 })
342 351  
343 352 $("#export_1").on("click",function(){
344   -// var date = $("#date").val();
345   -// var endDate = $("#endDate").val();
346   -// $("#forms_1_h").table2excel({
347   -// // 不被导出的表格行的CSS class类
348   -// exclude: ".noExl",
349   -// // 导出的Excel文档的名称,(没看到作用)
350   -// name: "Excel Document Name.xlsx",
351   -// // Excel文件的名称
352   -// filename: date+"-"+endDate+"发车到站准点率"
353   -// });
354 353 var date = $("#date").val();
355 354 var endDate = $("#endDate").val();
356 355 var fgs=$('#fgsdm').val();
357 356 var gs=$('#gsdm').val();
358 357 var i = layer.load(2);
359   - $get('/busInterval/onTime',{line:line1,startDate:date,endDate:endDate,gs:gs,fgs:fgs,flag:1,type:"export"},function(result){
360   - window.open("/downloadFile/download?fileName=发车到站准点率明细");
  358 + $get('/busInterval/onTime',{line:line1,startDate:date,endDate:endDate,gs:gs,fgs:fgs,flag:1,type:"export",lineName:lineName1},function(result){
  359 + var dateTime = "";
  360 + if(date == endDate){
  361 + dateTime = moment(date).format("YYYYMMDD");
  362 + } else {
  363 + dateTime = moment(date).format("YYYYMMDD")+"-"+
  364 + moment(endDate).format("YYYYMMDD");
  365 + }
  366 + window.open("/downloadFile/download?fileName="
  367 + +dateTime+"-"+lineName1+"-发车到站准点率明细");
361 368 layer.close(i);
362 369 });
363 370 });
... ...
src/main/resources/static/pages/report/countMileage/countBus/company/countBusMileage.html
... ... @@ -208,12 +208,14 @@
208 208 return;
209 209 }
210 210 line = $("#line").val();
211   - xlName = $("#select2-line-container").html();
212 211 date = $("#date").val();
213 212 date2 =$("#date2").val();
214 213 gsdm =$("#gsdm").val();
215 214 fgsdm=$("#fgsdm").val();
216 215 zt=$("#zt").val();
  216 + xlName = $("#select2-line-container").html();
  217 + if(xlName == "全部线路")
  218 + xlName = $('#fgsdm option:selected').text();
217 219 if(line=="请选择"){
218 220 line="";
219 221 }
... ... @@ -250,7 +252,7 @@
250 252 $("#export").on("click",function(){
251 253 var params = {};
252 254 params['gsdm'] = gsdm;
253   - params['fgsdm'] =fgsdm ;
  255 + params['fgsdm'] =fgsdm;
254 256 params['line'] = line;
255 257 params['date'] = date;
256 258 params['date2'] = date2;
... ... @@ -259,7 +261,15 @@
259 261 params['type'] = "export";
260 262 params['by']='gs';
261 263 $get('/report/countBusMileage',params,function(result){
262   - window.open("/downloadFile/download?fileName=路单数据统计表");
  264 + var dateTime = "";
  265 + if(date == date2){
  266 + dateTime = moment(date).format("YYYYMMDD");
  267 + } else {
  268 + dateTime = moment(date).format("YYYYMMDD")
  269 + +"-"+moment(date2).format("YYYYMMDD");
  270 + }
  271 + window.open("/downloadFile/download?fileName="
  272 + +dateTime+"-"+xlName+"-路单数据统计表");
263 273 });
264 274 });
265 275  
... ...
src/main/resources/static/pages/report/countMileage/countBus/countBusMileage.html
... ... @@ -208,12 +208,14 @@
208 208 return;
209 209 }
210 210 line = $("#line").val();
211   - xlName = $("#select2-line-container").html();
212 211 date = $("#date").val();
213 212 date2 =$("#date2").val();
214 213 gsdm =$("#gsdm").val();
215 214 fgsdm=$("#fgsdm").val();
216 215 zt=$("#zt").val();
  216 + xlName = $("#select2-line-container").html();
  217 + if(xlName == "全部线路")
  218 + xlName = $('#fgsdm option:selected').text();
217 219 if(line=="请选择"){
218 220 line="";
219 221 }
... ... @@ -222,7 +224,7 @@
222 224 }else{
223 225 var params = {};
224 226 params['gsdm'] = gsdm;
225   - params['fgsdm'] =fgsdm ;
  227 + params['fgsdm'] =fgsdm;
226 228 params['line'] = line;
227 229 params['date'] = date;
228 230 params['date2'] = date2;
... ... @@ -250,7 +252,7 @@
250 252 $("#export").on("click",function(){
251 253 var params = {};
252 254 params['gsdm'] = gsdm;
253   - params['fgsdm'] =fgsdm ;
  255 + params['fgsdm'] =fgsdm;
254 256 params['line'] = line;
255 257 params['date'] = date;
256 258 params['date2'] = date2;
... ... @@ -258,8 +260,18 @@
258 260 params['zt']=zt;
259 261 params['type'] = "export";
260 262 params['by']='sj';
  263 + var i = layer.load(2);
261 264 $get('/report/countBusMileage',params,function(result){
262   - window.open("/downloadFile/download?fileName=路单数据统计表");
  265 + var dateTime = "";
  266 + if(date == date2){
  267 + dateTime = moment(date).format("YYYYMMDD");
  268 + } else {
  269 + dateTime = moment(date).format("YYYYMMDD")
  270 + +"-"+moment(date2).format("YYYYMMDD");
  271 + }
  272 + window.open("/downloadFile/download?fileName="
  273 + +dateTime+"-"+xlName+"-路单数据统计表");
  274 + layer.close(i);
263 275 });
264 276 });
265 277  
... ...
src/main/resources/static/pages/report/countMileage/countLine/company/countLineMileage.html
... ... @@ -244,11 +244,13 @@
244 244 return;
245 245 }
246 246 line = $("#line").val();
247   - xlName = $("#select2-line-container").html();
248 247 date = $("#date").val();
249 248 date2 =$("#date2").val();
250 249 gsdm =$("#gsdm").val();
251 250 fgsdm=$("#fgsdm").val();
  251 + xlName = $("#select2-line-container").html();
  252 + if(xlName == "全部线路")
  253 + xlName = $('#fgsdm option:selected').text();
252 254 if(line=="请选择"){
253 255 line="";
254 256 }
... ... @@ -257,7 +259,7 @@
257 259 }else{
258 260 var params = {};
259 261 params['gsdm'] = gsdm;
260   - params['fgsdm'] =fgsdm ;
  262 + params['fgsdm'] =fgsdm;
261 263 params['line'] = line;
262 264 params['date'] = date;
263 265 params['date2'] = date2;
... ... @@ -291,8 +293,18 @@
291 293 params['xlName'] = xlName;
292 294 params['type'] = "export";
293 295 params['by']='gs';
  296 + var i = layer.load(2);
294 297 $get('/report/countLineMileage',params,function(result){
295   - window.open("/downloadFile/download?fileName=线路公里统计表");
  298 + var dateTime = "";
  299 + if(date == date2){
  300 + dateTime = moment(date).format("YYYYMMDD");
  301 + } else {
  302 + dateTime = moment(date).format("YYYYMMDD")
  303 + +"-"+moment(date2).format("YYYYMMDD");
  304 + }
  305 + window.open("/downloadFile/download?fileName="
  306 + +dateTime+"-"+xlName+"-线路公里统计表");
  307 + layer.close(i);
296 308 });
297 309 });
298 310 });
... ...
src/main/resources/static/pages/report/countMileage/countLine/countLineMileage.html
... ... @@ -243,11 +243,13 @@
243 243 return;
244 244 }
245 245 line = $("#line").val();
246   - xlName = $("#select2-line-container").html();
247 246 date = $("#date").val();
248 247 date2 =$("#date2").val();
249 248 gsdm =$("#gsdm").val();
250 249 fgsdm=$("#fgsdm").val();
  250 + xlName = $("#select2-line-container").html();
  251 + if(xlName == "全部线路")
  252 + xlName = $('#fgsdm option:selected').text();
251 253 if(line=="请选择"){
252 254 line="";
253 255 }
... ... @@ -264,8 +266,8 @@
264 266 params['type'] = "query";
265 267 var i = layer.load(2);
266 268 $get('/report/countLineMileage',params,function(result){
267   - $("#datetodate").html(date+"至"+date2);
268 269 layer.close(i);
  270 + $("#datetodate").html(date+"至"+date2);
269 271 // 把数据填充到模版中
270 272 var tbodyHtml = template('countLineListSj',{list:result});
271 273 // 把渲染好的模版html文本追加到表格中
... ... @@ -290,8 +292,18 @@
290 292 params['xlName'] = xlName;
291 293 params['type'] = "export";
292 294 params['by']='sj';
  295 + var i = layer.load(2);
293 296 $get('/report/countLineMileage',params,function(result){
294   - window.open("/downloadFile/download?fileName=线路公里统计表");
  297 + var dateTime = "";
  298 + if(date == date2){
  299 + dateTime = moment(date).format("YYYYMMDD");
  300 + } else {
  301 + dateTime = moment(date).format("YYYYMMDD")
  302 + +"-"+moment(date2).format("YYYYMMDD");
  303 + }
  304 + window.open("/downloadFile/download?fileName="
  305 + +dateTime+"-"+xlName+"-线路公里统计表");
  306 + layer.close(i);
295 307 });
296 308 });
297 309 });
... ...
src/main/resources/static/pages/report/inoutstation.html
... ... @@ -479,11 +479,14 @@
479 479 var nbbm=$("#nbbm").val();
480 480 var fcsj=$("#fcsj_xx").val();
481 481 var ddsj=$("#ddsj_xx").val();
  482 + var pzh=$('#nbbm option:selected').text();
482 483 if(fcsj==""){
483 484 layer.msg("没数据");
484 485 }else{
485 486 $get('/report/exportQueryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){
486   - window.open("/downloadFile/download?fileName=班次到离站");
  487 + window.open("/downloadFile/download?fileName="
  488 + +moment(rq).format("YYYYMMDD")
  489 + +"-"+pzh+"-班次到离站");
487 490 });
488 491 }
489 492  
... ... @@ -495,6 +498,7 @@
495 498 var line=$("#line").val();
496 499 var zdlx=$("#zdlx").val();
497 500 var zd=$("#zd").val();
  501 + var lineName = $('#line option:selected').text();
498 502 if(date1=="" || date1==null){
499 503 layer.msg("请选择时间");
500 504 }else if( line=="" || line==null){
... ... @@ -505,7 +509,16 @@
505 509 layer.msg("请选择方向");
506 510 }else{
507 511 $get('/report/exportQueryListClzd',{zd:zd,zdlx:zdlx,line:line,fcsj:date1,ddsj:date2},function(result){
508   - window.open("/downloadFile/download?fileName=班次到离站");
  512 + var startDate = moment(date1).format("YYYYMMDD");
  513 + var endDate = moment(date2).format("YYYYMMDD");
  514 + var dateTime = "";
  515 + if(startDate == endDate){
  516 + dateTime = startDate;
  517 + } else {
  518 + dateTime = startDate + "-" + endDate;
  519 + }
  520 + window.open("/downloadFile/download?fileName="
  521 + +dateTime+"-"+lineName+"-班次到离站");
509 522 });
510 523 }
511 524 });
... ...
src/main/resources/static/pages/report/message/message.html
... ... @@ -179,7 +179,8 @@
179 179 });
180 180  
181 181 var date = '';
182   - var line = $("#line").val();
  182 + var line = $("#line").val();
  183 + var lineName = $('#line option:selected').text();
183 184 $("#query").on("click",function(){
184 185 if($("#date").val() == null || $("#date").val().trim().length == 0){
185 186 layer.msg("请选择时间!");
... ... @@ -216,6 +217,7 @@
216 217 jName = params[1];
217 218 line = $("#line").val();
218 219 date = $("#date").val();
  220 + lineName = $('#line option:selected').text();
219 221 var obj = $(this);
220 222 $get('/report/historyMessageList',{line:line,date:date,code:jName,type:"query"},function(result){
221 223 var list_history_msg = template('list_history_msg',{list:result});
... ... @@ -238,7 +240,8 @@
238 240  
239 241 $("#export").on("click",function(){
240 242 $get('/report/historyMessageList',{line:line,date:date,code:jName,type:"export_msg"},function(result){
241   - window.open("/downloadFile/download?fileName=调度消息分析"+moment(date).format("YYYYMMDD"));
  243 + window.open("/downloadFile/download?fileName="
  244 + +moment(date).format("YYYYMMDD")+"-"+lineName+"-调度消息分析");
242 245 });
243 246 });
244 247  
... ...
src/main/resources/static/pages/report/oil/oilListMonth.html
... ... @@ -214,9 +214,11 @@
214 214 var date = $("#date").val();
215 215 var gsdm = $("#gsdm").val();
216 216 var fgsdm = $("#fgsdm").val();
  217 + var i = layer.load(2);
217 218 $get('/ylb/oilListMonth',{line:line,date:date,gsdm:gsdm,fgsdm,fgsdm,type:'query'},function(result){
218 219 var oilListMonth = template('oilListMonth',{list:result});
219 220 $('#forms tbody').html(oilListMonth);
  221 + layer.close(i);
220 222 });
221 223 });
222 224  
... ... @@ -230,8 +232,13 @@
230 232 var date = $("#date").val();
231 233 var gsdm = $("#gsdm").val();
232 234 var fgsdm = $("#fgsdm").val();
233   - $get('/ylb/oilListMonth', {line:line,date:date,gsdm:gsdm,fgsdm,fgsdm,type:'export'}, function(result){
234   - window.open("/downloadFile/download?fileName=月存油报表"+moment(date).format("YYYYMMDD"));
  235 + var lineName = $('#line option:selected').text();
  236 + if(lineName == "全部线路")
  237 + lineName = $('#fgsdm option:selected').text();
  238 + $get('/ylb/oilListMonth', {line:line,date:date,gsdm:gsdm,fgsdm,fgsdm,type:'export',lineName:lineName}, function(result){
  239 + window.open("/downloadFile/download?fileName="
  240 + +moment(date).format("YYYYMMDD")
  241 + +"-"+lineName+"-月存油报表");
235 242 });
236 243 });
237 244 });
... ...
src/main/resources/static/pages/report/sheet/sheetList.html
... ... @@ -312,9 +312,20 @@
312 312 var endDate = $("#endDate").val();
313 313 var fgs=$('#fgsdm').val();
314 314 var gs=$('#gsdm').val();
  315 + var lineName = $('#line option:selected').text();
  316 + if(lineName == "全部线路")
  317 + lineName = $('#fgsdm option:selected').text();
315 318 var i = layer.load(2);
316   - $get('/sheet/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,type:"export"},function(result){
317   - window.open("/downloadFile/download?fileName=发车准点率"+moment(date).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  319 + $get('/sheet/countList',{line:line,date:date,endDate:endDate,gs:gs,fgs:fgs,type:"export",lineName:lineName},function(result){
  320 + var dateTime = "";
  321 + if(date == endDate){
  322 + dateTime = moment(date).format("YYYYMMDD");
  323 + } else {
  324 + dateTime = moment(date).format("YYYYMMDD")+"-"+
  325 + moment(endDate).format("YYYYMMDD");
  326 + }
  327 + window.open("/downloadFile/download?fileName="
  328 + +dateTime+"-"+lineName+"-发车准点率");
318 329 layer.close(i);
319 330 });
320 331 // $("#forms_h").table2excel({
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
... ... @@ -502,12 +502,10 @@
502 502 },
503 503 items: {
504 504 "edit_sub_task":{
505   - name: '修改子任务',
506   - icon: 'edit'
  505 + name: '修改子任务'
507 506 },
508 507 "remove_sub_task": {
509 508 name: "删除子任务"
510   - , icon: "delete"
511 509 }
512 510 }
513 511 });
... ...
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/temp_sch/main.html
... ... @@ -247,6 +247,8 @@
247 247 var stp;
248 248 var qdSelect=$f('qdzCode', f)[0],zdSelect=$f('zdzCode', f)[0];
249 249  
  250 + if(qdSelect.options.selectedIndex < 0)
  251 + return;
250 252 var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text,
251 253 zdzName=zdSelect.options[zdSelect.options.selectedIndex].text,
252 254 type2 = $f('bcType', f).val();
... ...
src/main/resources/static/real_control_v2/fragments/north/nav/line_config/line_config_entity.html
... ... @@ -317,12 +317,12 @@
317 317 * 渲染场既是站dom
318 318 */
319 319 function renderPSDom() {
320   - $('.c_2_s_list', $panel).html('');
321 320 var pArray = conf.twinsParks.split(','),
322 321 cArray = conf.twinsStations.split(',');
323 322 var htmlStr = '',
324 323 $panel = $('.park-and-station-wrap', wrap);
325 324  
  325 + $('.c_2_s_list', $panel).html('');
326 326 if(conf['outConfig']!=2){
327 327 $panel.hide().find('.c_2_s_list').empty();
328 328 return;
... ...
src/main/resources/static/real_control_v2/js/line_schedule/sch_table.js
... ... @@ -836,7 +836,7 @@ var gb_schedule_table = (function () {
836 836 if(wrap.length==0)
837 837 continue;
838 838  
839   - $('.schedule-wrap span.warn_multi_station', wrap)
  839 + $(".schedule-wrap span.warn_multi_station[data-updown="+(k.split('_')[1])+"]", wrap)
840 840 .html('班次站点编码与实际不符!!!').show();
841 841 }
842 842  
... ...
src/main/resources/static/real_control_v2/mapmonitor/real.html
... ... @@ -14,7 +14,7 @@
14 14  
15 15 <div id="real_map_container"></div>
16 16 <div class="real_right_gps_panel">
17   - <form class="uk-form" >
  17 + <form class="uk-form" onsubmit="return false;">
18 18 <div class="uk-autocomplete uk-form ral-gps-autocom" style="width: 100%;">
19 19 <div class="uk-form-icon">
20 20 <i class="uk-icon-search"></i>
... ...