Commit 703d20dbe2d17186717fdb646eed0943f3c3a869

Authored by 徐烜
2 parents ca7c84ae addbcf56

Update

Too many changes to show.

To preserve performance only 14 of 32 files are displayed.

src/main/java/com/bsth/controller/report/ReportController.java
... ... @@ -51,6 +51,7 @@ public class ReportController {
51 51 m.put("jzsj", a.getJzsj());
52 52 m.put("czsj", a.getCzsj());
53 53 m.put("upDown", a.getUpDown()==0?"上行":"下行");
  54 + resList.add(m);
54 55 i++;
55 56 }
56 57  
... ... @@ -66,41 +67,61 @@ public class ReportController {
66 67 return resList;
67 68 }
68 69  
  70 +
69 71 @RequestMapping(value="/queryListClzd" ,method = RequestMethod.GET)
70 72 public List<ArrivalInfo> queryListClzd(@RequestParam String zd,@RequestParam String line,
71 73 @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){
72 74 return service.queryListClzd(line,zd,zdlx,fcsj,ddsj);
73 75 }
74 76  
75   - @RequestMapping(value="/exportQueryListClzd" ,method = RequestMethod.GET)
76   - public List<Map<String, Object>> exportQueryListClzd(@RequestParam String zd,@RequestParam String line,
77   - @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){
  77 +
  78 +
  79 +
  80 + @RequestMapping(value="/jobSummaryExport" ,method = RequestMethod.GET)
  81 + public List<Map<String, Object>> jobSummaryExport(@RequestParam Map<String, Object> map){
78 82 List<Iterator<?>> listI = new ArrayList<Iterator<?>>();
  83 + String lineName=map.get("lineName").toString();
  84 + String date=map.get("date").toString();
79 85 ReportUtils ee = new ReportUtils();
80   - List<ArrivalInfo> list=service.queryListClzd(line, zd, zdlx, fcsj, ddsj);
81   - List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>();
82   - int i=1;
83   - for (ArrivalInfo a:list ) {
84   - Map<String, Object> m = new HashMap<String, Object>();
85   - m.put("i", i);
86   - m.put("nbbm", a.getNbbm());
87   - m.put("stopName", a.getStopName());
88   - m.put("jzsj", a.getJzsj());
89   - m.put("czsj", a.getCzsj());
90   - m.put("upDown", a.getUpDown()==0?"上行":"下行");
91   - i++;
  86 + List<Map<String,Object>> fwqlList= service.jobFwqk(map);
  87 + List<Map<String, Object>> lgqlList=service.jobLjqk(map);
  88 + map=service.jobHzxx(map);
  89 + map.put("lineName", lineName);
  90 + map.put("date",date);
  91 + if(fwqlList.size()<=0){
  92 + Map<String, Object> newMap=new HashMap<String,Object>();
  93 + newMap.put("nr", " ");
  94 + newMap.put("lp", " ");
  95 + newMap.put("nbbm", " ");
  96 + newMap.put("jgh", " ");
  97 + newMap.put("dz", " ");
  98 + newMap.put("sj", " ");
  99 + newMap.put("lbbc", " ");
  100 + newMap.put("lblc", " ");
  101 + newMap.put("jyqp", " ");
  102 + fwqlList.add(newMap);
  103 + }
  104 + if(lgqlList.size()<=0){
  105 + Map<String, Object> newMap=new HashMap<String,Object>();
  106 + newMap.put("lp", " ");
  107 + newMap.put("nbbm", " ");
  108 + newMap.put("jgh", " ");
  109 + newMap.put("dz", " ");
  110 + newMap.put("sj", " ");
  111 + newMap.put("ljlc"," ");
  112 + newMap.put("jyqp", " ");
  113 + lgqlList.add(newMap);
92 114 }
93   -
94 115 try {
95   - Map<String, Object> map=new HashMap<String, Object>();
96   - listI.add(resList.iterator());
  116 + listI.add(fwqlList.iterator());
  117 + listI.add(lgqlList.iterator());
97 118 String path = this.getClass().getResource("/").getPath() + "static/pages/forms/";
98   - ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls",
99   - path + "export/班次到离站.xls");
  119 + ee.excelReplace(listI, new Object[] { map }, path + "mould/jobSummary.xls",
  120 + path + "export/调度员工作汇总日报.xls");
100 121 } catch (Exception e) {
101 122 e.printStackTrace();
102 123 }
103   - return resList;
  124 + return new ArrayList<Map<String, Object>>();
104 125 }
105 126 @RequestMapping(value = "/sreachZd", method = RequestMethod.GET)
106 127 public List<Map<String, String>> sreachPersonnel(@RequestParam String line,@RequestParam int zdlx,@RequestParam String zd) {
... ...
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
... ... @@ -253,20 +253,22 @@ public class InOutStationSignalHandle extends SignalHandle{
253 253 //已完成班次数
254 254 int doneSum = dayOfSchedule.doneSum(sch.getClZbh());
255 255 ScheduleRealInfo next = dayOfSchedule.next(sch);
256   - //通知客户端
257   - sendUtils.sendZdsj(sch, next, doneSum);
258 256 //持久化
259 257 dayOfSchedule.save(sch);
260 258  
261   - //准备执行下一个班次
262   - if (next != null) {
  259 + if(next != null){
263 260 next.setQdzArrDatesj(sch.getZdsjActual());
264 261 dayOfSchedule.addExecPlan(next);
265 262 //进站既进场
266 263 inStationAndInPark(sch, next);
  264 + }
  265 + //通知客户端
  266 + sendUtils.sendZdsj(sch, next, doneSum);
  267 +
  268 + //准备执行下一个班次
  269 + if (next != null) {
267 270 //将gps转换为下一个班次走向的站内信号
268 271 transformUpdown(gps, next);
269   -
270 272 //下发调度指令
271 273 directiveService.send60Dispatch(next, doneSum, "到站@系统");
272 274  
... ...
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
... ... @@ -11,7 +11,10 @@ import com.bsth.data.directive.DirectivesPstThread;
11 11 import com.bsth.data.gpsdata.GpsRealData;
12 12 import com.bsth.data.gpsdata.recovery.GpsDataRecovery;
13 13 import com.bsth.data.schedule.late_adjust.ScheduleLateThread;
14   -import com.bsth.data.schedule.thread.*;
  14 +import com.bsth.data.schedule.thread.CalcOilThread;
  15 +import com.bsth.data.schedule.thread.SchedulePstThread;
  16 +import com.bsth.data.schedule.thread.ScheduleRefreshThread;
  17 +import com.bsth.data.schedule.thread.SubmitToTrafficManage;
15 18 import com.bsth.entity.realcontrol.LineConfig;
16 19 import com.bsth.entity.realcontrol.ScheduleRealInfo;
17 20 import com.bsth.entity.schedule.SchedulePlanInfo;
... ... @@ -146,7 +149,7 @@ public class DayOfSchedule implements CommandLineRunner {
146 149 //入库
147 150 // Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 30, TimeUnit.SECONDS);
148 151 //班次误点扫描
149   -// Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 60, TimeUnit.SECONDS);
  152 +// Application.mainServices.scheduleWithFixedDelay(scheduleLateThread, 60, 30, TimeUnit.SECONDS);
150 153  
151 154 //每天凌晨2点20提交数据到运管处
152 155 long diff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis();
... ...
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
1 1  
2 2 package com.bsth.data.schedule.late_adjust;
3 3  
  4 +import com.bsth.data.BasicData;
4 5 import com.bsth.data.LineConfigData;
5 6 import com.bsth.data.gpsdata.GpsEntity;
6 7 import com.bsth.entity.realcontrol.LineConfig;
7 8 import com.bsth.entity.realcontrol.ScheduleRealInfo;
  9 +import com.bsth.util.Arith;
8 10 import com.bsth.websocket.handler.SendUtils;
9 11 import org.slf4j.Logger;
10 12 import org.slf4j.LoggerFactory;
... ... @@ -47,6 +49,9 @@ public class LateAdjustHandle implements ApplicationContextAware{
47 49 */
48 50 public static void putLate(ScheduleRealInfo sch){
49 51 try {
  52 + //进出场班次不需要
  53 + if(sch.getBcType().equals("in") || sch.getBcType().equals("out"))
  54 + return;
50 55 //线路配置
51 56 LineConfig config = lineConfigData.get(sch.getXlBm());
52 57 if(sch.getLateMinute() == 0){
... ... @@ -115,18 +120,22 @@ public class LateAdjustHandle implements ApplicationContextAware{
115 120 if(sch == null)
116 121 return;
117 122  
118   - //进的是班次起点
119   - if(gps.getStopNo().equals(sch.getQdzCode())
  123 + //进的是班次起点(名称一样即可)
  124 + gps.setStationName(BasicData.stationCode2NameMap.get(gps.getLineId() + "_" + gps.getUpDown() + "_" + gps.getStopNo()));
  125 + if(gps.getStationName().equals(sch.getQdzName())
120 126 && sch.getLateMinute() > 0){
121 127 //自动调整待发 到达时间 + 停靠时间
122   - long dt = gps.getTimestamp() + (Long.parseLong(String.valueOf(sch.getLateMinute() * 60 * 1000)));
  128 + long dt = Arith.addLong(gps.getTimestamp(), (sch.getLateMinute() * 60 * 1000));
123 129 sch.setDfsjAll(dt);
124 130 sch.setDfAuto(true);
  131 + //取消应发未到标记
  132 + sch.setLate2(false);
125 133  
126 134 lateSchMap.remove(sch.getClZbh());
127 135 logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt);
128 136 }
129 137 }catch (Exception e){
  138 + e.printStackTrace();
130 139 logger.error("", e);
131 140 }
132 141 }
... ...
src/main/java/com/bsth/data/schedule/late_adjust/ScheduleLateThread.java
... ... @@ -19,7 +19,7 @@ import java.util.List;
19 19 * @ClassName: ScheduleLateThread
20 20 * @Description: TODO(班次误点扫描线程)
21 21 * @author PanZhao
22   - * @date 2016年8月31日 下午3:09:02
  22 + * @date 2016年8月31日 下午3:09:02
23 23 *
24 24 */
25 25 @Component
... ... @@ -44,11 +44,14 @@ public class ScheduleLateThread extends Thread{
44 44 ScheduleRealInfo sch;
45 45 for(int i = 0; i < size; i ++){
46 46 sch = all.get(i);
47   - if(sch.getDfsjT() > t || sch.isLate())
  47 + if(sch.getDfsjT() > t)
48 48 break;
49 49  
  50 + if(sch.isLate())
  51 + continue;
  52 +
50 53 if(sch.getStatus() == 0
51   - && sch.getFcsjActual() == null){
  54 + && StringUtils.isEmpty(sch.getFcsjActual())){
52 55  
53 56 //检查应发未到 当前班次无起点到达时间
54 57 if(StringUtils.isEmpty(sch.getQdzArrDateSJ())){
... ...
src/main/java/com/bsth/entity/mcy_forms/Waybillday.java
... ... @@ -20,6 +20,8 @@ public class Waybillday {
20 20  
21 21 private String zlc;//里程
22 22  
  23 + private String sh;//损耗
  24 +
23 25 public String getJgh() {
24 26 return jgh;
25 27 }
... ... @@ -110,6 +112,15 @@ public class Waybillday {
110 112 public void setYl(String yl) {
111 113 this.yl = yl;
112 114 }
  115 +
  116 + public String getSh() {
  117 + return sh;
  118 + }
  119 +
  120 + public void setSh(String sh) {
  121 + this.sh = sh;
  122 + }
  123 +
113 124  
114 125  
115 126 }
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -22,7 +22,7 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
22 22 List<ScheduleRealInfo> findByLines(List<String> lines);
23 23  
24 24  
25   - @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and bc_type not in ('in','out') order by (lpName+1),clZbh,realExecDate,fcsj")
  25 + @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and bc_type not in ('in','out') order by (lpName+1),clZbh,realExecDate,dfsj")
26 26 List<ScheduleRealInfo> scheduleDailyQp(String line,String date);
27 27  
28 28 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)")
... ... @@ -87,11 +87,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
87 87 List<ScheduleRealInfo> correctForm(String line,String startDate,String endDate,String lpName,String code);
88 88  
89 89 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
90   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,fcsj")
  90 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jName = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,dfsj")
91 91 List<ScheduleRealInfo> queryListWaybill(String jName,String clZbh,String lpName,String date,String line);
92 92  
93 93 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
94   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,fcsj")
  94 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh = ?1 and s.clZbh = ?2 and s.lpName = ?3 and s.scheduleDate = str_to_date(?4,'%Y-%m-%d') and s.xlBm=?5 order by realExecDate,dfsj")
95 95 List<ScheduleRealInfo> queryListWaybillXcld(String jGh,String clZbh,String lpName,String date,String line);
96 96  
97 97 // @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
... ... @@ -104,11 +104,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
104 104  
105 105  
106 106 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
107   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.clZbh = ?1 and s.scheduleDate = str_to_date(?2,'%Y-%m-%d') and xlBm =?3 order by realExecDate,fcsj")
  107 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.clZbh = ?1 and s.scheduleDate = str_to_date(?2,'%Y-%m-%d') and xlBm =?3 order by realExecDate,dfsj")
108 108 List<ScheduleRealInfo> queryListWaybill2(String clZbh,String date,String line);
109 109  
110 110 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
111   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh like %?1% and s.clZbh like %?2% and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') and s.gsBm like %?4% and s.fgsBm like %?5% order by realExecDate,fcsj")
  111 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.jGh like %?1% and s.clZbh like %?2% and s.scheduleDate = str_to_date(?3,'%Y-%m-%d') and s.gsBm like %?4% and s.fgsBm like %?5% order by realExecDate,dfsj")
112 112 List<ScheduleRealInfo> queryListWaybill3(String jName,String clZbh,String date,String gsbm,String fgsbm);
113 113  
114 114 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
... ... @@ -133,11 +133,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
133 133  
134 134 //去掉了 xlBm is not null
135 135 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
136   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.realExecDate,s.fcsj, (s.lpName+1)")
  136 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.realExecDate,s.dfsj, (s.lpName+1)")
137 137 List<ScheduleRealInfo> scheduleByDateAndLine(String line,String date);
138 138  
139 139 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
140   - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.fcsj")
  140 + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by (s.lpName+1), s.realExecDate,s.dfsj")
141 141 List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date);
142 142  
143 143 @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH)
... ...
src/main/java/com/bsth/service/forms/impl/ExportServiceImpl.java
... ... @@ -35,12 +35,14 @@ public class ExportServiceImpl implements ExportService{
35 35  
36 36 for(Waybillday w : list){
37 37 Map<String, Object> m = new HashMap<String, Object>();
38   - m.put("carPlate", w.getCarPlate());
  38 + m.put("carPlate", w.getNbbm());
39 39 m.put("jzl1", w.getJzl1());
40 40 m.put("jzl", w.getJzl());
41 41 m.put("yh", w.getYh());
  42 + m.put("sh", w.getSh());
42 43 m.put("jName", w.getjName());
43 44 m.put("zlc", w.getZlc());
  45 + m.put("jy", "");
44 46 resList.add(m);
45 47 }
46 48  
... ... @@ -48,7 +50,7 @@ public class ExportServiceImpl implements ExportService{
48 50 listI.add(resList.iterator());
49 51 String path = this.getClass().getResource("/").getPath()+"static/pages/forms/";
50 52 ee.excelReplace(listI, new Object[] { map }, path+"mould/waybillday.xls",
51   - path+"export/行车路单日报表" + sdfSimple.format(sdfMonth.parse(date)) + ".xls");
  53 + path+"export/行车路单日报表.xls");
52 54 } catch (Exception e) {
53 55 e.printStackTrace();
54 56 }
... ...
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
... ... @@ -64,48 +64,69 @@ public class FormsServiceImpl implements FormsService {
64 64 // 行车路单日报表
65 65 @Override
66 66 public List<Waybillday> waybillday(Map<String, Object> map) {
67   -
68   -
69   -
70   - String sql=" select t.*,z.jzl,z.yh from ("
71   - + " select x.j_gh,x.cl_zbh,x.j_name,x.schedule_date,"
72   - + " x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name from bsth_c_s_sp_info_real x "
73   - + " where to_days( x.schedule_date)=to_days('"+map.get("date").toString() + "') "
74   - + " and x.gs_bm='"+map.get("gsdmWaybillday").toString()+"' "
75   - + " and x.fgs_bm='"+map.get("fgsdmWaybillday").toString()+"' "
76   - + " and xl_bm like '%"+ map.get("line").toString().trim()+"%'"
77   - + " GROUP BY x.j_gh,x.cl_zbh,x.j_name,"
78   - + " x.schedule_date,x.gs_bm,x.gs_name,x.fgs_bm,x.fgs_name ) t"
79   - + " LEFT join (select y.rq,y.xlbm,y.nbbm,y.jsy,y.jzl,y.yh from"
80   - + " bsth_c_ylb y where 1=1 "
81   - + " and to_days(y.RQ)=to_days('"+map.get("date").toString() + "') "
82   - + " and y.XLBM like '%"+ map.get("line").toString().trim()+"%'"
83   - + " and y.ssgsdm='"+map.get("gsdmWaybillday").toString()+"'"
84   - + " and y.fgsdm='"+map.get("gsdmWaybillday").toString()+"') z "
85   - + " on t.cl_zbh=z.nbbm ";
  67 + String line=map.get("line").toString();
  68 + String date=map.get("date").toString();
  69 +
  70 + String sql="select "
  71 + + " r.cl_zbh,r.j_gh,r.j_name"
  72 + + " from bsth_c_s_sp_info_real r where "
  73 + + " r.schedule_date_str = '"+date+"'"
  74 + + " and r.xl_bm = '"+line+"' "
  75 + + " group by "
  76 + + " r.cl_zbh,r.j_gh,r.j_name";
86 77  
87 78 List<Waybillday> list = jdbcTemplate.query(sql, new RowMapper<Waybillday>() {
  79 +
88 80 @Override
89 81 public Waybillday mapRow(ResultSet arg0, int arg1) throws SQLException {
90   - Waybillday wbd = new Waybillday();
91   - wbd.setCarPlate(arg0.getString("cl_zbh"));
92   - wbd.setJzl(arg0.getString("jzl"));
93   - wbd.setYh(arg0.getString("yh"));
94   - wbd.setjName(arg0.getString("j_name"));
95   - wbd.setRq(arg0.getString("schedule_date"));
96   - wbd.setJgh(arg0.getString("j_gh"));
97   - return wbd;
98   - }
  82 + Waybillday w=new Waybillday();
  83 + w.setJgh(arg0.getString("j_gh"));
  84 + w.setjName(arg0.getString("j_name"));
  85 + w.setNbbm(arg0.getString("cl_zbh"));
  86 + return w;
  87 +
  88 + };
99 89 });
100   -
101   - for(int i=0;i<list.size();i++){
  90 + List<ScheduleRealInfo> realList= scheduleRealInfoRepository.scheduleByDateAndLineTjrb(line, date);
  91 + List<Ylb> listYlb= ylbRepository.obtainYl(date, "", "", line, "", "xlbm");
  92 + double jzl=0.0,sh=0.0,yh=0.0;
  93 + for (int i = 0; i < list.size(); i++) {
102 94 Waybillday w=list.get(i);
103   - Map<String, Object> maps = new HashMap<>();
104   - maps = commonService.findKMBC2(w.getJgh(), w.getCarPlate(),
105   - w.getRq());
106   - w.setJzl1(maps.get("ksgl").toString());
107   - w.setZlc(maps.get("realMileage").toString());
108   -
  95 + List<ScheduleRealInfo> listInfo=new ArrayList<ScheduleRealInfo>();
  96 + for (int j = 0; j < realList.size(); j++) {
  97 + ScheduleRealInfo s=realList.get(j);
  98 + if(w.getNbbm().equals(s.getClZbh()) && w.getJgh().equals(w.getJgh())){
  99 + listInfo.add(s);
  100 + }
  101 + }
  102 +
  103 + double sjgl=culateMileageService.culateSjgl(listInfo);
  104 + double ljgl=culateMileageService.culateLjgl(listInfo);
  105 + double zyygl=Arith.add(sjgl, ljgl);
  106 + double jccg=culateMileageService.culateJccgl(listInfo);
  107 + double ksgl=culateMileageService.culateKsgl(listInfo);
  108 + double zksgl=Arith.add(jccg, ksgl);
  109 +
  110 + w.setJzl1(String.valueOf(zksgl));
  111 + w.setZlc(String.valueOf(Arith.add(zyygl, zksgl)));
  112 +
  113 +
  114 + jzl=0.0;
  115 + sh=0.0;
  116 + yh=0.0;
  117 + for (int j = 0; j < listYlb.size(); j++) {
  118 + Ylb y=listYlb.get(j);
  119 + if(w.getNbbm().equals(y.getNbbm()) && w.getJgh().equals(y.getJsy())){
  120 + jzl=Arith.add(jzl, y.getJzl());
  121 + sh=Arith.add(sh, y.getSh());
  122 + yh=Arith.add(yh, y.getYh());
  123 + }
  124 + }
  125 +
  126 + w.setJzl(String.valueOf(jzl));
  127 + w.setYh(String.valueOf(yh));
  128 + w.setSh(String.valueOf(sh));
  129 +
109 130 }
110 131 return list;
111 132 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -1050,6 +1050,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1050 1050 ScheduleRealInfo next = dayOfSchedule.next(sch);
1051 1051 if (null != next) {
1052 1052 next.setQdzArrDateSJ(zdsjActual);
  1053 + next.setLate2(false);
1053 1054 ts.add(next);
1054 1055 }
1055 1056  
... ... @@ -1667,35 +1668,42 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
1667 1668 public List<Map<String, Object>> statisticsDaily(String line, String date,
1668 1669 String xlName, String type) {
1669 1670 List<Map<String, Object>> lMap= new ArrayList<Map<String, Object>>();
1670   - List<ScheduleRealInfo> lists = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  1671 + List<ScheduleRealInfo>list_s=scheduleRealInfoRepository.scheduleByDateAndLine2(line, date);
  1672 + List<ScheduleRealInfo> lists =new ArrayList<ScheduleRealInfo>();
  1673 + for (int i = 0; i < list_s.size(); i++) {
  1674 + ScheduleRealInfo s=list_s.get(i);
  1675 + if(s.getZdsjActual()!=null){
  1676 + lists.add(s);
  1677 + }
  1678 + }
1671 1679 Map<String, Object> map = new HashMap<String, Object>();
1672 1680 map.put("xlName", xlName);
1673   - double jhlc=culateService.culateJhgl(lists);
  1681 + double jhlc=culateService.culateJhgl(list_s);
1674 1682 map.put("jhlc",jhlc);
1675 1683 map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists)));
1676   - double lbgl=culateService.culateLbgl(lists);
  1684 + double lbgl=culateService.culateLbgl(list_s);
1677 1685 map.put("ssgl", lbgl);
1678   - map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻"));
1679   - map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢"));
1680   - map.put("ssgl_gz", culateService.culateCJLC(lists, "故障"));
1681   - map.put("ssgl_jf", culateService.culateCJLC(lists, "纠纷"));
1682   - map.put("ssgl_zs", culateService.culateCJLC(lists, "肇事"));
1683   - map.put("ssgl_qr", culateService.culateCJLC(lists, "缺人"));
1684   - map.put("ssgl_qc", culateService.culateCJLC(lists, "缺车"));
1685   - map.put("ssgl_kx", culateService.culateCJLC(lists, "客稀"));
1686   - map.put("ssgl_qh", culateService.culateCJLC(lists, "气候"));
1687   - map.put("ssgl_yw", culateService.culateCJLC(lists, "援外"));
1688   - double ssgl_pc=culateService.culateCJLC(lists, "配车");
1689   - double ssgl_by=culateService.culateCJLC(lists, "保养");
1690   - double ssgl_cj=culateService.culateCJLC(lists, "抽减");
1691   - double ssgl_qt=culateService.culateCJLC(lists, "其他");
  1686 + map.put("ssgl_lz", culateService.culateCJLC(list_s, "路阻"));
  1687 + map.put("ssgl_dm", culateService.culateCJLC(list_s, "吊慢"));
  1688 + map.put("ssgl_gz", culateService.culateCJLC(list_s, "故障"));
  1689 + map.put("ssgl_jf", culateService.culateCJLC(list_s, "纠纷"));
  1690 + map.put("ssgl_zs", culateService.culateCJLC(list_s, "肇事"));
  1691 + map.put("ssgl_qr", culateService.culateCJLC(list_s, "缺人"));
  1692 + map.put("ssgl_qc", culateService.culateCJLC(list_s, "缺车"));
  1693 + map.put("ssgl_kx", culateService.culateCJLC(list_s, "客稀"));
  1694 + map.put("ssgl_qh", culateService.culateCJLC(list_s, "气候"));
  1695 + map.put("ssgl_yw", culateService.culateCJLC(list_s, "援外"));
  1696 + double ssgl_pc=culateService.culateCJLC(list_s, "配车");
  1697 + double ssgl_by=culateService.culateCJLC(list_s, "保养");
  1698 + double ssgl_cj=culateService.culateCJLC(list_s, "抽减");
  1699 + double ssgl_qt=culateService.culateCJLC(list_s, "其他");
1692 1700 map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt)));
1693   - map.put("ssbc", culateService.culateLbbc(lists));
  1701 + map.put("ssbc", culateService.culateLbbc(list_s));
1694 1702 double ljgl=culateService.culateLjgl(lists);
1695 1703 map.put("ljgl", ljgl);
1696   - map.put("jhbc", culateService.culateJhbc(lists,""));
1697   - map.put("jhbc_m", culateService.culateJhbc(lists, "zgf"));
1698   - map.put("jhbc_a", culateService.culateJhbc(lists, "wgf"));
  1704 + map.put("jhbc", culateService.culateJhbc(list_s,""));
  1705 + map.put("jhbc_m", culateService.culateJhbc(list_s, "zgf"));
  1706 + map.put("jhbc_a", culateService.culateJhbc(list_s, "wgf"));
1699 1707 map.put("sjbc", culateService.culateSjbc(lists,""));
1700 1708 map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));
1701 1709 map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));
... ... @@ -2263,11 +2271,18 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2263 2271 return lMap;
2264 2272 }*/
2265 2273  
2266   - public final Map<String, Object> staticTj(List<ScheduleRealInfo> lists){
  2274 + public final Map<String, Object> staticTj(List<ScheduleRealInfo> list){
  2275 + List<ScheduleRealInfo> lists=new ArrayList<ScheduleRealInfo>();
  2276 + for(int i=0;i<list.size();i++){
  2277 + ScheduleRealInfo s=list.get(i);
  2278 + if(s.getZdsjActual()!=null){
  2279 + lists.add(s);
  2280 + }
  2281 + }
2267 2282 Map<String, Object> map = new HashMap<String, Object>();
2268 2283 map.put("xlName", lists.get(0).getXlName());
2269   - double jhyygl=culateService.culateJhgl(lists);//计划营运公里
2270   - double jhjcclc= culateService.culateJhJccgl(lists);//计划进出场公里(计划空驶公里)
  2284 + double jhyygl=culateService.culateJhgl(list);//计划营运公里
  2285 + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里)
2271 2286 map.put("jhlc", jhyygl);
2272 2287 map.put("jcclc", jhjcclc);
2273 2288 map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
... ... @@ -2283,23 +2298,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2283 2298 map.put("sjgl",zyygl);
2284 2299 map.put("sjksgl", zksgl);
2285 2300  
2286   - map.put("ssgl", culateService.culateLbgl(lists));
2287   - map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻"));
2288   - map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢"));
2289   - map.put("ssgl_gz", culateService.culateCJLC(lists, "故障"));
2290   - map.put("ssgl_jf", culateService.culateCJLC(lists, "纠纷"));
2291   - map.put("ssgl_zs", culateService.culateCJLC(lists, "肇事"));
2292   - map.put("ssgl_qr", culateService.culateCJLC(lists, "缺人"));
2293   - map.put("ssgl_qc", culateService.culateCJLC(lists, "缺车"));
2294   - map.put("ssgl_kx", culateService.culateCJLC(lists, "客稀"));
2295   - map.put("ssgl_qh", culateService.culateCJLC(lists, "气候"));
2296   - map.put("ssgl_yw", culateService.culateCJLC(lists, "援外"));
2297   - map.put("ssgl_other", culateService.culateCJLC(lists, "其他"));
2298   - map.put("ssbc", culateService.culateLbbc(lists));
  2301 + map.put("ssgl", culateService.culateLbgl(list));
  2302 + map.put("ssgl_lz", culateService.culateCJLC(list, "路阻"));
  2303 + map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢"));
  2304 + map.put("ssgl_gz", culateService.culateCJLC(list, "故障"));
  2305 + map.put("ssgl_jf", culateService.culateCJLC(list, "纠纷"));
  2306 + map.put("ssgl_zs", culateService.culateCJLC(list, "肇事"));
  2307 + map.put("ssgl_qr", culateService.culateCJLC(list, "缺人"));
  2308 + map.put("ssgl_qc", culateService.culateCJLC(list, "缺车"));
  2309 + map.put("ssgl_kx", culateService.culateCJLC(list, "客稀"));
  2310 + map.put("ssgl_qh", culateService.culateCJLC(list, "气候"));
  2311 + map.put("ssgl_yw", culateService.culateCJLC(list, "援外"));
  2312 + map.put("ssgl_other", culateService.culateCJLC(list, "其他"));
  2313 + map.put("ssbc", culateService.culateLbbc(list));
2299 2314 map.put("ljgl", ljgl);
2300   - map.put("jhbc", culateService.culateJhbc(lists,""));
2301   - map.put("jhbc_m", culateService.culateJhbc(lists, "zgf"));
2302   - map.put("jhbc_a", culateService.culateJhbc(lists, "wgf"));
  2315 + map.put("jhbc", culateService.culateJhbc(list,""));
  2316 + map.put("jhbc_m", culateService.culateJhbc(list, "zgf"));
  2317 + map.put("jhbc_a", culateService.culateJhbc(list, "wgf"));
2303 2318 map.put("sjbc", culateService.culateSjbc(lists,""));
2304 2319 map.put("sjbc_m", culateService.culateSjbc(lists,"zgf"));
2305 2320 map.put("sjbc_a", culateService.culateSjbc(lists,"wgf"));
... ... @@ -2323,6 +2338,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2323 2338 public List<Map<String, Object>> statisticsDailyTj(String gsdm,String fgsdm,String line, String date,String date2,
2324 2339 String xlName, String type) {
2325 2340 List<ScheduleRealInfo> list = new ArrayList<ScheduleRealInfo>();
  2341 + List<ScheduleRealInfo> list_s = new ArrayList<ScheduleRealInfo>();
2326 2342 List<ScheduleRealInfo> lists = new ArrayList<ScheduleRealInfo>();
2327 2343 line =line.trim();
2328 2344 if(line.equals("")){
... ... @@ -2332,6 +2348,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2332 2348 //查询单条线路
2333 2349 list = scheduleRealInfoRepository.scheduleByDateAndLineTj2(line, date,date2);
2334 2350 }
  2351 + for (int i = 0; i < list.size(); i++) {
  2352 + ScheduleRealInfo s=list.get(i);
  2353 + if(s.getZdsjActual()!=null){
  2354 + list_s.add(s);
  2355 + }
  2356 + }
2335 2357 List<Map<String, Object>> lMap = new ArrayList<Map<String, Object>>();
2336 2358 for (int i = 0; i < list.size(); i++) {
2337 2359 if(i<list.size()-1){
... ... @@ -2365,12 +2387,12 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2365 2387 map.put("jcclc", jhjcclc);
2366 2388 map.put("jhzlc", Arith.add(jhyygl, jhjcclc));
2367 2389  
2368   - double ljgl= culateService.culateLjgl(list);
2369   - double sjyygl= culateService.culateSjgl(list);
  2390 + double ljgl= culateService.culateLjgl(list_s);
  2391 + double sjyygl= culateService.culateSjgl(list_s);
2370 2392 double zyygl= Arith.add(sjyygl,ljgl);
2371 2393  
2372   - double sjjccgl=culateService.culateJccgl(list);
2373   - double sjksgl=culateService.culateKsgl(list);
  2394 + double sjjccgl=culateService.culateJccgl(list_s);
  2395 + double sjksgl=culateService.culateKsgl(list_s);
2374 2396 double zksgl=Arith.add(sjjccgl, sjksgl);
2375 2397 map.put("sjzgl", Arith.add(zyygl, zksgl));
2376 2398 map.put("sjgl",zyygl);
... ... @@ -2392,15 +2414,15 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2392 2414 map.put("jhbc", culateService.culateJhbc(list,""));
2393 2415 map.put("jhbc_m", culateService.culateJhbc(list, "zgf"));
2394 2416 map.put("jhbc_a", culateService.culateJhbc(list, "wgf"));
2395   - map.put("sjbc", culateService.culateSjbc(list,""));
2396   - map.put("sjbc_m", culateService.culateSjbc(list,"zgf"));
2397   - map.put("sjbc_a", culateService.culateSjbc(list,"wgf"));
2398   - map.put("ljbc", culateService.culateLjbc(list,""));
2399   - map.put("ljbc_m", culateService.culateLjbc(list,"zgf"));
2400   - map.put("ljbc_a", culateService.culateLjbc(list,"wgf"));
2401   - map.put("fzbc", culateService.culateFzbc(list, ""));
2402   - map.put("fzbc_m", culateService.culateFzbc(list, "zgf"));
2403   - map.put("fzbc_a", culateService.culateFzbc(list, "wgf"));
  2417 + map.put("sjbc", culateService.culateSjbc(list_s,""));
  2418 + map.put("sjbc_m", culateService.culateSjbc(list_s,"zgf"));
  2419 + map.put("sjbc_a", culateService.culateSjbc(list_s,"wgf"));
  2420 + map.put("ljbc", culateService.culateLjbc(list_s,""));
  2421 + map.put("ljbc_m", culateService.culateLjbc(list_s,"zgf"));
  2422 + map.put("ljbc_a", culateService.culateLjbc(list_s,"wgf"));
  2423 + map.put("fzbc", culateService.culateFzbc(list_s, ""));
  2424 + map.put("fzbc_m", culateService.culateFzbc(list_s, "zgf"));
  2425 + map.put("fzbc_a", culateService.culateFzbc(list_s, "wgf"));
2404 2426 map.put("dtbc", 0);
2405 2427 map.put("dtbc_m", 0);
2406 2428 map.put("dtbc_a", 0);
... ...
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
... ... @@ -1181,6 +1181,7 @@ public class ReportServiceImpl implements ReportService{
1181 1181 newMap.put("dz", scheduleRealInfo.getQdzName());
1182 1182 newMap.put("sj", scheduleRealInfo.getFcsj());
1183 1183 newMap.put("lbbc", 1);
  1184 + newMap.put("gzf", " ");
1184 1185 newMap.put("lblc", scheduleRealInfo.getJhlcOrig());
1185 1186 newMap.put("jyqp", scheduleRealInfo.getRemarks());
1186 1187 list.add(newMap);
... ... @@ -1206,6 +1207,7 @@ public class ReportServiceImpl implements ReportService{
1206 1207 newMap.put("jgh", scheduleRealInfo.getjGh());
1207 1208 newMap.put("dz", childTaskPlan.getStartStationName());
1208 1209 newMap.put("sj", childTaskPlan.getStartDate());
  1210 + newMap.put("gzf", " ");
1209 1211 newMap.put("lbbc", 0);
1210 1212 newMap.put("lblc", childTaskPlan.getMileage());
1211 1213 newMap.put("jyqp", childTaskPlan.getRemarks());
... ... @@ -1237,8 +1239,12 @@ public class ReportServiceImpl implements ReportService{
1237 1239 newMap.put("lp", "小计");
1238 1240 newMap.put("nbbm", "少驶班次");
1239 1241 newMap.put("jgh", lbbc);
1240   - newMap.put("sj", "少驶公里");
  1242 + newMap.put("lbbc", "少驶公里");
1241 1243 newMap.put("lblc", lblc);
  1244 + newMap.put("dz", " ");
  1245 + newMap.put("sj", " ");
  1246 + newMap.put("gzf", " ");
  1247 + newMap.put("jyqp"," ");
1242 1248 listNew.add(newMap);
1243 1249 }
1244 1250  
... ... @@ -1271,7 +1277,7 @@ public class ReportServiceImpl implements ReportService{
1271 1277 newMap.put("dz", scheduleRealInfo.getQdzName());
1272 1278 newMap.put("sj", scheduleRealInfo.getFcsj());
1273 1279 newMap.put("ljlc", scheduleRealInfo.getJhlc()==null?0:scheduleRealInfo.getJhlc());
1274   - newMap.put("jyqp", scheduleRealInfo.getRealMileage());
  1280 + newMap.put("jyqp", scheduleRealInfo.getRealMileage()==null?"":scheduleRealInfo.getRealMileage());
1275 1281 list.add(newMap);
1276 1282 }
1277 1283 // }else{
... ...
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleService.java
... ... @@ -43,3 +43,4 @@ public interface ScheduleRuleService {
43 43 */
44 44 void deelteSchedulePlanInfo(Integer xlid, Date datefrom, Date dateto);
45 45 }
  46 +
... ...
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleServiceImpl.java
... ... @@ -125,3 +125,4 @@ public class ScheduleRuleServiceImpl implements ScheduleRuleService {
125 125  
126 126 }
127 127 }
  128 +
... ...
src/main/java/com/bsth/util/Arith.java
... ... @@ -24,8 +24,20 @@ public class Arith {
24 24 BigDecimal b1 = new BigDecimal(v1.toString());
25 25 BigDecimal b2 = new BigDecimal(v2.toString());
26 26 return b1.add(b2).doubleValue();
27   - }
28   -
  27 + }
  28 +
  29 + /**
  30 + * 提供精确的加法运算。
  31 + * @param v1 被加数
  32 + * @param v2 加数
  33 + * @return 两个参数的和
  34 + */
  35 + public static long addLong(Object v1,Object v2){
  36 + BigDecimal b1 = new BigDecimal(v1.toString());
  37 + BigDecimal b2 = new BigDecimal(v2.toString());
  38 + return b1.add(b2).longValue();
  39 + }
  40 +
29 41 /**
30 42 * 提供精确的减法运算。
31 43 * @param v1 被减数
... ...