Commit 4f544f09c8cae7739590a13905fecfbc6dae79fa

Authored by 潘钊
2 parents 9a3f0ed5 aa134516

Merge branch 'minhang' into pudong

# Conflicts:
#	src/main/resources/application-dev.properties
Showing 35 changed files with 1364 additions and 606 deletions
src/main/java/com/bsth/controller/forms/ExportController.java
@@ -303,12 +303,10 @@ public class ExportController { @@ -303,12 +303,10 @@ public class ExportController {
303 m.put("fssj", l.getFssj()); 303 m.put("fssj", l.getFssj());
304 m.put("xgsj", l.getXgsj()); 304 m.put("xgsj", l.getXgsj());
305 m.put("pcch", l.getPcch()); 305 m.put("pcch", l.getPcch());
306 - m.put("pcry", l.getPcry());  
307 - m.put("jhch", l.getJhch());  
308 - m.put("jhgh", l.getJhgh());  
309 m.put("sjch", l.getSjch()); 306 m.put("sjch", l.getSjch());
  307 + m.put("fcgh", l.getPcry());
310 m.put("sjgh", l.getSjgh()); 308 m.put("sjgh", l.getSjgh());
311 - m.put("yy", l.getYy()); 309 + m.put("yy", l.getYy()==null?"":l.getYy());
312 m.put("xgr", l.getXgr()); 310 m.put("xgr", l.getXgr());
313 resList.add(m); 311 resList.add(m);
314 } 312 }
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
@@ -66,7 +66,7 @@ public class MCY_FormsController { @@ -66,7 +66,7 @@ public class MCY_FormsController {
66 } 66 }
67 67
68 // 换人换车情况统计表 68 // 换人换车情况统计表
69 - @RequestMapping(value = "/changetochange", method = RequestMethod.POST) 69 + @RequestMapping(value = "/changetochange", method = RequestMethod.GET)
70 public List<Changetochange> changetochange(@RequestParam Map<String, Object> map) { 70 public List<Changetochange> changetochange(@RequestParam Map<String, Object> map) {
71 71
72 return formsService.changetochange(map); 72 return formsService.changetochange(map);
src/main/java/com/bsth/controller/schedule/PeopleCarPlanController.java
@@ -33,6 +33,11 @@ public class PeopleCarPlanController { @@ -33,6 +33,11 @@ public class PeopleCarPlanController {
33 public Map<String, Object> scheduleAnaly(@RequestParam Map<String, Object> map){ 33 public Map<String, Object> scheduleAnaly(@RequestParam Map<String, Object> map){
34 return peopleCarPlanService.scheduleAnaly(map); 34 return peopleCarPlanService.scheduleAnaly(map);
35 } 35 }
  36 +
  37 + @RequestMapping(value="/scheduleAnaly_sum", method = RequestMethod.GET)
  38 + public Map<String, Object> scheduleAnaly_sum(@RequestParam Map<String, Object> map){
  39 + return peopleCarPlanService.scheduleAnaly_sum(map);
  40 + }
36 41
37 @RequestMapping(value="/getModel", method = RequestMethod.GET) 42 @RequestMapping(value="/getModel", method = RequestMethod.GET)
38 public List<Map<String,Object>> getModel(@RequestParam Map<String, Object> map){ 43 public List<Map<String,Object>> getModel(@RequestParam Map<String, Object> map){
@@ -44,6 +49,11 @@ public class PeopleCarPlanController { @@ -44,6 +49,11 @@ public class PeopleCarPlanController {
44 return peopleCarPlanService.firstAndLastBus(map); 49 return peopleCarPlanService.firstAndLastBus(map);
45 } 50 }
46 51
  52 + @RequestMapping(value="/firstAndLastBus_sum", method = RequestMethod.GET)
  53 + public List<Map<String,Object>> firstAndLastBus_sum(@RequestParam Map<String, Object> map){
  54 + return peopleCarPlanService.firstAndLastBus_sum(map);
  55 + }
  56 +
47 @RequestMapping(value="/commandState", method = RequestMethod.GET) 57 @RequestMapping(value="/commandState", method = RequestMethod.GET)
48 public List<Map<String,Object>> commandState(@RequestParam Map<String, Object> map){ 58 public List<Map<String,Object>> commandState(@RequestParam Map<String, Object> map){
49 return peopleCarPlanService.commandState(map); 59 return peopleCarPlanService.commandState(map);
src/main/java/com/bsth/controller/schedule/core/SchedulePlanInfoController.java
@@ -39,6 +39,23 @@ public class SchedulePlanInfoController extends BController&lt;SchedulePlanInfo, Lo @@ -39,6 +39,23 @@ public class SchedulePlanInfoController extends BController&lt;SchedulePlanInfo, Lo
39 return resultMap; 39 return resultMap;
40 } 40 }
41 41
  42 + @RequestMapping(value = "/lastestsd/{xlid}", method = RequestMethod.GET)
  43 + public Map<String, Object> findLastestPlanDate(
  44 + @PathVariable(value = "xlid") Integer xlid) {
  45 + Map<String, Object> resultMap = new HashMap<>();
  46 + try {
  47 + resultMap.put("status", ResponseCode.SUCCESS);
  48 + resultMap.put("data", schedulePlanInfoService.findLastestPlanDate(xlid));
  49 +
  50 + } catch (Exception exp) {
  51 + exp.printStackTrace();
  52 + resultMap.put("status", ResponseCode.ERROR);
  53 + resultMap.put("msg", exp.getLocalizedMessage());
  54 + }
  55 +
  56 + return resultMap;
  57 + }
  58 +
42 59
43 // ------------------------ 老版本 ----------------------// 60 // ------------------------ 老版本 ----------------------//
44 @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET) 61 @RequestMapping(value = "/groupinfos/{xlid}/{date}", method = RequestMethod.GET)
src/main/java/com/bsth/data/car_out_info/CarOutInfoHandler.java
1 package com.bsth.data.car_out_info; 1 package com.bsth.data.car_out_info;
2 2
3 -import com.bsth.Application;  
4 import com.bsth.data.BasicData; 3 import com.bsth.data.BasicData;
5 import com.bsth.data.schedule.DayOfSchedule; 4 import com.bsth.data.schedule.DayOfSchedule;
6 import com.bsth.data.schedule.ScheduleComparator; 5 import com.bsth.data.schedule.ScheduleComparator;
@@ -24,7 +23,6 @@ import org.springframework.transaction.support.DefaultTransactionDefinition; @@ -24,7 +23,6 @@ import org.springframework.transaction.support.DefaultTransactionDefinition;
24 import java.sql.PreparedStatement; 23 import java.sql.PreparedStatement;
25 import java.sql.SQLException; 24 import java.sql.SQLException;
26 import java.util.*; 25 import java.util.*;
27 -import java.util.concurrent.TimeUnit;  
28 26
29 /** 27 /**
30 * 发车信息表处理程序 28 * 发车信息表处理程序
@@ -208,7 +206,7 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo { @@ -208,7 +206,7 @@ public class CarOutInfoHandler implements CommandLineRunner, CarOutInfo {
208 bcTypeMap.put("venting", "直放"); 206 bcTypeMap.put("venting", "直放");
209 bcTypeMap.put("major", "放站"); 207 bcTypeMap.put("major", "放站");
210 bcTypeMap.put("ldks", "两点间空驶"); 208 bcTypeMap.put("ldks", "两点间空驶");
211 - Application.mainServices.scheduleWithFixedDelay(updateInfoThread, 60, 40, TimeUnit.SECONDS); 209 + //Application.mainServices.scheduleWithFixedDelay(updateInfoThread, 60, 40, TimeUnit.SECONDS);
212 } 210 }
213 211
214 @Component 212 @Component
src/main/java/com/bsth/data/directive/DirectivesPstThread.java
1 package com.bsth.data.directive; 1 package com.bsth.data.directive;
2 2
  3 +import com.bsth.data.schedule.DayOfSchedule;
3 import com.bsth.entity.directive.D60; 4 import com.bsth.entity.directive.D60;
4 import com.bsth.entity.directive.D64; 5 import com.bsth.entity.directive.D64;
5 import com.bsth.entity.directive.Directive; 6 import com.bsth.entity.directive.Directive;
  7 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
6 import com.bsth.repository.directive.D60Repository; 8 import com.bsth.repository.directive.D60Repository;
7 import com.bsth.repository.directive.D64Repository; 9 import com.bsth.repository.directive.D64Repository;
8 import org.slf4j.Logger; 10 import org.slf4j.Logger;
@@ -27,6 +29,9 @@ public class DirectivesPstThread extends Thread { @@ -27,6 +29,9 @@ public class DirectivesPstThread extends Thread {
27 @Autowired 29 @Autowired
28 D64Repository d64Repository; 30 D64Repository d64Repository;
29 31
  32 + @Autowired
  33 + DayOfSchedule dayOfSchedule;
  34 +
30 @Override 35 @Override
31 public void run() { 36 public void run() {
32 LinkedList<Directive> list = DayOfDirectives.pstDirectives; 37 LinkedList<Directive> list = DayOfDirectives.pstDirectives;
@@ -37,7 +42,14 @@ public class DirectivesPstThread extends Thread { @@ -37,7 +42,14 @@ public class DirectivesPstThread extends Thread {
37 directive = list.poll(); 42 directive = list.poll();
38 43
39 if (directive instanceof D60) { 44 if (directive instanceof D60) {
40 - d60Repository.save((D60) directive); 45 + D60 d60 = (D60) directive;
  46 + if(d60.isDispatch()){
  47 + ScheduleRealInfo sch = d60.getSch();
  48 + //如果关联的班次已经不存在了,放弃入库
  49 + if(dayOfSchedule.get(sch.getId()) == null)
  50 + continue;
  51 + }
  52 + d60Repository.save(d60);
41 } 53 }
42 54
43 if (directive instanceof D64) { 55 if (directive instanceof D64) {
src/main/java/com/bsth/data/gpsdata/thread/ThreadPollMonitor.java
1 -package com.bsth.data.gpsdata.thread;  
2 -  
3 -import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;  
4 -import org.springframework.stereotype.Component;  
5 -  
6 -/**  
7 - * 线程池监听  
8 - * Created by panzhao on 2017/5/10.  
9 - */  
10 -@Component  
11 -public class ThreadPollMonitor extends Thread{  
12 -  
13 - @Override  
14 - public void run() {  
15 - long t = System.currentTimeMillis();  
16 -  
17 - if(t - GpsRealAnalyse.st > 3000 * 10){  
18 - GpsRealAnalyse.shutdown();  
19 - }  
20 - }  
21 -} 1 +package com.bsth.data.gpsdata.thread;
  2 +
  3 +import com.bsth.data.gpsdata.arrival.GpsRealAnalyse;
  4 +import org.springframework.stereotype.Component;
  5 +
  6 +/**
  7 + * 线程池监听
  8 + * Created by panzhao on 2017/5/10.
  9 + */
  10 +@Component
  11 +public class ThreadPollMonitor extends Thread{
  12 +
  13 + @Override
  14 + public void run() {
  15 + long t = System.currentTimeMillis();
  16 +
  17 + if(t - GpsRealAnalyse.st > 3000 * 10){
  18 + GpsRealAnalyse.shutdown();
  19 + }
  20 + }
  21 +}
src/main/java/com/bsth/entity/directive/D60.java
1 package com.bsth.entity.directive; 1 package com.bsth.entity.directive;
2 2
3 -import javax.persistence.Embeddable;  
4 -import javax.persistence.Entity;  
5 -import javax.persistence.FetchType;  
6 -import javax.persistence.GeneratedValue;  
7 -import javax.persistence.Id;  
8 -import javax.persistence.ManyToOne;  
9 -import javax.persistence.NamedAttributeNode;  
10 -import javax.persistence.NamedEntityGraph;  
11 -import javax.persistence.NamedEntityGraphs;  
12 -import javax.persistence.Table;  
13 -import javax.persistence.Transient;  
14 -  
15 import com.bsth.entity.realcontrol.ScheduleRealInfo; 3 import com.bsth.entity.realcontrol.ScheduleRealInfo;
16 import com.fasterxml.jackson.annotation.JsonIgnore; 4 import com.fasterxml.jackson.annotation.JsonIgnore;
17 5
  6 +import javax.persistence.*;
  7 +
18 8
19 /** 9 /**
20 * @author PanZhao 10 * @author PanZhao
@@ -75,7 +65,7 @@ public class D60 extends Directive { @@ -75,7 +65,7 @@ public class D60 extends Directive {
75 * 相关联的班次 65 * 相关联的班次
76 */ 66 */
77 @JsonIgnore 67 @JsonIgnore
78 - @ManyToOne(fetch = FetchType.LAZY) 68 + @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
79 private ScheduleRealInfo sch; 69 private ScheduleRealInfo sch;
80 70
81 public Long getReply46Time() { 71 public Long getReply46Time() {
src/main/java/com/bsth/entity/schedule/temp/SchedulePlanRuleResult.java
@@ -81,8 +81,8 @@ public class SchedulePlanRuleResult { @@ -81,8 +81,8 @@ public class SchedulePlanRuleResult {
81 "(xl_id,xl_name,rule_id,cc_id,cc_zbh," + 81 "(xl_id,xl_name,rule_id,cc_id,cc_zbh," +
82 "gids,gnames,gidindex,ecids,ecdbbms,ecindex," + 82 "gids,gnames,gidindex,ecids,ecdbbms,ecindex," +
83 "ttinfo_id,ttinfo_name,schedule_date," + 83 "ttinfo_id,ttinfo_name,schedule_date," +
84 - "sysuser_id,sysuser_name,create_date) " +  
85 - "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; 84 + "sysuser_id,sysuser_name,create_date, qyrq) " +
  85 + "values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
86 86
87 return sql; 87 return sql;
88 } 88 }
@@ -105,6 +105,8 @@ public class SchedulePlanRuleResult { @@ -105,6 +105,8 @@ public class SchedulePlanRuleResult {
105 ps.setString(15, this.getSysuserId()); 105 ps.setString(15, this.getSysuserId());
106 ps.setString(16, this.getSysuserName()); 106 ps.setString(16, this.getSysuserName());
107 ps.setTimestamp(17, new java.sql.Timestamp(this.getCreateDate().getTime())); 107 ps.setTimestamp(17, new java.sql.Timestamp(this.getCreateDate().getTime()));
  108 + ps.setDate(18, new java.sql.Date(this.getQyrq().getTime()));
  109 +
108 110
109 } 111 }
110 112
src/main/java/com/bsth/service/directive/DirectiveServiceImpl.java
@@ -132,14 +132,14 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen @@ -132,14 +132,14 @@ public class DirectiveServiceImpl extends BaseServiceImpl&lt;D60, Integer&gt; implemen
132 // 发送指令 132 // 发送指令
133 int code = GatewayHttpUtils.postJson(jObj.toJSONString()); 133 int code = GatewayHttpUtils.postJson(jObj.toJSONString());
134 134
135 - // 添加到缓存,等待入库  
136 d60.setDispatch(true); 135 d60.setDispatch(true);
137 d60.setSch(sch); 136 d60.setSch(sch);
138 d60.setHttpCode(code); 137 d60.setHttpCode(code);
139 - dayOfDirectives.put60(d60);  
140 138
141 if (code == 0) { 139 if (code == 0) {
142 sch.setDirectiveState(60); 140 sch.setDirectiveState(60);
  141 + // 添加到缓存,延迟入库
  142 + dayOfDirectives.put60(d60);
143 // 通知页面 143 // 通知页面
144 sendD60ToPage(sch); 144 sendD60ToPage(sch);
145 } 145 }
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
@@ -407,7 +407,19 @@ public class FormsServiceImpl implements FormsService { @@ -407,7 +407,19 @@ public class FormsServiceImpl implements FormsService {
407 407
408 rq = rq2 + "-" + rq3; 408 rq = rq2 + "-" + rq3;
409 409
410 - String sql = " select c.*,l.line_code from bsth_c_chtoch c LEFT JOIN bsth_c_line l on c.xl=l.name WHERE 1=1 "; 410 + String line="";
  411 + if(map.get("line")!=null){
  412 + line=map.get("line").toString().trim();
  413 + }
  414 + String gs="";
  415 + if(map.get("gsdm")!=null){
  416 + gs=map.get("gsdm").toString();
  417 + }
  418 + String fgs="";
  419 + if(map.get("fgsdm")!=null){
  420 + fgs =map.get("fgsdm").toString();
  421 + }
  422 + /*String sql = " select c.*,l.line_code from bsth_c_chtoch c LEFT JOIN bsth_c_line l on c.xl=l.name WHERE 1=1 ";
411 if (!map.get("startDate").toString().equals(" ") && !map.get("endDate").toString().equals(" ")) { 423 if (!map.get("startDate").toString().equals(" ") && !map.get("endDate").toString().equals(" ")) {
412 sql += "and DATE_FORMAT( c.rq,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '" 424 sql += "and DATE_FORMAT( c.rq,'%Y-%m-%d') BETWEEN '" + map.get("startDate").toString() + "' and '"
413 + map.get("endDate").toString() + "'"; 425 + map.get("endDate").toString() + "'";
@@ -419,18 +431,28 @@ public class FormsServiceImpl implements FormsService { @@ -419,18 +431,28 @@ public class FormsServiceImpl implements FormsService {
419 sql += " and c.pcch!=c.pcry"; 431 sql += " and c.pcch!=c.pcry";
420 } else if (map.get("sel").equals("1")) { 432 } else if (map.get("sel").equals("1")) {
421 sql += " and c.jhgh!=c.sjgh"; 433 sql += " and c.jhgh!=c.sjgh";
422 - } 434 + }*/
423 435
  436 + String sql="select * from bsth_c_chtoch where rq BETWEEN '"+ map.get("startDate").toString()+"' "
  437 + + " and '"+map.get("endDate").toString() +"'";
  438 +
  439 + if(!line.equals("")){
  440 + sql +=" and xl= '"+line+"'";
  441 + }else{
  442 + sql += " and gs= '"+gs+"' and fgs= '"+fgs+"'";
  443 + }
  444 +
  445 + sql +=" order by rq";
424 List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() { 446 List<Changetochange> list = jdbcTemplate.query(sql, new RowMapper<Changetochange>() {
425 447
426 448
427 @Override 449 @Override
428 public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException { 450 public Changetochange mapRow(ResultSet arg0, int arg1) throws SQLException {
429 Changetochange chan = new Changetochange(); 451 Changetochange chan = new Changetochange();
430 - chan.setRq(rq);  
431 - chan.setGs(arg0.getString("gs"));  
432 - chan.setFgs(arg0.getString("fgs"));  
433 - chan.setXl(arg0.getString("xl")); 452 + chan.setRq(arg0.getString("rq"));
  453 + chan.setGs(BasicData.businessCodeNameMap.get(arg0.getString("gs")));
  454 + chan.setFgs(BasicData.businessFgsCodeNameMap.get(arg0.getString("fgs")+"_"+arg0.getString("gs")));
  455 + chan.setXl(BasicData.lineCode2NameMap.get(arg0.getString("xl")));
434 chan.setLp(arg0.getString("lp")); 456 chan.setLp(arg0.getString("lp"));
435 chan.setFssj(arg0.getString("fssj")); 457 chan.setFssj(arg0.getString("fssj"));
436 chan.setXgsj(arg0.getString("xgsj")); 458 chan.setXgsj(arg0.getString("xgsj"));
src/main/java/com/bsth/service/impl/BusIntervalServiceImpl.java
@@ -79,6 +79,7 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -79,6 +79,7 @@ public class BusIntervalServiceImpl implements BusIntervalService {
79 @Override 79 @Override
80 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException { 80 public ScheduleRealInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
81 ScheduleRealInfo schedule = new ScheduleRealInfo(); 81 ScheduleRealInfo schedule = new ScheduleRealInfo();
  82 + schedule.setId(rs.getLong("id"));
82 schedule.setScheduleDateStr(rs.getString("schedule_date_Str")); 83 schedule.setScheduleDateStr(rs.getString("schedule_date_Str"));
83 schedule.setRealExecDate(rs.getString("real_exec_date")); 84 schedule.setRealExecDate(rs.getString("real_exec_date"));
84 schedule.setXlBm(rs.getString("xl_bm")); 85 schedule.setXlBm(rs.getString("xl_bm"));
@@ -98,6 +99,8 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -98,6 +99,8 @@ public class BusIntervalServiceImpl implements BusIntervalService {
98 schedule.setZdzName(rs.getString("zdz_name")); 99 schedule.setZdzName(rs.getString("zdz_name"));
99 schedule.setXlDir(rs.getString("xl_dir")); 100 schedule.setXlDir(rs.getString("xl_dir"));
100 schedule.setStatus(rs.getInt("status")); 101 schedule.setStatus(rs.getInt("status"));
  102 + schedule.setAdjustExps(rs.getString("adjust_exps"));
  103 + schedule.setJhlcOrig(rs.getDouble("jhlc_orig"));
101 schedule.setRemarks(rs.getString("remarks")); 104 schedule.setRemarks(rs.getString("remarks"));
102 schedule.setGsName(rs.getString("gs_name")); 105 schedule.setGsName(rs.getString("gs_name"));
103 schedule.setFgsName(rs.getString("fgs_name")); 106 schedule.setFgsName(rs.getString("fgs_name"));
@@ -1557,47 +1560,52 @@ public class BusIntervalServiceImpl implements BusIntervalService { @@ -1557,47 +1560,52 @@ public class BusIntervalServiceImpl implements BusIntervalService {
1557 companyName = schedule.getGsName(); 1560 companyName = schedule.getGsName();
1558 if(schedule.getFgsName() != null && subCompanyName.length() == 0) 1561 if(schedule.getFgsName() != null && subCompanyName.length() == 0)
1559 subCompanyName = schedule.getFgsName(); 1562 subCompanyName = schedule.getFgsName();
  1563 + double lc = 0d;
  1564 + if(schedule.getJhlcOrig() != null && schedule.getJhlcOrig() > 0.1d){
  1565 + lc = schedule.getJhlcOrig();
  1566 + } else {
  1567 + lc = schedule.getJhlc();
  1568 + }
  1569 +
1560 jhbc++; 1570 jhbc++;
1561 - if(schedule.getJhlc() != null)  
1562 - jhlc += schedule.getJhlc(); 1571 + jhlc += lc;
1563 if(schedule.getStatus() == 2){ 1572 if(schedule.getStatus() == 2){
1564 sjbc++; 1573 sjbc++;
1565 - if(schedule.getJhlc() != null)  
1566 - sjlc += schedule.getJhlc(); 1574 + sjlc += lc;
1567 } else if(schedule.getStatus() == -1){ 1575 } else if(schedule.getStatus() == -1){
1568 - if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("路阻") != -1){ 1576 + if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("路阻") != -1){
1569 lzbc++; 1577 lzbc++;
1570 - lzlc += schedule.getJhlc();  
1571 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("吊慢") != -1){ 1578 + lzlc += lc;
  1579 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("吊慢") != -1){
1572 dmbc++; 1580 dmbc++;
1573 - dmlc += schedule.getJhlc();  
1574 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("故障") != -1){ 1581 + dmlc += lc;
  1582 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("故障") != -1){
1575 gzbc++; 1583 gzbc++;
1576 - gzlc += schedule.getJhlc();  
1577 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("纠纷") != -1){ 1584 + gzlc += lc;
  1585 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("纠纷") != -1){
1578 jfbc++; 1586 jfbc++;
1579 - jflc += schedule.getJhlc();  
1580 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("肇事") != -1){ 1587 + jflc += lc;
  1588 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("肇事") != -1){
1581 zsbc++; 1589 zsbc++;
1582 - zslc += schedule.getJhlc();  
1583 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("缺人") != -1){ 1590 + zslc += lc;
  1591 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺人") != -1){
1584 qrbc++; 1592 qrbc++;
1585 - qrlc += schedule.getJhlc();  
1586 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("缺车") != -1){ 1593 + qrlc += lc;
  1594 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("缺车") != -1){
1587 qcbc++; 1595 qcbc++;
1588 - qclc += schedule.getJhlc();  
1589 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("客稀") != -1){ 1596 + qclc += lc;
  1597 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("客稀") != -1){
1590 kxbc++; 1598 kxbc++;
1591 - kxlc += schedule.getJhlc();  
1592 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("气候") != -1){ 1599 + kxlc += lc;
  1600 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("气候") != -1){
1593 qhbc++; 1601 qhbc++;
1594 - qhlc += schedule.getJhlc();  
1595 - }else if(schedule.getRemarks() != null && schedule.getRemarks().indexOf("外援") != -1){ 1602 + qhlc += lc;
  1603 + }else if(schedule.getAdjustExps() != null && schedule.getAdjustExps().indexOf("外援") != -1){
1596 wybc++; 1604 wybc++;
1597 - wylc += schedule.getJhlc(); 1605 + wylc += lc;
1598 } else { 1606 } else {
1599 qtbc++; 1607 qtbc++;
1600 - qtlc += schedule.getJhlc(); 1608 + qtlc += lc;
1601 } 1609 }
1602 } 1610 }
1603 } 1611 }
src/main/java/com/bsth/service/realcontrol/impl/ChildTaskPlanServiceImpl.java
@@ -51,11 +51,11 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon @@ -51,11 +51,11 @@ public class ChildTaskPlanServiceImpl extends BaseServiceImpl&lt;ChildTaskPlan, Lon
51 51
52 if(StringUtils.isEmpty(t.getEndStationName())) 52 if(StringUtils.isEmpty(t.getEndStationName()))
53 t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix)); 53 t.setEndStationName(BasicData.getStationNameByCode(t.getEndStation(), prefix));
  54 + if(t.getDestroyReason() == null)
  55 + t.setDestroyReason("");
54 //先持久化子任务 56 //先持久化子任务
55 rs = super.save(t); 57 rs = super.save(t);
56 //关联主任务 58 //关联主任务
57 - System.out.println("schschsch: " + sch);  
58 - System.out.println("sch.getcTasks()sch.getcTasks(): " + sch.getcTasks());  
59 sch.getcTasks().add(t); 59 sch.getcTasks().add(t);
60 dayOfSchedule.save(sch); 60 dayOfSchedule.save(sch);
61 //直接持久化 61 //直接持久化
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
@@ -41,6 +41,7 @@ import com.bsth.repository.schedule.EmployeeConfigInfoRepository; @@ -41,6 +41,7 @@ import com.bsth.repository.schedule.EmployeeConfigInfoRepository;
41 import com.bsth.repository.schedule.GuideboardInfoRepository; 41 import com.bsth.repository.schedule.GuideboardInfoRepository;
42 import com.bsth.security.util.SecurityUtils; 42 import com.bsth.security.util.SecurityUtils;
43 import com.bsth.service.SectionRouteService; 43 import com.bsth.service.SectionRouteService;
  44 +import com.bsth.service.directive.DirectiveService;
44 import com.bsth.service.impl.BaseServiceImpl; 45 import com.bsth.service.impl.BaseServiceImpl;
45 import com.bsth.service.realcontrol.ScheduleRealInfoService; 46 import com.bsth.service.realcontrol.ScheduleRealInfoService;
46 import com.bsth.service.report.CulateMileageService; 47 import com.bsth.service.report.CulateMileageService;
@@ -89,7 +90,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -89,7 +90,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
89 90
90 @Autowired 91 @Autowired
91 SectionRouteService sectionRouteService; 92 SectionRouteService sectionRouteService;
92 - 93 +
93 @Autowired 94 @Autowired
94 CulateMileageService culateMieageService; 95 CulateMileageService culateMieageService;
95 96
@@ -125,16 +126,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -125,16 +126,19 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
125 126
126 @Autowired 127 @Autowired
127 YlbRepository ylbRepository; 128 YlbRepository ylbRepository;
128 - 129 +
129 @Autowired 130 @Autowired
130 ReportService reposrService; 131 ReportService reposrService;
131 - 132 +
132 @Autowired 133 @Autowired
133 CulateMileageService culateService; 134 CulateMileageService culateService;
134 135
135 @Autowired 136 @Autowired
136 SchModifyLog schModifyLog; 137 SchModifyLog schModifyLog;
137 138
  139 + @Autowired
  140 + DirectiveService directiveService;
  141 +
138 Logger logger = LoggerFactory.getLogger(this.getClass()); 142 Logger logger = LoggerFactory.getLogger(this.getClass());
139 143
140 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), 144 SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"),
@@ -620,6 +624,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -620,6 +624,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
620 //数据库删除 624 //数据库删除
621 rs = super.delete(id); 625 rs = super.delete(id);
622 if(rs.get("status").equals(ResponseCode.SUCCESS)){ 626 if(rs.get("status").equals(ResponseCode.SUCCESS)){
  627 + /*ScheduleRealInfo temp = super.findById(id);
  628 + if(temp != null){
  629 + rs.put("status", ResponseCode.ERROR);
  630 + rs.put("msg", "删除失败,请重试!");
  631 + return rs;
  632 + }*/
  633 +
623 dayOfSchedule.delete(sch); 634 dayOfSchedule.delete(sch);
624 //更新起点应到时间 635 //更新起点应到时间
625 List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch); 636 List<ScheduleRealInfo> ts = dayOfSchedule.updateQdzTimePlan(sch);
@@ -729,39 +740,39 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -729,39 +740,39 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
729 List<ScheduleRealInfo> listNew = new ArrayList<ScheduleRealInfo>(); 740 List<ScheduleRealInfo> listNew = new ArrayList<ScheduleRealInfo>();
730 Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); 741 Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
731 // if (px.equals("desc")) { 742 // if (px.equals("desc")) {
732 - int zt = 0;  
733 - for (int l = 0; l < 2; l++) {  
734 - for (int i = 0; i < list.size(); i++) {  
735 - ScheduleRealInfo t = list.get(i);  
736 - if (t.getLpName().indexOf("+") != -1) {  
737 - if (zt == 0) {  
738 - listNew.add(t);  
739 - }  
740 - } else if (pattern.matcher(t.getLpName()).matches()) {  
741 - if (zt == 1) {  
742 - listNew.add(t);  
743 - }  
744 - } else { 743 + int zt = 0;
  744 + for (int l = 0; l < 2; l++) {
  745 + for (int i = 0; i < list.size(); i++) {
  746 + ScheduleRealInfo t = list.get(i);
  747 + if (t.getLpName().indexOf("+") != -1) {
  748 + if (zt == 0) {
  749 + listNew.add(t);
  750 + }
  751 + } else if (pattern.matcher(t.getLpName()).matches()) {
  752 + if (zt == 1) {
  753 + listNew.add(t);
  754 + }
  755 + } else {
745 // if (zt == 2) { 756 // if (zt == 2) {
746 // listNew.add(t); 757 // listNew.add(t);
747 // } 758 // }
748 - continue;  
749 - } 759 + continue;
750 } 760 }
751 - zt++;  
752 } 761 }
753 -  
754 - Collections.sort(list, new ComparableLp());  
755 - for (int i = 0; i < list.size(); i++) {  
756 - ScheduleRealInfo t = list.get(i);  
757 - if (t.getLpName().indexOf("+") != -1) {  
758 - continue;  
759 - } else if (pattern.matcher(t.getLpName()).matches()) {  
760 - continue;  
761 - } else {  
762 - listNew.add(t);  
763 - }  
764 - } 762 + zt++;
  763 + }
  764 +
  765 + Collections.sort(list, new ComparableLp());
  766 + for (int i = 0; i < list.size(); i++) {
  767 + ScheduleRealInfo t = list.get(i);
  768 + if (t.getLpName().indexOf("+") != -1) {
  769 + continue;
  770 + } else if (pattern.matcher(t.getLpName()).matches()) {
  771 + continue;
  772 + } else {
  773 + listNew.add(t);
  774 + }
  775 + }
765 /*} else { 776 /*} else {
766 int zt = 0; 777 int zt = 0;
767 for (int l = 0; l < 3; l++) { 778 for (int l = 0; l < 3; l++) {
@@ -804,17 +815,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -804,17 +815,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
804 List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); 815 List<ScheduleRealInfo> scheduleRealInfos = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
805 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); 816 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
806 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); 817 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);
807 - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();  
808 - for (int i = 0; i < scheduleRealInfos.size(); i++) {  
809 - ScheduleRealInfo s=scheduleRealInfos.get(i);  
810 - if(s.getZdsjActual()!=null){  
811 - lists.add(s);  
812 - }  
813 - } 818 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  819 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  820 + ScheduleRealInfo s=scheduleRealInfos.get(i);
  821 + if(s.getZdsjActual()!=null){
  822 + lists.add(s);
  823 + }
  824 + }
814 DecimalFormat format = new DecimalFormat("0.00"); 825 DecimalFormat format = new DecimalFormat("0.00");
815 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 826 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
816 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 827 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
817 - //计算里程和班次数,并放入Map里 828 + //计算里程和班次数,并放入Map里
818 Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId()); 829 Map<String, Object> map = this.MapById(scheduleRealInfos.get(0).getId());
819 830
820 map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos))); 831 map.put("jhlc",Arith.add(culateMieageService.culateJhgl(scheduleRealInfos),culateMieageService.culateJhJccgl(scheduleRealInfos)));
@@ -833,33 +844,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -833,33 +844,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
833 // map=new HashMap<String,Object>(); 844 // map=new HashMap<String,Object>();
834 Map<String, Object> maps; 845 Map<String, Object> maps;
835 for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { 846 for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) {
836 - maps = new HashMap<String, Object>();  
837 - try {  
838 - scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());  
839 - scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());  
840 - maps = rru.getMapValue(scheduleRealInfo);  
841 - String zdsj = scheduleRealInfo.getZdsj();  
842 - String zdsjActual = scheduleRealInfo.getZdsjActual();  
843 - if (zdsj != null && zdsjActual != null &&  
844 - !zdsj.equals(zdsjActual)) {  
845 - if (zdsj.compareTo(zdsjActual) > 0) {  
846 - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
847 - maps.put("slow", "");  
848 - } else {  
849 - maps.put("fast", "");  
850 - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
851 - } 847 + maps = new HashMap<String, Object>();
  848 + try {
  849 + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
  850 + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
  851 + maps = rru.getMapValue(scheduleRealInfo);
  852 + String zdsj = scheduleRealInfo.getZdsj();
  853 + String zdsjActual = scheduleRealInfo.getZdsjActual();
  854 + if (zdsj != null && zdsjActual != null &&
  855 + !zdsj.equals(zdsjActual)) {
  856 + if (zdsj.compareTo(zdsjActual) > 0) {
  857 + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  858 + maps.put("slow", "");
852 } else { 859 } else {
853 - maps.put("fast", "");  
854 - maps.put("slow", ""); 860 + maps.put("fast", "");
  861 + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
855 } 862 }
856 - listMap.add(maps);  
857 - } catch (Exception e) {  
858 - e.printStackTrace(); 863 + } else {
  864 + maps.put("fast", "");
  865 + maps.put("slow", "");
859 } 866 }
  867 + listMap.add(maps);
  868 + } catch (Exception e) {
  869 + e.printStackTrace();
  870 + }
860 } 871 }
861 872
862 - 873 +
863 874
864 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 875 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
865 876
@@ -1269,6 +1280,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1269,6 +1280,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1269 ts.add(next); 1280 ts.add(next);
1270 } 1281 }
1271 1282
  1283 + if(!next.getXlBm().equals(sch.getXlBm())){
  1284 + directiveService.lineChange(next.getClZbh(), next.getXlBm(), "套跑@系统");
  1285 + }
  1286 +
1272 //重新计算车辆执行班次 1287 //重新计算车辆执行班次
1273 dayOfSchedule.reCalcExecPlan(sch.getClZbh()); 1288 dayOfSchedule.reCalcExecPlan(sch.getClZbh());
1274 } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){ 1289 } else if(StringUtils.isNotEmpty(sch.getZdsjActual()) && StringUtils.isEmpty(zdsjActual)){
@@ -1638,38 +1653,38 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1638,38 +1653,38 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1638 // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc)); 1653 // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc));
1639 return map; 1654 return map;
1640 }*/ 1655 }*/
1641 - 1656 +
1642 public Map<String, Object> findKMBC(String jGh, String clZbh, 1657 public Map<String, Object> findKMBC(String jGh, String clZbh,
1643 - String lpName, String date, String line) {  
1644 - Map<String, Object> map = new HashMap<String, Object>();  
1645 - List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);  
1646 - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();  
1647 - for (int i = 0; i < list.size(); i++) {  
1648 - ScheduleRealInfo s=list.get(i);  
1649 - if(s.getZdsjActual()!=null){  
1650 - lists.add(s);  
1651 - }  
1652 - }  
1653 - double ksgl=culateService.culateKsgl(list);  
1654 - double sjgl=culateService.culateSjgl(lists);  
1655 - double jccgl=culateService.culateJccgl(lists);  
1656 - double ljgl=culateService.culateLjgl(lists);  
1657 -  
1658 - map.put("jhlc", Arith.add(culateService.culateJhgl(list),culateService.culateJhJccgl(list))); //计划里程  
1659 - map.put("remMileage", culateService.culateLbgl(list)); //烂班公里  
1660 - map.put("addMileage", ljgl); //临加公里  
1661 - map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里  
1662 - map.put("ksgl", ksgl);//空驶公里  
1663 - map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl))); 1658 + String lpName, String date, String line) {
  1659 + Map<String, Object> map = new HashMap<String, Object>();
  1660 + List<ScheduleRealInfo> list=scheduleRealInfoRepository.queryListWaybillXcld(jGh, clZbh, lpName, date, line);
  1661 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  1662 + for (int i = 0; i < list.size(); i++) {
  1663 + ScheduleRealInfo s=list.get(i);
  1664 + if(s.getZdsjActual()!=null){
  1665 + lists.add(s);
  1666 + }
  1667 + }
  1668 + double ksgl=culateService.culateKsgl(list);
  1669 + double sjgl=culateService.culateSjgl(lists);
  1670 + double jccgl=culateService.culateJccgl(lists);
  1671 + double ljgl=culateService.culateLjgl(lists);
  1672 +
  1673 + map.put("jhlc", Arith.add(culateService.culateJhgl(list),culateService.culateJhJccgl(list))); //计划里程
  1674 + map.put("remMileage", culateService.culateLbgl(list)); //烂班公里
  1675 + map.put("addMileage", ljgl); //临加公里
  1676 + map.put("yygl",Arith.add(sjgl,ljgl)); //实际公里
  1677 + map.put("ksgl", ksgl);//空驶公里
  1678 + map.put("realMileage",Arith.add(Arith.add(ksgl,jccgl ),Arith.add(sjgl,ljgl)));
1664 // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage)); 1679 // map.put("realMileage", format.format(yygl + ksgl + jcclc+addMileage));
1665 - map.put("jhbc", culateService.culateJhbc(list,""));  
1666 - map.put("cjbc", culateService.culateLbbc(list));  
1667 - map.put("ljbc", culateService.culateLjbc(lists,""));  
1668 - map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,""));  
1669 - map.put("jcclc", jccgl);  
1670 - map.put("zkslc", Arith.add(ksgl,jccgl)); 1680 + map.put("jhbc", culateService.culateJhbc(list,""));
  1681 + map.put("cjbc", culateService.culateLbbc(list));
  1682 + map.put("ljbc", culateService.culateLjbc(lists,""));
  1683 + map.put("sjbc", culateService.culateJhbc(lists,"") - culateService.culateLbbc(lists) + culateService.culateLjbc(lists,""));
  1684 + map.put("jcclc", jccgl);
  1685 + map.put("zkslc", Arith.add(ksgl,jccgl));
1671 // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc)); 1686 // map.put("zkslc", format.format(ksgl + jcclc+addMileageJc));
1672 - return map; 1687 + return map;
1673 } 1688 }
1674 1689
1675 1690
@@ -1792,38 +1807,38 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1792,38 +1807,38 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1792 list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line); 1807 list = scheduleRealInfoRepository.queryListWaybill(jName, clZbh, lpName, date, line);
1793 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm"); 1808 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm");
1794 String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'"; 1809 String sqlMinYysj="select start_opt from bsth_c_line_config where line = '"+BasicData.lineId2CodeMap.inverse().get(line) +"'";
1795 - String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);  
1796 - String[] minSjs = minfcsj.split(":");  
1797 - Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);  
1798 - 1810 + String minfcsj=jdbcTemplate.queryForObject(sqlMinYysj, String.class);
  1811 + String[] minSjs = minfcsj.split(":");
  1812 + Long minSj=Long.parseLong(minSjs[0])*60+Long.parseLong(minSjs[1]);
  1813 +
1799 for (int i = 0; i < list.size(); i++) { 1814 for (int i = 0; i < list.size(); i++) {
1800 - ScheduleRealInfo s=list.get(i);  
1801 - String[] fcsj= s.getFcsj().split(":");  
1802 - Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);  
1803 -  
1804 - Long fscjT=0L;  
1805 - if(fcsjL<minSj){  
1806 - Calendar calendar = new GregorianCalendar();  
1807 - calendar.setTime(s.getScheduleDate());  
1808 - calendar.add(calendar.DATE,1);  
1809 - s.setScheduleDate(calendar.getTime());  
1810 - try {  
1811 - fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();  
1812 - } catch (ParseException e) {  
1813 - // TODO Auto-generated catch block  
1814 - e.printStackTrace();  
1815 - }  
1816 -  
1817 - }else{  
1818 - try {  
1819 - fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();  
1820 - } catch (ParseException e) {  
1821 - // TODO Auto-generated catch block  
1822 - e.printStackTrace();  
1823 - };  
1824 - }  
1825 - s.setFcsjT(fscjT);  
1826 - } 1815 + ScheduleRealInfo s=list.get(i);
  1816 + String[] fcsj= s.getFcsj().split(":");
  1817 + Long fcsjL=Long.parseLong(fcsj[0])*60+Long.parseLong(fcsj[1]);
  1818 +
  1819 + Long fscjT=0L;
  1820 + if(fcsjL<minSj){
  1821 + Calendar calendar = new GregorianCalendar();
  1822 + calendar.setTime(s.getScheduleDate());
  1823 + calendar.add(calendar.DATE,1);
  1824 + s.setScheduleDate(calendar.getTime());
  1825 + try {
  1826 + fscjT = sdf.parse(sdf.format(s.getScheduleDate())+" "+s.getFcsj()).getTime();
  1827 + } catch (ParseException e) {
  1828 + // TODO Auto-generated catch block
  1829 + e.printStackTrace();
  1830 + }
  1831 +
  1832 + }else{
  1833 + try {
  1834 + fscjT =sdf.parse(s.getScheduleDateStr()+" "+s.getFcsj()).getTime();
  1835 + } catch (ParseException e) {
  1836 + // TODO Auto-generated catch block
  1837 + e.printStackTrace();
  1838 + };
  1839 + }
  1840 + s.setFcsjT(fscjT);
  1841 + }
1827 Collections.sort(list, new ComparableReal()); 1842 Collections.sort(list, new ComparableReal());
1828 for (int i = 0; i < list.size(); i++) { 1843 for (int i = 0; i < list.size(); i++) {
1829 ScheduleRealInfo s = list.get(i); 1844 ScheduleRealInfo s = list.get(i);
@@ -1847,31 +1862,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1847,31 +1862,31 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1847 remarks += "(烂班)"; 1862 remarks += "(烂班)";
1848 s.setRemarks(remarks); 1863 s.setRemarks(remarks);
1849 } 1864 }
1850 - 1865 +
1851 listSchedule.add(s); 1866 listSchedule.add(s);
1852 //计算营运里程,空驶里程 1867 //计算营运里程,空驶里程
1853 if (!childTaskPlans.isEmpty()) { 1868 if (!childTaskPlans.isEmpty()) {
1854 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator(); 1869 // Iterator<ChildTaskPlan> it = childTaskPlans.iterator();
1855 - List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);  
1856 - Collections.sort(listit, new ComparableChild());  
1857 - for (int j = 0; j < listit.size(); j++) {  
1858 - ScheduleRealInfo t = new ScheduleRealInfo();  
1859 - ChildTaskPlan childTaskPlan = listit.get(j);  
1860 - if (childTaskPlan.isDestroy()) {  
1861 - t.setFcsjActual("");  
1862 - t.setZdsjActual("");  
1863 - t.setJhlc(0.0);  
1864 - } else {  
1865 - t.setFcsjActual(childTaskPlan.getStartDate());  
1866 - t.setZdsjActual(childTaskPlan.getEndDate());  
1867 - t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));  
1868 - }  
1869 - t.setQdzName(childTaskPlan.getStartStationName());  
1870 - t.setZdzName(childTaskPlan.getEndStationName());  
1871 - t.setRemarks(childTaskPlan.getRemarks());  
1872 - t.setAdjustExps("子");  
1873 - listSchedule.add(t);  
1874 - } 1870 + List<ChildTaskPlan> listit=new ArrayList<ChildTaskPlan>(childTaskPlans);
  1871 + Collections.sort(listit, new ComparableChild());
  1872 + for (int j = 0; j < listit.size(); j++) {
  1873 + ScheduleRealInfo t = new ScheduleRealInfo();
  1874 + ChildTaskPlan childTaskPlan = listit.get(j);
  1875 + if (childTaskPlan.isDestroy()) {
  1876 + t.setFcsjActual("");
  1877 + t.setZdsjActual("");
  1878 + t.setJhlc(0.0);
  1879 + } else {
  1880 + t.setFcsjActual(childTaskPlan.getStartDate());
  1881 + t.setZdsjActual(childTaskPlan.getEndDate());
  1882 + t.setJhlc(Double.parseDouble(String.valueOf(childTaskPlan.getMileage())));
  1883 + }
  1884 + t.setQdzName(childTaskPlan.getStartStationName());
  1885 + t.setZdzName(childTaskPlan.getEndStationName());
  1886 + t.setRemarks(childTaskPlan.getRemarks());
  1887 + t.setAdjustExps("子");
  1888 + listSchedule.add(t);
  1889 + }
1875 /* String sqlPc = "select * from bsth_c_s_child_task where schedule=" + s.getId() + " order by start_date "; 1890 /* String sqlPc = "select * from bsth_c_s_child_task where schedule=" + s.getId() + " order by start_date ";
1876 List<ScheduleRealInfo> lists = jdbcTemplate.query(sqlPc, 1891 List<ScheduleRealInfo> lists = jdbcTemplate.query(sqlPc,
1877 new RowMapper<ScheduleRealInfo>() { 1892 new RowMapper<ScheduleRealInfo>() {
@@ -1924,62 +1939,62 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -1924,62 +1939,62 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1924 @Override 1939 @Override
1925 public List<Map<String, Object>> statisticsDaily(String line, String date, 1940 public List<Map<String, Object>> statisticsDaily(String line, String date,
1926 String xlName, String type) { 1941 String xlName, String type) {
1927 - List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>();  
1928 - List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);  
1929 - List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>();  
1930 - for (int i = 0; i < list_s.size(); i++) {  
1931 - ScheduleRealInfo s=list_s.get(i);  
1932 - if(s.getZdsjActual()!=null){  
1933 - lists.add(s);  
1934 - }  
1935 - }  
1936 - Map<String, Object> map = new HashMap<String, Object>();  
1937 - map.put("xlName", xlName);  
1938 - double jhlc=culateService.culateJhgl(list_s);  
1939 - map.put("jhlc",jhlc);  
1940 - map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));  
1941 - double lbgl=culateService.culateLbgl(list_s);  
1942 - map.put("ssgl", lbgl);  
1943 - map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻"));  
1944 - map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢"));  
1945 - map.put("ssgl_gz", culateService.culateCJLC(list_s, "故障"));  
1946 - map.put("ssgl_jf", culateService.culateCJLC(list_s, "纠纷"));  
1947 - map.put("ssgl_zs", culateService.culateCJLC(list_s, "肇事"));  
1948 - map.put("ssgl_qr", culateService.culateCJLC(list_s, "缺人"));  
1949 - map.put("ssgl_qc", culateService.culateCJLC(list_s, "缺车"));  
1950 - map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀"));  
1951 - map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候"));  
1952 - map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外"));  
1953 - double ssgl_pc=culateService.culateCJLC(list_s, "配车");  
1954 - double ssgl_by=culateService.culateCJLC(list_s, "保养");  
1955 - double ssgl_cj=culateService.culateCJLC(list_s, "抽减");  
1956 - double ssgl_qt=culateService.culateCJLC(list_s, "其他");  
1957 - map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));  
1958 - map.put("ssbc", culateService.culateLbbc(list_s));  
1959 - double ljgl=culateService.culateLjgl(lists);  
1960 - map.put("ljgl", ljgl);  
1961 - map.put("jhbc", culateService.culateJhbc(list_s,""));  
1962 - map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf"));  
1963 - map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf"));  
1964 - map.put("sjbc", culateService.culateSjbc(lists,""));  
1965 - map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));  
1966 - map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));  
1967 - map.put("ljbc", culateService.culateLjbc(lists,""));  
1968 - map.put("ljbc_m", culateService.culateLjbc(lists,"zgf"));  
1969 - map.put("ljbc_a", culateService.culateLjbc(lists,"wgf"));  
1970 - map.put("fzbc", culateService.culateFzbc(lists, ""));  
1971 - map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));  
1972 - map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));  
1973 - map.put("dtbc", 0);  
1974 - map.put("dtbc_m", 0);  
1975 - map.put("dtbc_a", 0);  
1976 - map.put("djg", 0);  
1977 - map.put("djg_m", 0);  
1978 - map.put("djg_a", 0);  
1979 - map.put("djg_time", 0);  
1980 - map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl));  
1981 - lMap.add(map);  
1982 - return lMap; 1942 + List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>();
  1943 + List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  1944 + List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>();
  1945 + for (int i = 0; i < list_s.size(); i++) {
  1946 + ScheduleRealInfo s=list_s.get(i);
  1947 + if(s.getZdsjActual()!=null){
  1948 + lists.add(s);
  1949 + }
  1950 + }
  1951 + Map<String, Object> map = new HashMap<String, Object>();
  1952 + map.put("xlName", xlName);
  1953 + double jhlc=culateService.culateJhgl(list_s);
  1954 + map.put("jhlc",jhlc);
  1955 + map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));
  1956 + double lbgl=culateService.culateLbgl(list_s);
  1957 + map.put("ssgl", lbgl);
  1958 + map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻"));
  1959 + map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢"));
  1960 + map.put("ssgl_gz", culateService.culateCJLC(list_s, "故障"));
  1961 + map.put("ssgl_jf", culateService.culateCJLC(list_s, "纠纷"));
  1962 + map.put("ssgl_zs", culateService.culateCJLC(list_s, "肇事"));
  1963 + map.put("ssgl_qr", culateService.culateCJLC(list_s, "缺人"));
  1964 + map.put("ssgl_qc", culateService.culateCJLC(list_s, "缺车"));
  1965 + map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀"));
  1966 + map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候"));
  1967 + map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外"));
  1968 + double ssgl_pc=culateService.culateCJLC(list_s, "配车");
  1969 + double ssgl_by=culateService.culateCJLC(list_s, "保养");
  1970 + double ssgl_cj=culateService.culateCJLC(list_s, "抽减");
  1971 + double ssgl_qt=culateService.culateCJLC(list_s, "其他");
  1972 + map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
  1973 + map.put("ssbc", culateService.culateLbbc(list_s));
  1974 + double ljgl=culateService.culateLjgl(lists);
  1975 + map.put("ljgl", ljgl);
  1976 + map.put("jhbc", culateService.culateJhbc(list_s,""));
  1977 + map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf"));
  1978 + map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf"));
  1979 + map.put("sjbc", culateService.culateSjbc(lists,""));
  1980 + map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));
  1981 + map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));
  1982 + map.put("ljbc", culateService.culateLjbc(lists,""));
  1983 + map.put("ljbc_m", culateService.culateLjbc(lists,"zgf"));
  1984 + map.put("ljbc_a", culateService.culateLjbc(lists,"wgf"));
  1985 + map.put("fzbc", culateService.culateFzbc(lists, ""));
  1986 + map.put("fzbc_m", culateService.culateFzbc(lists, "zgf"));
  1987 + map.put("fzbc_a", culateService.culateFzbc(lists, "wgf"));
  1988 + map.put("dtbc", 0);
  1989 + map.put("dtbc_m", 0);
  1990 + map.put("dtbc_a", 0);
  1991 + map.put("djg", 0);
  1992 + map.put("djg_m", 0);
  1993 + map.put("djg_a", 0);
  1994 + map.put("djg_time", 0);
  1995 + map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl));
  1996 + lMap.add(map);
  1997 + return lMap;
1983 } 1998 }
1984 1999
1985 /* @Override 2000 /* @Override
@@ -2527,34 +2542,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2527,34 +2542,34 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2527 2542
2528 return lMap; 2543 return lMap;
2529 }*/ 2544 }*/
2530 - 2545 +
2531 public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){ 2546 public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){
2532 - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();  
2533 - for(int i=0;i<list.size();i++){  
2534 - ScheduleRealInfo s=list.get(i);  
2535 - if(s.getZdsjActual()!=null){  
2536 - lists.add(s);  
2537 - }  
2538 - }  
2539 - Map<String, Object> map = new HashMap<String, Object>();  
2540 - map.put("xlName", lists.get(0).getXlName());  
2541 - double jhyygl=culateService.culateJhgl(list);//计划营运公里  
2542 - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)  
2543 - map.put("jhlc", jhyygl);  
2544 - map.put("jcclc", jhjcclc);  
2545 - map.put("jhzlc", Arith.add(jhyygl, jhjcclc));  
2546 -  
2547 - double ljgl= culateService.culateLjgl(lists);  
2548 - double sjyygl= culateService.culateSjgl(lists);  
2549 - double zyygl= Arith.add(sjyygl,ljgl);  
2550 -  
2551 - double sjjccgl=culateService.culateJccgl(lists);  
2552 - double sjksgl=culateService.culateKsgl(lists);  
2553 - double zksgl=Arith.add(sjjccgl, sjksgl);  
2554 - map.put("sjzgl", Arith.add(zyygl, zksgl));  
2555 - map.put("sjgl",zyygl);  
2556 - map.put("sjksgl", zksgl);  
2557 - 2547 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  2548 + for(int i=0;i<list.size();i++){
  2549 + ScheduleRealInfo s=list.get(i);
  2550 + if(s.getZdsjActual()!=null){
  2551 + lists.add(s);
  2552 + }
  2553 + }
  2554 + Map<String, Object> map = new HashMap<String, Object>();
  2555 + map.put("xlName", lists.get(0).getXlName());
  2556 + double jhyygl=culateService.culateJhgl(list);//计划营运公里
  2557 + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
  2558 + map.put("jhlc", jhyygl);
  2559 + map.put("jcclc", jhjcclc);
  2560 + map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
  2561 +
  2562 + double ljgl= culateService.culateLjgl(lists);
  2563 + double sjyygl= culateService.culateSjgl(lists);
  2564 + double zyygl= Arith.add(sjyygl,ljgl);
  2565 +
  2566 + double sjjccgl=culateService.culateJccgl(lists);
  2567 + double sjksgl=culateService.culateKsgl(lists);
  2568 + double zksgl=Arith.add(sjjccgl, sjksgl);
  2569 + map.put("sjzgl", Arith.add(zyygl, zksgl));
  2570 + map.put("sjgl",zyygl);
  2571 + map.put("sjksgl", zksgl);
  2572 +
2558 map.put("ssgl", culateService.culateLbgl(list)); 2573 map.put("ssgl", culateService.culateLbgl(list));
2559 map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); 2574 map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
2560 map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); 2575 map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
@@ -2588,66 +2603,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2588,66 +2603,66 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2588 map.put("djg_m", 0); 2603 map.put("djg_m", 0);
2589 map.put("djg_a", 0); 2604 map.put("djg_a", 0);
2590 map.put("djg_time", 0); 2605 map.put("djg_time", 0);
2591 - return map; 2606 + return map;
2592 } 2607 }
2593 - 2608 +
2594 @Override 2609 @Override
2595 public List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2, 2610 public List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2,
2596 - String xlName, String type) { 2611 + String xlName, String type) {
2597 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>(); 2612 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
2598 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>(); 2613 List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
2599 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>(); 2614 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2600 line =line.trim(); 2615 line =line.trim();
2601 if(line.equals("")){ 2616 if(line.equals("")){
2602 - //查询所有线路  
2603 - list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm); 2617 + //查询所有线路
  2618 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj(line, date,date2,gsdm,fgsdm);
2604 }else{ 2619 }else{
2605 - //查询单条线路  
2606 - list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2); 2620 + //查询单条线路
  2621 + list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
2607 } 2622 }
2608 for (int i = 0; i < list.size(); i++) { 2623 for (int i = 0; i < list.size(); i++) {
2609 - ScheduleRealInfo s=list.get(i);  
2610 - if(s.getZdsjActual()!=null){  
2611 - list_s.add(s);  
2612 - }  
2613 - } 2624 + ScheduleRealInfo s=list.get(i);
  2625 + if(s.getZdsjActual()!=null){
  2626 + list_s.add(s);
  2627 + }
  2628 + }
2614 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>(); 2629 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
2615 for (int i = 0; i < list.size(); i++) { 2630 for (int i = 0; i < list.size(); i++) {
2616 - if(i<list.size()-1){  
2617 - if(list.get(i+1).getXlBm().equals(list.get(i).getXlBm())){  
2618 - lists.add(list.get(i));  
2619 - }else{  
2620 - lists.add(list.get(i));  
2621 - Map<String, Object> map=staticTj(lists);  
2622 - lMap.add(map);  
2623 - lists=new ArrayList<ScheduleRealInfo>();  
2624 - }  
2625 - }else{  
2626 - if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){  
2627 - lists.add(list.get(i));  
2628 - Map<String, Object> map=staticTj(lists);  
2629 - lMap.add(map);  
2630 - }else{  
2631 - lists=new ArrayList<ScheduleRealInfo>();  
2632 - lists.add(list.get(i));  
2633 - Map<String, Object> map=staticTj(lists);  
2634 - lMap.add(map);  
2635 - }  
2636 - } 2631 + if(i<list.size()-1){
  2632 + if(list.get(i+1).getXlBm().equals(list.get(i).getXlBm())){
  2633 + lists.add(list.get(i));
  2634 + }else{
  2635 + lists.add(list.get(i));
  2636 + Map<String, Object> map=staticTj(lists);
  2637 + lMap.add(map);
  2638 + lists=new ArrayList<ScheduleRealInfo>();
  2639 + }
  2640 + }else{
  2641 + if(list.get(i).getXlBm().equals(list.get(i-1).getXlBm())){
  2642 + lists.add(list.get(i));
  2643 + Map<String, Object> map=staticTj(lists);
  2644 + lMap.add(map);
  2645 + }else{
  2646 + lists=new ArrayList<ScheduleRealInfo>();
  2647 + lists.add(list.get(i));
  2648 + Map<String, Object> map=staticTj(lists);
  2649 + lMap.add(map);
  2650 + }
  2651 + }
2637 } 2652 }
2638 - 2653 +
2639 Map<String, Object> map = new HashMap<String, Object>(); 2654 Map<String, Object> map = new HashMap<String, Object>();
2640 - map.put("xlName", "合计");  
2641 - double jhyygl=culateService.culateJhgl(list);//计划营运公里  
2642 - double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) 2655 + map.put("xlName", "合计");
  2656 + double jhyygl=culateService.culateJhgl(list);//计划营运公里
  2657 + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
2643 map.put("jhlc", jhyygl); 2658 map.put("jhlc", jhyygl);
2644 map.put("jcclc", jhjcclc); 2659 map.put("jcclc", jhjcclc);
2645 map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); 2660 map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
2646 - 2661 +
2647 double ljgl= culateService.culateLjgl(list_s); 2662 double ljgl= culateService.culateLjgl(list_s);
2648 double sjyygl= culateService.culateSjgl(list_s); 2663 double sjyygl= culateService.culateSjgl(list_s);
2649 double zyygl= Arith.add(sjyygl,ljgl); 2664 double zyygl= Arith.add(sjyygl,ljgl);
2650 - 2665 +
2651 double sjjccgl=culateService.culateJccgl(list_s); 2666 double sjjccgl=culateService.culateJccgl(list_s);
2652 double sjksgl=culateService.culateKsgl(list_s); 2667 double sjksgl=culateService.culateKsgl(list_s);
2653 double zksgl=Arith.add(sjjccgl, sjksgl); 2668 double zksgl=Arith.add(sjjccgl, sjksgl);
@@ -2965,10 +2980,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2965,10 +2980,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2965 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm); 2980 List<ScheduleRealInfo> lists = scheduleRealInfoRepository.queryListWaybill3(jGh, nbbm, date,gsbm,fgsbm);
2966 // System.out.println("shijian3:"+new Date()); 2981 // System.out.println("shijian3:"+new Date());
2967 for (int x = 0; x < yesterdayDataList.size(); x++) { 2982 for (int x = 0; x < yesterdayDataList.size(); x++) {
2968 - 2983 +
2969 String jName = yesterdayDataList.get(x).get("jGh").toString(); 2984 String jName = yesterdayDataList.get(x).get("jGh").toString();
2970 String clZbh = yesterdayDataList.get(x).get("clZbh").toString(); 2985 String clZbh = yesterdayDataList.get(x).get("clZbh").toString();
2971 - 2986 +
2972 // double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0; 2987 // double jhlc = 0, yygl = 0, ksgl = 0, tempJhlc = 0, jcclc = 0;
2973 double addMileage = 0, remMileage = 0; 2988 double addMileage = 0, remMileage = 0;
2974 Map<String, Object> map = new HashMap<String, Object>(); 2989 Map<String, Object> map = new HashMap<String, Object>();
@@ -2977,14 +2992,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -2977,14 +2992,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2977 String bCompany=""; 2992 String bCompany="";
2978 List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>(); 2993 List<ScheduleRealInfo> listS=new ArrayList<ScheduleRealInfo>();
2979 for (ScheduleRealInfo scheduleRealInfo : lists) { 2994 for (ScheduleRealInfo scheduleRealInfo : lists) {
2980 - if(scheduleRealInfo.getjGh().equals(jName) && scheduleRealInfo.getClZbh().equals(clZbh)){  
2981 - if (fage) {  
2982 - //根据线路代码获取公司  
2983 - company=scheduleRealInfo.getGsBm();  
2984 - bCompany=scheduleRealInfo.getFgsBm();  
2985 - fage = false;  
2986 - }  
2987 - listS.add(scheduleRealInfo); 2995 + if(scheduleRealInfo.getjGh().equals(jName) && scheduleRealInfo.getClZbh().equals(clZbh)){
  2996 + if (fage) {
  2997 + //根据线路代码获取公司
  2998 + company=scheduleRealInfo.getGsBm();
  2999 + bCompany=scheduleRealInfo.getFgsBm();
  3000 + fage = false;
  3001 + }
  3002 + listS.add(scheduleRealInfo);
2988 3003
2989 /* if (scheduleRealInfo != null) { 3004 /* if (scheduleRealInfo != null) {
2990 //计划里程(主任务过滤掉临加班次), 3005 //计划里程(主任务过滤掉临加班次),
@@ -3046,9 +3061,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3046,9 +3061,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3046 } 3061 }
3047 } 3062 }
3048 }*/ 3063 }*/
3049 - } 3064 + }
3050 } 3065 }
3051 - 3066 +
3052 yesterdayDataList.get(x).put("company", company); 3067 yesterdayDataList.get(x).put("company", company);
3053 yesterdayDataList.get(x).put("bCompany", bCompany); 3068 yesterdayDataList.get(x).put("bCompany", bCompany);
3054 // Double zgl=Arith.add(yygl,ksgl); 3069 // Double zgl=Arith.add(yygl,ksgl);
@@ -3800,9 +3815,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3800,9 +3815,9 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3800 } 3815 }
3801 3816
3802 if (!c.isDestroy()) { 3817 if (!c.isDestroy()) {
3803 - if(c.getMileageType().equals("service")){  
3804 - sjlc += c.getMileage() == null ? 0 : c.getMileage();  
3805 - } 3818 + if(c.getMileageType().equals("service")){
  3819 + sjlc += c.getMileage() == null ? 0 : c.getMileage();
  3820 + }
3806 } 3821 }
3807 3822
3808 } 3823 }
@@ -3866,14 +3881,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3866,14 +3881,14 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3866 Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime(); 3881 Long fcsj2 = sdf.parse(fcrq + " 11:00").getTime();
3867 Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime(); 3882 Long fcsj3 = sdf.parse(fcrq + " 23:59").getTime();
3868 for (int i = 0; i < list.size(); i++) { 3883 for (int i = 0; i < list.size(); i++) {
3869 - DutyEmployee t = list.get(i);  
3870 - if(!(dbdp.indexOf(",")>0)){  
3871 - if(!(dbdp.length()>0)){  
3872 - dbdp =t.getuName();  
3873 - }else{  
3874 - dbdp +=","+t.getuName();  
3875 - }  
3876 - } 3884 + DutyEmployee t = list.get(i);
  3885 + if(!(dbdp.indexOf(",")>0)){
  3886 + if(!(dbdp.length()>0)){
  3887 + dbdp =t.getuName();
  3888 + }else{
  3889 + dbdp +=","+t.getuName();
  3890 + }
  3891 + }
3877 Long ts = t.getTs(); 3892 Long ts = t.getTs();
3878 if (ts > fcsj1 && ts < fcsj2) { 3893 if (ts > fcsj1 && ts < fcsj2) {
3879 if (zdp.indexOf(t.getuName()) == -1) { 3894 if (zdp.indexOf(t.getuName()) == -1) {
@@ -3958,18 +3973,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -3958,18 +3973,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
3958 if (!scheduleRealInfo.getsGh().equals(sgh)) { 3973 if (!scheduleRealInfo.getsGh().equals(sgh)) {
3959 sgh = scheduleRealInfo.getsGh()==null?"":scheduleRealInfo.getsGh(); 3974 sgh = scheduleRealInfo.getsGh()==null?"":scheduleRealInfo.getsGh();
3960 if(!sgh.equals("")){ 3975 if(!sgh.equals("")){
3961 - if (map.get("sjb1") != null) {  
3962 - if (map.get("sjb2") != null) {  
3963 - map.put("sjb3", scheduleRealInfo.getsGh() + "/" +  
3964 - scheduleRealInfo.getFcsjActual());  
3965 - } else {  
3966 - map.put("sjb2", scheduleRealInfo.getsGh() + "/" +  
3967 - scheduleRealInfo.getFcsjActual());  
3968 - }  
3969 - } else {  
3970 - map.put("sjb1", scheduleRealInfo.getsGh() + "/" +  
3971 - scheduleRealInfo.getFcsjActual());  
3972 - } 3976 + if (map.get("sjb1") != null) {
  3977 + if (map.get("sjb2") != null) {
  3978 + map.put("sjb3", scheduleRealInfo.getsGh() + "/" +
  3979 + scheduleRealInfo.getFcsjActual());
  3980 + } else {
  3981 + map.put("sjb2", scheduleRealInfo.getsGh() + "/" +
  3982 + scheduleRealInfo.getFcsjActual());
  3983 + }
  3984 + } else {
  3985 + map.put("sjb1", scheduleRealInfo.getsGh() + "/" +
  3986 + scheduleRealInfo.getFcsjActual());
  3987 + }
3973 } 3988 }
3974 } 3989 }
3975 } 3990 }
@@ -4059,7 +4074,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4059,7 +4074,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4059 String xlName = map.get("xlName").toString(); 4074 String xlName = map.get("xlName").toString();
4060 String state = map.get("state").toString(); 4075 String state = map.get("state").toString();
4061 String type = map.get("type").toString(); 4076 String type = map.get("type").toString();
4062 - 4077 +
4063 List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>(); 4078 List<Map<String, Object>> dataList2 = new ArrayList<Map<String, Object>>();
4064 List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>(); 4079 List<Map<String, Object>> dataList3 = new ArrayList<Map<String, Object>>();
4065 List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null); 4080 List<Map<String, Object>> list1 = this.statisticsDaily(line, date, xlName, null);
@@ -4136,10 +4151,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4136,10 +4151,10 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4136 String fcsjActural=schedule.getFcsjActual() != null ? schedule.getFcsjActual() : ""; 4151 String fcsjActural=schedule.getFcsjActual() != null ? schedule.getFcsjActual() : "";
4137 String bcType=schedule.getBcType()!=null?schedule.getBcType():""; 4152 String bcType=schedule.getBcType()!=null?schedule.getBcType():"";
4138 if(bcType.equals("in")){ 4153 if(bcType.equals("in")){
4139 - fcsjActural=fcsjActural+"(进)"; 4154 + fcsjActural=fcsjActural+"(进)";
4140 } 4155 }
4141 if(bcType.equals("out")){ 4156 if(bcType.equals("out")){
4142 - fcsjActural=fcsjActural+"(出)"; 4157 + fcsjActural=fcsjActural+"(出)";
4143 } 4158 }
4144 tempMap.put("fcsjActual" + size, fcsjActural); 4159 tempMap.put("fcsjActual" + size, fcsjActural);
4145 tempMap.put("fcsjk" + size, ""); 4160 tempMap.put("fcsjk" + size, "");
@@ -4201,13 +4216,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4201,13 +4216,13 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4201 List<ScheduleRealInfo> scheduleRealInfos = listpl; 4216 List<ScheduleRealInfo> scheduleRealInfos = listpl;
4202 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); 4217 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
4203 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line); 4218 // List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.queryListWaybillXcld(jName, clZbh, lpName, date, line);
4204 - List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();  
4205 - for (int i = 0; i < scheduleRealInfos.size(); i++) {  
4206 - ScheduleRealInfo s=scheduleRealInfos.get(i);  
4207 - if(s.getZdsjActual()!=null){  
4208 - lists.add(s);  
4209 - }  
4210 - } 4219 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  4220 + for (int i = 0; i < scheduleRealInfos.size(); i++) {
  4221 + ScheduleRealInfo s=scheduleRealInfos.get(i);
  4222 + if(s.getZdsjActual()!=null){
  4223 + lists.add(s);
  4224 + }
  4225 + }
4211 DecimalFormat format = new DecimalFormat("0.00"); 4226 DecimalFormat format = new DecimalFormat("0.00");
4212 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName); 4227 // int cjbc = scheduleRealInfoRepository.findCjbc(jName, clZbh, lpName);
4213 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName); 4228 // int ljbc = scheduleRealInfoRepository.findLjbc(jName, clZbh, lpName);
@@ -4229,33 +4244,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4229,33 +4244,33 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4229 4244
4230 Map<String, Object> maps; 4245 Map<String, Object> maps;
4231 for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) { 4246 for (ScheduleRealInfo scheduleRealInfo : scheduleRealInfos) {
4232 - maps = new HashMap<String, Object>();  
4233 - try {  
4234 - scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());  
4235 - scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());  
4236 - maps = rru.getMapValue(scheduleRealInfo);  
4237 - String zdsj = scheduleRealInfo.getZdsj();  
4238 - String zdsjActual = scheduleRealInfo.getZdsjActual();  
4239 - if (zdsj != null && zdsjActual != null &&  
4240 - !zdsj.equals(zdsjActual)) {  
4241 - if (zdsj.compareTo(zdsjActual) > 0) {  
4242 - maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
4243 - maps.put("slow", "");  
4244 - } else {  
4245 - maps.put("fast", "");  
4246 - maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));  
4247 - } 4247 + maps = new HashMap<String, Object>();
  4248 + try {
  4249 + scheduleRealInfo.setjName(scheduleRealInfo.getjGh() + scheduleRealInfo.getjName());
  4250 + scheduleRealInfo.setsName(scheduleRealInfo.getsGh() + scheduleRealInfo.getsName());
  4251 + maps = rru.getMapValue(scheduleRealInfo);
  4252 + String zdsj = scheduleRealInfo.getZdsj();
  4253 + String zdsjActual = scheduleRealInfo.getZdsjActual();
  4254 + if (zdsj != null && zdsjActual != null &&
  4255 + !zdsj.equals(zdsjActual)) {
  4256 + if (zdsj.compareTo(zdsjActual) > 0) {
  4257 + maps.put("fast", TimeUtils.getTimeDifference(zdsj, zdsjActual));
  4258 + maps.put("slow", "");
4248 } else { 4259 } else {
4249 maps.put("fast", ""); 4260 maps.put("fast", "");
4250 - maps.put("slow", ""); 4261 + maps.put("slow", TimeUtils.getTimeDifference(zdsj, zdsjActual));
4251 } 4262 }
4252 - listMap.add(maps);  
4253 - } catch (Exception e) {  
4254 - e.printStackTrace(); 4263 + } else {
  4264 + maps.put("fast", "");
  4265 + maps.put("slow", "");
4255 } 4266 }
  4267 + listMap.add(maps);
  4268 + } catch (Exception e) {
  4269 + e.printStackTrace();
  4270 + }
4256 } 4271 }
4257 4272
4258 - 4273 +
4259 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; 4274 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
4260 4275
4261 list.add(listMap.iterator()); 4276 list.add(listMap.iterator());
@@ -4263,7 +4278,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4263,7 +4278,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4263 path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); 4278 path + "export/" + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
4264 // return scheduleRealInfos; 4279 // return scheduleRealInfos;
4265 } 4280 }
4266 - 4281 +
4267 @Override 4282 @Override
4268 public Map<String, Object> exportWaybillMore(Map<String, Object> map) { 4283 public Map<String, Object> exportWaybillMore(Map<String, Object> map) {
4269 String date = map.get("date").toString(); 4284 String date = map.get("date").toString();
@@ -4287,17 +4302,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf @@ -4287,17 +4302,17 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
4287 file.mkdirs(); 4302 file.mkdirs();
4288 List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date); 4303 List<ScheduleRealInfo> lists_line=scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
4289 for (List<String> list : lists) { 4304 for (List<String> list : lists) {
4290 - List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); 4305 + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>();
4291 String jName = list.get(0); 4306 String jName = list.get(0);
4292 String clZbh = list.get(1); 4307 String clZbh = list.get(1);
4293 String lpName = list.get(2); 4308 String lpName = list.get(2);
4294 String jGh =list.get(3); 4309 String jGh =list.get(3);
4295 for (int i = 0; i < lists_line.size(); i++) { 4310 for (int i = 0; i < lists_line.size(); i++) {
4296 - ScheduleRealInfo s=lists_line.get(i);  
4297 - if(s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){  
4298 - newList.add(s);  
4299 - }  
4300 - } 4311 + ScheduleRealInfo s=lists_line.get(i);
  4312 + if(s.getjGh().equals(jGh) && s.getClZbh().equals(clZbh) && s.getLpName().equals(lpName)){
  4313 + newList.add(s);
  4314 + }
  4315 + }
4301 this.exportWaybill_pl(newList, date, jName, clZbh, lpName); 4316 this.exportWaybill_pl(newList, date, jName, clZbh, lpName);
4302 File temp = new File(path + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls"); 4317 File temp = new File(path + date + "-" + jName + "-" + clZbh + "-" + lpName + "-行车路单.xls");
4303 String fileName = file.getName(); 4318 String fileName = file.getName();
src/main/java/com/bsth/service/report/impl/CulateMileageServiceImpl.java
@@ -558,7 +558,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{ @@ -558,7 +558,7 @@ public class CulateMileageServiceImpl implements CulateMileageService{
558 //有子任务 558 //有子任务
559 if (cts != null && cts.size() > 0) { 559 if (cts != null && cts.size() > 0) {
560 for(ChildTaskPlan c : cts){ 560 for(ChildTaskPlan c : cts){
561 - if(c.isDestroy() && c.getDestroyReason().equals(item)) 561 + if(c.isDestroy() && (c.getDestroyReason()==null?"": c.getDestroyReason()).equals(item))
562 sum = Arith.add(sum, c.getMileage()); 562 sum = Arith.add(sum, c.getMileage());
563 } 563 }
564 } 564 }
src/main/java/com/bsth/service/schedule/PeopleCarPlanService.java
@@ -11,9 +11,13 @@ public interface PeopleCarPlanService { @@ -11,9 +11,13 @@ public interface PeopleCarPlanService {
11 11
12 Map<String, Object> scheduleAnaly(Map<String, Object> map); 12 Map<String, Object> scheduleAnaly(Map<String, Object> map);
13 13
  14 + Map<String, Object> scheduleAnaly_sum(Map<String, Object> map);
  15 +
14 List<Map<String, Object>> getModel(Map<String, Object> map); 16 List<Map<String, Object>> getModel(Map<String, Object> map);
15 17
16 List<Map<String, Object>> firstAndLastBus(Map<String, Object> map); 18 List<Map<String, Object>> firstAndLastBus(Map<String, Object> map);
17 19
  20 + List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map);
  21 +
18 List<Map<String, Object>> commandState(Map<String, Object> map); 22 List<Map<String, Object>> commandState(Map<String, Object> map);
19 } 23 }
src/main/java/com/bsth/service/schedule/SchedulePlanInfoService.java
@@ -17,6 +17,13 @@ import java.util.List; @@ -17,6 +17,13 @@ import java.util.List;
17 public interface SchedulePlanInfoService extends BService<SchedulePlanInfo, Long> { 17 public interface SchedulePlanInfoService extends BService<SchedulePlanInfo, Long> {
18 18
19 /** 19 /**
  20 + * 查找最近的排班的日期。
  21 + * @param xlId 线路Id
  22 + * @return
  23 + */
  24 + List<Date> findLastestPlanDate(Integer xlId);
  25 +
  26 + /**
20 * 查找排班计划汇总数据。 27 * 查找排班计划汇总数据。
21 * @param xlId 线路Id 28 * @param xlId 线路Id
22 * @param scheduleDate 排班时间 29 * @param scheduleDate 排班时间
src/main/java/com/bsth/service/schedule/PeopleCarPlanServiceImpl.java renamed to src/main/java/com/bsth/service/schedule/impl/PeopleCarPlanServiceImpl.java
1 -package com.bsth.service.schedule; 1 +package com.bsth.service.schedule.impl;
  2 +
  3 +import com.bsth.entity.realcontrol.ScheduleRealInfo;
  4 +import com.bsth.entity.schedule.SchedulePlanInfo;
  5 +import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  6 +import com.bsth.util.ReportUtils;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.jdbc.core.JdbcTemplate;
  9 +import org.springframework.jdbc.core.RowMapper;
  10 +import org.springframework.stereotype.Service;
2 11
3 import java.math.BigDecimal; 12 import java.math.BigDecimal;
4 -import java.net.URLEncoder;  
5 import java.sql.ResultSet; 13 import java.sql.ResultSet;
6 import java.sql.SQLException; 14 import java.sql.SQLException;
7 import java.text.DecimalFormat; 15 import java.text.DecimalFormat;
8 import java.text.NumberFormat; 16 import java.text.NumberFormat;
9 import java.text.ParseException; 17 import java.text.ParseException;
10 import java.text.SimpleDateFormat; 18 import java.text.SimpleDateFormat;
11 -import java.util.ArrayList;  
12 -import java.util.Collections;  
13 -import java.util.Date;  
14 -import java.util.HashMap;  
15 -import java.util.HashSet;  
16 -import java.util.Iterator;  
17 -import java.util.List;  
18 -import java.util.Map;  
19 -import java.util.Set; 19 +import java.util.*;
  20 +
20 21
21 import org.springframework.beans.factory.annotation.Autowired; 22 import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.jdbc.core.JdbcTemplate; 23 import org.springframework.jdbc.core.JdbcTemplate;
@@ -26,6 +27,7 @@ import org.springframework.stereotype.Service; @@ -26,6 +27,7 @@ import org.springframework.stereotype.Service;
26 import com.bsth.entity.realcontrol.ScheduleRealInfo; 27 import com.bsth.entity.realcontrol.ScheduleRealInfo;
27 import com.bsth.entity.schedule.SchedulePlanInfo; 28 import com.bsth.entity.schedule.SchedulePlanInfo;
28 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; 29 import com.bsth.repository.realcontrol.ScheduleRealInfoRepository;
  30 +import com.bsth.service.schedule.PeopleCarPlanService;
29 import com.bsth.util.ReportUtils; 31 import com.bsth.util.ReportUtils;
30 32
31 @Service 33 @Service
@@ -760,7 +762,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -760,7 +762,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
760 return modelMap; 762 return modelMap;
761 } 763 }
762 764
763 - @Override 765 +// @Override
764 public Map<String, Object> scheduleAnaly_sum(Map<String, Object> map) { 766 public Map<String, Object> scheduleAnaly_sum(Map<String, Object> map) {
765 DecimalFormat df = new DecimalFormat("00"); 767 DecimalFormat df = new DecimalFormat("00");
766 NumberFormat nf = NumberFormat.getNumberInstance(); 768 NumberFormat nf = NumberFormat.getNumberInstance();
@@ -1141,6 +1143,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1141,6 +1143,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1141 for(ScheduleRealInfo schedule : list){ 1143 for(ScheduleRealInfo schedule : list){
1142 if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out")) 1144 if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out"))
1143 continue; 1145 continue;
  1146 + if(schedule.getStatus() == -1){
  1147 + continue;
  1148 + }
1144 String key = schedule.getXlName(); 1149 String key = schedule.getXlName();
1145 if(key == null || key.trim().length() == 0) 1150 if(key == null || key.trim().length() == 0)
1146 continue; 1151 continue;
@@ -1174,9 +1179,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1174,9 +1179,7 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1174 longList1.add(min); 1179 longList1.add(min);
1175 } 1180 }
1176 } 1181 }
1177 - if(longList0.size() == 0 || longList1.size() == 0){  
1178 - continue;  
1179 - } 1182 +
1180 if(longList0.size() != 0){ 1183 if(longList0.size() != 0){
1181 Collections.sort(longList0); 1184 Collections.sort(longList0);
1182 ScheduleRealInfo shouban0 = temp0.get(longList0.get(0)); 1185 ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));
@@ -1294,8 +1297,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1294,8 +1297,10 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1294 return resList; 1297 return resList;
1295 } 1298 }
1296 1299
1297 - @Override 1300 +// @Override
1298 public List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map) { 1301 public List<Map<String, Object>> firstAndLastBus_sum(Map<String, Object> map) {
  1302 + NumberFormat nf = NumberFormat.getNumberInstance();
  1303 + nf.setMinimumFractionDigits(2);
1299 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); 1304 List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
1300 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>(); 1305 Map<String, List<ScheduleRealInfo>> keyMap = new HashMap<String, List<ScheduleRealInfo>>();
1301 1306
@@ -1313,6 +1318,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1313,6 +1318,9 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1313 for(ScheduleRealInfo schedule : list){ 1318 for(ScheduleRealInfo schedule : list){
1314 if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out")) 1319 if(schedule.getBcType().equals("in") || schedule.getBcType().equals("out"))
1315 continue; 1320 continue;
  1321 + if(schedule.getStatus() == -1){
  1322 + continue;
  1323 + }
1316 String key = schedule.getXlName(); 1324 String key = schedule.getXlName();
1317 if(key == null || key.trim().length() == 0) 1325 if(key == null || key.trim().length() == 0)
1318 continue; 1326 continue;
@@ -1346,80 +1354,68 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService { @@ -1346,80 +1354,68 @@ public class PeopleCarPlanServiceImpl implements PeopleCarPlanService {
1346 longList1.add(min); 1354 longList1.add(min);
1347 } 1355 }
1348 } 1356 }
1349 - if(longList0.size() == 0 || longList1.size() == 0){  
1350 - continue; 1357 +
  1358 + int jhbc = 0;
  1359 + int sjbc = 0;
  1360 +
  1361 + if(longList0.size() != 0){
  1362 + Collections.sort(longList0);
  1363 + ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));
  1364 + ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1));
  1365 + if(shouban0.getFcsjActual() != null){
  1366 + jhbc++;
  1367 + String[] split = shouban0.getFcsjActual().split(":");
  1368 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1369 + long delay = shouban0.getFcsjT() - min;
  1370 + if(delay >= -3 && delay <= 1){
  1371 + sjbc++;
  1372 + }
  1373 + }
  1374 +
  1375 + if(moban0.getFcsjActual() != null){
  1376 + jhbc++;
  1377 + String[] split = moban0.getFcsjActual().split(":");
  1378 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1379 + long delay = moban0.getFcsjT() - min;
  1380 + if(delay >= -3 && delay <= 1){
  1381 + sjbc++;
  1382 + }
  1383 + }
  1384 + }
  1385 +
  1386 + if(longList1.size() != 0){
  1387 + Collections.sort(longList1);
  1388 + ScheduleRealInfo shouban1 = temp1.get(longList1.get(0));
  1389 + ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1));
  1390 + if(shouban1.getFcsjActual() != null){
  1391 + jhbc++;
  1392 + String[] split = shouban1.getFcsjActual().split(":");
  1393 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1394 + long delay = shouban1.getFcsjT() - min;
  1395 + if(delay >= -3 && delay <= 1){
  1396 + sjbc++;
  1397 + }
  1398 + }
  1399 + if(moban1.getFcsjActual() != null){
  1400 + jhbc++;
  1401 + String[] split = moban1.getFcsjActual().split(":");
  1402 + long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);
  1403 + long delay = moban1.getFcsjT() - min;
  1404 + if(delay >= -3 && delay <= 1){
  1405 + sjbc++;
  1406 + }
  1407 + }
1351 } 1408 }
1352 - Collections.sort(longList0);  
1353 - Collections.sort(longList1);  
1354 - ScheduleRealInfo shouban0 = temp0.get(longList0.get(0));  
1355 - ScheduleRealInfo moban0 = temp0.get(longList0.get(longList0.size() - 1));  
1356 - ScheduleRealInfo shouban1 = temp1.get(longList1.get(0));  
1357 - ScheduleRealInfo moban1 = temp1.get(longList1.get(longList1.size() - 1)); 1409 +
  1410 + tempMap.put("jhbc", jhbc);
  1411 + tempMap.put("sjbc", sjbc);
  1412 + tempMap.put("zdl", nf.format((float) sjbc / jhbc *100) + "%");
1358 tempMap.put("date", date); 1413 tempMap.put("date", date);
1359 tempMap.put("company", companyName); 1414 tempMap.put("company", companyName);
1360 tempMap.put("subCompany", subCompanyName); 1415 tempMap.put("subCompany", subCompanyName);
1361 tempMap.put("line", key); 1416 tempMap.put("line", key);
1362 - tempMap.put("qdzFirst0", shouban0.getQdzName());  
1363 - tempMap.put("jhfcFirst0", shouban0.getFcsj());  
1364 - tempMap.put("qdzLast0", moban0.getQdzName());  
1365 - tempMap.put("jhfcLast0", moban0.getFcsj());  
1366 - tempMap.put("qdzFirst1", shouban1.getQdzName());  
1367 - tempMap.put("jhfcFirst1", shouban1.getFcsj());  
1368 - tempMap.put("qdzLast1", moban1.getQdzName());  
1369 - tempMap.put("jhfcLast1", moban1.getFcsj());  
1370 - if(shouban0.getFcsjActual() != null){  
1371 - String[] split = shouban0.getFcsjActual().split(":");  
1372 - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);  
1373 - long delay = shouban0.getFcsjT() - min;  
1374 - tempMap.put("sjfcFirst0", shouban0.getFcsjActual());  
1375 - if(delay > 0)  
1376 - tempMap.put("delayFirst0", "+" + delay);  
1377 - else  
1378 - tempMap.put("delayFirst0", delay);  
1379 - } else {  
1380 - tempMap.put("sjfcFirst0", "/");  
1381 - tempMap.put("delayFirst0", "/");  
1382 - }  
1383 - if(moban0.getFcsjActual() != null){  
1384 - String[] split = moban0.getFcsjActual().split(":");  
1385 - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);  
1386 - long delay = moban0.getFcsjT() - min;  
1387 - tempMap.put("sjfcLast0", moban0.getFcsjActual());  
1388 - if(delay > 0)  
1389 - tempMap.put("delayLast0", "+" + delay);  
1390 - else  
1391 - tempMap.put("delayLast0", delay);  
1392 - } else {  
1393 - tempMap.put("sjfcLast0", "/");  
1394 - tempMap.put("delayLast0", "/");  
1395 - }  
1396 - if(shouban1.getFcsjActual() != null){  
1397 - String[] split = shouban1.getFcsjActual().split(":");  
1398 - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);  
1399 - long delay = shouban1.getFcsjT() - min;  
1400 - tempMap.put("sjfcFirst1", shouban1.getFcsjActual());  
1401 - if(delay > 0)  
1402 - tempMap.put("delayFirst1", "+" + delay);  
1403 - else  
1404 - tempMap.put("delayFirst1", delay);  
1405 - } else {  
1406 - tempMap.put("sjfcFirst1", "/");  
1407 - tempMap.put("delayFirst1", "/");  
1408 - }  
1409 - if(moban1.getFcsjActual() != null){  
1410 - String[] split = moban1.getFcsjActual().split(":");  
1411 - long min = Integer.valueOf(split[0])*60 + Integer.valueOf(split[1]);  
1412 - long delay = moban1.getFcsjT() - min;  
1413 - tempMap.put("sjfcLast1", moban1.getFcsjActual());  
1414 - if(delay > 0)  
1415 - tempMap.put("delayLast1", "+" + delay);  
1416 - else  
1417 - tempMap.put("delayLast1", delay);  
1418 - } else {  
1419 - tempMap.put("sjfcLast1", "/");  
1420 - tempMap.put("delayLast1", "/");  
1421 - }  
1422 resList.add(tempMap); 1417 resList.add(tempMap);
  1418 + System.out.println(tempMap);
1423 } 1419 }
1424 1420
1425 if(type.equals("export")){ 1421 if(type.equals("export")){
src/main/java/com/bsth/service/schedule/impl/SchedulePlanInfoServiceImpl.java
@@ -5,6 +5,7 @@ import com.bsth.repository.schedule.SchedulePlanInfoRepository; @@ -5,6 +5,7 @@ import com.bsth.repository.schedule.SchedulePlanInfoRepository;
5 import com.bsth.service.schedule.SchedulePlanInfoService; 5 import com.bsth.service.schedule.SchedulePlanInfoService;
6 import org.springframework.beans.factory.annotation.Autowired; 6 import org.springframework.beans.factory.annotation.Autowired;
7 import org.springframework.jdbc.core.JdbcTemplate; 7 import org.springframework.jdbc.core.JdbcTemplate;
  8 +import org.springframework.jdbc.core.RowCallbackHandler;
8 import org.springframework.jdbc.core.RowMapper; 9 import org.springframework.jdbc.core.RowMapper;
9 import org.springframework.stereotype.Service; 10 import org.springframework.stereotype.Service;
10 import org.springframework.transaction.annotation.Transactional; 11 import org.springframework.transaction.annotation.Transactional;
@@ -25,6 +26,26 @@ public class SchedulePlanInfoServiceImpl extends BServiceImpl&lt;SchedulePlanInfo, @@ -25,6 +26,26 @@ public class SchedulePlanInfoServiceImpl extends BServiceImpl&lt;SchedulePlanInfo,
25 private JdbcTemplate jdbcTemplate; 26 private JdbcTemplate jdbcTemplate;
26 27
27 @Override 28 @Override
  29 + public List<Date> findLastestPlanDate(Integer xlId) {
  30 + String sql = "select max(schedule_date) as sd from bsth_c_s_sp_info " +
  31 + "where xl = ?";
  32 +
  33 + final List<Date> ld = new ArrayList<>();
  34 +
  35 + jdbcTemplate.query(sql, new Object[]{xlId}, new RowCallbackHandler() {
  36 + @Override
  37 + public void processRow(ResultSet rs) throws SQLException {
  38 + if (rs != null && rs.getDate("sd") != null) {
  39 + ld.add(new Date(rs.getDate("sd").getTime()));
  40 + }
  41 + }
  42 + });
  43 +
  44 + return ld;
  45 +
  46 + }
  47 +
  48 + @Override
28 public List<SchedulePlanGroupInfo> findSchedulePlanGroupInfo(Integer xlId, Date scheduleDate) { 49 public List<SchedulePlanGroupInfo> findSchedulePlanGroupInfo(Integer xlId, Date scheduleDate) {
29 String sql = SchedulePlanGroupInfo.generateSelectSql(); 50 String sql = SchedulePlanGroupInfo.generateSelectSql();
30 List<SchedulePlanGroupInfo> schedulePlanGroupInfos = jdbcTemplate.query(sql, new Object[]{xlId, scheduleDate}, new RowMapper<SchedulePlanGroupInfo>() { 51 List<SchedulePlanGroupInfo> schedulePlanGroupInfos = jdbcTemplate.query(sql, new Object[]{xlId, scheduleDate}, new RowMapper<SchedulePlanGroupInfo>() {
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
@@ -28,6 +28,9 @@ import org.slf4j.Logger; @@ -28,6 +28,9 @@ import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory; 28 import org.slf4j.LoggerFactory;
29 import org.springframework.beans.factory.annotation.Autowired; 29 import org.springframework.beans.factory.annotation.Autowired;
30 import org.springframework.stereotype.Service; 30 import org.springframework.stereotype.Service;
  31 +import org.springframework.transaction.annotation.Isolation;
  32 +import org.springframework.transaction.annotation.Propagation;
  33 +import org.springframework.transaction.annotation.Transactional;
31 34
32 import java.util.*; 35 import java.util.*;
33 36
@@ -318,6 +321,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im @@ -318,6 +321,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl&lt;SchedulePlan, Long&gt; im
318 321
319 } 322 }
320 323
  324 + @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
321 public SchedulePlan save(SchedulePlan schedulePlan) { 325 public SchedulePlan save(SchedulePlan schedulePlan) {
322 // pre、如果排班的数据之前已经有了,删除之前的数据 326 // pre、如果排班的数据之前已经有了,删除之前的数据
323 Date startpre = new Date(); 327 Date startpre = new Date();
src/main/java/com/bsth/websocket/handler/RealControlSocketHandler.java
@@ -6,29 +6,29 @@ import com.bsth.data.BasicData; @@ -6,29 +6,29 @@ import com.bsth.data.BasicData;
6 import com.google.common.base.Splitter; 6 import com.google.common.base.Splitter;
7 import org.slf4j.Logger; 7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory; 8 import org.slf4j.LoggerFactory;
9 -import org.springframework.context.annotation.Scope;  
10 import org.springframework.stereotype.Component; 9 import org.springframework.stereotype.Component;
11 import org.springframework.web.socket.*; 10 import org.springframework.web.socket.*;
12 11
13 -import java.util.*; 12 +import java.util.ArrayList;
  13 +import java.util.Collection;
  14 +import java.util.Iterator;
  15 +import java.util.List;
14 import java.util.concurrent.ConcurrentHashMap; 16 import java.util.concurrent.ConcurrentHashMap;
  17 +import java.util.concurrent.CopyOnWriteArrayList;
15 18
16 /** 19 /**
17 * @author PanZhao 20 * @author PanZhao
18 */ 21 */
19 @Component 22 @Component
20 -@Scope("prototype")  
21 public class RealControlSocketHandler implements WebSocketHandler { 23 public class RealControlSocketHandler implements WebSocketHandler {
22 24
23 Logger logger = LoggerFactory.getLogger(this.getClass()); 25 Logger logger = LoggerFactory.getLogger(this.getClass());
24 26
25 private static ArrayList<WebSocketSession> users; 27 private static ArrayList<WebSocketSession> users;
26 - //private static final ArrayListMultimap<String, WebSocketSession> listenMap;  
27 - private static ConcurrentHashMap<String, List<WebSocketSession>> listenMap; 28 + private static ConcurrentHashMap<String, CopyOnWriteArrayList<WebSocketSession>> listenMap;
28 29
29 static { 30 static {
30 users = new ArrayList<WebSocketSession>(); 31 users = new ArrayList<WebSocketSession>();
31 - //listenMap = ArrayListMultimap.create();  
32 listenMap = new ConcurrentHashMap(); 32 listenMap = new ConcurrentHashMap();
33 } 33 }
34 34
@@ -37,30 +37,13 @@ public class RealControlSocketHandler implements WebSocketHandler { @@ -37,30 +37,13 @@ public class RealControlSocketHandler implements WebSocketHandler {
37 throws Exception { 37 throws Exception {
38 users.remove(session); 38 users.remove(session);
39 //清理监听 39 //清理监听
40 - //Set<String> keys = listenMap.keySet();  
41 - //Map<String, WebSocketSession> remMap = new HashMap<>();  
42 -  
43 int vsCount=0; 40 int vsCount=0;
44 - Collection<List<WebSocketSession>> vs = listenMap.values();  
45 - for(List<WebSocketSession> list : vs){ 41 + Collection<CopyOnWriteArrayList<WebSocketSession>> vs = listenMap.values();
  42 + for(CopyOnWriteArrayList<WebSocketSession> list : vs){
46 list.remove(session); 43 list.remove(session);
47 44
48 vsCount += list.size(); 45 vsCount += list.size();
49 } 46 }
50 - /*List<WebSocketSession> vs;  
51 - for(String k : keys){  
52 - //vs = listenMap.get(k);  
53 - //vs.remove(session);  
54 - listenMap.get(k).remove()  
55 - *//*if(listenMap.get(k).contains(session))  
56 - remMap.put(k, session);*//*  
57 - }*/  
58 -  
59 - /*Set<String> remSet = remMap.keySet();  
60 - for(String k : remSet){  
61 - listenMap.remove(k, remMap.get(k));  
62 - logger.info("web socket close, remove listen K: "+ k);  
63 - }*/  
64 logger.info("listen values size: " + vsCount + " -CloseStatus:" + arg1); 47 logger.info("listen values size: " + vsCount + " -CloseStatus:" + arg1);
65 } 48 }
66 49
@@ -81,7 +64,7 @@ public class RealControlSocketHandler implements WebSocketHandler { @@ -81,7 +64,7 @@ public class RealControlSocketHandler implements WebSocketHandler {
81 for(String lineCode : idx){ 64 for(String lineCode : idx){
82 if(BasicData.lineCode2NameMap.containsKey(lineCode)){ 65 if(BasicData.lineCode2NameMap.containsKey(lineCode)){
83 if(!listenMap.containsKey(lineCode)){ 66 if(!listenMap.containsKey(lineCode)){
84 - listenMap.put(lineCode, new ArrayList<WebSocketSession>()); 67 + listenMap.put(lineCode, new CopyOnWriteArrayList<WebSocketSession>());
85 } 68 }
86 listenMap.get(lineCode).add(session); 69 listenMap.get(lineCode).add(session);
87 } 70 }
src/main/resources/application-dev.properties
@@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy @@ -8,9 +8,9 @@ spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy
8 spring.jpa.database= MYSQL 8 spring.jpa.database= MYSQL
9 spring.jpa.show-sql= true 9 spring.jpa.show-sql= true
10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver 10 spring.datasource.driver-class-name= com.mysql.jdbc.Driver
11 -spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false 11 +spring.datasource.url= jdbc:mysql://127.0.0.1/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
12 spring.datasource.username= root 12 spring.datasource.username= root
13 -spring.datasource.password= 13 +spring.datasource.password= panzhao
14 #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false 14 #spring.datasource.url= jdbc:mysql://192.168.168.117/pd_control?useUnicode=true&characterEncoding=utf-8&useSSL=false
15 #spring.datasource.username= root 15 #spring.datasource.username= root
16 #spring.datasource.password= root 16 #spring.datasource.password= root
@@ -29,15 +29,7 @@ spring.datasource.validation-query=select 1 @@ -29,15 +29,7 @@ spring.datasource.validation-query=select 1
29 ## 29 ##
30 #222.66.0.204:5555 30 #222.66.0.204:5555
31 ##\u5B9E\u65F6gps 31 ##\u5B9E\u65F6gps
32 -#http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/ 32 +http.gps.real.url= http://114.80.178.12:18080/transport_server/rtgps/
33 #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/ 33 #http.gps.real.url= http://27.115.69.123:8800/transport_server/rtgps/
34 ##\u6D88\u606F\u4E0B\u53D1 34 ##\u6D88\u606F\u4E0B\u53D1
35 http.send.directive = http://192.168.168.201:9090/transport_server/message/ 35 http.send.directive = http://192.168.168.201:9090/transport_server/message/
36 -  
37 -  
38 -## gps client  
39 -gps.server.pd=114.80.178.12  
40 -gps.port.pd=8899  
41 -gps.server.pf=180.166.5.82  
42 -gps.port.pf=9030  
43 -forward.device.name=client98  
44 \ No newline at end of file 36 \ No newline at end of file
src/main/resources/rules/validplan.drl 0 → 100644
  1 +// TODO:
0 \ No newline at end of file 2 \ 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/mould/scheduleAnaly_sum.xls 0 → 100644
No preview for this file type
src/main/resources/static/pages/forms/statement/firstAndLastBus.html
@@ -64,6 +64,7 @@ @@ -64,6 +64,7 @@
64 <th colspan="4">下行末发</th> 64 <th colspan="4">下行末发</th>
65 </tr> 65 </tr>
66 <tr class="hidden"> 66 <tr class="hidden">
  67 + <th style="display: none;"></th>
67 <th>站点</th> 68 <th>站点</th>
68 <th>计发</th> 69 <th>计发</th>
69 <th>实发</th> 70 <th>实发</th>
src/main/resources/static/pages/forms/statement/firstAndLastBus_sum.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 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>线路首末班准点率</h1>
  22 + </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;margin-left: 10px;" id="company1">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="company" style="width: 160px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 10px;" id="subCompany1">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
  37 + </div>
  38 + <div style="display: inline-block;margin-left: 10px;">
  39 + <span class="item-label" style="width: 80px;">线路: </span>
  40 + <select class="form-control" name="line" id="line" style="width: 160px;"></select>
  41 + </div>
  42 + <div style="display: inline-block;margin-left: 10px;">
  43 + <span class="item-label" style="width: 80px;">时间: </span>
  44 + <input class="form-control" type="text" id="date" style="width: 160px;"/>
  45 + </div>
  46 + <div class="form-group">
  47 + <input class="btn btn-default" type="button" id="query" value="筛选"/>
  48 + <input class="btn btn-default" type="button" id="export" value="导出"/>
  49 + </div>
  50 + </form>
  51 + </div>
  52 + <div class="portlet-body">
  53 + <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 906px">
  54 + <table class="table table-bordered table-hover table-checkable" id="forms">
  55 + <thead>
  56 + <tr class="hidden">
  57 + <th>日期</th>
  58 + <th>公司</th>
  59 + <th>分公司</th>
  60 + <th>线路</th>
  61 + <th>计划首末班次数</th>
  62 + <th>实际准点首末班次数</th>
  63 + <th>首末班准点率</th>
  64 + </tr>
  65 + </thead>
  66 + <tbody>
  67 +
  68 + </tbody>
  69 + </table>
  70 + <div style="text-align: right;">
  71 + <ul id="pagination" class="pagination"></ul>
  72 + </div>
  73 + </div>
  74 + </div>
  75 + </div>
  76 + </div>
  77 +</div>
  78 +
  79 +<script>
  80 + $(function(){
  81 + $('#export').attr('disabled', "true");
  82 +
  83 + // 关闭左侧栏
  84 + if (!$('body').hasClass('page-sidebar-closed'))
  85 + $('.menu-toggler.sidebar-toggler').click();
  86 +
  87 + $("#date").datetimepicker({
  88 + format : 'YYYY-MM-DD',
  89 + locale : 'zh-cn'
  90 + });
  91 +
  92 + var d = new Date();
  93 + var year = d.getFullYear();
  94 + var month = d.getMonth() + 1;
  95 + var day = d.getDate();
  96 + if(month < 10)
  97 + month = "0" + month;
  98 + if(day < 10)
  99 + day = "0" + day;
  100 + $("#date").val(year + "-" + month + "-" + day);
  101 +
  102 + var fage=false;
  103 + var xlList;
  104 + var obj = [];
  105 +
  106 + $.get('/report/lineList',function(result){
  107 + xlList=result;
  108 + $.get('/user/companyData', function(result){
  109 + obj = result;
  110 + var options = '';
  111 + for(var i = 0; i < obj.length; i++){
  112 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  113 + }
  114 +
  115 + if(obj.length ==0){
  116 + $("#company1").css('display','none');
  117 + }else if(obj.length ==1){
  118 + $("#company1").css('display','none');
  119 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  120 + $('#subCompany1').css('display','none');
  121 + }
  122 + $('#company').html(options);
  123 + updateCompany();
  124 + });
  125 + })
  126 + $("#company").on("change",updateCompany);
  127 + function updateCompany(){
  128 + var company = $('#company').val();
  129 + var options = '';
  130 + for(var i = 0; i < obj.length; i++){
  131 + if(obj[i].companyCode == company){
  132 + var children = obj[i].children;
  133 + for(var j = 0; j < children.length; j++){
  134 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  135 + }
  136 + }
  137 + }
  138 + $('#subCompany').html(options);
  139 + initXl();
  140 + }
  141 +
  142 + $("#subCompany").on("change",initXl);
  143 + function initXl(){
  144 + var data=[];
  145 + if(fage){
  146 + $("#line").select2("destroy").html('');
  147 + }
  148 + var fgs=$('#subCompany').val();
  149 + var gs=$('#company').val();
  150 + data.push({id: " ", text: "全部线路"});
  151 + for(var i=0;i<xlList.length;i++){
  152 + if(gs!=""){
  153 + if(fgs!=""){
  154 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  155 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  156 + }
  157 + }else{
  158 + if(xlList[i]["gsbm"]==gs){
  159 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  160 + }
  161 + }
  162 + }
  163 + }
  164 + initPinYinSelect2('#line',data,'');
  165 + fage=true;
  166 + }
  167 +
  168 +
  169 + $("#query").on("click",jsDoQuery);
  170 +
  171 + var company = $("#company").val();
  172 + var subCompany = $("#subCompany").val();
  173 + var line = $("#line").val();
  174 + var date = $("#date").val();
  175 + function jsDoQuery(pagination){
  176 + if($("#date").val() == null || $("#date").val().trim().length == 0){
  177 + layer.msg("请选择时间!");
  178 + return;
  179 + }
  180 + var params = {};
  181 + company = $("#company").val();
  182 + subCompany = $("#subCompany").val();
  183 + line = $("#line").val();
  184 + date = $("#date").val();
  185 + if(line == " ")
  186 + line = "";
  187 + params['company'] = company;
  188 + params['subCompany'] = subCompany;
  189 + params['line'] = line;
  190 + params['line'] = line;
  191 + params['date'] = date;
  192 + params['type'] = "query";
  193 + $(".hidden").removeClass("hidden");
  194 + $get('/pcpc/firstAndLastBus_sum', params, function(result){
  195 + // 把数据填充到模版中
  196 + var tbodyHtml = template('list_firstAndLastBus',{list:result});
  197 + // 把渲染好的模版html文本追加到表格中
  198 + $('#forms tbody').html(tbodyHtml);
  199 +
  200 + if(result.length == 0)
  201 + $("#export").attr('disabled',"true");
  202 + else
  203 + $("#export").removeAttr("disabled");
  204 + });
  205 + }
  206 +
  207 + $("#export").on("click",function(){
  208 + var params = {};
  209 + params['company'] = company;
  210 + params['subCompany'] = subCompany;
  211 + params['line'] = line;
  212 + params['line'] = line;
  213 + params['date'] = date;
  214 + params['type'] = "export";
  215 + $get('/pcpc/firstAndLastBus', params, function(result){
  216 + window.open("/downloadFile/download?fileName=线路首末班"+moment(date).format("YYYYMMDD"));
  217 + });
  218 + });
  219 +
  220 +
  221 + });
  222 +
  223 +</script>
  224 +<script type="text/html" id="list_firstAndLastBus">
  225 + {{each list as obj i}}
  226 + <tr>
  227 + <td>{{obj.date}}</td>
  228 + <td>{{obj.company}}</td>
  229 + <td>{{obj.subCompany}}</td>
  230 + <td>{{obj.line}}</td>
  231 + <td>{{obj.jhbc}}</td>
  232 + <td>{{obj.sjbc}}</td>
  233 + <td>{{obj.zdl}}</td>
  234 + </tr>
  235 + {{/each}}
  236 + {{if list.length == 0}}
  237 + <tr>
  238 + <td colspan="20"><h6 class="muted">没有找到相关数据</h6></td>
  239 + </tr>
  240 + {{/if}}
  241 +</script>
0 \ No newline at end of file 242 \ No newline at end of file
src/main/resources/static/pages/forms/statement/scheduleAnaly_sum.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 +</style>
  18 +
  19 +<div class="page-head">
  20 + <div class="page-title">
  21 + <h1>时刻表分析</h1>
  22 + </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;margin-left: 38px;" id="company1">
  31 + <span class="item-label" style="width: 80px;">公司: </span>
  32 + <select class="form-control" name="company" id="company" style="width: 160px;"></select>
  33 + </div>
  34 + <div style="display: inline-block;margin-left: 24px;" id="subCompany1">
  35 + <span class="item-label" style="width: 80px;">分公司: </span>
  36 + <select class="form-control" name="subCompany" id="subCompany" style="width: 160px;"></select>
  37 + </div>
  38 + <div style="display: inline-block;margin-left: 15px;">
  39 + <span class="item-label" style="width: 80px;">线路: </span>
  40 + <select class="form-control" name="line" id="line" style="width: 160px;"></select>
  41 + </div>
  42 + <div style="margin-top: 10px"></div>
  43 + <div style="display: inline-block;margin-left: 10px;">
  44 + <span class="item-label" style="width: 80px;">开始时间: </span>
  45 + <input class="form-control" type="text" id="startDate" style="width: 160px;"/>
  46 + </div>
  47 + <div style="display: inline-block;margin-left: 10px;">
  48 + <span class="item-label" style="width: 80px;">结束时间: </span>
  49 + <input class="form-control" type="text" id="endDate" style="width: 160px;"/>
  50 + </div>
  51 + <div style="display: inline-block;margin-left: 15px;">
  52 + <span class="item-label" style="width: 80px;">车辆: </span>
  53 + <select class="form-control" id="nbbm" style="width: 160px;"></select>
  54 + </div>
  55 +<!-- <div style="display: inline-block;margin-left: 10px;"> -->
  56 +<!-- <span class="item-label" style="width: 80px;">模板类型: </span> -->
  57 +<!-- <select class="form-control" name="model" id="model" style="width: 160px;"> -->
  58 +<!-- <option value="">请选择...</option> -->
  59 +<!-- </select> -->
  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" 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 class="hidden">
  72 + <th style="display: none;"></th>
  73 + <th>时间段</th>
  74 + <th>上行班次</th>
  75 + <th>下行班次</th>
  76 + <th>上行平均运送</th>
  77 + <th>下行平均运送</th>
  78 + <th>平均运送</th>
  79 + </tr>
  80 + </thead>
  81 + <tbody>
  82 +
  83 + </tbody>
  84 + </table>
  85 + <div style="text-align: right;">
  86 + <ul id="pagination" class="pagination"></ul>
  87 + </div>
  88 + </div>
  89 + </div>
  90 + </div>
  91 + </div>
  92 +</div>
  93 +
  94 +<script>
  95 + $(function(){
  96 + var page = 0, initPagination;
  97 + $('#export').attr('disabled', "true");
  98 +
  99 + // 关闭左侧栏
  100 + if (!$('body').hasClass('page-sidebar-closed'))
  101 + $('.menu-toggler.sidebar-toggler').click();
  102 +
  103 + $("#startDate").datetimepicker({
  104 + format : 'YYYY-MM-DD',
  105 + locale : 'zh-cn'
  106 + });
  107 +
  108 + $("#endDate").datetimepicker({
  109 + format : 'YYYY-MM-DD',
  110 + locale : 'zh-cn'
  111 + });
  112 +
  113 + var d = new Date();
  114 + var year = d.getFullYear();
  115 + var month = d.getMonth() + 1;
  116 + var day = d.getDate();
  117 + if(month < 10)
  118 + month = "0" + month;
  119 + if(day < 10)
  120 + day = "0" + day;
  121 + $("#startDate").val(year + "-" + month + "-" + day);
  122 + $("#endDate").val(year + "-" + month + "-" + day);
  123 +
  124 + var fage=false;
  125 + var xlList;
  126 + var obj = [];
  127 +
  128 + $.get('/report/lineList',function(result){
  129 + xlList=result;
  130 + $.get('/user/companyData', function(result){
  131 + obj = result;
  132 + var options = '';
  133 + for(var i = 0; i < obj.length; i++){
  134 + options += '<option value="'+obj[i].companyCode+'">'+obj[i].companyName+'</option>';
  135 + }
  136 +
  137 + if(obj.length ==0){
  138 + $("#company1").css('display','none');
  139 + }else if(obj.length ==1){
  140 + $("#company1").css('display','none');
  141 + if(obj[0].children.length == 1 || obj[0].children.length ==0)
  142 + $('#subCompany1').css('display','none');
  143 + }
  144 + $('#company').html(options);
  145 + updateCompany();
  146 + });
  147 + })
  148 + $("#company").on("change",updateCompany);
  149 + function updateCompany(){
  150 + var company = $('#company').val();
  151 + var options = '';
  152 + for(var i = 0; i < obj.length; i++){
  153 + if(obj[i].companyCode == company){
  154 + var children = obj[i].children;
  155 + for(var j = 0; j < children.length; j++){
  156 + options += '<option value="'+children[j].code+'">'+children[j].name+'</option>';
  157 + }
  158 + }
  159 + }
  160 + $('#subCompany').html(options);
  161 + initXl();
  162 + }
  163 +
  164 + $("#subCompany").on("change",initXl);
  165 + function initXl(){
  166 + var data=[];
  167 + if(fage){
  168 + $("#line").select2("destroy").html('');
  169 + }
  170 + var fgs=$('#subCompany').val();
  171 + var gs=$('#company').val();
  172 + for(var i=0;i<xlList.length;i++){
  173 + if(gs!=""){
  174 + if(fgs!=""){
  175 + if(xlList[i]["fgsbm"]==fgs && xlList[i]["gsbm"]==gs){
  176 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  177 + }
  178 + }else{
  179 + if(xlList[i]["gsbm"]==gs){
  180 + data.push({id: xlList[i]["xlbm"], text: xlList[i]["xlname"]});
  181 + }
  182 + }
  183 + }
  184 + }
  185 + initPinYinSelect2('#line',data,'');
  186 + line = data[0].id;
  187 + updateModel();
  188 + initCl();
  189 +
  190 + fage=true;
  191 + }
  192 +
  193 +
  194 + $("#query").on("click", function(){
  195 + page = 0;
  196 + jsDoQuery(true);
  197 + });
  198 +
  199 + var line = $("#line").val();
  200 + var startDate = $("#startDate").val();
  201 + var endDate = $("#endDate").val();
  202 + var model = $("#model").val();
  203 + var nbbm = "";
  204 + var company = $("#company").val();
  205 + var subCompany = $("#subCompany").val();
  206 + function jsDoQuery(pagination){
  207 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  208 + layer.msg("请选择时间范围!");
  209 + return;
  210 + }
  211 + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){
  212 + layer.msg("请选择时间范围!");
  213 + return;
  214 + }
  215 + var params = {};
  216 +// line = $("#line").val();
  217 + startDate = $("#startDate").val();
  218 + endDate = $("#endDate").val();
  219 +// model = $("#model").val();
  220 + nbbm = $("#nbbm").val()!=null?$("#nbbm").val():"";
  221 + company = $("#company").val();
  222 + subCompany = $("#subCompany").val();
  223 + params['page'] = page;
  224 + params['line'] = line;
  225 + params['startDate'] = startDate;
  226 + params['endDate'] = endDate;
  227 +// params['model'] = model;
  228 + params['company'] = company;
  229 + params['subCompany'] = subCompany;
  230 + params['nbbm'] = nbbm;
  231 + params['type'] = "query";
  232 + $(".hidden").removeClass("hidden");
  233 + $get('/pcpc/scheduleAnaly_sum', params, function(result){
  234 + // 把数据填充到模版中
  235 + var tbodyHtml = template('list_scheduleAnaly',{list:result.dataList});
  236 + // 把渲染好的模版html文本追加到表格中
  237 + $('#forms tbody').html(tbodyHtml);
  238 +
  239 + if(result.dataList.length == 0)
  240 + $("#export").attr('disabled',"true");
  241 + else
  242 + $("#export").removeAttr("disabled");
  243 +
  244 + });
  245 + }
  246 +
  247 + $("#export").on("click",function(){
  248 + if($("#startDate").val() == null || $("#startDate").val().trim().length == 0){
  249 + layer.msg("请选择时间范围!");
  250 + return;
  251 + }
  252 + if($("#endDate").val() == null || $("#endDate").val().trim().length == 0){
  253 + layer.msg("请选择时间范围!");
  254 + return;
  255 + }
  256 + var params = {};
  257 + params['page'] = page;
  258 + params['line'] = line;
  259 + params['startDate'] = startDate;
  260 + params['endDate'] = endDate;
  261 +// params['model'] = model;
  262 + params['company'] = company;
  263 + params['subCompany'] = subCompany;
  264 + params['nbbm'] = nbbm;
  265 + params['type'] = "export";
  266 + $get('/pcpc/scheduleAnaly_sum', params, function(result){
  267 + window.open("/downloadFile/download?fileName=时刻表分析(汇总)"+moment(startDate).format("YYYYMMDD")+"-"+moment(endDate).format("YYYYMMDD"));
  268 + });
  269 + });
  270 +
  271 +
  272 + $("#line").on("change", function(){
  273 + line = $("#line").val();
  274 + if(line == " ")
  275 + line = "";
  276 + updateModel();
  277 + });
  278 + $('#startDate').on("blur", function(){
  279 + startDate = $("#startDate").val();
  280 + endDate = $("#endDate").val();
  281 + updateModel();
  282 + });
  283 + $('#endDate').on("blur", function(){
  284 + startDate = $("#startDate").val();
  285 + endDate = $("#endDate").val();
  286 + updateModel();
  287 + });
  288 +
  289 + var flag = 0;
  290 + function updateModel(){
  291 + if(flag == 1)
  292 + return;
  293 + flag = 1;
  294 + var treeData = [];
  295 + var params = {};
  296 + params['line'] = line;
  297 + params['startDate'] = startDate;
  298 + params['endDate'] = endDate;
  299 + $get('/pcpc/getModel', params, function(result){
  300 + treeData = createTreeData(result);
  301 + var options = '<option value="">请选择...</option>';
  302 + var size = 0;
  303 + $.each(treeData, function(i, g){
  304 + options += '<option value="'+g.id+'">'+g.name+'</option>';
  305 + size++;
  306 + });
  307 + $('#model').html(options)/* .select2() */;
  308 + flag = 0;
  309 + });
  310 + }
  311 +
  312 + function initCl(){
  313 + $('#nbbm').select2({
  314 + placeholder: '搜索车辆...',
  315 + ajax: {
  316 + url: '/report/carList',
  317 + dataType: 'json',
  318 + delay: 150,
  319 + data: function(params){
  320 + return{nbbm: params.term,
  321 + gsbm:$('#gsdm').val(),
  322 + fgsbm:$('#fgsdm').val(),
  323 + xlbm:$('#line').val()};
  324 + },
  325 + processResults: function (data) {
  326 + return {
  327 + results: data
  328 + };
  329 + },
  330 + cache: true
  331 + },
  332 + templateResult: function(repo){
  333 + if (repo.loading) return repo.text;
  334 + var h = '<span>'+repo.text+'</span>';
  335 + h += (repo.lineName?'&nbsp;<span class="select2-desc">'+repo.lineName+'</span>':'');
  336 + return h;
  337 + },
  338 + escapeMarkup: function (markup) { return markup; },
  339 + minimumInputLength: 1,
  340 + templateSelection: function(repo){
  341 + return repo.text;
  342 + },
  343 + language: {
  344 + noResults: function(){
  345 + return '<span style="color:red;font-size: 12px;">没有搜索到车辆!</span>';
  346 + },
  347 + inputTooShort : function(e) {
  348 + return '<span style="color:gray;font-size: 12px;"><i class="fa fa-search"></i> 输入自编号搜索车辆</span>';
  349 + },
  350 + searching : function() {
  351 + return '<span style="color:gray;font-size: 12px;"> 正在搜索车辆...</span>';
  352 + }
  353 + }
  354 + });
  355 + };
  356 +
  357 +
  358 + });
  359 +
  360 +</script>
  361 +<script type="text/html" id="list_scheduleAnaly">
  362 + {{each list as obj i}}
  363 + <tr>
  364 + <th style="display: none;"></th>
  365 + <td>{{obj.time}}</td>
  366 + <td>{{obj.upbc}}</td>
  367 + <td>{{obj.dnbc}}</td>
  368 + <td>{{obj.upys}}</td>
  369 + <td>{{obj.dnys}}</td>
  370 + <td>{{obj.pjys}}</td>
  371 + </tr>
  372 + {{/each}}
  373 + {{if list.length == 0}}
  374 + <tr>
  375 + <td colspan="6"><h6 class="muted">没有找到相关数据</h6></td>
  376 + </tr>
  377 + {{/if}}
  378 +</script>
0 \ No newline at end of file 379 \ No newline at end of file
src/main/resources/static/pages/mforms/changetochanges/changetochange.html
@@ -70,14 +70,14 @@ @@ -70,14 +70,14 @@
70 class="form-control" type="text" id="endDate" 70 class="form-control" type="text" id="endDate"
71 style="width: 140px;" /> 71 style="width: 140px;" />
72 </div> 72 </div>
73 - <div style="display: inline-block; margin-left: 10px;">  
74 - <span class="item-label" style="width: 120px;">类型: </span> <select  
75 - class="form-control" id="sel">  
76 - <option value="">请选择</option>  
77 - <option value="1">换人</option>  
78 - <option value="2">换车</option>  
79 - </select>  
80 - </div> 73 +<!-- <div style="display: inline-block; margin-left: 10px;"> -->
  74 +<!-- <span class="item-label" style="width: 120px;">类型: </span> <select -->
  75 +<!-- class="form-control" id="sel"> -->
  76 +<!-- <option value="">请选择</option> -->
  77 +<!-- <option value="1">换人</option> -->
  78 +<!-- <option value="2">换车</option> -->
  79 +<!-- </select> -->
  80 +<!-- </div> -->
81 <div class="form-group"> 81 <div class="form-group">
82 <input class="btn btn-default" type="button" id="query" value="筛选" /> 82 <input class="btn btn-default" type="button" id="query" value="筛选" />
83 <input class="btn btn-default" type="button" id="export" 83 <input class="btn btn-default" type="button" id="export"
@@ -117,10 +117,8 @@ @@ -117,10 +117,8 @@
117 <tr> 117 <tr>
118 <td>车号</td> 118 <td>车号</td>
119 <td>车号</td> 119 <td>车号</td>
120 - <td>工号</td>  
121 - <td>人员</td>  
122 - <td>工号</td>  
123 - <td>人员</td> 120 + <td colspan="2">工号/人员</td>
  121 + <td colspan="2">工号/人员</td>
124 </tr> 122 </tr>
125 </thead> 123 </thead>
126 <tbody> 124 <tbody>
@@ -188,6 +186,7 @@ @@ -188,6 +186,7 @@
188 $("#fgsdmChange").on("change",initXl); 186 $("#fgsdmChange").on("change",initXl);
189 function initXl(){ 187 function initXl(){
190 var data=[]; 188 var data=[];
  189 + data.push({id: " ", text: "请选择"});
191 if(fage){ 190 if(fage){
192 $("#line").select2("destroy").html(''); 191 $("#line").select2("destroy").html('');
193 } 192 }
@@ -223,29 +222,15 @@ @@ -223,29 +222,15 @@
223 var gsdmChange= $("#gsdmChange").val(); 222 var gsdmChange= $("#gsdmChange").val();
224 var fgsdmChange= $("#fgsdmChange").val(); 223 var fgsdmChange= $("#fgsdmChange").val();
225 if (startDate1 != '' && endDate1 != '') { 224 if (startDate1 != '' && endDate1 != '') {
226 - $post('/mcy_forms/changetochange', { 225 + $get('/mcy_forms/changetochange', {
227 sel : sel, 226 sel : sel,
228 line : line, 227 line : line,
229 startDate : $("#startDate").val(), 228 startDate : $("#startDate").val(),
230 endDate : $("#endDate").val(), 229 endDate : $("#endDate").val(),
  230 + gsdm:gsdmChange,
  231 + fgsdm:fgsdmChange,
231 type : 'query' 232 type : 'query'
232 }, function(result) { 233 }, function(result) {
233 - startDate = $("#startDate").val();  
234 - endDate = $("#endDate").val();  
235 - $("#sDate").text(startDate);  
236 - $("#eDate").text(endDate);  
237 - var temp = {};  
238 - var today_account = 0;  
239 - temp["line"] = $("#line").text();  
240 - $.each(result, function(i, obj) {  
241 - if (moment(obj.schedule_date_str).format(  
242 - "YYYY-MM-DD") == moment(obj.startDate)  
243 - .format("YYYY-MM-DD")) {  
244 - today_account++;  
245 - }  
246 - obj.updateDate = moment(obj.startDate).format(  
247 - "YYYY-MM-DD HH:mm:ss");  
248 - });  
249 // 把数据填充到模版中 234 // 把数据填充到模版中
250 var tbodyHtml = template('changetochange', { 235 var tbodyHtml = template('changetochange', {
251 list : result 236 list : result
@@ -294,11 +279,9 @@ @@ -294,11 +279,9 @@
294 <td>{{obj.fssj}}</td> 279 <td>{{obj.fssj}}</td>
295 <td>{{obj.xgsj}}</td> 280 <td>{{obj.xgsj}}</td>
296 <td>{{obj.pcch}}</td> 281 <td>{{obj.pcch}}</td>
297 - <td>{{obj.pcry}}</td>  
298 - <td>{{obj.jhgh}}</td>  
299 - <td>{{obj.jhch}}</td>  
300 - <td>{{obj.sjgh}}</td>  
301 <td>{{obj.sjch}}</td> 282 <td>{{obj.sjch}}</td>
  283 + <td colspan="2">{{obj.pcry}}</td>
  284 + <td colspan="2">{{obj.sjgh}}</td>
302 <td>{{obj.yy}}</td> 285 <td>{{obj.yy}}</td>
303 <td>{{obj.xgr}}</td> 286 <td>{{obj.xgr}}</td>
304 </tr> 287 </tr>
src/main/resources/static/pages/scheduleApp/module/common/prj-common-globalservice.js
@@ -548,6 +548,24 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso @@ -548,6 +548,24 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
548 } 548 }
549 } 549 }
550 } 550 }
  551 + ),
  552 + latestsd: $resource(
  553 + '/spic/lastestsd/:xlid',
  554 + {},
  555 + {
  556 + list: {
  557 + method: 'GET',
  558 + isArray: true,
  559 + transformResponse: function(rs) {
  560 + var dst = angular.fromJson(rs);
  561 + if (dst.status == 'SUCCESS') {
  562 + return dst.data;
  563 + } else {
  564 + return dst; // 业务错误留给控制器处理
  565 + }
  566 + }
  567 + }
  568 + }
551 ) 569 )
552 570
553 571
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/list.html
1 <!-- ui-route employeeInfoManage.list --> 1 <!-- ui-route employeeInfoManage.list -->
2 <div ng-controller="SchedulePlanReportExtManageListCtrl as ctrl"> 2 <div ng-controller="SchedulePlanReportExtManageListCtrl as ctrl">
  3 +
  4 + <div class="portlet">
  5 + <div class="portlet-title">
  6 + <div class="caption caption-subject font-red-sunglo bold uppercase">
  7 + 最近排班至
  8 + <span ng-bind="ctrl.lsd | date: 'yyyy年MM月dd日'">
  9 + </span>
  10 + </div>
  11 + </div>
  12 + </div>
  13 +
3 <div class="fixDiv"> 14 <div class="fixDiv">
4 <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column" 15 <table class="fixTable table table-striped table-bordered table-hover table-checkable order-column"
5 style="width: 1800px; min-height: 500px;"> 16 style="width: 1800px; min-height: 500px;">
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/report/ext/module.js
@@ -46,6 +46,15 @@ angular.module(&#39;ScheduleApp&#39;).factory( @@ -46,6 +46,15 @@ angular.module(&#39;ScheduleApp&#39;).factory(
46 }, 46 },
47 47
48 /** 48 /**
  49 + * 查询线路最近排班日期。
  50 + * @param xlid
  51 + */
  52 + getLastestsd: function() {
  53 + var params = currentSearchCondition; // 查询条件
  54 + return service.latestsd.list(params).$promise;
  55 + },
  56 +
  57 + /**
49 * 批量保存排班明细。 58 * 批量保存排班明细。
50 * @param rs 59 * @param rs
51 */ 60 */
@@ -168,6 +177,8 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -168,6 +177,8 @@ angular.module(&#39;ScheduleApp&#39;).controller(
168 return service.resetSearchCondition(); 177 return service.resetSearchCondition();
169 }; 178 };
170 179
  180 + self.lsd;
  181 +
171 // 监控条件变化,触发查询 182 // 监控条件变化,触发查询
172 $scope.$watch( 183 $scope.$watch(
173 function() { 184 function() {
@@ -175,6 +186,22 @@ angular.module(&#39;ScheduleApp&#39;).controller( @@ -175,6 +186,22 @@ angular.module(&#39;ScheduleApp&#39;).controller(
175 }, 186 },
176 function(newValue, oldValue) { 187 function(newValue, oldValue) {
177 if (newValue) { 188 if (newValue) {
  189 + if (newValue.xlid) {
  190 + service.getLastestsd().then(
  191 + function(result) {
  192 + if (result.length > 0) {
  193 + self.lsd = new Date();
  194 + self.lsd.setTime(result[0]);
  195 + } else {
  196 + self.lsd = "暂无排班";
  197 + }
  198 +
  199 + },
  200 + function() {
  201 + }
  202 + );
  203 + }
  204 +
178 if (newValue.xlid && newValue.sdate) { 205 if (newValue.xlid && newValue.sdate) {
179 self.pageChanaged(); 206 self.pageChanaged();
180 } 207 }
src/main/resources/static/pages/scheduleApp/module/core/schedulePlanManage/service.js
@@ -126,6 +126,24 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso @@ -126,6 +126,24 @@ angular.module(&#39;ScheduleApp&#39;).factory(&#39;SchedulePlanInfoManageService_g&#39;, [&#39;$reso
126 } 126 }
127 } 127 }
128 } 128 }
  129 + ),
  130 + latestsd: $resource(
  131 + '/spic/lastestsd/:xlid',
  132 + {},
  133 + {
  134 + list: {
  135 + method: 'GET',
  136 + isArray: true,
  137 + transformResponse: function(rs) {
  138 + var dst = angular.fromJson(rs);
  139 + if (dst.status == 'SUCCESS') {
  140 + return dst.data;
  141 + } else {
  142 + return dst; // 业务错误留给控制器处理
  143 + }
  144 + }
  145 + }
  146 + }
129 ) 147 )
130 148
131 149
src/main/resources/static/real_control_v2/fragments/north/nav/directive_history.html
1 -<div class="uk-modal" id="directive-history-modal"> 1 +<div class="uk-modal ct_move_modal" id="directive-history-modal">
2 <div class="uk-modal-dialog" style="width: 1040px;"> 2 <div class="uk-modal-dialog" style="width: 1040px;">
3 <a href="" class="uk-modal-close uk-close"></a> 3 <a href="" class="uk-modal-close uk-close"></a>
4 <div class="uk-modal-header"> 4 <div class="uk-modal-header">
@@ -15,12 +15,12 @@ @@ -15,12 +15,12 @@
15 </legend> 15 </legend>
16 <span class="horizontal-field">指令类型</span> 16 <span class="horizontal-field">指令类型</span>
17 <select name="dType"> 17 <select name="dType">
18 - <option value="-1">全部</option>  
19 - <option value="3">消息短语</option>  
20 - <option value="0">调度指令</option>  
21 - <option value="1">运营指令</option>  
22 - <option value="2">线路切换指令</option>  
23 - </select> 18 + <option value="-1">全部</option>
  19 + <option value="3">消息短语</option>
  20 + <option value="0">调度指令</option>
  21 + <option value="1">运营指令</option>
  22 + <option value="2">线路切换指令</option>
  23 + </select>
24 <span class="horizontal-field">车辆</span> 24 <span class="horizontal-field">车辆</span>
25 <div class="uk-autocomplete uk-form" id="uk-autocomplete-cars"> 25 <div class="uk-autocomplete uk-form" id="uk-autocomplete-cars">
26 <input type="text" name="nbbm" placeholder="车辆自编号"> 26 <input type="text" name="nbbm" placeholder="车辆自编号">
@@ -33,13 +33,13 @@ @@ -33,13 +33,13 @@
33 <div style="height: 495px;margin:5px 0 -18px;"> 33 <div style="height: 495px;margin:5px 0 -18px;">
34 <table class="ct-fixed-table uk-table uk-table-hover"> 34 <table class="ct-fixed-table uk-table uk-table-hover">
35 <thead> 35 <thead>
36 - <tr>  
37 - <th style="width: 6%;">时间</th>  
38 - <th style="width: 8%;">车辆</th>  
39 - <th style="width: 44%;">指令内容</th>  
40 - <th style="width: 7%;">发送人</th>  
41 - <th style="width: 15%;">状态</th>  
42 - </tr> 36 + <tr>
  37 + <th style="width: 6%;">时间</th>
  38 + <th style="width: 8%;">车辆</th>
  39 + <th style="width: 44%;">指令内容</th>
  40 + <th style="width: 7%;">发送人</th>
  41 + <th style="width: 15%;">状态</th>
  42 + </tr>
43 </thead> 43 </thead>
44 <tbody> 44 <tbody>
45 </tbody> 45 </tbody>
@@ -61,14 +61,14 @@ @@ -61,14 +61,14 @@
61 <td> 61 <td>
62 {{if obj.errorText != null}} 62 {{if obj.errorText != null}}
63 <div class="uk-badge uk-badge-danger"> {{obj.errorText}}</div> 63 <div class="uk-badge uk-badge-danger"> {{obj.errorText}}</div>
64 - {{else}}  
65 - {{if obj.reply46 != 0}}  
66 - <div class="uk-badge uk-badge-danger"> 设备未响应</div>  
67 - {{else if obj.reply47 != 0}}  
68 - <div class="uk-badge uk-badge-warning"> 设备已响应</div>  
69 - {{else if obj.reply46 == 0 && obj.reply47 == 0}}  
70 - <div class="uk-badge"> 驾驶员已确认</div>  
71 - {{/if}} 64 + {{else if obj.operCode==96}}
  65 + {{if obj.reply46 != 0}}
  66 + <div class="uk-badge uk-badge-danger"> 设备未响应</div>
  67 + {{else if obj.reply47 != 0}}
  68 + <div class="uk-badge uk-badge-warning"> 设备已响应</div>
  69 + {{else if obj.reply46 == 0 && obj.reply47 == 0}}
  70 + <div class="uk-badge"> 驾驶员已确认</div>
  71 + {{/if}}
72 {{/if}} 72 {{/if}}
73 </td> 73 </td>
74 </tr> 74 </tr>
@@ -87,17 +87,17 @@ @@ -87,17 +87,17 @@
87 var carInput = $('#uk-autocomplete-cars input'); 87 var carInput = $('#uk-autocomplete-cars input');
88 var search_nbbm = function(release) { 88 var search_nbbm = function(release) {
89 var q = carInput.val().toUpperCase(), 89 var q = carInput.val().toUpperCase(),
90 - rs = [],  
91 - max = 12,  
92 - count = 0; 90 + rs = [],
  91 + max = 12,
  92 + count = 0;
93 93
94 $.each(cars, function(i, item) { 94 $.each(cars, function(i, item) {
95 if (item.indexOf(q) != -1){ 95 if (item.indexOf(q) != -1){
96 - rs.push({  
97 - value: item,  
98 - title: item  
99 - });  
100 - count ++; 96 + rs.push({
  97 + value: item,
  98 + title: item
  99 + });
  100 + count ++;
101 } 101 }
102 if (count >= max) 102 if (count >= max)
103 return false; 103 return false;
@@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
156 var resetPagination = true; 156 var resetPagination = true;
157 var pagination = function(pages, currentPage) { 157 var pagination = function(pages, currentPage) {
158 var wrap = $('.pagination-wrap', modal).empty() 158 var wrap = $('.pagination-wrap', modal).empty()
159 - ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap); 159 + ,e = $('<ul class="uk-pagination"></ul>').appendTo(wrap);
160 160
161 var pagination = UIkit.pagination(e, { 161 var pagination = UIkit.pagination(e, {
162 pages: pages, 162 pages: pages,
@@ -164,8 +164,8 @@ @@ -164,8 +164,8 @@
164 }); 164 });
165 165
166 e.on('select.uk.pagination', function(e, pageIndex){ 166 e.on('select.uk.pagination', function(e, pageIndex){
167 - page = pageIndex;  
168 - query(); 167 + page = pageIndex;
  168 + query();
169 }); 169 });
170 170
171 resetPagination = false; 171 resetPagination = false;
src/test/resources/testdata/problem.properties
@@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@
14 14=路牌编号自动生成 14 14=路牌编号自动生成
15 15=时刻表导入的时候表头后面不需要加数字 15 15=时刻表导入的时候表头后面不需要加数字
16 ##16=时间框中文 16 ##16=时间框中文
17 -17=人员工号前公司编码自动加 17 +##17=人员工号前公司编码自动加
18 18=排班计划明细可以修改(修改到每个班次) 18 18=排班计划明细可以修改(修改到每个班次)
19 19=线路运营概览 19 19=线路运营概览
20 20=排班规则备注 20 20=排班规则备注
@@ -31,3 +31,4 @@ @@ -31,3 +31,4 @@
31 ##30=时刻表公里数 三位数 31 ##30=时刻表公里数 三位数
32 32
33 31=规则修改,路牌范围,人员范围可以拖动 33 31=规则修改,路牌范围,人员范围可以拖动
  34 +32=人员配置不存在的情况下,导入规则ktr,找不到的人员不添加,人员范围不存在的,规则不导入