Commit dc24c65dd2dc1c2fa36ed937ee1c22914aa9db1e
Merge branch 'minhang' into pudong
Showing
26 changed files
with
583 additions
and
325 deletions
Too many changes to show.
To preserve performance only 26 of 58 files are displayed.
pom.xml
| @@ -259,11 +259,11 @@ | @@ -259,11 +259,11 @@ | ||
| 259 | </dependency> | 259 | </dependency> |
| 260 | 260 | ||
| 261 | 261 | ||
| 262 | - <dependency> | ||
| 263 | - <groupId>ojdbc</groupId> | ||
| 264 | - <artifactId>ojdbc</artifactId> | ||
| 265 | - <version>14</version> | ||
| 266 | - </dependency> | 262 | + <!--<dependency>--> |
| 263 | + <!--<groupId>ojdbc</groupId>--> | ||
| 264 | + <!--<artifactId>ojdbc</artifactId>--> | ||
| 265 | + <!--<version>14</version>--> | ||
| 266 | + <!--</dependency>--> | ||
| 267 | </dependencies> | 267 | </dependencies> |
| 268 | 268 | ||
| 269 | <dependencyManagement> | 269 | <dependencyManagement> |
src/main/java/com/bsth/controller/forms/ExportController.java
| @@ -253,7 +253,7 @@ public class ExportController { | @@ -253,7 +253,7 @@ public class ExportController { | ||
| 253 | } | 253 | } |
| 254 | 254 | ||
| 255 | // 运营服务阶段报表 | 255 | // 运营服务阶段报表 |
| 256 | - @RequestMapping(value = "/operationserviceExport", method = RequestMethod.POST) | 256 | + @RequestMapping(value = "/operationserviceExport", method = RequestMethod.GET) |
| 257 | public List<Map<String, Object>> operationserviceExport(@RequestParam Map<String, Object> map) { | 257 | public List<Map<String, Object>> operationserviceExport(@RequestParam Map<String, Object> map) { |
| 258 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); | 258 | SimpleDateFormat sdfMonth = new SimpleDateFormat("yyyy-MM-dd"), sdfSimple = new SimpleDateFormat("yyyyMMdd"); |
| 259 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | 259 | List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); |
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
| @@ -86,7 +86,7 @@ public class MCY_FormsController { | @@ -86,7 +86,7 @@ public class MCY_FormsController { | ||
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | // 运营服务阶段报表 | 88 | // 运营服务阶段报表 |
| 89 | - @RequestMapping(value = "/operationservice", method = RequestMethod.POST) | 89 | + @RequestMapping(value = "/operationservice", method = RequestMethod.GET) |
| 90 | public List<Operationservice> operationservice(@RequestParam Map<String, Object> map) { | 90 | public List<Operationservice> operationservice(@RequestParam Map<String, Object> map) { |
| 91 | 91 | ||
| 92 | return formsService.operationservice(map); | 92 | return formsService.operationservice(map); |
src/main/java/com/bsth/controller/report/ReportController.java
| 1 | package com.bsth.controller.report; | 1 | package com.bsth.controller.report; |
| 2 | 2 | ||
| 3 | +import java.util.ArrayList; | ||
| 3 | import java.util.HashMap; | 4 | import java.util.HashMap; |
| 5 | +import java.util.Iterator; | ||
| 4 | import java.util.List; | 6 | import java.util.List; |
| 5 | import java.util.Map; | 7 | import java.util.Map; |
| 6 | 8 | ||
| @@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController; | @@ -13,6 +15,7 @@ import org.springframework.web.bind.annotation.RestController; | ||
| 13 | import com.bsth.entity.excep.ArrivalInfo; | 15 | import com.bsth.entity.excep.ArrivalInfo; |
| 14 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 16 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 15 | import com.bsth.service.report.ReportService; | 17 | import com.bsth.service.report.ReportService; |
| 18 | +import com.bsth.util.ReportUtils; | ||
| 16 | 19 | ||
| 17 | @RestController | 20 | @RestController |
| 18 | @RequestMapping("report") | 21 | @RequestMapping("report") |
| @@ -31,12 +34,74 @@ public class ReportController { | @@ -31,12 +34,74 @@ public class ReportController { | ||
| 31 | @RequestParam String date,@RequestParam String fcsj,@RequestParam String ddsj){ | 34 | @RequestParam String date,@RequestParam String fcsj,@RequestParam String ddsj){ |
| 32 | return service.queryListZdxx(line,date,clzbh,fcsj,ddsj); | 35 | return service.queryListZdxx(line,date,clzbh,fcsj,ddsj); |
| 33 | } | 36 | } |
| 37 | + | ||
| 38 | + @RequestMapping(value="/exportQueryListZdxx" ,method = RequestMethod.GET) | ||
| 39 | + public List<Map<String, Object>> exportQueryListZdxx(@RequestParam String clzbh,@RequestParam String line, | ||
| 40 | + @RequestParam String date,@RequestParam String fcsj,@RequestParam String ddsj){ | ||
| 41 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 42 | + ReportUtils ee = new ReportUtils(); | ||
| 43 | + List<ArrivalInfo> list=service.queryListZdxx(line,date,clzbh,fcsj,ddsj); | ||
| 44 | + List<Map<String, Object>> resList = new ArrayList<Map<String, Object>>(); | ||
| 45 | + int i=1; | ||
| 46 | + for (ArrivalInfo a:list ) { | ||
| 47 | + Map<String, Object> m = new HashMap<String, Object>(); | ||
| 48 | + m.put("i", i); | ||
| 49 | + m.put("mbbm", a.getNbbm()); | ||
| 50 | + m.put("stopName", a.getStopName()); | ||
| 51 | + m.put("jzsj", a.getJzsj()); | ||
| 52 | + m.put("czsj", a.getCzsj()); | ||
| 53 | + m.put("upDown", a.getUpDown()==0?"上行":"下行"); | ||
| 54 | + i++; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + try { | ||
| 58 | + Map<String, Object> map=new HashMap<String, Object>(); | ||
| 59 | + listI.add(resList.iterator()); | ||
| 60 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 61 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls", | ||
| 62 | + path + "export/班次到离站.xls"); | ||
| 63 | + } catch (Exception e) { | ||
| 64 | + e.printStackTrace(); | ||
| 65 | + } | ||
| 66 | + return resList; | ||
| 67 | + } | ||
| 68 | + | ||
| 34 | @RequestMapping(value="/queryListClzd" ,method = RequestMethod.GET) | 69 | @RequestMapping(value="/queryListClzd" ,method = RequestMethod.GET) |
| 35 | public List<ArrivalInfo> queryListClzd(@RequestParam String zd,@RequestParam String line, | 70 | public List<ArrivalInfo> queryListClzd(@RequestParam String zd,@RequestParam String line, |
| 36 | @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){ | 71 | @RequestParam String zdlx,@RequestParam String fcsj,@RequestParam String ddsj){ |
| 37 | return service.queryListClzd(line,zd,zdlx,fcsj,ddsj); | 72 | return service.queryListClzd(line,zd,zdlx,fcsj,ddsj); |
| 38 | } | 73 | } |
| 39 | 74 | ||
| 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){ | ||
| 78 | + List<Iterator<?>> listI = new ArrayList<Iterator<?>>(); | ||
| 79 | + 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++; | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + try { | ||
| 95 | + Map<String, Object> map=new HashMap<String, Object>(); | ||
| 96 | + listI.add(resList.iterator()); | ||
| 97 | + String path = this.getClass().getResource("/").getPath() + "static/pages/forms/"; | ||
| 98 | + ee.excelReplace(listI, new Object[] { map }, path + "mould/inoutstation.xls", | ||
| 99 | + path + "export/班次到离站.xls"); | ||
| 100 | + } catch (Exception e) { | ||
| 101 | + e.printStackTrace(); | ||
| 102 | + } | ||
| 103 | + return resList; | ||
| 104 | + } | ||
| 40 | @RequestMapping(value = "/sreachZd", method = RequestMethod.GET) | 105 | @RequestMapping(value = "/sreachZd", method = RequestMethod.GET) |
| 41 | public List<Map<String, String>> sreachPersonnel(@RequestParam String line,@RequestParam int zdlx,@RequestParam String zd) { | 106 | public List<Map<String, String>> sreachPersonnel(@RequestParam String line,@RequestParam int zdlx,@RequestParam String zd) { |
| 42 | return service.sreachZd(line,zdlx, zd); | 107 | return service.sreachZd(line,zdlx, zd); |
src/main/java/com/bsth/controller/schedule/core/TTInfoDetailController.java
| @@ -5,11 +5,7 @@ import com.bsth.controller.schedule.BController; | @@ -5,11 +5,7 @@ import com.bsth.controller.schedule.BController; | ||
| 5 | import com.bsth.entity.schedule.TTInfoDetail; | 5 | import com.bsth.entity.schedule.TTInfoDetail; |
| 6 | import com.bsth.service.schedule.TTInfoDetailService; | 6 | import com.bsth.service.schedule.TTInfoDetailService; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | -import org.springframework.web.bind.annotation.PathVariable; | ||
| 9 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 10 | -import org.springframework.web.bind.annotation.RequestMethod; | ||
| 11 | -import org.springframework.web.bind.annotation.RequestParam; | ||
| 12 | -import org.springframework.web.bind.annotation.RestController; | 8 | +import org.springframework.web.bind.annotation.*; |
| 13 | 9 | ||
| 14 | import java.util.HashMap; | 10 | import java.util.HashMap; |
| 15 | import java.util.List; | 11 | import java.util.List; |
| @@ -88,6 +84,20 @@ public class TTInfoDetailController extends BController<TTInfoDetail, Long> { | @@ -88,6 +84,20 @@ public class TTInfoDetailController extends BController<TTInfoDetail, Long> { | ||
| 88 | } | 84 | } |
| 89 | return rtn; | 85 | return rtn; |
| 90 | } | 86 | } |
| 87 | + | ||
| 88 | + @RequestMapping(value = "/zd_tcc", method = RequestMethod.GET) | ||
| 89 | + public Map<String, Object> getZdAndTccInfo(Integer lineid, Integer xldir) { | ||
| 90 | + Map<String, Object> rtn = new HashMap<>(); | ||
| 91 | + try { | ||
| 92 | + List<Map<String, Object>> list = ttInfoDetailService.findZdAndTcc(lineid, xldir); | ||
| 93 | + rtn.put("status", ResponseCode.SUCCESS); | ||
| 94 | + rtn.put("data", list); | ||
| 95 | + } catch (Exception exp) { | ||
| 96 | + rtn.put("status", ResponseCode.ERROR); | ||
| 97 | + rtn.put("msg", exp.getMessage()); | ||
| 98 | + } | ||
| 99 | + return rtn; | ||
| 100 | + } | ||
| 91 | 101 | ||
| 92 | /** | 102 | /** |
| 93 | * 时刻表明细批量插入 | 103 | * 时刻表明细批量插入 |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| @@ -253,20 +253,22 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -253,20 +253,22 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 253 | //已完成班次数 | 253 | //已完成班次数 |
| 254 | int doneSum = dayOfSchedule.doneSum(sch.getClZbh()); | 254 | int doneSum = dayOfSchedule.doneSum(sch.getClZbh()); |
| 255 | ScheduleRealInfo next = dayOfSchedule.next(sch); | 255 | ScheduleRealInfo next = dayOfSchedule.next(sch); |
| 256 | - //通知客户端 | ||
| 257 | - sendUtils.sendZdsj(sch, next, doneSum); | ||
| 258 | //持久化 | 256 | //持久化 |
| 259 | dayOfSchedule.save(sch); | 257 | dayOfSchedule.save(sch); |
| 260 | 258 | ||
| 261 | - //准备执行下一个班次 | ||
| 262 | - if (next != null) { | 259 | + if(next != null){ |
| 263 | next.setQdzArrDatesj(sch.getZdsjActual()); | 260 | next.setQdzArrDatesj(sch.getZdsjActual()); |
| 264 | dayOfSchedule.addExecPlan(next); | 261 | dayOfSchedule.addExecPlan(next); |
| 265 | //进站既进场 | 262 | //进站既进场 |
| 266 | inStationAndInPark(sch, next); | 263 | inStationAndInPark(sch, next); |
| 264 | + } | ||
| 265 | + //通知客户端 | ||
| 266 | + sendUtils.sendZdsj(sch, next, doneSum); | ||
| 267 | + | ||
| 268 | + //准备执行下一个班次 | ||
| 269 | + if (next != null) { | ||
| 267 | //将gps转换为下一个班次走向的站内信号 | 270 | //将gps转换为下一个班次走向的站内信号 |
| 268 | transformUpdown(gps, next); | 271 | transformUpdown(gps, next); |
| 269 | - | ||
| 270 | //下发调度指令 | 272 | //下发调度指令 |
| 271 | directiveService.send60Dispatch(next, doneSum, "到站@系统"); | 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,7 +11,10 @@ import com.bsth.data.directive.DirectivesPstThread; | ||
| 11 | import com.bsth.data.gpsdata.GpsRealData; | 11 | import com.bsth.data.gpsdata.GpsRealData; |
| 12 | import com.bsth.data.gpsdata.recovery.GpsDataRecovery; | 12 | import com.bsth.data.gpsdata.recovery.GpsDataRecovery; |
| 13 | import com.bsth.data.schedule.late_adjust.ScheduleLateThread; | 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 | import com.bsth.entity.realcontrol.LineConfig; | 18 | import com.bsth.entity.realcontrol.LineConfig; |
| 16 | import com.bsth.entity.realcontrol.ScheduleRealInfo; | 19 | import com.bsth.entity.realcontrol.ScheduleRealInfo; |
| 17 | import com.bsth.entity.schedule.SchedulePlanInfo; | 20 | import com.bsth.entity.schedule.SchedulePlanInfo; |
| @@ -146,7 +149,7 @@ public class DayOfSchedule implements CommandLineRunner { | @@ -146,7 +149,7 @@ public class DayOfSchedule implements CommandLineRunner { | ||
| 146 | //入库 | 149 | //入库 |
| 147 | // Application.mainServices.scheduleWithFixedDelay(schedulePstThread, 60, 30, TimeUnit.SECONDS); | 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 | //每天凌晨2点20提交数据到运管处 | 154 | //每天凌晨2点20提交数据到运管处 |
| 152 | long diff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis(); | 155 | long diff = (DateUtils.getTimestamp() + 1000 * 60 * 140) - System.currentTimeMillis(); |
src/main/java/com/bsth/data/schedule/late_adjust/LateAdjustHandle.java
| @@ -116,17 +116,20 @@ public class LateAdjustHandle implements ApplicationContextAware{ | @@ -116,17 +116,20 @@ public class LateAdjustHandle implements ApplicationContextAware{ | ||
| 116 | return; | 116 | return; |
| 117 | 117 | ||
| 118 | //进的是班次起点 | 118 | //进的是班次起点 |
| 119 | - if(gps.getStopNo().equals(sch.getQdzCode()) | 119 | + if(gps.getStationName().equals(sch.getQdzName()) |
| 120 | && sch.getLateMinute() > 0){ | 120 | && sch.getLateMinute() > 0){ |
| 121 | //自动调整待发 到达时间 + 停靠时间 | 121 | //自动调整待发 到达时间 + 停靠时间 |
| 122 | - long dt = gps.getTimestamp() + (Long.parseLong(String.valueOf(sch.getLateMinute() * 60 * 1000))); | 122 | + long dt = (long) (gps.getTimestamp() + (sch.getLateMinute() * 60 * 1000)); |
| 123 | sch.setDfsjAll(dt); | 123 | sch.setDfsjAll(dt); |
| 124 | sch.setDfAuto(true); | 124 | sch.setDfAuto(true); |
| 125 | + //取消应发未到标记 | ||
| 126 | + sch.setLate2(false); | ||
| 125 | 127 | ||
| 126 | lateSchMap.remove(sch.getClZbh()); | 128 | lateSchMap.remove(sch.getClZbh()); |
| 127 | logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt); | 129 | logger.info("【应发未到】车辆到站 " + sch.getClZbh() + " -" + sch.getDfsj() + " -到站时间:" + gps.getTimestamp() + " -停靠时间:" + sch.getLateMinute() + " -自动设置的待发时间:" + dt); |
| 128 | } | 130 | } |
| 129 | }catch (Exception e){ | 131 | }catch (Exception e){ |
| 132 | + e.printStackTrace(); | ||
| 130 | logger.error("", e); | 133 | logger.error("", e); |
| 131 | } | 134 | } |
| 132 | } | 135 | } |
src/main/java/com/bsth/data/schedule/late_adjust/ScheduleLateThread.java
| @@ -19,7 +19,7 @@ import java.util.List; | @@ -19,7 +19,7 @@ import java.util.List; | ||
| 19 | * @ClassName: ScheduleLateThread | 19 | * @ClassName: ScheduleLateThread |
| 20 | * @Description: TODO(班次误点扫描线程) | 20 | * @Description: TODO(班次误点扫描线程) |
| 21 | * @author PanZhao | 21 | * @author PanZhao |
| 22 | - * @date 2016年8月31日 下午3:09:02 | 22 | + * @date 2016年8月31日 下午3:09:02 |
| 23 | * | 23 | * |
| 24 | */ | 24 | */ |
| 25 | @Component | 25 | @Component |
| @@ -44,11 +44,14 @@ public class ScheduleLateThread extends Thread{ | @@ -44,11 +44,14 @@ public class ScheduleLateThread extends Thread{ | ||
| 44 | ScheduleRealInfo sch; | 44 | ScheduleRealInfo sch; |
| 45 | for(int i = 0; i < size; i ++){ | 45 | for(int i = 0; i < size; i ++){ |
| 46 | sch = all.get(i); | 46 | sch = all.get(i); |
| 47 | - if(sch.getDfsjT() > t || sch.isLate()) | 47 | + if(sch.getDfsjT() > t) |
| 48 | break; | 48 | break; |
| 49 | 49 | ||
| 50 | + if(sch.isLate()) | ||
| 51 | + continue; | ||
| 52 | + | ||
| 50 | if(sch.getStatus() == 0 | 53 | if(sch.getStatus() == 0 |
| 51 | - && sch.getFcsjActual() == null){ | 54 | + && StringUtils.isEmpty(sch.getFcsjActual())){ |
| 52 | 55 | ||
| 53 | //检查应发未到 当前班次无起点到达时间 | 56 | //检查应发未到 当前班次无起点到达时间 |
| 54 | if(StringUtils.isEmpty(sch.getQdzArrDateSJ())){ | 57 | if(StringUtils.isEmpty(sch.getQdzArrDateSJ())){ |
src/main/java/com/bsth/entity/mcy_forms/Operationservice.java
| @@ -3,7 +3,7 @@ package com.bsth.entity.mcy_forms; | @@ -3,7 +3,7 @@ package com.bsth.entity.mcy_forms; | ||
| 3 | public class Operationservice { | 3 | public class Operationservice { |
| 4 | 4 | ||
| 5 | private String xlName;//线路 | 5 | private String xlName;//线路 |
| 6 | - | 6 | + private String xlBm;//线路编码 |
| 7 | private String jzl;//加注量 | 7 | private String jzl;//加注量 |
| 8 | 8 | ||
| 9 | private String xhl;//消耗量 | 9 | private String xhl;//消耗量 |
| @@ -81,6 +81,14 @@ public class Operationservice { | @@ -81,6 +81,14 @@ public class Operationservice { | ||
| 81 | public void setSjbc(String sjbc) { | 81 | public void setSjbc(String sjbc) { |
| 82 | this.sjbc = sjbc; | 82 | this.sjbc = sjbc; |
| 83 | } | 83 | } |
| 84 | + | ||
| 85 | + public String getXlBm() { | ||
| 86 | + return xlBm; | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + public void setXlBm(String xlBm) { | ||
| 90 | + this.xlBm = xlBm; | ||
| 91 | + } | ||
| 84 | 92 | ||
| 85 | 93 | ||
| 86 | } | 94 | } |
src/main/java/com/bsth/entity/schedule/SchedulePlanInfo.java
| @@ -88,16 +88,18 @@ public class SchedulePlanInfo { | @@ -88,16 +88,18 @@ public class SchedulePlanInfo { | ||
| 88 | @Column(nullable = false) | 88 | @Column(nullable = false) |
| 89 | private String xlDir; | 89 | private String xlDir; |
| 90 | /** 起点站id,根据班次类型,会关联 bsth_c_station,或 bsth_c_car_park,不做mapping */ | 90 | /** 起点站id,根据班次类型,会关联 bsth_c_station,或 bsth_c_car_park,不做mapping */ |
| 91 | - @Column(nullable = false) | ||
| 92 | - private Integer qdz; | 91 | + // 这个字段以后不用了 |
| 92 | +// @Column(nullable = false) | ||
| 93 | +// private Integer qdz; | ||
| 93 | /** 起点站code */ | 94 | /** 起点站code */ |
| 94 | private String qdzCode; | 95 | private String qdzCode; |
| 95 | /** 起点站名字 */ | 96 | /** 起点站名字 */ |
| 96 | @Column(nullable = false) | 97 | @Column(nullable = false) |
| 97 | private String qdzName; | 98 | private String qdzName; |
| 98 | /** 终点站id,根据班次类型,会关联 bsth_c_station,或 bsth_c_car_park,不做mapping */ | 99 | /** 终点站id,根据班次类型,会关联 bsth_c_station,或 bsth_c_car_park,不做mapping */ |
| 99 | - @Column(nullable = false) | ||
| 100 | - private Integer zdz; | 100 | + // 这个字段以后不用了 |
| 101 | +// @Column(nullable = false) | ||
| 102 | +// private Integer zdz; | ||
| 101 | /** 终点站code */ | 103 | /** 终点站code */ |
| 102 | private String zdzCode; | 104 | private String zdzCode; |
| 103 | /** 终点站名字 */ | 105 | /** 终点站名字 */ |
| @@ -238,28 +240,10 @@ public class SchedulePlanInfo { | @@ -238,28 +240,10 @@ public class SchedulePlanInfo { | ||
| 238 | // 时刻明细数据 | 240 | // 时刻明细数据 |
| 239 | this.xlDir = ttInfoDetail.getXlDir(); // 线路上下行 | 241 | this.xlDir = ttInfoDetail.getXlDir(); // 线路上下行 |
| 240 | this.bcType = ttInfoDetail.getBcType(); // 班次类型 | 242 | this.bcType = ttInfoDetail.getBcType(); // 班次类型 |
| 241 | - if ("out".equals(this.bcType)) { // 出场班次 | ||
| 242 | - this.qdz = ttInfoDetail.getTcc().getId(); // 起点站-停车场id | ||
| 243 | - this.qdzCode = ttInfoDetail.getTcc().getParkCode(); // 起点站-停车场code | ||
| 244 | - this.qdzName = ttInfoDetail.getTcc().getParkName(); // 起点站-停车场name | ||
| 245 | - this.zdz = ttInfoDetail.getZdz().getId(); // 终点站id | ||
| 246 | - this.zdzCode = ttInfoDetail.getZdz().getStationCod(); // 终点站code | ||
| 247 | - this.zdzName = ttInfoDetail.getZdz().getStationName(); // 终点站name | ||
| 248 | - } else if ("in".equals(this.bcType)) { // 进场班次 | ||
| 249 | - this.qdz = ttInfoDetail.getQdz().getId(); // 起点站id | ||
| 250 | - this.qdzCode = ttInfoDetail.getQdz().getStationCod(); // 起点站code | ||
| 251 | - this.qdzName = ttInfoDetail.getQdz().getStationName(); // 起点站name | ||
| 252 | - this.zdz = ttInfoDetail.getTcc().getId(); // 终点站-停车场id | ||
| 253 | - this.zdzCode = ttInfoDetail.getTcc().getParkCode(); // 终点站-停车场code | ||
| 254 | - this.zdzName = ttInfoDetail.getTcc().getParkName(); // 终点站-停车场name | ||
| 255 | - } else { // 其他班次 | ||
| 256 | - this.qdz = ttInfoDetail.getQdz().getId(); // 起点站id | ||
| 257 | - this.qdzCode = ttInfoDetail.getQdz().getStationCod(); // 起点站code | ||
| 258 | - this.qdzName = ttInfoDetail.getQdz().getStationName(); // 起点站name | ||
| 259 | - this.zdz = ttInfoDetail.getZdz().getId(); // 终点站id | ||
| 260 | - this.zdzCode = ttInfoDetail.getZdz().getStationCod(); // 终点站code | ||
| 261 | - this.zdzName = ttInfoDetail.getZdz().getStationName(); // 终点站name | ||
| 262 | - } | 243 | + this.qdzCode = ttInfoDetail.getQdzCode(); // 起点站code |
| 244 | + this.qdzName = ttInfoDetail.getQdzName(); // 起点站name | ||
| 245 | + this.zdzCode = ttInfoDetail.getZdzCode(); // 终点站code | ||
| 246 | + this.zdzName = ttInfoDetail.getZdzName(); // 终点站name | ||
| 263 | 247 | ||
| 264 | this.fcsj = ttInfoDetail.getFcsj(); // 发车时间 | 248 | this.fcsj = ttInfoDetail.getFcsj(); // 发车时间 |
| 265 | this.fcno = ttInfoDetail.getFcno(); // 发车顺序号 | 249 | this.fcno = ttInfoDetail.getFcno(); // 发车顺序号 |
| @@ -280,7 +264,7 @@ public class SchedulePlanInfo { | @@ -280,7 +264,7 @@ public class SchedulePlanInfo { | ||
| 280 | if (pzType != null && !pzType.equals("BSY")) { | 264 | if (pzType != null && !pzType.equals("BSY")) { |
| 281 | if ("ZW".equals(pzType)) { // 只看早晚进出场 | 265 | if ("ZW".equals(pzType)) { // 只看早晚进出场 |
| 282 | if (isFirstBc) { // 第一个班次是出场 | 266 | if (isFirstBc) { // 第一个班次是出场 |
| 283 | - this.qdz = carConfigInfo.getTcc().getId(); // 起点站-停车场id | 267 | +// this.qdz = carConfigInfo.getTcc().getId(); // 起点站-停车场id |
| 284 | this.qdzCode = carConfigInfo.getTcc().getParkCode(); // 起点站-停车场code | 268 | this.qdzCode = carConfigInfo.getTcc().getParkCode(); // 起点站-停车场code |
| 285 | this.qdzName = carConfigInfo.getTcc().getParkName(); // 起点站-停车场name | 269 | this.qdzName = carConfigInfo.getTcc().getParkName(); // 起点站-停车场name |
| 286 | 270 | ||
| @@ -288,7 +272,7 @@ public class SchedulePlanInfo { | @@ -288,7 +272,7 @@ public class SchedulePlanInfo { | ||
| 288 | this.bcsj = "0".equals(this.xlDir) ? carConfigInfo.getUpOutSj().intValue() : carConfigInfo.getDownOutSj().intValue(); | 272 | this.bcsj = "0".equals(this.xlDir) ? carConfigInfo.getUpOutSj().intValue() : carConfigInfo.getDownOutSj().intValue(); |
| 289 | 273 | ||
| 290 | } else if (isLastBc) { // 最后一个班次是进场 | 274 | } else if (isLastBc) { // 最后一个班次是进场 |
| 291 | - this.zdz = carConfigInfo.getTcc().getId(); // 终点站-停车场id | 275 | +// this.zdz = carConfigInfo.getTcc().getId(); // 终点站-停车场id |
| 292 | this.zdzCode = carConfigInfo.getTcc().getParkCode(); // 终点站-停车场code | 276 | this.zdzCode = carConfigInfo.getTcc().getParkCode(); // 终点站-停车场code |
| 293 | this.zdzName = carConfigInfo.getTcc().getParkName(); // 终点站-停车场name | 277 | this.zdzName = carConfigInfo.getTcc().getParkName(); // 终点站-停车场name |
| 294 | 278 | ||
| @@ -298,7 +282,7 @@ public class SchedulePlanInfo { | @@ -298,7 +282,7 @@ public class SchedulePlanInfo { | ||
| 298 | 282 | ||
| 299 | } else if ("FS".equals(pzType)) { // 所有进出场 | 283 | } else if ("FS".equals(pzType)) { // 所有进出场 |
| 300 | if ("out".equals(this.bcType)) { // 出场班次 | 284 | if ("out".equals(this.bcType)) { // 出场班次 |
| 301 | - this.qdz = carConfigInfo.getTcc().getId(); // 起点站-停车场id | 285 | +// this.qdz = carConfigInfo.getTcc().getId(); // 起点站-停车场id |
| 302 | this.qdzCode = carConfigInfo.getTcc().getParkCode(); // 起点站-停车场code | 286 | this.qdzCode = carConfigInfo.getTcc().getParkCode(); // 起点站-停车场code |
| 303 | this.qdzName = carConfigInfo.getTcc().getParkName(); // 起点站-停车场name | 287 | this.qdzName = carConfigInfo.getTcc().getParkName(); // 起点站-停车场name |
| 304 | 288 | ||
| @@ -306,7 +290,7 @@ public class SchedulePlanInfo { | @@ -306,7 +290,7 @@ public class SchedulePlanInfo { | ||
| 306 | this.bcsj = "0".equals(this.xlDir) ? carConfigInfo.getUpOutSj().intValue() : carConfigInfo.getDownOutSj().intValue(); | 290 | this.bcsj = "0".equals(this.xlDir) ? carConfigInfo.getUpOutSj().intValue() : carConfigInfo.getDownOutSj().intValue(); |
| 307 | 291 | ||
| 308 | } else if ("in".equals(this.bcType)) { | 292 | } else if ("in".equals(this.bcType)) { |
| 309 | - this.zdz = carConfigInfo.getTcc().getId(); // 终点站-停车场id | 293 | +// this.zdz = carConfigInfo.getTcc().getId(); // 终点站-停车场id |
| 310 | this.zdzCode = carConfigInfo.getTcc().getParkCode(); // 终点站-停车场code | 294 | this.zdzCode = carConfigInfo.getTcc().getParkCode(); // 终点站-停车场code |
| 311 | this.zdzName = carConfigInfo.getTcc().getParkName(); // 终点站-停车场name | 295 | this.zdzName = carConfigInfo.getTcc().getParkName(); // 终点站-停车场name |
| 312 | 296 | ||
| @@ -319,14 +303,6 @@ public class SchedulePlanInfo { | @@ -319,14 +303,6 @@ public class SchedulePlanInfo { | ||
| 319 | } | 303 | } |
| 320 | 304 | ||
| 321 | 305 | ||
| 322 | - public Integer getS() { | ||
| 323 | - return s; | ||
| 324 | - } | ||
| 325 | - | ||
| 326 | - public void setS(Integer s) { | ||
| 327 | - this.s = s; | ||
| 328 | - } | ||
| 329 | - | ||
| 330 | public Long getId() { | 306 | public Long getId() { |
| 331 | return id; | 307 | return id; |
| 332 | } | 308 | } |
| @@ -343,6 +319,46 @@ public class SchedulePlanInfo { | @@ -343,6 +319,46 @@ public class SchedulePlanInfo { | ||
| 343 | this.scheduleDate = scheduleDate; | 319 | this.scheduleDate = scheduleDate; |
| 344 | } | 320 | } |
| 345 | 321 | ||
| 322 | + public String getGsName() { | ||
| 323 | + return gsName; | ||
| 324 | + } | ||
| 325 | + | ||
| 326 | + public void setGsName(String gsName) { | ||
| 327 | + this.gsName = gsName; | ||
| 328 | + } | ||
| 329 | + | ||
| 330 | + public String getGsBm() { | ||
| 331 | + return gsBm; | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + public void setGsBm(String gsBm) { | ||
| 335 | + this.gsBm = gsBm; | ||
| 336 | + } | ||
| 337 | + | ||
| 338 | + public String getFgsName() { | ||
| 339 | + return fgsName; | ||
| 340 | + } | ||
| 341 | + | ||
| 342 | + public void setFgsName(String fgsName) { | ||
| 343 | + this.fgsName = fgsName; | ||
| 344 | + } | ||
| 345 | + | ||
| 346 | + public String getFgsBm() { | ||
| 347 | + return fgsBm; | ||
| 348 | + } | ||
| 349 | + | ||
| 350 | + public void setFgsBm(String fgsBm) { | ||
| 351 | + this.fgsBm = fgsBm; | ||
| 352 | + } | ||
| 353 | + | ||
| 354 | + public Integer getCcno() { | ||
| 355 | + return ccno; | ||
| 356 | + } | ||
| 357 | + | ||
| 358 | + public void setCcno(Integer ccno) { | ||
| 359 | + this.ccno = ccno; | ||
| 360 | + } | ||
| 361 | + | ||
| 346 | public Integer getXl() { | 362 | public Integer getXl() { |
| 347 | return xl; | 363 | return xl; |
| 348 | } | 364 | } |
| @@ -439,6 +455,14 @@ public class SchedulePlanInfo { | @@ -439,6 +455,14 @@ public class SchedulePlanInfo { | ||
| 439 | this.jName = jName; | 455 | this.jName = jName; |
| 440 | } | 456 | } |
| 441 | 457 | ||
| 458 | + public Integer getS() { | ||
| 459 | + return s; | ||
| 460 | + } | ||
| 461 | + | ||
| 462 | + public void setS(Integer s) { | ||
| 463 | + this.s = s; | ||
| 464 | + } | ||
| 465 | + | ||
| 442 | public String getsGh() { | 466 | public String getsGh() { |
| 443 | return sGh; | 467 | return sGh; |
| 444 | } | 468 | } |
| @@ -463,12 +487,12 @@ public class SchedulePlanInfo { | @@ -463,12 +487,12 @@ public class SchedulePlanInfo { | ||
| 463 | this.xlDir = xlDir; | 487 | this.xlDir = xlDir; |
| 464 | } | 488 | } |
| 465 | 489 | ||
| 466 | - public Integer getQdz() { | ||
| 467 | - return qdz; | 490 | + public String getQdzCode() { |
| 491 | + return qdzCode; | ||
| 468 | } | 492 | } |
| 469 | 493 | ||
| 470 | - public void setQdz(Integer qdz) { | ||
| 471 | - this.qdz = qdz; | 494 | + public void setQdzCode(String qdzCode) { |
| 495 | + this.qdzCode = qdzCode; | ||
| 472 | } | 496 | } |
| 473 | 497 | ||
| 474 | public String getQdzName() { | 498 | public String getQdzName() { |
| @@ -479,12 +503,12 @@ public class SchedulePlanInfo { | @@ -479,12 +503,12 @@ public class SchedulePlanInfo { | ||
| 479 | this.qdzName = qdzName; | 503 | this.qdzName = qdzName; |
| 480 | } | 504 | } |
| 481 | 505 | ||
| 482 | - public Integer getZdz() { | ||
| 483 | - return zdz; | 506 | + public String getZdzCode() { |
| 507 | + return zdzCode; | ||
| 484 | } | 508 | } |
| 485 | 509 | ||
| 486 | - public void setZdz(Integer zdz) { | ||
| 487 | - this.zdz = zdz; | 510 | + public void setZdzCode(String zdzCode) { |
| 511 | + this.zdzCode = zdzCode; | ||
| 488 | } | 512 | } |
| 489 | 513 | ||
| 490 | public String getZdzName() { | 514 | public String getZdzName() { |
| @@ -543,6 +567,30 @@ public class SchedulePlanInfo { | @@ -543,6 +567,30 @@ public class SchedulePlanInfo { | ||
| 543 | this.bcType = bcType; | 567 | this.bcType = bcType; |
| 544 | } | 568 | } |
| 545 | 569 | ||
| 570 | + public Long getTtInfo() { | ||
| 571 | + return ttInfo; | ||
| 572 | + } | ||
| 573 | + | ||
| 574 | + public void setTtInfo(Long ttInfo) { | ||
| 575 | + this.ttInfo = ttInfo; | ||
| 576 | + } | ||
| 577 | + | ||
| 578 | + public String getTtInfoName() { | ||
| 579 | + return ttInfoName; | ||
| 580 | + } | ||
| 581 | + | ||
| 582 | + public void setTtInfoName(String ttInfoName) { | ||
| 583 | + this.ttInfoName = ttInfoName; | ||
| 584 | + } | ||
| 585 | + | ||
| 586 | + public String getRemark() { | ||
| 587 | + return remark; | ||
| 588 | + } | ||
| 589 | + | ||
| 590 | + public void setRemark(String remark) { | ||
| 591 | + this.remark = remark; | ||
| 592 | + } | ||
| 593 | + | ||
| 546 | public SysUser getCreateBy() { | 594 | public SysUser getCreateBy() { |
| 547 | return createBy; | 595 | return createBy; |
| 548 | } | 596 | } |
| @@ -575,62 +623,6 @@ public class SchedulePlanInfo { | @@ -575,62 +623,6 @@ public class SchedulePlanInfo { | ||
| 575 | this.updateDate = updateDate; | 623 | this.updateDate = updateDate; |
| 576 | } | 624 | } |
| 577 | 625 | ||
| 578 | - public String getQdzCode() { | ||
| 579 | - return qdzCode; | ||
| 580 | - } | ||
| 581 | - | ||
| 582 | - public void setQdzCode(String qdzCode) { | ||
| 583 | - this.qdzCode = qdzCode; | ||
| 584 | - } | ||
| 585 | - | ||
| 586 | - public String getZdzCode() { | ||
| 587 | - return zdzCode; | ||
| 588 | - } | ||
| 589 | - | ||
| 590 | - public void setZdzCode(String zdzCode) { | ||
| 591 | - this.zdzCode = zdzCode; | ||
| 592 | - } | ||
| 593 | - | ||
| 594 | - public String getGsName() { | ||
| 595 | - return gsName; | ||
| 596 | - } | ||
| 597 | - | ||
| 598 | - public void setGsName(String gsName) { | ||
| 599 | - this.gsName = gsName; | ||
| 600 | - } | ||
| 601 | - | ||
| 602 | - public String getGsBm() { | ||
| 603 | - return gsBm; | ||
| 604 | - } | ||
| 605 | - | ||
| 606 | - public void setGsBm(String gsBm) { | ||
| 607 | - this.gsBm = gsBm; | ||
| 608 | - } | ||
| 609 | - | ||
| 610 | - public String getFgsName() { | ||
| 611 | - return fgsName; | ||
| 612 | - } | ||
| 613 | - | ||
| 614 | - public void setFgsName(String fgsName) { | ||
| 615 | - this.fgsName = fgsName; | ||
| 616 | - } | ||
| 617 | - | ||
| 618 | - public String getFgsBm() { | ||
| 619 | - return fgsBm; | ||
| 620 | - } | ||
| 621 | - | ||
| 622 | - public void setFgsBm(String fgsBm) { | ||
| 623 | - this.fgsBm = fgsBm; | ||
| 624 | - } | ||
| 625 | - | ||
| 626 | - public Integer getCcno() { | ||
| 627 | - return ccno; | ||
| 628 | - } | ||
| 629 | - | ||
| 630 | - public void setCcno(Integer ccno) { | ||
| 631 | - this.ccno = ccno; | ||
| 632 | - } | ||
| 633 | - | ||
| 634 | public SchedulePlan getSchedulePlan() { | 626 | public SchedulePlan getSchedulePlan() { |
| 635 | return schedulePlan; | 627 | return schedulePlan; |
| 636 | } | 628 | } |
| @@ -638,28 +630,4 @@ public class SchedulePlanInfo { | @@ -638,28 +630,4 @@ public class SchedulePlanInfo { | ||
| 638 | public void setSchedulePlan(SchedulePlan schedulePlan) { | 630 | public void setSchedulePlan(SchedulePlan schedulePlan) { |
| 639 | this.schedulePlan = schedulePlan; | 631 | this.schedulePlan = schedulePlan; |
| 640 | } | 632 | } |
| 641 | - | ||
| 642 | - public Long getTtInfo() { | ||
| 643 | - return ttInfo; | ||
| 644 | - } | ||
| 645 | - | ||
| 646 | - public void setTtInfo(Long ttInfo) { | ||
| 647 | - this.ttInfo = ttInfo; | ||
| 648 | - } | ||
| 649 | - | ||
| 650 | - public String getTtInfoName() { | ||
| 651 | - return ttInfoName; | ||
| 652 | - } | ||
| 653 | - | ||
| 654 | - public void setTtInfoName(String ttInfoName) { | ||
| 655 | - this.ttInfoName = ttInfoName; | ||
| 656 | - } | ||
| 657 | - | ||
| 658 | - public String getRemark() { | ||
| 659 | - return remark; | ||
| 660 | - } | ||
| 661 | - | ||
| 662 | - public void setRemark(String remark) { | ||
| 663 | - this.remark = remark; | ||
| 664 | - } | ||
| 665 | } | 633 | } |
src/main/java/com/bsth/entity/schedule/TTInfoDetail.java
| @@ -47,16 +47,28 @@ public class TTInfoDetail extends BEntity { | @@ -47,16 +47,28 @@ public class TTInfoDetail extends BEntity { | ||
| 47 | /** 线路方向(TODO:上下行,上行,下行,这个以后用枚举还是字典再议,现在先用文字) */ | 47 | /** 线路方向(TODO:上下行,上行,下行,这个以后用枚举还是字典再议,现在先用文字) */ |
| 48 | @Column(nullable = false) | 48 | @Column(nullable = false) |
| 49 | private String xlDir; | 49 | private String xlDir; |
| 50 | - /** 起点站关联 */ | 50 | + |
| 51 | + /** 起点站关联(以后不用了,暂时留着) */ | ||
| 51 | @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY) | 52 | @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY) |
| 52 | private Station qdz; | 53 | private Station qdz; |
| 53 | - /** 终点站关联 */ | 54 | + /** 终点站关联(以后不用了,暂时留着) */ |
| 54 | @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY) | 55 | @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY) |
| 55 | private Station zdz; | 56 | private Station zdz; |
| 56 | - /** 停车场关联(出场,进场班次会关联停车场) */ | 57 | + /** 停车场关联(出场,进场班次会关联停车场)(以后不用了,暂时留着) */ |
| 57 | @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY) | 58 | @ManyToOne(cascade = CascadeType.DETACH, fetch = FetchType.LAZY) |
| 58 | private CarPark tcc; | 59 | private CarPark tcc; |
| 59 | 60 | ||
| 61 | + // 站点包括普通站点和停车场(站点编码不同,使用站点编码区分) | ||
| 62 | + // 以后不需要再区分是站点还是停车场了 | ||
| 63 | + /** 起站点代码(bsth_c_station,bsth_c_car_park 里的编码) */ | ||
| 64 | + private String qdzCode; | ||
| 65 | + /** 起站点名字(bsth_c_stationroute,bsth_c_car_park里的名字) */ | ||
| 66 | + private String qdzName; | ||
| 67 | + /** 终点站代码(bsth_c_station,bsth_c_car_park 里的编码) */ | ||
| 68 | + private String zdzCode; | ||
| 69 | + /** 终点站名字(bsth_c_stationroute,bsth_c_car_park里的名字) */ | ||
| 70 | + private String zdzName; | ||
| 71 | + | ||
| 60 | /** 发车时间(格式 HH:mm) */ | 72 | /** 发车时间(格式 HH:mm) */ |
| 61 | @Column(nullable = false, length = 5) | 73 | @Column(nullable = false, length = 5) |
| 62 | private String fcsj; | 74 | private String fcsj; |
| @@ -236,4 +248,36 @@ public class TTInfoDetail extends BEntity { | @@ -236,4 +248,36 @@ public class TTInfoDetail extends BEntity { | ||
| 236 | public void setIsFB(Boolean isFB) { | 248 | public void setIsFB(Boolean isFB) { |
| 237 | this.isFB = isFB; | 249 | this.isFB = isFB; |
| 238 | } | 250 | } |
| 251 | + | ||
| 252 | + public String getQdzCode() { | ||
| 253 | + return qdzCode; | ||
| 254 | + } | ||
| 255 | + | ||
| 256 | + public void setQdzCode(String qdzCode) { | ||
| 257 | + this.qdzCode = qdzCode; | ||
| 258 | + } | ||
| 259 | + | ||
| 260 | + public String getQdzName() { | ||
| 261 | + return qdzName; | ||
| 262 | + } | ||
| 263 | + | ||
| 264 | + public void setQdzName(String qdzName) { | ||
| 265 | + this.qdzName = qdzName; | ||
| 266 | + } | ||
| 267 | + | ||
| 268 | + public String getZdzCode() { | ||
| 269 | + return zdzCode; | ||
| 270 | + } | ||
| 271 | + | ||
| 272 | + public void setZdzCode(String zdzCode) { | ||
| 273 | + this.zdzCode = zdzCode; | ||
| 274 | + } | ||
| 275 | + | ||
| 276 | + public String getZdzName() { | ||
| 277 | + return zdzName; | ||
| 278 | + } | ||
| 279 | + | ||
| 280 | + public void setZdzName(String zdzName) { | ||
| 281 | + this.zdzName = zdzName; | ||
| 282 | + } | ||
| 239 | } | 283 | } |
src/main/java/com/bsth/entity/schedule/temp/SchedulePlanRuleResult.java
| @@ -10,6 +10,7 @@ import java.util.Date; | @@ -10,6 +10,7 @@ import java.util.Date; | ||
| 10 | */ | 10 | */ |
| 11 | @Entity | 11 | @Entity |
| 12 | @Table(name = "bsth_c_s_sp_rule_rst") | 12 | @Table(name = "bsth_c_s_sp_rule_rst") |
| 13 | +// TODO:此表以后考虑表分区 | ||
| 13 | public class SchedulePlanRuleResult { | 14 | public class SchedulePlanRuleResult { |
| 14 | /** 主键Id */ | 15 | /** 主键Id */ |
| 15 | @Id | 16 | @Id |
| @@ -17,7 +18,8 @@ public class SchedulePlanRuleResult { | @@ -17,7 +18,8 @@ public class SchedulePlanRuleResult { | ||
| 17 | private Long id; | 18 | private Long id; |
| 18 | 19 | ||
| 19 | /** 线路id */ | 20 | /** 线路id */ |
| 20 | - private String xlId; | 21 | + // 这里要建一个索引 tt1 normal btree |
| 22 | + private Integer xlId; | ||
| 21 | /** 线路名字 */ | 23 | /** 线路名字 */ |
| 22 | private String xlName; | 24 | private String xlName; |
| 23 | 25 | ||
| @@ -49,6 +51,7 @@ public class SchedulePlanRuleResult { | @@ -49,6 +51,7 @@ public class SchedulePlanRuleResult { | ||
| 49 | private String ttinfoName; | 51 | private String ttinfoName; |
| 50 | 52 | ||
| 51 | /** 排班日期 */ | 53 | /** 排班日期 */ |
| 54 | + // 这里要建一个索引 tt2 normal btree | ||
| 52 | private Date scheduleDate; | 55 | private Date scheduleDate; |
| 53 | 56 | ||
| 54 | /** 操作人员id */ | 57 | /** 操作人员id */ |
| @@ -56,6 +59,7 @@ public class SchedulePlanRuleResult { | @@ -56,6 +59,7 @@ public class SchedulePlanRuleResult { | ||
| 56 | /** 操作人员姓名 */ | 59 | /** 操作人员姓名 */ |
| 57 | private String sysuserName; | 60 | private String sysuserName; |
| 58 | /** 操作时间 */ | 61 | /** 操作时间 */ |
| 62 | + // 这里要建一个索引 tt3 normal btree | ||
| 59 | private Date createDate; | 63 | private Date createDate; |
| 60 | 64 | ||
| 61 | public SchedulePlanRuleResult() { | 65 | public SchedulePlanRuleResult() { |
| @@ -76,6 +80,22 @@ public class SchedulePlanRuleResult { | @@ -76,6 +80,22 @@ public class SchedulePlanRuleResult { | ||
| 76 | this.id = id; | 80 | this.id = id; |
| 77 | } | 81 | } |
| 78 | 82 | ||
| 83 | + public Integer getXlId() { | ||
| 84 | + return xlId; | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + public void setXlId(Integer xlId) { | ||
| 88 | + this.xlId = xlId; | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + public String getXlName() { | ||
| 92 | + return xlName; | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + public void setXlName(String xlName) { | ||
| 96 | + this.xlName = xlName; | ||
| 97 | + } | ||
| 98 | + | ||
| 79 | public String getRuleId() { | 99 | public String getRuleId() { |
| 80 | return ruleId; | 100 | return ruleId; |
| 81 | } | 101 | } |
| @@ -148,6 +168,22 @@ public class SchedulePlanRuleResult { | @@ -148,6 +168,22 @@ public class SchedulePlanRuleResult { | ||
| 148 | this.ecindex = ecindex; | 168 | this.ecindex = ecindex; |
| 149 | } | 169 | } |
| 150 | 170 | ||
| 171 | + public String getTtinfoId() { | ||
| 172 | + return ttinfoId; | ||
| 173 | + } | ||
| 174 | + | ||
| 175 | + public void setTtinfoId(String ttinfoId) { | ||
| 176 | + this.ttinfoId = ttinfoId; | ||
| 177 | + } | ||
| 178 | + | ||
| 179 | + public String getTtinfoName() { | ||
| 180 | + return ttinfoName; | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + public void setTtinfoName(String ttinfoName) { | ||
| 184 | + this.ttinfoName = ttinfoName; | ||
| 185 | + } | ||
| 186 | + | ||
| 151 | public Date getScheduleDate() { | 187 | public Date getScheduleDate() { |
| 152 | return scheduleDate; | 188 | return scheduleDate; |
| 153 | } | 189 | } |
| @@ -179,36 +215,4 @@ public class SchedulePlanRuleResult { | @@ -179,36 +215,4 @@ public class SchedulePlanRuleResult { | ||
| 179 | public void setCreateDate(Date createDate) { | 215 | public void setCreateDate(Date createDate) { |
| 180 | this.createDate = createDate; | 216 | this.createDate = createDate; |
| 181 | } | 217 | } |
| 182 | - | ||
| 183 | - public String getXlId() { | ||
| 184 | - return xlId; | ||
| 185 | - } | ||
| 186 | - | ||
| 187 | - public void setXlId(String xlId) { | ||
| 188 | - this.xlId = xlId; | ||
| 189 | - } | ||
| 190 | - | ||
| 191 | - public String getXlName() { | ||
| 192 | - return xlName; | ||
| 193 | - } | ||
| 194 | - | ||
| 195 | - public void setXlName(String xlName) { | ||
| 196 | - this.xlName = xlName; | ||
| 197 | - } | ||
| 198 | - | ||
| 199 | - public String getTtinfoId() { | ||
| 200 | - return ttinfoId; | ||
| 201 | - } | ||
| 202 | - | ||
| 203 | - public void setTtinfoId(String ttinfoId) { | ||
| 204 | - this.ttinfoId = ttinfoId; | ||
| 205 | - } | ||
| 206 | - | ||
| 207 | - public String getTtinfoName() { | ||
| 208 | - return ttinfoName; | ||
| 209 | - } | ||
| 210 | - | ||
| 211 | - public void setTtinfoName(String ttinfoName) { | ||
| 212 | - this.ttinfoName = ttinfoName; | ||
| 213 | - } | ||
| 214 | } | 218 | } |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| @@ -151,18 +151,19 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -151,18 +151,19 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 151 | 151 | ||
| 152 | //按照时间段统计 | 152 | //按照时间段统计 |
| 153 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 153 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 154 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') and gsBm like %?4% and fgsBm like %?5% order by s.xlBm") | 154 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and gsBm like %?4% and fgsBm like %?5% order by s.xlBm") |
| 155 | List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm); | 155 | List<ScheduleRealInfo> scheduleByDateAndLineTj(String line,String date,String date2,String gsdm,String fgsdm); |
| 156 | 156 | ||
| 157 | //按照时间段统计 | 157 | //按照时间段统计 |
| 158 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 158 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 159 | - @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 and s.bcType not in ('in','out') order by s.xlBm") | 159 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 order by s.xlBm") |
| 160 | List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2); | 160 | List<ScheduleRealInfo> scheduleByDateAndLineTj2(String line,String date,String date2); |
| 161 | //月报表 | 161 | //月报表 |
| 162 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 162 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 163 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 order by s.xlBm") | 163 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') between ?2 and ?3 order by s.xlBm") |
| 164 | List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2); | 164 | List<ScheduleRealInfo> scheduleByDateAndLineYbb(String line,String date,String date2); |
| 165 | 165 | ||
| 166 | + | ||
| 166 | @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY clZbh,fcsj") | 167 | @Query(value="select new map(s.scheduleDate as scheduleDate,s.xlBm as xlBm,s.clZbh as clZbh,s.jGh as jGh,min(s.fcsj) as fcsj ) from ScheduleRealInfo s where s.xlBm like %?1% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and s.gsBm like %?3% and s.fgsBm like %?4% GROUP BY xlBm,clZbh,jGh,scheduleDate,jGh ORDER BY clZbh,fcsj") |
| 167 | List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm); | 168 | List<Map<String,Object>> yesterdayDataList(String line,String date,String gsbm,String fgsbm); |
| 168 | 169 |
src/main/java/com/bsth/repository/schedule/SchedulePlanRuleResultRepository.java
| @@ -2,24 +2,18 @@ package com.bsth.repository.schedule; | @@ -2,24 +2,18 @@ package com.bsth.repository.schedule; | ||
| 2 | 2 | ||
| 3 | import com.bsth.entity.schedule.temp.SchedulePlanRuleResult; | 3 | import com.bsth.entity.schedule.temp.SchedulePlanRuleResult; |
| 4 | import com.bsth.repository.BaseRepository; | 4 | import com.bsth.repository.BaseRepository; |
| 5 | -import org.springframework.data.jpa.repository.Modifying; | ||
| 6 | -import org.springframework.data.jpa.repository.Query; | ||
| 7 | import org.springframework.stereotype.Repository; | 5 | import org.springframework.stereotype.Repository; |
| 8 | 6 | ||
| 9 | -import java.util.Date; | ||
| 10 | -import java.util.List; | ||
| 11 | - | ||
| 12 | /** | 7 | /** |
| 13 | * Created by xu on 17/3/29. | 8 | * Created by xu on 17/3/29. |
| 14 | */ | 9 | */ |
| 15 | @Repository | 10 | @Repository |
| 16 | public interface SchedulePlanRuleResultRepository extends BaseRepository<SchedulePlanRuleResult, Long> { | 11 | public interface SchedulePlanRuleResultRepository extends BaseRepository<SchedulePlanRuleResult, Long> { |
| 17 | 12 | ||
| 18 | - @Query("select t from SchedulePlanRuleResult t " + | ||
| 19 | - "where not exists (select 1 from SchedulePlanRuleResult " + | ||
| 20 | - "where createDate > t.createDate and scheduleDate < ?2 ) " + | ||
| 21 | - "and t.xlId = ?1 and t.scheduleDate < ?2") | ||
| 22 | - List<SchedulePlanRuleResult> findLastByXl(String xlid, Date from); | 13 | +// @Query("select t from SchedulePlanRuleResult t " + |
| 14 | +// "where not exists (select 1 from SchedulePlanRuleResult " + | ||
| 15 | +// "where createDate > t.createDate and scheduleDate < ?2 ) " + | ||
| 16 | +// "and t.xlId = ?1 and t.scheduleDate < ?2") | ||
| 23 | 17 | ||
| 24 | // @Modifying | 18 | // @Modifying |
| 25 | // @Query("delete from SchedulePlanRuleResult t " + | 19 | // @Query("delete from SchedulePlanRuleResult t " + |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -539,55 +539,102 @@ public class FormsServiceImpl implements FormsService { | @@ -539,55 +539,102 @@ public class FormsServiceImpl implements FormsService { | ||
| 539 | // 运营服务阶段报表 | 539 | // 运营服务阶段报表 |
| 540 | @Override | 540 | @Override |
| 541 | public List<Operationservice> operationservice(Map<String, Object> map) { | 541 | public List<Operationservice> operationservice(Map<String, Object> map) { |
| 542 | - | ||
| 543 | - String sql = " SELECT r.schedule_date_str,r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name,r.bc_type " | ||
| 544 | - + " FROM bsth_c_s_sp_info_real r " | ||
| 545 | - // + "LEFT JOIN bsth_c_s_sp_info_real r on r.cl_zbh=y.NBBM" | ||
| 546 | - + " left join bsth_c_ylb y ON r.cl_zbh = y.nbbm " | ||
| 547 | - + " where 1=1 "; | ||
| 548 | - if(map.get("startDate").toString()!=""){ | ||
| 549 | - sql+=" and to_days(r.schedule_date_str) BETWEEN to_days('" + map.get("startDate").toString() + "') "; | ||
| 550 | - } | ||
| 551 | 542 | ||
| 552 | - if(map.get("endDate").toString()!=""){ | ||
| 553 | - sql+=" and to_days('" + map.get("endDate").toString() + "') "; | ||
| 554 | - } | ||
| 555 | - sql+=" and r.xl_bm='" + map.get("line").toString() + "'" ; | ||
| 556 | - sql+=" and r.bc_type not in('in','out')"; | ||
| 557 | - if(map.get("gsdmOperat").toString()!=""){ | ||
| 558 | - sql+=" and r.gs_bm='"+map.get("gsdmOperat").toString()+"'"; | 543 | + String xlbm=map.get("line").toString().trim(); |
| 544 | + String gsdm=""; | ||
| 545 | + if(map.get("gsdmOperat")!=null){ | ||
| 546 | + gsdm=map.get("gsdmOperat").toString(); | ||
| 559 | } | 547 | } |
| 560 | - if(map.get("fgsdmOperat").toString()!=""){ | ||
| 561 | - sql+=" and r.fgs_bm='"+map.get("fgsdmOperat").toString()+"'"; | 548 | + String fgsdm=""; |
| 549 | + if(map.get("fgsdmOperat")!=null){ | ||
| 550 | + fgsdm=map.get("fgsdmOperat").toString(); | ||
| 551 | + } | ||
| 552 | + startDate=map.get("startDate").toString(); | ||
| 553 | + endDate =map.get("endDate").toString(); | ||
| 554 | + String sql="select r.xl_bm" | ||
| 555 | + + " from bsth_c_s_sp_info_real r where" | ||
| 556 | + + " r.schedule_date_str BETWEEN '"+startDate+"' and '"+endDate+"'"; | ||
| 557 | + if(xlbm.equals("")){ | ||
| 558 | + sql +="and r.gs_bm='"+gsdm+"' " | ||
| 559 | + + " and r.fgs_bm='"+fgsdm+"'"; | ||
| 560 | + }else{ | ||
| 561 | + sql += " and r.xl_bm = '"+xlbm+"'"; | ||
| 562 | } | 562 | } |
| 563 | - sql += " AND r.gs_bm is not null"; | ||
| 564 | - sql += " GROUP BY r.xl_bm,r.xl_name,r.cl_zbh,r.j_gh,r.j_name,y.YH,y.JZL,r.gs_bm,r.gs_name,r.fgs_bm,r.fgs_name"; | ||
| 565 | - startDate = map.get("startDate").toString(); | ||
| 566 | - endDate = map.get("endDate").toString(); | ||
| 567 | - List<Operationservice> list = jdbcTemplate.query(sql, new RowMapper<Operationservice>() { | ||
| 568 | - | ||
| 569 | - @Override | ||
| 570 | - public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 571 | - Operationservice op = new Operationservice(); | ||
| 572 | - op.setXlName(arg0.getString("xl_name")); | ||
| 573 | - op.setJzl(arg0.getString("JZL")); | ||
| 574 | - op.setXhl(arg0.getString("YH")); | ||
| 575 | - op.setClzbh(arg0.getString("cl_zbh")); | ||
| 576 | - op.setJname(arg0.getString("j_name")); | 563 | + sql += " group by r.xl_bm"; |
| 564 | + | ||
| 565 | + | ||
| 566 | + List<Operationservice> list= jdbcTemplate.query(sql, new RowMapper<Operationservice>() { | ||
| 567 | + @Override | ||
| 568 | + public Operationservice mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 569 | + Operationservice ve = new Operationservice(); | ||
| 570 | + ve.setXlBm(arg0.getString("xl_bm")); | ||
| 571 | + return ve; | ||
| 572 | + } | ||
| 573 | + }); | ||
| 574 | + | ||
| 575 | + String ylbSql=" select * from bsth_c_ylb where rq BETWEEN '"+startDate+"' and '"+endDate+"'"; | ||
| 576 | + if(xlbm.equals("")){ | ||
| 577 | + ylbSql +="and ssgsdm='"+gsdm+"' " | ||
| 578 | + + " and fgsdm='"+fgsdm+"'"; | ||
| 579 | + }else{ | ||
| 580 | + ylbSql += " and xlbm = '"+xlbm+"'"; | ||
| 581 | + } | ||
| 582 | + List<Ylb> ylbList= jdbcTemplate.query(ylbSql, new RowMapper<Ylb>() { | ||
| 583 | + @Override | ||
| 584 | + public Ylb mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 585 | + Ylb y = new Ylb(); | ||
| 586 | + y.setXlbm(arg0.getString("xlbm")); | ||
| 587 | + y.setJzl(arg0.getDouble("jzl")); | ||
| 588 | + y.setYh(arg0.getDouble("yh")); | ||
| 589 | + return y; | ||
| 590 | + } | ||
| 591 | + }); | ||
| 592 | + List<ScheduleRealInfo> listReal; | ||
| 593 | + if(xlbm.equals("")){ | ||
| 594 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj(xlbm, startDate, endDate, gsdm, fgsdm); | ||
| 595 | + }else{ | ||
| 596 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineTj2(xlbm, startDate, endDate); | ||
| 597 | + } | ||
| 598 | + | ||
| 599 | + for (int i = 0; i < list.size(); i++) { | ||
| 600 | + Operationservice o=list.get(i); | ||
| 601 | + String line=o.getXlBm(); | ||
| 602 | + String xlname=BasicData.lineCode2NameMap.get(line); | ||
| 603 | + o.setXlName(xlname); | ||
| 604 | + | ||
| 605 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 606 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 607 | + ScheduleRealInfo s=listReal.get(j); | ||
| 608 | + if(s.getXlBm().equals(line)){ | ||
| 609 | + newList.add(s); | ||
| 610 | + } | ||
| 611 | + } | ||
| 612 | + | ||
| 613 | + int sjbc=culateMileageService.culateSjbc(newList,""); | ||
| 614 | + int ljbc=culateMileageService.culateLjbc(newList,""); | ||
| 615 | + double ksgl=culateMileageService.culateKsgl(newList); | ||
| 616 | + double jccgl=culateMileageService.culateJccgl(newList); | ||
| 617 | + | ||
| 618 | + double sjgl=culateMileageService.culateSjgl(newList); | ||
| 619 | + double ljgl=culateMileageService.culateLjgl(newList); | ||
| 577 | 620 | ||
| 578 | - return op; | 621 | + o.setEmptMileage(String.valueOf(Arith.add(ksgl, jccgl))); |
| 622 | + o.setXsgl(String.valueOf(Arith.add(sjgl, ljgl))); | ||
| 623 | + o.setSjbc(String.valueOf(sjbc+ljbc)); | ||
| 624 | + | ||
| 625 | + double jzl=0.0; | ||
| 626 | + double xhl=0.0; | ||
| 627 | + for (int j = 0; j < ylbList.size(); j++) { | ||
| 628 | + Ylb t=ylbList.get(j); | ||
| 629 | + if(t.getXlbm().equals(line)){ | ||
| 630 | + jzl=Arith.add(jzl, t.getJzl()); | ||
| 631 | + xhl=Arith.add(xhl, t.getYh()); | ||
| 632 | + } | ||
| 633 | + } | ||
| 634 | + | ||
| 635 | + o.setJzl(String.valueOf(jzl)); | ||
| 636 | + o.setXhl(String.valueOf(xhl)); | ||
| 579 | } | 637 | } |
| 580 | - }); | ||
| 581 | - | ||
| 582 | - for(int i=0;i<list.size();i++){ | ||
| 583 | - Operationservice o=list.get(i); | ||
| 584 | - Map<String, Object> maps = new HashMap<>(); | ||
| 585 | - maps = commonService.findKMBC1(o.getJname(), o.getClzbh(), startDate, | ||
| 586 | - endDate); | ||
| 587 | - o.setXsgl(maps.get("jhlc").toString() == null ? "" : maps.get("jhlc").toString()); | ||
| 588 | - o.setEmptMileage(maps.get("ksgl").toString() == null ? "" : maps.get("ksgl").toString()); | ||
| 589 | - o.setSjbc(maps.get("sjbc").toString() == null ? "" : maps.get("sjbc").toString()); | ||
| 590 | - } | ||
| 591 | return list; | 638 | return list; |
| 592 | } | 639 | } |
| 593 | 640 |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -3,6 +3,7 @@ package com.bsth.service.realcontrol.impl; | @@ -3,6 +3,7 @@ package com.bsth.service.realcontrol.impl; | ||
| 3 | import com.alibaba.fastjson.JSON; | 3 | import com.alibaba.fastjson.JSON; |
| 4 | import com.alibaba.fastjson.JSONArray; | 4 | import com.alibaba.fastjson.JSONArray; |
| 5 | import com.alibaba.fastjson.JSONObject; | 5 | import com.alibaba.fastjson.JSONObject; |
| 6 | +import com.alibaba.fastjson.support.odps.udf.CodecCheck.A; | ||
| 6 | import com.bsth.common.Constants; | 7 | import com.bsth.common.Constants; |
| 7 | import com.bsth.common.ResponseCode; | 8 | import com.bsth.common.ResponseCode; |
| 8 | import com.bsth.controller.realcontrol.dto.ChangePersonCar; | 9 | import com.bsth.controller.realcontrol.dto.ChangePersonCar; |
| @@ -1049,6 +1050,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1049,6 +1050,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1049 | ScheduleRealInfo next = dayOfSchedule.next(sch); | 1050 | ScheduleRealInfo next = dayOfSchedule.next(sch); |
| 1050 | if (null != next) { | 1051 | if (null != next) { |
| 1051 | next.setQdzArrDateSJ(zdsjActual); | 1052 | next.setQdzArrDateSJ(zdsjActual); |
| 1053 | + next.setLate2(false); | ||
| 1052 | ts.add(next); | 1054 | ts.add(next); |
| 1053 | } | 1055 | } |
| 1054 | 1056 | ||
| @@ -1669,9 +1671,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1669,9 +1671,11 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1669 | List<ScheduleRealInfo> lists = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date); | 1671 | List<ScheduleRealInfo> lists = scheduleRealInfoRepository.scheduleByDateAndLine2(line, date); |
| 1670 | Map<String, Object> map = new HashMap<String, Object>(); | 1672 | Map<String, Object> map = new HashMap<String, Object>(); |
| 1671 | map.put("xlName", xlName); | 1673 | map.put("xlName", xlName); |
| 1672 | - map.put("jhlc", culateService.culateJhgl(lists)); | 1674 | + double jhlc=culateService.culateJhgl(lists); |
| 1675 | + map.put("jhlc",jhlc); | ||
| 1673 | map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists))); | 1676 | map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists))); |
| 1674 | - map.put("ssgl", culateService.culateLbgl(lists)); | 1677 | + double lbgl=culateService.culateLbgl(lists); |
| 1678 | + map.put("ssgl", lbgl); | ||
| 1675 | map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻")); | 1679 | map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻")); |
| 1676 | map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢")); | 1680 | map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢")); |
| 1677 | map.put("ssgl_gz", culateService.culateCJLC(lists, "故障")); | 1681 | map.put("ssgl_gz", culateService.culateCJLC(lists, "故障")); |
| @@ -1688,7 +1692,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1688,7 +1692,8 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1688 | double ssgl_qt=culateService.culateCJLC(lists, "其他"); | 1692 | double ssgl_qt=culateService.culateCJLC(lists, "其他"); |
| 1689 | map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt))); | 1693 | map.put("ssgl_other", Arith.add(Arith.add(ssgl_pc, ssgl_by),Arith.add(ssgl_cj, ssgl_qt))); |
| 1690 | map.put("ssbc", culateService.culateLbbc(lists)); | 1694 | map.put("ssbc", culateService.culateLbbc(lists)); |
| 1691 | - map.put("ljgl", culateService.culateLjgl(lists)); | 1695 | + double ljgl=culateService.culateLjgl(lists); |
| 1696 | + map.put("ljgl", ljgl); | ||
| 1692 | map.put("jhbc", culateService.culateJhbc(lists,"")); | 1697 | map.put("jhbc", culateService.culateJhbc(lists,"")); |
| 1693 | map.put("jhbc_m", culateService.culateJhbc(lists, "zgf")); | 1698 | map.put("jhbc_m", culateService.culateJhbc(lists, "zgf")); |
| 1694 | map.put("jhbc_a", culateService.culateJhbc(lists, "wgf")); | 1699 | map.put("jhbc_a", culateService.culateJhbc(lists, "wgf")); |
| @@ -1708,6 +1713,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -1708,6 +1713,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 1708 | map.put("djg_m", 0); | 1713 | map.put("djg_m", 0); |
| 1709 | map.put("djg_a", 0); | 1714 | map.put("djg_a", 0); |
| 1710 | map.put("djg_time", 0); | 1715 | map.put("djg_time", 0); |
| 1716 | + map.put("jls", Arith.sub(Arith.add(jhlc, ljgl), lbgl)); | ||
| 1711 | lMap.add(map); | 1717 | lMap.add(map); |
| 1712 | return lMap; | 1718 | return lMap; |
| 1713 | } | 1719 | } |
| @@ -2261,8 +2267,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2261,8 +2267,23 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2261 | public final Map<String, Object> staticTj(List<ScheduleRealInfo> lists){ | 2267 | public final Map<String, Object> staticTj(List<ScheduleRealInfo> lists){ |
| 2262 | Map<String, Object> map = new HashMap<String, Object>(); | 2268 | Map<String, Object> map = new HashMap<String, Object>(); |
| 2263 | map.put("xlName", lists.get(0).getXlName()); | 2269 | map.put("xlName", lists.get(0).getXlName()); |
| 2264 | - map.put("jhlc", culateService.culateJhgl(lists)); | ||
| 2265 | - map.put("sjgl", Arith.add(culateService.culateSjgl(lists),culateService.culateLjgl(lists))); | 2270 | + double jhyygl=culateService.culateJhgl(lists);//计划营运公里 |
| 2271 | + double jhjcclc= culateService.culateJhJccgl(lists);//计划进出场公里(计划空驶公里) | ||
| 2272 | + map.put("jhlc", jhyygl); | ||
| 2273 | + map.put("jcclc", jhjcclc); | ||
| 2274 | + map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); | ||
| 2275 | + | ||
| 2276 | + double ljgl= culateService.culateLjgl(lists); | ||
| 2277 | + double sjyygl= culateService.culateSjgl(lists); | ||
| 2278 | + double zyygl= Arith.add(sjyygl,ljgl); | ||
| 2279 | + | ||
| 2280 | + double sjjccgl=culateService.culateJccgl(lists); | ||
| 2281 | + double sjksgl=culateService.culateKsgl(lists); | ||
| 2282 | + double zksgl=Arith.add(sjjccgl, sjksgl); | ||
| 2283 | + map.put("sjzgl", Arith.add(zyygl, zksgl)); | ||
| 2284 | + map.put("sjgl",zyygl); | ||
| 2285 | + map.put("sjksgl", zksgl); | ||
| 2286 | + | ||
| 2266 | map.put("ssgl", culateService.culateLbgl(lists)); | 2287 | map.put("ssgl", culateService.culateLbgl(lists)); |
| 2267 | map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻")); | 2288 | map.put("ssgl_lz", culateService.culateCJLC(lists, "路阻")); |
| 2268 | map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢")); | 2289 | map.put("ssgl_dm", culateService.culateCJLC(lists, "吊慢")); |
| @@ -2276,7 +2297,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2276,7 +2297,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2276 | map.put("ssgl_yw", culateService.culateCJLC(lists, "援外")); | 2297 | map.put("ssgl_yw", culateService.culateCJLC(lists, "援外")); |
| 2277 | map.put("ssgl_other", culateService.culateCJLC(lists, "其他")); | 2298 | map.put("ssgl_other", culateService.culateCJLC(lists, "其他")); |
| 2278 | map.put("ssbc", culateService.culateLbbc(lists)); | 2299 | map.put("ssbc", culateService.culateLbbc(lists)); |
| 2279 | - map.put("ljgl", culateService.culateLjgl(lists)); | 2300 | + map.put("ljgl", ljgl); |
| 2280 | map.put("jhbc", culateService.culateJhbc(lists,"")); | 2301 | map.put("jhbc", culateService.culateJhbc(lists,"")); |
| 2281 | map.put("jhbc_m", culateService.culateJhbc(lists, "zgf")); | 2302 | map.put("jhbc_m", culateService.culateJhbc(lists, "zgf")); |
| 2282 | map.put("jhbc_a", culateService.culateJhbc(lists, "wgf")); | 2303 | map.put("jhbc_a", culateService.culateJhbc(lists, "wgf")); |
| @@ -2339,8 +2360,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2339,8 +2360,22 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2339 | 2360 | ||
| 2340 | Map<String, Object> map = new HashMap<String, Object>(); | 2361 | Map<String, Object> map = new HashMap<String, Object>(); |
| 2341 | map.put("xlName", "合计"); | 2362 | map.put("xlName", "合计"); |
| 2342 | - map.put("jhlc", culateService.culateJhgl(list)); | ||
| 2343 | - map.put("sjgl", Arith.add(culateService.culateSjgl(list),culateService.culateLjgl(list))); | 2363 | + double jhyygl=culateService.culateJhgl(list);//计划营运公里 |
| 2364 | + double jhjcclc= culateService.culateJhJccgl(list);//计划进出场公里(计划空驶公里) | ||
| 2365 | + map.put("jhlc", jhyygl); | ||
| 2366 | + map.put("jcclc", jhjcclc); | ||
| 2367 | + map.put("jhzlc", Arith.add(jhyygl, jhjcclc)); | ||
| 2368 | + | ||
| 2369 | + double ljgl= culateService.culateLjgl(list); | ||
| 2370 | + double sjyygl= culateService.culateSjgl(list); | ||
| 2371 | + double zyygl= Arith.add(sjyygl,ljgl); | ||
| 2372 | + | ||
| 2373 | + double sjjccgl=culateService.culateJccgl(list); | ||
| 2374 | + double sjksgl=culateService.culateKsgl(list); | ||
| 2375 | + double zksgl=Arith.add(sjjccgl, sjksgl); | ||
| 2376 | + map.put("sjzgl", Arith.add(zyygl, zksgl)); | ||
| 2377 | + map.put("sjgl",zyygl); | ||
| 2378 | + map.put("sjksgl", zksgl); | ||
| 2344 | map.put("ssgl", culateService.culateLbgl(list)); | 2379 | map.put("ssgl", culateService.culateLbgl(list)); |
| 2345 | map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); | 2380 | map.put("ssgl_lz", culateService.culateCJLC(list, "路阻")); |
| 2346 | map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); | 2381 | map.put("ssgl_dm", culateService.culateCJLC(list, "吊慢")); |
| @@ -2354,7 +2389,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2354,7 +2389,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2354 | map.put("ssgl_yw", culateService.culateCJLC(list, "援外")); | 2389 | map.put("ssgl_yw", culateService.culateCJLC(list, "援外")); |
| 2355 | map.put("ssgl_other", culateService.culateCJLC(list, "其他")); | 2390 | map.put("ssgl_other", culateService.culateCJLC(list, "其他")); |
| 2356 | map.put("ssbc", culateService.culateLbbc(list)); | 2391 | map.put("ssbc", culateService.culateLbbc(list)); |
| 2357 | - map.put("ljgl", culateService.culateLjgl(list)); | 2392 | + map.put("ljgl", ljgl); |
| 2358 | map.put("jhbc", culateService.culateJhbc(list,"")); | 2393 | map.put("jhbc", culateService.culateJhbc(list,"")); |
| 2359 | map.put("jhbc_m", culateService.culateJhbc(list, "zgf")); | 2394 | map.put("jhbc_m", culateService.culateJhbc(list, "zgf")); |
| 2360 | map.put("jhbc_a", culateService.culateJhbc(list, "wgf")); | 2395 | map.put("jhbc_a", culateService.culateJhbc(list, "wgf")); |
| @@ -2529,7 +2564,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2529,7 +2564,7 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2529 | list.add(t); | 2564 | list.add(t); |
| 2530 | } | 2565 | } |
| 2531 | 2566 | ||
| 2532 | - List<ScheduleRealInfo> listInfo2 = scheduleRealInfoRepository.scheduleByDateAndLine(line, date); | 2567 | + List<ScheduleRealInfo> listInfo2 = scheduleRealInfoRepository.scheduleByDateAndLineQp(line, date); |
| 2533 | List<ScheduleRealInfo> xList = new ArrayList<ScheduleRealInfo>(); | 2568 | List<ScheduleRealInfo> xList = new ArrayList<ScheduleRealInfo>(); |
| 2534 | List<ScheduleRealInfo> yList = new ArrayList<ScheduleRealInfo>(); | 2569 | List<ScheduleRealInfo> yList = new ArrayList<ScheduleRealInfo>(); |
| 2535 | List<ScheduleRealInfo> zList = new ArrayList<ScheduleRealInfo>(); | 2570 | List<ScheduleRealInfo> zList = new ArrayList<ScheduleRealInfo>(); |
src/main/java/com/bsth/service/report/impl/ReportServiceImpl.java
| @@ -181,10 +181,10 @@ public class ReportServiceImpl implements ReportService{ | @@ -181,10 +181,10 @@ public class ReportServiceImpl implements ReportService{ | ||
| 181 | try { | 181 | try { |
| 182 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | 182 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| 183 | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); | 183 | SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss"); |
| 184 | - Long date1=simpleDateFormat.parse(fcsj+" 00:00:00").getTime(); | ||
| 185 | - Long date2=simpleDateFormat.parse(ddsj+" 23:59:59").getTime(); | ||
| 186 | - Date dates1=simpleDateFormat.parse(fcsj+" 00:00:00"); | ||
| 187 | - Date dates2=simpleDateFormat.parse(ddsj+" 00:00:00"); | 184 | + Long date1=simpleDateFormat.parse(fcsj+":00").getTime(); |
| 185 | + Long date2=simpleDateFormat.parse(ddsj+":00").getTime(); | ||
| 186 | + Date dates1=simpleDateFormat.parse(fcsj+":00"); | ||
| 187 | + Date dates2=simpleDateFormat.parse(ddsj+":00"); | ||
| 188 | List<ArrivalInfo> lists=load2(line,date1,date2,dates1,dates2,zd,zdlx); | 188 | List<ArrivalInfo> lists=load2(line,date1,date2,dates1,dates2,zd,zdlx); |
| 189 | 189 | ||
| 190 | for(int i=0;i<lists.size();i++){ | 190 | for(int i=0;i<lists.size();i++){ |
src/main/java/com/bsth/service/schedule/TTInfoDetailService.java
| @@ -28,12 +28,10 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | @@ -28,12 +28,10 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | ||
| 28 | /** 是偶分班 */ | 28 | /** 是偶分班 */ |
| 29 | private Boolean isfb; | 29 | private Boolean isfb; |
| 30 | 30 | ||
| 31 | - /** 起点站 */ | ||
| 32 | - private Integer qdz; | ||
| 33 | - /** 终点站 */ | ||
| 34 | - private Integer zdz; | ||
| 35 | - /** 停车场 */ | ||
| 36 | - private Integer tcc; | 31 | + /** 起点站code */ |
| 32 | + private String qdzCode; | ||
| 33 | + /** 终点站code */ | ||
| 34 | + private String zdzCode; | ||
| 37 | 35 | ||
| 38 | public FcInfo() { | 36 | public FcInfo() { |
| 39 | } | 37 | } |
| @@ -44,9 +42,8 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | @@ -44,9 +42,8 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | ||
| 44 | String fcsj, | 42 | String fcsj, |
| 45 | String xldir, | 43 | String xldir, |
| 46 | String isfb, | 44 | String isfb, |
| 47 | - String qdz, | ||
| 48 | - String zdz, | ||
| 49 | - String tcc) { | 45 | + String qdzCode, |
| 46 | + String zdzCode) { | ||
| 50 | this.ttdid = StringUtils.isEmpty(ttdid_str) ? null : Long.valueOf(ttdid_str); | 47 | this.ttdid = StringUtils.isEmpty(ttdid_str) ? null : Long.valueOf(ttdid_str); |
| 51 | this.bc_type = bc_type; | 48 | this.bc_type = bc_type; |
| 52 | this.fcsj = fcsj; | 49 | this.fcsj = fcsj; |
| @@ -58,14 +55,11 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | @@ -58,14 +55,11 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | ||
| 58 | else | 55 | else |
| 59 | this.isfb = false; | 56 | this.isfb = false; |
| 60 | 57 | ||
| 61 | - if (StringUtils.isNotEmpty(qdz) && !"null".equals(qdz)) { | ||
| 62 | - this.qdz = Integer.valueOf(qdz); | 58 | + if (StringUtils.isNotEmpty(qdzCode) && !"null".equals(qdzCode)) { |
| 59 | + this.qdzCode = qdzCode; | ||
| 63 | } | 60 | } |
| 64 | - if (StringUtils.isNotEmpty(zdz) && !"null".equals(zdz)) { | ||
| 65 | - this.zdz = Integer.valueOf(zdz); | ||
| 66 | - } | ||
| 67 | - if (StringUtils.isNotEmpty(tcc) && !"null".equals(tcc)) { | ||
| 68 | - this.tcc = Integer.valueOf(tcc); | 61 | + if (StringUtils.isNotEmpty(zdzCode) && !"null".equals(zdzCode)) { |
| 62 | + this.zdzCode = zdzCode; | ||
| 69 | } | 63 | } |
| 70 | 64 | ||
| 71 | } | 65 | } |
| @@ -110,28 +104,20 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | @@ -110,28 +104,20 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | ||
| 110 | this.isfb = isfb; | 104 | this.isfb = isfb; |
| 111 | } | 105 | } |
| 112 | 106 | ||
| 113 | - public Integer getQdz() { | ||
| 114 | - return qdz; | ||
| 115 | - } | ||
| 116 | - | ||
| 117 | - public void setQdz(Integer qdz) { | ||
| 118 | - this.qdz = qdz; | 107 | + public String getQdzCode() { |
| 108 | + return qdzCode; | ||
| 119 | } | 109 | } |
| 120 | 110 | ||
| 121 | - public Integer getZdz() { | ||
| 122 | - return zdz; | 111 | + public void setQdzCode(String qdzCode) { |
| 112 | + this.qdzCode = qdzCode; | ||
| 123 | } | 113 | } |
| 124 | 114 | ||
| 125 | - public void setZdz(Integer zdz) { | ||
| 126 | - this.zdz = zdz; | 115 | + public String getZdzCode() { |
| 116 | + return zdzCode; | ||
| 127 | } | 117 | } |
| 128 | 118 | ||
| 129 | - public Integer getTcc() { | ||
| 130 | - return tcc; | ||
| 131 | - } | ||
| 132 | - | ||
| 133 | - public void setTcc(Integer tcc) { | ||
| 134 | - this.tcc = tcc; | 119 | + public void setZdzCode(String zdzCode) { |
| 120 | + this.zdzCode = zdzCode; | ||
| 135 | } | 121 | } |
| 136 | } | 122 | } |
| 137 | 123 | ||
| @@ -202,4 +188,6 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | @@ -202,4 +188,6 @@ public interface TTInfoDetailService extends BService<TTInfoDetail, Long> { | ||
| 202 | List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId); | 188 | List<TTInfoDetail> findBcdetails(Integer xlId, Long ttinfoId, Long lpId); |
| 203 | 189 | ||
| 204 | Map<String, Object> skbDetailMxSave(Map<String, Object> map); | 190 | Map<String, Object> skbDetailMxSave(Map<String, Object> map); |
| 191 | + | ||
| 192 | + List<Map<String, Object>> findZdAndTcc(int lineid, int xldir); | ||
| 205 | } | 193 | } |
src/main/java/com/bsth/service/schedule/impl/SchedulePlanServiceImpl.java
| @@ -8,6 +8,7 @@ import com.bsth.repository.LineRepository; | @@ -8,6 +8,7 @@ import com.bsth.repository.LineRepository; | ||
| 8 | import com.bsth.repository.schedule.*; | 8 | import com.bsth.repository.schedule.*; |
| 9 | import com.bsth.service.schedule.SchedulePlanRuleResultService; | 9 | import com.bsth.service.schedule.SchedulePlanRuleResultService; |
| 10 | import com.bsth.service.schedule.SchedulePlanService; | 10 | import com.bsth.service.schedule.SchedulePlanService; |
| 11 | +import com.bsth.service.schedule.rules.ScheduleRuleService; | ||
| 11 | import com.bsth.service.schedule.rules.plan.PlanCalcuParam_input; | 12 | import com.bsth.service.schedule.rules.plan.PlanCalcuParam_input; |
| 12 | import com.bsth.service.schedule.rules.plan.PlanResult; | 13 | import com.bsth.service.schedule.rules.plan.PlanResult; |
| 13 | import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; | 14 | import com.bsth.service.schedule.rules.shiftloop.ScheduleCalcuParam_input; |
| @@ -55,7 +56,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im | @@ -55,7 +56,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im | ||
| 55 | @Autowired | 56 | @Autowired |
| 56 | private SchedulePlanRuleResultService schedulePlanRuleResultService; | 57 | private SchedulePlanRuleResultService schedulePlanRuleResultService; |
| 57 | @Autowired | 58 | @Autowired |
| 58 | - private SchedulePlanRuleResultRepository schedulePlanRuleResultRepository; | 59 | + private ScheduleRuleService scheduleRuleService; |
| 59 | 60 | ||
| 60 | /** 日志记录器 */ | 61 | /** 日志记录器 */ |
| 61 | private Logger logger = LoggerFactory.getLogger(SchedulePlanServiceImpl.class); | 62 | private Logger logger = LoggerFactory.getLogger(SchedulePlanServiceImpl.class); |
| @@ -89,7 +90,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im | @@ -89,7 +90,7 @@ public class SchedulePlanServiceImpl extends BServiceImpl<SchedulePlan, Long> im | ||
| 89 | // 设置gloable对象,在drl中通过别名使用 | 90 | // 设置gloable对象,在drl中通过别名使用 |
| 90 | session.setGlobal("scheduleResult", scheduleResults_output); | 91 | session.setGlobal("scheduleResult", scheduleResults_output); |
| 91 | session.setGlobal("log", logger); // 设置日志 | 92 | session.setGlobal("log", logger); // 设置日志 |
| 92 | - session.setGlobal("schedulePlanRuleResultRepository", schedulePlanRuleResultRepository); | 93 | + session.setGlobal("scheduleRuleService", scheduleRuleService); |
| 93 | 94 | ||
| 94 | // 载入数据 | 95 | // 载入数据 |
| 95 | session.insert(scheduleCalcuParam_input); | 96 | session.insert(scheduleCalcuParam_input); |
src/main/java/com/bsth/service/schedule/impl/TTInfoDetailServiceImpl.java
| @@ -37,6 +37,7 @@ import org.slf4j.LoggerFactory; | @@ -37,6 +37,7 @@ import org.slf4j.LoggerFactory; | ||
| 37 | import org.springframework.beans.factory.annotation.Autowired; | 37 | import org.springframework.beans.factory.annotation.Autowired; |
| 38 | import org.springframework.beans.factory.annotation.Qualifier; | 38 | import org.springframework.beans.factory.annotation.Qualifier; |
| 39 | import org.springframework.boot.context.properties.EnableConfigurationProperties; | 39 | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| 40 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 40 | import org.springframework.stereotype.Service; | 41 | import org.springframework.stereotype.Service; |
| 41 | import org.springframework.transaction.annotation.Transactional; | 42 | import org.springframework.transaction.annotation.Transactional; |
| 42 | import org.springframework.util.CollectionUtils; | 43 | import org.springframework.util.CollectionUtils; |
| @@ -85,6 +86,28 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -85,6 +86,28 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 85 | @Qualifier(value = "dataToolsServiceImpl") | 86 | @Qualifier(value = "dataToolsServiceImpl") |
| 86 | private DataToolsService dataToolsService; | 87 | private DataToolsService dataToolsService; |
| 87 | 88 | ||
| 89 | + @Autowired | ||
| 90 | + private JdbcTemplate jdbcTemplate; | ||
| 91 | + | ||
| 92 | + /** | ||
| 93 | + * 查找站点和停车场集合 | ||
| 94 | + * @param lineid 线路id | ||
| 95 | + * @param xldir 线路上下行 | ||
| 96 | + * @return | ||
| 97 | + */ | ||
| 98 | + public List<Map<String, Object>> findZdAndTcc(int lineid, int xldir) { | ||
| 99 | + String sql = "select * from " + | ||
| 100 | + "(" + | ||
| 101 | + "select station_code as zcode, station_name as zname from bsth_c_stationroute " + | ||
| 102 | + "where destroy = 0 and line = ? and directions = ? " + | ||
| 103 | + "union all " + | ||
| 104 | + "select park_code as zcode, park_name as zname from bsth_c_car_park " + | ||
| 105 | + "where destroy = 0 " + | ||
| 106 | + ") a "; | ||
| 107 | + | ||
| 108 | + return jdbcTemplate.queryForList(sql, lineid, xldir); | ||
| 109 | + } | ||
| 110 | + | ||
| 88 | @Override | 111 | @Override |
| 89 | public TTInfoDetail findById(Long aLong) { | 112 | public TTInfoDetail findById(Long aLong) { |
| 90 | return ttInfoDetailRepository.findOneExtend(aLong); | 113 | return ttInfoDetailRepository.findOneExtend(aLong); |
| @@ -294,7 +317,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -294,7 +317,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 294 | for (int r = 1; r < sheet.getRows(); r++) { | 317 | for (int r = 1; r < sheet.getRows(); r++) { |
| 295 | List<FcInfo> fcInfos = new ArrayList<>(); | 318 | List<FcInfo> fcInfos = new ArrayList<>(); |
| 296 | // 每行第一列都是路牌 | 319 | // 每行第一列都是路牌 |
| 297 | - fcInfos.add(new FcInfo(null, null, sheet.getCell(0, r).getContents(), null, null, null, null, null)); // 用fcsj放置路牌显示 | 320 | + fcInfos.add(new FcInfo(null, null, sheet.getCell(0, r).getContents(), null, null, null, null)); // 用fcsj放置路牌显示 |
| 298 | 321 | ||
| 299 | int bc_ks = 0; // 空驶班次 | 322 | int bc_ks = 0; // 空驶班次 |
| 300 | int bc_yy = 0; // 营运班次 | 323 | int bc_yy = 0; // 营运班次 |
| @@ -314,11 +337,10 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -314,11 +337,10 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 314 | String xldir = content == null ? "" : content[5]; // 线路上下行 | 337 | String xldir = content == null ? "" : content[5]; // 线路上下行 |
| 315 | String isfb = content == null ? "" : content[6]; // 是否分班 | 338 | String isfb = content == null ? "" : content[6]; // 是否分班 |
| 316 | 339 | ||
| 317 | - String qdz = content == null ? "" : content[7]; // 起点站 | ||
| 318 | - String zdz = content == null ? "" : content[8]; // 终点站 | ||
| 319 | - String tcc = content == null ? "" : content[9]; // 停车场 | 340 | + String qdzCode = content == null ? "" : content[7]; // 起点站编码 |
| 341 | + String zdzCode = content == null ? "" : content[8]; // 终点站编码 | ||
| 320 | 342 | ||
| 321 | - FcInfo fcInfo = new FcInfo(ttdid_str, bctype, fcsj, xldir, isfb, qdz, zdz, tcc); | 343 | + FcInfo fcInfo = new FcInfo(ttdid_str, bctype, fcsj, xldir, isfb, qdzCode, zdzCode); |
| 322 | 344 | ||
| 323 | if (StringUtils.isNotEmpty(fzdname)) | 345 | if (StringUtils.isNotEmpty(fzdname)) |
| 324 | headarrays[c] = fzdname; | 346 | headarrays[c] = fzdname; |
| @@ -344,6 +366,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -344,6 +366,7 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 344 | } | 366 | } |
| 345 | 367 | ||
| 346 | } catch (Exception exp) { | 368 | } catch (Exception exp) { |
| 369 | + exp.printStackTrace(); | ||
| 347 | LOGGER.info("第{}行,第{}列数据有问题,数据={},异常message={}", r, c, content_str, exp.getCause()); | 370 | LOGGER.info("第{}行,第{}列数据有问题,数据={},异常message={}", r, c, content_str, exp.getCause()); |
| 348 | break; | 371 | break; |
| 349 | } | 372 | } |
| @@ -351,10 +374,10 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -351,10 +374,10 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 351 | } | 374 | } |
| 352 | 375 | ||
| 353 | // 添加一列 空驶班次/空驶里程,fcsj放置数据 | 376 | // 添加一列 空驶班次/空驶里程,fcsj放置数据 |
| 354 | - fcInfos.add(new FcInfo(null, null, String.format("%d/%.2f", bc_ks, lc_ks), null, null, null, null, null)); | 377 | + fcInfos.add(new FcInfo(null, null, String.format("%d/%.2f", bc_ks, lc_ks), null, null, null, null)); |
| 355 | 378 | ||
| 356 | // 添加一列 营运班次/营运里程,fcsj放置数据 | 379 | // 添加一列 营运班次/营运里程,fcsj放置数据 |
| 357 | - fcInfos.add(new FcInfo(null, null, String.format("%d/%.2f", bc_yy, lc_yy), null, null, null, null, null)); | 380 | + fcInfos.add(new FcInfo(null, null, String.format("%d/%.2f", bc_yy, lc_yy), null, null, null, null)); |
| 358 | 381 | ||
| 359 | editInfo.getContents().add(fcInfos); | 382 | editInfo.getContents().add(fcInfos); |
| 360 | } | 383 | } |
| @@ -421,6 +444,8 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | @@ -421,6 +444,8 @@ public class TTInfoDetailServiceImpl extends BServiceImpl<TTInfoDetail, Long> im | ||
| 421 | throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中不是起点站", i + 1, cell_con.trim(), linename)); | 444 | throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中不是起点站", i + 1, cell_con.trim(), linename)); |
| 422 | } else if (stationRouteList.size() > 1) { | 445 | } else if (stationRouteList.size() > 1) { |
| 423 | throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中上下行都是起点站", i + 1, cell_con.trim(), linename)); | 446 | throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中上下行都是起点站", i + 1, cell_con.trim(), linename)); |
| 447 | + } else if (StringUtils.isEmpty(stationRouteList.get(0).getStationCode())) { | ||
| 448 | + throw new Exception(String.format("第1行,第%d列数据%s在%s站点路由中没有站点编码", i + 1, cell_con.trim(), linename)); | ||
| 424 | } | 449 | } |
| 425 | } | 450 | } |
| 426 | 451 |
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleService.java
0 → 100644
| 1 | +package com.bsth.service.schedule.rules; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.schedule.temp.SchedulePlanRuleResult; | ||
| 4 | + | ||
| 5 | +import java.util.Date; | ||
| 6 | +import java.util.List; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 排班计划使用的service。 | ||
| 10 | + */ | ||
| 11 | +public interface ScheduleRuleService { | ||
| 12 | + | ||
| 13 | + // TODO:之后所有排班使用的方法汇总到这里 | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 查找最近的历史排班记录 | ||
| 17 | + * @param xlid 线路id | ||
| 18 | + * @param from 开始时间 | ||
| 19 | + * @return | ||
| 20 | + */ | ||
| 21 | + List<SchedulePlanRuleResult> findLastByXl(String xlid, Date from); | ||
| 22 | +} |
src/main/java/com/bsth/service/schedule/rules/ScheduleRuleServiceImpl.java
0 → 100644
| 1 | +package com.bsth.service.schedule.rules; | ||
| 2 | + | ||
| 3 | +import com.bsth.entity.schedule.temp.SchedulePlanRuleResult; | ||
| 4 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 5 | +import org.springframework.jdbc.core.JdbcTemplate; | ||
| 6 | +import org.springframework.jdbc.core.RowMapper; | ||
| 7 | +import org.springframework.stereotype.Service; | ||
| 8 | + | ||
| 9 | +import java.sql.ResultSet; | ||
| 10 | +import java.sql.SQLException; | ||
| 11 | +import java.util.Date; | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * Created by xu on 17/4/19. | ||
| 16 | + */ | ||
| 17 | +@Service | ||
| 18 | +public class ScheduleRuleServiceImpl implements ScheduleRuleService { | ||
| 19 | + | ||
| 20 | + @Autowired | ||
| 21 | + private JdbcTemplate jdbcTemplate; | ||
| 22 | + | ||
| 23 | + @Override | ||
| 24 | + public List<SchedulePlanRuleResult> findLastByXl(String xlid, Date from) { | ||
| 25 | + String sql = "select * from bsth_c_s_sp_rule_rst a " + | ||
| 26 | + "where exists (select 1 from " + | ||
| 27 | + "(select t.rule_id as rid, max(t.schedule_date) as sd from bsth_c_s_sp_rule_rst t " + | ||
| 28 | + "where t.xl_id = ? and t.schedule_date < ? " + | ||
| 29 | + "group by t.rule_id) a2 " + | ||
| 30 | + "where a.rule_id = rid and a.schedule_date = sd) "; | ||
| 31 | + | ||
| 32 | + return jdbcTemplate.query(sql, new Object[]{xlid, from}, new RowMapper<SchedulePlanRuleResult>() { | ||
| 33 | + @Override | ||
| 34 | + public SchedulePlanRuleResult mapRow(ResultSet rs, int i) throws SQLException { | ||
| 35 | + SchedulePlanRuleResult obj = new SchedulePlanRuleResult(); | ||
| 36 | + obj.setRuleId(rs.getString("rule_id")); | ||
| 37 | + obj.setScheduleDate(rs.getDate("schedule_date")); | ||
| 38 | + obj.setGidindex(rs.getString("gidindex")); | ||
| 39 | + obj.setEcindex(rs.getString("ecindex")); | ||
| 40 | + | ||
| 41 | + // 其他字段没用 | ||
| 42 | + return obj; | ||
| 43 | + } | ||
| 44 | + }); | ||
| 45 | + } | ||
| 46 | +} |
src/main/java/com/bsth/service/schedule/rules/ttinfo2/ErrorBcCountFunction.java
| 1 | package com.bsth.service.schedule.rules.ttinfo2; | 1 | package com.bsth.service.schedule.rules.ttinfo2; |
| 2 | 2 | ||
| 3 | import com.bsth.entity.schedule.TTInfoDetail; | 3 | import com.bsth.entity.schedule.TTInfoDetail; |
| 4 | +import org.apache.commons.lang3.StringUtils; | ||
| 4 | import org.kie.api.runtime.rule.AccumulateFunction; | 5 | import org.kie.api.runtime.rule.AccumulateFunction; |
| 5 | 6 | ||
| 6 | import java.io.*; | 7 | import java.io.*; |
| @@ -58,18 +59,12 @@ public class ErrorBcCountFunction implements AccumulateFunction { | @@ -58,18 +59,12 @@ public class ErrorBcCountFunction implements AccumulateFunction { | ||
| 58 | return; | 59 | return; |
| 59 | } | 60 | } |
| 60 | 61 | ||
| 61 | - if ("in".equals(ttInfoDetail.getBcType())) { | ||
| 62 | - if (ttInfoDetail.getQdz() == null || ttInfoDetail.getTcc() == null) { | ||
| 63 | - errorCountData.errorcount ++; | ||
| 64 | - } | ||
| 65 | - } else if ("out".equals(ttInfoDetail.getBcType())) { | ||
| 66 | - if (ttInfoDetail.getTcc() == null || ttInfoDetail.getZdz() == null) { | ||
| 67 | - errorCountData.errorcount ++; | ||
| 68 | - } | ||
| 69 | - } else { | ||
| 70 | - if (ttInfoDetail.getQdz() == null || ttInfoDetail.getZdz() == null) { | ||
| 71 | - errorCountData.errorcount ++; | ||
| 72 | - } | 62 | + if (StringUtils.isEmpty(ttInfoDetail.getQdzCode()) || |
| 63 | + StringUtils.isEmpty(ttInfoDetail.getQdzName()) || | ||
| 64 | + StringUtils.isEmpty(ttInfoDetail.getZdzCode()) || | ||
| 65 | + StringUtils.isEmpty(ttInfoDetail.getZdzName()) ) { | ||
| 66 | + | ||
| 67 | + errorCountData.errorcount ++; | ||
| 73 | } | 68 | } |
| 74 | } | 69 | } |
| 75 | 70 | ||
| @@ -83,18 +78,12 @@ public class ErrorBcCountFunction implements AccumulateFunction { | @@ -83,18 +78,12 @@ public class ErrorBcCountFunction implements AccumulateFunction { | ||
| 83 | return; | 78 | return; |
| 84 | } | 79 | } |
| 85 | 80 | ||
| 86 | - if ("in".equals(ttInfoDetail.getBcType())) { | ||
| 87 | - if (ttInfoDetail.getQdz() == null || ttInfoDetail.getTcc() == null) { | ||
| 88 | - errorCountData.errorcount --; | ||
| 89 | - } | ||
| 90 | - } else if ("out".equals(ttInfoDetail.getBcType())) { | ||
| 91 | - if (ttInfoDetail.getTcc() == null || ttInfoDetail.getZdz() == null) { | ||
| 92 | - errorCountData.errorcount --; | ||
| 93 | - } | ||
| 94 | - } else { | ||
| 95 | - if (ttInfoDetail.getQdz() == null || ttInfoDetail.getZdz() == null) { | ||
| 96 | - errorCountData.errorcount --; | ||
| 97 | - } | 81 | + if (StringUtils.isEmpty(ttInfoDetail.getQdzCode()) || |
| 82 | + StringUtils.isEmpty(ttInfoDetail.getQdzName()) || | ||
| 83 | + StringUtils.isEmpty(ttInfoDetail.getZdzCode()) || | ||
| 84 | + StringUtils.isEmpty(ttInfoDetail.getZdzName()) ) { | ||
| 85 | + | ||
| 86 | + errorCountData.errorcount --; | ||
| 98 | } | 87 | } |
| 99 | 88 | ||
| 100 | } | 89 | } |
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://localhost/control?useUnicode=true&characterEncoding=utf-8&useSSL=false | 11 | +spring.datasource.url= jdbc:mysql://127.0.0.1/control?useUnicode=true&characterEncoding=utf-8&useSSL=false |
| 12 | spring.datasource.username= root | 12 | spring.datasource.username= root |
| 13 | -spring.datasource.password= root123 | 13 | +spring.datasource.password= |
| 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 |
src/main/resources/datatools/config-dev.properties
| @@ -10,7 +10,7 @@ datatools.kvars_dbuname=root | @@ -10,7 +10,7 @@ datatools.kvars_dbuname=root | ||
| 10 | #数据库密码 | 10 | #数据库密码 |
| 11 | datatools.kvars_dbpwd= | 11 | datatools.kvars_dbpwd= |
| 12 | #数据库库名 | 12 | #数据库库名 |
| 13 | -datatools.kvars_dbdname=qp_control | 13 | +datatools.kvars_dbdname=control |
| 14 | 14 | ||
| 15 | # 3、上传数据配置信息 | 15 | # 3、上传数据配置信息 |
| 16 | # 上传文件目录配置(根据不同的环境需要修正) | 16 | # 上传文件目录配置(根据不同的环境需要修正) |