Commit 3e8964e5a9907ca035112b227c186c172cb24920
1 parent
0c6c5b95
动态生成时刻表修正,直接打开时刻表可以导出
Showing
5 changed files
with
38 additions
and
8 deletions
src/main/java/com/bsth/service/schedule/datatools/TTInfoDetailDataToolsImpl.java
| ... | ... | @@ -454,6 +454,19 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail |
| 454 | 454 | |
| 455 | 455 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); |
| 456 | 456 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); |
| 457 | + | |
| 458 | + // TODO | |
| 459 | + Map<String, Object> param = new HashMap<>(); | |
| 460 | + param.put("station.id_eq", null); | |
| 461 | + if (station1 == null) { | |
| 462 | + param.put("station.id_eq", lpObjList.get(0).getStationRouteId1()); | |
| 463 | + station1 = ((List<StationRoute>) stationRouteService.list(param)).get(0); | |
| 464 | + } | |
| 465 | + if (station2 == null) { | |
| 466 | + param.put("station.id_eq", lpObjList.get(0).getStationRouteId2()); | |
| 467 | + station2 = ((List<StationRoute>) stationRouteService.list(param)).get(0); | |
| 468 | + } | |
| 469 | + | |
| 457 | 470 | for (int i = 0; i < groupCount; i++) { |
| 458 | 471 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 1), station1.getStationName(), new Color(0x96b9d7)); |
| 459 | 472 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 2), station2.getStationName(), new Color(0x96b9d7)); |
| ... | ... | @@ -566,6 +579,19 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail |
| 566 | 579 | |
| 567 | 580 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); |
| 568 | 581 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); |
| 582 | + | |
| 583 | + // TODO | |
| 584 | + Map<String, Object> param = new HashMap<>(); | |
| 585 | + param.put("station.id_eq", null); | |
| 586 | + if (station1 == null) { | |
| 587 | + param.put("station.id_eq", lpObjList.get(0).getStationRouteId1()); | |
| 588 | + station1 = ((List<StationRoute>) stationRouteService.list(param)).get(0); | |
| 589 | + } | |
| 590 | + if (station2 == null) { | |
| 591 | + param.put("station.id_eq", lpObjList.get(0).getStationRouteId2()); | |
| 592 | + station2 = ((List<StationRoute>) stationRouteService.list(param)).get(0); | |
| 593 | + } | |
| 594 | + | |
| 569 | 595 | for (int i = 1; i <= groupCount; i++) { |
| 570 | 596 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 1), station1.getStationName(), new Color(0x96b9d7)); |
| 571 | 597 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 2), station2.getStationName(), new Color(0x96b9d7)); |
| ... | ... | @@ -644,7 +670,9 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail |
| 644 | 670 | cell.setCellValue(bcObj.getFcsj() + "X"); |
| 645 | 671 | } else { // 一个车次链 |
| 646 | 672 | cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3)); |
| 647 | - cell.setCellValue(bcObj.getFcsj() + "X"); | |
| 673 | + if (cell != null) { | |
| 674 | + cell.setCellValue(bcObj.getFcsj() + "X"); | |
| 675 | + } | |
| 648 | 676 | } |
| 649 | 677 | break; |
| 650 | 678 | case LC: | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/add-form-reload.js
src/main/resources/static/pages/base/timesmodel/js/gantt.js
| ... | ... | @@ -66,6 +66,8 @@ |
| 66 | 66 | CSMap = getMaxCarAndStopSpace0(map,seMap); |
| 67 | 67 | // 发车间隙 |
| 68 | 68 | map.fcjx = CSMap.fcjx; |
| 69 | + map.stt = "1"; | |
| 70 | + _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); | |
| 69 | 71 | }else if(map.baseRes== '1') { |
| 70 | 72 | CSMap = getMaxCarAndStopSpace1(map); |
| 71 | 73 | // 发车间隙 |
| ... | ... | @@ -144,7 +146,7 @@ |
| 144 | 146 | // // 初始化右键菜单. |
| 145 | 147 | // contextInit(graph); |
| 146 | 148 | |
| 147 | - if (map.baseRes == '3' || map.baseRes == '1') { | |
| 149 | + if (map.baseRes == '3' || map.baseRes == '1' || map.baseRes == '0') { | |
| 148 | 150 | // 导入导出设置 |
| 149 | 151 | // Main_v2_2.exportExcelConfig($_GlobalGraph.getDataArray); |
| 150 | 152 | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/v2_2/Main_v2_2_ExcelObj.js
| ... | ... | @@ -581,10 +581,10 @@ var Main_v2_2_ExcelObj = (function() { |
| 581 | 581 | "zdzid": oGanttBc.zdz, // 终点站id |
| 582 | 582 | |
| 583 | 583 | "isUp": bIsUp, // 是否上行 |
| 584 | - "isFb": null, // 是否分班(_resetBdOutInLcBcGroup方法修正) | |
| 584 | + "isFb": false, // 是否分班(_resetBdOutInLcBcGroup方法修正) | |
| 585 | 585 | |
| 586 | 586 | "bcType": oGanttBc.bcType, // 班次类型(bc、out、in、lc) |
| 587 | - "fcsj": oGanttBc.fcsj, // 发车时间描述 | |
| 587 | + "fcsj": (oGanttBc.fcsj == null ? "" : oGanttBc.fcsj), // 发车时间描述 | |
| 588 | 588 | |
| 589 | 589 | "groupNo": -99, // 第几圈(_resetBdOutInLcBcGroup方法修正) |
| 590 | 590 | "groupBcNo": -99, // 圈里第几个班次(_resetBdOutInLcBcGroup方法修正) | ... | ... |
src/main/resources/static/pages/base/timesmodel/js/v2_2/main_v2_2.js
| ... | ... | @@ -43,7 +43,7 @@ var Main_v2_2 = function() { |
| 43 | 43 | schedule.fnAdjustHeadway(); |
| 44 | 44 | // 4、计算吃饭班次 |
| 45 | 45 | schedule.fnCalcuEatBc(); |
| 46 | - // // 6、计算末班车 | |
| 46 | + // // 6、计算末班车(TODO:这里家里末班车,貌似导出Excel会报错,待修正) | |
| 47 | 47 | // schedule.fnCalcuLastBc(); |
| 48 | 48 | // 7、重新设置停站时间 |
| 49 | 49 | schedule.fnReSetLayoverTime(); |
| ... | ... | @@ -64,8 +64,8 @@ var Main_v2_2 = function() { |
| 64 | 64 | * 导出时刻表配置。 |
| 65 | 65 | * @param fnGetGanttBc 获取gantt班次方法 |
| 66 | 66 | */ |
| 67 | - exportExcelConfig: function(fnGetGanttBc) { | |
| 68 | - var oExcel = new Main_v2_2_ExcelObj(_paramObj, fnGetGanttBc); | |
| 67 | + exportExcelConfig: function(paramobj, fnGetGanttBc) { | |
| 68 | + var oExcel = new Main_v2_2_ExcelObj(paramobj, fnGetGanttBc); | |
| 69 | 69 | |
| 70 | 70 | $('.exportAddXls').off('click'); |
| 71 | 71 | $('.exportAddXlsx').off('click'); | ... | ... |