Commit 44c30450f1c22a9bd8fea6c5ef16561f0b6d496b

Authored by ljq
1 parent 4e1ec9f8

1

src/main/java/com/bsth/data/pilot80/PilotReport.java
@@ -136,11 +136,29 @@ public class PilotReport { @@ -136,11 +136,29 @@ public class PilotReport {
136 if (d80.getSchId() != null){ 136 if (d80.getSchId() != null){
137 sch = dayOfSchedule.get(d80.getSchId()); 137 sch = dayOfSchedule.get(d80.getSchId());
138 } 138 }
  139 + if (sch == null){
  140 + // 查找离发车时间最近的班次
  141 + long currentTime = new Date().getTime();
  142 + long minTimeDiff = Long.MAX_VALUE;
  143 + List<ScheduleRealInfo> schlist = dayOfSchedule.findByNbbm(nbbm);
  144 + for (ScheduleRealInfo schedule : schlist) {
  145 + // 检查计划发车时间
  146 + if (schedule.getDfsjT() != null) {
  147 + long timeDiff = Math.abs(currentTime - schedule.getDfsjT());
  148 + if (timeDiff < minTimeDiff) {
  149 + minTimeDiff = timeDiff;
  150 + sch = schedule;
  151 + }
  152 + }
  153 + }
  154 +
  155 + }
  156 +
139 String url = systemParamService.getValue("url.yjbj")+"dataDockingApi/accident/saveAccident?"; 157 String url = systemParamService.getValue("url.yjbj")+"dataDockingApi/accident/saveAccident?";
140 url = url + "accidentTime=" + new Date().getTime() + "&nbbm=" + nbbm +"&requestCode=" +d80.getData().getRequestCode() 158 url = url + "accidentTime=" + new Date().getTime() + "&nbbm=" + nbbm +"&requestCode=" +d80.getData().getRequestCode()
141 +"&lon=" +d80.getData().getLon()+"&lat="+d80.getData().getLat(); 159 +"&lon=" +d80.getData().getLon()+"&lat="+d80.getData().getLat();
142 if (sch != null){ 160 if (sch != null){
143 - url = url + "&lineName=" +sch.getXlName()+"&jsy=" +sch.getjGh()+"&jsName=" +sch.getjName(); 161 + url = url + "&lineName=" +sch.getXlName()+"&jsy=" +sch.getjGh()+"&jsName=" +sch.getjName()+"&fgs="+sch.getFgsBm();
144 } 162 }
145 logger.info("url===="+url); 163 logger.info("url===="+url);
146 StringBuilder sb = HttpClientUtils.get(url); 164 StringBuilder sb = HttpClientUtils.get(url);