Commit 0cec34562fc61896542e41f61482dc630e2954e0
1 parent
6e21e4a2
update
Showing
7 changed files
with
57 additions
and
12 deletions
pom.xml
| @@ -18,6 +18,13 @@ | @@ -18,6 +18,13 @@ | ||
| 18 | <groupId>org.springframework.boot</groupId> | 18 | <groupId>org.springframework.boot</groupId> |
| 19 | <artifactId>spring-boot-starter-web</artifactId> | 19 | <artifactId>spring-boot-starter-web</artifactId> |
| 20 | </dependency> | 20 | </dependency> |
| 21 | + | ||
| 22 | + <!-- <dependency> | ||
| 23 | + <groupId>org.springframework.boot</groupId> | ||
| 24 | + <artifactId>spring-boot-starter-tomcat</artifactId> | ||
| 25 | + <scope>provided</scope> | ||
| 26 | + </dependency> --> | ||
| 27 | + | ||
| 21 | <dependency> | 28 | <dependency> |
| 22 | <groupId>org.springframework.boot</groupId> | 29 | <groupId>org.springframework.boot</groupId> |
| 23 | <artifactId>spring-boot-starter-security</artifactId> | 30 | <artifactId>spring-boot-starter-security</artifactId> |
src/main/java/com/bsth/entity/sys/Module.java
| @@ -18,11 +18,6 @@ import javax.persistence.Table; | @@ -18,11 +18,6 @@ import javax.persistence.Table; | ||
| 18 | 18 | ||
| 19 | @Entity | 19 | @Entity |
| 20 | @Table(name = "bsth_c_sys_module") | 20 | @Table(name = "bsth_c_sys_module") |
| 21 | -@NamedEntityGraphs({ | ||
| 22 | - @NamedEntityGraph(name = "module_roles", attributeNodes = { | ||
| 23 | - @NamedAttributeNode("roles") | ||
| 24 | - }) | ||
| 25 | -}) | ||
| 26 | public class Module { | 21 | public class Module { |
| 27 | 22 | ||
| 28 | @Id | 23 | @Id |
| @@ -53,7 +48,7 @@ public class Module { | @@ -53,7 +48,7 @@ public class Module { | ||
| 53 | */ | 48 | */ |
| 54 | private String groupType; | 49 | private String groupType; |
| 55 | 50 | ||
| 56 | - @ManyToMany(mappedBy = "modules", fetch = FetchType.LAZY) | 51 | + @ManyToMany(mappedBy = "modules") |
| 57 | private Set<Role> roles = new LinkedHashSet<>(); | 52 | private Set<Role> roles = new LinkedHashSet<>(); |
| 58 | 53 | ||
| 59 | @Column(updatable = false,name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") | 54 | @Column(updatable = false,name = "create_date", columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP") |
src/main/java/com/bsth/repository/ModuleRepository.java
| @@ -21,7 +21,6 @@ public interface ModuleRepository extends BaseRepository<Module, Integer>{ | @@ -21,7 +21,6 @@ public interface ModuleRepository extends BaseRepository<Module, Integer>{ | ||
| 21 | @Query("select m from Module m where m.id in ?1") | 21 | @Query("select m from Module m where m.id in ?1") |
| 22 | Set<Module> findByIds(List<Integer> ids); | 22 | Set<Module> findByIds(List<Integer> ids); |
| 23 | 23 | ||
| 24 | - @EntityGraph(value = "carConfigInfo_xl_cl", type = EntityGraph.EntityGraphType.FETCH) | ||
| 25 | @Override | 24 | @Override |
| 26 | List<Module> findAll(Specification<Module> spec); | 25 | List<Module> findAll(Specification<Module> spec); |
| 27 | } | 26 | } |
src/main/resources/static/pages/control/line/child_pages/child_task.html
| @@ -240,6 +240,7 @@ $(function(){ | @@ -240,6 +240,7 @@ $(function(){ | ||
| 240 | var scheduleIdMap; | 240 | var scheduleIdMap; |
| 241 | 241 | ||
| 242 | var _data; //data.js引用 | 242 | var _data; //data.js引用 |
| 243 | + var _alone; //alone.js 引用 | ||
| 243 | 244 | ||
| 244 | //滚动时固定表头 | 245 | //滚动时固定表头 |
| 245 | $('.custom-table-panel').on('scroll', function(){ | 246 | $('.custom-table-panel').on('scroll', function(){ |
| @@ -317,6 +318,7 @@ $(function(){ | @@ -317,6 +318,7 @@ $(function(){ | ||
| 317 | //线路下拉框 | 318 | //线路下拉框 |
| 318 | $('#childTaskDiv').on('init', function(e, ops ){ | 319 | $('#childTaskDiv').on('init', function(e, ops ){ |
| 319 | _data = ops._data; | 320 | _data = ops._data; |
| 321 | + _alone = ops._alone; | ||
| 320 | //要选中的班次 | 322 | //要选中的班次 |
| 321 | var schedul = ops.selected; | 323 | var schedul = ops.selected; |
| 322 | var lineData = [], lineName; | 324 | var lineData = [], lineName; |
| @@ -494,8 +496,14 @@ $(function(){ | @@ -494,8 +496,14 @@ $(function(){ | ||
| 494 | param.zdzName = searchStationName(route, param.zdzCode); | 496 | param.zdzName = searchStationName(route, param.zdzCode); |
| 495 | 497 | ||
| 496 | $post('/realSchedule', param, function(rs){ | 498 | $post('/realSchedule', param, function(rs){ |
| 499 | + var sch = rs.t; | ||
| 497 | //前端缓存更新 | 500 | //前端缓存更新 |
| 498 | - scheduleLineMap[param.xlBm][param.lpName].push(rs.t); | 501 | + scheduleLineMap[param.xlBm][param.lpName].push(sch); |
| 502 | + _data.pushSchedule(sch); | ||
| 503 | + //刷新表格 | ||
| 504 | + _alone.addScheduleToTable(sch); | ||
| 505 | + //关闭弹出层 | ||
| 506 | + layer.closeAll(); | ||
| 499 | }); | 507 | }); |
| 500 | }); | 508 | }); |
| 501 | 509 |
src/main/resources/static/pages/control/line/js/alone.js
| @@ -62,6 +62,27 @@ var _alone = (function(){ | @@ -62,6 +62,27 @@ var _alone = (function(){ | ||
| 62 | $tr.replaceWith(newTr); | 62 | $tr.replaceWith(newTr); |
| 63 | initRemarksPop(); | 63 | initRemarksPop(); |
| 64 | }, | 64 | }, |
| 65 | + //添加一个班次到表格 | ||
| 66 | + addScheduleToTable: function(schedule){ | ||
| 67 | + var upDown = schedule.xlDir==0?'up':'down'; | ||
| 68 | + //重新渲染表格 | ||
| 69 | + var table = $('#tab_line_' + schedule.xlBm).find('.pb-table[data-type='+upDown+']'); | ||
| 70 | + //获取班次信息 | ||
| 71 | + var schArray = _data.findSchByLine(schedule.xlBm, schedule.xlDir); | ||
| 72 | + calculateLineNo( | ||
| 73 | + table.find('tbody').html(template('alone_plan_table_temp', {list: schArray}))[0] | ||
| 74 | + ); | ||
| 75 | + | ||
| 76 | + var currTr = table.find('tr[data-id='+schedule.id+']'); | ||
| 77 | + console.log(currTr); | ||
| 78 | + //重新设置滚动条, | ||
| 79 | + table.find('._body').slimscroll({ | ||
| 80 | + height: 'calc(100% - 80px)', | ||
| 81 | + alwaysVisible: true, | ||
| 82 | + start: currTr | ||
| 83 | + }); | ||
| 84 | + | ||
| 85 | + }, | ||
| 65 | //重新计算行号 | 86 | //重新计算行号 |
| 66 | calculateLineNo: calculateLineNo | 87 | calculateLineNo: calculateLineNo |
| 67 | } | 88 | } |
src/main/resources/static/pages/control/line/js/data.js
| @@ -28,6 +28,23 @@ var _data = (function(){ | @@ -28,6 +28,23 @@ var _data = (function(){ | ||
| 28 | var carDeviceIdMapp = {}; | 28 | var carDeviceIdMapp = {}; |
| 29 | 29 | ||
| 30 | var dataObject = { | 30 | var dataObject = { |
| 31 | + //根据线路和上下行获取计划排班 | ||
| 32 | + findSchByLine: function(xlbm, upDown){ | ||
| 33 | + var array = []; | ||
| 34 | + $.each(scheduleList, function(){ | ||
| 35 | + if(this.xlBm == xlbm | ||
| 36 | + && this.xlDir == upDown) | ||
| 37 | + array.push(this); | ||
| 38 | + }); | ||
| 39 | + | ||
| 40 | + return array; | ||
| 41 | + }, | ||
| 42 | + //添加一个班次 | ||
| 43 | + pushSchedule: function(sch){ | ||
| 44 | + scheduleList.push(sch); | ||
| 45 | + schedules[sch.id] = sch; | ||
| 46 | + lineLpMap[sch.xlBm][sch.lpName].push(sch); | ||
| 47 | + }, | ||
| 31 | getLines: function(){ | 48 | getLines: function(){ |
| 32 | return JSON.parse(storage.getItem('lineControlItems')); | 49 | return JSON.parse(storage.getItem('lineControlItems')); |
| 33 | }, | 50 | }, |
src/main/resources/static/pages/control/line/js/rightMenu.js
| @@ -177,11 +177,9 @@ var _menu = (function() { | @@ -177,11 +177,9 @@ var _menu = (function() { | ||
| 177 | success: function(){ | 177 | success: function(){ |
| 178 | dictionaryUtils.transformDom($('#childTaskDiv .nt-dictionary')); | 178 | dictionaryUtils.transformDom($('#childTaskDiv .nt-dictionary')); |
| 179 | $('#childTaskDiv').trigger('init', { | 179 | $('#childTaskDiv').trigger('init', { |
| 180 | - //data: _data.getLineLpMap(), | ||
| 181 | selected: schedul, | 180 | selected: schedul, |
| 182 | - _data: _data | ||
| 183 | - //stationRoute: _data.getStationRouteByLine(schedul.xlBm), | ||
| 184 | - // lineInformation: _data.getLineInformation(schedul.xlBm) | 181 | + _data: _data, |
| 182 | + _alone: _alone | ||
| 185 | }); | 183 | }); |
| 186 | } | 184 | } |
| 187 | }); | 185 | }); |