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,6 +454,19 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | ||
| 454 | 454 | ||
| 455 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); | 455 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); |
| 456 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); | 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 | for (int i = 0; i < groupCount; i++) { | 470 | for (int i = 0; i < groupCount; i++) { |
| 458 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 1), station1.getStationName(), new Color(0x96b9d7)); | 471 | 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)); | 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,6 +579,19 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | ||
| 566 | 579 | ||
| 567 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); | 580 | StationRoute station1 = stationRouteService.findById(lpObjList.get(0).getStationRouteId1()); |
| 568 | StationRoute station2 = stationRouteService.findById(lpObjList.get(1).getStationRouteId2()); | 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 | for (int i = 1; i <= groupCount; i++) { | 595 | for (int i = 1; i <= groupCount; i++) { |
| 570 | excelPoiOperator.createStringCell(wb, lpHeadRow, (short) (i * 2 + 1), station1.getStationName(), new Color(0x96b9d7)); | 596 | 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)); | 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,7 +670,9 @@ public class TTInfoDetailDataToolsImpl implements DataToolsService, TTInfoDetail | ||
| 644 | cell.setCellValue(bcObj.getFcsj() + "X"); | 670 | cell.setCellValue(bcObj.getFcsj() + "X"); |
| 645 | } else { // 一个车次链 | 671 | } else { // 一个车次链 |
| 646 | cell = lpRow.getCell((short) (bcObj.getGroupNo() * 2 + bcObj.getGroupBcNo() + 3)); | 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 | break; | 677 | break; |
| 650 | case LC: | 678 | case LC: |
src/main/resources/static/pages/base/timesmodel/js/add-form-reload.js
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | if (!$('body').hasClass('page-sidebar-closed')) { | 3 | if (!$('body').hasClass('page-sidebar-closed')) { |
| 4 | $('.menu-toggler.sidebar-toggler').click(); | 4 | $('.menu-toggler.sidebar-toggler').click(); |
| 5 | } | 5 | } |
| 6 | - | 6 | + |
| 7 | $('.openHaveSkb').on('click',function() { | 7 | $('.openHaveSkb').on('click',function() { |
| 8 | var skbId = $("#skbNameSelect").val(); | 8 | var skbId = $("#skbNameSelect").val(); |
| 9 | var argus = { | 9 | var argus = { |
src/main/resources/static/pages/base/timesmodel/js/gantt.js
| @@ -66,6 +66,8 @@ | @@ -66,6 +66,8 @@ | ||
| 66 | CSMap = getMaxCarAndStopSpace0(map,seMap); | 66 | CSMap = getMaxCarAndStopSpace0(map,seMap); |
| 67 | // 发车间隙 | 67 | // 发车间隙 |
| 68 | map.fcjx = CSMap.fcjx; | 68 | map.fcjx = CSMap.fcjx; |
| 69 | + map.stt = "1"; | ||
| 70 | + _paramObj = Main_v2.getFactory().createParameterObj(map, dataMap); | ||
| 69 | }else if(map.baseRes== '1') { | 71 | }else if(map.baseRes== '1') { |
| 70 | CSMap = getMaxCarAndStopSpace1(map); | 72 | CSMap = getMaxCarAndStopSpace1(map); |
| 71 | // 发车间隙 | 73 | // 发车间隙 |
| @@ -144,7 +146,7 @@ | @@ -144,7 +146,7 @@ | ||
| 144 | // // 初始化右键菜单. | 146 | // // 初始化右键菜单. |
| 145 | // contextInit(graph); | 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 | // Main_v2_2.exportExcelConfig($_GlobalGraph.getDataArray); | 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,10 +581,10 @@ var Main_v2_2_ExcelObj = (function() { | ||
| 581 | "zdzid": oGanttBc.zdz, // 终点站id | 581 | "zdzid": oGanttBc.zdz, // 终点站id |
| 582 | 582 | ||
| 583 | "isUp": bIsUp, // 是否上行 | 583 | "isUp": bIsUp, // 是否上行 |
| 584 | - "isFb": null, // 是否分班(_resetBdOutInLcBcGroup方法修正) | 584 | + "isFb": false, // 是否分班(_resetBdOutInLcBcGroup方法修正) |
| 585 | 585 | ||
| 586 | "bcType": oGanttBc.bcType, // 班次类型(bc、out、in、lc) | 586 | "bcType": oGanttBc.bcType, // 班次类型(bc、out、in、lc) |
| 587 | - "fcsj": oGanttBc.fcsj, // 发车时间描述 | 587 | + "fcsj": (oGanttBc.fcsj == null ? "" : oGanttBc.fcsj), // 发车时间描述 |
| 588 | 588 | ||
| 589 | "groupNo": -99, // 第几圈(_resetBdOutInLcBcGroup方法修正) | 589 | "groupNo": -99, // 第几圈(_resetBdOutInLcBcGroup方法修正) |
| 590 | "groupBcNo": -99, // 圈里第几个班次(_resetBdOutInLcBcGroup方法修正) | 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,7 +43,7 @@ var Main_v2_2 = function() { | ||
| 43 | schedule.fnAdjustHeadway(); | 43 | schedule.fnAdjustHeadway(); |
| 44 | // 4、计算吃饭班次 | 44 | // 4、计算吃饭班次 |
| 45 | schedule.fnCalcuEatBc(); | 45 | schedule.fnCalcuEatBc(); |
| 46 | - // // 6、计算末班车 | 46 | + // // 6、计算末班车(TODO:这里家里末班车,貌似导出Excel会报错,待修正) |
| 47 | // schedule.fnCalcuLastBc(); | 47 | // schedule.fnCalcuLastBc(); |
| 48 | // 7、重新设置停站时间 | 48 | // 7、重新设置停站时间 |
| 49 | schedule.fnReSetLayoverTime(); | 49 | schedule.fnReSetLayoverTime(); |
| @@ -64,8 +64,8 @@ var Main_v2_2 = function() { | @@ -64,8 +64,8 @@ var Main_v2_2 = function() { | ||
| 64 | * 导出时刻表配置。 | 64 | * 导出时刻表配置。 |
| 65 | * @param fnGetGanttBc 获取gantt班次方法 | 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 | $('.exportAddXls').off('click'); | 70 | $('.exportAddXls').off('click'); |
| 71 | $('.exportAddXlsx').off('click'); | 71 | $('.exportAddXlsx').off('click'); |