Commit 1008b078bd2dda862825a9a62bfc5cc34aef88d8
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,6 +39,9 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer> | ||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | Map<String, Object> m = new HashMap<String, Object>(); | 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 | try { | 45 | try { |
| 43 | 46 | ||
| 44 | m = calcWaybillService.generateNew(date, line); | 47 | m = calcWaybillService.generateNew(date, line); |
| @@ -53,7 +56,6 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer> | @@ -53,7 +56,6 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer> | ||
| 53 | m.put("status", ResponseCode.ERROR); | 56 | m.put("status", ResponseCode.ERROR); |
| 54 | return m; | 57 | return m; |
| 55 | } | 58 | } |
| 56 | - | ||
| 57 | return m; | 59 | return m; |
| 58 | } | 60 | } |
| 59 | 61 | ||
| @@ -101,6 +103,8 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer> | @@ -101,6 +103,8 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer> | ||
| 101 | } | 103 | } |
| 102 | 104 | ||
| 103 | Map<String, Object> m = new HashMap<String, Object>(); | 105 | Map<String, Object> m = new HashMap<String, Object>(); |
| 106 | + m.put("date", date); | ||
| 107 | + m.put("line", line); | ||
| 104 | try { | 108 | try { |
| 105 | 109 | ||
| 106 | m.put("status", calcWaybillService.calcDaily(date, line)); | 110 | m.put("status", calcWaybillService.calcDaily(date, line)); |
| @@ -147,4 +151,130 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer> | @@ -147,4 +151,130 @@ public class CalcWaybillController extends BaseController<CalcWaybill, Integer> | ||
| 147 | return calcWaybillService.calcStatisticsDaily(gsdm,fgsdm,line,date,date2,xlName,type); | 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,7 +46,8 @@ public class ExportController { | ||
| 46 | @RequestMapping(value = "/waybilldayExport", method = RequestMethod.POST) | 46 | @RequestMapping(value = "/waybilldayExport", method = RequestMethod.POST) |
| 47 | public List<Waybillday> waybilldayExport(@RequestParam Map<String, Object> map) { | 47 | public List<Waybillday> waybilldayExport(@RequestParam Map<String, Object> map) { |
| 48 | List<Waybillday> waybillday = formsService.waybillday(map); | 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 | return waybillday; | 51 | return waybillday; |
| 51 | } | 52 | } |
| 52 | 53 | ||
| @@ -85,7 +86,8 @@ public class ExportController { | @@ -85,7 +86,8 @@ public class ExportController { | ||
| 85 | // 班次车辆人员日统计 | 86 | // 班次车辆人员日统计 |
| 86 | @RequestMapping(value = "/shifdayExport", method = RequestMethod.GET) | 87 | @RequestMapping(value = "/shifdayExport", method = RequestMethod.GET) |
| 87 | public List<Map<String, Object>> shifdayExport(@RequestParam Map<String, Object> map) { | 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 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 91 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 90 | Map<String, Object> map2 = new HashMap<String, Object>(); | 92 | Map<String, Object> map2 = new HashMap<String, Object>(); |
| 91 | ReportUtils ee = new ReportUtils(); | 93 | ReportUtils ee = new ReportUtils(); |
| @@ -117,10 +119,14 @@ public class ExportController { | @@ -117,10 +119,14 @@ public class ExportController { | ||
| 117 | } | 119 | } |
| 118 | 120 | ||
| 119 | try { | 121 | try { |
| 122 | + String lineName = ""; | ||
| 123 | + if(map.containsKey("lineName")) | ||
| 124 | + lineName = map.get("lineName").toString(); | ||
| 120 | listI.add(resList.iterator()); | 125 | listI.add(resList.iterator()); |
| 121 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 126 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 122 | ee.excelReplace(listI, new Object[] { map2 }, path + "mould/shifday.xls", | 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 | } catch (Exception e) { | 130 | } catch (Exception e) { |
| 125 | e.printStackTrace(); | 131 | e.printStackTrace(); |
| 126 | } | 132 | } |
| @@ -130,7 +136,8 @@ public class ExportController { | @@ -130,7 +136,8 @@ public class ExportController { | ||
| 130 | // 班次车辆人员月统计 | 136 | // 班次车辆人员月统计 |
| 131 | @RequestMapping(value = "/shiftuehiclemanthExport", method = RequestMethod.GET) | 137 | @RequestMapping(value = "/shiftuehiclemanthExport", method = RequestMethod.GET) |
| 132 | public List<Map<String, Object>> shiftuehiclemanthExport(@RequestParam Map<String, Object> map) { | 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 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 141 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 135 | ReportUtils ee = new ReportUtils(); | 142 | ReportUtils ee = new ReportUtils(); |
| 136 | List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth(map); | 143 | List<Shiftuehiclemanth> shiftuehiclemanth = formsService.shiftuehiclemanth(map); |
| @@ -153,7 +160,20 @@ public class ExportController { | @@ -153,7 +160,20 @@ public class ExportController { | ||
| 153 | } | 160 | } |
| 154 | 161 | ||
| 155 | try { | 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 | if(map.get("empnames").equals("驾驶员")){ | 177 | if(map.get("empnames").equals("驾驶员")){ |
| 158 | mouldurl="mould/shiftuehiclemanth.xls"; | 178 | mouldurl="mould/shiftuehiclemanth.xls"; |
| 159 | }else if(map.get("empnames").equals("售票员")){ | 179 | }else if(map.get("empnames").equals("售票员")){ |
| @@ -164,7 +184,7 @@ public class ExportController { | @@ -164,7 +184,7 @@ public class ExportController { | ||
| 164 | listI.add(resList.iterator()); | 184 | listI.add(resList.iterator()); |
| 165 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 185 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 166 | ee.excelReplace(listI, new Object[] { map }, path +mouldurl, | 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 | } catch (Exception e) { | 188 | } catch (Exception e) { |
| 169 | e.printStackTrace(); | 189 | e.printStackTrace(); |
| 170 | } | 190 | } |
| @@ -304,7 +324,8 @@ public class ExportController { | @@ -304,7 +324,8 @@ public class ExportController { | ||
| 304 | } | 324 | } |
| 305 | @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET) | 325 | @RequestMapping(value = "/singledataExportTj", method = RequestMethod.GET) |
| 306 | public List<Map<String, Object>> singledataExportTj(@RequestParam Map<String, Object> map) { | 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 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 329 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 309 | ReportUtils ee = new ReportUtils(); | 330 | ReportUtils ee = new ReportUtils(); |
| 310 | List<Singledata> singledata = formsService.singledatatj(map); | 331 | List<Singledata> singledata = formsService.singledatatj(map); |
| @@ -333,10 +354,16 @@ public class ExportController { | @@ -333,10 +354,16 @@ public class ExportController { | ||
| 333 | } | 354 | } |
| 334 | 355 | ||
| 335 | try { | 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 | listI.add(resList.iterator()); | 362 | listI.add(resList.iterator()); |
| 337 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 363 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 338 | ee.excelReplace(listI, new Object[] { map }, path + "mould/singledata.xls", | 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 | } catch (Exception e) { | 367 | } catch (Exception e) { |
| 341 | e.printStackTrace(); | 368 | e.printStackTrace(); |
| 342 | } | 369 | } |
| @@ -388,7 +415,8 @@ public class ExportController { | @@ -388,7 +415,8 @@ public class ExportController { | ||
| 388 | // 车辆加注 | 415 | // 车辆加注 |
| 389 | @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET) | 416 | @RequestMapping(value = "/vehicleloadingExport", method = RequestMethod.GET) |
| 390 | public List<Map<String, Object>> vehicleloadingExport(@RequestParam Map<String, Object> map) { | 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 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 420 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 393 | ReportUtils ee = new ReportUtils(); | 421 | ReportUtils ee = new ReportUtils(); |
| 394 | List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(), | 422 | List<Vehicleloading> vehicleloading = formsService.vehicleloading(map.get("line").toString(), |
| @@ -414,10 +442,15 @@ public class ExportController { | @@ -414,10 +442,15 @@ public class ExportController { | ||
| 414 | } | 442 | } |
| 415 | 443 | ||
| 416 | try { | 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 | listI.add(resList.iterator()); | 450 | listI.add(resList.iterator()); |
| 418 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 451 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 419 | ee.excelReplace(listI, new Object[] { map }, path + "mould/vehicleloading.xls", | 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 | } catch (Exception e) { | 454 | } catch (Exception e) { |
| 422 | e.printStackTrace(); | 455 | e.printStackTrace(); |
| 423 | } | 456 | } |
| @@ -447,10 +480,23 @@ public class ExportController { | @@ -447,10 +480,23 @@ public class ExportController { | ||
| 447 | } | 480 | } |
| 448 | 481 | ||
| 449 | try { | 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 | listI.add(resList.iterator()); | 496 | listI.add(resList.iterator()); |
| 451 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 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 | } catch (Exception e) { | 500 | } catch (Exception e) { |
| 455 | e.printStackTrace(); | 501 | e.printStackTrace(); |
| 456 | } | 502 | } |
| @@ -460,7 +506,8 @@ public class ExportController { | @@ -460,7 +506,8 @@ public class ExportController { | ||
| 460 | // 换人换车情况日统计 | 506 | // 换人换车情况日统计 |
| 461 | @RequestMapping(value = "/changetochangeExport", method = RequestMethod.POST) | 507 | @RequestMapping(value = "/changetochangeExport", method = RequestMethod.POST) |
| 462 | public List<Map<String, Object>> changetochangeExport(@RequestParam Map<String, Object> map) { | 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 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 511 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 465 | ReportUtils ee = new ReportUtils(); | 512 | ReportUtils ee = new ReportUtils(); |
| 466 | List<Changetochange> changetochange = formsService.changetochange(map); | 513 | List<Changetochange> changetochange = formsService.changetochange(map); |
| @@ -484,10 +531,23 @@ public class ExportController { | @@ -484,10 +531,23 @@ public class ExportController { | ||
| 484 | } | 531 | } |
| 485 | 532 | ||
| 486 | try { | 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 | listI.add(resList.iterator()); | 547 | listI.add(resList.iterator()); |
| 488 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 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 | } catch (Exception e) { | 551 | } catch (Exception e) { |
| 492 | e.printStackTrace(); | 552 | e.printStackTrace(); |
| 493 | } | 553 | } |
| @@ -497,7 +557,8 @@ public class ExportController { | @@ -497,7 +557,8 @@ public class ExportController { | ||
| 497 | // 营运线路出车率统计表 | 557 | // 营运线路出车率统计表 |
| 498 | @RequestMapping(value = "/turnoutrateExport", method = RequestMethod.POST) | 558 | @RequestMapping(value = "/turnoutrateExport", method = RequestMethod.POST) |
| 499 | public List<Map<String, Object>> turnoutrateExport(@RequestParam Map<String, Object> map) { | 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 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 562 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 502 | ReportUtils ee = new ReportUtils(); | 563 | ReportUtils ee = new ReportUtils(); |
| 503 | Map<String, Object> map1 = new HashMap<String, Object>(); | 564 | Map<String, Object> map1 = new HashMap<String, Object>(); |
| @@ -517,10 +578,23 @@ public class ExportController { | @@ -517,10 +578,23 @@ public class ExportController { | ||
| 517 | resList.remove(m); | 578 | resList.remove(m); |
| 518 | 579 | ||
| 519 | try { | 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 | listI.add(resList.iterator()); | 594 | listI.add(resList.iterator()); |
| 521 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 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 | } catch (Exception e) { | 598 | } catch (Exception e) { |
| 525 | e.printStackTrace(); | 599 | e.printStackTrace(); |
| 526 | } | 600 | } |
| @@ -713,10 +787,13 @@ public class ExportController { | @@ -713,10 +787,13 @@ public class ExportController { | ||
| 713 | m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString())); | 787 | m.put("line", BasicData.lineCode2NameMap.get(map.get("line").toString())); |
| 714 | m.put("date", map.get("date").toString()); | 788 | m.put("date", map.get("date").toString()); |
| 715 | try { | 789 | try { |
| 790 | + String lineName = map.get("lineName").toString(); | ||
| 791 | + String date = map.get("date").toString(); | ||
| 716 | listI.add(resList.iterator()); | 792 | listI.add(resList.iterator()); |
| 717 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 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 | } catch (Exception e) { | 797 | } catch (Exception e) { |
| 721 | e.printStackTrace(); | 798 | e.printStackTrace(); |
| 722 | } | 799 | } |
src/main/java/com/bsth/controller/report/ReportController.java
| 1 | package com.bsth.controller.report; | 1 | package com.bsth.controller.report; |
| 2 | 2 | ||
| 3 | +import java.text.SimpleDateFormat; | ||
| 3 | import java.util.ArrayList; | 4 | import java.util.ArrayList; |
| 4 | import java.util.HashMap; | 5 | import java.util.HashMap; |
| 5 | import java.util.Iterator; | 6 | import java.util.Iterator; |
| @@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; | @@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 15 | 16 | ||
| 16 | import com.alibaba.fastjson.JSONArray; | 17 | import com.alibaba.fastjson.JSONArray; |
| 17 | import com.alibaba.fastjson.JSONObject; | 18 | import com.alibaba.fastjson.JSONObject; |
| 19 | +import com.bsth.data.BasicData; | ||
| 18 | import com.bsth.entity.StationRoute; | 20 | import com.bsth.entity.StationRoute; |
| 19 | import com.bsth.entity.excep.ArrivalInfo; | 21 | import com.bsth.entity.excep.ArrivalInfo; |
| 20 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 22 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| @@ -51,6 +53,7 @@ public class ReportController { | @@ -51,6 +53,7 @@ public class ReportController { | ||
| 51 | Map<String, Object> m = new HashMap<String, Object>(); | 53 | Map<String, Object> m = new HashMap<String, Object>(); |
| 52 | m.put("i", i); | 54 | m.put("i", i); |
| 53 | m.put("nbbm", a.getNbbm()); | 55 | m.put("nbbm", a.getNbbm()); |
| 56 | + m.put("pzh", a.getPzh()); | ||
| 54 | m.put("stopName", a.getStopName()); | 57 | m.put("stopName", a.getStopName()); |
| 55 | m.put("jzsj", a.getJzsj()); | 58 | m.put("jzsj", a.getJzsj()); |
| 56 | m.put("czsj", a.getCzsj()); | 59 | m.put("czsj", a.getCzsj()); |
| @@ -65,13 +68,15 @@ public class ReportController { | @@ -65,13 +68,15 @@ public class ReportController { | ||
| 65 | resList.add(m); | 68 | resList.add(m); |
| 66 | i++; | 69 | i++; |
| 67 | } | 70 | } |
| 68 | - | ||
| 69 | try { | 71 | try { |
| 72 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 73 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 70 | Map<String, Object> map=new HashMap<String, Object>(); | 74 | Map<String, Object> map=new HashMap<String, Object>(); |
| 71 | listI.add(resList.iterator()); | 75 | listI.add(resList.iterator()); |
| 72 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 76 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 73 | ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls", | 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 | } catch (Exception e) { | 80 | } catch (Exception e) { |
| 76 | e.printStackTrace(); | 81 | e.printStackTrace(); |
| 77 | } | 82 | } |
| @@ -138,11 +143,23 @@ public class ReportController { | @@ -138,11 +143,23 @@ public class ReportController { | ||
| 138 | } | 143 | } |
| 139 | 144 | ||
| 140 | try { | 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 | Map<String, Object> map=new HashMap<String, Object>(); | 158 | Map<String, Object> map=new HashMap<String, Object>(); |
| 142 | listI.add(resList.iterator()); | 159 | listI.add(resList.iterator()); |
| 143 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 160 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 144 | ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls", | 161 | ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls", |
| 145 | - path + "export/班次到离站.xls"); | 162 | + path + "export/"+dateTime+"-"+lineName+"-班次到离站.xls"); |
| 146 | } catch (Exception e) { | 163 | } catch (Exception e) { |
| 147 | e.printStackTrace(); | 164 | e.printStackTrace(); |
| 148 | } | 165 | } |
| @@ -186,11 +203,14 @@ public class ReportController { | @@ -186,11 +203,14 @@ public class ReportController { | ||
| 186 | lgqlList.add(newMap); | 203 | lgqlList.add(newMap); |
| 187 | } | 204 | } |
| 188 | try { | 205 | try { |
| 206 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 207 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 189 | listI.add(fwqlList.iterator()); | 208 | listI.add(fwqlList.iterator()); |
| 190 | listI.add(lgqlList.iterator()); | 209 | listI.add(lgqlList.iterator()); |
| 191 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 210 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 192 | ee.excelReplace(listI, new Object[] { map }, path + "mould/jobSummary.xls", | 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 | } catch (Exception e) { | 214 | } catch (Exception e) { |
| 195 | e.printStackTrace(); | 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,6 +8,7 @@ import com.bsth.service.schedule.datatools.TTInfoDetailForEdit; | ||
| 8 | import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData; | 8 | import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData; |
| 9 | import com.bsth.service.schedule.timetable.ExcelFormatType; | 9 | import com.bsth.service.schedule.timetable.ExcelFormatType; |
| 10 | import com.bsth.service.schedule.utils.DataToolsFile; | 10 | import com.bsth.service.schedule.utils.DataToolsFile; |
| 11 | +import com.bsth.service.schedule.utils.DataToolsFileType; | ||
| 11 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | import org.springframework.web.bind.annotation.*; | 13 | import org.springframework.web.bind.annotation.*; |
| 13 | 14 | ||
| @@ -128,11 +129,19 @@ public class TTInfoDetailController extends BController<TTInfoDetail, Long> { | @@ -128,11 +129,19 @@ public class TTInfoDetailController extends BController<TTInfoDetail, Long> { | ||
| 128 | } | 129 | } |
| 129 | 130 | ||
| 130 | 131 | ||
| 131 | - @RequestMapping(value = "/exportDTDFile", method = RequestMethod.POST) | 132 | + @RequestMapping(value = "/exportDTDFile/{type}", method = RequestMethod.POST) |
| 132 | public void exportFile( | 133 | public void exportFile( |
| 133 | - @RequestBody TTinfoDetailDynamicData.DTInfos dtInfos, | 134 | + @RequestBody TTinfoDetailDynamicData.DTInfos dtInfos, @PathVariable("type") String type, |
| 134 | HttpServletResponse response) throws Exception { | 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 | response.setHeader("content-type", "application/octet-stream"); | 146 | response.setHeader("content-type", "application/octet-stream"); |
| 138 | response.setHeader("Content-Disposition", "attachment; filename=" + dataToolsFile.getFile().getName()); | 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,7 +28,7 @@ public class BasicData { | ||
| 28 | //公司代码和公司名对照(K: 公司编码,V:公司名) | 28 | //公司代码和公司名对照(K: 公司编码,V:公司名) |
| 29 | public static Map<String, String> businessCodeNameMap; | 29 | public static Map<String, String> businessCodeNameMap; |
| 30 | 30 | ||
| 31 | - //分公司公司代码和分公司公司名对照(K: 公司编码_分公司编码,V:分公司公司名) | 31 | + //分公司公司代码和分公司公司名对照(K: 分公司编码_公司编码,V:分公司公司名) |
| 32 | public static Map<String, String> businessFgsCodeNameMap; | 32 | public static Map<String, String> businessFgsCodeNameMap; |
| 33 | 33 | ||
| 34 | //设备号和车辆自编号 (K: 设备编码 ,V:车辆自编号) | 34 | //设备号和车辆自编号 (K: 设备编码 ,V:车辆自编号) |
| @@ -37,7 +37,7 @@ public class BasicData { | @@ -37,7 +37,7 @@ public class BasicData { | ||
| 37 | //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码) | 37 | //车辆自编号和公司代码对照 (K: 车辆自编号 ,V:公司代码) |
| 38 | public static Map<String, String> nbbm2CompanyCodeMap; | 38 | public static Map<String, String> nbbm2CompanyCodeMap; |
| 39 | 39 | ||
| 40 | - //车辆自编号和分公司代码对照 (K: 车辆自编号 ,V:公司代码_分公司代码) | 40 | + //车辆自编号和分公司代码对照 (K: 车辆自编号 ,V:分公司编码_公司编码) |
| 41 | public static Map<String, String> nbbm2FgsCompanyCodeMap; | 41 | public static Map<String, String> nbbm2FgsCompanyCodeMap; |
| 42 | 42 | ||
| 43 | //车辆自编号和牌照号对照 (K: 车辆自编号 ,V:牌照号) | 43 | //车辆自编号和牌照号对照 (K: 车辆自编号 ,V:牌照号) |
| @@ -206,7 +206,7 @@ public class BasicData { | @@ -206,7 +206,7 @@ public class BasicData { | ||
| 206 | car = carIterator.next(); | 206 | car = carIterator.next(); |
| 207 | deviceId2Nbbm.put(car.getEquipmentCode(), car.getInsideCode()); | 207 | deviceId2Nbbm.put(car.getEquipmentCode(), car.getInsideCode()); |
| 208 | nbbm2CompanyCode.put(car.getInsideCode(), car.getBusinessCode()); | 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 | nbbmCompanyPlate.put(car.getInsideCode(), car.getCarPlate()); | 210 | nbbmCompanyPlate.put(car.getInsideCode(), car.getCarPlate()); |
| 211 | } | 211 | } |
| 212 | 212 | ||
| @@ -256,6 +256,8 @@ public class BasicData { | @@ -256,6 +256,8 @@ public class BasicData { | ||
| 256 | CarConfigInfo cci; | 256 | CarConfigInfo cci; |
| 257 | while (allIterator.hasNext()) { | 257 | while (allIterator.hasNext()) { |
| 258 | cci = allIterator.next(); | 258 | cci = allIterator.next(); |
| 259 | + if(cci.getIsCancel()) | ||
| 260 | + continue;//排除已经报废的 | ||
| 259 | ccMap.put(cci.getCl().getInsideCode(), cci.getXl()); | 261 | ccMap.put(cci.getCl().getInsideCode(), cci.getXl()); |
| 260 | } | 262 | } |
| 261 | nbbm2LineMap = ccMap; | 263 | nbbm2LineMap = ccMap; |
src/main/java/com/bsth/data/directive/DirectivesPstThread.java
| @@ -142,7 +142,7 @@ public class DirectivesPstThread extends Thread { | @@ -142,7 +142,7 @@ public class DirectivesPstThread extends Thread { | ||
| 142 | 142 | ||
| 143 | tran.commit(status); | 143 | tran.commit(status); |
| 144 | 144 | ||
| 145 | - logger.info("64 入库成功: " + d64s.size()); | 145 | + //logger.info("64 入库成功: " + d64s.size()); |
| 146 | }catch (Exception e){ | 146 | }catch (Exception e){ |
| 147 | tran.rollback(status); | 147 | tran.rollback(status); |
| 148 | logger.error("", e); | 148 | logger.error("", e); |
| @@ -192,7 +192,7 @@ public class DirectivesPstThread extends Thread { | @@ -192,7 +192,7 @@ public class DirectivesPstThread extends Thread { | ||
| 192 | 192 | ||
| 193 | tran.commit(status); | 193 | tran.commit(status); |
| 194 | 194 | ||
| 195 | - logger.info("60 更新成功: " + d60s.size()); | 195 | + //logger.info("60 更新成功: " + d60s.size()); |
| 196 | }catch (Exception e){ | 196 | }catch (Exception e){ |
| 197 | tran.rollback(status); | 197 | tran.rollback(status); |
| 198 | logger.error("", e); | 198 | logger.error("", e); |
| @@ -266,7 +266,7 @@ public class DirectivesPstThread extends Thread { | @@ -266,7 +266,7 @@ public class DirectivesPstThread extends Thread { | ||
| 266 | 266 | ||
| 267 | tran.commit(status); | 267 | tran.commit(status); |
| 268 | 268 | ||
| 269 | - logger.info("60 入库成功: " + d60s.size()); | 269 | + //logger.info("60 入库成功: " + d60s.size()); |
| 270 | }catch (Exception e){ | 270 | }catch (Exception e){ |
| 271 | tran.rollback(status); | 271 | tran.rollback(status); |
| 272 | logger.error("", e); | 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,6 +21,8 @@ import org.springframework.stereotype.Component; | ||
| 21 | import java.sql.ResultSet; | 21 | import java.sql.ResultSet; |
| 22 | import java.sql.SQLException; | 22 | import java.sql.SQLException; |
| 23 | import java.util.*; | 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,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,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 | @Autowired | 65 | @Autowired |
| 64 | JdbcTemplate jdbcTemplate; | 66 | JdbcTemplate jdbcTemplate; |
| @@ -118,7 +120,7 @@ public class GeoCacheData { | @@ -118,7 +120,7 @@ public class GeoCacheData { | ||
| 118 | //按线路和走向分组 | 120 | //按线路和走向分组 |
| 119 | if (routeList.size() > 0) { | 121 | if (routeList.size() > 0) { |
| 120 | ArrayListMultimap<String, StationRoute> tempMap = ArrayListMultimap.create(); | 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 | for (StationRoute sr : routeList) { | 124 | for (StationRoute sr : routeList) { |
| 123 | tempMap.put(sr.getLineCode() + "_" + sr.getDirections(), sr); | 125 | tempMap.put(sr.getLineCode() + "_" + sr.getDirections(), sr); |
| 124 | //站点编码 ——> 和路由顺序对照 | 126 | //站点编码 ——> 和路由顺序对照 |
| @@ -141,7 +143,7 @@ public class GeoCacheData { | @@ -141,7 +143,7 @@ public class GeoCacheData { | ||
| 141 | //加载停车场数据 | 143 | //加载停车场数据 |
| 142 | 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"; | 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 | List<Map<String, Object>> tccList = jdbcTemplate.queryForList(sql); | 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 | Polygon polygon; | 148 | Polygon polygon; |
| 147 | for (Map<String, Object> tMap : tccList) { | 149 | for (Map<String, Object> tMap : tccList) { |
| @@ -163,7 +165,7 @@ public class GeoCacheData { | @@ -163,7 +165,7 @@ public class GeoCacheData { | ||
| 163 | //加载线路限速信息 | 165 | //加载线路限速信息 |
| 164 | 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"; | 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 | List<Map<String, Object>> speedMap = jdbcTemplate.queryForList(sql); | 167 | List<Map<String, Object>> speedMap = jdbcTemplate.queryForList(sql); |
| 166 | - Map<String, Double> speedTempMap = new HashMap<>(); | 168 | + ConcurrentMap<String, Double> speedTempMap = new ConcurrentHashMap(); |
| 167 | for (Map<String, Object> tMap : speedMap) { | 169 | for (Map<String, Object> tMap : speedMap) { |
| 168 | try { | 170 | try { |
| 169 | speedTempMap.put(tMap.get("LINE_CODE").toString(), Double.parseDouble(tMap.get("SPEEDING").toString())); | 171 | speedTempMap.put(tMap.get("LINE_CODE").toString(), Double.parseDouble(tMap.get("SPEEDING").toString())); |
| @@ -208,7 +210,7 @@ public class GeoCacheData { | @@ -208,7 +210,7 @@ public class GeoCacheData { | ||
| 208 | if(sectionCacheTempMap.size() > 0) | 210 | if(sectionCacheTempMap.size() > 0) |
| 209 | sectionCacheMap = sectionCacheTempMap; | 211 | sectionCacheMap = sectionCacheTempMap; |
| 210 | 212 | ||
| 211 | - Map<String, String> sectionCode2NameTemp = new HashMap<>(); | 213 | + ConcurrentMap<String, String> sectionCode2NameTemp = new ConcurrentHashMap<>(); |
| 212 | 214 | ||
| 213 | //加载全量路段编码和名称对照 | 215 | //加载全量路段编码和名称对照 |
| 214 | sql = "select SECTION_CODE,SECTION_NAME,CROSES_ROAD from bsth_c_section"; | 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,8 +37,8 @@ public class SafeDrivDataLoadThread extends Thread{ | ||
| 37 | httpClient = HttpClients.createDefault(); | 37 | httpClient = HttpClients.createDefault(); |
| 38 | get = new HttpGet(url); | 38 | get = new HttpGet(url); |
| 39 | requestConfig = RequestConfig.custom() | 39 | requestConfig = RequestConfig.custom() |
| 40 | - .setConnectTimeout(2500).setConnectionRequestTimeout(2000) | ||
| 41 | - .setSocketTimeout(2500).build(); | 40 | + .setConnectTimeout(5500).setConnectionRequestTimeout(5000) |
| 41 | + .setSocketTimeout(5500).build(); | ||
| 42 | get.setConfig(requestConfig); | 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,6 +38,7 @@ import java.text.SimpleDateFormat; | ||
| 38 | import java.util.*; | 38 | import java.util.*; |
| 39 | import java.util.concurrent.ConcurrentHashMap; | 39 | import java.util.concurrent.ConcurrentHashMap; |
| 40 | import java.util.concurrent.ConcurrentLinkedQueue; | 40 | import java.util.concurrent.ConcurrentLinkedQueue; |
| 41 | +import java.util.concurrent.ConcurrentMap; | ||
| 41 | 42 | ||
| 42 | /** | 43 | /** |
| 43 | * @author PanZhao | 44 | * @author PanZhao |
| @@ -63,10 +64,10 @@ public class DayOfSchedule { | @@ -63,10 +64,10 @@ public class DayOfSchedule { | ||
| 63 | private static ArrayListMultimap<String, ScheduleRealInfo> lpScheduleMap; | 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 | public static ConcurrentLinkedQueue<ScheduleRealInfo> pstBuffer; | 73 | public static ConcurrentLinkedQueue<ScheduleRealInfo> pstBuffer; |
| @@ -1098,7 +1099,7 @@ public class DayOfSchedule { | @@ -1098,7 +1099,7 @@ public class DayOfSchedule { | ||
| 1098 | */ | 1099 | */ |
| 1099 | public int reCalcIdMaps(){ | 1100 | public int reCalcIdMaps(){ |
| 1100 | Collection<ScheduleRealInfo> all = findAll(); | 1101 | Collection<ScheduleRealInfo> all = findAll(); |
| 1101 | - Map<Long, ScheduleRealInfo> id2SchedulMapCopy = new ConcurrentHashMap<>(); | 1102 | + ConcurrentMap<Long, ScheduleRealInfo> id2SchedulMapCopy = new ConcurrentHashMap<>(); |
| 1102 | 1103 | ||
| 1103 | for(ScheduleRealInfo sch : all){ | 1104 | for(ScheduleRealInfo sch : all){ |
| 1104 | id2SchedulMapCopy.put(sch.getId(), sch); | 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,13 +32,17 @@ public class ScheduleStationCodeChecker { | ||
| 32 | @Autowired | 32 | @Autowired |
| 33 | JdbcTemplate jdbcTemplate; | 33 | JdbcTemplate jdbcTemplate; |
| 34 | 34 | ||
| 35 | - Logger logger = LoggerFactory.getLogger(this.getClass()); | 35 | + static Logger logger = LoggerFactory.getLogger(ScheduleStationCodeChecker.class); |
| 36 | 36 | ||
| 37 | public static List<SCodeInfo> findByLineIdx(List<String> lineArray){ | 37 | public static List<SCodeInfo> findByLineIdx(List<String> lineArray){ |
| 38 | List<SCodeInfo> rs = new ArrayList<>(); | 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 | return rs; | 47 | return rs; |
| 44 | } | 48 | } |
| @@ -116,13 +120,13 @@ public class ScheduleStationCodeChecker { | @@ -116,13 +120,13 @@ public class ScheduleStationCodeChecker { | ||
| 116 | 120 | ||
| 117 | 121 | ||
| 118 | private Map<String, SCodeInfo> allRealCodeInfo() { | 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 | List<SCodeInfo> realList = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SCodeInfo.class)); | 124 | List<SCodeInfo> realList = jdbcTemplate.query(sql, BeanPropertyRowMapper.newInstance(SCodeInfo.class)); |
| 121 | Map<String, SCodeInfo> realMap = new HashMap<>(); | 125 | Map<String, SCodeInfo> realMap = new HashMap<>(); |
| 122 | 126 | ||
| 123 | for (SCodeInfo sci : realList) { | 127 | for (SCodeInfo sci : realList) { |
| 124 | realMap.put(sci.getLineCode() + "_" + sci.getUpDown() + "_" + sci.getStationName(), sci); | 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 | return realMap; | 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,6 +9,7 @@ import com.bsth.entity.realcontrol.ScheduleRealInfo; | ||
| 9 | import com.bsth.util.Arith; | 9 | import com.bsth.util.Arith; |
| 10 | import com.bsth.websocket.handler.SendUtils; | 10 | import com.bsth.websocket.handler.SendUtils; |
| 11 | import com.google.common.collect.ArrayListMultimap; | 11 | import com.google.common.collect.ArrayListMultimap; |
| 12 | +import org.apache.commons.lang3.StringUtils; | ||
| 12 | import org.slf4j.Logger; | 13 | import org.slf4j.Logger; |
| 13 | import org.slf4j.LoggerFactory; | 14 | import org.slf4j.LoggerFactory; |
| 14 | import org.springframework.beans.BeansException; | 15 | import org.springframework.beans.BeansException; |
| @@ -64,12 +65,14 @@ public class LateAdjustHandle implements ApplicationContextAware{ | @@ -64,12 +65,14 @@ public class LateAdjustHandle implements ApplicationContextAware{ | ||
| 64 | && sch.getDfsj().compareTo(config.getYjtkEnd()) <= 0){ | 65 | && sch.getDfsj().compareTo(config.getYjtkEnd()) <= 0){ |
| 65 | 66 | ||
| 66 | ScheduleRealInfo old = popLateSch(sch); | 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 | sch.setLate2(true); | 74 | sch.setLate2(true); |
| 70 | sendUtils.sendAutoWdtz(sch, old); | 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,15 +87,17 @@ public class LateAdjustHandle implements ApplicationContextAware{ | ||
| 84 | * @return 返回被移除的误点班次 | 87 | * @return 返回被移除的误点班次 |
| 85 | */ | 88 | */ |
| 86 | private static ScheduleRealInfo popLateSch(ScheduleRealInfo sch) { | 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 | if(null == list || list.size() == 0) | 92 | if(null == list || list.size() == 0) |
| 90 | lateSchMaps.put(sch.getClZbh(), sch); | 93 | lateSchMaps.put(sch.getClZbh(), sch); |
| 91 | else { | 94 | else { |
| 92 | ScheduleRealInfo old = findExistQdz(list, sch.getQdzCode(), sch.getQdzName()); | 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 | lateSchMaps.remove(old.getClZbh(), old); | 101 | lateSchMaps.remove(old.getClZbh(), old); |
| 97 | lateSchMaps.put(sch.getClZbh(), sch); | 102 | lateSchMaps.put(sch.getClZbh(), sch); |
| 98 | 103 | ||
| @@ -155,8 +160,12 @@ public class LateAdjustHandle implements ApplicationContextAware{ | @@ -155,8 +160,12 @@ public class LateAdjustHandle implements ApplicationContextAware{ | ||
| 155 | return; | 160 | return; |
| 156 | 161 | ||
| 157 | String key = gps.getStopNo(); | 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 | gps.setStationName(BasicData.stationCode2NameMap.get(key)); | 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,36 +25,48 @@ public class SubmitToTrafficManage extends Thread{ | ||
| 25 | @Override | 25 | @Override |
| 26 | public void run() { | 26 | public void run() { |
| 27 | logger.info("开始提交数据到运管处..."); | 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 | logger.info("提交数据到运管处结束!"); | 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,8 +59,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | ||
| 59 | .and().csrf().disable() | 59 | .and().csrf().disable() |
| 60 | //禁用匿名用户功能 | 60 | //禁用匿名用户功能 |
| 61 | .anonymous().disable() | 61 | .anonymous().disable() |
| 62 | - //允许同源 iframe | ||
| 63 | - .headers().frameOptions().sameOrigin().httpStrictTransportSecurity().disable(); | 62 | + //允许 iframe |
| 63 | + .headers().frameOptions().disable(); | ||
| 64 | 64 | ||
| 65 | // 同时只保持一个回话 | 65 | // 同时只保持一个回话 |
| 66 | http.sessionManagement().maximumSessions(1) | 66 | http.sessionManagement().maximumSessions(1) |
src/main/java/com/bsth/service/calc/CalcWaybillService.java
| @@ -3,6 +3,8 @@ package com.bsth.service.calc; | @@ -3,6 +3,8 @@ package com.bsth.service.calc; | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import java.util.Map; | 4 | import java.util.Map; |
| 5 | 5 | ||
| 6 | +import com.bsth.entity.calc.CalcBusMileage; | ||
| 7 | +import com.bsth.entity.calc.CalcLineMileage; | ||
| 6 | import com.bsth.entity.calc.CalcStatistics; | 8 | import com.bsth.entity.calc.CalcStatistics; |
| 7 | import com.bsth.entity.calc.CalcWaybill; | 9 | import com.bsth.entity.calc.CalcWaybill; |
| 8 | import com.bsth.service.BaseService; | 10 | import com.bsth.service.BaseService; |
| @@ -13,7 +15,7 @@ import com.bsth.service.BaseService; | @@ -13,7 +15,7 @@ import com.bsth.service.BaseService; | ||
| 13 | public interface CalcWaybillService extends BaseService<CalcWaybill, Integer> { | 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 | * @param line (留空""默认全部线路) | 19 | * @param line (留空""默认全部线路) |
| 18 | */ | 20 | */ |
| 19 | Map<String, Object> autoGenerate(String date, String line) throws Exception; | 21 | Map<String, Object> autoGenerate(String date, String line) throws Exception; |
| @@ -23,10 +25,19 @@ public interface CalcWaybillService extends BaseService<CalcWaybill, Integer> { | @@ -23,10 +25,19 @@ public interface CalcWaybillService extends BaseService<CalcWaybill, Integer> { | ||
| 23 | List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type); | 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 | * @param line (留空""默认全部线路) | 29 | * @param line (留空""默认全部线路) |
| 28 | */ | 30 | */ |
| 29 | String calcDaily(String rq, String line) throws Exception; | 31 | String calcDaily(String rq, String line) throws Exception; |
| 30 | 32 | ||
| 31 | List<CalcStatistics> calcStatisticsDaily(String gsdm,String fgsdm, String line, String date, String date2, String xlName, String type); | 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,13 +18,19 @@ import java.util.Set; | ||
| 18 | import javax.transaction.Transactional; | 18 | import javax.transaction.Transactional; |
| 19 | 19 | ||
| 20 | import com.bsth.common.ResponseCode; | 20 | import com.bsth.common.ResponseCode; |
| 21 | +import com.bsth.entity.Line; | ||
| 22 | +import com.bsth.entity.calc.CalcBusMileage; | ||
| 21 | import com.bsth.entity.calc.CalcInterval; | 23 | import com.bsth.entity.calc.CalcInterval; |
| 24 | +import com.bsth.entity.calc.CalcLineMileage; | ||
| 22 | import com.bsth.entity.calc.CalcStatistics; | 25 | import com.bsth.entity.calc.CalcStatistics; |
| 23 | import com.bsth.entity.calc.CalcWaybill; | 26 | import com.bsth.entity.calc.CalcWaybill; |
| 24 | import com.bsth.entity.realcontrol.ChildTaskPlan; | 27 | import com.bsth.entity.realcontrol.ChildTaskPlan; |
| 25 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 28 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 26 | import com.bsth.entity.sys.Interval; | 29 | import com.bsth.entity.sys.Interval; |
| 30 | +import com.bsth.repository.LineRepository; | ||
| 31 | +import com.bsth.repository.calc.CalcBusMileageRepository; | ||
| 27 | import com.bsth.repository.calc.CalcIntervalRepository; | 32 | import com.bsth.repository.calc.CalcIntervalRepository; |
| 33 | +import com.bsth.repository.calc.CalcLineMileageRepository; | ||
| 28 | import com.bsth.repository.calc.CalcStatisticsRepository; | 34 | import com.bsth.repository.calc.CalcStatisticsRepository; |
| 29 | import com.bsth.repository.calc.CalcWaybillRepository; | 35 | import com.bsth.repository.calc.CalcWaybillRepository; |
| 30 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 36 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| @@ -32,6 +38,7 @@ import com.bsth.service.calc.CalcToolService; | @@ -32,6 +38,7 @@ import com.bsth.service.calc.CalcToolService; | ||
| 32 | import com.bsth.service.calc.CalcWaybillService; | 38 | import com.bsth.service.calc.CalcWaybillService; |
| 33 | import com.bsth.service.impl.BaseServiceImpl; | 39 | import com.bsth.service.impl.BaseServiceImpl; |
| 34 | import com.bsth.service.report.CulateMileageService; | 40 | import com.bsth.service.report.CulateMileageService; |
| 41 | +import com.bsth.service.report.ReportService; | ||
| 35 | import com.bsth.util.Arith; | 42 | import com.bsth.util.Arith; |
| 36 | import com.bsth.util.BatchSaveUtils; | 43 | import com.bsth.util.BatchSaveUtils; |
| 37 | import com.bsth.util.ReportUtils; | 44 | import com.bsth.util.ReportUtils; |
| @@ -62,6 +69,12 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -62,6 +69,12 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 62 | private CalcStatisticsRepository calcStatisticsRepository; | 69 | private CalcStatisticsRepository calcStatisticsRepository; |
| 63 | 70 | ||
| 64 | @Autowired | 71 | @Autowired |
| 72 | + private CalcLineMileageRepository calcLineMileageRepository; | ||
| 73 | + | ||
| 74 | + @Autowired | ||
| 75 | + private CalcBusMileageRepository calcBusMileageRepository; | ||
| 76 | + | ||
| 77 | + @Autowired | ||
| 65 | private CalcToolService calcToolService; | 78 | private CalcToolService calcToolService; |
| 66 | 79 | ||
| 67 | @Autowired | 80 | @Autowired |
| @@ -69,7 +82,13 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -69,7 +82,13 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 69 | 82 | ||
| 70 | @Autowired | 83 | @Autowired |
| 71 | private ScheduleRealInfoRepository scheduleRealInfoRepository; | 84 | private ScheduleRealInfoRepository scheduleRealInfoRepository; |
| 85 | + | ||
| 86 | + @Autowired | ||
| 87 | + private LineRepository lineRepository; | ||
| 72 | 88 | ||
| 89 | + @Autowired | ||
| 90 | + private ReportService reportService; | ||
| 91 | + | ||
| 73 | @Autowired | 92 | @Autowired |
| 74 | JdbcTemplate jdbcTemplate; | 93 | JdbcTemplate jdbcTemplate; |
| 75 | 94 | ||
| @@ -83,20 +102,56 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -83,20 +102,56 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 83 | Date d = new Date(); | 102 | Date d = new Date(); |
| 84 | d.setTime(d.getTime() - (4 * 1000 * 60 * 60 * 24)); | 103 | d.setTime(d.getTime() - (4 * 1000 * 60 * 60 * 24)); |
| 85 | date = sdf.format(d); | 104 | date = sdf.format(d); |
| 105 | + } else { | ||
| 106 | + date = date.trim(); | ||
| 86 | } | 107 | } |
| 87 | if(line == null || line.trim().length() == 0){ | 108 | if(line == null || line.trim().length() == 0){ |
| 88 | line = ""; | 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 | @Transactional | 140 | @Transactional |
| 94 | @Override | 141 | @Override |
| 95 | public Map<String, Object> generateNew(String date, String line) throws Exception { | 142 | public Map<String, Object> generateNew(String date, String line) throws Exception { |
| 96 | Map<String, Object> newMap = new HashMap<String, Object>(); | 143 | Map<String, Object> newMap = new HashMap<String, Object>(); |
| 97 | - | ||
| 98 | try { | 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 | if(date.length() != 0 && line.length() != 0){ | 155 | if(date.length() != 0 && line.length() != 0){ |
| 101 | calcRepository.deleteByDateAndLine(date, line); | 156 | calcRepository.deleteByDateAndLine(date, line); |
| 102 | calcIntervalRepository.deleteByDateAndLine(date, line); | 157 | calcIntervalRepository.deleteByDateAndLine(date, line); |
| @@ -414,11 +469,37 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -414,11 +469,37 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 414 | resList.add(m); | 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 | return resList; | 498 | return resList; |
| 418 | } | 499 | } |
| 419 | 500 | ||
| 420 | /** | 501 | /** |
| 421 | - * @param rq 格式如:2018-03-22(留空""默认当前日期前两天) | 502 | + * @param rq 格式如:2018-03-22(留空""默认当前日期前四天) |
| 422 | * @param line (留空""默认全部线路) | 503 | * @param line (留空""默认全部线路) |
| 423 | */ | 504 | */ |
| 424 | @Transactional | 505 | @Transactional |
| @@ -432,7 +513,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -432,7 +513,7 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 432 | Date dBefore = new Date(); | 513 | Date dBefore = new Date(); |
| 433 | Calendar calendar = Calendar.getInstance(); //得到日历 | 514 | Calendar calendar = Calendar.getInstance(); //得到日历 |
| 434 | calendar.setTime(dNow);//把当前时间赋给日历 | 515 | calendar.setTime(dNow);//把当前时间赋给日历 |
| 435 | - calendar.add(Calendar.DAY_OF_MONTH, -2); //设置为前一天 | 516 | + calendar.add(Calendar.DAY_OF_MONTH, -4); //设置为前一天 |
| 436 | dBefore = calendar.getTime(); //得到前一天的时间 | 517 | dBefore = calendar.getTime(); //得到前一天的时间 |
| 437 | rq = sdf.format(dBefore); | 518 | rq = sdf.format(dBefore); |
| 438 | } else { | 519 | } else { |
| @@ -448,11 +529,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -448,11 +529,11 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 448 | List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); | 529 | List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); |
| 449 | List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); | 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 | if(line.trim().length() > 0) | 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 | @Override | 537 | @Override |
| 457 | public Map<String, String> mapRow(ResultSet arg0, int arg1) throws SQLException { | 538 | public Map<String, String> mapRow(ResultSet arg0, int arg1) throws SQLException { |
| 458 | Map<String, String> m = new HashMap<String, String>(); | 539 | Map<String, String> m = new HashMap<String, String>(); |
| @@ -695,6 +776,78 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -695,6 +776,78 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 695 | resList.add(temp); | 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 | return resList; | 851 | return resList; |
| 699 | } | 852 | } |
| 700 | 853 | ||
| @@ -740,5 +893,572 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | @@ -740,5 +893,572 @@ public class CalcWaybillServiceImpl extends BaseServiceImpl<CalcWaybill, Integer | ||
| 740 | s.setDjgsj(s.getDjgsj()>s_.getDjgsj()?s.getDjgsj():s_.getDjgsj()); | 893 | s.setDjgsj(s.getDjgsj()>s_.getDjgsj()?s.getDjgsj():s_.getDjgsj()); |
| 741 | return s; | 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,7 +13,7 @@ import com.bsth.entity.mcy_forms.Waybillday; | ||
| 13 | 13 | ||
| 14 | public interface ExportService { | 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 | public void linepasswengerflow(String date,List<Linepasswengerflow> resList); | 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,7 +24,7 @@ public class ExportServiceImpl implements ExportService{ | ||
| 24 | 24 | ||
| 25 | //行车路单日报表 | 25 | //行车路单日报表 |
| 26 | @Override | 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 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 29 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 30 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 30 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| @@ -50,7 +50,8 @@ public class ExportServiceImpl implements ExportService{ | @@ -50,7 +50,8 @@ public class ExportServiceImpl implements ExportService{ | ||
| 50 | listI.add(resList.iterator()); | 50 | listI.add(resList.iterator()); |
| 51 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 51 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 52 | ee.excelReplace(listI, new Object[] { map }, path+"mould/waybillday.xls", | 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 | } catch (Exception e) { | 55 | } catch (Exception e) { |
| 55 | e.printStackTrace(); | 56 | e.printStackTrace(); |
| 56 | } | 57 | } |
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
| @@ -703,17 +703,26 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -703,17 +703,26 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 703 | } | 703 | } |
| 704 | 704 | ||
| 705 | if(type != null && type.length() != 0 && type.equals("export")){ | 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 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 709 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 707 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 710 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 708 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 711 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 709 | Map<String, Object> m = new HashMap<String, Object>(); | 712 | Map<String, Object> m = new HashMap<String, Object>(); |
| 710 | ReportUtils ee = new ReportUtils(); | 713 | ReportUtils ee = new ReportUtils(); |
| 711 | try { | 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 | listI.add(resList.iterator()); | 722 | listI.add(resList.iterator()); |
| 713 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 723 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 714 | ee.excelReplace(listI, new Object[] { m }, path+"mould/busInterval"+statu+".xls", | 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 | } catch (Exception e) { | 726 | } catch (Exception e) { |
| 718 | // TODO: handle exception | 727 | // TODO: handle exception |
| 719 | e.printStackTrace(); | 728 | e.printStackTrace(); |
| @@ -1441,6 +1450,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1441,6 +1450,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1441 | } | 1450 | } |
| 1442 | 1451 | ||
| 1443 | if(type != null && type.length() != 0 && type.equals("export")){ | 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 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 1456 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 1445 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 1457 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 1446 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 1458 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -1450,11 +1462,17 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -1450,11 +1462,17 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 1450 | else if(statu.equals("1")) | 1462 | else if(statu.equals("1")) |
| 1451 | modelMap.put("lpType", "路牌名"); | 1463 | modelMap.put("lpType", "路牌名"); |
| 1452 | try { | 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 | listI.add(((List<Map<String, Object>>)modelMap.get("dataList")).iterator()); | 1472 | listI.add(((List<Map<String, Object>>)modelMap.get("dataList")).iterator()); |
| 1454 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 1473 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 1455 | ee.excelReplace(listI, new Object[] { modelMap }, path+"mould/timeAndSpeed.xls", | 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 | } catch (Exception e) { | 1476 | } catch (Exception e) { |
| 1459 | // TODO: handle exception | 1477 | // TODO: handle exception |
| 1460 | e.printStackTrace(); | 1478 | e.printStackTrace(); |
| @@ -2006,6 +2024,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2006,6 +2024,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2006 | } | 2024 | } |
| 2007 | 2025 | ||
| 2008 | if(type != null && type.length() != 0 && type.equals("export")){ | 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 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 2030 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 2010 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 2031 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 2011 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 2032 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -2015,8 +2036,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2015,8 +2036,9 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2015 | listI.add(resList.iterator()); | 2036 | listI.add(resList.iterator()); |
| 2016 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 2037 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 2017 | ee.excelReplace(listI, new Object[] { m }, path+"mould/lbStatuAnaly.xls", | 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 | } catch (Exception e) { | 2042 | } catch (Exception e) { |
| 2021 | // TODO: handle exception | 2043 | // TODO: handle exception |
| 2022 | e.printStackTrace(); | 2044 | e.printStackTrace(); |
| @@ -2408,6 +2430,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2408,6 +2430,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2408 | public Map<String, Object> exportWaybillMore(Map<String, Object> map) { | 2430 | public Map<String, Object> exportWaybillMore(Map<String, Object> map) { |
| 2409 | String date = map.get("date").toString(); | 2431 | String date = map.get("date").toString(); |
| 2410 | String line = map.get("line").toString(); | 2432 | String line = map.get("line").toString(); |
| 2433 | + String lineName = map.get("lineName").toString(); | ||
| 2411 | ReportUtils ee = new ReportUtils(); | 2434 | ReportUtils ee = new ReportUtils(); |
| 2412 | List<List> strs = JSON.parseArray(map.get("strs").toString(), List.class); | 2435 | List<List> strs = JSON.parseArray(map.get("strs").toString(), List.class); |
| 2413 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/export/"; | 2436 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/export/"; |
| @@ -2417,7 +2440,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -2417,7 +2440,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 2417 | File file = null; | 2440 | File file = null; |
| 2418 | try { | 2441 | try { |
| 2419 | while (true) { | 2442 | while (true) { |
| 2420 | - String fileUrl = path + "行车路单" + sdfSimple.format(sdfMonth.parse(date)); | 2443 | + String fileUrl = path + sdfSimple.format(sdfMonth.parse(date))+"-"+lineName+"-行车路单"; |
| 2421 | // file = new File(fileUrl + (num == 0 ? "/" : "(" + num + ")/")); //新建文件夹 | 2444 | // file = new File(fileUrl + (num == 0 ? "/" : "(" + num + ")/")); //新建文件夹 |
| 2422 | file = new File(fileUrl + (num == 0 ? ".xls" : "(" + num + ").xls")); //新建excel文件 | 2445 | file = new File(fileUrl + (num == 0 ? ".xls" : "(" + num + ").xls")); //新建excel文件 |
| 2423 | if (file.exists()) { //判断是否已存在重名 | 2446 | if (file.exists()) { //判断是否已存在重名 |
| @@ -3009,19 +3032,28 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -3009,19 +3032,28 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 3009 | } | 3032 | } |
| 3010 | 3033 | ||
| 3011 | if(map.containsKey("type") && map.get("type").toString().equals("export")){ | 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 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 3038 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 3013 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 3039 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 3014 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 3040 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 3015 | Map<String,Object> m = new HashMap<String, Object>(); | 3041 | Map<String,Object> m = new HashMap<String, Object>(); |
| 3016 | ReportUtils ee = new ReportUtils(); | 3042 | ReportUtils ee = new ReportUtils(); |
| 3017 | try { | 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 | listI.add(resList.iterator()); | 3051 | listI.add(resList.iterator()); |
| 3019 | m.put("date1", startDate); | 3052 | m.put("date1", startDate); |
| 3020 | m.put("date2", endDate); | 3053 | m.put("date2", endDate); |
| 3021 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 3054 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 3022 | ee.excelReplace(listI, new Object[] { m }, path+"mould/onTime.xls", | 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 | } catch (Exception e) { | 3057 | } catch (Exception e) { |
| 3026 | // TODO: handle exception | 3058 | // TODO: handle exception |
| 3027 | e.printStackTrace(); | 3059 | e.printStackTrace(); |
| @@ -3058,18 +3090,28 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -3058,18 +3090,28 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 3058 | } | 3090 | } |
| 3059 | 3091 | ||
| 3060 | if(map.containsKey("type") && map.get("type").toString().equals("export")){ | 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 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 3096 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 3062 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 3097 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 3063 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 3098 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 3064 | Map<String,Object> m = new HashMap<String, Object>(); | 3099 | Map<String,Object> m = new HashMap<String, Object>(); |
| 3065 | ReportUtils ee = new ReportUtils(); | 3100 | ReportUtils ee = new ReportUtils(); |
| 3066 | try { | 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 | listI.add(resList.iterator()); | 3109 | listI.add(resList.iterator()); |
| 3068 | m.put("date1", startDate); | 3110 | m.put("date1", startDate); |
| 3069 | m.put("date2", endDate); | 3111 | m.put("date2", endDate); |
| 3070 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 3112 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 3071 | ee.excelReplace(listI, new Object[] { m }, path+"mould/onTime1.xls", | 3113 | ee.excelReplace(listI, new Object[] { m }, path+"mould/onTime1.xls", |
| 3072 | - path+"export/发车到站准点率明细.xls"); | 3114 | + path+"export/"+dateTime+"-"+lineName+"-发车到站准点率明细.xls"); |
| 3073 | } catch (Exception e) { | 3115 | } catch (Exception e) { |
| 3074 | // TODO: handle exception | 3116 | // TODO: handle exception |
| 3075 | e.printStackTrace(); | 3117 | e.printStackTrace(); |
| @@ -3093,18 +3135,29 @@ public class BusIntervalServiceImpl implements BusIntervalService { | @@ -3093,18 +3135,29 @@ public class BusIntervalServiceImpl implements BusIntervalService { | ||
| 3093 | } | 3135 | } |
| 3094 | 3136 | ||
| 3095 | if(map.containsKey("type") && map.get("type").toString().equals("export")){ | 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 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 3141 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 3097 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 3142 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 3098 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 3143 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 3099 | Map<String,Object> m = new HashMap<String, Object>(); | 3144 | Map<String,Object> m = new HashMap<String, Object>(); |
| 3100 | ReportUtils ee = new ReportUtils(); | 3145 | ReportUtils ee = new ReportUtils(); |
| 3101 | try { | 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 | listI.add(resList.iterator()); | 3154 | listI.add(resList.iterator()); |
| 3103 | m.put("date", startDate); | 3155 | m.put("date", startDate); |
| 3104 | m.put("line", line); | 3156 | m.put("line", line); |
| 3105 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 3157 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 3106 | ee.excelReplace(listI, new Object[] { m }, path+"mould/onTime2.xls", | 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 | } catch (Exception e) { | 3161 | } catch (Exception e) { |
| 3109 | // TODO: handle exception | 3162 | // TODO: handle exception |
| 3110 | e.printStackTrace(); | 3163 | e.printStackTrace(); |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -1047,10 +1047,14 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -1047,10 +1047,14 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 1047 | m.put("fyyyhj", fyyyhj); | 1047 | m.put("fyyyhj", fyyyhj); |
| 1048 | ReportUtils ee = new ReportUtils(); | 1048 | ReportUtils ee = new ReportUtils(); |
| 1049 | try { | 1049 | try { |
| 1050 | + String lineName = ""; | ||
| 1051 | + if(map.containsKey("lineName")) | ||
| 1052 | + lineName = map.get("lineName").toString(); | ||
| 1050 | listI.add(mapList.iterator()); | 1053 | listI.add(mapList.iterator()); |
| 1051 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 1054 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 1052 | ee.excelReplace(listI, new Object[] { m }, path+"mould/oilListMonth.xls", | 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 | } catch (Exception e) { | 1058 | } catch (Exception e) { |
| 1055 | // TODO: handle exception | 1059 | // TODO: handle exception |
| 1056 | e.printStackTrace(); | 1060 | e.printStackTrace(); |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -141,7 +141,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -141,7 +141,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 141 | 141 | ||
| 142 | @Autowired | 142 | @Autowired |
| 143 | YlbRepository ylbRepository; | 143 | YlbRepository ylbRepository; |
| 144 | - | 144 | + |
| 145 | @Autowired | 145 | @Autowired |
| 146 | DlbRepository dlbRepository; | 146 | DlbRepository dlbRepository; |
| 147 | 147 | ||
| @@ -156,7 +156,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -156,7 +156,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 156 | 156 | ||
| 157 | @Autowired | 157 | @Autowired |
| 158 | DirectiveService directiveService; | 158 | DirectiveService directiveService; |
| 159 | - | 159 | + |
| 160 | @Autowired | 160 | @Autowired |
| 161 | CarDeviceRepository carDeviceRepository; | 161 | CarDeviceRepository carDeviceRepository; |
| 162 | 162 | ||
| @@ -170,19 +170,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -170,19 +170,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 170 | 170 | ||
| 171 | /** | 171 | /** |
| 172 | * 校验人车 和 班次的公司和分公司归属 | 172 | * 校验人车 和 班次的公司和分公司归属 |
| 173 | + * | ||
| 173 | * @param schId | 174 | * @param schId |
| 174 | * @param jsy | 175 | * @param jsy |
| 175 | * @param spy | 176 | * @param spy |
| 176 | * @param nbbm | 177 | * @param nbbm |
| 177 | - * @return | ||
| 178 | - * -2 跨营运公司,校验不过 | 178 | + * @return -2 跨营运公司,校验不过 |
| 179 | * -1 跨分公司,二次确认 | 179 | * -1 跨分公司,二次确认 |
| 180 | * 1 校验通过 | 180 | * 1 校验通过 |
| 181 | */ | 181 | */ |
| 182 | @Override | 182 | @Override |
| 183 | public Map<String, Object> checkPCFgsAscription(Long schId, String jGh, String sGh, String nbbm) { | 183 | public Map<String, Object> checkPCFgsAscription(Long schId, String jGh, String sGh, String nbbm) { |
| 184 | Map<String, Object> rs = new HashMap<>(); | 184 | Map<String, Object> rs = new HashMap<>(); |
| 185 | - try{ | 185 | + try { |
| 186 | rs.put("status", ResponseCode.SUCCESS); | 186 | rs.put("status", ResponseCode.SUCCESS); |
| 187 | rs.put("checkStatus", -2); | 187 | rs.put("checkStatus", -2); |
| 188 | 188 | ||
| @@ -192,22 +192,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -192,22 +192,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 192 | 192 | ||
| 193 | //校验运营公司 | 193 | //校验运营公司 |
| 194 | Personnel jsy = BasicData.perMap.get(gsbm + "-" + jGh); | 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 | rs.put("msg", msg); | 197 | rs.put("msg", msg); |
| 198 | return rs; | 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 | rs.put("msg", msg); | 202 | rs.put("msg", msg); |
| 203 | return rs; | 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 | Personnel spy = null; | 211 | Personnel spy = null; |
| 207 | - if(StringUtils.isNotEmpty(sGh)){ | 212 | + if (StringUtils.isNotEmpty(sGh)) { |
| 208 | spy = BasicData.perMap.get(gsbm + "-" + sGh); | 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 | rs.put("msg", msg); | 216 | rs.put("msg", msg); |
| 212 | return rs; | 217 | return rs; |
| 213 | } | 218 | } |
| @@ -215,15 +220,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -215,15 +220,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 215 | 220 | ||
| 216 | 221 | ||
| 217 | //校验分公司 | 222 | //校验分公司 |
| 218 | - if(null != jsy && !fgsbm.equals(jsy.getBrancheCompanyCode())){ | 223 | + if (null != jsy && !fgsbm.equals(jsy.getBrancheCompanyCode())) { |
| 219 | msg = ("【驾驶员】:" + jGh + "/" + jsy.getPersonnelName() + "是" + jsy.getBrancheCompany() + "的人员"); | 224 | msg = ("【驾驶员】:" + jGh + "/" + jsy.getPersonnelName() + "是" + jsy.getBrancheCompany() + "的人员"); |
| 220 | rs.put("msg", msg); | 225 | rs.put("msg", msg); |
| 221 | rs.put("checkStatus", -1); | 226 | rs.put("checkStatus", -1); |
| 222 | return rs; | 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 | msg = ("【售票员】: " + jGh + "/" + spy.getPersonnelName() + "是" + spy.getBrancheCompany() + "的人员"); | 232 | msg = ("【售票员】: " + jGh + "/" + spy.getPersonnelName() + "是" + spy.getBrancheCompany() + "的人员"); |
| 228 | rs.put("msg", msg); | 233 | rs.put("msg", msg); |
| 229 | rs.put("checkStatus", -1); | 234 | rs.put("checkStatus", -1); |
| @@ -231,15 +236,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -231,15 +236,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<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 | rs.put("msg", msg); | 244 | rs.put("msg", msg); |
| 237 | rs.put("checkStatus", -1); | 245 | rs.put("checkStatus", -1); |
| 238 | return rs; | 246 | return rs; |
| 239 | } | 247 | } |
| 240 | 248 | ||
| 241 | rs.put("checkStatus", 1); | 249 | rs.put("checkStatus", 1); |
| 242 | - }catch (Exception e){ | 250 | + } catch (Exception e) { |
| 243 | logger.error("", e); | 251 | logger.error("", e); |
| 244 | rs.put("status", ResponseCode.ERROR); | 252 | rs.put("status", ResponseCode.ERROR); |
| 245 | } | 253 | } |
| @@ -249,21 +257,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -249,21 +257,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 249 | 257 | ||
| 250 | /** | 258 | /** |
| 251 | * 车辆是否存在 | 259 | * 车辆是否存在 |
| 260 | + * | ||
| 252 | * @param gsbm 公司编码 | 261 | * @param gsbm 公司编码 |
| 253 | * @param nbbm 车辆自编号 | 262 | * @param nbbm 车辆自编号 |
| 254 | * @return | 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 | * @param gsbm 公司编码 | 272 | * @param gsbm 公司编码 |
| 263 | - * @param gh 人员工号 | 273 | + * @param gh 人员工号 |
| 264 | * @return | 274 | * @return |
| 265 | */ | 275 | */ |
| 266 | - private String getPersonName(String gsbm, String gh){ | 276 | + private String getPersonName(String gsbm, String gh) { |
| 267 | return BasicData.allPerson.get(gsbm + '-' + gh); | 277 | return BasicData.allPerson.get(gsbm + '-' + gh); |
| 268 | } | 278 | } |
| 269 | 279 | ||
| @@ -275,12 +285,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -275,12 +285,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 275 | DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); | 285 | DateTimeFormatter fmtyyyyMMddHHmm = DateTimeFormat.forPattern("yyyy-MM-ddHH:mm"); |
| 276 | //计算时间戳 | 286 | //计算时间戳 |
| 277 | ScheduleRealInfo sch; | 287 | ScheduleRealInfo sch; |
| 278 | - while(iterator.hasNext()){ | 288 | + while (iterator.hasNext()) { |
| 279 | sch = iterator.next(); | 289 | sch = iterator.next(); |
| 280 | //待发时间戳 | 290 | //待发时间戳 |
| 281 | sch.setDfsjT(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getDfsj())); | 291 | sch.setDfsjT(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getDfsj())); |
| 282 | //实发时间戳 | 292 | //实发时间戳 |
| 283 | - if(StringUtils.isNotEmpty(sch.getFcsjActual())){ | 293 | + if (StringUtils.isNotEmpty(sch.getFcsjActual())) { |
| 284 | sch.setFcsjActualTime(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getFcsjActual())); | 294 | sch.setFcsjActualTime(fmtyyyyMMddHHmm.parseMillis(sch.getRealExecDate() + sch.getFcsjActual())); |
| 285 | } | 295 | } |
| 286 | set.add(sch); | 296 | set.add(sch); |
| @@ -314,7 +324,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -314,7 +324,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 314 | 324 | ||
| 315 | ScheduleRealInfo schedule = dayOfSchedule.get(id); | 325 | ScheduleRealInfo schedule = dayOfSchedule.get(id); |
| 316 | 326 | ||
| 317 | - if(schedule.getStatus() > 0){ | 327 | + if (schedule.getStatus() > 0) { |
| 318 | map.put("status", ResponseCode.SUCCESS); | 328 | map.put("status", ResponseCode.SUCCESS); |
| 319 | map.put("flag", "4008"); | 329 | map.put("flag", "4008"); |
| 320 | map.put("t", schedule); | 330 | map.put("t", schedule); |
| @@ -330,11 +340,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -330,11 +340,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<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 | schedule.setDfsjAll(dfsj); | 345 | schedule.setDfsjAll(dfsj); |
| 336 | schedule.setDfAuto(false); | 346 | schedule.setDfAuto(false); |
| 337 | - if("1".equals(opType)) | 347 | + if ("1".equals(opType)) |
| 338 | schedule.setRemarks(remarks); | 348 | schedule.setRemarks(remarks); |
| 339 | 349 | ||
| 340 | List<ScheduleRealInfo> ts = new ArrayList<>(); | 350 | List<ScheduleRealInfo> ts = new ArrayList<>(); |
| @@ -349,9 +359,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -349,9 +359,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 349 | 359 | ||
| 350 | //调整班次类型 | 360 | //调整班次类型 |
| 351 | if (StringUtils.isNotEmpty(bcType) && !bcType.equals(schedule.getBcType())) { | 361 | if (StringUtils.isNotEmpty(bcType) && !bcType.equals(schedule.getBcType())) { |
| 352 | - if((schedule.getBcType().equals("major") | 362 | + if ((schedule.getBcType().equals("major") |
| 353 | || schedule.getBcType().equals("venting")) | 363 | || schedule.getBcType().equals("venting")) |
| 354 | - && bcType.equals("normal")){ | 364 | + && bcType.equals("normal")) { |
| 355 | //清空备注 | 365 | //清空备注 |
| 356 | schedule.setRemarks(""); | 366 | schedule.setRemarks(""); |
| 357 | } | 367 | } |
| @@ -361,8 +371,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -361,8 +371,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 361 | //如果正在执行该班次 | 371 | //如果正在执行该班次 |
| 362 | //ScheduleRealInfo exec = dayOfSchedule.executeCurr(schedule.getClZbh()); | 372 | //ScheduleRealInfo exec = dayOfSchedule.executeCurr(schedule.getClZbh()); |
| 363 | //if(exec != null && exec == schedule){ | 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<ScheduleRealInf | @@ -374,11 +384,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 374 | //} | 384 | //} |
| 375 | 385 | ||
| 376 | try { | 386 | try { |
| 377 | - if(!schedule.getDirectiveState().equals(-1) && schedule.getStatus()==0){ | 387 | + if (!schedule.getDirectiveState().equals(-1) && schedule.getStatus() == 0) { |
| 378 | //重新下发调度指令 | 388 | //重新下发调度指令 |
| 379 | directiveService.send60Dispatch(schedule.getId(), "待发@系统"); | 389 | directiveService.send60Dispatch(schedule.getId(), "待发@系统"); |
| 380 | } | 390 | } |
| 381 | - }catch (Exception e){ | 391 | + } catch (Exception e) { |
| 382 | logger.error("", e); | 392 | logger.error("", e); |
| 383 | } | 393 | } |
| 384 | 394 | ||
| @@ -504,6 +514,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -504,6 +514,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 504 | 514 | ||
| 505 | /** | 515 | /** |
| 506 | * 添加到历史库 | 516 | * 添加到历史库 |
| 517 | + * | ||
| 507 | * @param t | 518 | * @param t |
| 508 | * @return | 519 | * @return |
| 509 | */ | 520 | */ |
| @@ -532,28 +543,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -532,28 +543,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 532 | t.setjGh(t.getjGh().split("-")[1]); | 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 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员"); | 548 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员"); |
| 538 | rs.put("status", ResponseCode.ERROR); | 549 | rs.put("status", ResponseCode.ERROR); |
| 539 | return rs; | 550 | return rs; |
| 540 | - } | ||
| 541 | - else if(StringUtils.isEmpty(t.getjName())){ | 551 | + } else if (StringUtils.isEmpty(t.getjName())) { |
| 542 | t.setjName(jName);//补上驾驶员名称 | 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 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员"); | 559 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员"); |
| 550 | rs.put("status", ResponseCode.ERROR); | 560 | rs.put("status", ResponseCode.ERROR); |
| 551 | return rs; | 561 | return rs; |
| 552 | - }else if(StringUtils.isEmpty(t.getsName())){ | 562 | + } else if (StringUtils.isEmpty(t.getsName())) { |
| 553 | t.setsName(sName);//补上售票员名称 | 563 | t.setsName(sName);//补上售票员名称 |
| 554 | } | 564 | } |
| 555 | - } | ||
| 556 | - else{ | 565 | + } else { |
| 557 | t.setsGh(""); | 566 | t.setsGh(""); |
| 558 | t.setsName(""); | 567 | t.setsName(""); |
| 559 | } | 568 | } |
| @@ -627,28 +636,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -627,28 +636,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 627 | t.setjGh(t.getjGh().split("-")[1]); | 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 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员"); | 641 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的驾驶员"); |
| 633 | rs.put("status", ResponseCode.ERROR); | 642 | rs.put("status", ResponseCode.ERROR); |
| 634 | return rs; | 643 | return rs; |
| 635 | - } | ||
| 636 | - else if(StringUtils.isEmpty(t.getjName())){ | 644 | + } else if (StringUtils.isEmpty(t.getjName())) { |
| 637 | t.setjName(jName);//补上驾驶员名称 | 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 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员"); | 652 | rs.put("msg", t.getXlName() + "所属的公司编码下找不到工号为【" + t.getjGh() + "】的售票员"); |
| 645 | rs.put("status", ResponseCode.ERROR); | 653 | rs.put("status", ResponseCode.ERROR); |
| 646 | return rs; | 654 | return rs; |
| 647 | - }else if(StringUtils.isEmpty(t.getsName())){ | 655 | + } else if (StringUtils.isEmpty(t.getsName())) { |
| 648 | t.setsName(sName);//补上售票员名称 | 656 | t.setsName(sName);//补上售票员名称 |
| 649 | } | 657 | } |
| 650 | - } | ||
| 651 | - else{ | 658 | + } else { |
| 652 | t.setsGh(""); | 659 | t.setsGh(""); |
| 653 | t.setsName(""); | 660 | t.setsName(""); |
| 654 | } | 661 | } |
| @@ -680,7 +687,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -680,7 +687,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 680 | 687 | ||
| 681 | //处理计达跨24点 | 688 | //处理计达跨24点 |
| 682 | LineConfig conf = lineConfigData.get(t.getXlBm()); | 689 | LineConfig conf = lineConfigData.get(t.getXlBm()); |
| 683 | - if(t.getZdsj().compareTo(conf.getStartOpt()) < 0){ | 690 | + if (t.getZdsj().compareTo(conf.getStartOpt()) < 0) { |
| 684 | t.setZdsjT(sdfyyyyMMddHHmm.parse(t.getScheduleDateStr() + t.getZdsj()).getTime() + (1000 * 60 * 60 * 24)); | 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<ScheduleRealInf | @@ -719,6 +726,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 719 | 726 | ||
| 720 | /** | 727 | /** |
| 721 | * 删除历史表临加班次 | 728 | * 删除历史表临加班次 |
| 729 | + * | ||
| 722 | * @param id | 730 | * @param id |
| 723 | * @return | 731 | * @return |
| 724 | */ | 732 | */ |
| @@ -744,7 +752,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -744,7 +752,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 744 | 752 | ||
| 745 | //数据库删除 | 753 | //数据库删除 |
| 746 | rs = super.delete(id); | 754 | rs = super.delete(id); |
| 747 | - }catch (Exception e){ | 755 | + } catch (Exception e) { |
| 748 | logger.error("", e); | 756 | logger.error("", e); |
| 749 | rs.put("msg", e.getMessage()); | 757 | rs.put("msg", e.getMessage()); |
| 750 | } | 758 | } |
| @@ -776,16 +784,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -776,16 +784,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 776 | 784 | ||
| 777 | //数据库删除 | 785 | //数据库删除 |
| 778 | rs = super.delete(id); | 786 | rs = super.delete(id); |
| 779 | - if(rs.get("status").equals(ResponseCode.SUCCESS)){ | 787 | + if (rs.get("status").equals(ResponseCode.SUCCESS)) { |
| 780 | dayOfSchedule.delete(sch); | 788 | dayOfSchedule.delete(sch); |
| 781 | //更新起点应到时间 | 789 | //更新起点应到时间 |
| 782 | List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch); | 790 | List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch); |
| 783 | rs.put("ts", ts); | 791 | rs.put("ts", ts); |
| 784 | rs.put("delete", sch); | 792 | rs.put("delete", sch); |
| 785 | - } | ||
| 786 | - else | 793 | + } else |
| 787 | sch.setDeleted(false); | 794 | sch.setDeleted(false); |
| 788 | - }catch (Exception e){ | 795 | + } catch (Exception e) { |
| 789 | logger.error("", e); | 796 | logger.error("", e); |
| 790 | rs.put("msg", e.getMessage()); | 797 | rs.put("msg", e.getMessage()); |
| 791 | sch.setDeleted(false); | 798 | sch.setDeleted(false); |
| @@ -866,28 +873,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -866,28 +873,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 866 | state = state + "+1"; | 873 | state = state + "+1"; |
| 867 | type = "ASC"; | 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 | List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan, | 898 | List<ScheduleRealInfo> list = jdbcTemplate.query(sqlPlan, |
| 892 | new RowMapper<ScheduleRealInfo>() { | 899 | new RowMapper<ScheduleRealInfo>() { |
| 893 | @Override | 900 | @Override |
| @@ -955,78 +962,79 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -955,78 +962,79 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 955 | List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); | 962 | List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); |
| 956 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); | 963 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); |
| 957 | // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); | 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 | for (int i = 0; i < scheduleRealInfos.size(); i++) { | 966 | for (int i = 0; i < scheduleRealInfos.size(); i++) { |
| 960 | - ScheduleRealInfo s=scheduleRealInfos.get(i); | 967 | + ScheduleRealInfo s = scheduleRealInfos.get(i); |
| 961 | Set<ChildTaskPlan> cts = s.getcTasks(); | 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 | DecimalFormat format = new DecimalFormat("0.00"); | 977 | DecimalFormat format = new DecimalFormat("0.00"); |
| 971 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | 978 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 972 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | 979 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); |
| 973 | //计算里程和班次数,并放入Map里 | 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 | map.put("addMileage", culateMieageService.culateLjgl(lists)); | 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 | map.put("yygl", yygl); | 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 | map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos)); | 992 | map.put("cjbc", culateMieageService.culateLbbc(scheduleRealInfos)); |
| 986 | map.put("ljbc", culateMieageService.culateLjbc(lists, "")); | 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 | map.put("sjbc", sjbc); | 995 | map.put("sjbc", sjbc); |
| 989 | // map=new HashMap<String,Object>(); | 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 | for (int i = 0; i < scheduleRealInfos.size(); i++) { | 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 | calendar.setTime(s.getScheduleDate()); | 1020 | calendar.setTime(s.getScheduleDate()); |
| 1014 | - calendar.add(calendar.DATE,1); | 1021 | + calendar.add(calendar.DATE, 1); |
| 1015 | s.setScheduleDate(calendar.getTime()); | 1022 | s.setScheduleDate(calendar.getTime()); |
| 1016 | try { | 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 | } catch (ParseException e) { | 1025 | } catch (ParseException e) { |
| 1019 | // TODO Auto-generated catch block | 1026 | // TODO Auto-generated catch block |
| 1020 | e.printStackTrace(); | 1027 | e.printStackTrace(); |
| 1021 | } | 1028 | } |
| 1022 | 1029 | ||
| 1023 | - }else{ | 1030 | + } else { |
| 1024 | try { | 1031 | try { |
| 1025 | - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime(); | 1032 | + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime(); |
| 1026 | } catch (ParseException e) { | 1033 | } catch (ParseException e) { |
| 1027 | // TODO Auto-generated catch block | 1034 | // TODO Auto-generated catch block |
| 1028 | e.printStackTrace(); | 1035 | e.printStackTrace(); |
| 1029 | - }; | 1036 | + } |
| 1037 | + ; | ||
| 1030 | } | 1038 | } |
| 1031 | s.setFcsjT(fscjT); | 1039 | s.setFcsjT(fscjT); |
| 1032 | } | 1040 | } |
| @@ -1059,7 +1067,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1059,7 +1067,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1059 | //计算营运里程,空驶里程 | 1067 | //计算营运里程,空驶里程 |
| 1060 | if (!childTaskPlans.isEmpty()) { | 1068 | if (!childTaskPlans.isEmpty()) { |
| 1061 | // Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | 1069 | // Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| 1062 | - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans); | 1070 | + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans); |
| 1063 | Collections.sort(listit, new ComparableChild()); | 1071 | Collections.sort(listit, new ComparableChild()); |
| 1064 | for (int j = 0; j < listit.size(); j++) { | 1072 | for (int j = 0; j < listit.size(); j++) { |
| 1065 | ScheduleRealInfo t = new ScheduleRealInfo(); | 1073 | ScheduleRealInfo t = new ScheduleRealInfo(); |
| @@ -1096,27 +1104,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1096,27 +1104,27 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1096 | String zdsj = scheduleRealInfo.getZdsj(); | 1104 | String zdsj = scheduleRealInfo.getZdsj(); |
| 1097 | String zdsjActual = scheduleRealInfo.getZdsjActual(); | 1105 | String zdsjActual = scheduleRealInfo.getZdsjActual(); |
| 1098 | if (zdsj != null && zdsjActual != null && | 1106 | if (zdsj != null && zdsjActual != null && |
| 1099 | - !zdsj.equals(zdsjActual) && | ||
| 1100 | - !zdsj.equals("")&& | 1107 | + !zdsj.equals(zdsjActual) && |
| 1108 | + !zdsj.equals("") && | ||
| 1101 | !zdsjActual.equals("")) { | 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 | if (zdsj.compareTo(zdsjActual) > 0) { | 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 | } else { | 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 | } else { | 1129 | } else { |
| 1122 | maps.put("fast", ""); | 1130 | maps.put("fast", ""); |
| @@ -1128,18 +1136,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1128,18 +1136,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<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 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 1147 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 1140 | 1148 | ||
| 1141 | list.add(listMap.iterator()); | 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 | path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); | 1151 | path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); |
| 1144 | return scheduleRealInfos; | 1152 | return scheduleRealInfos; |
| 1145 | } | 1153 | } |
| @@ -1189,7 +1197,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1189,7 +1197,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1189 | @Override | 1197 | @Override |
| 1190 | public List<Object[]> historyMessage(String line, String date, String code, String type) { | 1198 | public List<Object[]> historyMessage(String line, String date, String code, String type) { |
| 1191 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 1199 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 1192 | - | 1200 | + |
| 1193 | long d = 0; | 1201 | long d = 0; |
| 1194 | long t = 0; | 1202 | long t = 0; |
| 1195 | if (date.length() > 0) { | 1203 | if (date.length() > 0) { |
| @@ -1202,36 +1210,37 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1202,36 +1210,37 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<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 | List<Object[]> list = scheduleRealInfoRepository.historyMessage(line, d, t, device); | 1217 | List<Object[]> list = scheduleRealInfoRepository.historyMessage(line, d, t, device); |
| 1210 | for (Object[] obj : list) { | 1218 | for (Object[] obj : list) { |
| 1211 | if (obj != null) { | 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 | obj[3] = sdf.format(new Date(Long.parseLong(obj[3].toString()))); | 1237 | obj[3] = sdf.format(new Date(Long.parseLong(obj[3].toString()))); |
| 1230 | obj[4] = BasicData.lineCode2NameMap.get(line); | 1238 | obj[4] = BasicData.lineCode2NameMap.get(line); |
| 1231 | } | 1239 | } |
| 1232 | } | 1240 | } |
| 1233 | 1241 | ||
| 1234 | if (type != null && type.length() != 0 && type.equals("export")) { | 1242 | if (type != null && type.length() != 0 && type.equals("export")) { |
| 1243 | + String lineName = BasicData.lineCode2NameMap.get(line); | ||
| 1235 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 1244 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 1236 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 1245 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 1237 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 1246 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -1253,7 +1262,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1253,7 +1262,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1253 | listI.add(newList.iterator()); | 1262 | listI.add(newList.iterator()); |
| 1254 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 1263 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 1255 | ee.excelReplace(listI, new Object[]{m}, path + "mould/historyMessage.xls", | 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 | } catch (Exception e) { | 1267 | } catch (Exception e) { |
| 1258 | // TODO: handle exception | 1268 | // TODO: handle exception |
| 1259 | e.printStackTrace(); | 1269 | e.printStackTrace(); |
| @@ -1321,8 +1331,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1321,8 +1331,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1321 | sch.setRemarks(remarks); | 1331 | sch.setRemarks(remarks); |
| 1322 | sch.calcStatus(); | 1332 | sch.calcStatus(); |
| 1323 | //if(sch.isLate2()){ | 1333 | //if(sch.isLate2()){ |
| 1324 | - //取消应发未到标记 | ||
| 1325 | - // sch.setLate2(false); | 1334 | + //取消应发未到标记 |
| 1335 | + // sch.setLate2(false); | ||
| 1326 | LateAdjustHandle.remove(sch); | 1336 | LateAdjustHandle.remove(sch); |
| 1327 | //} | 1337 | //} |
| 1328 | 1338 | ||
| @@ -1435,7 +1445,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1435,7 +1445,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1435 | //调整待发 | 1445 | //调整待发 |
| 1436 | tempRs = outgoAdjust(sch.getId(), null, fmtHHmm.print(st), null, "3", null); | 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 | tempTs = (List<ScheduleRealInfo>) tempRs.get("ts"); | 1449 | tempTs = (List<ScheduleRealInfo>) tempRs.get("ts"); |
| 1440 | 1450 | ||
| 1441 | ts.addAll(tempTs); | 1451 | ts.addAll(tempTs); |
| @@ -1465,7 +1475,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1465,7 +1475,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1465 | 1475 | ||
| 1466 | ScheduleRealInfo sch = dayOfSchedule.get(id); | 1476 | ScheduleRealInfo sch = dayOfSchedule.get(id); |
| 1467 | 1477 | ||
| 1468 | - if(null == sch){ | 1478 | + if (null == sch) { |
| 1469 | rs.put("status", ResponseCode.ERROR); | 1479 | rs.put("status", ResponseCode.ERROR); |
| 1470 | rs.put("msg", "不存在的班次!"); | 1480 | rs.put("msg", "不存在的班次!"); |
| 1471 | return rs; | 1481 | return rs; |
| @@ -1476,19 +1486,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1476,19 +1486,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1476 | 1486 | ||
| 1477 | String clZbh = map.get("clZbh"); | 1487 | String clZbh = map.get("clZbh"); |
| 1478 | String jsy = map.get("jsy"); | 1488 | String jsy = map.get("jsy"); |
| 1479 | - if(!clZbh.equals(sch.getClZbh()) | 1489 | + if (!clZbh.equals(sch.getClZbh()) |
| 1480 | || !jsy.equals(sch.getjGh() + "/" + sch.getjName())) | 1490 | || !jsy.equals(sch.getjGh() + "/" + sch.getjName())) |
| 1481 | schModifyLog.saveChangetochange(sch, clZbh, jsy);//为换人换车情况表写入数据 | 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 | if (!carExist(sch.getGsBm(), clZbh)) { | 1497 | if (!carExist(sch.getGsBm(), clZbh)) { |
| 1488 | rs.put("status", ResponseCode.ERROR); | 1498 | rs.put("status", ResponseCode.ERROR); |
| 1489 | rs.put("msg", "车辆 " + clZbh + " 不存在!"); | 1499 | rs.put("msg", "车辆 " + clZbh + " 不存在!"); |
| 1490 | return rs; | 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 | fLog.log("换车", sch.getClZbh(), clZbh); | 1506 | fLog.log("换车", sch.getClZbh(), clZbh); |
| 1493 | dayOfSchedule.changeCar(sch, clZbh); | 1507 | dayOfSchedule.changeCar(sch, clZbh); |
| 1494 | } | 1508 | } |
| @@ -1500,12 +1514,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1500,12 +1514,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1500 | if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) { | 1514 | if (StringUtils.isNotEmpty(jsy) && jsy.indexOf("/") != -1) { |
| 1501 | String jGh = jsy.split("/")[0]; | 1515 | String jGh = jsy.split("/")[0]; |
| 1502 | String jName = getPersonName(sch.getGsBm(), jGh); | 1516 | String jName = getPersonName(sch.getGsBm(), jGh); |
| 1503 | - if(StringUtils.isEmpty(jName)){ | 1517 | + if (StringUtils.isEmpty(jName)) { |
| 1504 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员"); | 1518 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员"); |
| 1505 | rs.put("status", ResponseCode.ERROR); | 1519 | rs.put("status", ResponseCode.ERROR); |
| 1506 | return rs; | 1520 | return rs; |
| 1507 | - } | ||
| 1508 | - else if(!jGh.equals(sch.getjGh())){ | 1521 | + } else if (!jGh.equals(sch.getjGh())) { |
| 1509 | fLog.log("换驾驶员", sch.getjGh() + "/" + sch.getjName(), jsy); | 1522 | fLog.log("换驾驶员", sch.getjGh() + "/" + sch.getjName(), jsy); |
| 1510 | persoChange(sch, jGh); | 1523 | persoChange(sch, jGh); |
| 1511 | } | 1524 | } |
| @@ -1518,17 +1531,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1518,17 +1531,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1518 | if (StringUtils.isNotEmpty(spy) && spy.indexOf("/") != -1 && !spy.equals("/")) { | 1531 | if (StringUtils.isNotEmpty(spy) && spy.indexOf("/") != -1 && !spy.equals("/")) { |
| 1519 | String sGh = spy.split("/")[0]; | 1532 | String sGh = spy.split("/")[0]; |
| 1520 | String sName = getPersonName(sch.getGsBm(), sGh); | 1533 | String sName = getPersonName(sch.getGsBm(), sGh); |
| 1521 | - if(StringUtils.isEmpty(sName)){ | 1534 | + if (StringUtils.isEmpty(sName)) { |
| 1522 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sGh + "】的售票员"); | 1535 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sGh + "】的售票员"); |
| 1523 | rs.put("status", ResponseCode.ERROR); | 1536 | rs.put("status", ResponseCode.ERROR); |
| 1524 | return rs; | 1537 | return rs; |
| 1525 | - } | ||
| 1526 | - else if(!sGh.equals(sch.getsGh())){ | 1538 | + } else if (!sGh.equals(sch.getsGh())) { |
| 1527 | fLog.log("换售票员", sch.getsGh() + "/" + sch.getsName(), spy); | 1539 | fLog.log("换售票员", sch.getsGh() + "/" + sch.getsName(), spy); |
| 1528 | persoChangeSPY(sch, sGh); | 1540 | persoChangeSPY(sch, sGh); |
| 1529 | } | 1541 | } |
| 1530 | - } | ||
| 1531 | - else if(StringUtils.isNotEmpty(sch.getsGh())){ | 1542 | + } else if (StringUtils.isNotEmpty(sch.getsGh())) { |
| 1532 | fLog.log("撤销售票员"); | 1543 | fLog.log("撤销售票员"); |
| 1533 | sch.setsGh(""); | 1544 | sch.setsGh(""); |
| 1534 | sch.setsName(""); | 1545 | sch.setsName(""); |
| @@ -1555,9 +1566,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1555,9 +1566,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1555 | //取消应发未到标记 | 1566 | //取消应发未到标记 |
| 1556 | //if(sch.isLate2()){ | 1567 | //if(sch.isLate2()){ |
| 1557 | // sch.setLate2(false); | 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 | fLog.log("撤销实发时间", sch.getFcsjActual(), ""); | 1572 | fLog.log("撤销实发时间", sch.getFcsjActual(), ""); |
| 1562 | //撤销实发 | 1573 | //撤销实发 |
| 1563 | revokeRealOutgo(sch.getId()); | 1574 | revokeRealOutgo(sch.getId()); |
| @@ -1587,7 +1598,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1587,7 +1598,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1587 | dayOfSchedule.reCalcExecPlan(sch.getClZbh()); | 1598 | dayOfSchedule.reCalcExecPlan(sch.getClZbh()); |
| 1588 | //取消应发未到标记 | 1599 | //取消应发未到标记 |
| 1589 | LateAdjustHandle.remove(sch); | 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 | fLog.log("撤销实达时间", sch.getZdsjActual(), ""); | 1603 | fLog.log("撤销实达时间", sch.getZdsjActual(), ""); |
| 1593 | sch.clearZdsjActual(); | 1604 | sch.clearZdsjActual(); |
| @@ -1622,15 +1633,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1622,15 +1633,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1622 | if (StringUtils.isNotEmpty(jhlc)) { | 1633 | if (StringUtils.isNotEmpty(jhlc)) { |
| 1623 | double jhlcNum = Double.parseDouble(jhlc); | 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 | destroy(sch.getId() + "", "", map.get("adjustExps").toString(), null); | 1637 | destroy(sch.getId() + "", "", map.get("adjustExps").toString(), null); |
| 1627 | fLog.log("里程设置为0,自动烂班"); | 1638 | fLog.log("里程设置为0,自动烂班"); |
| 1628 | - } | ||
| 1629 | - else if(jhlcNum != sch.getJhlc()){ | 1639 | + } else if (jhlcNum != sch.getJhlc()) { |
| 1630 | fLog.log("设置里程", sch.getJhlc(), jhlcNum); | 1640 | fLog.log("设置里程", sch.getJhlc(), jhlcNum); |
| 1631 | sch.setJhlc(jhlcNum); | 1641 | sch.setJhlc(jhlcNum); |
| 1632 | //临加班次,实际计划一起改 | 1642 | //临加班次,实际计划一起改 |
| 1633 | - if(sch.isSflj()) | 1643 | + if (sch.isSflj()) |
| 1634 | sch.setJhlcOrig(jhlcNum); | 1644 | sch.setJhlcOrig(jhlcNum); |
| 1635 | } | 1645 | } |
| 1636 | } | 1646 | } |
| @@ -1678,7 +1688,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1678,7 +1688,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1678 | id = jsonObj.getLong("id"); | 1688 | id = jsonObj.getLong("id"); |
| 1679 | schedule = dayOfSchedule.get(id); | 1689 | schedule = dayOfSchedule.get(id); |
| 1680 | 1690 | ||
| 1681 | - if(schedule != null) | 1691 | + if (schedule != null) |
| 1682 | outgoAdjust(id, null, dfsj, null, "2", null); | 1692 | outgoAdjust(id, null, dfsj, null, "2", null); |
| 1683 | } | 1693 | } |
| 1684 | 1694 | ||
| @@ -1796,7 +1806,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1796,7 +1806,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1796 | 1806 | ||
| 1797 | @Override | 1807 | @Override |
| 1798 | public Map<String, Object> findKMBC2(String jName, String clZbh, String date) { | 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 | DecimalFormat format = new DecimalFormat("0.00"); | 1811 | DecimalFormat format = new DecimalFormat("0.00"); |
| 1802 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | 1812 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| @@ -1865,47 +1875,47 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1865,47 +1875,47 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1865 | public Map<String, Object> findKMBC(String jGh, String clZbh, | 1875 | public Map<String, Object> findKMBC(String jGh, String clZbh, |
| 1866 | String lpName, String date, String line) { | 1876 | String lpName, String date, String line) { |
| 1867 | Map<String, Object> map = new HashMap<String, Object>(); | 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 | for (int i = 0; i < list.size(); i++) { | 1880 | for (int i = 0; i < list.size(); i++) { |
| 1871 | - ScheduleRealInfo s=list.get(i); | 1881 | + ScheduleRealInfo s = list.get(i); |
| 1872 | Set<ChildTaskPlan> cts = s.getcTasks(); | 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 | map.put("jhlc", Arith.add(culateService.culateJhgl(list), | 1892 | map.put("jhlc", Arith.add(culateService.culateJhgl(list), |
| 1883 | - culateService.culateJhJccgl(list))); //计划总里程 | 1893 | + culateService.culateJhJccgl(list))); //计划总里程 |
| 1884 | map.put("cjbc", culateService.culateLbbc(list));//烂班班次 | 1894 | map.put("cjbc", culateService.culateLbbc(list));//烂班班次 |
| 1885 | map.put("remMileage", culateService.culateLbgl(list)); //烂班公里 | 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 | map.put("addMileage", ljgl); //临加公里 | 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 | map.put("ksgl", ksgl);//空驶公里 | 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 | map.put("jcclc", jccgl); | 1906 | map.put("jcclc", jccgl); |
| 1897 | - map.put("yygl",Arith.add(sjgl,ljgl)); //总营运公里 | 1907 | + map.put("yygl", Arith.add(sjgl, ljgl)); //总营运公里 |
| 1898 | return map; | 1908 | return map; |
| 1899 | } | 1909 | } |
| 1900 | 1910 | ||
| 1901 | public Map<String, Object> findKMBC_mh_2(String jGh, String clZbh, | 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 | Map<String, Object> map = new HashMap<String, Object>(); | 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 | for (int i = 0; i < list.size(); i++) { | 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 | s.setRemark(""); | 1919 | s.setRemark(""); |
| 1910 | s.setFcsjActual(s.getDfsj()); | 1920 | s.setFcsjActual(s.getDfsj()); |
| 1911 | s.setZdsjActual(s.getZdsj()); | 1921 | s.setZdsjActual(s.getZdsj()); |
| @@ -1914,32 +1924,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1914,32 +1924,32 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1914 | } | 1924 | } |
| 1915 | 1925 | ||
| 1916 | Set<ChildTaskPlan> cts = s.getcTasks(); | 1926 | Set<ChildTaskPlan> cts = s.getcTasks(); |
| 1917 | - if(cts != null && cts.size() > 0){ | 1927 | + if (cts != null && cts.size() > 0) { |
| 1918 | lists.add(s); | 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 | lists.add(s); | 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 | map.put("remMileage", culateService.culateLbgl(list)); //烂班公里 | 1941 | map.put("remMileage", culateService.culateLbgl(list)); //烂班公里 |
| 1932 | map.put("addMileage", ljgl); //临加公里 | 1942 | map.put("addMileage", ljgl); //临加公里 |
| 1933 | - map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里 | 1943 | + map.put("yygl", Arith.add(sjgl, ljgl)); //实际公里 |
| 1934 | map.put("ksgl", ksgl);//空驶公里 | 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 | // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage)); | 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 | map.put("cjbc", culateService.culateLbbc(list)); | 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 | map.put("jcclc", jccgl); | 1951 | map.put("jcclc", jccgl); |
| 1942 | - map.put("zkslc", Arith.add(ksgl,jccgl)); | 1952 | + map.put("zkslc", Arith.add(ksgl, jccgl)); |
| 1943 | // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc)); | 1953 | // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc)); |
| 1944 | return map; | 1954 | return map; |
| 1945 | } | 1955 | } |
| @@ -1947,86 +1957,87 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1947,86 +1957,87 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1947 | 1957 | ||
| 1948 | @Override | 1958 | @Override |
| 1949 | public List<Map<String, Object>> accountPx(String line, String date, | 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 | // List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px); | 1961 | // List<Object[]> lsitObj = scheduleRealInfoRepository.accountPx(line, date, code,px); |
| 1952 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 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 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); | 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 | Map<String, Object> map; | 1977 | Map<String, Object> map; |
| 1968 | List<Object[]> lsitObj = jdbcTemplate.query(sql, | 1978 | List<Object[]> lsitObj = jdbcTemplate.query(sql, |
| 1969 | new RowMapper<Object[]>() { | 1979 | new RowMapper<Object[]>() { |
| 1970 | @Override | 1980 | @Override |
| 1971 | public Object[] mapRow(ResultSet rs, int rowNum) throws SQLException { | 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 | return t; | 1986 | return t; |
| 1977 | } | 1987 | } |
| 1978 | }); | 1988 | }); |
| 1979 | int i = 1; | 1989 | int i = 1; |
| 1980 | for (Object[] obj : lsitObj) { | 1990 | for (Object[] obj : lsitObj) { |
| 1981 | if (obj != null) { | 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 | return listMap; | 2026 | return listMap; |
| 2017 | } | 2027 | } |
| 2028 | + | ||
| 2018 | @Override | 2029 | @Override |
| 2019 | public List<Map<String, Object>> account(String line, String date, | 2030 | public List<Map<String, Object>> account(String line, String date, |
| 2020 | String code, String xlName, String type) { | 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 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 2041 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 2031 | List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code); | 2042 | List<Object[]> lsitObj = scheduleRealInfoRepository.account(line, date, code); |
| 2032 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); | 2043 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); |
| @@ -2037,25 +2048,25 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2037,25 +2048,25 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2037 | map = new HashMap<String, Object>(); | 2048 | map = new HashMap<String, Object>(); |
| 2038 | map.put("num", i++); | 2049 | map.put("num", i++); |
| 2039 | map.put("xlName", xlName); | 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 | map.put("clZbh", carDeviceList.get(0).getClZbh()); | 2060 | map.put("clZbh", carDeviceList.get(0).getClZbh()); |
| 2050 | 2061 | ||
| 2051 | - }else{ | 2062 | + } else { |
| 2052 | map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2])); | 2063 | map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2])); |
| 2053 | - } | ||
| 2054 | - }else{ | 2064 | + } |
| 2065 | + } else { | ||
| 2055 | map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2])); | 2066 | map.put("clZbh", BasicData.deviceId2NbbmMap.get(obj[2])); |
| 2056 | 2067 | ||
| 2057 | - } | ||
| 2058 | - map.put("company",fgs); | 2068 | + } |
| 2069 | + map.put("company", fgs); | ||
| 2059 | map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase()); | 2070 | map.put("requestType", "0x" + Integer.toHexString(Integer.parseInt(obj[0] + "")).toUpperCase()); |
| 2060 | map.put("requestTime", obj[1]); | 2071 | map.put("requestTime", obj[1]); |
| 2061 | listMap.add(map); | 2072 | listMap.add(map); |
| @@ -2086,7 +2097,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2086,7 +2097,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2086 | listI.add(listMap.iterator()); | 2097 | listI.add(listMap.iterator()); |
| 2087 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 2098 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 2088 | ee.excelReplace(listI, new Object[]{m}, path + "mould/account.xls", | 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 | } catch (Exception e) { | 2102 | } catch (Exception e) { |
| 2091 | // TODO: handle exception | 2103 | // TODO: handle exception |
| 2092 | e.printStackTrace(); | 2104 | e.printStackTrace(); |
| @@ -2095,189 +2107,193 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2095,189 +2107,193 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2095 | 2107 | ||
| 2096 | return listMap; | 2108 | return listMap; |
| 2097 | } | 2109 | } |
| 2098 | - | 2110 | + |
| 2099 | @Override | 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 | // var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班', | 2115 | // var types = {'DFTZ': '待发调整', 'FCXXWT':'发车信息微调', 'JHLB': '计划烂班', 'CXLB': '撤销烂班', |
| 2104 | // 'CXZX': '撤销执行', 'CXSF': '撤销实发', 'SFTZ': '实发调整', 'TZRC': '调整人车'}; | 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 | // Map<String, Object> maps = tempList.get(tempList.size() - 1); | 2240 | // Map<String, Object> maps = tempList.get(tempList.size() - 1); |
| 2227 | - } | 2241 | + } |
| 2228 | return lists; | 2242 | return lists; |
| 2229 | } | 2243 | } |
| 2244 | + | ||
| 2230 | @Override | 2245 | @Override |
| 2231 | public List<ScheduleRealInfo> queryListWaybill(String jName, String clZbh, | 2246 | public List<ScheduleRealInfo> queryListWaybill(String jName, String clZbh, |
| 2232 | String lpName, String date, String line) { | 2247 | String lpName, String date, String line) { |
| 2233 | List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>(); | 2248 | List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>(); |
| 2234 | List<ScheduleRealInfo> list = null; | 2249 | List<ScheduleRealInfo> list = null; |
| 2235 | list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); | 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 | for (int i = 0; i < list.size(); i++) { | 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 | calendar.setTime(s.getScheduleDate()); | 2279 | calendar.setTime(s.getScheduleDate()); |
| 2265 | - calendar.add(calendar.DATE,1); | 2280 | + calendar.add(calendar.DATE, 1); |
| 2266 | s.setScheduleDate(calendar.getTime()); | 2281 | s.setScheduleDate(calendar.getTime()); |
| 2267 | try { | 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 | } catch (ParseException e) { | 2284 | } catch (ParseException e) { |
| 2270 | // TODO Auto-generated catch block | 2285 | // TODO Auto-generated catch block |
| 2271 | e.printStackTrace(); | 2286 | e.printStackTrace(); |
| 2272 | } | 2287 | } |
| 2273 | 2288 | ||
| 2274 | - }else{ | 2289 | + } else { |
| 2275 | try { | 2290 | try { |
| 2276 | - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime(); | 2291 | + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime(); |
| 2277 | } catch (ParseException e) { | 2292 | } catch (ParseException e) { |
| 2278 | // TODO Auto-generated catch block | 2293 | // TODO Auto-generated catch block |
| 2279 | e.printStackTrace(); | 2294 | e.printStackTrace(); |
| 2280 | - }; | 2295 | + } |
| 2296 | + ; | ||
| 2281 | } | 2297 | } |
| 2282 | s.setFcsjT(fscjT); | 2298 | s.setFcsjT(fscjT); |
| 2283 | } | 2299 | } |
| @@ -2309,28 +2325,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2309,28 +2325,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2309 | //计算营运里程,空驶里程 | 2325 | //计算营运里程,空驶里程 |
| 2310 | if (!childTaskPlans.isEmpty()) { | 2326 | if (!childTaskPlans.isEmpty()) { |
| 2311 | // Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | 2327 | // Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| 2312 | - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans); | 2328 | + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans); |
| 2313 | Collections.sort(listit, new ComparableChild()); | 2329 | Collections.sort(listit, new ComparableChild()); |
| 2314 | for (int j = 0; j < listit.size(); j++) { | 2330 | for (int j = 0; j < listit.size(); j++) { |
| 2315 | ScheduleRealInfo t = new ScheduleRealInfo(); | 2331 | ScheduleRealInfo t = new ScheduleRealInfo(); |
| 2316 | ChildTaskPlan childTaskPlan = listit.get(j); | 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<ScheduleRealInf | @@ -2341,48 +2357,49 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2341 | 2357 | ||
| 2342 | @Override | 2358 | @Override |
| 2343 | public List<ScheduleRealInfo> queryListWaybill2(String jName, String clZbh, | 2359 | public List<ScheduleRealInfo> queryListWaybill2(String jName, String clZbh, |
| 2344 | - String lpName, String date, String line) { | 2360 | + String lpName, String date, String line) { |
| 2345 | List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>(); | 2361 | List<ScheduleRealInfo> listSchedule = new ArrayList<ScheduleRealInfo>(); |
| 2346 | List<ScheduleRealInfo> list = null; | 2362 | List<ScheduleRealInfo> list = null; |
| 2347 | list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); | 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 | String[] minSjs = minfcsj.split(":"); | 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 | for (int i = 0; i < list.size(); i++) { | 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 | calendar.setTime(s.getScheduleDate()); | 2385 | calendar.setTime(s.getScheduleDate()); |
| 2370 | - calendar.add(calendar.DATE,1); | 2386 | + calendar.add(calendar.DATE, 1); |
| 2371 | s.setScheduleDate(calendar.getTime()); | 2387 | s.setScheduleDate(calendar.getTime()); |
| 2372 | try { | 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 | } catch (ParseException e) { | 2390 | } catch (ParseException e) { |
| 2375 | // TODO Auto-generated catch block | 2391 | // TODO Auto-generated catch block |
| 2376 | e.printStackTrace(); | 2392 | e.printStackTrace(); |
| 2377 | } | 2393 | } |
| 2378 | 2394 | ||
| 2379 | - }else{ | 2395 | + } else { |
| 2380 | try { | 2396 | try { |
| 2381 | - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime(); | 2397 | + fscjT = sdf.parse(s.getScheduleDateStr() + " " + s.getFcsj()).getTime(); |
| 2382 | } catch (ParseException e) { | 2398 | } catch (ParseException e) { |
| 2383 | // TODO Auto-generated catch block | 2399 | // TODO Auto-generated catch block |
| 2384 | e.printStackTrace(); | 2400 | e.printStackTrace(); |
| 2385 | - }; | 2401 | + } |
| 2402 | + ; | ||
| 2386 | } | 2403 | } |
| 2387 | s.setFcsjT(fscjT); | 2404 | s.setFcsjT(fscjT); |
| 2388 | } | 2405 | } |
| @@ -2403,14 +2420,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2403,14 +2420,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2403 | } | 2420 | } |
| 2404 | 2421 | ||
| 2405 | if (s.isDestroy()) { | 2422 | if (s.isDestroy()) { |
| 2406 | - if(s.isReissue()){ | 2423 | + if (s.isReissue()) { |
| 2407 | s.setFcsjActual(s.getDfsj()); | 2424 | s.setFcsjActual(s.getDfsj()); |
| 2408 | s.setZdsjActual(s.getZdsj()); | 2425 | s.setZdsjActual(s.getZdsj()); |
| 2409 | s.setRemarks(""); | 2426 | s.setRemarks(""); |
| 2410 | s.setStatus(2); | 2427 | s.setStatus(2); |
| 2411 | s.setJhlc(s.getJhlcOrig()); | 2428 | s.setJhlc(s.getJhlcOrig()); |
| 2412 | - } | ||
| 2413 | - else{ | 2429 | + } else { |
| 2414 | s.setFcsjActual(""); | 2430 | s.setFcsjActual(""); |
| 2415 | s.setZdsjActual(""); | 2431 | s.setZdsjActual(""); |
| 2416 | s.setJhlc(0.0); | 2432 | s.setJhlc(0.0); |
| @@ -2423,7 +2439,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2423,7 +2439,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2423 | //计算营运里程,空驶里程 | 2439 | //计算营运里程,空驶里程 |
| 2424 | if (!childTaskPlans.isEmpty()) { | 2440 | if (!childTaskPlans.isEmpty()) { |
| 2425 | // Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | 2441 | // Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); |
| 2426 | - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans); | 2442 | + List<ChildTaskPlan> listit = new ArrayList<ChildTaskPlan>(childTaskPlans); |
| 2427 | Collections.sort(listit, new ComparableChild()); | 2443 | Collections.sort(listit, new ComparableChild()); |
| 2428 | for (int j = 0; j < listit.size(); j++) { | 2444 | for (int j = 0; j < listit.size(); j++) { |
| 2429 | ScheduleRealInfo t = new ScheduleRealInfo(); | 2445 | ScheduleRealInfo t = new ScheduleRealInfo(); |
| @@ -2466,29 +2482,30 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2466,29 +2482,30 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2466 | } | 2482 | } |
| 2467 | return rs; | 2483 | return rs; |
| 2468 | } | 2484 | } |
| 2485 | + | ||
| 2469 | @Override | 2486 | @Override |
| 2470 | public List<Map<String, Object>> statisticsDaily(String line, String date, | 2487 | public List<Map<String, Object>> statisticsDaily(String line, String date, |
| 2471 | String xlName, String type) { | 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 | for (int i = 0; i < list_s.size(); i++) { | 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 | Set<ChildTaskPlan> cts = s.getcTasks(); | 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 | Map<String, Object> map = new HashMap<String, Object>(); | 2503 | Map<String, Object> map = new HashMap<String, Object>(); |
| 2487 | map.put("xlName", xlName); | 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 | map.put("ssgl", lbgl); | 2509 | map.put("ssgl", lbgl); |
| 2493 | map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻")); | 2510 | map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻")); |
| 2494 | map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢")); | 2511 | map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢")); |
| @@ -2500,70 +2517,70 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2500,70 +2517,70 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2500 | map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀")); | 2517 | map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀")); |
| 2501 | map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候")); | 2518 | map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候")); |
| 2502 | map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外")); | 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 | map.put("ssbc", culateService.culateLbbc(list_s)); | 2525 | map.put("ssbc", culateService.culateLbbc(list_s)); |
| 2509 | - double ljgl=culateService.culateLjgl(lists); | 2526 | + double ljgl = culateService.culateLjgl(lists); |
| 2510 | map.put("ljgl", ljgl); | 2527 | map.put("ljgl", ljgl); |
| 2511 | - map.put("jhbc", culateService.culateJhbc(list_s,"")); | 2528 | + map.put("jhbc", culateService.culateJhbc(list_s, "")); |
| 2512 | map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf")); | 2529 | map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf")); |
| 2513 | map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf")); | 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 | map.put("fzbc", culateService.culateFzbc(lists, "")); | 2537 | map.put("fzbc", culateService.culateFzbc(lists, "")); |
| 2521 | map.put("fzbc_m", culateService.culateFzbc(lists, "zgf")); | 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 | map.put("dtbc", 0); | 2540 | map.put("dtbc", 0); |
| 2524 | map.put("dtbc_m", 0); | 2541 | map.put("dtbc_m", 0); |
| 2525 | map.put("dtbc_a", 0); | 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 | map.put("djg", m.get("djgcsq")); | 2544 | map.put("djg", m.get("djgcsq")); |
| 2528 | map.put("djg_m", m.get("djgcsz")); | 2545 | map.put("djg_m", m.get("djgcsz")); |
| 2529 | map.put("djg_a", m.get("djgcsw")); | 2546 | map.put("djg_a", m.get("djgcsw")); |
| 2530 | map.put("djg_time", m.get("djgsj")); | 2547 | map.put("djg_time", m.get("djgsj")); |
| 2531 | map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl)); | 2548 | map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl)); |
| 2532 | lMap.add(map); | 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 | return lMap; | 2572 | return lMap; |
| 2556 | } | 2573 | } |
| 2557 | 2574 | ||
| 2558 | @Override | 2575 | @Override |
| 2559 | public List<Map<String, Object>> statisticsDaily_mh_2(String line, String date, | 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 | for (int i = 0; i < list_s.size(); i++) { | 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 | s.setRemark(""); | 2584 | s.setRemark(""); |
| 2568 | s.setFcsjActual(s.getDfsj()); | 2585 | s.setFcsjActual(s.getDfsj()); |
| 2569 | s.setZdsjActual(s.getZdsj()); | 2586 | s.setZdsjActual(s.getZdsj()); |
| @@ -2572,20 +2589,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2572,20 +2589,20 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2572 | } | 2589 | } |
| 2573 | 2590 | ||
| 2574 | Set<ChildTaskPlan> cts = s.getcTasks(); | 2591 | Set<ChildTaskPlan> cts = s.getcTasks(); |
| 2575 | - if(cts != null && cts.size() > 0){ | 2592 | + if (cts != null && cts.size() > 0) { |
| 2576 | lists.add(s); | 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 | lists.add(s); | 2596 | lists.add(s); |
| 2580 | } | 2597 | } |
| 2581 | } | 2598 | } |
| 2582 | } | 2599 | } |
| 2583 | Map<String, Object> map = new HashMap<String, Object>(); | 2600 | Map<String, Object> map = new HashMap<String, Object>(); |
| 2584 | map.put("xlName", xlName); | 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 | map.put("ssgl", lbgl); | 2606 | map.put("ssgl", lbgl); |
| 2590 | map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻")); | 2607 | map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻")); |
| 2591 | map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢")); | 2608 | map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢")); |
| @@ -2597,26 +2614,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2597,26 +2614,26 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2597 | map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀")); | 2614 | map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀")); |
| 2598 | map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候")); | 2615 | map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候")); |
| 2599 | map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外")); | 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 | map.put("ssbc", culateService.culateLbbc(list_s)); | 2622 | map.put("ssbc", culateService.culateLbbc(list_s)); |
| 2606 | - double ljgl=culateService.culateLjgl(lists); | 2623 | + double ljgl = culateService.culateLjgl(lists); |
| 2607 | map.put("ljgl", ljgl); | 2624 | map.put("ljgl", ljgl); |
| 2608 | - map.put("jhbc", culateService.culateJhbc(list_s,"")); | 2625 | + map.put("jhbc", culateService.culateJhbc(list_s, "")); |
| 2609 | map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf")); | 2626 | map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf")); |
| 2610 | map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf")); | 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 | map.put("fzbc", culateService.culateFzbc(lists, "")); | 2634 | map.put("fzbc", culateService.culateFzbc(lists, "")); |
| 2618 | map.put("fzbc_m", culateService.culateFzbc(lists, "zgf")); | 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 | map.put("dtbc", 0); | 2637 | map.put("dtbc", 0); |
| 2621 | map.put("dtbc_m", 0); | 2638 | map.put("dtbc_m", 0); |
| 2622 | map.put("dtbc_a", 0); | 2639 | map.put("dtbc_a", 0); |
| @@ -2629,175 +2646,175 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2629,175 +2646,175 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2629 | return lMap; | 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 | Set<ChildTaskPlan> cts = s.getcTasks(); | 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 | Map<String, Object> map = new HashMap<String, Object>(); | 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 | return map; | 2737 | return map; |
| 2721 | } | 2738 | } |
| 2722 | 2739 | ||
| 2723 | @Override | 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 | String xlName, String type) { | 2742 | String xlName, String type) { |
| 2726 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); | 2743 | List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); |
| 2727 | List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); | 2744 | List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); |
| 2728 | List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); | 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 | for (int i = 0; i < list.size(); i++) { | 2754 | for (int i = 0; i < list.size(); i++) { |
| 2738 | - ScheduleRealInfo s=list.get(i); | 2755 | + ScheduleRealInfo s = list.get(i); |
| 2739 | Set<ChildTaskPlan> cts = s.getcTasks(); | 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 | List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); | 2765 | List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); |
| 2749 | for (int i = 0; i < list.size(); i++) { | 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 | lists.add(list.get(i)); | 2769 | lists.add(list.get(i)); |
| 2753 | - }else{ | 2770 | + } else { |
| 2754 | lists.add(list.get(i)); | 2771 | lists.add(list.get(i)); |
| 2755 | - Map<String, Object> map=staticTj(lists); | 2772 | + Map<String, Object> map = staticTj(lists); |
| 2756 | lMap.add(map); | 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 | lists.add(list.get(i)); | 2778 | lists.add(list.get(i)); |
| 2762 | - Map<String, Object> map=staticTj(lists); | 2779 | + Map<String, Object> map = staticTj(lists); |
| 2763 | lMap.add(map); | 2780 | lMap.add(map); |
| 2764 | - }else{ | ||
| 2765 | - lists=new ArrayList<ScheduleRealInfo>(); | 2781 | + } else { |
| 2782 | + lists = new ArrayList<ScheduleRealInfo>(); | ||
| 2766 | lists.add(list.get(i)); | 2783 | lists.add(list.get(i)); |
| 2767 | - Map<String, Object> map=staticTj(lists); | 2784 | + Map<String, Object> map = staticTj(lists); |
| 2768 | lMap.add(map); | 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 | Map<String, Object> map = new HashMap<String, Object>(); | 2791 | Map<String, Object> map = new HashMap<String, Object>(); |
| 2775 | map.put("xlName", "合计"); | 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 | map.put("jhlc", jhyygl); | 2795 | map.put("jhlc", jhyygl); |
| 2779 | map.put("jcclc", jhjcclc); | 2796 | map.put("jcclc", jhjcclc); |
| 2780 | map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); | 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 | map.put("sjzgl", Arith.add(zyygl, zksgl)); | 2806 | map.put("sjzgl", Arith.add(zyygl, zksgl)); |
| 2790 | - map.put("sjgl",zyygl); | 2807 | + map.put("sjgl", zyygl); |
| 2791 | map.put("sjksgl", zksgl); | 2808 | map.put("sjksgl", zksgl); |
| 2792 | - | ||
| 2793 | - double ssgl= culateService.culateLbgl(list); | 2809 | + |
| 2810 | + double ssgl = culateService.culateLbgl(list); | ||
| 2794 | map.put("ssgl", ssgl); | 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 | map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); | 2819 | map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); |
| 2803 | map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); | 2820 | map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); |
| @@ -2809,40 +2826,58 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2809,40 +2826,58 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2809 | map.put("ssgl_kx", culateService.culateCJLC(list, "客稀")); | 2826 | map.put("ssgl_kx", culateService.culateCJLC(list, "客稀")); |
| 2810 | map.put("ssgl_qh", culateService.culateCJLC(list, "气候")); | 2827 | map.put("ssgl_qh", culateService.culateCJLC(list, "气候")); |
| 2811 | map.put("ssgl_yw", culateService.culateCJLC(list, "援外")); | 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 | map.put("ssbc", culateService.culateLbbc(list)); | 2835 | map.put("ssbc", culateService.culateLbbc(list)); |
| 2819 | map.put("ljgl", ljgl); | 2836 | map.put("ljgl", ljgl); |
| 2820 | - map.put("jhbc", culateService.culateJhbc(list,"")); | 2837 | + map.put("jhbc", culateService.culateJhbc(list, "")); |
| 2821 | map.put("jhbc_m", culateService.culateJhbc(list, "zgf")); | 2838 | map.put("jhbc_m", culateService.culateJhbc(list, "zgf")); |
| 2822 | map.put("jhbc_a", culateService.culateJhbc(list, "wgf")); | 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 | map.put("fzbc", culateService.culateFzbc(list_s, "")); | 2846 | map.put("fzbc", culateService.culateFzbc(list_s, "")); |
| 2830 | map.put("fzbc_m", culateService.culateFzbc(list_s, "zgf")); | 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 | map.put("dtbc", 0); | 2849 | map.put("dtbc", 0); |
| 2833 | map.put("dtbc_m", 0); | 2850 | map.put("dtbc_m", 0); |
| 2834 | map.put("dtbc_a", 0); | 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 | lMap.add(map); | 2882 | lMap.add(map); |
| 2848 | if (type != null && type.length() != 0 && type.equals("export")) { | 2883 | if (type != null && type.length() != 0 && type.equals("export")) { |
| @@ -2850,17 +2885,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2850,17 +2885,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2850 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 2885 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 2851 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 2886 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 2852 | Map<String, Object> m = new HashMap<String, Object>(); | 2887 | Map<String, Object> m = new HashMap<String, Object>(); |
| 2853 | - m.put("date", date+"至"+date2); | 2888 | + m.put("date", date + "至" + date2); |
| 2854 | ReportUtils ee = new ReportUtils(); | 2889 | ReportUtils ee = new ReportUtils(); |
| 2855 | try { | 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 | listI.add(lMap.iterator()); | 2898 | listI.add(lMap.iterator()); |
| 2857 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 2899 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 2858 | ee.excelReplace(listI, new Object[]{m}, path + "mould/statisticsDaily_.xls", | 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 | } catch (Exception e) { | 2902 | } catch (Exception e) { |
| 2861 | // TODO: handle exception | 2903 | // TODO: handle exception |
| 2862 | //e.printStackTrace(); | 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<ScheduleRealInf | @@ -3046,17 +3088,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3046 | } | 3088 | } |
| 3047 | } | 3089 | } |
| 3048 | } | 3090 | } |
| 3049 | - | 3091 | + |
| 3050 | for (int i = 0; i < newList.size(); i++) { | 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 | return newList; | 3102 | return newList; |
| 3061 | } | 3103 | } |
| 3062 | 3104 | ||
| @@ -3070,8 +3112,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3070,8 +3112,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3070 | String zdsjActual1 = ""; | 3112 | String zdsjActual1 = ""; |
| 3071 | List<ScheduleRealInfo> listInfo = scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date); | 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 | s.setRemark(""); | 3117 | s.setRemark(""); |
| 3076 | s.setFcsjActual(s.getDfsj()); | 3118 | s.setFcsjActual(s.getDfsj()); |
| 3077 | s.setZdsjActual(s.getZdsj()); | 3119 | s.setZdsjActual(s.getZdsj()); |
| @@ -3187,66 +3229,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3187,66 +3229,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3187 | return list; | 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 | List<Map<String, Object>> yesterdayDataList = new ArrayList<Map<String, Object>>(); | 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 | for (int x = 0; x < yesterdayDataList.size(); x++) { | 3240 | for (int x = 0; x < yesterdayDataList.size(); x++) { |
| 3199 | String jName = yesterdayDataList.get(x).get("jGh").toString(); | 3241 | String jName = yesterdayDataList.get(x).get("jGh").toString(); |
| 3200 | String clZbh = yesterdayDataList.get(x).get("clZbh").toString(); | 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 | Map<String, Object> map = new HashMap<String, Object>(); | 3245 | Map<String, Object> map = new HashMap<String, Object>(); |
| 3204 | boolean fage = true; | 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 | for (ScheduleRealInfo scheduleRealInfo : lists) { | 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 | if (fage) { | 3255 | if (fage) { |
| 3214 | //根据线路代码获取公司 | 3256 | //根据线路代码获取公司 |
| 3215 | - company=scheduleRealInfo.getGsBm(); | ||
| 3216 | - bCompany=scheduleRealInfo.getFgsBm(); | 3257 | + company = scheduleRealInfo.getGsBm(); |
| 3258 | + bCompany = scheduleRealInfo.getFgsBm(); | ||
| 3217 | fage = false; | 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 | yesterdayDataList.get(x).put("company", company); | 3271 | yesterdayDataList.get(x).put("company", company); |
| 3230 | yesterdayDataList.get(x).put("bCompany", bCompany); | 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 | yesterdayDataList.get(x).put("totalKilometers", zlc); | 3280 | yesterdayDataList.get(x).put("totalKilometers", zlc); |
| 3239 | 3281 | ||
| 3240 | } | 3282 | } |
| 3241 | //增加顺序号 | 3283 | //增加顺序号 |
| 3242 | for (int i = 0; i < yesterdayDataList.size(); i++) { | 3284 | for (int i = 0; i < yesterdayDataList.size(); i++) { |
| 3243 | if (i == 0) { | 3285 | if (i == 0) { |
| 3244 | - yesterdayDataList.get(i).put("seqNumber", 1); | 3286 | + yesterdayDataList.get(i).put("seqNumber", 1); |
| 3245 | } else { | 3287 | } else { |
| 3246 | if (yesterdayDataList.get(i - 1).get("clZbh").equals(yesterdayDataList.get(i).get("clZbh"))) { | 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 | } else { | 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<ScheduleRealInf | @@ -3265,7 +3307,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3265 | ScheduleRealInfo sch; | 3307 | ScheduleRealInfo sch; |
| 3266 | //StringBuilder sb = new StringBuilder(); | 3308 | //StringBuilder sb = new StringBuilder(); |
| 3267 | 3309 | ||
| 3268 | - String jGh = null,jName,sGh,sName; | 3310 | + String jGh = null, jName, sGh, sName; |
| 3269 | for (ChangePersonCar cpc : cpcs) { | 3311 | for (ChangePersonCar cpc : cpcs) { |
| 3270 | //sb = new StringBuilder(); | 3312 | //sb = new StringBuilder(); |
| 3271 | 3313 | ||
| @@ -3274,12 +3316,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3274,12 +3316,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3274 | continue; | 3316 | continue; |
| 3275 | 3317 | ||
| 3276 | if (cpc.getClZbh() != null) { | 3318 | if (cpc.getClZbh() != null) { |
| 3277 | - if(!carExist(sch.getGsBm(), cpc.getClZbh())) { | 3319 | + if (!carExist(sch.getGsBm(), cpc.getClZbh())) { |
| 3278 | rs.put("msg", "车辆 " + cpc.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!"); | 3320 | rs.put("msg", "车辆 " + cpc.getClZbh() + " <a href=\"/#/busInfoManage\" target=_blank>车辆基础信息</a> 里找不到!"); |
| 3279 | rs.put("status", ResponseCode.ERROR); | 3321 | rs.put("status", ResponseCode.ERROR); |
| 3280 | return rs; | 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 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + cpc.getClZbh() + "】的车辆"); | 3324 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到自编号为【" + cpc.getClZbh() + "】的车辆"); |
| 3284 | rs.put("status", ResponseCode.ERROR); | 3325 | rs.put("status", ResponseCode.ERROR); |
| 3285 | return rs; | 3326 | return rs; |
| @@ -3289,7 +3330,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3289,7 +3330,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3289 | if (StringUtils.isNotEmpty(cpc.getJsy())) { | 3330 | if (StringUtils.isNotEmpty(cpc.getJsy())) { |
| 3290 | jGh = cpc.getJsy().split("/")[0]; | 3331 | jGh = cpc.getJsy().split("/")[0]; |
| 3291 | jName = getPersonName(sch.getGsBm(), jGh); | 3332 | jName = getPersonName(sch.getGsBm(), jGh); |
| 3292 | - if(StringUtils.isEmpty(jName)){ | 3333 | + if (StringUtils.isEmpty(jName)) { |
| 3293 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员"); | 3334 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + jGh + "】的驾驶员"); |
| 3294 | rs.put("status", ResponseCode.ERROR); | 3335 | rs.put("status", ResponseCode.ERROR); |
| 3295 | return rs; | 3336 | return rs; |
| @@ -3306,17 +3347,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3306,17 +3347,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3306 | /*if(!jGh.equals(sch.getjGh())) | 3347 | /*if(!jGh.equals(sch.getjGh())) |
| 3307 | sb.append(sch.getjGh() + " 换 " + jGh + ";");*/ | 3348 | sb.append(sch.getjGh() + " 换 " + jGh + ";");*/ |
| 3308 | //换驾驶员 | 3349 | //换驾驶员 |
| 3309 | - if(persoChange(sch, jGh)) | 3350 | + if (persoChange(sch, jGh)) |
| 3310 | set.add(sch); | 3351 | set.add(sch); |
| 3311 | } | 3352 | } |
| 3312 | 3353 | ||
| 3313 | //换售票员 | 3354 | //换售票员 |
| 3314 | if (StringUtils.isNotEmpty(cpc.getSpy()) | 3355 | if (StringUtils.isNotEmpty(cpc.getSpy()) |
| 3315 | - && cpc.getSpy().indexOf("/")!=-1 | 3356 | + && cpc.getSpy().indexOf("/") != -1 |
| 3316 | && cpc.getSpy().length() > 1) { | 3357 | && cpc.getSpy().length() > 1) { |
| 3317 | sGh = cpc.getSpy().split("/")[0]; | 3358 | sGh = cpc.getSpy().split("/")[0]; |
| 3318 | sName = getPersonName(sch.getGsBm(), sGh); | 3359 | sName = getPersonName(sch.getGsBm(), sGh); |
| 3319 | - if(StringUtils.isEmpty(sName)){ | 3360 | + if (StringUtils.isEmpty(sName)) { |
| 3320 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sGh + "】的售票员"); | 3361 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sGh + "】的售票员"); |
| 3321 | rs.put("status", ResponseCode.ERROR); | 3362 | rs.put("status", ResponseCode.ERROR); |
| 3322 | return rs; | 3363 | return rs; |
| @@ -3324,10 +3365,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3324,10 +3365,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3324 | 3365 | ||
| 3325 | /*if(!sGh.equals(sch.getsGh())) | 3366 | /*if(!sGh.equals(sch.getsGh())) |
| 3326 | sb.append(sch.getsGh() + " 换 " + sGh + ";");*/ | 3367 | sb.append(sch.getsGh() + " 换 " + sGh + ";");*/ |
| 3327 | - if(persoChangeSPY(sch, sGh)) | 3368 | + if (persoChangeSPY(sch, sGh)) |
| 3328 | set.add(sch); | 3369 | set.add(sch); |
| 3329 | - } | ||
| 3330 | - else if(StringUtils.isNotEmpty(sch.getsGh())){ | 3370 | + } else if (StringUtils.isNotEmpty(sch.getsGh())) { |
| 3331 | sch.setsGh(""); | 3371 | sch.setsGh(""); |
| 3332 | sch.setsName(""); | 3372 | sch.setsName(""); |
| 3333 | } | 3373 | } |
| @@ -3358,7 +3398,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3358,7 +3398,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3358 | public boolean persoChange(ScheduleRealInfo sch, String jGh) { | 3398 | public boolean persoChange(ScheduleRealInfo sch, String jGh) { |
| 3359 | if (sch.getjGh().equals(jGh)) | 3399 | if (sch.getjGh().equals(jGh)) |
| 3360 | return false; | 3400 | return false; |
| 3361 | - String jName = getPersonName(sch.getGsBm() , jGh); | 3401 | + String jName = getPersonName(sch.getGsBm(), jGh); |
| 3362 | if (StringUtils.isNotEmpty(jName)) { | 3402 | if (StringUtils.isNotEmpty(jName)) { |
| 3363 | 3403 | ||
| 3364 | if (jGh.indexOf("-") != -1) | 3404 | if (jGh.indexOf("-") != -1) |
| @@ -3379,7 +3419,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3379,7 +3419,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3379 | public boolean persoChangeSPY(ScheduleRealInfo sch, String sGh) { | 3419 | public boolean persoChangeSPY(ScheduleRealInfo sch, String sGh) { |
| 3380 | if (sch.getsGh().equals(sGh)) | 3420 | if (sch.getsGh().equals(sGh)) |
| 3381 | return false; | 3421 | return false; |
| 3382 | - String sName = getPersonName(sch.getGsBm() , sGh); | 3422 | + String sName = getPersonName(sch.getGsBm(), sGh); |
| 3383 | if (StringUtils.isNotEmpty(sName)) { | 3423 | if (StringUtils.isNotEmpty(sName)) { |
| 3384 | if (sGh.indexOf("-") != -1) | 3424 | if (sGh.indexOf("-") != -1) |
| 3385 | sch.setsGh(sGh.substring(sGh.indexOf("-") + 1)); | 3425 | sch.setsGh(sGh.substring(sGh.indexOf("-") + 1)); |
| @@ -3500,7 +3540,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3500,7 +3540,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3500 | rs.put("status", ResponseCode.SUCCESS); | 3540 | rs.put("status", ResponseCode.SUCCESS); |
| 3501 | rs.put("t", sch); | 3541 | rs.put("t", sch); |
| 3502 | 3542 | ||
| 3503 | - if("major".equals(bcType)){ | 3543 | + if ("major".equals(bcType)) { |
| 3504 | sch.setMajorStationName(majorStationName); | 3544 | sch.setMajorStationName(majorStationName); |
| 3505 | } | 3545 | } |
| 3506 | 3546 | ||
| @@ -3525,10 +3565,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3525,10 +3565,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3525 | 3565 | ||
| 3526 | //换车 | 3566 | //换车 |
| 3527 | if (StringUtils.isNotEmpty(sch.getClZbh()) && !oldSch.getClZbh().equals(sch.getClZbh())) { | 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 | rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!"); | 3569 | rs.put("msg", "车辆 " + sch.getClZbh() + " 不存在!"); |
| 3530 | return rs; | 3570 | return rs; |
| 3531 | - } else{ | 3571 | + } else { |
| 3532 | aflog.log("换车", oldSch.getClZbh(), sch.getClZbh()); | 3572 | aflog.log("换车", oldSch.getClZbh(), sch.getClZbh()); |
| 3533 | oldSch.setClZbh(sch.getClZbh()); | 3573 | oldSch.setClZbh(sch.getClZbh()); |
| 3534 | } | 3574 | } |
| @@ -3537,22 +3577,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3537,22 +3577,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3537 | //换驾驶员 | 3577 | //换驾驶员 |
| 3538 | if (StringUtils.isNotEmpty(sch.getjGh()) && !oldSch.getjGh().equals(sch.getjGh())) { | 3578 | if (StringUtils.isNotEmpty(sch.getjGh()) && !oldSch.getjGh().equals(sch.getjGh())) { |
| 3539 | String jName = getPersonName(oldSch.getGsBm(), sch.getjGh()); | 3579 | String jName = getPersonName(oldSch.getGsBm(), sch.getjGh()); |
| 3540 | - if(StringUtils.isEmpty(jName)){ | 3580 | + if (StringUtils.isEmpty(jName)) { |
| 3541 | rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员"); | 3581 | rs.put("msg", oldSch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getjGh() + "】的驾驶员"); |
| 3542 | return rs; | 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 | persoChange(oldSch, sch.getjGh()); | 3585 | persoChange(oldSch, sch.getjGh()); |
| 3546 | } | 3586 | } |
| 3547 | 3587 | ||
| 3548 | //换售票员 | 3588 | //换售票员 |
| 3549 | if (StringUtils.isNotEmpty(sch.getsGh()) && !oldSch.getsGh().equals(sch.getsGh())) { | 3589 | if (StringUtils.isNotEmpty(sch.getsGh()) && !oldSch.getsGh().equals(sch.getsGh())) { |
| 3550 | String sName = getPersonName(oldSch.getGsBm(), sch.getsGh()); | 3590 | String sName = getPersonName(oldSch.getGsBm(), sch.getsGh()); |
| 3551 | - if(StringUtils.isEmpty(sName)){ | 3591 | + if (StringUtils.isEmpty(sName)) { |
| 3552 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员"); | 3592 | rs.put("msg", sch.getXlName() + "所属的公司编码下找不到工号为【" + sch.getsGh() + "】的售票员"); |
| 3553 | return rs; | 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 | persoChangeSPY(oldSch, sch.getsGh()); | 3596 | persoChangeSPY(oldSch, sch.getsGh()); |
| 3557 | } | 3597 | } |
| 3558 | 3598 | ||
| @@ -3562,8 +3602,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3562,8 +3602,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3562 | if (!dest1 && dest2) { | 3602 | if (!dest1 && dest2) { |
| 3563 | oldSch.destroy(); | 3603 | oldSch.destroy(); |
| 3564 | aflog.log("烂班"); | 3604 | aflog.log("烂班"); |
| 3565 | - } | ||
| 3566 | - else if(dest1 && !dest2){ | 3605 | + } else if (dest1 && !dest2) { |
| 3567 | //撤销烂班 | 3606 | //撤销烂班 |
| 3568 | oldSch.setJhlc(oldSch.getJhlcOrig()); | 3607 | oldSch.setJhlc(oldSch.getJhlcOrig()); |
| 3569 | oldSch.setStatus(0); | 3608 | oldSch.setStatus(0); |
| @@ -3581,34 +3620,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3581,34 +3620,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3581 | double jhlcNum = sch.getJhlc(); | 3620 | double jhlcNum = sch.getJhlc(); |
| 3582 | aflog.log("修改班次里程", oldSch.getJhlc(), jhlcNum); | 3621 | aflog.log("修改班次里程", oldSch.getJhlc(), jhlcNum); |
| 3583 | //烂班 | 3622 | //烂班 |
| 3584 | - if(jhlcNum == 0 && oldSch.getJhlcOrig() != 0) | 3623 | + if (jhlcNum == 0 && oldSch.getJhlcOrig() != 0) |
| 3585 | oldSch.destroy(); | 3624 | oldSch.destroy(); |
| 3586 | else { | 3625 | else { |
| 3587 | oldSch.setJhlc(jhlcNum); | 3626 | oldSch.setJhlc(jhlcNum); |
| 3588 | //临加班次,实际计划一起改 | 3627 | //临加班次,实际计划一起改 |
| 3589 | - if(oldSch.isSflj()) | 3628 | + if (oldSch.isSflj()) |
| 3590 | oldSch.setJhlcOrig(jhlcNum); | 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 | aflog.log("修改待发时间", oldSch.getDfsj(), sch.getDfsj()); | 3635 | aflog.log("修改待发时间", oldSch.getDfsj(), sch.getDfsj()); |
| 3597 | oldSch.setDfsj(sch.getDfsj()); | 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 | aflog.log("修改实发时间", oldSch.getFcsjActual(), sch.getFcsjActual()); | 3640 | aflog.log("修改实发时间", oldSch.getFcsjActual(), sch.getFcsjActual()); |
| 3602 | oldSch.setFcsjActual(sch.getFcsjActual()); | 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 | aflog.log("修改实达时间", oldSch.getZdsjActual(), sch.getZdsjActual()); | 3645 | aflog.log("修改实达时间", oldSch.getZdsjActual(), sch.getZdsjActual()); |
| 3607 | oldSch.setZdsjActual(sch.getZdsjActual()); | 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 | aflog.log("修改备注", oldSch.getRemarks(), sch.getRemarks()); | 3651 | aflog.log("修改备注", oldSch.getRemarks(), sch.getRemarks()); |
| 3613 | oldSch.setRemarks(sch.getRemarks()); | 3652 | oldSch.setRemarks(sch.getRemarks()); |
| 3614 | } | 3653 | } |
| @@ -3728,8 +3767,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3728,8 +3767,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3728 | if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") | 3767 | if (scheduleRealInfo.getBcType().equals("in") || scheduleRealInfo.getBcType().equals("out") |
| 3729 | ) { | 3768 | ) { |
| 3730 | jcclc += tempJhlc; | 3769 | jcclc += tempJhlc; |
| 3731 | - } | ||
| 3732 | - else { | 3770 | + } else { |
| 3733 | if (scheduleRealInfo.getStatus() != -1) { | 3771 | if (scheduleRealInfo.getStatus() != -1) { |
| 3734 | if (scheduleRealInfo.isSflj()) { | 3772 | if (scheduleRealInfo.isSflj()) { |
| 3735 | addMileage += tempJhlc; | 3773 | addMileage += tempJhlc; |
| @@ -3793,24 +3831,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3793,24 +3831,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3793 | String zdsjActual = scheduleRealInfo.getZdsjActual(); | 3831 | String zdsjActual = scheduleRealInfo.getZdsjActual(); |
| 3794 | if (zdsj != null && zdsjActual != null && | 3832 | if (zdsj != null && zdsjActual != null && |
| 3795 | !zdsj.equals(zdsjActual)) { | 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 | if (zdsj.compareTo(zdsjActual) > 0) { | 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 | } else { | 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 | } else { | 3853 | } else { |
| 3816 | map.put("fast", ""); | 3854 | map.put("fast", ""); |
| @@ -3856,7 +3894,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3856,7 +3894,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3856 | // map.put("sjbc", jhbc - cjbc + ljbc); | 3894 | // map.put("sjbc", jhbc - cjbc + ljbc); |
| 3857 | // map.put("zgl", format.format(yygl + ksgl + jcclc)); | 3895 | // map.put("zgl", format.format(yygl + ksgl + jcclc)); |
| 3858 | // map.put("ljbc", ljbc); | 3896 | // map.put("ljbc", ljbc); |
| 3859 | - | 3897 | + |
| 3860 | String zdp = "", zwdp = "", wdp = ""; | 3898 | String zdp = "", zwdp = "", wdp = ""; |
| 3861 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); | 3899 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); |
| 3862 | List<DutyEmployee> listDtuy = dutyEmployeeService.getDutyEmployee(line, date + "00:00", date + "23:59"); | 3900 | List<DutyEmployee> listDtuy = dutyEmployeeService.getDutyEmployee(line, date + "00:00", date + "23:59"); |
| @@ -3904,34 +3942,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3904,34 +3942,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3904 | DecimalFormat format = new DecimalFormat("0.00"); | 3942 | DecimalFormat format = new DecimalFormat("0.00"); |
| 3905 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | 3943 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 3906 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | 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 | double addMileage = 0, remMileage = 0, addgl = 0, remgl = 0; | 3947 | double addMileage = 0, remMileage = 0, addgl = 0, remgl = 0; |
| 3910 | Map<String, Object> map = new HashMap<String, Object>(); | 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 | map.put("yygljh", jhlc); | 3963 | map.put("yygljh", jhlc); |
| 3926 | map.put("ssgl", remMileage); | 3964 | map.put("ssgl", remMileage); |
| 3927 | map.put("ksgl", ksgl); | 3965 | map.put("ksgl", ksgl); |
| 3928 | - map.put("yyglsj", Arith.add(yygl,addMileage)); | 3966 | + map.put("yyglsj", Arith.add(yygl, addMileage)); |
| 3929 | map.put("jcclc", jcclc); | 3967 | map.put("jcclc", jcclc); |
| 3930 | map.put("jhbc", jhbc); | 3968 | map.put("jhbc", jhbc); |
| 3931 | - map.put("ljgl",addMileage); | 3969 | + map.put("ljgl", addMileage); |
| 3932 | map.put("ssbc", cjbc); | 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 | map.put("zgl", Arith.add(zyygl, zksgl)); | 3973 | map.put("zgl", Arith.add(zyygl, zksgl)); |
| 3936 | map.put("ljbc", ljbc); | 3974 | map.put("ljbc", ljbc); |
| 3937 | 3975 | ||
| @@ -3965,7 +4003,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3965,7 +4003,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3965 | } | 4003 | } |
| 3966 | 4004 | ||
| 3967 | if (!c.isDestroy()) { | 4005 | if (!c.isDestroy()) { |
| 3968 | - if(c.getMileageType().equals("service")){ | 4006 | + if (c.getMileageType().equals("service")) { |
| 3969 | sjlc += c.getMileage() == null ? 0 : c.getMileage(); | 4007 | sjlc += c.getMileage() == null ? 0 : c.getMileage(); |
| 3970 | } | 4008 | } |
| 3971 | } | 4009 | } |
| @@ -3987,140 +4025,140 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -3987,140 +4025,140 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 3987 | } | 4025 | } |
| 3988 | 4026 | ||
| 3989 | @Override | 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 | public Map<String, Object> MapByIdQp(Long id) { | 4162 | public Map<String, Object> MapByIdQp(Long id) { |
| 4125 | // TODO Auto-generated method stub | 4163 | // TODO Auto-generated method stub |
| 4126 | Map<String, Object> map = new HashMap<String, Object>(); | 4164 | Map<String, Object> map = new HashMap<String, Object>(); |
| @@ -4129,12 +4167,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4129,12 +4167,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4129 | String xlbm = s.getXlBm(); | 4167 | String xlbm = s.getXlBm(); |
| 4130 | String fcrq = s.getScheduleDateStr(); | 4168 | String fcrq = s.getScheduleDateStr(); |
| 4131 | 4169 | ||
| 4132 | - int type=0; | 4170 | + int type = 0; |
| 4133 | Double ccyl = 0.0; | 4171 | Double ccyl = 0.0; |
| 4134 | Double jcyl = 0.0; | 4172 | Double jcyl = 0.0; |
| 4135 | Double yh = 0.0; | 4173 | Double yh = 0.0; |
| 4136 | Double jzl = 0.0; | 4174 | Double jzl = 0.0; |
| 4137 | - Double zlc=0.0; | 4175 | + Double zlc = 0.0; |
| 4138 | // List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(),xlbm); | 4176 | // List<Ylb> listYlb = ylbRepository.queryListYlb(fcrq, s.getClZbh(), s.getjGh(),xlbm); |
| 4139 | // List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(),xlbm); | 4177 | // List<Dlb> listDlb = dlbRepository.queryListDlb(fcrq, s.getClZbh(), s.getjGh(),xlbm); |
| 4140 | // if(listYlb.size()>0){ | 4178 | // if(listYlb.size()>0){ |
| @@ -4180,12 +4218,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4180,12 +4218,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<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 | for (int i = 0; i < listylxxb.size(); i++) { | 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 | map.put("jzl", jzl); | 4227 | map.put("jzl", jzl); |
| 4190 | map.put("yh", yh); | 4228 | map.put("yh", yh); |
| 4191 | map.put("ccyl", ccyl); | 4229 | map.put("ccyl", ccyl); |
| @@ -4201,7 +4239,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4201,7 +4239,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4201 | map.put("lpName", s.getLpName()); | 4239 | map.put("lpName", s.getLpName()); |
| 4202 | String zdp = "", zwdp = "", wdp = ""; | 4240 | String zdp = "", zwdp = "", wdp = ""; |
| 4203 | String zdpT = "", zwdpT = "", wdpT = ""; | 4241 | String zdpT = "", zwdpT = "", wdpT = ""; |
| 4204 | - String dbdp=""; | 4242 | + String dbdp = ""; |
| 4205 | List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59"); | 4243 | List<DutyEmployee> list = dutyEmployeeService.getDutyEmployee(xlbm, fcrq + "00:01", fcrq + "23:59"); |
| 4206 | try { | 4244 | try { |
| 4207 | Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime(); | 4245 | Long fcsj1 = sdf.parse(fcrq + " 00:01").getTime(); |
| @@ -4209,11 +4247,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4209,11 +4247,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4209 | Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime(); | 4247 | Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime(); |
| 4210 | for (int i = 0; i < list.size(); i++) { | 4248 | for (int i = 0; i < list.size(); i++) { |
| 4211 | DutyEmployee t = list.get(i); | 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 | Long ts = t.getTs(); | 4257 | Long ts = t.getTs(); |
| @@ -4298,8 +4336,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4298,8 +4336,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4298 | 4336 | ||
| 4299 | if (scheduleRealInfo.getsGh() != null) { | 4337 | if (scheduleRealInfo.getsGh() != null) { |
| 4300 | if (!scheduleRealInfo.getsGh().equals(sgh)) { | 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 | if (map.get("sjb1") != null) { | 4341 | if (map.get("sjb1") != null) { |
| 4304 | if (map.get("sjb2") != null) { | 4342 | if (map.get("sjb2") != null) { |
| 4305 | map.put("sjb3", scheduleRealInfo.getsGh() + "/" + | 4343 | map.put("sjb3", scheduleRealInfo.getsGh() + "/" + |
| @@ -4408,8 +4446,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4408,8 +4446,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4408 | List<ScheduleRealInfo> list2 = this.queryUserInfo(line, date, state); | 4446 | List<ScheduleRealInfo> list2 = this.queryUserInfo(line, date, state); |
| 4409 | List<ScheduleRealInfo> list3 = this.realScheduleList(line, date); | 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 | nMap.put("jls", list1.get(0).get("jls")); | 4451 | nMap.put("jls", list1.get(0).get("jls")); |
| 4414 | nMap.put("sjgl", list1.get(0).get("sjgl")); | 4452 | nMap.put("sjgl", list1.get(0).get("sjgl")); |
| 4415 | for (Map<String, Object> m : list1) { | 4453 | for (Map<String, Object> m : list1) { |
| @@ -4506,72 +4544,72 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4506,72 +4544,72 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4506 | } | 4544 | } |
| 4507 | } | 4545 | } |
| 4508 | */ | 4546 | */ |
| 4509 | - | 4547 | + |
| 4510 | size = 0; | 4548 | size = 0; |
| 4511 | tempMap = new HashMap<String, Object>(); | 4549 | tempMap = new HashMap<String, Object>(); |
| 4512 | for (ScheduleRealInfo schedule : list3) { | 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 | tempMap.put("zdsjActual1", ""); | 4613 | tempMap.put("zdsjActual1", ""); |
| 4576 | tempMap.put("zdsjk1", ""); | 4614 | tempMap.put("zdsjk1", ""); |
| 4577 | tempMap.put("zdsjm1", ""); | 4615 | tempMap.put("zdsjm1", ""); |
| @@ -4580,9 +4618,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4580,9 +4618,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4580 | tempMap.put("fcsjk1", ""); | 4618 | tempMap.put("fcsjk1", ""); |
| 4581 | tempMap.put("fcsjm1", ""); | 4619 | tempMap.put("fcsjm1", ""); |
| 4582 | tempMap.put("remarks1", ""); | 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 | tempMap.put("qdzName2", ""); | 4624 | tempMap.put("qdzName2", ""); |
| 4587 | tempMap.put("zdsj2", ""); | 4625 | tempMap.put("zdsj2", ""); |
| 4588 | tempMap.put("zdsjActual2", ""); | 4626 | tempMap.put("zdsjActual2", ""); |
| @@ -4593,35 +4631,35 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4593,35 +4631,35 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4593 | tempMap.put("fcsjk2", ""); | 4631 | tempMap.put("fcsjk2", ""); |
| 4594 | tempMap.put("fcsjm2", ""); | 4632 | tempMap.put("fcsjm2", ""); |
| 4595 | tempMap.put("remarks2", ""); | 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 | if (type.equals("export")) { | 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 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 4663 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 4626 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 4664 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 4627 | Map<String, Object> m = new HashMap<String, Object>(); | 4665 | Map<String, Object> m = new HashMap<String, Object>(); |
| @@ -4639,7 +4677,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4639,7 +4677,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4639 | sourcePath = path + "mould/scheduleDaily_m.xls"; | 4677 | sourcePath = path + "mould/scheduleDaily_m.xls"; |
| 4640 | } | 4678 | } |
| 4641 | ee.excelReplace(listI, new Object[]{nMap}, sourcePath, | 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 | } catch (Exception e) { | 4681 | } catch (Exception e) { |
| 4644 | // TODO: handle exception | 4682 | // TODO: handle exception |
| 4645 | e.printStackTrace(); | 4683 | e.printStackTrace(); |
| @@ -4650,197 +4688,198 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4650,197 +4688,198 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4650 | } | 4688 | } |
| 4651 | 4689 | ||
| 4652 | public void exportWaybill_pl(List<ScheduleRealInfo> listpl, | 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 | ReportUtils ee = new ReportUtils(); | 4692 | ReportUtils ee = new ReportUtils(); |
| 4655 | ReportRelatedUtils rru = new ReportRelatedUtils(); | 4693 | ReportRelatedUtils rru = new ReportRelatedUtils(); |
| 4656 | List<Iterator<?>> list = new ArrayList<Iterator<?>>(); | 4694 | List<Iterator<?>> list = new ArrayList<Iterator<?>>(); |
| 4657 | List<ScheduleRealInfo> scheduleRealInfos = listpl; | 4695 | List<ScheduleRealInfo> scheduleRealInfos = listpl; |
| 4658 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); | 4696 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); |
| 4659 | // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); | 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 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); | 4711 | // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); |
| 4674 | // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); | 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 | // map=new HashMap<String,Object>(); | 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 | // Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); | 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 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 4873 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 4835 | list.add(listMap.iterator()); | 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 | map.put("sheetName", jName + "-" + clZbh + "-" + lpName); | 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 | path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); | 4883 | path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); |
| 4845 | } | 4884 | } |
| 4846 | 4885 | ||
| @@ -4859,25 +4898,25 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4859,25 +4898,25 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4859 | while (true) { | 4898 | while (true) { |
| 4860 | String fileUrl = path + "行车路单" + sdfSimple.format(sdfMonth.parse(date)); | 4899 | String fileUrl = path + "行车路单" + sdfSimple.format(sdfMonth.parse(date)); |
| 4861 | // file = new File(fileUrl + (num == 0 ? "/" : "(" + num + ")/")); //新建文件夹 | 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 | num++; | 4903 | num++; |
| 4865 | } else { | 4904 | } else { |
| 4866 | break; | 4905 | break; |
| 4867 | } | 4906 | } |
| 4868 | } | 4907 | } |
| 4869 | // file.mkdirs(); //创建 | 4908 | // file.mkdirs(); //创建 |
| 4870 | - List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); | 4909 | + List<ScheduleRealInfo> lists_line = scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); |
| 4871 | List<File> files = new ArrayList<File>(); | 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 | String jName = list.get(0); | 4913 | String jName = list.get(0); |
| 4875 | String clZbh = list.get(1); | 4914 | String clZbh = list.get(1); |
| 4876 | String lpName = list.get(2); | 4915 | String lpName = list.get(2); |
| 4877 | - String jGh =list.get(3); | 4916 | + String jGh = list.get(3); |
| 4878 | for (int i = 0; i < lists_line.size(); i++) { | 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 | newList.add(s); | 4920 | newList.add(s); |
| 4882 | } | 4921 | } |
| 4883 | } | 4922 | } |
| @@ -4886,10 +4925,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4886,10 +4925,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4886 | String fileName = file.getName(); | 4925 | String fileName = file.getName(); |
| 4887 | files.add(temp); | 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 | File newFile = files.get(0); | 4933 | File newFile = files.get(0); |
| 4895 | newFile.renameTo(file); | 4934 | newFile.renameTo(file); |
| @@ -4971,7 +5010,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4971,7 +5010,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4971 | if (i < smallList.size()) { | 5010 | if (i < smallList.size()) { |
| 4972 | rightSch = smallList.get(i); | 5011 | rightSch = smallList.get(i); |
| 4973 | ts.add(rightSch); | 5012 | ts.add(rightSch); |
| 4974 | - } else{ | 5013 | + } else { |
| 4975 | //不对称时多出来的 | 5014 | //不对称时多出来的 |
| 4976 | lpChangeByLeft(leftSch, largeList.get(i - 1), type); | 5015 | lpChangeByLeft(leftSch, largeList.get(i - 1), type); |
| 4977 | ts.add(leftSch); | 5016 | ts.add(leftSch); |
| @@ -4988,7 +5027,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -4988,7 +5027,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 4988 | } | 5027 | } |
| 4989 | 5028 | ||
| 4990 | //重新计算路牌的起点应到时间 | 5029 | //重新计算路牌的起点应到时间 |
| 4991 | - for(String lpName : lpSet){ | 5030 | + for (String lpName : lpSet) { |
| 4992 | ts.addAll(dayOfSchedule.updateQdzTimePlan(lpName)); | 5031 | ts.addAll(dayOfSchedule.updateQdzTimePlan(lpName)); |
| 4993 | } | 5032 | } |
| 4994 | 5033 | ||
| @@ -5018,7 +5057,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -5018,7 +5057,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 5018 | @Override | 5057 | @Override |
| 5019 | public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { | 5058 | public void lpChange(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { |
| 5020 | //释放班次映射 | 5059 | //释放班次映射 |
| 5021 | - if(type > 0) { | 5060 | + if (type > 0) { |
| 5022 | dayOfSchedule.removeNbbm2SchMapp(leftSch); | 5061 | dayOfSchedule.removeNbbm2SchMapp(leftSch); |
| 5023 | dayOfSchedule.removeNbbm2SchMapp(rightSch); | 5062 | dayOfSchedule.removeNbbm2SchMapp(rightSch); |
| 5024 | } | 5063 | } |
| @@ -5030,7 +5069,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -5030,7 +5069,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 5030 | leftData.appendTo(rightSch, type); | 5069 | leftData.appendTo(rightSch, type); |
| 5031 | rightData.appendTo(leftSch, type); | 5070 | rightData.appendTo(leftSch, type); |
| 5032 | 5071 | ||
| 5033 | - if(type > 0){ | 5072 | + if (type > 0) { |
| 5034 | //重新映射 | 5073 | //重新映射 |
| 5035 | dayOfSchedule.addNbbm2SchMapp(leftSch); | 5074 | dayOfSchedule.addNbbm2SchMapp(leftSch); |
| 5036 | dayOfSchedule.addNbbm2SchMapp(rightSch); | 5075 | dayOfSchedule.addNbbm2SchMapp(rightSch); |
| @@ -5039,20 +5078,21 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -5039,20 +5078,21 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 5039 | 5078 | ||
| 5040 | /** | 5079 | /** |
| 5041 | * 更换左边班次的路牌,右边不变 | 5080 | * 更换左边班次的路牌,右边不变 |
| 5081 | + * | ||
| 5042 | * @param leftSch | 5082 | * @param leftSch |
| 5043 | * @param rightSch | 5083 | * @param rightSch |
| 5044 | * @param type | 5084 | * @param type |
| 5045 | */ | 5085 | */ |
| 5046 | public void lpChangeByLeft(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { | 5086 | public void lpChangeByLeft(ScheduleRealInfo leftSch, ScheduleRealInfo rightSch, int type) { |
| 5047 | //释放班次映射 | 5087 | //释放班次映射 |
| 5048 | - if(type > 0) | 5088 | + if (type > 0) |
| 5049 | dayOfSchedule.removeNbbm2SchMapp(leftSch); | 5089 | dayOfSchedule.removeNbbm2SchMapp(leftSch); |
| 5050 | 5090 | ||
| 5051 | LpData rightData = new LpData(rightSch); | 5091 | LpData rightData = new LpData(rightSch); |
| 5052 | rightData.appendTo(leftSch, type); | 5092 | rightData.appendTo(leftSch, type); |
| 5053 | 5093 | ||
| 5054 | //重新映射 | 5094 | //重新映射 |
| 5055 | - if(type > 0) | 5095 | + if (type > 0) |
| 5056 | dayOfSchedule.addNbbm2SchMapp(leftSch); | 5096 | dayOfSchedule.addNbbm2SchMapp(leftSch); |
| 5057 | 5097 | ||
| 5058 | } | 5098 | } |
| @@ -5106,16 +5146,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -5106,16 +5146,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 5106 | List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx); | 5146 | List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx); |
| 5107 | 5147 | ||
| 5108 | ScheduleRealInfo sch; | 5148 | ScheduleRealInfo sch; |
| 5109 | - for(String id : ids){ | 5149 | + for (String id : ids) { |
| 5110 | sch = dayOfSchedule.get(Long.parseLong(id)); | 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 | sch.setLateMinute(minute); | 5153 | sch.setLateMinute(minute); |
| 5114 | - } | ||
| 5115 | - else if(minute == 0){ | 5154 | + } else if (minute == 0) { |
| 5116 | LateAdjustHandle.remove(sch); | 5155 | LateAdjustHandle.remove(sch); |
| 5117 | } | 5156 | } |
| 5118 | - count ++; | 5157 | + count++; |
| 5119 | list.add(sch); | 5158 | list.add(sch); |
| 5120 | } | 5159 | } |
| 5121 | } | 5160 | } |
| @@ -5123,7 +5162,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -5123,7 +5162,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 5123 | rs.put("status", ResponseCode.SUCCESS); | 5162 | rs.put("status", ResponseCode.SUCCESS); |
| 5124 | rs.put("count", count); | 5163 | rs.put("count", count); |
| 5125 | rs.put("ts", list); | 5164 | rs.put("ts", list); |
| 5126 | - }catch (Exception e){ | 5165 | + } catch (Exception e) { |
| 5127 | logger.error("", e); | 5166 | logger.error("", e); |
| 5128 | rs.put("status", ResponseCode.ERROR); | 5167 | rs.put("status", ResponseCode.ERROR); |
| 5129 | rs.put("msg", e.getMessage()); | 5168 | rs.put("msg", e.getMessage()); |
| @@ -5138,36 +5177,36 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -5138,36 +5177,36 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 5138 | List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx); | 5177 | List<String> ids = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(idx); |
| 5139 | 5178 | ||
| 5140 | Collection<ScheduleRealInfo> all = LateAdjustHandle.allLateSch(); | 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 | rs.add(sch); | 5182 | rs.add(sch); |
| 5144 | } | 5183 | } |
| 5145 | } | 5184 | } |
| 5146 | return rs; | 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 | new RowMapper<MileageReport>() { | 5206 | new RowMapper<MileageReport>() { |
| 5168 | @Override | 5207 | @Override |
| 5169 | public MileageReport mapRow(ResultSet rs, int rowNum) throws SQLException { | 5208 | public MileageReport mapRow(ResultSet rs, int rowNum) throws SQLException { |
| 5170 | - MileageReport mr = new MileageReport(); | 5209 | + MileageReport mr = new MileageReport(); |
| 5171 | mr.setCompanyName(rs.getString("company_name")); | 5210 | mr.setCompanyName(rs.getString("company_name")); |
| 5172 | mr.setSubCompanyName(rs.getString("sub_company_name")); | 5211 | mr.setSubCompanyName(rs.getString("sub_company_name")); |
| 5173 | mr.setLineName(rs.getString("line_name")); | 5212 | mr.setLineName(rs.getString("line_name")); |
| @@ -5185,189 +5224,189 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -5185,189 +5224,189 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 5185 | return mr; | 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 | // PinyinHelper.convertToPinyinString(ppy.getName(), | 5398 | // PinyinHelper.convertToPinyinString(ppy.getName(), |
| 5360 | // "" , PinyinFormat.WITHOUT_TONE) | 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,17 +1321,19 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 1321 | for (int j = 0; j < list.size(); j++) { | 1321 | for (int j = 0; j < list.size(); j++) { |
| 1322 | ScheduleRealInfo sinfo=list.get(j); | 1322 | ScheduleRealInfo sinfo=list.get(j); |
| 1323 | try { | 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 | } catch (ParseException e) { | 1337 | } catch (ParseException e) { |
| 1336 | // TODO Auto-generated catch block | 1338 | // TODO Auto-generated catch block |
| 1337 | e.printStackTrace(); | 1339 | e.printStackTrace(); |
| @@ -1384,7 +1386,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | @@ -1384,7 +1386,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 1384 | if(s.getXlDir().equals("0")){ | 1386 | if(s.getXlDir().equals("0")){ |
| 1385 | listInfo0.add(s); | 1387 | listInfo0.add(s); |
| 1386 | }else{ | 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,76 +1396,80 @@ public class CulateMileageServiceImpl implements CulateMileageService{ | ||
| 1394 | int djgcsq=0; | 1396 | int djgcsq=0; |
| 1395 | long djcsj=0l; | 1397 | long djcsj=0l; |
| 1396 | for (int i = 0; i < listInfo0.size(); i++) { | 1398 | for (int i = 0; i < listInfo0.size(); i++) { |
| 1397 | - ScheduleRealInfo s=listInfo.get(i); | 1399 | + ScheduleRealInfo s=listInfo0.get(i); |
| 1398 | Long fcsjTime=s.getFcsjActualTime(); | 1400 | Long fcsjTime=s.getFcsjActualTime(); |
| 1399 | String time=s.getFcsjActual(); | 1401 | String time=s.getFcsjActual(); |
| 1400 | String[] fcsjStr = time.split(":"); | 1402 | String[] fcsjStr = time.split(":"); |
| 1401 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | 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 | Long djg=0l; | 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 | for (int i = 0; i < listInfo1.size(); i++) { | 1438 | for (int i = 0; i < listInfo1.size(); i++) { |
| 1435 | - ScheduleRealInfo s=listInfo.get(i); | 1439 | + ScheduleRealInfo s=listInfo1.get(i); |
| 1436 | Long fcsjTime=s.getFcsjActualTime(); | 1440 | Long fcsjTime=s.getFcsjActualTime(); |
| 1437 | String time=s.getFcsjActual(); | 1441 | String time=s.getFcsjActual(); |
| 1438 | String[] fcsjStr = time.split(":"); | 1442 | String[] fcsjStr = time.split(":"); |
| 1439 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | 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 | Long djg=0l; | 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,7 +229,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 229 | 229 | ||
| 230 | 230 | ||
| 231 | public List<ArrivalInfo> load2(String line,Long date1,Long date2,Date dates1,Date dates2,String zd,String zdlx,String fcsj){ | 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 | Calendar cal = Calendar.getInstance(); | 233 | Calendar cal = Calendar.getInstance(); |
| 234 | cal.setTime(dates1); | 234 | cal.setTime(dates1); |
| 235 | //周数,表分区字段 | 235 | //周数,表分区字段 |
| @@ -295,6 +295,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -295,6 +295,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 295 | } | 295 | } |
| 296 | 296 | ||
| 297 | if (type != null && type.length() != 0 && type.equals("export_msg")) { | 297 | if (type != null && type.length() != 0 && type.equals("export_msg")) { |
| 298 | + String lineName = BasicData.lineCode2NameMap.get(line); | ||
| 298 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 299 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 299 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 300 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 300 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 301 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -316,7 +317,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -316,7 +317,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 316 | listI.add(newList.iterator()); | 317 | listI.add(newList.iterator()); |
| 317 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 318 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 318 | ee.excelReplace(listI, new Object[]{m}, path + "mould/message.xls", | 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 | } catch (Exception e) { | 322 | } catch (Exception e) { |
| 321 | // TODO: handle exception | 323 | // TODO: handle exception |
| 322 | e.printStackTrace(); | 324 | e.printStackTrace(); |
| @@ -2482,6 +2484,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -2482,6 +2484,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2482 | lMap.add(newMap); | 2484 | lMap.add(newMap); |
| 2483 | } | 2485 | } |
| 2484 | if(type.equals("export")){ | 2486 | if(type.equals("export")){ |
| 2487 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 2488 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 2485 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 2489 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 2486 | Map<String, Object> m = new HashMap<String, Object>(); | 2490 | Map<String, Object> m = new HashMap<String, Object>(); |
| 2487 | m.put("date", date); | 2491 | m.put("date", date); |
| @@ -2495,10 +2499,17 @@ public class ReportServiceImpl implements ReportService{ | @@ -2495,10 +2499,17 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2495 | } | 2499 | } |
| 2496 | ReportUtils ee = new ReportUtils(); | 2500 | ReportUtils ee = new ReportUtils(); |
| 2497 | try { | 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 | listI.add(lMap.iterator()); | 2509 | listI.add(lMap.iterator()); |
| 2499 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 2510 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 2500 | ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls, | 2511 | ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls, |
| 2501 | - path + "export/线路公里统计表.xls"); | 2512 | + path + "export/"+dateTime+"-"+xlName+"-线路公里统计表.xls"); |
| 2502 | } catch (Exception e) { | 2513 | } catch (Exception e) { |
| 2503 | // TODO: handle exception | 2514 | // TODO: handle exception |
| 2504 | e.printStackTrace(); | 2515 | e.printStackTrace(); |
| @@ -2962,6 +2973,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -2962,6 +2973,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2962 | 2973 | ||
| 2963 | } | 2974 | } |
| 2964 | if(type.equals("export")){ | 2975 | if(type.equals("export")){ |
| 2976 | + SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 2977 | + sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 2965 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 2978 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 2966 | Map<String, Object> m = new HashMap<String, Object>(); | 2979 | Map<String, Object> m = new HashMap<String, Object>(); |
| 2967 | m.put("date", date); | 2980 | m.put("date", date); |
| @@ -2986,10 +2999,17 @@ public class ReportServiceImpl implements ReportService{ | @@ -2986,10 +2999,17 @@ public class ReportServiceImpl implements ReportService{ | ||
| 2986 | } | 2999 | } |
| 2987 | ReportUtils ee = new ReportUtils(); | 3000 | ReportUtils ee = new ReportUtils(); |
| 2988 | try { | 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 | listI.add(lMap.iterator()); | 3009 | listI.add(lMap.iterator()); |
| 2990 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 3010 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 2991 | ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls, | 3011 | ee.excelReplace(listI, new Object[]{m}, path + "mould/"+xls, |
| 2992 | - path + "export/路单数据统计表.xls"); | 3012 | + path + "export/"+dateTime+"-"+xlName+"-路单数据统计表.xls"); |
| 2993 | } catch (Exception e) { | 3013 | } catch (Exception e) { |
| 2994 | // TODO: handle exception | 3014 | // TODO: handle exception |
| 2995 | e.printStackTrace(); | 3015 | e.printStackTrace(); |
| @@ -3304,7 +3324,7 @@ public class ReportServiceImpl implements ReportService{ | @@ -3304,7 +3324,7 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3304 | if(s.getXlDir().equals("0")){ | 3324 | if(s.getXlDir().equals("0")){ |
| 3305 | listInfo0.add(s); | 3325 | listInfo0.add(s); |
| 3306 | }else{ | 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,14 +3337,14 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3317 | int djgcs=0; | 3337 | int djgcs=0; |
| 3318 | List<Map<String, Object>> mapList=new ArrayList<Map<String, Object>>(); | 3338 | List<Map<String, Object>> mapList=new ArrayList<Map<String, Object>>(); |
| 3319 | for (int i = 0; i < listInfo0.size(); i++) { | 3339 | for (int i = 0; i < listInfo0.size(); i++) { |
| 3320 | - ScheduleRealInfo s=listInfo.get(i); | 3340 | + ScheduleRealInfo s=listInfo0.get(i); |
| 3321 | Long fcsjTime=s.getFcsjActualTime(); | 3341 | Long fcsjTime=s.getFcsjActualTime(); |
| 3322 | String time=s.getFcsjActual(); | 3342 | String time=s.getFcsjActual(); |
| 3323 | String[] fcsjStr = time.split(":"); | 3343 | String[] fcsjStr = time.split(":"); |
| 3324 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | 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 | Long djg=0l; | 3346 | Long djg=0l; |
| 3327 | - Long fscjNext=listInfo.get(i+1).getFcsjActualTime(); | 3347 | + Long fscjNext=listInfo0.get(i+1).getFcsjActualTime(); |
| 3328 | if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){ | 3348 | if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){ |
| 3329 | djg = (long) (peak*60*1000); | 3349 | djg = (long) (peak*60*1000); |
| 3330 | if(fscjNext-fcsjTime>djg){ | 3350 | if(fscjNext-fcsjTime>djg){ |
| @@ -3335,8 +3355,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -3335,8 +3355,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3335 | m.put("djgde", grade); | 3355 | m.put("djgde", grade); |
| 3336 | m.put("qJh", s.getFcsj()); | 3356 | m.put("qJh", s.getFcsj()); |
| 3337 | m.put("qSj", time); | 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 | m.put("djgsj", peak); | 3360 | m.put("djgsj", peak); |
| 3341 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); | 3361 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); |
| 3342 | mapList.add(m); | 3362 | mapList.add(m); |
| @@ -3351,8 +3371,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -3351,8 +3371,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3351 | m.put("djgde", grade); | 3371 | m.put("djgde", grade); |
| 3352 | m.put("qJh", s.getFcsj()); | 3372 | m.put("qJh", s.getFcsj()); |
| 3353 | m.put("qSj", time); | 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 | m.put("djgsj", trough); | 3376 | m.put("djgsj", trough); |
| 3357 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); | 3377 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); |
| 3358 | mapList.add(m); | 3378 | mapList.add(m); |
| @@ -3362,14 +3382,14 @@ public class ReportServiceImpl implements ReportService{ | @@ -3362,14 +3382,14 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3362 | } | 3382 | } |
| 3363 | 3383 | ||
| 3364 | for (int i = 0; i < listInfo1.size(); i++) { | 3384 | for (int i = 0; i < listInfo1.size(); i++) { |
| 3365 | - ScheduleRealInfo s=listInfo.get(i); | 3385 | + ScheduleRealInfo s=listInfo1.get(i); |
| 3366 | Long fcsjTime=s.getFcsjActualTime(); | 3386 | Long fcsjTime=s.getFcsjActualTime(); |
| 3367 | String time=s.getFcsjActual(); | 3387 | String time=s.getFcsjActual(); |
| 3368 | String[] fcsjStr = time.split(":"); | 3388 | String[] fcsjStr = time.split(":"); |
| 3369 | long fcsj= Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | 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 | Long djg=0l; | 3391 | Long djg=0l; |
| 3372 | - Long fscjNext=listInfo.get(i+1).getFcsjActualTime(); | 3392 | + Long fscjNext=listInfo1.get(i+1).getFcsjActualTime(); |
| 3373 | if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){ | 3393 | if((fcsj>=zgf1&&fcsj<=zgf2)||(fcsj>=wgf1&&fcsj<=wgf2)){ |
| 3374 | djg = (long) (peak*60*1000); | 3394 | djg = (long) (peak*60*1000); |
| 3375 | if(fscjNext-fcsjTime>djg){ | 3395 | if(fscjNext-fcsjTime>djg){ |
| @@ -3380,8 +3400,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -3380,8 +3400,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3380 | m.put("djgde", grade); | 3400 | m.put("djgde", grade); |
| 3381 | m.put("qJh", s.getFcsj()); | 3401 | m.put("qJh", s.getFcsj()); |
| 3382 | m.put("qSj", time); | 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 | m.put("djgsj", peak); | 3405 | m.put("djgsj", peak); |
| 3386 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); | 3406 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); |
| 3387 | mapList.add(m); | 3407 | mapList.add(m); |
| @@ -3396,8 +3416,8 @@ public class ReportServiceImpl implements ReportService{ | @@ -3396,8 +3416,8 @@ public class ReportServiceImpl implements ReportService{ | ||
| 3396 | m.put("djgde", grade); | 3416 | m.put("djgde", grade); |
| 3397 | m.put("qJh", s.getFcsj()); | 3417 | m.put("qJh", s.getFcsj()); |
| 3398 | m.put("qSj", time); | 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 | m.put("djgsj", trough); | 3421 | m.put("djgsj", trough); |
| 3402 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); | 3422 | m.put("bcjgsj", (fscjNext-fcsjTime)/60000); |
| 3403 | mapList.add(m); | 3423 | mapList.add(m); |
src/main/java/com/bsth/service/report/impl/SheetServiceImpl.java
| @@ -614,16 +614,26 @@ public class SheetServiceImpl extends BaseServiceImpl<Sheet, Integer> implements | @@ -614,16 +614,26 @@ public class SheetServiceImpl extends BaseServiceImpl<Sheet, Integer> implements | ||
| 614 | } | 614 | } |
| 615 | 615 | ||
| 616 | if(map.containsKey("type") && map.get("type").toString().equals("export")){ | 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 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 620 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 618 | Map<String, Object> m = new HashMap<String, Object>(); | 621 | Map<String, Object> m = new HashMap<String, Object>(); |
| 619 | m.put("date", date); | 622 | m.put("date", date); |
| 620 | m.put("endDate", endDate); | 623 | m.put("endDate", endDate); |
| 621 | ReportUtils ee = new ReportUtils(); | 624 | ReportUtils ee = new ReportUtils(); |
| 622 | try { | 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 | listI.add(listmap.iterator()); | 633 | listI.add(listmap.iterator()); |
| 624 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | 634 | String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; |
| 625 | ee.excelReplace(listI, new Object[]{m}, path + "mould/" + "sheetList.xls", | 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 | } catch (Exception e) { | 637 | } catch (Exception e) { |
| 628 | // TODO: handle exception | 638 | // TODO: handle exception |
| 629 | e.printStackTrace(); | 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 +6,7 @@ import com.bsth.service.schedule.datatools.TTinfoDetailDynamicData; | ||
| 6 | import com.bsth.service.schedule.exception.ScheduleException; | 6 | import com.bsth.service.schedule.exception.ScheduleException; |
| 7 | import com.bsth.service.schedule.timetable.ExcelFormatType; | 7 | import com.bsth.service.schedule.timetable.ExcelFormatType; |
| 8 | import com.bsth.service.schedule.utils.DataToolsFile; | 8 | import com.bsth.service.schedule.utils.DataToolsFile; |
| 9 | +import com.bsth.service.schedule.utils.DataToolsFileType; | ||
| 9 | 10 | ||
| 10 | import java.util.List; | 11 | import java.util.List; |
| 11 | import java.util.Map; | 12 | import java.util.Map; |
| @@ -30,7 +31,7 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | @@ -30,7 +31,7 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | ||
| 30 | * @return | 31 | * @return |
| 31 | * @throws ScheduleException | 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,10 +14,6 @@ import org.apache.commons.lang3.StringUtils; | ||
| 14 | import org.apache.poi.ss.usermodel.Cell; | 14 | import org.apache.poi.ss.usermodel.Cell; |
| 15 | import org.apache.poi.ss.usermodel.Row; | 15 | import org.apache.poi.ss.usermodel.Row; |
| 16 | import org.apache.poi.ss.util.CellRangeAddress; | 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 | import org.apache.poi.xssf.usermodel.XSSFWorkbook; | 17 | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| 22 | import org.joda.time.DateTime; | 18 | import org.joda.time.DateTime; |
| 23 | import org.joda.time.LocalTime; | 19 | import org.joda.time.LocalTime; |
| @@ -31,7 +27,6 @@ import org.springframework.stereotype.Service; | @@ -31,7 +27,6 @@ import org.springframework.stereotype.Service; | ||
| 31 | 27 | ||
| 32 | import java.awt.*; | 28 | import java.awt.*; |
| 33 | import java.io.File; | 29 | import java.io.File; |
| 34 | -import java.io.FileOutputStream; | ||
| 35 | import java.io.PrintWriter; | 30 | import java.io.PrintWriter; |
| 36 | import java.io.StringWriter; | 31 | import java.io.StringWriter; |
| 37 | import java.util.*; | 32 | import java.util.*; |
| @@ -438,14 +433,14 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | @@ -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 | //-------------------------------- 1、路牌班次数据 -------------------------------// | 439 | //-------------------------------- 1、路牌班次数据 -------------------------------// |
| 445 | List<LpObj> lpObjList = dtInfos.getLpObjList(); | 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 | if (lpObjList.size() == 0) { | 444 | if (lpObjList.size() == 0) { |
| 450 | throw new RuntimeException("没有班次数据!"); | 445 | throw new RuntimeException("没有班次数据!"); |
| 451 | } | 446 | } |
| @@ -455,40 +450,36 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | @@ -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 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); | 455 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); |
| 460 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); | 456 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); |
| 461 | for (int i = 0; i < groupCount; i++) { | 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 | for (int i = 0; i < lpObjList.size(); i++) { | 465 | for (int i = 0; i < lpObjList.size(); i++) { |
| 474 | LpObj lpObj = lpObjList.get(i); | 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 | for (int j = 0; j < groupCount; j++) { | 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 | for (BcObj bcObj : lpObj.getBcObjList()) { | 473 | for (BcObj bcObj : lpObj.getBcObjList()) { |
| 482 | if (bcObj.getBcType() == BcType.NORMAL) { | 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 | lpObj.getZgs() / 60); | 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 | lpObj.getZbc()); | 483 | lpObj.getZbc()); |
| 493 | } | 484 | } |
| 494 | 485 | ||
| @@ -514,9 +505,9 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | @@ -514,9 +505,9 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | ||
| 514 | 505 | ||
| 515 | int startrow = lpObjList.size() + 3; | 506 | int startrow = lpObjList.size() + 3; |
| 516 | for (int i = startrow; i <= startrow + 22; i++) { | 507 | for (int i = startrow; i <= startrow + 22; i++) { |
| 517 | - XSSFRow xssfRow = sheet.createRow(i); | 508 | + Row row = excelPoiOperator.createSheetRow(sheet, i); |
| 518 | for (int j = 0; j < 10; j++) { | 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,27 +528,27 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | ||
| 537 | StatInfo statInfo = statInfos.get(i); | 528 | StatInfo statInfo = statInfos.get(i); |
| 538 | 529 | ||
| 539 | // 1、统计序号 | 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 | sheet.getRow(startrow + 2 + i).getCell(0).setCellValue(i); | 532 | sheet.getRow(startrow + 2 + i).getCell(0).setCellValue(i); |
| 542 | 533 | ||
| 543 | // 2、统计项目 | 534 | // 2、统计项目 |
| 544 | sheet.getRow(startrow + 2 + i).getCell(1).setCellValue(statInfo.getStatItem()); | 535 | sheet.getRow(startrow + 2 + i).getCell(1).setCellValue(statInfo.getStatItem()); |
| 545 | 536 | ||
| 546 | // 3、统计数值 | 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 | sheet.getRow(startrow + 2 + i).getCell(9).setCellValue(statInfo.getStatValue()); | 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 | //-------------------------------- 1、路牌班次数据 -------------------------------// | 547 | //-------------------------------- 1、路牌班次数据 -------------------------------// |
| 557 | List<LpObj> lpObjList = dtInfos.getLpObjList(); | 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 | if (lpObjList.size() == 0) { | 552 | if (lpObjList.size() == 0) { |
| 562 | throw new RuntimeException("没有班次数据!"); | 553 | throw new RuntimeException("没有班次数据!"); |
| 563 | } | 554 | } |
| @@ -567,72 +558,61 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | @@ -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 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); | 567 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); |
| 572 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); | 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 | for (int i = 1; i <= groupCount; i++) { | 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 | // 1个分班进场班次插入到前面的班次 | 575 | // 1个分班进场班次插入到前面的班次 |
| 586 | // 后面添加两个班次,1个到场班次,1个离场班次 | 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 | for (int i = 0; i < lpObjList.size(); i++) { | 590 | for (int i = 0; i < lpObjList.size(); i++) { |
| 608 | LpObj lpObj = lpObjList.get(i); | 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 | for (int j = 1; j <= groupCount; j++) { | 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 | for (int j = 0; j < lpObj.getBcObjList().size(); j++) { | 614 | for (int j = 0; j < lpObj.getBcObjList().size(); j++) { |
| 634 | BcObj bcObj = lpObj.getBcObjList().get(j); // 当前班次 | 615 | BcObj bcObj = lpObj.getBcObjList().get(j); // 当前班次 |
| 635 | - Cell cell = null; // 待处理的单元格 | ||
| 636 | 616 | ||
| 637 | switch (bcObj.getBcType()) { | 617 | switch (bcObj.getBcType()) { |
| 638 | case BD: // 报到班次 | 618 | case BD: // 报到班次 |
| @@ -680,14 +660,16 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | @@ -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 | String.format("%d%s%d", (int) (lpObj.getZgs() / 60), ":", (int) (lpObj.getZgs() % 60))); | 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 | String.format("%d%s%d", (int) (lpObj.getYygs() / 60), ":", (int) (lpObj.getYygs() % 60))); | 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,24 +692,33 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | ||
| 710 | } | 692 | } |
| 711 | 693 | ||
| 712 | @Override | 694 | @Override |
| 713 | - public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos) throws ScheduleException { | 695 | + public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos, DataToolsFileType type) throws ScheduleException { |
| 714 | try { | 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 | // 使用POI,创建xlsx文件 | 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 | // wb内存写入文件 | 711 | // wb内存写入文件 |
| 721 | String filepath = dataToolsProperties.getFileoutputDir() + | 712 | String filepath = dataToolsProperties.getFileoutputDir() + |
| 722 | File.separator + | 713 | File.separator + |
| 723 | "动态时刻表-" + | 714 | "动态时刻表-" + |
| 724 | new DateTime().toString("yyyyMMddHHmmss") + ".xlsx"; | 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 | DataToolsFile dataToolsFile = new DataToolsFile(); | 719 | DataToolsFile dataToolsFile = new DataToolsFile(); |
| 729 | dataToolsFile.setFileType(DataToolsFileType.XLSX); | 720 | dataToolsFile.setFileType(DataToolsFileType.XLSX); |
| 730 | - dataToolsFile.setFile(new File(filepath)); | 721 | + dataToolsFile.setFile(file); |
| 731 | 722 | ||
| 732 | return dataToolsFile; | 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,6 +2,7 @@ package com.bsth.service.schedule.datatools; | ||
| 2 | 2 | ||
| 3 | import com.bsth.service.schedule.exception.ScheduleException; | 3 | import com.bsth.service.schedule.exception.ScheduleException; |
| 4 | import com.bsth.service.schedule.utils.DataToolsFile; | 4 | import com.bsth.service.schedule.utils.DataToolsFile; |
| 5 | +import com.bsth.service.schedule.utils.DataToolsFileType; | ||
| 5 | import com.fasterxml.jackson.annotation.JsonCreator; | 6 | import com.fasterxml.jackson.annotation.JsonCreator; |
| 6 | import com.fasterxml.jackson.annotation.JsonValue; | 7 | import com.fasterxml.jackson.annotation.JsonValue; |
| 7 | 8 | ||
| @@ -374,5 +375,5 @@ public interface TTinfoDetailDynamicData { | @@ -374,5 +375,5 @@ public interface TTinfoDetailDynamicData { | ||
| 374 | * @return | 375 | * @return |
| 375 | * @throws ScheduleException | 376 | * @throws ScheduleException |
| 376 | */ | 377 | */ |
| 377 | - public DataToolsFile exportDynamicTTinfo(DTInfos dtInfos) throws ScheduleException; | ||
| 378 | -} | ||
| 379 | \ No newline at end of file | 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,6 +293,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | if(type.equals("export")){ | 295 | if(type.equals("export")){ |
| 296 | + String lineName = ""; | ||
| 297 | + if(map.containsKey("lineName")) | ||
| 298 | + lineName = map.get("lineName").toString(); | ||
| 296 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 299 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 297 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 300 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 298 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 301 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -302,7 +305,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -302,7 +305,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 302 | listI.add(resList.iterator()); | 305 | listI.add(resList.iterator()); |
| 303 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 306 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 304 | ee.excelReplace(listI, new Object[] { m }, path+"mould/peoCarPlan.xls", | 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 | } catch (Exception e) { | 310 | } catch (Exception e) { |
| 307 | // TODO: handle exception | 311 | // TODO: handle exception |
| 308 | e.printStackTrace(); | 312 | e.printStackTrace(); |
| @@ -341,7 +345,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -341,7 +345,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 341 | keyMap.get(key).add(schedule); | 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 | Long zgfBegin = 0l; | 349 | Long zgfBegin = 0l; |
| 346 | Long zgfEnd = 0l; | 350 | Long zgfEnd = 0l; |
| 347 | Long wgfBegin = 0l; | 351 | Long wgfBegin = 0l; |
| @@ -513,6 +517,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -513,6 +517,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 513 | } | 517 | } |
| 514 | 518 | ||
| 515 | if(type.equals("export")){ | 519 | if(type.equals("export")){ |
| 520 | + String lineName = ""; | ||
| 521 | + if(map.containsKey("lineName")) | ||
| 522 | + lineName = map.get("lineName").toString(); | ||
| 516 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 523 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 517 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 524 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 518 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 525 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -522,7 +529,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -522,7 +529,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 522 | listI.add(resList.iterator()); | 529 | listI.add(resList.iterator()); |
| 523 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 530 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 524 | ee.excelReplace(listI, new Object[] { m }, path+"mould/workDaily.xls", | 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 | } catch (Exception e) { | 534 | } catch (Exception e) { |
| 527 | // TODO: handle exception | 535 | // TODO: handle exception |
| 528 | e.printStackTrace(); | 536 | e.printStackTrace(); |
| @@ -810,6 +818,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -810,6 +818,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 810 | 818 | ||
| 811 | //导出 | 819 | //导出 |
| 812 | if(type.equals("export")){ | 820 | if(type.equals("export")){ |
| 821 | + String lineName = ""; | ||
| 822 | + if(map.containsKey("lineName")) | ||
| 823 | + lineName = map.get("lineName").toString(); | ||
| 813 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 824 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 814 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 825 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 815 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 826 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -819,7 +830,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -819,7 +830,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 819 | listI.add(resList.iterator()); | 830 | listI.add(resList.iterator()); |
| 820 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 831 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 821 | ee.excelReplace(listI, new Object[] { m }, path+"mould/scheduleAnaly.xls", | 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 | } catch (Exception e) { | 837 | } catch (Exception e) { |
| 824 | // TODO: handle exception | 838 | // TODO: handle exception |
| 825 | e.printStackTrace(); | 839 | e.printStackTrace(); |
| @@ -1110,16 +1124,26 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1110,16 +1124,26 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1110 | 1124 | ||
| 1111 | //导出 | 1125 | //导出 |
| 1112 | if(type.equals("export")){ | 1126 | if(type.equals("export")){ |
| 1127 | + String lineName_ = ""; | ||
| 1128 | + if(map.containsKey("lineName")) | ||
| 1129 | + lineName_ = map.get("lineName").toString(); | ||
| 1113 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 1130 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 1114 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 1131 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 1115 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 1132 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 1116 | Map<String,Object> m = new HashMap<String, Object>(); | 1133 | Map<String,Object> m = new HashMap<String, Object>(); |
| 1117 | ReportUtils ee = new ReportUtils(); | 1134 | ReportUtils ee = new ReportUtils(); |
| 1118 | try { | 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 | listI.add(tempList.iterator()); | 1143 | listI.add(tempList.iterator()); |
| 1120 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 1144 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 1121 | ee.excelReplace(listI, new Object[] { m }, path+"mould/scheduleAnaly_sum.xls", | 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 | } catch (Exception e) { | 1147 | } catch (Exception e) { |
| 1124 | // TODO: handle exception | 1148 | // TODO: handle exception |
| 1125 | e.printStackTrace(); | 1149 | e.printStackTrace(); |
| @@ -1370,6 +1394,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1370,6 +1394,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1370 | } | 1394 | } |
| 1371 | 1395 | ||
| 1372 | if(type.equals("export")){ | 1396 | if(type.equals("export")){ |
| 1397 | + String lineName = ""; | ||
| 1398 | + if(map.containsKey("lineName")) | ||
| 1399 | + lineName = map.get("lineName").toString(); | ||
| 1373 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 1400 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 1374 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 1401 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 1375 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 1402 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -1379,7 +1406,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1379,7 +1406,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1379 | listI.add(resList.iterator()); | 1406 | listI.add(resList.iterator()); |
| 1380 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 1407 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 1381 | ee.excelReplace(listI, new Object[] { m }, path+"mould/firstAndLastBus.xls", | 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 | } catch (Exception e) { | 1411 | } catch (Exception e) { |
| 1384 | // TODO: handle exception | 1412 | // TODO: handle exception |
| 1385 | e.printStackTrace(); | 1413 | e.printStackTrace(); |
| @@ -1723,10 +1751,24 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1723,10 +1751,24 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1723 | if(!type.equals("export")) | 1751 | if(!type.equals("export")) |
| 1724 | resList.add(tempMap); | 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 | if(type.equals("export")){ | 1771 | if(type.equals("export")){ |
| 1728 | - SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | ||
| 1729 | - sdfSimple = new SimpleDateFormat("yyyyMMdd"); | ||
| 1730 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 1772 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| 1731 | Map<String,Object> m = new HashMap<String, Object>(); | 1773 | Map<String,Object> m = new HashMap<String, Object>(); |
| 1732 | ReportUtils ee = new ReportUtils(); | 1774 | ReportUtils ee = new ReportUtils(); |
| @@ -1734,8 +1776,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1734,8 +1776,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1734 | listI.add(resList.iterator()); | 1776 | listI.add(resList.iterator()); |
| 1735 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 1777 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 1736 | ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_sum.xls", | 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 | } catch (Exception e) { | 1780 | } catch (Exception e) { |
| 1740 | // TODO: handle exception | 1781 | // TODO: handle exception |
| 1741 | e.printStackTrace(); | 1782 | e.printStackTrace(); |
| @@ -1750,7 +1791,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1750,7 +1791,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1750 | listI.add(resList.iterator()); | 1791 | listI.add(resList.iterator()); |
| 1751 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 1792 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 1752 | ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_map.xls", | 1793 | ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_map.xls", |
| 1753 | - path+"export/线路首末班明细.xls"); | 1794 | + path+"export/" + dateTime + "-" + lineName + "-线路首末班明细.xls"); |
| 1754 | } catch (Exception e) { | 1795 | } catch (Exception e) { |
| 1755 | // TODO: handle exception | 1796 | // TODO: handle exception |
| 1756 | e.printStackTrace(); | 1797 | e.printStackTrace(); |
| @@ -1765,7 +1806,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -1765,7 +1806,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 1765 | listI.add(resList.iterator()); | 1806 | listI.add(resList.iterator()); |
| 1766 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 1807 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 1767 | ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_delay.xls", | 1808 | ee.excelReplace(listI, new Object[] { tempMap }, path+"mould/firstAndLastBus_delay.xls", |
| 1768 | - path+"export/首末班误点班次.xls"); | 1809 | + path+"export/" + dateTime + "-" + lineName + "-首末班误点班次.xls"); |
| 1769 | } catch (Exception e) { | 1810 | } catch (Exception e) { |
| 1770 | // TODO: handle exception | 1811 | // TODO: handle exception |
| 1771 | e.printStackTrace(); | 1812 | e.printStackTrace(); |
| @@ -2008,11 +2049,23 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -2008,11 +2049,23 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 2008 | // TODO Auto-generated catch block | 2049 | // TODO Auto-generated catch block |
| 2009 | e.printStackTrace(); | 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 | sql="SELECT sch,TIMESTAMP,reply46,reply47,reply46time,reply47time" | 2064 | sql="SELECT sch,TIMESTAMP,reply46,reply47,reply46time,reply47time" |
| 2013 | + " FROM bsth_v_directive_60 WHERE is_dispatch = 1 AND sch is not null" | 2065 | + " FROM bsth_v_directive_60 WHERE is_dispatch = 1 AND sch is not null" |
| 2014 | + " AND TIMESTAMP >= "+(dateTime.getTime()) | 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 | List<Map<String, Object>> list2 = jdbcTemplate.query(sql, | 2070 | List<Map<String, Object>> list2 = jdbcTemplate.query(sql, |
| 2018 | new RowMapper<Map<String, Object>>(){ | 2071 | new RowMapper<Map<String, Object>>(){ |
| @@ -2125,6 +2178,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -2125,6 +2178,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 2125 | } | 2178 | } |
| 2126 | 2179 | ||
| 2127 | if(type.equals("export")){ | 2180 | if(type.equals("export")){ |
| 2181 | + String lineName = ""; | ||
| 2182 | + if(map.containsKey("lineName")) | ||
| 2183 | + lineName = map.get("lineName").toString(); | ||
| 2128 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 2184 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 2129 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 2185 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 2130 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 2186 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -2134,7 +2190,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -2134,7 +2190,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 2134 | listI.add(list_.iterator()); | 2190 | listI.add(list_.iterator()); |
| 2135 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 2191 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 2136 | ee.excelReplace(listI, new Object[] { m }, path+"mould/commandState.xls", | 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 | } catch (Exception e) { | 2195 | } catch (Exception e) { |
| 2139 | // TODO: handle exception | 2196 | // TODO: handle exception |
| 2140 | e.printStackTrace(); | 2197 | e.printStackTrace(); |
| @@ -2187,11 +2244,23 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -2187,11 +2244,23 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 2187 | // TODO Auto-generated catch block | 2244 | // TODO Auto-generated catch block |
| 2188 | e.printStackTrace(); | 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 | sql="SELECT sch,TIMESTAMP,reply46,reply47,reply46time,reply47time" | 2259 | sql="SELECT sch,TIMESTAMP,reply46,reply47,reply46time,reply47time" |
| 2192 | + " FROM bsth_v_directive_60 WHERE is_dispatch = 1 AND sch is not null" | 2260 | + " FROM bsth_v_directive_60 WHERE is_dispatch = 1 AND sch is not null" |
| 2193 | + " AND TIMESTAMP >= "+(dateTime.getTime()) | 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 | List<Map<String, Object>> list2 = jdbcTemplate.query(sql, | 2265 | List<Map<String, Object>> list2 = jdbcTemplate.query(sql, |
| 2197 | new RowMapper<Map<String, Object>>(){ | 2266 | new RowMapper<Map<String, Object>>(){ |
| @@ -2309,6 +2378,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -2309,6 +2378,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 2309 | 2378 | ||
| 2310 | 2379 | ||
| 2311 | if(type.equals("export")){ | 2380 | if(type.equals("export")){ |
| 2381 | + String lineName = ""; | ||
| 2382 | + if(map.containsKey("lineName")) | ||
| 2383 | + lineName = map.get("lineName").toString(); | ||
| 2312 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 2384 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 2313 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 2385 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 2314 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 2386 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -2319,7 +2391,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -2319,7 +2391,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 2319 | listI.add(list_.iterator()); | 2391 | listI.add(list_.iterator()); |
| 2320 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 2392 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 2321 | ee.excelReplace(listI, new Object[] { m }, path+"mould/commandState1.xls", | 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 | } catch (Exception e) { | 2396 | } catch (Exception e) { |
| 2324 | // TODO: handle exception | 2397 | // TODO: handle exception |
| 2325 | e.printStackTrace(); | 2398 | e.printStackTrace(); |
| @@ -2337,7 +2410,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -2337,7 +2410,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 2337 | String date = map.get("date").toString(); | 2410 | String date = map.get("date").toString(); |
| 2338 | String jgh = map.get("jgh").toString(); | 2411 | String jgh = map.get("jgh").toString(); |
| 2339 | // String code = map.get("code").toString(); | 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 | String sql_="select * from bsth_c_s_sp_info_real " | 2417 | String sql_="select * from bsth_c_s_sp_info_real " |
| 2343 | + " WHERE schedule_date_str = '"+date+"' and j_gh = '"+jgh+"'"; | 2418 | + " WHERE schedule_date_str = '"+date+"' and j_gh = '"+jgh+"'"; |
| @@ -2409,6 +2484,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -2409,6 +2484,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 2409 | } | 2484 | } |
| 2410 | 2485 | ||
| 2411 | if(type.equals("export")){ | 2486 | if(type.equals("export")){ |
| 2487 | + String jName = map.get("jName").toString(); | ||
| 2412 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), | 2488 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), |
| 2413 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 2489 | sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 2414 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 2490 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
| @@ -2418,7 +2494,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | @@ -2418,7 +2494,8 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { | ||
| 2418 | listI.add(list_.iterator()); | 2494 | listI.add(list_.iterator()); |
| 2419 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; | 2495 | String path = this.getClass().getResource("/").getPath()+"static/pages/forms/"; |
| 2420 | ee.excelReplace(listI, new Object[] { m }, path+"mould/commandState2.xls", | 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 | } catch (Exception e) { | 2499 | } catch (Exception e) { |
| 2423 | // TODO: handle exception | 2500 | // TODO: handle exception |
| 2424 | e.printStackTrace(); | 2501 | e.printStackTrace(); |
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
| @@ -145,8 +145,8 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -145,8 +145,8 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | @Override | 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 | @Override | 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 | \ No newline at end of file | 19 | \ No newline at end of file |
src/main/resources/static/pages/base/timesmodel/gantt.html
| @@ -50,9 +50,31 @@ | @@ -50,9 +50,31 @@ | ||
| 50 | <!--<div class="btn-group btn-group-devided checkbtn" data-toggle="buttons">--> | 50 | <!--<div class="btn-group btn-group-devided checkbtn" data-toggle="buttons">--> |
| 51 | <!--<a class="btn btn-circle blue checkAdd" href="javascript:;" data-pjax><i class="fa fa-check"></i> 保存数据</a>--> | 51 | <!--<a class="btn btn-circle blue checkAdd" href="javascript:;" data-pjax><i class="fa fa-check"></i> 保存数据</a>--> |
| 52 | <!--</div>--> | 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 | </div> | 74 | </div> |
| 75 | + | ||
| 76 | + | ||
| 77 | + | ||
| 56 | <div class="btn-group checkbtn"> | 78 | <div class="btn-group checkbtn"> |
| 57 | <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown" aria-expanded="false"> | 79 | <a href="javascript:" class="btn red btn-outline btn-circle" data-toggle="dropdown" aria-expanded="false"> |
| 58 | <i class="fa fa-cog"></i> | 80 | <i class="fa fa-cog"></i> |
src/main/resources/static/pages/base/timesmodel/js/gantt.js
| @@ -83,7 +83,6 @@ | @@ -83,7 +83,6 @@ | ||
| 83 | // TODO:绘制gantt图表 | 83 | // TODO:绘制gantt图表 |
| 84 | // TODO:var seDate = getksjssj(null,seMap.s); 关联参数必须设置 | 84 | // TODO:var seDate = getksjssj(null,seMap.s); 关联参数必须设置 |
| 85 | // TODO:CSMap.maxCar 之后要设定一下的 | 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 | data = Main_v2.BXPplaceClassesTime03(_paramObj, CSMap.maxCar); | 86 | data = Main_v2.BXPplaceClassesTime03(_paramObj, CSMap.maxCar); |
| 88 | Main_v2.exportDataConfig(data.aInternalLpObj); | 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,6 +1548,8 @@ var InternalScheduleObj = function(paramObj, lpArray, factory) { | ||
| 1548 | oLp.fnGetBcChainInfo(0)["e_q"], | 1548 | oLp.fnGetBcChainInfo(0)["e_q"], |
| 1549 | oLp.fnGetBcChainInfo(0)["e_b"] | 1549 | oLp.fnGetBcChainInfo(0)["e_b"] |
| 1550 | ); | 1550 | ); |
| 1551 | + oEndBc.fnSetIsLastBc(false); // 有可能最后一个班次是吃饭班次,重置 | ||
| 1552 | + oEndBc.fnSetEatTime(0); // 有可能最后一个班次是吃饭班次,重置 | ||
| 1551 | aOtherBc.push(_factory.createBcObj( | 1553 | aOtherBc.push(_factory.createBcObj( |
| 1552 | oLp, "in", true, 1, | 1554 | oLp, "in", true, 1, |
| 1553 | oEndBc.getArrTimeObj(), | 1555 | oEndBc.getArrTimeObj(), |
src/main/resources/static/pages/base/timesmodel/js/v2/main_v2.js
| @@ -821,7 +821,7 @@ var Main_v2 = function() { | @@ -821,7 +821,7 @@ var Main_v2 = function() { | ||
| 821 | * @param aInternalLpObj 内部路牌对象列表 | 821 | * @param aInternalLpObj 内部路牌对象列表 |
| 822 | */ | 822 | */ |
| 823 | exportDataConfig: function(aInternalLpObj) { | 823 | exportDataConfig: function(aInternalLpObj) { |
| 824 | - $('.exportAdd').on('click',function() { | 824 | + $('.exportAddXls').on('click', function() { |
| 825 | var aInfos = { | 825 | var aInfos = { |
| 826 | "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表 | 826 | "lpObjList": _funCalcuExportData_lpObjList(aInternalLpObj), // 路牌班次信息列表 |
| 827 | "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj) // 统计项目列表 | 827 | "statInfoList": _funCalcuExportData_statInfoList(aInternalLpObj) // 统计项目列表 |
| @@ -830,12 +830,12 @@ var Main_v2 = function() { | @@ -830,12 +830,12 @@ var Main_v2 = function() { | ||
| 830 | console.log(aInfos); | 830 | console.log(aInfos); |
| 831 | 831 | ||
| 832 | $(".exportAdd").addClass("disabled"); | 832 | $(".exportAdd").addClass("disabled"); |
| 833 | - $(".exportAdd").html("<i class=\"fa fa-spinner\" aria-hidden=\"true\"></i>" + " 正在导出..."); | 833 | + $(".exportAddSpan").html("正在导出..."); |
| 834 | 834 | ||
| 835 | // 提交 | 835 | // 提交 |
| 836 | $.ajax({ | 836 | $.ajax({ |
| 837 | type: 'POST', | 837 | type: 'POST', |
| 838 | - url: "/tidc/exportDTDFile", | 838 | + url: "/tidc/exportDTDFile/xls", |
| 839 | dataType: 'binary', | 839 | dataType: 'binary', |
| 840 | contentType: "application/json", | 840 | contentType: "application/json", |
| 841 | data: JSON.stringify(aInfos), | 841 | data: JSON.stringify(aInfos), |
| @@ -843,16 +843,48 @@ var Main_v2 = function() { | @@ -843,16 +843,48 @@ var Main_v2 = function() { | ||
| 843 | Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xls"); | 843 | Main_v2.downloadFile(data, "application/octet-stream", "时刻表信息.xls"); |
| 844 | 844 | ||
| 845 | $(".exportAdd").removeClass("disabled"); | 845 | $(".exportAdd").removeClass("disabled"); |
| 846 | - $(".exportAdd").html("<i class=\"fa fa-file-excel-o\"></i>" + " 导出数据"); | 846 | + $(".exportAddSpan").html(" 导出数据"); |
| 847 | }, | 847 | }, |
| 848 | error: function(xhr, type){ | 848 | error: function(xhr, type){ |
| 849 | alert('错误:TODO'); | 849 | alert('错误:TODO'); |
| 850 | 850 | ||
| 851 | $(".exportAdd").removeClass("disabled"); | 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 | <div class="modal fade" id="paramadd_mobal" tabindex="-1" role="basic" aria-hidden="true"> | 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 | <div class="modal-header"> | 16 | <div class="modal-header"> |
| 6 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> | 17 | <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> |
| 7 | <h4 class="modal-title">参数数据 </h4> | 18 | <h4 class="modal-title">参数数据 </h4> |
| @@ -318,6 +329,54 @@ | @@ -318,6 +329,54 @@ | ||
| 318 | </div> | 329 | </div> |
| 319 | </div> | 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 | <input type="hidden" name="skbName" value="{{map.skbName}}" id="skbName_id"/> | 381 | <input type="hidden" name="skbName" value="{{map.skbName}}" id="skbName_id"/> |
| 323 | <input type="hidden" name="skbmc" value="{{map.skbmc}}" id="skbmc_id"/> | 382 | <input type="hidden" name="skbmc" value="{{map.skbmc}}" id="skbmc_id"/> |
| @@ -423,6 +482,8 @@ | @@ -423,6 +482,8 @@ | ||
| 423 | // 1、 获取表单内容,并序列化 | 482 | // 1、 获取表单内容,并序列化 |
| 424 | var fp = form.serializeJSON(); | 483 | var fp = form.serializeJSON(); |
| 425 | 484 | ||
| 485 | + console.log(fp); | ||
| 486 | + | ||
| 426 | // 2、重新刷新表单数据 | 487 | // 2、重新刷新表单数据 |
| 427 | var ganttMap = JSON.parse(window.localStorage.Gantt_AgursData); | 488 | var ganttMap = JSON.parse(window.localStorage.Gantt_AgursData); |
| 428 | var key; | 489 | var key; |
| @@ -431,6 +492,8 @@ | @@ -431,6 +492,8 @@ | ||
| 431 | if (ganttMap[key] != fp[key]) { | 492 | if (ganttMap[key] != fp[key]) { |
| 432 | ganttMap[key] = fp[key]; | 493 | ganttMap[key] = fp[key]; |
| 433 | } | 494 | } |
| 495 | + } else { | ||
| 496 | + ganttMap[key] = fp[key]; | ||
| 434 | } | 497 | } |
| 435 | } | 498 | } |
| 436 | window.localStorage.setItem("Gantt_AgursData",JSON.stringify(ganttMap)); | 499 | window.localStorage.setItem("Gantt_AgursData",JSON.stringify(ganttMap)); |
| @@ -440,7 +503,7 @@ | @@ -440,7 +503,7 @@ | ||
| 440 | var paramObj = pp[0]; | 503 | var paramObj = pp[0]; |
| 441 | var dataMap = pp[1]; | 504 | var dataMap = pp[1]; |
| 442 | var csMap = getCSMap(paramObj); | 505 | var csMap = getCSMap(paramObj); |
| 443 | - console.log(graph); | 506 | + // console.log(graph); |
| 444 | var data = Main_v2.BXPplaceClassesTime03(paramObj, csMap.maxCar); | 507 | var data = Main_v2.BXPplaceClassesTime03(paramObj, csMap.maxCar); |
| 445 | Main_v2.exportDataConfig(data.aInternalLpObj); | 508 | Main_v2.exportDataConfig(data.aInternalLpObj); |
| 446 | 509 | ||
| @@ -491,6 +554,8 @@ | @@ -491,6 +554,8 @@ | ||
| 491 | opt.push("<option value='1'>" + d.stationName + "</option>"); | 554 | opt.push("<option value='1'>" + d.stationName + "</option>"); |
| 492 | } | 555 | } |
| 493 | }); | 556 | }); |
| 557 | + initTagsinput(opt.join(",")); | ||
| 558 | + | ||
| 494 | opt.push("<option value='allYes'>起终点站都可以</option>"); | 559 | opt.push("<option value='allYes'>起终点站都可以</option>"); |
| 495 | $('#cfdd_id').html(opt.join("")); | 560 | $('#cfdd_id').html(opt.join("")); |
| 496 | $('#cfdd_id').val(param.cfdd); | 561 | $('#cfdd_id').val(param.cfdd); |
| @@ -524,10 +589,62 @@ | @@ -524,10 +589,62 @@ | ||
| 524 | $('#lateStartTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'}); | 589 | $('#lateStartTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'}); |
| 525 | $('#lateEndTime_id').datetimepicker({format : 'HH:mm',locale: 'zh-cn'}); | 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 | function getMinDate(d1,d2) { | 649 | function getMinDate(d1,d2) { |
| 533 | // 1、定义返回字符串. | 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 | \ No newline at end of file | 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 | \ No newline at end of file | 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 | \ No newline at end of file | 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 | \ No newline at end of file | 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 | \ No newline at end of file | 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,7 +224,9 @@ | ||
| 224 | $("#export").on("click",function(){ | 224 | $("#export").on("click",function(){ |
| 225 | var type = "export"; | 225 | var type = "export"; |
| 226 | $get('/realSchedule/account', {line:line,date:date,code:code,xlName:xlName,type:type}, function(result){ | 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,49 +137,6 @@ | ||
| 137 | $("#times1").attr("disabled", true); | 137 | $("#times1").attr("disabled", true); |
| 138 | $("#times2").attr("disabled", true); | 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 | var fage=false; | 140 | var fage=false; |
| 184 | var xlList; | 141 | var xlList; |
| 185 | var obj = []; | 142 | var obj = []; |
| @@ -276,6 +233,7 @@ | @@ -276,6 +233,7 @@ | ||
| 276 | var times2 = $("#times2").val(); | 233 | var times2 = $("#times2").val(); |
| 277 | var company = $("#company").val(); | 234 | var company = $("#company").val(); |
| 278 | var subCompany = $("#subCompany").val(); | 235 | var subCompany = $("#subCompany").val(); |
| 236 | + var lineName = $('#line option:selected').text(); | ||
| 279 | function jsDoQuery(pagination){ | 237 | function jsDoQuery(pagination){ |
| 280 | if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){ | 238 | if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){ |
| 281 | layer.msg("请选择日期"); | 239 | layer.msg("请选择日期"); |
| @@ -294,6 +252,9 @@ | @@ -294,6 +252,9 @@ | ||
| 294 | times2 = $("#times2").val(); | 252 | times2 = $("#times2").val(); |
| 295 | company = $("#company").val(); | 253 | company = $("#company").val(); |
| 296 | subCompany = $("#subCompany").val(); | 254 | subCompany = $("#subCompany").val(); |
| 255 | + lineName = $('#line option:selected').text(); | ||
| 256 | + if(lineName == "全部线路") | ||
| 257 | + lineName = $('#subCompany option:selected').text(); | ||
| 297 | params['line'] = line; | 258 | params['line'] = line; |
| 298 | params['sfqr'] = sfqr; | 259 | params['sfqr'] = sfqr; |
| 299 | params['statu'] = statu; | 260 | params['statu'] = statu; |
| @@ -343,11 +304,18 @@ | @@ -343,11 +304,18 @@ | ||
| 343 | params['company'] = company; | 304 | params['company'] = company; |
| 344 | params['subCompany'] = subCompany; | 305 | params['subCompany'] = subCompany; |
| 345 | params['type'] = "export"; | 306 | params['type'] = "export"; |
| 307 | + params['lineName'] = lineName; | ||
| 346 | var i = layer.load(2); | 308 | var i = layer.load(2); |
| 347 | $get('/busInterval/interval', params, function(result){ | 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 | layer.close(i); | 319 | layer.close(i); |
| 352 | }); | 320 | }); |
| 353 | }); | 321 | }); |
src/main/resources/static/pages/forms/statement/commandState.html
| @@ -266,6 +266,7 @@ | @@ -266,6 +266,7 @@ | ||
| 266 | var code = $("#code").val(); | 266 | var code = $("#code").val(); |
| 267 | var company = $("#company").val(); | 267 | var company = $("#company").val(); |
| 268 | var subCompany = $("#subCompany").val(); | 268 | var subCompany = $("#subCompany").val(); |
| 269 | + var lineName = $('#line option:selected').text(); | ||
| 269 | function jsDoQuery(pagination){ | 270 | function jsDoQuery(pagination){ |
| 270 | $("#export").removeAttr("disabled"); | 271 | $("#export").removeAttr("disabled"); |
| 271 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 272 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| @@ -280,6 +281,9 @@ | @@ -280,6 +281,9 @@ | ||
| 280 | code = $("#code").val(); | 281 | code = $("#code").val(); |
| 281 | company = $("#company").val(); | 282 | company = $("#company").val(); |
| 282 | subCompany = $("#subCompany").val(); | 283 | subCompany = $("#subCompany").val(); |
| 284 | + lineName = $('#line option:selected').text(); | ||
| 285 | + if(lineName == "全部线路") | ||
| 286 | + lineName = $('#subCompany option:selected').text(); | ||
| 283 | params['line'] = line; | 287 | params['line'] = line; |
| 284 | params['date'] = date; | 288 | params['date'] = date; |
| 285 | params['code'] = code; | 289 | params['code'] = code; |
| @@ -287,31 +291,36 @@ | @@ -287,31 +291,36 @@ | ||
| 287 | params['company'] = company; | 291 | params['company'] = company; |
| 288 | params['subCompany'] = subCompany; | 292 | params['subCompany'] = subCompany; |
| 289 | $("#forms .hidden").removeClass("hidden"); | 293 | $("#forms .hidden").removeClass("hidden"); |
| 294 | + var i = layer.load(2); | ||
| 290 | $get('/pcpc/commandState', params, function(result){ | 295 | $get('/pcpc/commandState', params, function(result){ |
| 291 | // 把数据填充到模版中 | 296 | // 把数据填充到模版中 |
| 292 | var tbodyHtml = template('list_commandState',{list:result}); | 297 | var tbodyHtml = template('list_commandState',{list:result}); |
| 293 | // 把渲染好的模版html文本追加到表格中 | 298 | // 把渲染好的模版html文本追加到表格中 |
| 294 | $('#forms tbody').html(tbodyHtml); | 299 | $('#forms tbody').html(tbodyHtml); |
| 300 | + layer.close(i); | ||
| 295 | 301 | ||
| 296 | $('.btn-command').on('click', openCommandByLine); | 302 | $('.btn-command').on('click', openCommandByLine); |
| 297 | 303 | ||
| 298 | }); | 304 | }); |
| 299 | } | 305 | } |
| 300 | 306 | ||
| 301 | - var xlbm=""; | 307 | + var xlbm="", lineName1=""; |
| 302 | function openCommandByLine(){ | 308 | function openCommandByLine(){ |
| 303 | var id = $(this).data('id'); | 309 | var id = $(this).data('id'); |
| 304 | date = $("#date").val(); | 310 | date = $("#date").val(); |
| 305 | xlbm=id; | 311 | xlbm=id; |
| 312 | + lineName1 = $(this).html(); | ||
| 306 | var params = {}; | 313 | var params = {}; |
| 307 | params['line'] = id; | 314 | params['line'] = id; |
| 308 | params['date'] = date; | 315 | params['date'] = date; |
| 309 | params['type'] = "query"; | 316 | params['type'] = "query"; |
| 310 | $("#works .hidden").removeClass("hidden"); | 317 | $("#works .hidden").removeClass("hidden"); |
| 311 | $("#works_hidden").removeClass("hidden"); | 318 | $("#works_hidden").removeClass("hidden"); |
| 319 | + var i = layer.load(2); | ||
| 312 | $get('/pcpc/commandByLineList',params,function(result){ | 320 | $get('/pcpc/commandByLineList',params,function(result){ |
| 313 | var commandByLine = template('list_workList',{list:result}); | 321 | var commandByLine = template('list_workList',{list:result}); |
| 314 | $('#works tbody').html(commandByLine); | 322 | $('#works tbody').html(commandByLine); |
| 323 | + layer.close(i); | ||
| 315 | 324 | ||
| 316 | $('.btn-command-line').on('click', openCommand); | 325 | $('.btn-command-line').on('click', openCommand); |
| 317 | $("html,body").animate({scrollTop:$("#works").offset().top},1000); | 326 | $("html,body").animate({scrollTop:$("#works").offset().top},1000); |
| @@ -325,6 +334,8 @@ | @@ -325,6 +334,8 @@ | ||
| 325 | params['jgh'] = id; | 334 | params['jgh'] = id; |
| 326 | params['date'] = date; | 335 | params['date'] = date; |
| 327 | params['line'] =xlbm; | 336 | params['line'] =xlbm; |
| 337 | + var jName = $(this).html(); | ||
| 338 | + params['jName'] = lineName1+"-"+jName.replace("/", "_"); | ||
| 328 | $.get('/pages/forms/statement/commandStateByLine.html', function (content) { | 339 | $.get('/pages/forms/statement/commandStateByLine.html', function (content) { |
| 329 | layer.open({ | 340 | layer.open({ |
| 330 | type: 1, | 341 | type: 1, |
| @@ -348,8 +359,13 @@ | @@ -348,8 +359,13 @@ | ||
| 348 | params['type'] = "export"; | 359 | params['type'] = "export"; |
| 349 | params['company'] = company; | 360 | params['company'] = company; |
| 350 | params['subCompany'] = subCompany; | 361 | params['subCompany'] = subCompany; |
| 362 | + params['lineName'] = lineName; | ||
| 363 | + var i = layer.load(2); | ||
| 351 | $get('/pcpc/commandState', params, function(result){ | 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,8 +374,13 @@ | ||
| 358 | params['line'] = xlbm; | 374 | params['line'] = xlbm; |
| 359 | params['date'] = date; | 375 | params['date'] = date; |
| 360 | params['type'] = "export"; | 376 | params['type'] = "export"; |
| 377 | + params['lineName'] = lineName1; | ||
| 378 | + var i = layer.load(2); | ||
| 361 | $get('/pcpc/commandByLineList', params, function(result){ | 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,18 +60,21 @@ | ||
| 60 | $('.menu-toggler.sidebar-toggler').click(); | 60 | $('.menu-toggler.sidebar-toggler').click(); |
| 61 | var params_; | 61 | var params_; |
| 62 | $("#commandByLineList").on('init', function (e, params) { | 62 | $("#commandByLineList").on('init', function (e, params) { |
| 63 | - params['type']='export'; | ||
| 64 | params_=params; | 63 | params_=params; |
| 65 | - console.log(params.date); | ||
| 66 | $get('/pcpc/commandByJghList',params,function(result){ | 64 | $get('/pcpc/commandByJghList',params,function(result){ |
| 67 | var commandByLine = template('commandByLine',{list:result}); | 65 | var commandByLine = template('commandByLine',{list:result}); |
| 68 | $('#forms_1 tbody').html(commandByLine); | 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,11 +33,11 @@ | ||
| 33 | </div> | 33 | </div> |
| 34 | <div style="display: inline-block;margin-left: 15px;"> | 34 | <div style="display: inline-block;margin-left: 15px;"> |
| 35 | <span class="item-label" style="width: 80px;">开始时间: </span> | 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 | </div> | 37 | </div> |
| 38 | <div style="display: inline-block;margin-left: 15px;"> | 38 | <div style="display: inline-block;margin-left: 15px;"> |
| 39 | <span class="item-label" style="width: 80px;">结束时间: </span> | 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 | </div> | 41 | </div> |
| 42 | <div style="margin-top: 10px"></div> | 42 | <div style="margin-top: 10px"></div> |
| 43 | <div style="display: inline-block;"> | 43 | <div style="display: inline-block;"> |
| @@ -97,20 +97,12 @@ | @@ -97,20 +97,12 @@ | ||
| 97 | $(function(){ | 97 | $(function(){ |
| 98 | $("#export").attr('disabled',"true"); | 98 | $("#export").attr('disabled',"true"); |
| 99 | 99 | ||
| 100 | - | ||
| 101 | // 关闭左侧栏 | 100 | // 关闭左侧栏 |
| 102 | if (!$('body').hasClass('page-sidebar-closed')) | 101 | if (!$('body').hasClass('page-sidebar-closed')) |
| 103 | $('.menu-toggler.sidebar-toggler').click(); | 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 | var d = new Date(); | 104 | var d = new Date(); |
| 105 | + d.setTime(d.getTime() - 1*1000*60*60*24); | ||
| 114 | var year = d.getFullYear(); | 106 | var year = d.getFullYear(); |
| 115 | var month = d.getMonth() + 1; | 107 | var month = d.getMonth() + 1; |
| 116 | var day = d.getDate(); | 108 | var day = d.getDate(); |
| @@ -118,8 +110,19 @@ | @@ -118,8 +110,19 @@ | ||
| 118 | month = "0" + month; | 110 | month = "0" + month; |
| 119 | if(day < 10) | 111 | if(day < 10) |
| 120 | day = "0" + day; | 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 | $.get('/report/lineList',function(xlList){ | 127 | $.get('/report/lineList',function(xlList){ |
| 125 | var data = []; | 128 | var data = []; |
| @@ -230,6 +233,7 @@ | @@ -230,6 +233,7 @@ | ||
| 230 | var endDate = $("#endDate").val(); | 233 | var endDate = $("#endDate").val(); |
| 231 | var code = $("#code").val(); | 234 | var code = $("#code").val(); |
| 232 | var changType=$("#changType").val(); | 235 | var changType=$("#changType").val(); |
| 236 | + var lineName = $('#line option:selected').text(); | ||
| 233 | $("#query").on("click",function(){ | 237 | $("#query").on("click",function(){ |
| 234 | line = $("#line").val(); | 238 | line = $("#line").val(); |
| 235 | date = $("#date").val(); | 239 | date = $("#date").val(); |
| @@ -237,6 +241,9 @@ | @@ -237,6 +241,9 @@ | ||
| 237 | code = $("#code").val(); | 241 | code = $("#code").val(); |
| 238 | endDate = $("#endDate").val(); | 242 | endDate = $("#endDate").val(); |
| 239 | changType=$("#changType").val(); | 243 | changType=$("#changType").val(); |
| 244 | + lineName = $('#line option:selected').text(); | ||
| 245 | + if(lineName == "全部线路") | ||
| 246 | + lineName = $('#subCompany option:selected').text(); | ||
| 240 | var type = "query"; | 247 | var type = "query"; |
| 241 | $get("/realSchedule/correctForm",{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){ | 248 | $get("/realSchedule/correctForm",{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){ |
| 242 | var list_correctForm = template('list_correctForm',{list:result}); | 249 | var list_correctForm = template('list_correctForm',{list:result}); |
| @@ -257,7 +264,15 @@ | @@ -257,7 +264,15 @@ | ||
| 257 | $("#export").on("click",function(){ | 264 | $("#export").on("click",function(){ |
| 258 | var type = "export"; | 265 | var type = "export"; |
| 259 | $get('/realSchedule/correctForm',{line:line,date:date,endDate:endDate,lpName:lpName,code:code,type:type,changType:changType},function(result){ | 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,43 +139,8 @@ | ||
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| 141 | $('#fgsdmDaily').html(options); | 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 | var tempData = {}; | 144 | var tempData = {}; |
| 180 | $.get('/report/lineList',function(xlList){ | 145 | $.get('/report/lineList',function(xlList){ |
| 181 | var data = []; | 146 | var data = []; |
| @@ -218,17 +183,18 @@ | @@ -218,17 +183,18 @@ | ||
| 218 | var date; | 183 | var date; |
| 219 | var gsdmDaily; | 184 | var gsdmDaily; |
| 220 | var fgsdmDaily; | 185 | var fgsdmDaily; |
| 186 | + var lineName=$("#select2-line-container").html(); | ||
| 221 | $("#query").on("click",function(){ | 187 | $("#query").on("click",function(){ |
| 222 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 188 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 223 | layer.msg("请选择时间"); | 189 | layer.msg("请选择时间"); |
| 224 | return; | 190 | return; |
| 225 | } | 191 | } |
| 226 | line = $("#line").val(); | 192 | line = $("#line").val(); |
| 227 | - var lineName=$("#select2-line-container").html(); | ||
| 228 | date = $("#date").val(); | 193 | date = $("#date").val(); |
| 229 | gsdmDaily=$("#gsdmDaily").val(); | 194 | gsdmDaily=$("#gsdmDaily").val(); |
| 230 | fgsdmDaily = $("#fgsdmDaily").val(); | 195 | fgsdmDaily = $("#fgsdmDaily").val(); |
| 231 | - | 196 | + lineName=$("#select2-line-container").html(); |
| 197 | + var i = layer.load(2); | ||
| 232 | $get('/mcy_forms/daily',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily, line:line,date:date,type:'query'},function(result){ | 198 | $get('/mcy_forms/daily',{gsdmDaily:gsdmDaily,fgsdmDaily:fgsdmDaily, line:line,date:date,type:'query'},function(result){ |
| 233 | $("#form_line").text(lineName); | 199 | $("#form_line").text(lineName); |
| 234 | $("#form_date").text(date); | 200 | $("#form_date").text(date); |
| @@ -236,8 +202,9 @@ | @@ -236,8 +202,9 @@ | ||
| 236 | var tbodyHtml = template('dailyInfo',{list:result}); | 202 | var tbodyHtml = template('dailyInfo',{list:result}); |
| 237 | // 把渲染好的模版html文本追加到表格中 | 203 | // 把渲染好的模版html文本追加到表格中 |
| 238 | $('#tbody').html(tbodyHtml); | 204 | $('#tbody').html(tbodyHtml); |
| 205 | + layer.close(i); | ||
| 206 | + | ||
| 239 | line = $("#line").val(); | 207 | line = $("#line").val(); |
| 240 | - | ||
| 241 | startDate = $("#startDate").val(); | 208 | startDate = $("#startDate").val(); |
| 242 | endDate = $("#endDate").val(); | 209 | endDate = $("#endDate").val(); |
| 243 | $("#sDate").text(startDate); | 210 | $("#sDate").text(startDate); |
| @@ -272,12 +239,20 @@ | @@ -272,12 +239,20 @@ | ||
| 272 | }); | 239 | }); |
| 273 | 240 | ||
| 274 | $("#export").on("click",function(){ | 241 | $("#export").on("click",function(){ |
| 242 | + if($("#date").val() == null || $("#date").val().trim().length == 0){ | ||
| 243 | + layer.msg("请选择时间"); | ||
| 244 | + return; | ||
| 245 | + } | ||
| 275 | line = $("#line").val(); | 246 | line = $("#line").val(); |
| 276 | date = $("#date").val(); | 247 | date = $("#date").val(); |
| 277 | gsdmDaily=$("#gsdmDaily").val(); | 248 | gsdmDaily=$("#gsdmDaily").val(); |
| 278 | fgsdmDaily = $("#fgsdmDaily").val(); | 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,6 +229,7 @@ | ||
| 229 | var subCompany = $("#subCompany").val(); | 229 | var subCompany = $("#subCompany").val(); |
| 230 | var line = $("#line").val(); | 230 | var line = $("#line").val(); |
| 231 | var date = $("#date").val(); | 231 | var date = $("#date").val(); |
| 232 | + var lineName = $('#line option:selected').text(); | ||
| 232 | function jsDoQuery(pagination){ | 233 | function jsDoQuery(pagination){ |
| 233 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 234 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 234 | layer.msg("请选择时间!"); | 235 | layer.msg("请选择时间!"); |
| @@ -239,6 +240,9 @@ | @@ -239,6 +240,9 @@ | ||
| 239 | subCompany = $("#subCompany").val(); | 240 | subCompany = $("#subCompany").val(); |
| 240 | line = $("#line").val(); | 241 | line = $("#line").val(); |
| 241 | date = $("#date").val(); | 242 | date = $("#date").val(); |
| 243 | + lineName = $('#line option:selected').text(); | ||
| 244 | + if(lineName == "全部线路") | ||
| 245 | + lineName = $('#subCompany option:selected').text(); | ||
| 242 | if(line == " ") | 246 | if(line == " ") |
| 243 | line = ""; | 247 | line = ""; |
| 244 | params['company'] = company; | 248 | params['company'] = company; |
| @@ -247,11 +251,13 @@ | @@ -247,11 +251,13 @@ | ||
| 247 | params['date'] = date; | 251 | params['date'] = date; |
| 248 | params['type'] = "query"; | 252 | params['type'] = "query"; |
| 249 | $(".hidden").removeClass("hidden"); | 253 | $(".hidden").removeClass("hidden"); |
| 254 | + var i = layer.load(2); | ||
| 250 | $get('/pcpc/firstAndLastBus', params, function(result){ | 255 | $get('/pcpc/firstAndLastBus', params, function(result){ |
| 251 | // 把数据填充到模版中 | 256 | // 把数据填充到模版中 |
| 252 | var tbodyHtml = template('list_firstAndLastBus',{list:result}); | 257 | var tbodyHtml = template('list_firstAndLastBus',{list:result}); |
| 253 | // 把渲染好的模版html文本追加到表格中 | 258 | // 把渲染好的模版html文本追加到表格中 |
| 254 | $('#forms tbody').html(tbodyHtml); | 259 | $('#forms tbody').html(tbodyHtml); |
| 260 | + layer.close(i); | ||
| 255 | 261 | ||
| 256 | if(result.length == 0) | 262 | if(result.length == 0) |
| 257 | $("#export").attr('disabled',"true"); | 263 | $("#export").attr('disabled',"true"); |
| @@ -271,8 +277,13 @@ | @@ -271,8 +277,13 @@ | ||
| 271 | params['line'] = line; | 277 | params['line'] = line; |
| 272 | params['date'] = date; | 278 | params['date'] = date; |
| 273 | params['type'] = "export"; | 279 | params['type'] = "export"; |
| 280 | + params['lineName'] = lineName; | ||
| 281 | + var i = layer.load(2); | ||
| 274 | $get('/pcpc/firstAndLastBus', params, function(result){ | 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,6 +191,7 @@ | ||
| 191 | var line = $("#line").val(); | 191 | var line = $("#line").val(); |
| 192 | var startDate = $("#startDate").val(); | 192 | var startDate = $("#startDate").val(); |
| 193 | var endDate = $("#endDate").val(); | 193 | var endDate = $("#endDate").val(); |
| 194 | + var lineName = $('#line option:selected').text(); | ||
| 194 | function jsDoQuery(pagination){ | 195 | function jsDoQuery(pagination){ |
| 195 | if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ | 196 | if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ |
| 196 | layer.msg("请选择时间!"); | 197 | layer.msg("请选择时间!"); |
| @@ -207,6 +208,9 @@ | @@ -207,6 +208,9 @@ | ||
| 207 | line = $("#line").val(); | 208 | line = $("#line").val(); |
| 208 | startDate = $("#startDate").val(); | 209 | startDate = $("#startDate").val(); |
| 209 | endDate = $("#endDate").val(); | 210 | endDate = $("#endDate").val(); |
| 211 | + lineName = $('#line option:selected').text(); | ||
| 212 | + if(lineName == "全部线路") | ||
| 213 | + lineName = $('#subCompany option:selected').text(); | ||
| 210 | if(line == " ") | 214 | if(line == " ") |
| 211 | line = ""; | 215 | line = ""; |
| 212 | params['company'] = company; | 216 | params['company'] = company; |
| @@ -240,14 +244,6 @@ | @@ -240,14 +244,6 @@ | ||
| 240 | } | 244 | } |
| 241 | 245 | ||
| 242 | $("#export").on("click",function(){ | 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 | var i = layer.load(2); | 247 | var i = layer.load(2); |
| 252 | var params = {}; | 248 | var params = {}; |
| 253 | company = $("#company").val(); | 249 | company = $("#company").val(); |
| @@ -263,8 +259,17 @@ | @@ -263,8 +259,17 @@ | ||
| 263 | params['startDate'] = startDate; | 259 | params['startDate'] = startDate; |
| 264 | params['endDate'] = endDate; | 260 | params['endDate'] = endDate; |
| 265 | params['type'] = "delay_export"; | 261 | params['type'] = "delay_export"; |
| 262 | + params['lineName'] = lineName; | ||
| 266 | $get('/pcpc/firstAndLastBus_sum', params, function(result){ | 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 | layer.close(i); | 273 | layer.close(i); |
| 269 | }); | 274 | }); |
| 270 | }); | 275 | }); |
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.html
| @@ -240,12 +240,14 @@ | @@ -240,12 +240,14 @@ | ||
| 240 | 240 | ||
| 241 | var list; | 241 | var list; |
| 242 | var tempLine; | 242 | var tempLine; |
| 243 | + var lineName1; | ||
| 243 | $("#forms tbody").on("click","a",function(){ | 244 | $("#forms tbody").on("click","a",function(){ |
| 244 | var index = $(this).parent().parent().index(); | 245 | var index = $(this).parent().parent().index(); |
| 245 | if(index < list.length - 1){ | 246 | if(index < list.length - 1){ |
| 246 | $.each(list, function(i, g){ | 247 | $.each(list, function(i, g){ |
| 247 | if(index == i){ | 248 | if(index == i){ |
| 248 | tempLine = g.xlbm; | 249 | tempLine = g.xlbm; |
| 250 | + lineName1 = g.line; | ||
| 249 | var tbodyHtml = template('list_maps',{list:g.map}); | 251 | var tbodyHtml = template('list_maps',{list:g.map}); |
| 250 | $('#map tbody').html(tbodyHtml); | 252 | $('#map tbody').html(tbodyHtml); |
| 251 | $("#sumMap tr").addClass("hidden"); | 253 | $("#sumMap tr").addClass("hidden"); |
| @@ -264,7 +266,8 @@ | @@ -264,7 +266,8 @@ | ||
| 264 | $("#map tr").addClass("hidden"); | 266 | $("#map tr").addClass("hidden"); |
| 265 | $("#exportMap").addClass("hidden"); | 267 | $("#exportMap").addClass("hidden"); |
| 266 | $("#sumMap .hidden").removeClass("hidden"); | 268 | $("#sumMap .hidden").removeClass("hidden"); |
| 267 | - $("#exportSumMap").removeClass("hidden"); | 269 | + if(g.map.length > 0) |
| 270 | + $("#exportSumMap").removeClass("hidden"); | ||
| 268 | $("html,body").animate({scrollTop:$("#sumMap").offset().top},1000); | 271 | $("html,body").animate({scrollTop:$("#sumMap").offset().top},1000); |
| 269 | } | 272 | } |
| 270 | }); | 273 | }); |
| @@ -278,6 +281,7 @@ | @@ -278,6 +281,7 @@ | ||
| 278 | var line = $("#line").val(); | 281 | var line = $("#line").val(); |
| 279 | var startDate = $("#startDate").val(); | 282 | var startDate = $("#startDate").val(); |
| 280 | var endDate = $("#endDate").val(); | 283 | var endDate = $("#endDate").val(); |
| 284 | + var lineName = $('#line option:selected').text(); | ||
| 281 | function jsDoQuery(pagination){ | 285 | function jsDoQuery(pagination){ |
| 282 | if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ | 286 | if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ |
| 283 | layer.msg("请选择时间!"); | 287 | layer.msg("请选择时间!"); |
| @@ -293,6 +297,9 @@ | @@ -293,6 +297,9 @@ | ||
| 293 | line = $("#line").val(); | 297 | line = $("#line").val(); |
| 294 | startDate = $("#startDate").val(); | 298 | startDate = $("#startDate").val(); |
| 295 | endDate = $("#endDate").val(); | 299 | endDate = $("#endDate").val(); |
| 300 | + lineName = $('#line option:selected').text(); | ||
| 301 | + if(lineName == "全部线路") | ||
| 302 | + lineName = $('#subCompany option:selected').text(); | ||
| 296 | if(line == " ") | 303 | if(line == " ") |
| 297 | line = ""; | 304 | line = ""; |
| 298 | params['company'] = company; | 305 | params['company'] = company; |
| @@ -331,22 +338,23 @@ | @@ -331,22 +338,23 @@ | ||
| 331 | params['startDate'] = startDate; | 338 | params['startDate'] = startDate; |
| 332 | params['endDate'] = endDate; | 339 | params['endDate'] = endDate; |
| 333 | params['type'] = "export"; | 340 | params['type'] = "export"; |
| 341 | + params['lineName'] = lineName; | ||
| 334 | var i = layer.load(2); | 342 | var i = layer.load(2); |
| 335 | $get('/pcpc/firstAndLastBus_sum', params, function(result){ | 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 | layer.close(i); | 353 | layer.close(i); |
| 338 | }); | 354 | }); |
| 339 | }); | 355 | }); |
| 340 | 356 | ||
| 341 | $("#exportMap").on("click",function(){ | 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 | var i = layer.load(2); | 358 | var i = layer.load(2); |
| 351 | var params = {}; | 359 | var params = {}; |
| 352 | params['company'] = company; | 360 | params['company'] = company; |
| @@ -355,21 +363,22 @@ | @@ -355,21 +363,22 @@ | ||
| 355 | params['startDate'] = startDate; | 363 | params['startDate'] = startDate; |
| 356 | params['endDate'] = endDate; | 364 | params['endDate'] = endDate; |
| 357 | params['type'] = "exportMap"; | 365 | params['type'] = "exportMap"; |
| 366 | + params['lineName'] = lineName1; | ||
| 358 | $get('/pcpc/firstAndLastBus_sum', params, function(result){ | 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 | layer.close(i); | 377 | layer.close(i); |
| 361 | }); | 378 | }); |
| 362 | }); | 379 | }); |
| 363 | 380 | ||
| 364 | $("#exportSumMap").on("click",function(){ | 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 | var i = layer.load(2); | 382 | var i = layer.load(2); |
| 374 | var params = {}; | 383 | var params = {}; |
| 375 | params['company'] = company; | 384 | params['company'] = company; |
| @@ -378,8 +387,17 @@ | @@ -378,8 +387,17 @@ | ||
| 378 | params['startDate'] = startDate; | 387 | params['startDate'] = startDate; |
| 379 | params['endDate'] = endDate; | 388 | params['endDate'] = endDate; |
| 380 | params['type'] = "delay_export"; | 389 | params['type'] = "delay_export"; |
| 390 | + params['lineName'] = lineName; | ||
| 381 | $get('/pcpc/firstAndLastBus_sum', params, function(result){ | 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 | layer.close(i); | 401 | layer.close(i); |
| 384 | }); | 402 | }); |
| 385 | }); | 403 | }); |
src/main/resources/static/pages/forms/statement/historyMessage.html
| @@ -21,20 +21,20 @@ | @@ -21,20 +21,20 @@ | ||
| 21 | <h1>调度历史消息</h1> | 21 | <h1>调度历史消息</h1> |
| 22 | </div> | 22 | </div> |
| 23 | </div> | 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 | <div style="display: inline-block;margin-left: 15px;"> | 34 | <div style="display: inline-block;margin-left: 15px;"> |
| 35 | <span class="item-label" style="width: 80px;">时间: </span> | 35 | <span class="item-label" style="width: 80px;">时间: </span> |
| 36 | <input class="form-control" type="text" id="date" style="width: 180px;"/> | 36 | <input class="form-control" type="text" id="date" style="width: 180px;"/> |
| 37 | - </div> | 37 | + </div> |
| 38 | <div style="display: inline-block;margin-left: 15px"> | 38 | <div style="display: inline-block;margin-left: 15px"> |
| 39 | <span class="item-label" style="width: 140px;">内部编码: </span> | 39 | <span class="item-label" style="width: 140px;">内部编码: </span> |
| 40 | <select class="form-control" name="code" id="code" style="width: 180px;"></select> | 40 | <select class="form-control" name="code" id="code" style="width: 180px;"></select> |
| @@ -42,10 +42,10 @@ | @@ -42,10 +42,10 @@ | ||
| 42 | <div class="form-group"> | 42 | <div class="form-group"> |
| 43 | <input class="btn btn-default" type="button" id="query" value="筛选"/> | 43 | <input class="btn btn-default" type="button" id="query" value="筛选"/> |
| 44 | <input class="btn btn-default" type="button" id="export" value="导出"/> | 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 | <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;"> | 49 | <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px;"> |
| 50 | <table class="table table-bordered table-hover table-checkable" id="forms"> | 50 | <table class="table table-bordered table-hover table-checkable" id="forms"> |
| 51 | <thead> | 51 | <thead> |
| @@ -62,23 +62,23 @@ | @@ -62,23 +62,23 @@ | ||
| 62 | 62 | ||
| 63 | </tbody> | 63 | </tbody> |
| 64 | </table> | 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 | $(function(){ | 72 | $(function(){ |
| 73 | $('#export').attr('disabled', "true"); | 73 | $('#export').attr('disabled', "true"); |
| 74 | - | ||
| 75 | - // 关闭左侧栏 | ||
| 76 | - if (!$('body').hasClass('page-sidebar-closed')) | 74 | + |
| 75 | + // 关闭左侧栏 | ||
| 76 | + if (!$('body').hasClass('page-sidebar-closed')) | ||
| 77 | $('.menu-toggler.sidebar-toggler').click(); | 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 | $.get('/report/lineList',function(xlList){ | 84 | $.get('/report/lineList',function(xlList){ |
| @@ -146,6 +146,7 @@ | @@ -146,6 +146,7 @@ | ||
| 146 | var line = $("#line").val(); | 146 | var line = $("#line").val(); |
| 147 | var date = $("#date").val(); | 147 | var date = $("#date").val(); |
| 148 | var code = $("#code").val(); | 148 | var code = $("#code").val(); |
| 149 | + var lineName = $('#line option:selected').text(); | ||
| 149 | $("#query").on("click",function(){ | 150 | $("#query").on("click",function(){ |
| 150 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 151 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 151 | layer.msg("请选择时间"); | 152 | layer.msg("请选择时间"); |
| @@ -154,13 +155,16 @@ | @@ -154,13 +155,16 @@ | ||
| 154 | line = $("#line").val(); | 155 | line = $("#line").val(); |
| 155 | date = $("#date").val(); | 156 | date = $("#date").val(); |
| 156 | code = $("#code").val(); | 157 | code = $("#code").val(); |
| 158 | + lineName = $('#line option:selected').text(); | ||
| 157 | var type = "query"; | 159 | var type = "query"; |
| 158 | $(".hidden").removeClass("hidden"); | 160 | $(".hidden").removeClass("hidden"); |
| 161 | + var i = layer.load(2); | ||
| 159 | $get('/realSchedule/historyMessage',{line:line,date:date,code:code,type:type},function(result){ | 162 | $get('/realSchedule/historyMessage',{line:line,date:date,code:code,type:type},function(result){ |
| 160 | // 把数据填充到模版中 | 163 | // 把数据填充到模版中 |
| 161 | var tbodyHtml = template('list_history',{list:result}); | 164 | var tbodyHtml = template('list_history',{list:result}); |
| 162 | // 把渲染好的模版html文本追加到表格中 | 165 | // 把渲染好的模版html文本追加到表格中 |
| 163 | $('#forms tbody').html(tbodyHtml); | 166 | $('#forms tbody').html(tbodyHtml); |
| 167 | + layer.close(i); | ||
| 164 | 168 | ||
| 165 | if(result.length == 0) | 169 | if(result.length == 0) |
| 166 | $("#export").attr('disabled',"true"); | 170 | $("#export").attr('disabled',"true"); |
| @@ -172,27 +176,31 @@ | @@ -172,27 +176,31 @@ | ||
| 172 | 176 | ||
| 173 | $("#export").on("click",function(){ | 177 | $("#export").on("click",function(){ |
| 174 | var type = "export"; | 178 | var type = "export"; |
| 179 | + var i = layer.load(2); | ||
| 175 | $get('/realSchedule/historyMessage', {line:line,date:date,code:code,type:type}, function(result){ | 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 | <td>{{i+1}}</td> | 193 | <td>{{i+1}}</td> |
| 186 | <td>{{obj[4]}}</td> | 194 | <td>{{obj[4]}}</td> |
| 187 | <td>{{obj[0]}}</td> | 195 | <td>{{obj[0]}}</td> |
| 188 | <td>{{obj[1]}}</td> | 196 | <td>{{obj[1]}}</td> |
| 189 | <td>{{obj[3]}}</td> | 197 | <td>{{obj[3]}}</td> |
| 190 | <td>{{obj[2]}}</td> | 198 | <td>{{obj[2]}}</td> |
| 191 | - </tr> | 199 | + </tr> |
| 192 | {{/each}} | 200 | {{/each}} |
| 193 | {{if list.length == 0}} | 201 | {{if list.length == 0}} |
| 194 | <tr> | 202 | <tr> |
| 195 | <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> | 203 | <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td> |
| 196 | </tr> | 204 | </tr> |
| 197 | - {{/if}} | 205 | + {{/if}} |
| 198 | </script> | 206 | </script> |
| 199 | \ No newline at end of file | 207 | \ No newline at end of file |
src/main/resources/static/pages/forms/statement/jobSummary.html
| @@ -254,6 +254,7 @@ | @@ -254,6 +254,7 @@ | ||
| 254 | }else{ | 254 | }else{ |
| 255 | $("#xlid").html(lineName); | 255 | $("#xlid").html(lineName); |
| 256 | $("#dateid").html(date); | 256 | $("#dateid").html(date); |
| 257 | + var i = layer.load(2); | ||
| 257 | $get('/report/jobFwqk',{line:line,date:date},function(result){ | 258 | $get('/report/jobFwqk',{line:line,date:date},function(result){ |
| 258 | console.log(result); | 259 | console.log(result); |
| 259 | var list_lbqk = template('list_lbqk',{list:result}); | 260 | var list_lbqk = template('list_lbqk',{list:result}); |
| @@ -263,6 +264,7 @@ | @@ -263,6 +264,7 @@ | ||
| 263 | $('#forms .list_lbqk').rowspan(1); | 264 | $('#forms .list_lbqk').rowspan(1); |
| 264 | $('#forms .list_lbqk').rowspan(2); | 265 | $('#forms .list_lbqk').rowspan(2); |
| 265 | $('#forms .list_lbqk').rowspan(3); | 266 | $('#forms .list_lbqk').rowspan(3); |
| 267 | + layer.close(i); | ||
| 266 | 268 | ||
| 267 | }) | 269 | }) |
| 268 | 270 | ||
| @@ -270,6 +272,7 @@ | @@ -270,6 +272,7 @@ | ||
| 270 | var list_ljqk = template('list_ljqk',{list:result}); | 272 | var list_ljqk = template('list_ljqk',{list:result}); |
| 271 | // 把渲染好的模版html文本追加到表格中 | 273 | // 把渲染好的模版html文本追加到表格中 |
| 272 | $('#forms .list_ljqk').html(list_ljqk); | 274 | $('#forms .list_ljqk').html(list_ljqk); |
| 275 | + layer.close(i); | ||
| 273 | }) | 276 | }) |
| 274 | 277 | ||
| 275 | $get('/report/jobHzxx',{line:line,date:date},function(result){ | 278 | $get('/report/jobHzxx',{line:line,date:date},function(result){ |
| @@ -282,6 +285,7 @@ | @@ -282,6 +285,7 @@ | ||
| 282 | $("#lbgls").html(result.lbgl) | 285 | $("#lbgls").html(result.lbgl) |
| 283 | var list_xxsj=template('list_xxsj',result); | 286 | var list_xxsj=template('list_xxsj',result); |
| 284 | $('#forms .list_xxsj').html(list_xxsj); | 287 | $('#forms .list_xxsj').html(list_xxsj); |
| 288 | + layer.close(i); | ||
| 285 | 289 | ||
| 286 | }) | 290 | }) |
| 287 | 291 | ||
| @@ -298,8 +302,12 @@ | @@ -298,8 +302,12 @@ | ||
| 298 | }else if(date==""||date==null){ | 302 | }else if(date==""||date==null){ |
| 299 | layer.msg('请选择日期.'); | 303 | layer.msg('请选择日期.'); |
| 300 | }else{ | 304 | }else{ |
| 305 | + var i = layer.load(2); | ||
| 301 | $get('/report/jobSummaryExport',{line:line,date:date,lineName:lineName},function(result){ | 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,14 +119,6 @@ | ||
| 119 | if (!$('body').hasClass('page-sidebar-closed')) | 119 | if (!$('body').hasClass('page-sidebar-closed')) |
| 120 | $('.menu-toggler.sidebar-toggler').click(); | 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 | $("#times1").datetimepicker({ | 122 | $("#times1").datetimepicker({ |
| 131 | format : 'HH:mm', | 123 | format : 'HH:mm', |
| 132 | locale : 'zh-cn' | 124 | locale : 'zh-cn' |
| @@ -137,6 +129,7 @@ | @@ -137,6 +129,7 @@ | ||
| 137 | }); | 129 | }); |
| 138 | 130 | ||
| 139 | var d = new Date(); | 131 | var d = new Date(); |
| 132 | + d.setTime(d.getTime() - 1*1000*60*60*24); | ||
| 140 | var year = d.getFullYear(); | 133 | var year = d.getFullYear(); |
| 141 | var month = d.getMonth() + 1; | 134 | var month = d.getMonth() + 1; |
| 142 | var day = d.getDate(); | 135 | var day = d.getDate(); |
| @@ -144,8 +137,19 @@ | @@ -144,8 +137,19 @@ | ||
| 144 | month = "0" + month; | 137 | month = "0" + month; |
| 145 | if(day < 10) | 138 | if(day < 10) |
| 146 | day = "0" + day; | 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 | $("#times1").val("05:00"); | 154 | $("#times1").val("05:00"); |
| 151 | $("#times2").val("23:00"); | 155 | $("#times2").val("23:00"); |
| @@ -308,6 +312,7 @@ | @@ -308,6 +312,7 @@ | ||
| 308 | var times = $("#times1").val() + "-" + $("#times2").val(); | 312 | var times = $("#times1").val() + "-" + $("#times2").val(); |
| 309 | var company = $("#company").val(); | 313 | var company = $("#company").val(); |
| 310 | var subCompany = $("#subCompany").val(); | 314 | var subCompany = $("#subCompany").val(); |
| 315 | + var lineName = $('#line option:selected').text(); | ||
| 311 | function jsDoQuery(pagination){ | 316 | function jsDoQuery(pagination){ |
| 312 | if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){ | 317 | if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){ |
| 313 | layer.msg("请选择日期"); | 318 | layer.msg("请选择日期"); |
| @@ -337,12 +342,18 @@ | @@ -337,12 +342,18 @@ | ||
| 337 | params['company'] = company; | 342 | params['company'] = company; |
| 338 | params['subCompany'] = subCompany; | 343 | params['subCompany'] = subCompany; |
| 339 | params['type'] = "query"; | 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 | // $(".hidden").removeClass("hidden"); | 349 | // $(".hidden").removeClass("hidden"); |
| 341 | $get('/busInterval/lbStatuAnaly', params, function(result){ | 350 | $get('/busInterval/lbStatuAnaly', params, function(result){ |
| 342 | // 把数据填充到模版中 | 351 | // 把数据填充到模版中 |
| 343 | var tbodyHtml = template('list_lbAnaly',{list:result, reason:reason, lb:lb}); | 352 | var tbodyHtml = template('list_lbAnaly',{list:result, reason:reason, lb:lb}); |
| 344 | // 把渲染好的模版html文本追加到表格中 | 353 | // 把渲染好的模版html文本追加到表格中 |
| 345 | $('#forms').html(tbodyHtml); | 354 | $('#forms').html(tbodyHtml); |
| 355 | + layer.close(i); | ||
| 356 | + | ||
| 346 | _w_table_rowspan("#forms", 1); | 357 | _w_table_rowspan("#forms", 1); |
| 347 | _w_table_rowspan("#forms", 2); | 358 | _w_table_rowspan("#forms", 2); |
| 348 | _w_table_rowspan("#forms", 3); | 359 | _w_table_rowspan("#forms", 3); |
| @@ -381,10 +392,14 @@ | @@ -381,10 +392,14 @@ | ||
| 381 | params['company'] = company; | 392 | params['company'] = company; |
| 382 | params['subCompany'] = subCompany; | 393 | params['subCompany'] = subCompany; |
| 383 | params['type'] = "export"; | 394 | params['type'] = "export"; |
| 395 | + params['lineName'] = lineName; | ||
| 396 | + var i = layer.load(2); | ||
| 384 | $get('/busInterval/lbStatuAnaly', params, function(result){ | 397 | $get('/busInterval/lbStatuAnaly', params, function(result){ |
| 385 | - window.open("/downloadFile/download?fileName=烂班情况分析表" | 398 | + window.open("/downloadFile/download?fileName=" |
| 386 | + moment(startDate).format("YYYYMMDD") | 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,60 +206,6 @@ | ||
| 206 | $("#times1").val("05:00"); | 206 | $("#times1").val("05:00"); |
| 207 | $("#times2").val("23:00"); | 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 | var fage=false; | 209 | var fage=false; |
| 264 | var xlList; | 210 | var xlList; |
| 265 | var obj = []; | 211 | var obj = []; |
src/main/resources/static/pages/forms/statement/peopleCarPlan.html
| @@ -183,6 +183,7 @@ | @@ -183,6 +183,7 @@ | ||
| 183 | var date = $("#date").val(); | 183 | var date = $("#date").val(); |
| 184 | var company = $("#company").val(); | 184 | var company = $("#company").val(); |
| 185 | var subCompany = $("#subCompany").val(); | 185 | var subCompany = $("#subCompany").val(); |
| 186 | + var lineName = $('#line option:selected').text(); | ||
| 186 | function jsDoQuery(pagination){ | 187 | function jsDoQuery(pagination){ |
| 187 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 188 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 188 | layer.msg("请选择时间"); | 189 | layer.msg("请选择时间"); |
| @@ -193,6 +194,9 @@ | @@ -193,6 +194,9 @@ | ||
| 193 | subCompany = $("#subCompany").val(); | 194 | subCompany = $("#subCompany").val(); |
| 194 | line = $("#line").val(); | 195 | line = $("#line").val(); |
| 195 | date = $("#date").val(); | 196 | date = $("#date").val(); |
| 197 | + lineName = $('#line option:selected').text(); | ||
| 198 | + if(lineName == "全部线路") | ||
| 199 | + lineName = $('#subCompany option:selected').text(); | ||
| 196 | if(line == " ") | 200 | if(line == " ") |
| 197 | line = ""; | 201 | line = ""; |
| 198 | params['company'] = company; | 202 | params['company'] = company; |
| @@ -221,8 +225,11 @@ | @@ -221,8 +225,11 @@ | ||
| 221 | params['line'] = line; | 225 | params['line'] = line; |
| 222 | params['date'] = date; | 226 | params['date'] = date; |
| 223 | params['type'] = "export"; | 227 | params['type'] = "export"; |
| 228 | + params['lineName'] = lineName; | ||
| 224 | $get('/pcpc/queryPeopleCar', params, function(result){ | 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,6 +226,7 @@ | ||
| 226 | var bcType = $('#bcType').val(); | 226 | var bcType = $('#bcType').val(); |
| 227 | var company = $("#company").val(); | 227 | var company = $("#company").val(); |
| 228 | var subCompany = $("#subCompany").val(); | 228 | var subCompany = $("#subCompany").val(); |
| 229 | + var lineName = $('#line option:selected').text(); | ||
| 229 | function jsDoQuery(pagination){ | 230 | function jsDoQuery(pagination){ |
| 230 | if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ | 231 | if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ |
| 231 | layer.msg("请选择时间范围!"); | 232 | layer.msg("请选择时间范围!"); |
| @@ -243,6 +244,9 @@ | @@ -243,6 +244,9 @@ | ||
| 243 | bcType = $("#bcType").val(); | 244 | bcType = $("#bcType").val(); |
| 244 | company = $("#company").val(); | 245 | company = $("#company").val(); |
| 245 | subCompany = $("#subCompany").val(); | 246 | subCompany = $("#subCompany").val(); |
| 247 | + lineName = $('#line option:selected').text(); | ||
| 248 | + if(lineName == "全部线路") | ||
| 249 | + lineName = $('#subCompany option:selected').text(); | ||
| 246 | params['page'] = page; | 250 | params['page'] = page; |
| 247 | params['line'] = line; | 251 | params['line'] = line; |
| 248 | params['startDate'] = startDate; | 252 | params['startDate'] = startDate; |
| @@ -298,9 +302,13 @@ | @@ -298,9 +302,13 @@ | ||
| 298 | params['subCompany'] = subCompany; | 302 | params['subCompany'] = subCompany; |
| 299 | params['bcType'] = bcType; | 303 | params['bcType'] = bcType; |
| 300 | params['type'] = "export"; | 304 | params['type'] = "export"; |
| 305 | + params['lineName'] = lineName; | ||
| 301 | var i = layer.load(2); | 306 | var i = layer.load(2); |
| 302 | $get('/pcpc/scheduleAnaly', params, function(result){ | 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 | layer.close(i); | 312 | layer.close(i); |
| 305 | }); | 313 | }); |
| 306 | }); | 314 | }); |
src/main/resources/static/pages/forms/statement/scheduleAnaly_sum.html
| @@ -113,17 +113,9 @@ | @@ -113,17 +113,9 @@ | ||
| 113 | if (!$('body').hasClass('page-sidebar-closed')) | 113 | if (!$('body').hasClass('page-sidebar-closed')) |
| 114 | $('.menu-toggler.sidebar-toggler').click(); | 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 | var d = new Date(); | 117 | var d = new Date(); |
| 118 | + d.setTime(d.getTime() - 1*1000*60*60*24); | ||
| 127 | var year = d.getFullYear(); | 119 | var year = d.getFullYear(); |
| 128 | var month = d.getMonth() + 1; | 120 | var month = d.getMonth() + 1; |
| 129 | var day = d.getDate(); | 121 | var day = d.getDate(); |
| @@ -131,8 +123,19 @@ | @@ -131,8 +123,19 @@ | ||
| 131 | month = "0" + month; | 123 | month = "0" + month; |
| 132 | if(day < 10) | 124 | if(day < 10) |
| 133 | day = "0" + day; | 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 | var fage=false; | 140 | var fage=false; |
| 138 | var xlList; | 141 | var xlList; |
| @@ -226,6 +229,7 @@ | @@ -226,6 +229,7 @@ | ||
| 226 | var nbbm = ""; | 229 | var nbbm = ""; |
| 227 | var company = $("#company").val(); | 230 | var company = $("#company").val(); |
| 228 | var subCompany = $("#subCompany").val(); | 231 | var subCompany = $("#subCompany").val(); |
| 232 | + var lineName = $('#line option:selected').text(); | ||
| 229 | function jsDoQuery(pagination){ | 233 | function jsDoQuery(pagination){ |
| 230 | if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ | 234 | if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){ |
| 231 | layer.msg("请选择时间范围!"); | 235 | layer.msg("请选择时间范围!"); |
| @@ -244,6 +248,9 @@ | @@ -244,6 +248,9 @@ | ||
| 244 | nbbm = $("#nbbm").val()!=null?$("#nbbm").val():""; | 248 | nbbm = $("#nbbm").val()!=null?$("#nbbm").val():""; |
| 245 | company = $("#company").val(); | 249 | company = $("#company").val(); |
| 246 | subCompany = $("#subCompany").val(); | 250 | subCompany = $("#subCompany").val(); |
| 251 | + lineName = $('#line option:selected').text(); | ||
| 252 | + if(lineName == "全部线路") | ||
| 253 | + lineName = $('#subCompany option:selected').text(); | ||
| 247 | params['page'] = page; | 254 | params['page'] = page; |
| 248 | params['line'] = line; | 255 | params['line'] = line; |
| 249 | params['startDate'] = startDate; | 256 | params['startDate'] = startDate; |
| @@ -255,11 +262,13 @@ | @@ -255,11 +262,13 @@ | ||
| 255 | params['nbbm'] = nbbm; | 262 | params['nbbm'] = nbbm; |
| 256 | params['type'] = "query"; | 263 | params['type'] = "query"; |
| 257 | $(".hidden").removeClass("hidden"); | 264 | $(".hidden").removeClass("hidden"); |
| 265 | + var i = layer.load(2); | ||
| 258 | $get('/pcpc/scheduleAnaly_sum', params, function(result){ | 266 | $get('/pcpc/scheduleAnaly_sum', params, function(result){ |
| 259 | // 把数据填充到模版中 | 267 | // 把数据填充到模版中 |
| 260 | var tbodyHtml = template('list_scheduleAnaly_sum',{list:result.dataList, companyName:companyName, subCompanyName:subCompanyName}); | 268 | var tbodyHtml = template('list_scheduleAnaly_sum',{list:result.dataList, companyName:companyName, subCompanyName:subCompanyName}); |
| 261 | // 把渲染好的模版html文本追加到表格中 | 269 | // 把渲染好的模版html文本追加到表格中 |
| 262 | $('#forms tbody').html(tbodyHtml); | 270 | $('#forms tbody').html(tbodyHtml); |
| 271 | + layer.close(i); | ||
| 263 | 272 | ||
| 264 | if(result.dataList.length == 0) | 273 | if(result.dataList.length == 0) |
| 265 | $("#export").attr('disabled',"true"); | 274 | $("#export").attr('disabled',"true"); |
| @@ -289,8 +298,19 @@ | @@ -289,8 +298,19 @@ | ||
| 289 | params['subCompany'] = subCompany; | 298 | params['subCompany'] = subCompany; |
| 290 | params['nbbm'] = nbbm; | 299 | params['nbbm'] = nbbm; |
| 291 | params['type'] = "export"; | 300 | params['type'] = "export"; |
| 301 | + params['lineName'] = lineName; | ||
| 302 | + var i = layer.load(2); | ||
| 292 | $get('/pcpc/scheduleAnaly_sum', params, function(result){ | 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,6 +431,7 @@ | ||
| 431 | // $("#ddrbBody").height($(window).height()-300); | 431 | // $("#ddrbBody").height($(window).height()-300); |
| 432 | $("c").html("全日"); | 432 | $("c").html("全日"); |
| 433 | $("#export").removeAttr("disabled"); | 433 | $("#export").removeAttr("disabled"); |
| 434 | + var i = layer.load(2); | ||
| 434 | $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName,type:"query"},function(result){ | 435 | $get('/realSchedule/statisticsDaily',{line:line,date:date,xlName:xlName,type:"query"},function(result){ |
| 435 | var scheduleDaily_1 = template('scheduleDaily_1',{list:result}); | 436 | var scheduleDaily_1 = template('scheduleDaily_1',{list:result}); |
| 436 | $("#jls").html(result[0].jls); | 437 | $("#jls").html(result[0].jls); |
| @@ -452,6 +453,7 @@ | @@ -452,6 +453,7 @@ | ||
| 452 | divFrom1 = window.document.getElementById('forms'); | 453 | divFrom1 = window.document.getElementById('forms'); |
| 453 | divFrom3 = window.document.getElementById('forms_2'); | 454 | divFrom3 = window.document.getElementById('forms_2'); |
| 454 | divFrom3.style.width=divFrom1.offsetWidth+"px"; | 455 | divFrom3.style.width=divFrom1.offsetWidth+"px"; |
| 456 | + layer.close(i); | ||
| 455 | }); | 457 | }); |
| 456 | 458 | ||
| 457 | }); | 459 | }); |
| @@ -492,9 +494,9 @@ | @@ -492,9 +494,9 @@ | ||
| 492 | params['state'] = '2'; | 494 | params['state'] = '2'; |
| 493 | $get('/realSchedule/scheduleDailyExport', params, function(result){ | 495 | $get('/realSchedule/scheduleDailyExport', params, function(result){ |
| 494 | if(date.length == 10) | 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 | else | 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,7 +148,7 @@ | ||
| 148 | // 关闭左侧栏 | 148 | // 关闭左侧栏 |
| 149 | if (!$('body').hasClass('page-sidebar-closed')) | 149 | if (!$('body').hasClass('page-sidebar-closed')) |
| 150 | $('.menu-toggler.sidebar-toggler').click(); | 150 | $('.menu-toggler.sidebar-toggler').click(); |
| 151 | - | 151 | + |
| 152 | $("#date").datetimepicker({ | 152 | $("#date").datetimepicker({ |
| 153 | format : 'YYYY-MM-DD', | 153 | format : 'YYYY-MM-DD', |
| 154 | locale : 'zh-cn' | 154 | locale : 'zh-cn' |
| @@ -264,11 +264,13 @@ | @@ -264,11 +264,13 @@ | ||
| 264 | } | 264 | } |
| 265 | // $("#tjrbBody").height($(window).height()-100); | 265 | // $("#tjrbBody").height($(window).height()-100); |
| 266 | line = $("#line").val(); | 266 | line = $("#line").val(); |
| 267 | - xlName = $("#select2-line-container").html(); | ||
| 268 | date = $("#date").val(); | 267 | date = $("#date").val(); |
| 269 | date2 =$("#date2").val(); | 268 | date2 =$("#date2").val(); |
| 270 | gsdm =$("#gsdm").val(); | 269 | gsdm =$("#gsdm").val(); |
| 271 | fgsdm=$("#fgsdm").val(); | 270 | fgsdm=$("#fgsdm").val(); |
| 271 | + xlName = $("#select2-line-container").html(); | ||
| 272 | + if(xlName == "全部线路") | ||
| 273 | + xlName = $('#fgsdm option:selected').text(); | ||
| 272 | if(line=="请选择"){ | 274 | if(line=="请选择"){ |
| 273 | line=""; | 275 | line=""; |
| 274 | } | 276 | } |
| @@ -284,11 +286,13 @@ | @@ -284,11 +286,13 @@ | ||
| 284 | params['date2'] = date2; | 286 | params['date2'] = date2; |
| 285 | params['xlName'] = xlName; | 287 | params['xlName'] = xlName; |
| 286 | params['type'] = "query"; | 288 | params['type'] = "query"; |
| 289 | + var i = layer.load(2); | ||
| 287 | $get('/realSchedule/statisticsDailyTj',params,function(result){ | 290 | $get('/realSchedule/statisticsDailyTj',params,function(result){ |
| 288 | // 把数据填充到模版中 | 291 | // 把数据填充到模版中 |
| 289 | var tbodyHtml = template('statisticsDaily',{list:result}); | 292 | var tbodyHtml = template('statisticsDaily',{list:result}); |
| 290 | // 把渲染好的模版html文本追加到表格中 | 293 | // 把渲染好的模版html文本追加到表格中 |
| 291 | $('#forms .statisticsDaily').html(tbodyHtml); | 294 | $('#forms .statisticsDaily').html(tbodyHtml); |
| 295 | + layer.close(i); | ||
| 292 | 296 | ||
| 293 | if(result.length == 0) | 297 | if(result.length == 0) |
| 294 | $("#export").attr('disabled',"true"); | 298 | $("#export").attr('disabled',"true"); |
| @@ -302,14 +306,24 @@ | @@ -302,14 +306,24 @@ | ||
| 302 | $("#export").on("click",function(){ | 306 | $("#export").on("click",function(){ |
| 303 | var params = {}; | 307 | var params = {}; |
| 304 | params['gsdm'] = gsdm; | 308 | params['gsdm'] = gsdm; |
| 305 | - params['fgsdm'] =fgsdm ; | 309 | + params['fgsdm'] =fgsdm; |
| 306 | params['line'] = line; | 310 | params['line'] = line; |
| 307 | params['date'] = date; | 311 | params['date'] = date; |
| 308 | params['date2'] = date2; | 312 | params['date2'] = date2; |
| 309 | params['xlName'] = xlName; | 313 | params['xlName'] = xlName; |
| 310 | params['type'] = "export"; | 314 | params['type'] = "export"; |
| 315 | + var i = layer.load(2); | ||
| 311 | $get('/realSchedule/statisticsDailyTj',params,function(result){ | 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,7 +372,7 @@ | ||
| 358 | <td>{{obj.djg_m}}</td> | 372 | <td>{{obj.djg_m}}</td> |
| 359 | <td>{{obj.djg_a}}</td> | 373 | <td>{{obj.djg_a}}</td> |
| 360 | <td>{{obj.djg_time}}</td> | 374 | <td>{{obj.djg_time}}</td> |
| 361 | - <td> </td> | 375 | + <td> </td> |
| 362 | </tr> | 376 | </tr> |
| 363 | {{/each}} | 377 | {{/each}} |
| 364 | {{if list.length == 0}} | 378 | {{if list.length == 0}} |
src/main/resources/static/pages/forms/statement/statisticsDailyCalc.html
| @@ -150,7 +150,7 @@ | @@ -150,7 +150,7 @@ | ||
| 150 | $('.menu-toggler.sidebar-toggler').click(); | 150 | $('.menu-toggler.sidebar-toggler').click(); |
| 151 | 151 | ||
| 152 | var d = new Date(); | 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 | var year = d.getFullYear(); | 154 | var year = d.getFullYear(); |
| 155 | var month = d.getMonth() + 1; | 155 | var month = d.getMonth() + 1; |
| 156 | var day = d.getDate(); | 156 | var day = d.getDate(); |
| @@ -267,11 +267,13 @@ | @@ -267,11 +267,13 @@ | ||
| 267 | } | 267 | } |
| 268 | // $("#tjrbBody").height($(window).height()-100); | 268 | // $("#tjrbBody").height($(window).height()-100); |
| 269 | line = $("#line").val(); | 269 | line = $("#line").val(); |
| 270 | - xlName = $("#select2-line-container").html(); | ||
| 271 | date = $("#date").val(); | 270 | date = $("#date").val(); |
| 272 | date2 =$("#date2").val(); | 271 | date2 =$("#date2").val(); |
| 273 | gsdm =$("#gsdm").val(); | 272 | gsdm =$("#gsdm").val(); |
| 274 | fgsdm=$("#fgsdm").val(); | 273 | fgsdm=$("#fgsdm").val(); |
| 274 | + xlName = $("#select2-line-container").html(); | ||
| 275 | + if(xlName == "全部线路") | ||
| 276 | + xlName = $('#fgsdm option:selected').text(); | ||
| 275 | if(line=="请选择"){ | 277 | if(line=="请选择"){ |
| 276 | line=""; | 278 | line=""; |
| 277 | } | 279 | } |
| @@ -314,8 +316,19 @@ | @@ -314,8 +316,19 @@ | ||
| 314 | params['date2'] = date2; | 316 | params['date2'] = date2; |
| 315 | params['xlName'] = xlName; | 317 | params['xlName'] = xlName; |
| 316 | params['type'] = "export"; | 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,7 +150,7 @@ | ||
| 150 | $('.menu-toggler.sidebar-toggler').click(); | 150 | $('.menu-toggler.sidebar-toggler').click(); |
| 151 | 151 | ||
| 152 | var d = new Date(); | 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 | var year = d.getFullYear(); | 154 | var year = d.getFullYear(); |
| 155 | var month = d.getMonth() + 1; | 155 | var month = d.getMonth() + 1; |
| 156 | var day = d.getDate(); | 156 | var day = d.getDate(); |
| @@ -267,11 +267,13 @@ | @@ -267,11 +267,13 @@ | ||
| 267 | } | 267 | } |
| 268 | // $("#tjrbBody").height($(window).height()-100); | 268 | // $("#tjrbBody").height($(window).height()-100); |
| 269 | line = $("#line").val(); | 269 | line = $("#line").val(); |
| 270 | - xlName = $("#select2-line-container").html(); | ||
| 271 | date = $("#date").val(); | 270 | date = $("#date").val(); |
| 272 | date2 =$("#date2").val(); | 271 | date2 =$("#date2").val(); |
| 273 | gsdm =$("#gsdm").val(); | 272 | gsdm =$("#gsdm").val(); |
| 274 | fgsdm=$("#fgsdm").val(); | 273 | fgsdm=$("#fgsdm").val(); |
| 274 | + xlName = $("#select2-line-container").html(); | ||
| 275 | + if(xlName == "全部线路") | ||
| 276 | + xlName = $('#fgsdm option:selected').text(); | ||
| 275 | if(line=="请选择"){ | 277 | if(line=="请选择"){ |
| 276 | line=""; | 278 | line=""; |
| 277 | } | 279 | } |
| @@ -314,8 +316,19 @@ | @@ -314,8 +316,19 @@ | ||
| 314 | params['date2'] = date2; | 316 | params['date2'] = date2; |
| 315 | params['xlName'] = xlName; | 317 | params['xlName'] = xlName; |
| 316 | params['type'] = "export"; | 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,49 +159,6 @@ | ||
| 159 | $("#times1").attr("disabled", true); | 159 | $("#times1").attr("disabled", true); |
| 160 | $("#times2").attr("disabled", true); | 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 | var fage=false; | 162 | var fage=false; |
| 206 | var xlList; | 163 | var xlList; |
| 207 | var obj = []; | 164 | var obj = []; |
| @@ -301,6 +258,7 @@ | @@ -301,6 +258,7 @@ | ||
| 301 | var company = $("#company").val(); | 258 | var company = $("#company").val(); |
| 302 | var subCompany = $("#subCompany").val(); | 259 | var subCompany = $("#subCompany").val(); |
| 303 | var lp = $("#lp").val(); | 260 | var lp = $("#lp").val(); |
| 261 | + var lineName = $('#line option:selected').text(); | ||
| 304 | function jsDoQuery(pagination){ | 262 | function jsDoQuery(pagination){ |
| 305 | if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){ | 263 | if($("#startDate").val().trim().length == 0 || $("#endDate").val().trim().length == 0){ |
| 306 | layer.msg("请选择日期"); | 264 | layer.msg("请选择日期"); |
| @@ -320,6 +278,9 @@ | @@ -320,6 +278,9 @@ | ||
| 320 | company = $("#company").val(); | 278 | company = $("#company").val(); |
| 321 | subCompany = $("#subCompany").val(); | 279 | subCompany = $("#subCompany").val(); |
| 322 | lp = $("#lp").val(); | 280 | lp = $("#lp").val(); |
| 281 | + lineName = $('#line option:selected').text(); | ||
| 282 | + if(lineName == "全部线路") | ||
| 283 | + lineName = $('#subCompany option:selected').text(); | ||
| 323 | params['lp'] = lp; | 284 | params['lp'] = lp; |
| 324 | params['line'] = line; | 285 | params['line'] = line; |
| 325 | params['sfqr'] = sfqr; | 286 | params['sfqr'] = sfqr; |
| @@ -394,11 +355,17 @@ | @@ -394,11 +355,17 @@ | ||
| 394 | params['company'] = company; | 355 | params['company'] = company; |
| 395 | params['subCompany'] = subCompany; | 356 | params['subCompany'] = subCompany; |
| 396 | params['type'] = "export"; | 357 | params['type'] = "export"; |
| 358 | + params['lineName'] = lineName; | ||
| 397 | var i = layer.load(2); | 359 | var i = layer.load(2); |
| 398 | $get('/busInterval/timeAndSpeed', params, function(result){ | 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 | layer.close(i); | 369 | layer.close(i); |
| 403 | }); | 370 | }); |
| 404 | }); | 371 | }); |
src/main/resources/static/pages/forms/statement/waybill.html
| @@ -227,10 +227,12 @@ | @@ -227,10 +227,12 @@ | ||
| 227 | }); | 227 | }); |
| 228 | var date = ''; | 228 | var date = ''; |
| 229 | var line = ''; | 229 | var line = ''; |
| 230 | + var lineName; | ||
| 230 | $("#query").on("click",function(){ | 231 | $("#query").on("click",function(){ |
| 231 | $("#left_height").height($(window).height()-100); | 232 | $("#left_height").height($(window).height()-100); |
| 232 | line = $("#line").val(); | 233 | line = $("#line").val(); |
| 233 | date = $("#date").val(); | 234 | date = $("#date").val(); |
| 235 | + lineName = $('#line option:selected').text(); | ||
| 234 | $(".hidden").removeClass("hidden"); | 236 | $(".hidden").removeClass("hidden"); |
| 235 | $get('/realSchedule/queryUserInfo',{line:line,date:date,state:2},function(result){ | 237 | $get('/realSchedule/queryUserInfo',{line:line,date:date,state:2},function(result){ |
| 236 | // 把数据填充到模版中 | 238 | // 把数据填充到模版中 |
| @@ -363,7 +365,7 @@ | @@ -363,7 +365,7 @@ | ||
| 363 | }); | 365 | }); |
| 364 | // $get('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){ | 366 | // $get('/realSchedule/exportWaybillMore',{date:date,line:line,strs:JSON.stringify(param)},function(result){ |
| 365 | // window.open("/downloadFile/downloadList?fileName="+result.fileName); //下载压缩包 | 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 | window.open("/downloadFile/download?fileName="+result.fileName); | 369 | window.open("/downloadFile/download?fileName="+result.fileName); |
| 368 | layer.close(i); | 370 | layer.close(i); |
| 369 | }); | 371 | }); |
src/main/resources/static/pages/forms/statement/workDaily.html
| @@ -116,7 +116,7 @@ | @@ -116,7 +116,7 @@ | ||
| 116 | var xlList; | 116 | var xlList; |
| 117 | var obj = []; | 117 | var obj = []; |
| 118 | 118 | ||
| 119 | - | 119 | + |
| 120 | $.get('/report/lineList',function(result){ | 120 | $.get('/report/lineList',function(result){ |
| 121 | xlList=result; | 121 | xlList=result; |
| 122 | $.get('/user/companyData', function(result){ | 122 | $.get('/user/companyData', function(result){ |
| @@ -198,6 +198,7 @@ | @@ -198,6 +198,7 @@ | ||
| 198 | var date = $("#date").val(); | 198 | var date = $("#date").val(); |
| 199 | var company = $("#company").val(); | 199 | var company = $("#company").val(); |
| 200 | var subCompany = $("#subCompany").val(); | 200 | var subCompany = $("#subCompany").val(); |
| 201 | + var lineName = $('#line option:selected').text(); | ||
| 201 | function jsDoQuery(pagination){ | 202 | function jsDoQuery(pagination){ |
| 202 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 203 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 203 | layer.msg("请选择时间"); | 204 | layer.msg("请选择时间"); |
| @@ -208,6 +209,9 @@ | @@ -208,6 +209,9 @@ | ||
| 208 | date = $("#date").val(); | 209 | date = $("#date").val(); |
| 209 | company = $("#company").val(); | 210 | company = $("#company").val(); |
| 210 | subCompany = $("#subCompany").val(); | 211 | subCompany = $("#subCompany").val(); |
| 212 | + lineName = $('#line option:selected').text(); | ||
| 213 | + if(lineName == "全部线路") | ||
| 214 | + lineName = $('#subCompany option:selected').text(); | ||
| 211 | if(line == " ") | 215 | if(line == " ") |
| 212 | line = ""; | 216 | line = ""; |
| 213 | params['line'] = line; | 217 | params['line'] = line; |
| @@ -216,11 +220,13 @@ | @@ -216,11 +220,13 @@ | ||
| 216 | params['company'] = company; | 220 | params['company'] = company; |
| 217 | params['subCompany'] = subCompany; | 221 | params['subCompany'] = subCompany; |
| 218 | $(".hidden").removeClass("hidden"); | 222 | $(".hidden").removeClass("hidden"); |
| 223 | + var i = layer.load(2); | ||
| 219 | $get('/pcpc/workDaily', params, function(result){ | 224 | $get('/pcpc/workDaily', params, function(result){ |
| 220 | // 把数据填充到模版中 | 225 | // 把数据填充到模版中 |
| 221 | var tbodyHtml = template('list_workDaily',{list:result}); | 226 | var tbodyHtml = template('list_workDaily',{list:result}); |
| 222 | // 把渲染好的模版html文本追加到表格中 | 227 | // 把渲染好的模版html文本追加到表格中 |
| 223 | $('#forms tbody').html(tbodyHtml); | 228 | $('#forms tbody').html(tbodyHtml); |
| 229 | + layer.close(i); | ||
| 224 | 230 | ||
| 225 | if(result.length == 0) | 231 | if(result.length == 0) |
| 226 | $("#export").attr('disabled',"true"); | 232 | $("#export").attr('disabled',"true"); |
| @@ -236,8 +242,11 @@ | @@ -236,8 +242,11 @@ | ||
| 236 | params['type'] = "export"; | 242 | params['type'] = "export"; |
| 237 | params['company'] = company; | 243 | params['company'] = company; |
| 238 | params['subCompany'] = subCompany; | 244 | params['subCompany'] = subCompany; |
| 245 | + params['lineName'] = lineName; | ||
| 239 | $get('/pcpc/workDaily', params, function(result){ | 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,38 +59,16 @@ | ||
| 59 | } | 59 | } |
| 60 | </style> | 60 | </style> |
| 61 | <div class="system_change_log"> | 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 | <ul > | 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 | <li class="sub_title"><h6>计划调度</h6></li> | 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 | <li class="sub_title"><h6>线调</h6></li> | 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 | </ul> | 73 | </ul> |
| 96 | </div> | 74 | </div> |
src/main/resources/static/pages/mforms/changetochanges/changetochange.html
| @@ -137,10 +137,22 @@ | @@ -137,10 +137,22 @@ | ||
| 137 | if (!$('body').hasClass('page-sidebar-closed')) | 137 | if (!$('body').hasClass('page-sidebar-closed')) |
| 138 | $('.menu-toggler.sidebar-toggler').click(); | 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 | $("#startDate,#endDate").datetimepicker({ | 150 | $("#startDate,#endDate").datetimepicker({ |
| 141 | format : 'YYYY-MM-DD', | 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 | var fage=false; | 157 | var fage=false; |
| 146 | var xlList; | 158 | var xlList; |
| @@ -233,6 +245,7 @@ | @@ -233,6 +245,7 @@ | ||
| 233 | var gsdmChange= $("#gsdmChange").val(); | 245 | var gsdmChange= $("#gsdmChange").val(); |
| 234 | var fgsdmChange= $("#fgsdmChange").val(); | 246 | var fgsdmChange= $("#fgsdmChange").val(); |
| 235 | if (startDate1 != '' && endDate1 != '') { | 247 | if (startDate1 != '' && endDate1 != '') { |
| 248 | + var i = layer.load(2); | ||
| 236 | $get('/mcy_forms/changetochange', { | 249 | $get('/mcy_forms/changetochange', { |
| 237 | sel : sel, | 250 | sel : sel, |
| 238 | line : line, | 251 | line : line, |
| @@ -248,6 +261,7 @@ | @@ -248,6 +261,7 @@ | ||
| 248 | }); | 261 | }); |
| 249 | // 把渲染好的模版html文本追加到表格中 | 262 | // 把渲染好的模版html文本追加到表格中 |
| 250 | $('#forms tbody').html(tbodyHtml); | 263 | $('#forms tbody').html(tbodyHtml); |
| 264 | + layer.close(i); | ||
| 251 | }) | 265 | }) |
| 252 | 266 | ||
| 253 | } else { | 267 | } else { |
| @@ -258,23 +272,37 @@ | @@ -258,23 +272,37 @@ | ||
| 258 | $("#export").on( | 272 | $("#export").on( |
| 259 | "click", | 273 | "click", |
| 260 | function() { | 274 | function() { |
| 275 | + line = $("#line").val(); | ||
| 261 | var sel = $("#sel").val(); | 276 | var sel = $("#sel").val(); |
| 262 | var startDate = $("#startDate").val(); | 277 | var startDate = $("#startDate").val(); |
| 263 | var endDate = $("#endDate").val(); | 278 | var endDate = $("#endDate").val(); |
| 264 | var lpName = $("#lpName").val(); | 279 | var lpName = $("#lpName").val(); |
| 265 | var gsdmChange= $("#gsdmChange").val(); | 280 | var gsdmChange= $("#gsdmChange").val(); |
| 266 | var fgsdmChange= $("#fgsdmChange").val(); | 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 | $post('/mcy_export/changetochangeExport', { | 286 | $post('/mcy_export/changetochangeExport', { |
| 268 | sel:sel, | 287 | sel:sel, |
| 269 | line:line, | 288 | line:line, |
| 270 | - gsdmChange:gsdmChange, | ||
| 271 | - fgsdmChange:fgsdmChange, | 289 | + gsdm:gsdmChange, |
| 290 | + fgsdm:fgsdmChange, | ||
| 272 | startDate : startDate, | 291 | startDate : startDate, |
| 273 | endDate : endDate, | 292 | endDate : endDate, |
| 274 | - type : 'export' | 293 | + type : 'export', |
| 294 | + lineName : lineName | ||
| 275 | }, function(result) { | 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,6 +202,7 @@ | ||
| 202 | var lpName = $("#lpName").val(); | 202 | var lpName = $("#lpName").val(); |
| 203 | var gsdmOperat = $("#gsdmOperat").val(); | 203 | var gsdmOperat = $("#gsdmOperat").val(); |
| 204 | var fgsdmOperat = $("#fgsdmOperat").val(); | 204 | var fgsdmOperat = $("#fgsdmOperat").val(); |
| 205 | + var i = layer.load(2); | ||
| 205 | $get("/mcy_forms/operationservice", { | 206 | $get("/mcy_forms/operationservice", { |
| 206 | gsdmOperat : gsdmOperat, | 207 | gsdmOperat : gsdmOperat, |
| 207 | fgsdmOperat : fgsdmOperat, | 208 | fgsdmOperat : fgsdmOperat, |
| @@ -230,6 +231,7 @@ | @@ -230,6 +231,7 @@ | ||
| 230 | }); | 231 | }); |
| 231 | // 把渲染好的模版html文本追加到表格中 | 232 | // 把渲染好的模版html文本追加到表格中 |
| 232 | $('#forms tbody').html(operationservice); | 233 | $('#forms tbody').html(operationservice); |
| 234 | + layer.close(i); | ||
| 233 | 235 | ||
| 234 | }); | 236 | }); |
| 235 | }); | 237 | }); |
| @@ -239,30 +241,43 @@ | @@ -239,30 +241,43 @@ | ||
| 239 | endDate=$("#endDate").val(); | 241 | endDate=$("#endDate").val(); |
| 240 | gsdmOperat=$("#gsdmOperat").val(); | 242 | gsdmOperat=$("#gsdmOperat").val(); |
| 241 | fgsdmOperat=$("#fgsdmOperat").val(); | 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 | </script> | 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 | <tr> | 267 | <tr> |
| 253 | - <td>{{i+1}}</td> | 268 | + <td>{{i+1}}</td> |
| 254 | <td>{{obj.xlName}}</td> | 269 | <td>{{obj.xlName}}</td> |
| 255 | <td>{{obj.jzl}}</td> | 270 | <td>{{obj.jzl}}</td> |
| 256 | <td>{{obj.xhl}}</td> | 271 | <td>{{obj.xhl}}</td> |
| 257 | <td>{{obj.xsgl}}</td> | 272 | <td>{{obj.xsgl}}</td> |
| 258 | <td>{{obj.emptMileage}}</td> | 273 | <td>{{obj.emptMileage}}</td> |
| 259 | <td>{{obj.sjbc}}</td> | 274 | <td>{{obj.sjbc}}</td> |
| 260 | - </tr> | 275 | + </tr> |
| 261 | {{/each}} | 276 | {{/each}} |
| 262 | {{if list.length == 0}} | 277 | {{if list.length == 0}} |
| 263 | <tr> | 278 | <tr> |
| 264 | <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> | 279 | <td colspan="7"><h6 class="muted">没有找到相关数据</h6></td> |
| 265 | </tr> | 280 | </tr> |
| 266 | - {{/if}} | 281 | + {{/if}} |
| 267 | </script> | 282 | </script> |
| 268 | </script> | 283 | </script> |
| 269 | \ No newline at end of file | 284 | \ No newline at end of file |
src/main/resources/static/pages/mforms/shifdays/shifday.html
| @@ -218,6 +218,7 @@ $(function(){ | @@ -218,6 +218,7 @@ $(function(){ | ||
| 218 | if(date=="" || date ==null){ | 218 | if(date=="" || date ==null){ |
| 219 | layer.msg('请选择日期.'); | 219 | layer.msg('请选择日期.'); |
| 220 | }else{ | 220 | }else{ |
| 221 | + var i = layer.load(2); | ||
| 221 | $get('/mcy_forms/shifday',params,function(result){ | 222 | $get('/mcy_forms/shifday',params,function(result){ |
| 222 | if(type=="desc"){ | 223 | if(type=="desc"){ |
| 223 | type ="asc"; | 224 | type ="asc"; |
| @@ -231,6 +232,7 @@ $(function(){ | @@ -231,6 +232,7 @@ $(function(){ | ||
| 231 | var tbodyHtml = template('shifday',{list:result}); | 232 | var tbodyHtml = template('shifday',{list:result}); |
| 232 | // 把渲染好的模版html文本追加到表格中 | 233 | // 把渲染好的模版html文本追加到表格中 |
| 233 | $('#forms tbody').html(tbodyHtml); | 234 | $('#forms tbody').html(tbodyHtml); |
| 235 | + layer.close(i); | ||
| 234 | }); | 236 | }); |
| 235 | } | 237 | } |
| 236 | }) | 238 | }) |
| @@ -250,6 +252,7 @@ $(function(){ | @@ -250,6 +252,7 @@ $(function(){ | ||
| 250 | if(date=="" || date ==null){ | 252 | if(date=="" || date ==null){ |
| 251 | layer.msg('请选择日期.'); | 253 | layer.msg('请选择日期.'); |
| 252 | }else{ | 254 | }else{ |
| 255 | + var i = layer.load(2); | ||
| 253 | $get('/mcy_forms/shifday',params,function(result){ | 256 | $get('/mcy_forms/shifday',params,function(result){ |
| 254 | if(type=="desc"){ | 257 | if(type=="desc"){ |
| 255 | type ="asc"; | 258 | type ="asc"; |
| @@ -263,6 +266,7 @@ $(function(){ | @@ -263,6 +266,7 @@ $(function(){ | ||
| 263 | var tbodyHtml = template('shifday',{list:result}); | 266 | var tbodyHtml = template('shifday',{list:result}); |
| 264 | // 把渲染好的模版html文本追加到表格中 | 267 | // 把渲染好的模版html文本追加到表格中 |
| 265 | $('#forms tbody').html(tbodyHtml); | 268 | $('#forms tbody').html(tbodyHtml); |
| 269 | + layer.close(i); | ||
| 266 | }); | 270 | }); |
| 267 | } | 271 | } |
| 268 | }) | 272 | }) |
| @@ -282,6 +286,7 @@ $(function(){ | @@ -282,6 +286,7 @@ $(function(){ | ||
| 282 | if(date=="" || date ==null){ | 286 | if(date=="" || date ==null){ |
| 283 | layer.msg('请选择日期.'); | 287 | layer.msg('请选择日期.'); |
| 284 | }else{ | 288 | }else{ |
| 289 | + var i = layer.load(2); | ||
| 285 | $get('/mcy_forms/shifday',params,function(result){ | 290 | $get('/mcy_forms/shifday',params,function(result){ |
| 286 | type ='asc'; | 291 | type ='asc'; |
| 287 | $.each(result, function(i, obj) { | 292 | $.each(result, function(i, obj) { |
| @@ -291,6 +296,7 @@ $(function(){ | @@ -291,6 +296,7 @@ $(function(){ | ||
| 291 | var tbodyHtml = template('shifday',{list:result}); | 296 | var tbodyHtml = template('shifday',{list:result}); |
| 292 | // 把渲染好的模版html文本追加到表格中 | 297 | // 把渲染好的模版html文本追加到表格中 |
| 293 | $('#forms tbody').html(tbodyHtml); | 298 | $('#forms tbody').html(tbodyHtml); |
| 299 | + layer.close(i); | ||
| 294 | }); | 300 | }); |
| 295 | } | 301 | } |
| 296 | }); | 302 | }); |
| @@ -299,15 +305,19 @@ $(function(){ | @@ -299,15 +305,19 @@ $(function(){ | ||
| 299 | var line = $("#line").val(); | 305 | var line = $("#line").val(); |
| 300 | var date = $("#date").val(); | 306 | var date = $("#date").val(); |
| 301 | var gsdmShif = $("#gsdmShif").val(); | 307 | var gsdmShif = $("#gsdmShif").val(); |
| 302 | - var fgsdmShif = $("#fgsdmShif").val(); | 308 | + var fgsdmShif = $("#fgsdmShif").val(); |
| 309 | + var lineName = $('#line option:selected').text(); | ||
| 303 | var params = {}; | 310 | var params = {}; |
| 304 | params.fgsdmShif =fgsdmShif; | 311 | params.fgsdmShif =fgsdmShif; |
| 305 | params.date =date; | 312 | params.date =date; |
| 306 | params.gsdmShif =gsdmShif; | 313 | params.gsdmShif =gsdmShif; |
| 307 | params.line =line; | 314 | params.line =line; |
| 308 | params.type='export'; | 315 | params.type='export'; |
| 316 | + params.lineName =lineName; | ||
| 309 | $get('/mcy_export/shifdayExport',params,function(result){ | 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,11 +99,8 @@ | ||
| 99 | if (!$('body').hasClass('page-sidebar-closed')) | 99 | if (!$('body').hasClass('page-sidebar-closed')) |
| 100 | $('.menu-toggler.sidebar-toggler').click(); | 100 | $('.menu-toggler.sidebar-toggler').click(); |
| 101 | 101 | ||
| 102 | - $("#startDate,#endDate").datetimepicker({ | ||
| 103 | - format : 'YYYY-MM-DD', | ||
| 104 | - locale : 'zh-cn' | ||
| 105 | - }); | ||
| 106 | var d = new Date(); | 102 | var d = new Date(); |
| 103 | + d.setTime(d.getTime() - 1*1000*60*60*24); | ||
| 107 | var year = d.getFullYear(); | 104 | var year = d.getFullYear(); |
| 108 | var month = d.getMonth() + 1; | 105 | var month = d.getMonth() + 1; |
| 109 | var day = d.getDate(); | 106 | var day = d.getDate(); |
| @@ -111,6 +108,12 @@ | @@ -111,6 +108,12 @@ | ||
| 111 | month = "0" + month; | 108 | month = "0" + month; |
| 112 | if(day < 10) | 109 | if(day < 10) |
| 113 | day = "0" + day; | 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 | $("#startDate,#endDate").val(year + "-" + month + "-" + day); | 117 | $("#startDate,#endDate").val(year + "-" + month + "-" + day); |
| 115 | 118 | ||
| 116 | var fage=false; | 119 | var fage=false; |
| @@ -207,6 +210,7 @@ | @@ -207,6 +210,7 @@ | ||
| 207 | params.lpName = $("#lpName").val(); | 210 | params.lpName = $("#lpName").val(); |
| 208 | params.gsdmManth= $("#gsdmManth").val(); | 211 | params.gsdmManth= $("#gsdmManth").val(); |
| 209 | params.fgsdmManth= $("#fgsdmManth").val(); | 212 | params.fgsdmManth= $("#fgsdmManth").val(); |
| 213 | + var i = layer.load(2); | ||
| 210 | $get("/mcy_forms/shiftuehiclemanth",params,function(result){ | 214 | $get("/mcy_forms/shiftuehiclemanth",params,function(result){ |
| 211 | $("#sDate").text(startDate); | 215 | $("#sDate").text(startDate); |
| 212 | $("#eDate").text(endDate); | 216 | $("#eDate").text(endDate); |
| @@ -223,11 +227,15 @@ | @@ -223,11 +227,15 @@ | ||
| 223 | var list_shiftuehiclemanth = template('list_shiftuehiclemanth',{list:result}); | 227 | var list_shiftuehiclemanth = template('list_shiftuehiclemanth',{list:result}); |
| 224 | // 把渲染好的模版html文本追加到表格中 | 228 | // 把渲染好的模版html文本追加到表格中 |
| 225 | $('#forms tbody').html(list_shiftuehiclemanth); | 229 | $('#forms tbody').html(list_shiftuehiclemanth); |
| 230 | + layer.close(i); | ||
| 226 | 231 | ||
| 227 | }); | 232 | }); |
| 228 | }); | 233 | }); |
| 229 | 234 | ||
| 230 | $("#export").on("click",function(){ | 235 | $("#export").on("click",function(){ |
| 236 | + var lineName = $('#line option:selected').text(); | ||
| 237 | + var startDate = $("#startDate").val(); | ||
| 238 | + var endDate = $("#endDate").val(); | ||
| 231 | var params={}; | 239 | var params={}; |
| 232 | params.empnames=$("#empnames").val(); | 240 | params.empnames=$("#empnames").val(); |
| 233 | params.line = $("#line").val(); | 241 | params.line = $("#line").val(); |
| @@ -236,9 +244,20 @@ | @@ -236,9 +244,20 @@ | ||
| 236 | params.lpName = $("#lpName").val(); | 244 | params.lpName = $("#lpName").val(); |
| 237 | params.gsdmManth= $("#gsdmManth").val(); | 245 | params.gsdmManth= $("#gsdmManth").val(); |
| 238 | params.fgsdmManth= $("#fgsdmManth").val(); | 246 | params.fgsdmManth= $("#fgsdmManth").val(); |
| 247 | + params.lineName = lineName; | ||
| 239 | params.type='export'; | 248 | params.type='export'; |
| 249 | + var i = layer.load(2); | ||
| 240 | $get('/mcy_export/shiftuehiclemanthExport',params,function(result){ | 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,9 +226,16 @@ | ||
| 226 | var gsdmSing = $("#gsdmSing").val(); | 226 | var gsdmSing = $("#gsdmSing").val(); |
| 227 | var fgsdmSing = $("#fgsdmSing").val(); | 227 | var fgsdmSing = $("#fgsdmSing").val(); |
| 228 | var tjtype=$("#tjtype").val(); | 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 | // if(tjtype=='jsy'){ | 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 | // }else{ | 240 | // }else{ |
| 234 | // $get('/mcy_export/singledataExport',{gsdmSing:gsdmSing,fgsdmSing:fgsdmSing,line:line,startDate:startDate,endDate:endDate,tjtype:tjtype,type:'export'},function(result){ | 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,12 +119,9 @@ | ||
| 119 | if (!$('body').hasClass('page-sidebar-closed')) | 119 | if (!$('body').hasClass('page-sidebar-closed')) |
| 120 | $('.menu-toggler.sidebar-toggler').click(); | 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 | var d = new Date(); | 123 | var d = new Date(); |
| 124 | + d.setTime(d.getTime() - 1*1000*60*60*24); | ||
| 128 | var year = d.getFullYear(); | 125 | var year = d.getFullYear(); |
| 129 | var month = d.getMonth() + 1; | 126 | var month = d.getMonth() + 1; |
| 130 | var day = d.getDate(); | 127 | var day = d.getDate(); |
| @@ -132,8 +129,14 @@ | @@ -132,8 +129,14 @@ | ||
| 132 | month = "0" + month; | 129 | month = "0" + month; |
| 133 | if(day < 10) | 130 | if(day < 10) |
| 134 | day = "0" + day; | 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 | var fage=false; | 141 | var fage=false; |
| 139 | var xlList; | 142 | var xlList; |
| @@ -224,6 +227,7 @@ | @@ -224,6 +227,7 @@ | ||
| 224 | gsdmTurn=$("#gsdmTurn").val(); | 227 | gsdmTurn=$("#gsdmTurn").val(); |
| 225 | fgsdmTurn=$("#fgsdmTurn").val(); | 228 | fgsdmTurn=$("#fgsdmTurn").val(); |
| 226 | if(startDate!=''&&endDate!=''){ | 229 | if(startDate!=''&&endDate!=''){ |
| 230 | + var i = layer.load(2); | ||
| 227 | $post('/mcy_forms/turnoutrate', | 231 | $post('/mcy_forms/turnoutrate', |
| 228 | { gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn, line:line,startDate:startDate,endDate:endDate,type:'query'},function(result){ | 232 | { gsdmTurn:gsdmTurn,fgsdmTurn:fgsdmTurn, line:line,startDate:startDate,endDate:endDate,type:'query'},function(result){ |
| 229 | // var result=[]; | 233 | // var result=[]; |
| @@ -231,6 +235,8 @@ | @@ -231,6 +235,8 @@ | ||
| 231 | var tbodyHtml = template('turnoutrate',{list:result}); | 235 | var tbodyHtml = template('turnoutrate',{list:result}); |
| 232 | // 把渲染好的模版html文本追加到表格中 | 236 | // 把渲染好的模版html文本追加到表格中 |
| 233 | $('#tbody').html(tbodyHtml); | 237 | $('#tbody').html(tbodyHtml); |
| 238 | + layer.close(i); | ||
| 239 | + | ||
| 234 | line = $("#line").val(); | 240 | line = $("#line").val(); |
| 235 | startDate = $("#startDate").val(); | 241 | startDate = $("#startDate").val(); |
| 236 | endDate = $("#endDate").val(); | 242 | endDate = $("#endDate").val(); |
| @@ -291,8 +297,21 @@ | @@ -291,8 +297,21 @@ | ||
| 291 | endDate=$("#endDate").val(); | 297 | endDate=$("#endDate").val(); |
| 292 | gsdmTurn=$("#gsdmTurn").val(); | 298 | gsdmTurn=$("#gsdmTurn").val(); |
| 293 | fgsdmTurn=$("#fgsdmTurn").val(); | 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,11 +178,13 @@ | ||
| 178 | date = $("#date").val(); | 178 | date = $("#date").val(); |
| 179 | // gsdmVehic = $("#gsdmVehic").val(); | 179 | // gsdmVehic = $("#gsdmVehic").val(); |
| 180 | // fgsdmVehic = $("#fgsdmVehic").val(); | 180 | // fgsdmVehic = $("#fgsdmVehic").val(); |
| 181 | + var i = layer.load(2); | ||
| 181 | $get('/mcy_forms/vehicleloading',{line:line,data:date},function(result){ | 182 | $get('/mcy_forms/vehicleloading',{line:line,data:date},function(result){ |
| 182 | // 把数据填充到模版中 | 183 | // 把数据填充到模版中 |
| 183 | var tbodyHtml = template('vehicleloading',{list:result}); | 184 | var tbodyHtml = template('vehicleloading',{list:result}); |
| 184 | // 把渲染好的模版html文本追加到表格中 | 185 | // 把渲染好的模版html文本追加到表格中 |
| 185 | $('#forms tbody').html(tbodyHtml); | 186 | $('#forms tbody').html(tbodyHtml); |
| 187 | + layer.close(i); | ||
| 186 | }); | 188 | }); |
| 187 | }); | 189 | }); |
| 188 | 190 | ||
| @@ -191,8 +193,13 @@ | @@ -191,8 +193,13 @@ | ||
| 191 | date = $("#date").val(); | 193 | date = $("#date").val(); |
| 192 | gsdmVehic = $("#gsdmVehic").val(); | 194 | gsdmVehic = $("#gsdmVehic").val(); |
| 193 | fgsdmVehic = $("#fgsdmVehic").val(); | 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,6 +183,7 @@ | ||
| 183 | if(date=="" || date ==null){ | 183 | if(date=="" || date ==null){ |
| 184 | layer.msg('请选择日期.'); | 184 | layer.msg('请选择日期.'); |
| 185 | }else{ | 185 | }else{ |
| 186 | + var i = layer.load(2); | ||
| 186 | $post('/mcy_forms/waybillday',{line:line,date:date,type:'query'},function(result){ | 187 | $post('/mcy_forms/waybillday',{line:line,date:date,type:'query'},function(result){ |
| 187 | $.each(result, function(i, obj) { | 188 | $.each(result, function(i, obj) { |
| 188 | obj.requestType = reqCodeMap[obj.requestType]; | 189 | obj.requestType = reqCodeMap[obj.requestType]; |
| @@ -191,6 +192,7 @@ | @@ -191,6 +192,7 @@ | ||
| 191 | var tbodyHtml = template('waybillday',{list:result}); | 192 | var tbodyHtml = template('waybillday',{list:result}); |
| 192 | // 把渲染好的模版html文本追加到表格中 | 193 | // 把渲染好的模版html文本追加到表格中 |
| 193 | $('#forms tbody').html(tbodyHtml); | 194 | $('#forms tbody').html(tbodyHtml); |
| 195 | + layer.close(i); | ||
| 194 | }); | 196 | }); |
| 195 | } | 197 | } |
| 196 | }); | 198 | }); |
| @@ -198,10 +200,13 @@ | @@ -198,10 +200,13 @@ | ||
| 198 | $("#export").on("click",function(){ | 200 | $("#export").on("click",function(){ |
| 199 | line = $("#line").val(); | 201 | line = $("#line").val(); |
| 200 | date = $("#date").val(); | 202 | date = $("#date").val(); |
| 203 | + lineName = $('#line option:selected').text(); | ||
| 201 | gsdmWaybillday=$("#gsdmWaybillday").val(); | 204 | gsdmWaybillday=$("#gsdmWaybillday").val(); |
| 202 | fgsdmWaybillday = $("#fgsdmWaybillday").val(); | 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,7 +157,6 @@ | ||
| 157 | }, | 157 | }, |
| 158 | 158 | ||
| 159 | submitHandler : function(f) { | 159 | submitHandler : function(f) { |
| 160 | - debugger | ||
| 161 | var params = form.serializeJSON(); | 160 | var params = form.serializeJSON(); |
| 162 | error.hide(); | 161 | error.hide(); |
| 163 | console.log(params); | 162 | console.log(params); |
src/main/resources/static/pages/permission/user/list.html
| @@ -55,8 +55,8 @@ | @@ -55,8 +55,8 @@ | ||
| 55 | <td> | 55 | <td> |
| 56 | <select class="form-control form-filter " name="enabled_eq"> | 56 | <select class="form-control form-filter " name="enabled_eq"> |
| 57 | <option value="">请选择...</option> | 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 | </select> | 60 | </select> |
| 61 | </td> | 61 | </td> |
| 62 | <td></td> | 62 | <td></td> |
src/main/resources/static/pages/punctual/list.html
| @@ -75,21 +75,14 @@ | @@ -75,21 +75,14 @@ | ||
| 75 | }); | 75 | }); |
| 76 | }); | 76 | }); |
| 77 | $("#exportList").on('click',function(){ | 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 | var date = no.split("_")[0]; | 78 | var date = no.split("_")[0]; |
| 87 | var endDate = date; | 79 | var endDate = date; |
| 88 | var line = no.split("_")[1]; | 80 | var line = no.split("_")[1]; |
| 89 | var fgs=$('#fgsdm').val(); | 81 | var fgs=$('#fgsdm').val(); |
| 90 | var gs=$('#gsdm').val(); | 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,6 +262,9 @@ | ||
| 262 | var endDate = $("#endDate").val(); | 262 | var endDate = $("#endDate").val(); |
| 263 | var fgs=$('#fgsdm').val(); | 263 | var fgs=$('#fgsdm').val(); |
| 264 | var gs=$('#gsdm').val(); | 264 | var gs=$('#gsdm').val(); |
| 265 | + var lineName = $('#line option:selected').text(); | ||
| 266 | + if(lineName == "全部线路") | ||
| 267 | + lineName = $('#subCompany option:selected').text(); | ||
| 265 | var i = layer.load(2); | 268 | var i = layer.load(2); |
| 266 | $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs},function(result){ | 269 | $get('/busInterval/onTime',{line:line,startDate:date,endDate:endDate,gs:gs,fgs:fgs},function(result){ |
| 267 | var onTime = template('onTime',{list:result}); | 270 | var onTime = template('onTime',{list:result}); |
| @@ -277,9 +280,12 @@ | @@ -277,9 +280,12 @@ | ||
| 277 | $("#export").removeAttr("disabled"); | 280 | $("#export").removeAttr("disabled"); |
| 278 | }); | 281 | }); |
| 279 | }); | 282 | }); |
| 283 | + | ||
| 280 | var line1; | 284 | var line1; |
| 285 | + var lineName1; | ||
| 281 | function showSheetList(){ | 286 | function showSheetList(){ |
| 282 | line1 = $(this).data('id'); | 287 | line1 = $(this).data('id'); |
| 288 | + lineName1 = $(this).parent().parent().children()[2].innerHTML; | ||
| 283 | var date = $("#date").val(); | 289 | var date = $("#date").val(); |
| 284 | var endDate = $("#endDate").val(); | 290 | var endDate = $("#endDate").val(); |
| 285 | var fgs=$('#fgsdm').val(); | 291 | var fgs=$('#fgsdm').val(); |
| @@ -320,44 +326,45 @@ | @@ -320,44 +326,45 @@ | ||
| 320 | }); | 326 | }); |
| 321 | } | 327 | } |
| 322 | $("#export").on("click",function(){ | 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 | var line = $("#line").val(); | 329 | var line = $("#line").val(); |
| 332 | var date = $("#date").val(); | 330 | var date = $("#date").val(); |
| 333 | var endDate = $("#endDate").val(); | 331 | var endDate = $("#endDate").val(); |
| 334 | var fgs=$('#fgsdm').val(); | 332 | var fgs=$('#fgsdm').val(); |
| 335 | var gs=$('#gsdm').val(); | 333 | var gs=$('#gsdm').val(); |
| 334 | + var lineName = $('#line option:selected').text(); | ||
| 335 | + if(lineName == "全部线路") | ||
| 336 | + lineName = $('#fgsdm option:selected').text(); | ||
| 336 | var i = layer.load(2); | 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 | layer.close(i); | 348 | layer.close(i); |
| 340 | }); | 349 | }); |
| 341 | }) | 350 | }) |
| 342 | 351 | ||
| 343 | $("#export_1").on("click",function(){ | 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 | var date = $("#date").val(); | 353 | var date = $("#date").val(); |
| 355 | var endDate = $("#endDate").val(); | 354 | var endDate = $("#endDate").val(); |
| 356 | var fgs=$('#fgsdm').val(); | 355 | var fgs=$('#fgsdm').val(); |
| 357 | var gs=$('#gsdm').val(); | 356 | var gs=$('#gsdm').val(); |
| 358 | var i = layer.load(2); | 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 | layer.close(i); | 368 | layer.close(i); |
| 362 | }); | 369 | }); |
| 363 | }); | 370 | }); |
src/main/resources/static/pages/report/countMileage/countBus/company/countBusMileage.html
| @@ -208,12 +208,14 @@ | @@ -208,12 +208,14 @@ | ||
| 208 | return; | 208 | return; |
| 209 | } | 209 | } |
| 210 | line = $("#line").val(); | 210 | line = $("#line").val(); |
| 211 | - xlName = $("#select2-line-container").html(); | ||
| 212 | date = $("#date").val(); | 211 | date = $("#date").val(); |
| 213 | date2 =$("#date2").val(); | 212 | date2 =$("#date2").val(); |
| 214 | gsdm =$("#gsdm").val(); | 213 | gsdm =$("#gsdm").val(); |
| 215 | fgsdm=$("#fgsdm").val(); | 214 | fgsdm=$("#fgsdm").val(); |
| 216 | zt=$("#zt").val(); | 215 | zt=$("#zt").val(); |
| 216 | + xlName = $("#select2-line-container").html(); | ||
| 217 | + if(xlName == "全部线路") | ||
| 218 | + xlName = $('#fgsdm option:selected').text(); | ||
| 217 | if(line=="请选择"){ | 219 | if(line=="请选择"){ |
| 218 | line=""; | 220 | line=""; |
| 219 | } | 221 | } |
| @@ -250,7 +252,7 @@ | @@ -250,7 +252,7 @@ | ||
| 250 | $("#export").on("click",function(){ | 252 | $("#export").on("click",function(){ |
| 251 | var params = {}; | 253 | var params = {}; |
| 252 | params['gsdm'] = gsdm; | 254 | params['gsdm'] = gsdm; |
| 253 | - params['fgsdm'] =fgsdm ; | 255 | + params['fgsdm'] =fgsdm; |
| 254 | params['line'] = line; | 256 | params['line'] = line; |
| 255 | params['date'] = date; | 257 | params['date'] = date; |
| 256 | params['date2'] = date2; | 258 | params['date2'] = date2; |
| @@ -259,7 +261,15 @@ | @@ -259,7 +261,15 @@ | ||
| 259 | params['type'] = "export"; | 261 | params['type'] = "export"; |
| 260 | params['by']='gs'; | 262 | params['by']='gs'; |
| 261 | $get('/report/countBusMileage',params,function(result){ | 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,12 +208,14 @@ | ||
| 208 | return; | 208 | return; |
| 209 | } | 209 | } |
| 210 | line = $("#line").val(); | 210 | line = $("#line").val(); |
| 211 | - xlName = $("#select2-line-container").html(); | ||
| 212 | date = $("#date").val(); | 211 | date = $("#date").val(); |
| 213 | date2 =$("#date2").val(); | 212 | date2 =$("#date2").val(); |
| 214 | gsdm =$("#gsdm").val(); | 213 | gsdm =$("#gsdm").val(); |
| 215 | fgsdm=$("#fgsdm").val(); | 214 | fgsdm=$("#fgsdm").val(); |
| 216 | zt=$("#zt").val(); | 215 | zt=$("#zt").val(); |
| 216 | + xlName = $("#select2-line-container").html(); | ||
| 217 | + if(xlName == "全部线路") | ||
| 218 | + xlName = $('#fgsdm option:selected').text(); | ||
| 217 | if(line=="请选择"){ | 219 | if(line=="请选择"){ |
| 218 | line=""; | 220 | line=""; |
| 219 | } | 221 | } |
| @@ -222,7 +224,7 @@ | @@ -222,7 +224,7 @@ | ||
| 222 | }else{ | 224 | }else{ |
| 223 | var params = {}; | 225 | var params = {}; |
| 224 | params['gsdm'] = gsdm; | 226 | params['gsdm'] = gsdm; |
| 225 | - params['fgsdm'] =fgsdm ; | 227 | + params['fgsdm'] =fgsdm; |
| 226 | params['line'] = line; | 228 | params['line'] = line; |
| 227 | params['date'] = date; | 229 | params['date'] = date; |
| 228 | params['date2'] = date2; | 230 | params['date2'] = date2; |
| @@ -250,7 +252,7 @@ | @@ -250,7 +252,7 @@ | ||
| 250 | $("#export").on("click",function(){ | 252 | $("#export").on("click",function(){ |
| 251 | var params = {}; | 253 | var params = {}; |
| 252 | params['gsdm'] = gsdm; | 254 | params['gsdm'] = gsdm; |
| 253 | - params['fgsdm'] =fgsdm ; | 255 | + params['fgsdm'] =fgsdm; |
| 254 | params['line'] = line; | 256 | params['line'] = line; |
| 255 | params['date'] = date; | 257 | params['date'] = date; |
| 256 | params['date2'] = date2; | 258 | params['date2'] = date2; |
| @@ -258,8 +260,18 @@ | @@ -258,8 +260,18 @@ | ||
| 258 | params['zt']=zt; | 260 | params['zt']=zt; |
| 259 | params['type'] = "export"; | 261 | params['type'] = "export"; |
| 260 | params['by']='sj'; | 262 | params['by']='sj'; |
| 263 | + var i = layer.load(2); | ||
| 261 | $get('/report/countBusMileage',params,function(result){ | 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,11 +244,13 @@ | ||
| 244 | return; | 244 | return; |
| 245 | } | 245 | } |
| 246 | line = $("#line").val(); | 246 | line = $("#line").val(); |
| 247 | - xlName = $("#select2-line-container").html(); | ||
| 248 | date = $("#date").val(); | 247 | date = $("#date").val(); |
| 249 | date2 =$("#date2").val(); | 248 | date2 =$("#date2").val(); |
| 250 | gsdm =$("#gsdm").val(); | 249 | gsdm =$("#gsdm").val(); |
| 251 | fgsdm=$("#fgsdm").val(); | 250 | fgsdm=$("#fgsdm").val(); |
| 251 | + xlName = $("#select2-line-container").html(); | ||
| 252 | + if(xlName == "全部线路") | ||
| 253 | + xlName = $('#fgsdm option:selected').text(); | ||
| 252 | if(line=="请选择"){ | 254 | if(line=="请选择"){ |
| 253 | line=""; | 255 | line=""; |
| 254 | } | 256 | } |
| @@ -257,7 +259,7 @@ | @@ -257,7 +259,7 @@ | ||
| 257 | }else{ | 259 | }else{ |
| 258 | var params = {}; | 260 | var params = {}; |
| 259 | params['gsdm'] = gsdm; | 261 | params['gsdm'] = gsdm; |
| 260 | - params['fgsdm'] =fgsdm ; | 262 | + params['fgsdm'] =fgsdm; |
| 261 | params['line'] = line; | 263 | params['line'] = line; |
| 262 | params['date'] = date; | 264 | params['date'] = date; |
| 263 | params['date2'] = date2; | 265 | params['date2'] = date2; |
| @@ -291,8 +293,18 @@ | @@ -291,8 +293,18 @@ | ||
| 291 | params['xlName'] = xlName; | 293 | params['xlName'] = xlName; |
| 292 | params['type'] = "export"; | 294 | params['type'] = "export"; |
| 293 | params['by']='gs'; | 295 | params['by']='gs'; |
| 296 | + var i = layer.load(2); | ||
| 294 | $get('/report/countLineMileage',params,function(result){ | 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,11 +243,13 @@ | ||
| 243 | return; | 243 | return; |
| 244 | } | 244 | } |
| 245 | line = $("#line").val(); | 245 | line = $("#line").val(); |
| 246 | - xlName = $("#select2-line-container").html(); | ||
| 247 | date = $("#date").val(); | 246 | date = $("#date").val(); |
| 248 | date2 =$("#date2").val(); | 247 | date2 =$("#date2").val(); |
| 249 | gsdm =$("#gsdm").val(); | 248 | gsdm =$("#gsdm").val(); |
| 250 | fgsdm=$("#fgsdm").val(); | 249 | fgsdm=$("#fgsdm").val(); |
| 250 | + xlName = $("#select2-line-container").html(); | ||
| 251 | + if(xlName == "全部线路") | ||
| 252 | + xlName = $('#fgsdm option:selected').text(); | ||
| 251 | if(line=="请选择"){ | 253 | if(line=="请选择"){ |
| 252 | line=""; | 254 | line=""; |
| 253 | } | 255 | } |
| @@ -264,8 +266,8 @@ | @@ -264,8 +266,8 @@ | ||
| 264 | params['type'] = "query"; | 266 | params['type'] = "query"; |
| 265 | var i = layer.load(2); | 267 | var i = layer.load(2); |
| 266 | $get('/report/countLineMileage',params,function(result){ | 268 | $get('/report/countLineMileage',params,function(result){ |
| 267 | - $("#datetodate").html(date+"至"+date2); | ||
| 268 | layer.close(i); | 269 | layer.close(i); |
| 270 | + $("#datetodate").html(date+"至"+date2); | ||
| 269 | // 把数据填充到模版中 | 271 | // 把数据填充到模版中 |
| 270 | var tbodyHtml = template('countLineListSj',{list:result}); | 272 | var tbodyHtml = template('countLineListSj',{list:result}); |
| 271 | // 把渲染好的模版html文本追加到表格中 | 273 | // 把渲染好的模版html文本追加到表格中 |
| @@ -290,8 +292,18 @@ | @@ -290,8 +292,18 @@ | ||
| 290 | params['xlName'] = xlName; | 292 | params['xlName'] = xlName; |
| 291 | params['type'] = "export"; | 293 | params['type'] = "export"; |
| 292 | params['by']='sj'; | 294 | params['by']='sj'; |
| 295 | + var i = layer.load(2); | ||
| 293 | $get('/report/countLineMileage',params,function(result){ | 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,11 +479,14 @@ | ||
| 479 | var nbbm=$("#nbbm").val(); | 479 | var nbbm=$("#nbbm").val(); |
| 480 | var fcsj=$("#fcsj_xx").val(); | 480 | var fcsj=$("#fcsj_xx").val(); |
| 481 | var ddsj=$("#ddsj_xx").val(); | 481 | var ddsj=$("#ddsj_xx").val(); |
| 482 | + var pzh=$('#nbbm option:selected').text(); | ||
| 482 | if(fcsj==""){ | 483 | if(fcsj==""){ |
| 483 | layer.msg("没数据"); | 484 | layer.msg("没数据"); |
| 484 | }else{ | 485 | }else{ |
| 485 | $get('/report/exportQueryListZdxx',{clzbh:nbbm,date:rq,line:line,fcsj:fcsj,ddsj:ddsj},function(result){ | 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,6 +498,7 @@ | ||
| 495 | var line=$("#line").val(); | 498 | var line=$("#line").val(); |
| 496 | var zdlx=$("#zdlx").val(); | 499 | var zdlx=$("#zdlx").val(); |
| 497 | var zd=$("#zd").val(); | 500 | var zd=$("#zd").val(); |
| 501 | + var lineName = $('#line option:selected').text(); | ||
| 498 | if(date1=="" || date1==null){ | 502 | if(date1=="" || date1==null){ |
| 499 | layer.msg("请选择时间"); | 503 | layer.msg("请选择时间"); |
| 500 | }else if( line=="" || line==null){ | 504 | }else if( line=="" || line==null){ |
| @@ -505,7 +509,16 @@ | @@ -505,7 +509,16 @@ | ||
| 505 | layer.msg("请选择方向"); | 509 | layer.msg("请选择方向"); |
| 506 | }else{ | 510 | }else{ |
| 507 | $get('/report/exportQueryListClzd',{zd:zd,zdlx:zdlx,line:line,fcsj:date1,ddsj:date2},function(result){ | 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,7 +179,8 @@ | ||
| 179 | }); | 179 | }); |
| 180 | 180 | ||
| 181 | var date = ''; | 181 | var date = ''; |
| 182 | - var line = $("#line").val(); | 182 | + var line = $("#line").val(); |
| 183 | + var lineName = $('#line option:selected').text(); | ||
| 183 | $("#query").on("click",function(){ | 184 | $("#query").on("click",function(){ |
| 184 | if($("#date").val() == null || $("#date").val().trim().length == 0){ | 185 | if($("#date").val() == null || $("#date").val().trim().length == 0){ |
| 185 | layer.msg("请选择时间!"); | 186 | layer.msg("请选择时间!"); |
| @@ -216,6 +217,7 @@ | @@ -216,6 +217,7 @@ | ||
| 216 | jName = params[1]; | 217 | jName = params[1]; |
| 217 | line = $("#line").val(); | 218 | line = $("#line").val(); |
| 218 | date = $("#date").val(); | 219 | date = $("#date").val(); |
| 220 | + lineName = $('#line option:selected').text(); | ||
| 219 | var obj = $(this); | 221 | var obj = $(this); |
| 220 | $get('/report/historyMessageList',{line:line,date:date,code:jName,type:"query"},function(result){ | 222 | $get('/report/historyMessageList',{line:line,date:date,code:jName,type:"query"},function(result){ |
| 221 | var list_history_msg = template('list_history_msg',{list:result}); | 223 | var list_history_msg = template('list_history_msg',{list:result}); |
| @@ -238,7 +240,8 @@ | @@ -238,7 +240,8 @@ | ||
| 238 | 240 | ||
| 239 | $("#export").on("click",function(){ | 241 | $("#export").on("click",function(){ |
| 240 | $get('/report/historyMessageList',{line:line,date:date,code:jName,type:"export_msg"},function(result){ | 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,9 +214,11 @@ | ||
| 214 | var date = $("#date").val(); | 214 | var date = $("#date").val(); |
| 215 | var gsdm = $("#gsdm").val(); | 215 | var gsdm = $("#gsdm").val(); |
| 216 | var fgsdm = $("#fgsdm").val(); | 216 | var fgsdm = $("#fgsdm").val(); |
| 217 | + var i = layer.load(2); | ||
| 217 | $get('/ylb/oilListMonth',{line:line,date:date,gsdm:gsdm,fgsdm,fgsdm,type:'query'},function(result){ | 218 | $get('/ylb/oilListMonth',{line:line,date:date,gsdm:gsdm,fgsdm,fgsdm,type:'query'},function(result){ |
| 218 | var oilListMonth = template('oilListMonth',{list:result}); | 219 | var oilListMonth = template('oilListMonth',{list:result}); |
| 219 | $('#forms tbody').html(oilListMonth); | 220 | $('#forms tbody').html(oilListMonth); |
| 221 | + layer.close(i); | ||
| 220 | }); | 222 | }); |
| 221 | }); | 223 | }); |
| 222 | 224 | ||
| @@ -230,8 +232,13 @@ | @@ -230,8 +232,13 @@ | ||
| 230 | var date = $("#date").val(); | 232 | var date = $("#date").val(); |
| 231 | var gsdm = $("#gsdm").val(); | 233 | var gsdm = $("#gsdm").val(); |
| 232 | var fgsdm = $("#fgsdm").val(); | 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,9 +312,20 @@ | ||
| 312 | var endDate = $("#endDate").val(); | 312 | var endDate = $("#endDate").val(); |
| 313 | var fgs=$('#fgsdm').val(); | 313 | var fgs=$('#fgsdm').val(); |
| 314 | var gs=$('#gsdm').val(); | 314 | var gs=$('#gsdm').val(); |
| 315 | + var lineName = $('#line option:selected').text(); | ||
| 316 | + if(lineName == "全部线路") | ||
| 317 | + lineName = $('#fgsdm option:selected').text(); | ||
| 315 | var i = layer.load(2); | 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 | layer.close(i); | 329 | layer.close(i); |
| 319 | }); | 330 | }); |
| 320 | // $("#forms_h").table2excel({ | 331 | // $("#forms_h").table2excel({ |
src/main/resources/static/real_control_v2/fragments/line_schedule/context_menu/lj_zrw.html
| @@ -502,12 +502,10 @@ | @@ -502,12 +502,10 @@ | ||
| 502 | }, | 502 | }, |
| 503 | items: { | 503 | items: { |
| 504 | "edit_sub_task":{ | 504 | "edit_sub_task":{ |
| 505 | - name: '修改子任务', | ||
| 506 | - icon: 'edit' | 505 | + name: '修改子任务' |
| 507 | }, | 506 | }, |
| 508 | "remove_sub_task": { | 507 | "remove_sub_task": { |
| 509 | name: "删除子任务" | 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,6 +247,8 @@ | ||
| 247 | var stp; | 247 | var stp; |
| 248 | var qdSelect=$f('qdzCode', f)[0],zdSelect=$f('zdzCode', f)[0]; | 248 | var qdSelect=$f('qdzCode', f)[0],zdSelect=$f('zdzCode', f)[0]; |
| 249 | 249 | ||
| 250 | + if(qdSelect.options.selectedIndex < 0) | ||
| 251 | + return; | ||
| 250 | var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text, | 252 | var qdzName=qdSelect.options[qdSelect.options.selectedIndex].text, |
| 251 | zdzName=zdSelect.options[zdSelect.options.selectedIndex].text, | 253 | zdzName=zdSelect.options[zdSelect.options.selectedIndex].text, |
| 252 | type2 = $f('bcType', f).val(); | 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,12 +317,12 @@ | ||
| 317 | * 渲染场既是站dom | 317 | * 渲染场既是站dom |
| 318 | */ | 318 | */ |
| 319 | function renderPSDom() { | 319 | function renderPSDom() { |
| 320 | - $('.c_2_s_list', $panel).html(''); | ||
| 321 | var pArray = conf.twinsParks.split(','), | 320 | var pArray = conf.twinsParks.split(','), |
| 322 | cArray = conf.twinsStations.split(','); | 321 | cArray = conf.twinsStations.split(','); |
| 323 | var htmlStr = '', | 322 | var htmlStr = '', |
| 324 | $panel = $('.park-and-station-wrap', wrap); | 323 | $panel = $('.park-and-station-wrap', wrap); |
| 325 | 324 | ||
| 325 | + $('.c_2_s_list', $panel).html(''); | ||
| 326 | if(conf['outConfig']!=2){ | 326 | if(conf['outConfig']!=2){ |
| 327 | $panel.hide().find('.c_2_s_list').empty(); | 327 | $panel.hide().find('.c_2_s_list').empty(); |
| 328 | return; | 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,7 +836,7 @@ var gb_schedule_table = (function () { | ||
| 836 | if(wrap.length==0) | 836 | if(wrap.length==0) |
| 837 | continue; | 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 | .html('班次站点编码与实际不符!!!').show(); | 840 | .html('班次站点编码与实际不符!!!').show(); |
| 841 | } | 841 | } |
| 842 | 842 |
src/main/resources/static/real_control_v2/mapmonitor/real.html
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | 14 | ||
| 15 | <div id="real_map_container"></div> | 15 | <div id="real_map_container"></div> |
| 16 | <div class="real_right_gps_panel"> | 16 | <div class="real_right_gps_panel"> |
| 17 | - <form class="uk-form" > | 17 | + <form class="uk-form" onsubmit="return false;"> |
| 18 | <div class="uk-autocomplete uk-form ral-gps-autocom" style="width: 100%;"> | 18 | <div class="uk-autocomplete uk-form ral-gps-autocom" style="width: 100%;"> |
| 19 | <div class="uk-form-icon"> | 19 | <div class="uk-form-icon"> |
| 20 | <i class="uk-icon-search"></i> | 20 | <i class="uk-icon-search"></i> |