Commit 06356c2bf86a82402c64eef9b8e726aedda4e0ba
1 parent
657931da
update
Showing
22 changed files
with
432 additions
and
70 deletions
pom.xml
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | <groupId>com.bsth</groupId> | 5 | <groupId>com.bsth</groupId> |
| 6 | <artifactId>bsth_control</artifactId> | 6 | <artifactId>bsth_control</artifactId> |
| 7 | <version>0.0.1-SNAPSHOT</version> | 7 | <version>0.0.1-SNAPSHOT</version> |
| 8 | - <packaging>jar</packaging> | 8 | + <packaging>war</packaging> |
| 9 | 9 | ||
| 10 | <parent> | 10 | <parent> |
| 11 | <groupId>org.springframework.boot</groupId> | 11 | <groupId>org.springframework.boot</groupId> |
| @@ -19,11 +19,11 @@ | @@ -19,11 +19,11 @@ | ||
| 19 | <artifactId>spring-boot-starter-web</artifactId> | 19 | <artifactId>spring-boot-starter-web</artifactId> |
| 20 | </dependency> | 20 | </dependency> |
| 21 | 21 | ||
| 22 | - <!-- <dependency> | 22 | + <dependency> |
| 23 | <groupId>org.springframework.boot</groupId> | 23 | <groupId>org.springframework.boot</groupId> |
| 24 | <artifactId>spring-boot-starter-tomcat</artifactId> | 24 | <artifactId>spring-boot-starter-tomcat</artifactId> |
| 25 | <scope>provided</scope> | 25 | <scope>provided</scope> |
| 26 | - </dependency> --> | 26 | + </dependency> |
| 27 | 27 | ||
| 28 | <dependency> | 28 | <dependency> |
| 29 | <groupId>org.springframework.boot</groupId> | 29 | <groupId>org.springframework.boot</groupId> |
src/main/java/com/bsth/Application.java
| @@ -4,21 +4,28 @@ import com.fasterxml.jackson.databind.ObjectMapper; | @@ -4,21 +4,28 @@ import com.fasterxml.jackson.databind.ObjectMapper; | ||
| 4 | import com.fasterxml.jackson.databind.SerializationFeature; | 4 | import com.fasterxml.jackson.databind.SerializationFeature; |
| 5 | import org.springframework.boot.SpringApplication; | 5 | import org.springframework.boot.SpringApplication; |
| 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; | 6 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 7 | +import org.springframework.boot.builder.SpringApplicationBuilder; | ||
| 8 | +import org.springframework.boot.context.web.SpringBootServletInitializer; | ||
| 7 | import org.springframework.context.annotation.Bean; | 9 | import org.springframework.context.annotation.Bean; |
| 8 | import org.springframework.context.annotation.Primary; | 10 | import org.springframework.context.annotation.Primary; |
| 9 | 11 | ||
| 10 | @SpringBootApplication | 12 | @SpringBootApplication |
| 11 | -public class Application{ | 13 | +public class Application extends SpringBootServletInitializer { |
| 12 | 14 | ||
| 13 | - @Bean | ||
| 14 | - @Primary | ||
| 15 | - public ObjectMapper objectMapper() { | ||
| 16 | - ObjectMapper objectMapper = new ObjectMapper(); | ||
| 17 | - objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); | 15 | + @Override |
| 16 | + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { | ||
| 17 | + return application.sources(Application.class); | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + @Bean | ||
| 21 | + @Primary | ||
| 22 | + public ObjectMapper objectMapper() { | ||
| 23 | + ObjectMapper objectMapper = new ObjectMapper(); | ||
| 24 | + objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS); | ||
| 25 | + | ||
| 26 | + return objectMapper; | ||
| 27 | + } | ||
| 18 | 28 | ||
| 19 | - return objectMapper; | ||
| 20 | - } | ||
| 21 | - | ||
| 22 | public static void main(String[] args) throws Exception { | 29 | public static void main(String[] args) throws Exception { |
| 23 | SpringApplication.run(Application.class, args); | 30 | SpringApplication.run(Application.class, args); |
| 24 | } | 31 | } |
src/main/java/com/bsth/StartCommand.java
| @@ -93,7 +93,7 @@ public class StartCommand implements CommandLineRunner{ | @@ -93,7 +93,7 @@ public class StartCommand implements CommandLineRunner{ | ||
| 93 | * 每15秒从数据库抓取到离站信息和班次匹配 | 93 | * 每15秒从数据库抓取到离站信息和班次匹配 |
| 94 | * (网关生成的到离站数据也是延迟批量入库,所以缩短该线程执行周期并不会提高 “实际到离站” 的实时性) | 94 | * (网关生成的到离站数据也是延迟批量入库,所以缩短该线程执行周期并不会提高 “实际到离站” 的实时性) |
| 95 | */ | 95 | */ |
| 96 | - scheduler.scheduleWithFixedDelay(gpsArrivalStationThread, 35, 1200, TimeUnit.SECONDS); | 96 | + //scheduler.scheduleWithFixedDelay(gpsArrivalStationThread, 35, 1200, TimeUnit.SECONDS); |
| 97 | 97 | ||
| 98 | /** | 98 | /** |
| 99 | * 首个调度指令下发(2分钟运行一次) | 99 | * 首个调度指令下发(2分钟运行一次) |
src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
| @@ -216,6 +216,19 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | @@ -216,6 +216,19 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo, | ||
| 216 | ScheduleBuffer.trustMap.put(lineCode, status); | 216 | ScheduleBuffer.trustMap.put(lineCode, status); |
| 217 | return 200; | 217 | return 200; |
| 218 | } | 218 | } |
| 219 | + | ||
| 220 | + /** | ||
| 221 | + * | ||
| 222 | + * @Title: findByLineAndUpDown | ||
| 223 | + * @Description: TODO(根据线路和走向获取班次) | ||
| 224 | + * @param @param line | ||
| 225 | + * @param @param upDown | ||
| 226 | + * @throws | ||
| 227 | + */ | ||
| 228 | + @RequestMapping(value = "/findByLineAndUpDown") | ||
| 229 | + public List<ScheduleRealInfo> findByLineAndUpDown(@RequestParam Integer line,@RequestParam Integer upDown){ | ||
| 230 | + return ScheduleBuffer.findByLineAndUpDown(line, upDown); | ||
| 231 | + } | ||
| 219 | 232 | ||
| 220 | @RequestMapping(value = "/queryUserInfo") | 233 | @RequestMapping(value = "/queryUserInfo") |
| 221 | public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, @RequestParam String date) { | 234 | public List<ScheduleRealInfo> queryUserInfo(@RequestParam String line, @RequestParam String date) { |
src/main/java/com/bsth/entity/realcontrol/ChildTaskPlan.java
| @@ -95,7 +95,7 @@ public class ChildTaskPlan { | @@ -95,7 +95,7 @@ public class ChildTaskPlan { | ||
| 95 | /** | 95 | /** |
| 96 | * 主排班计划 | 96 | * 主排班计划 |
| 97 | */ | 97 | */ |
| 98 | - @ManyToOne(fetch = FetchType.LAZY) | 98 | + @ManyToOne |
| 99 | private ScheduleRealInfo schedule; | 99 | private ScheduleRealInfo schedule; |
| 100 | 100 | ||
| 101 | private String remarks; | 101 | private String remarks; |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| @@ -4,10 +4,6 @@ import java.util.Date; | @@ -4,10 +4,6 @@ import java.util.Date; | ||
| 4 | import java.util.List; | 4 | import java.util.List; |
| 5 | import java.util.Map; | 5 | import java.util.Map; |
| 6 | 6 | ||
| 7 | -import org.springframework.data.domain.Page; | ||
| 8 | -import org.springframework.data.domain.Pageable; | ||
| 9 | -import org.springframework.data.jpa.domain.Specification; | ||
| 10 | -import org.springframework.data.jpa.repository.EntityGraph; | ||
| 11 | import org.springframework.data.jpa.repository.Query; | 7 | import org.springframework.data.jpa.repository.Query; |
| 12 | import org.springframework.stereotype.Repository; | 8 | import org.springframework.stereotype.Repository; |
| 13 | 9 | ||
| @@ -20,9 +16,6 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -20,9 +16,6 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 20 | @Query("select s from ScheduleRealInfo s where s.xlBm in ?1") | 16 | @Query("select s from ScheduleRealInfo s where s.xlBm in ?1") |
| 21 | List<ScheduleRealInfo> findByLines(List<String> lines); | 17 | List<ScheduleRealInfo> findByLines(List<String> lines); |
| 22 | 18 | ||
| 23 | - @EntityGraph(value = "scheduleRealInfo_childTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 24 | - @Override | ||
| 25 | - Page<ScheduleRealInfo> findAll(Specification<ScheduleRealInfo> spec, Pageable pageable); | ||
| 26 | 19 | ||
| 27 | @Query(value="select s from ScheduleRealInfo s where s.xlName = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by jName,clZbh,lpName") | 20 | @Query(value="select s from ScheduleRealInfo s where s.xlName = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 group by jName,clZbh,lpName") |
| 28 | List<ScheduleRealInfo> queryUserInfo(String line,String date); | 21 | List<ScheduleRealInfo> queryUserInfo(String line,String date); |
src/main/java/com/bsth/service/realcontrol/buffer/ScheduleBuffer.java
| @@ -256,4 +256,16 @@ public class ScheduleBuffer { | @@ -256,4 +256,16 @@ public class ScheduleBuffer { | ||
| 256 | public static ScheduleRealInfo findOne(Long id){ | 256 | public static ScheduleRealInfo findOne(Long id){ |
| 257 | return pkSchedulMap.get(id); | 257 | return pkSchedulMap.get(id); |
| 258 | } | 258 | } |
| 259 | + | ||
| 260 | + public static List<ScheduleRealInfo> findByLineAndUpDown(Integer lineCode, Integer upDown){ | ||
| 261 | + List<ScheduleRealInfo> list = schedulListMap.get(String.valueOf(lineCode)) | ||
| 262 | + ,subList = new ArrayList<>(); | ||
| 263 | + //按走向过滤 | ||
| 264 | + for(ScheduleRealInfo sch : list){ | ||
| 265 | + if(Integer.parseInt(sch.getXlDir()) == upDown){ | ||
| 266 | + subList.add(sch); | ||
| 267 | + } | ||
| 268 | + } | ||
| 269 | + return subList; | ||
| 270 | + } | ||
| 259 | } | 271 | } |
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
| @@ -12,6 +12,7 @@ import com.bsth.vehicle.common.CommonMapped; | @@ -12,6 +12,7 @@ import com.bsth.vehicle.common.CommonMapped; | ||
| 12 | @Service | 12 | @Service |
| 13 | public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService{ | 13 | public class ChildTaskPlanServiceImpl extends BaseServiceImpl<ChildTaskPlan, Long> implements ChildTaskPlanService{ |
| 14 | 14 | ||
| 15 | + | ||
| 15 | @Override | 16 | @Override |
| 16 | public Map<String, Object> save(ChildTaskPlan t) { | 17 | public Map<String, Object> save(ChildTaskPlan t) { |
| 17 | //保存起终点名称 | 18 | //保存起终点名称 |
src/main/resources/application-dev.properties
| @@ -26,6 +26,6 @@ spring.datasource.validation-query=select 1 | @@ -26,6 +26,6 @@ spring.datasource.validation-query=select 1 | ||
| 26 | ## | 26 | ## |
| 27 | #222.66.0.204:5555 | 27 | #222.66.0.204:5555 |
| 28 | ##\u5B9E\u65F6gps | 28 | ##\u5B9E\u65F6gps |
| 29 | -http.gps.real.url= http://192.168.168.192:8080/transport_server/rtgps/ | 29 | +http.gps.real.url= http://192.168.168.171:8080/transport_server/rtgps/ |
| 30 | ##\u6D88\u606F\u4E0B\u53D1 | 30 | ##\u6D88\u606F\u4E0B\u53D1 |
| 31 | -http.send.directive = http://192.168.168.192:8080/transport_server/message/ | 31 | +http.send.directive = http://192.168.168.171:8080/transport_server/message/ |
src/main/resources/application.properties
src/main/resources/fatso/start.js
| @@ -37,8 +37,9 @@ fs.mkdir(dest, function(e){ | @@ -37,8 +37,9 @@ fs.mkdir(dest, function(e){ | ||
| 37 | var cProcess; | 37 | var cProcess; |
| 38 | 38 | ||
| 39 | ep.tail('mvn-clean',function(){ | 39 | ep.tail('mvn-clean',function(){ |
| 40 | + ep.emit('copy-project'); | ||
| 40 | //清理target | 41 | //清理target |
| 41 | - logInfo('mvn clean...'); | 42 | + /*logInfo('mvn clean...'); |
| 42 | cProcess = child_process.exec("mvn clean",{cwd: workspace + '\\' + pName},function(error){ | 43 | cProcess = child_process.exec("mvn clean",{cwd: workspace + '\\' + pName},function(error){ |
| 43 | if(error) | 44 | if(error) |
| 44 | logError(error); | 45 | logError(error); |
| @@ -46,7 +47,7 @@ ep.tail('mvn-clean',function(){ | @@ -46,7 +47,7 @@ ep.tail('mvn-clean',function(){ | ||
| 46 | logSuccess('mvn clean success'); | 47 | logSuccess('mvn clean success'); |
| 47 | 48 | ||
| 48 | ep.emit('copy-project'); | 49 | ep.emit('copy-project'); |
| 49 | - }); | 50 | + });*/ |
| 50 | output(cProcess); | 51 | output(cProcess); |
| 51 | }); | 52 | }); |
| 52 | 53 |
src/main/resources/ftp.properties
| @@ -2,7 +2,7 @@ ftp.url=222.66.0.205 | @@ -2,7 +2,7 @@ ftp.url=222.66.0.205 | ||
| 2 | ftp.port=21 | 2 | ftp.port=21 |
| 3 | ftp.username=transport | 3 | ftp.username=transport |
| 4 | ftp.password=transport123 | 4 | ftp.password=transport123 |
| 5 | -ftp.path= down/ | 5 | +ftp.path=down/ |
| 6 | 6 | ||
| 7 | #ftp.url=192.168.168.101 | 7 | #ftp.url=192.168.168.101 |
| 8 | #ftp.port=21 | 8 | #ftp.port=21 |
src/main/resources/ms-jdbc.properties
| 1 | ms.mysql.driver= com.mysql.jdbc.Driver | 1 | ms.mysql.driver= com.mysql.jdbc.Driver |
| 2 | -ms.mysql.url= jdbc:mysql://192.168.168.192:3306/ms?useUnicode=true&characterEncoding=utf-8 | 2 | +ms.mysql.url= jdbc:mysql://192.168.168.171:3306/ms?useUnicode=true&characterEncoding=utf-8 |
| 3 | ms.mysql.username= root | 3 | ms.mysql.username= root |
| 4 | ms.mysql.password= root2jsp | 4 | ms.mysql.password= root2jsp |
| 5 | \ No newline at end of file | 5 | \ No newline at end of file |
src/main/resources/static/pages/control/line/child_pages/child_task.html
| @@ -433,9 +433,12 @@ $(function(){ | @@ -433,9 +433,12 @@ $(function(){ | ||
| 433 | //拆分驾驶员工号和姓名 | 433 | //拆分驾驶员工号和姓名 |
| 434 | param.jName = param.jGh.split('/')[1]; | 434 | param.jName = param.jGh.split('/')[1]; |
| 435 | param.jGh = param.jGh.split('/')[0]; | 435 | param.jGh = param.jGh.split('/')[0]; |
| 436 | - //拆分售票员工号和姓名 | ||
| 437 | - param.sName = param.sGh.split('/')[1]; | ||
| 438 | - param.sGh = param.sGh.split('/')[0]; | 436 | + |
| 437 | + if(param.sGh != null){ | ||
| 438 | + //拆分售票员工号和姓名 | ||
| 439 | + param.sName = param.sGh.split('/')[1]; | ||
| 440 | + param.sGh = param.sGh.split('/')[0]; | ||
| 441 | + } | ||
| 439 | //附加起终点名称 | 442 | //附加起终点名称 |
| 440 | var route = stationRoute[param.xlDir]; | 443 | var route = stationRoute[param.xlDir]; |
| 441 | param.qdzName = searchStationName(route, param.qdzCode); | 444 | param.qdzName = searchStationName(route, param.qdzCode); |
| @@ -445,10 +448,13 @@ $(function(){ | @@ -445,10 +448,13 @@ $(function(){ | ||
| 445 | $post('/realSchedule', param, function(rs){ | 448 | $post('/realSchedule', param, function(rs){ |
| 446 | var sch = rs.t; | 449 | var sch = rs.t; |
| 447 | //前端缓存更新 | 450 | //前端缓存更新 |
| 448 | - scheduleLineMap[param.xlBm][param.lpName].push(sch); | 451 | + //scheduleLineMap[param.xlBm][param.lpName].push(sch); |
| 452 | + /* var ups = rs.ups; | ||
| 453 | + for(var i in ups){ | ||
| 454 | + _data.updateSchedule(ups[i]); | ||
| 455 | + } */ | ||
| 449 | //刷新表格 | 456 | //刷新表格 |
| 450 | _alone.addScheduleToTable(sch); | 457 | _alone.addScheduleToTable(sch); |
| 451 | - _alone.refreshScheduleArray(rs.ups); | ||
| 452 | 458 | ||
| 453 | //关闭弹出层 | 459 | //关闭弹出层 |
| 454 | layer.closeAll(); | 460 | layer.closeAll(); |
src/main/resources/static/pages/control/line/child_pages/outgo_adjust_all.html
0 → 100644
| 1 | +<!-- 待发调整 --> | ||
| 2 | +<div id="outgoAdjustAllPanel"> | ||
| 3 | + <form action="#" class="form-horizontal form-custom"> | ||
| 4 | + <div class="form-body"> | ||
| 5 | + <div class="form-custom-row"> | ||
| 6 | + <div class="item" style="margin-top: 0"> | ||
| 7 | + <div class="input-icon right"> | ||
| 8 | + <span class="item-label" style="width: 40px;">线路: </span> | ||
| 9 | + <select name="line" class="form-control lineSelect"> | ||
| 10 | + </select> | ||
| 11 | + </div> | ||
| 12 | + </div> | ||
| 13 | + | ||
| 14 | + <div class="item" style="margin-top: 0"> | ||
| 15 | + <span class="item-label" style="width: 40px;">车辆: </span> | ||
| 16 | + <select name="nbbm" class="form-control vehicSelect"> | ||
| 17 | + </select> | ||
| 18 | + </div> | ||
| 19 | + </div> | ||
| 20 | + | ||
| 21 | + <div class="form-custom-row"> | ||
| 22 | + <div class="item" style="min-width: calc(100% - 10px);"> | ||
| 23 | + <div class="custom-table-panel" style="display: inline-block;height: 420px;"> | ||
| 24 | + <div style="height: 36px; position: relative;"> | ||
| 25 | + <div class="custom-table-header"> | ||
| 26 | + <table class="table table-bordered table-advance sch-table"> | ||
| 27 | + <thead> | ||
| 28 | + <tr> | ||
| 29 | + <th width="12%">车辆</th> | ||
| 30 | + <th width="7%">路牌</th> | ||
| 31 | + <th width="10%">驾驶员</th> | ||
| 32 | + <th width="18%">起点</th> | ||
| 33 | + <th width="18%">终点</th> | ||
| 34 | + <th width="13%">计发</th> | ||
| 35 | + <th width="22%">待发</th> | ||
| 36 | + </tr> | ||
| 37 | + </thead> | ||
| 38 | + </table> | ||
| 39 | + </div> | ||
| 40 | + </div> | ||
| 41 | + | ||
| 42 | + <div class="custom-table-body" > | ||
| 43 | + <table class="table table-bordered table-hover table-advance sch-table" > | ||
| 44 | + <tbody></tbody> | ||
| 45 | + </table> | ||
| 46 | + </div> | ||
| 47 | + </div> | ||
| 48 | + </div> | ||
| 49 | + </div> | ||
| 50 | + | ||
| 51 | + <hr> | ||
| 52 | + <div class="form-custom-footer" style="margin-top: 15px;"> | ||
| 53 | + <button type="button" class="btn blue-madison confirm"> | ||
| 54 | + <i class="fa fa-check"></i> 确 定 | ||
| 55 | + </button> | ||
| 56 | + <button type="button" class="btn layui-layer-close">取消</button> | ||
| 57 | + </div> | ||
| 58 | + <br> | ||
| 59 | + </div> | ||
| 60 | + </form> | ||
| 61 | + | ||
| 62 | +<script id="outgo_adjust_all_item_temp" type="text/html"> | ||
| 63 | +{{each list as item i}} | ||
| 64 | +<tr data-id={{item.id}}> | ||
| 65 | + <td width="12%"> | ||
| 66 | + {{item.clZbh}} | ||
| 67 | + {{if item.bcType == "out"}} | ||
| 68 | + <span class="out-badge short"></span> | ||
| 69 | + {{else if item.bcType == "in"}} | ||
| 70 | + <span class="in-badge short"></span> | ||
| 71 | + {{/if}} | ||
| 72 | + </td> | ||
| 73 | + <td width="7%">{{item.lpName}}</td> | ||
| 74 | + <td width="10%">{{item.jName}}</td> | ||
| 75 | + <td width="18%" title="{{item.qdzName}}">{{item.qdzName}}</td> | ||
| 76 | + <td width="18%" title="{{item.zdzName}}">{{item.zdzName}}</td> | ||
| 77 | + <td width="13%">{{item.fcsj}}</td> | ||
| 78 | + <td width="22%"><input value="{{item.dfsj}}" data-old="{{item.dfsj}}" type="time" class="form-control df-input" style="width: 100%;"></td> | ||
| 79 | +</tr> | ||
| 80 | +{{/each}} | ||
| 81 | + | ||
| 82 | +{{if list.length == 0 }} | ||
| 83 | +<tr> | ||
| 84 | + <td style="font-size: 12px;text-align: center;" colspan=7>该车辆今日无班次信息</td> | ||
| 85 | +</tr> | ||
| 86 | +{{/if}} | ||
| 87 | +</script> | ||
| 88 | + | ||
| 89 | +<script id="outgo_adjust_change_text_temp" type="text/html"> | ||
| 90 | +<h5>B-89524(闵行11路)</h5> | ||
| 91 | +<hr> | ||
| 92 | +<div class="change-confirm-text"> | ||
| 93 | +{{each list as item i}} | ||
| 94 | +<div> | ||
| 95 | + <span>{{item.old}}</span><i class="fa fa-long-arrow-right"></i><span>{{item.t}}</span> | ||
| 96 | +</div> | ||
| 97 | +{{/each}} | ||
| 98 | +</div> | ||
| 99 | +</script> | ||
| 100 | + | ||
| 101 | +<script type="text/javascript"> | ||
| 102 | +!function(){ | ||
| 103 | + //滚动时固定表头 | ||
| 104 | + $('.custom-table-panel').on('scroll', function(){ | ||
| 105 | + var top = $(this).scrollTop() | ||
| 106 | + ,$header = $(this).find('.custom-table-header'); | ||
| 107 | + $header.css('top', top); | ||
| 108 | + }); | ||
| 109 | + | ||
| 110 | + var _data, _alone, lineCodeMaps; | ||
| 111 | + | ||
| 112 | + var lineSelect = $('#outgoAdjustAllPanel .lineSelect'); | ||
| 113 | + var vehicSelect = $('#outgoAdjustAllPanel .vehicSelect'); | ||
| 114 | + | ||
| 115 | + var initStatus, schedul; | ||
| 116 | + $('#outgoAdjustAllPanel').on('init', function(e, ops){ | ||
| 117 | + initStatus = true; | ||
| 118 | + _data = ops._data; | ||
| 119 | + _alone = ops._alone; | ||
| 120 | + schedul = ops.selected; | ||
| 121 | + | ||
| 122 | + //线路下拉框 | ||
| 123 | + var data = []; | ||
| 124 | + lineCodeMaps = _data.getLineIds(); | ||
| 125 | + console.log(lineCodeMaps); | ||
| 126 | + for(var line in lineCodeMaps){ | ||
| 127 | + data.push({id: line, text: lineCodeMaps[line]}); | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + initPinYinSelect2(lineSelect, data, function(){ | ||
| 131 | + //默认选中线路 | ||
| 132 | + lineSelect.val(schedul.xlBm).trigger("change"); | ||
| 133 | + | ||
| 134 | + | ||
| 135 | + }).on('change', lineSelectChange); | ||
| 136 | + | ||
| 137 | + | ||
| 138 | + //线路切换事件 | ||
| 139 | + function lineSelectChange(){ | ||
| 140 | + var lineCode = $(this).val(); | ||
| 141 | + | ||
| 142 | + var index = layer.msg('加载中', {icon: 16}); | ||
| 143 | + //查询线路配车 | ||
| 144 | + $get('/cci/all', {'xl.lineCode_eq': lineCode}, function(rs){ | ||
| 145 | + var data = []; | ||
| 146 | + $.each(rs, function(){ | ||
| 147 | + data.push({id: this.cl.carCode, text: this.cl.carCode}) | ||
| 148 | + }); | ||
| 149 | + vehicSelect.html('').select2({data: data}); | ||
| 150 | + | ||
| 151 | + layer.close(index); | ||
| 152 | + | ||
| 153 | + //初始选中车辆 | ||
| 154 | + if(initStatus) | ||
| 155 | + vehicSelect.val(schedul.clZbh); | ||
| 156 | + //触发change | ||
| 157 | + vehicSelect.trigger("change") | ||
| 158 | + }); | ||
| 159 | + } | ||
| 160 | + | ||
| 161 | + //车辆切换事件 | ||
| 162 | + vehicSelect.on('change', function(){ | ||
| 163 | + //根据车辆获取班次信息 | ||
| 164 | + var schArray = _data.getSchedulByVeh($(this).val()); | ||
| 165 | + | ||
| 166 | + var htmlStr = template('outgo_adjust_all_item_temp', {list: schArray}); | ||
| 167 | + | ||
| 168 | + var table = '#outgoAdjustAllPanel .sch-table '; | ||
| 169 | + $('tbody', table).html(htmlStr); | ||
| 170 | + | ||
| 171 | + //初始选中班次 | ||
| 172 | + if(initStatus){ | ||
| 173 | + var $tr = $('tr[data-id='+schedul.id+']', table); | ||
| 174 | + $tr.addClass('anim-delay animated flash'); | ||
| 175 | + //滚动条 | ||
| 176 | + var cont = $('#outgoAdjustAllPanel .custom-table-panel'); | ||
| 177 | + cont.animate({ | ||
| 178 | + scrollTop: $tr.offset().top - cont.offset().top + $tr.scrollTop() - 36 * 4 | ||
| 179 | + }, 500); | ||
| 180 | + | ||
| 181 | + initStatus = false; | ||
| 182 | + } | ||
| 183 | + }); | ||
| 184 | + | ||
| 185 | + //确定 | ||
| 186 | + $('.confirm', '#outgoAdjustAllPanel').on('click', function(){ | ||
| 187 | + var es = $('#outgoAdjustAllPanel .df-input'),old, t; | ||
| 188 | + var changes = []; | ||
| 189 | + for(var i = 0, e;e = es[i++];){ | ||
| 190 | + t = $(e).val(), old = $(e).data('old'); | ||
| 191 | + if(t == ''){ | ||
| 192 | + layer.alert('待发时间不能为空!', {icon: 2, title: '提交失败'}); | ||
| 193 | + $(e).addClass('custom-val-error'); | ||
| 194 | + return false; | ||
| 195 | + } | ||
| 196 | + $(e).removeClass('custom-val-error'); | ||
| 197 | + | ||
| 198 | + if(old != t) | ||
| 199 | + changes.push({old: old, t: t}); | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + var text = template('outgo_adjust_change_text_temp', {list: changes}); | ||
| 203 | + layer.confirm(text, { | ||
| 204 | + btn: ['确认调整','取消'],title:'待发调整确认' | ||
| 205 | + }, function(){ | ||
| 206 | + layer.msg('确认调整', {icon: 1}); | ||
| 207 | + }); | ||
| 208 | + }); | ||
| 209 | + }); | ||
| 210 | +}(); | ||
| 211 | +</script> | ||
| 212 | +</div> | ||
| 0 | \ No newline at end of file | 213 | \ No newline at end of file |
src/main/resources/static/pages/control/line/css/lineControl.css
| @@ -2032,16 +2032,24 @@ span.log-item-handle a { | @@ -2032,16 +2032,24 @@ span.log-item-handle a { | ||
| 2032 | } | 2032 | } |
| 2033 | 2033 | ||
| 2034 | .out-badge:BEFORE{ | 2034 | .out-badge:BEFORE{ |
| 2035 | - content: '出场' | 2035 | + content: '出场'; |
| 2036 | +} | ||
| 2037 | + | ||
| 2038 | +.out-badge.short:BEFORE{ | ||
| 2039 | + content: '出'; | ||
| 2040 | +} | ||
| 2041 | + | ||
| 2042 | +.in-badge.short:BEFORE{ | ||
| 2043 | + content: '进'; | ||
| 2036 | } | 2044 | } |
| 2037 | 2045 | ||
| 2038 | @media ( max-width : 1780px) { | 2046 | @media ( max-width : 1780px) { |
| 2039 | .in-badge:BEFORE{ | 2047 | .in-badge:BEFORE{ |
| 2040 | - content: '进' | 2048 | + content: '进'; |
| 2041 | } | 2049 | } |
| 2042 | 2050 | ||
| 2043 | .out-badge:BEFORE{ | 2051 | .out-badge:BEFORE{ |
| 2044 | - content: '出' | 2052 | + content: '出'; |
| 2045 | } | 2053 | } |
| 2046 | } | 2054 | } |
| 2047 | 2055 | ||
| @@ -2187,4 +2195,58 @@ tr._tr_active.active-line-no .out-badge{ | @@ -2187,4 +2195,58 @@ tr._tr_active.active-line-no .out-badge{ | ||
| 2187 | color: black; | 2195 | color: black; |
| 2188 | } | 2196 | } |
| 2189 | 2197 | ||
| 2198 | +.pb-table tr .anim-delay{ | ||
| 2199 | + animation-delay:.5s; | ||
| 2200 | + -webkit-animation-delay:.5s; | ||
| 2201 | +} | ||
| 2202 | + | ||
| 2203 | +.sch-table tr td:nth-of-type(1), | ||
| 2204 | +.sch-table tr td:nth-of-type(2), | ||
| 2205 | +.sch-table tr td:nth-of-type(3), | ||
| 2206 | +.sch-table tr td:nth-of-type(4), | ||
| 2207 | +.sch-table tr td:nth-of-type(5){ | ||
| 2208 | + color: #646363; | ||
| 2209 | +} | ||
| 2210 | + | ||
| 2211 | +.sch-table tr td:nth-of-type(6), | ||
| 2212 | +.sch-table tr td:nth-of-type(7){ | ||
| 2213 | + color: black; | ||
| 2214 | +} | ||
| 2215 | + | ||
| 2216 | + | ||
| 2217 | +.sch-table tr th:nth-of-type(1), | ||
| 2218 | +.sch-table tr th:nth-of-type(2), | ||
| 2219 | +.sch-table tr th:nth-of-type(3), | ||
| 2220 | +.sch-table tr th:nth-of-type(4), | ||
| 2221 | +.sch-table tr th:nth-of-type(5){ | ||
| 2222 | + color: #646363; | ||
| 2223 | +} | ||
| 2224 | + | ||
| 2225 | +.sch-table tr th:nth-of-type(6), | ||
| 2226 | +.sch-table tr th:nth-of-type(7){ | ||
| 2227 | + color: black; | ||
| 2228 | +} | ||
| 2229 | + | ||
| 2230 | +.sch-table input{ | ||
| 2231 | + color: black; | ||
| 2232 | +} | ||
| 2190 | 2233 | ||
| 2234 | +.sch-table td{ | ||
| 2235 | + text-overflow: ellipsis; | ||
| 2236 | + overflow: hidden; | ||
| 2237 | + white-space: nowrap; | ||
| 2238 | + vertical-align: middle !important; | ||
| 2239 | +} | ||
| 2240 | + | ||
| 2241 | +.change-confirm-text span{ | ||
| 2242 | + margin: 3px 8px 0 3px; | ||
| 2243 | + font-family: arial; | ||
| 2244 | +} | ||
| 2245 | + | ||
| 2246 | +.change-confirm-text div span:nth-of-type(1){ | ||
| 2247 | + color: gray; | ||
| 2248 | +} | ||
| 2249 | + | ||
| 2250 | +.change-confirm-text i{ | ||
| 2251 | + color: #46c146; | ||
| 2252 | +} |
src/main/resources/static/pages/control/line/index.html
| @@ -90,13 +90,28 @@ | @@ -90,13 +90,28 @@ | ||
| 90 | </div> | 90 | </div> |
| 91 | <div id="tooltipShade" class="animated fadeIn"></div> | 91 | <div id="tooltipShade" class="animated fadeIn"></div> |
| 92 | 92 | ||
| 93 | +<div id="menuWrap"></div> | ||
| 93 | <!-- 线路调度右键菜单 --> | 94 | <!-- 线路调度右键菜单 --> |
| 94 | -<menu class="menu" id="rightMenu"> | ||
| 95 | - <li class="menu-item" > | 95 | +<menu class="menu" id="rightMenu" style="display: none;"> |
| 96 | + <li class="menu-item submenu"> | ||
| 96 | <button type="button" class="menu-btn" data-method="outgoAdjust"> | 97 | <button type="button" class="menu-btn" data-method="outgoAdjust"> |
| 97 | <span class="menu-text">待发调整</span> | 98 | <span class="menu-text">待发调整</span> |
| 98 | </button> | 99 | </button> |
| 100 | + <menu class="menu"> | ||
| 101 | + <li class="menu-item"> | ||
| 102 | + <button type="button" class="menu-btn" data-method="outgoAdjust"> | ||
| 103 | + <span class="menu-text">基于班次</span> | ||
| 104 | + </button> | ||
| 105 | + </li> | ||
| 106 | + <li class="menu-item"> | ||
| 107 | + <button type="button" class="menu-btn" data-method="outgoAdjustAll"> | ||
| 108 | + <span class="menu-text">基于车辆</span> | ||
| 109 | + </button> | ||
| 110 | + </li> | ||
| 111 | + </menu> | ||
| 99 | </li> | 112 | </li> |
| 113 | + | ||
| 114 | + | ||
| 100 | <li class="menu-separator"></li> | 115 | <li class="menu-separator"></li> |
| 101 | <li class="menu-item" > | 116 | <li class="menu-item" > |
| 102 | <button type="button" class="menu-btn" data-method="planDestroy"> | 117 | <button type="button" class="menu-btn" data-method="planDestroy"> |
| @@ -164,7 +179,7 @@ | @@ -164,7 +179,7 @@ | ||
| 164 | </li> | 179 | </li> |
| 165 | </menu> | 180 | </menu> |
| 166 | <!-- 主页右键菜单 --> | 181 | <!-- 主页右键菜单 --> |
| 167 | -<menu class="menu" id="homeMenu"> | 182 | +<menu class="menu" id="homeMenu" style="display: none;"> |
| 168 | <li class="menu-item disabled" id="menu-linename"> | 183 | <li class="menu-item disabled" id="menu-linename"> |
| 169 | <button type="button" class="menu-btn"> | 184 | <button type="button" class="menu-btn"> |
| 170 | <span class="menu-text">--- W2B-102 ---</span> | 185 | <span class="menu-text">--- W2B-102 ---</span> |
src/main/resources/static/pages/control/line/js/alone.js
| @@ -75,24 +75,33 @@ var _alone = (function(){ | @@ -75,24 +75,33 @@ var _alone = (function(){ | ||
| 75 | }, | 75 | }, |
| 76 | //添加一个班次到表格 | 76 | //添加一个班次到表格 |
| 77 | addScheduleToTable: function(schedule){ | 77 | addScheduleToTable: function(schedule){ |
| 78 | - _data.pushSchedule(schedule); | ||
| 79 | - | ||
| 80 | - var upDown = schedule.xlDir==0?'up':'down'; | ||
| 81 | - var tab = $('#tab_line_' + schedule.xlBm); | ||
| 82 | - //重新渲染表格 | ||
| 83 | - var table = tab.find('.pb-table[data-type='+upDown+']'); | ||
| 84 | - //获取班次信息 | ||
| 85 | - var schArray = _data.findSchByLine(schedule.xlBm, schedule.xlDir); | ||
| 86 | - calculateLineNo( | ||
| 87 | - table.find('tbody').html(template('alone_plan_table_temp', {list: schArray}))[0] | ||
| 88 | - ); | ||
| 89 | - | ||
| 90 | - //定位到新添加的班次 | ||
| 91 | - var currTr = table.find('tr[data-id='+schedule.id+']') | ||
| 92 | - ,top = parseInt(currTr.find('td[name=lineNo]').text()) * 37; | ||
| 93 | - | ||
| 94 | - currTr.addClass('animated flash'); | ||
| 95 | - currTr.parents('._body').slimScroll({ scrollTo: top + 'px' }); | 78 | + //将该线路走向班次 全部从服务器同步一次 |
| 79 | + var xlDir = schedule.xlDir, xlBm = schedule.xlBm; | ||
| 80 | + $.get('/realSchedule/findByLineAndUpDown', {line: xlBm, upDown: xlDir} | ||
| 81 | + ,function(list){ | ||
| 82 | + $.each(list, function(){ | ||
| 83 | + _data.pushSchedule(this); | ||
| 84 | + }); | ||
| 85 | + | ||
| 86 | + var upDown = xlDir==0?'up':'down'; | ||
| 87 | + var tab = $('#tab_line_' + xlBm); | ||
| 88 | + //重新渲染表格 | ||
| 89 | + var table = tab.find('.pb-table[data-type='+upDown+']'); | ||
| 90 | + var schArray = _data.findSchByLine(xlBm, xlDir); | ||
| 91 | + calculateLineNo( | ||
| 92 | + table.find('tbody').html(template('alone_plan_table_temp', {list: schArray}))[0] | ||
| 93 | + ); | ||
| 94 | + | ||
| 95 | + var half = tab.find('._body').height() / 2; | ||
| 96 | + | ||
| 97 | + //定位到新添加的班次 | ||
| 98 | + var currTr = table.find('tr[data-id='+schedule.id+']') | ||
| 99 | + ,top = parseInt(currTr.find('td[name=lineNo]').text()) * 37 - half; | ||
| 100 | + | ||
| 101 | + top = top>0?top:0; | ||
| 102 | + currTr.addClass('anim-delay animated flash'); | ||
| 103 | + currTr.parents('._body').slimScroll({ scrollTo: top + 'px' }); | ||
| 104 | + }); | ||
| 96 | }, | 105 | }, |
| 97 | //重新计算行号 | 106 | //重新计算行号 |
| 98 | calculateLineNo: calculateLineNo | 107 | calculateLineNo: calculateLineNo |
src/main/resources/static/pages/control/line/js/data.js
| @@ -13,8 +13,7 @@ var _data = (function(){ | @@ -13,8 +13,7 @@ var _data = (function(){ | ||
| 13 | 13 | ||
| 14 | var dateStr = moment().format('YYYY-MM-DD'); | 14 | var dateStr = moment().format('YYYY-MM-DD'); |
| 15 | //实际排班 | 15 | //实际排班 |
| 16 | - var schedules = {} | ||
| 17 | - ,scheduleList = []; | 16 | + var schedules = {}; |
| 18 | 17 | ||
| 19 | //站点路由缓存 | 18 | //站点路由缓存 |
| 20 | var stationRoute = {}; | 19 | var stationRoute = {}; |
| @@ -38,10 +37,17 @@ var _data = (function(){ | @@ -38,10 +37,17 @@ var _data = (function(){ | ||
| 38 | //根据线路和上下行获取计划排班 | 37 | //根据线路和上下行获取计划排班 |
| 39 | findSchByLine: function(xlbm, upDown){ | 38 | findSchByLine: function(xlbm, upDown){ |
| 40 | var array = []; | 39 | var array = []; |
| 41 | - $.each(scheduleList, function(){ | ||
| 42 | - if(this.xlBm == xlbm | ||
| 43 | - && this.xlDir == upDown) | ||
| 44 | - array.push(this); | 40 | + var sch; |
| 41 | + for(var id in schedules){ | ||
| 42 | + sch = schedules[id]; | ||
| 43 | + if(sch.xlBm == xlbm | ||
| 44 | + && sch.xlDir == upDown){ | ||
| 45 | + array.push(sch); | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + //排序 | ||
| 49 | + array.sort(function(a, b){ | ||
| 50 | + return a.fcsjT - b.fcsjT; | ||
| 45 | }); | 51 | }); |
| 46 | 52 | ||
| 47 | return array; | 53 | return array; |
| @@ -54,8 +60,6 @@ var _data = (function(){ | @@ -54,8 +60,6 @@ var _data = (function(){ | ||
| 54 | pushSchedule: function(sch){ | 60 | pushSchedule: function(sch){ |
| 55 | //附加信息 | 61 | //附加信息 |
| 56 | attachInfo(sch); | 62 | attachInfo(sch); |
| 57 | - //加入缓存 | ||
| 58 | - scheduleList.push(sch); | ||
| 59 | schedules[sch.id] = sch; | 63 | schedules[sch.id] = sch; |
| 60 | lineLpMap[sch.xlBm][sch.lpName].push(sch); | 64 | lineLpMap[sch.xlBm][sch.lpName].push(sch); |
| 61 | }, | 65 | }, |
| @@ -124,7 +128,6 @@ var _data = (function(){ | @@ -124,7 +128,6 @@ var _data = (function(){ | ||
| 124 | attachInfo(this); | 128 | attachInfo(this); |
| 125 | //缓存排班计划 | 129 | //缓存排班计划 |
| 126 | schedules[this.id] = this; | 130 | schedules[this.id] = this; |
| 127 | - scheduleList.push(this); | ||
| 128 | //构造 线路 ——> 路牌 ——> 班次 3层映射 | 131 | //构造 线路 ——> 路牌 ——> 班次 3层映射 |
| 129 | if(!lineLpMap[lineCode][this.lpName]) | 132 | if(!lineLpMap[lineCode][this.lpName]) |
| 130 | lineLpMap[lineCode][this.lpName] = []; | 133 | lineLpMap[lineCode][this.lpName] = []; |
| @@ -150,9 +153,16 @@ var _data = (function(){ | @@ -150,9 +153,16 @@ var _data = (function(){ | ||
| 150 | //根据车辆内部编码获取排班数组 | 153 | //根据车辆内部编码获取排班数组 |
| 151 | getSchedulByVeh: function(nbbm){ | 154 | getSchedulByVeh: function(nbbm){ |
| 152 | var array = []; | 155 | var array = []; |
| 153 | - $.each(scheduleList, function(){ | ||
| 154 | - if(this.clZbh == nbbm) | ||
| 155 | - array.push(this); | 156 | + var sch; |
| 157 | + for(var id in schedules){ | ||
| 158 | + sch = schedules[id]; | ||
| 159 | + if(sch.clZbh == nbbm) | ||
| 160 | + array.push(sch); | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + //排序 | ||
| 164 | + array.sort(function(a, b){ | ||
| 165 | + return a.fcsjT - b.fcsjT; | ||
| 156 | }); | 166 | }); |
| 157 | return array; | 167 | return array; |
| 158 | }, | 168 | }, |
src/main/resources/static/pages/control/line/js/main.js
src/main/resources/static/pages/control/line/js/rightMenu.js
| @@ -511,6 +511,26 @@ var _menu = (function() { | @@ -511,6 +511,26 @@ var _menu = (function() { | ||
| 511 | }); | 511 | }); |
| 512 | } | 512 | } |
| 513 | }); | 513 | }); |
| 514 | + }, | ||
| 515 | + //基于车辆的待发调整 | ||
| 516 | + outgoAdjustAll: function(schedul){ | ||
| 517 | + $.get('/pages/control/line/child_pages/outgo_adjust_all.html', function(content){ | ||
| 518 | + layer.open({ | ||
| 519 | + type: 1, | ||
| 520 | + area: '830px', | ||
| 521 | + maxmin: true, | ||
| 522 | + content: content, | ||
| 523 | + shift: 5, | ||
| 524 | + title: '待发调整(车辆)', | ||
| 525 | + success: function(){ | ||
| 526 | + $('#outgoAdjustAllPanel').trigger('init', { | ||
| 527 | + selected: schedul, | ||
| 528 | + _data: _data, | ||
| 529 | + _alone: _alone | ||
| 530 | + }); | ||
| 531 | + } | ||
| 532 | + }); | ||
| 533 | + }); | ||
| 514 | } | 534 | } |
| 515 | } | 535 | } |
| 516 | 536 |
src/main/resources/static/pages/control/line/temps/alone_tp.html
| @@ -486,7 +486,7 @@ | @@ -486,7 +486,7 @@ | ||
| 486 | <div class="form-custom-row"> | 486 | <div class="form-custom-row"> |
| 487 | <div class="item full" > | 487 | <div class="item full" > |
| 488 | <p style="margin: 10px 0;">调整说明: <span class="font-red">(不超过20个字符)</span></p> | 488 | <p style="margin: 10px 0;">调整说明: <span class="font-red">(不超过20个字符)</span></p> |
| 489 | - <textarea class="form-control" name="remarks" rows="4" placeholder="说明,必填"></textarea> | 489 | + <textarea class="form-control" name="remarks" rows="4" placeholder="调整说明"></textarea> |
| 490 | </div> | 490 | </div> |
| 491 | </div> | 491 | </div> |
| 492 | <hr> | 492 | <hr> |