Commit 57e2a2c820c43d4cf0ed866ac6fb24ae905b01e4
Merge branch 'minhang' of http://222.66.0.204:8090//panzhaov5/bsth_control into minhang
Showing
35 changed files
with
909 additions
and
262 deletions
Too many changes to show.
To preserve performance only 35 of 56 files are displayed.
src/main/java/com/bsth/controller/forms/ExportController.java
| @@ -190,9 +190,6 @@ public class ExportController { | @@ -190,9 +190,6 @@ public class ExportController { | ||
| 190 | m.put("clzbh", l.getClzbh()); | 190 | m.put("clzbh", l.getClzbh()); |
| 191 | m.put("jsy", l.getJsy()); | 191 | m.put("jsy", l.getJsy()); |
| 192 | m.put("jName", l.getjName()); | 192 | m.put("jName", l.getjName()); |
| 193 | - | ||
| 194 | - | ||
| 195 | - | ||
| 196 | m.put("sgh", l.getSgh()); | 193 | m.put("sgh", l.getSgh()); |
| 197 | m.put("sName", l.getsName()); | 194 | m.put("sName", l.getsName()); |
| 198 | m.put("jhlc", l.getJhlc()); | 195 | m.put("jhlc", l.getJhlc()); |
src/main/java/com/bsth/controller/forms/MCY_FormsController.java
| @@ -78,6 +78,13 @@ public class MCY_FormsController { | @@ -78,6 +78,13 @@ public class MCY_FormsController { | ||
| 78 | 78 | ||
| 79 | return formsService.singledata(map); | 79 | return formsService.singledata(map); |
| 80 | } | 80 | } |
| 81 | + | ||
| 82 | + // 路单数据 | ||
| 83 | + @RequestMapping(value = "/singledatanew", method = RequestMethod.GET) | ||
| 84 | + public List<Singledata> singledatanew(@RequestParam Map<String, Object> map) { | ||
| 85 | + | ||
| 86 | + return formsService.singledata(map); | ||
| 87 | + } | ||
| 81 | 88 | ||
| 82 | // 车辆加注 | 89 | // 车辆加注 |
| 83 | @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET) | 90 | @RequestMapping(value = "/vehicleloading", method = RequestMethod.GET) |
src/main/java/com/bsth/controller/oil/CwjyController.java
| @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod; | @@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMethod; | ||
| 12 | import org.springframework.web.bind.annotation.RequestParam; | 12 | import org.springframework.web.bind.annotation.RequestParam; |
| 13 | import org.springframework.web.bind.annotation.RestController; | 13 | import org.springframework.web.bind.annotation.RestController; |
| 14 | 14 | ||
| 15 | +import com.bsth.common.ResponseCode; | ||
| 15 | import com.bsth.controller.BaseController; | 16 | import com.bsth.controller.BaseController; |
| 16 | import com.bsth.data.BasicData; | 17 | import com.bsth.data.BasicData; |
| 17 | import com.bsth.entity.Line; | 18 | import com.bsth.entity.Line; |
| @@ -35,7 +36,16 @@ public class CwjyController extends BaseController<Cwjy, Integer>{ | @@ -35,7 +36,16 @@ public class CwjyController extends BaseController<Cwjy, Integer>{ | ||
| 35 | t.setNbbm(t.getNbbm().trim().toUpperCase()); | 36 | t.setNbbm(t.getNbbm().trim().toUpperCase()); |
| 36 | Line line=BasicData.nbbm2LineMap.get(t.getNbbm()); | 37 | Line line=BasicData.nbbm2LineMap.get(t.getNbbm()); |
| 37 | t.setLine(line == null?"" : line.getLineCode()); | 38 | t.setLine(line == null?"" : line.getLineCode()); |
| 38 | - return service.save(t); | 39 | + Map<String, Object> map = new HashMap<>(); |
| 40 | + try { | ||
| 41 | + map=service.save(t); | ||
| 42 | + }catch (Exception e) { | ||
| 43 | + // TODO: handle exception | ||
| 44 | + if(e.getMessage().indexOf("PK_CWJYUK")>0){ | ||
| 45 | + map.put("fage", "存在相同数据,数据已经过滤"); | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + return map; | ||
| 39 | } | 49 | } |
| 40 | 50 | ||
| 41 | @RequestMapping(value = "/checkNbbm",method = RequestMethod.GET) | 51 | @RequestMapping(value = "/checkNbbm",method = RequestMethod.GET) |
src/main/java/com/bsth/controller/oil/DlbController.java
| @@ -2,6 +2,7 @@ package com.bsth.controller.oil; | @@ -2,6 +2,7 @@ package com.bsth.controller.oil; | ||
| 2 | 2 | ||
| 3 | import java.text.SimpleDateFormat; | 3 | import java.text.SimpleDateFormat; |
| 4 | import java.util.ArrayList; | 4 | import java.util.ArrayList; |
| 5 | +import java.util.Date; | ||
| 5 | import java.util.HashMap; | 6 | import java.util.HashMap; |
| 6 | import java.util.Iterator; | 7 | import java.util.Iterator; |
| 7 | import java.util.List; | 8 | import java.util.List; |
| @@ -194,4 +195,30 @@ public class DlbController extends BaseController<Dlb, Integer>{ | @@ -194,4 +195,30 @@ public class DlbController extends BaseController<Dlb, Integer>{ | ||
| 194 | 195 | ||
| 195 | } | 196 | } |
| 196 | 197 | ||
| 198 | + | ||
| 199 | + @RequestMapping(value = "/checkJsy",method = RequestMethod.GET) | ||
| 200 | + public String checkJsy(@RequestParam Map<String, Object> map){ | ||
| 201 | + String list=service.checkJsy(map); | ||
| 202 | + return list; | ||
| 203 | + } | ||
| 204 | + | ||
| 205 | + @RequestMapping(value = "/deleteIds", method = RequestMethod.POST) | ||
| 206 | + public Map<String, Object> deleteIds(@RequestParam Map<String, Object> map) { | ||
| 207 | + Map<String, Object> maps=new HashMap<String, Object>(); | ||
| 208 | + try { | ||
| 209 | + maps= service.deleteIds(map); | ||
| 210 | + } catch (Exception e) { | ||
| 211 | + // TODO Auto-generated catch block | ||
| 212 | + e.printStackTrace(); | ||
| 213 | + } | ||
| 214 | + return maps; | ||
| 215 | + } | ||
| 216 | + | ||
| 217 | + @RequestMapping(value = "/saveDlb",method = RequestMethod.POST) | ||
| 218 | + public Map<String, Object> saveDlb(Dlb t){ | ||
| 219 | +// SysUser user = SecurityUtils.getCurrentUser(); | ||
| 220 | + t.setCreatetime(new Date()); | ||
| 221 | +// Ylb t=new Ylb(); | ||
| 222 | + return service.saveDlb(t); | ||
| 223 | + } | ||
| 197 | } | 224 | } |
src/main/java/com/bsth/controller/oil/YlbController.java
| @@ -209,8 +209,8 @@ public class YlbController extends BaseController<Ylb, Integer>{ | @@ -209,8 +209,8 @@ public class YlbController extends BaseController<Ylb, Integer>{ | ||
| 209 | return maps; | 209 | return maps; |
| 210 | } | 210 | } |
| 211 | @RequestMapping(value="/oilListMonth") | 211 | @RequestMapping(value="/oilListMonth") |
| 212 | - public List<Ylb> oilListMonth(@RequestParam String line,@RequestParam String date,@RequestParam String type){ | ||
| 213 | - return yblService.oilListMonth(line, date, type); | 212 | + public List<Ylb> oilListMonth(@RequestParam Map<String, Object> map){ |
| 213 | + return yblService.oilListMonth(map); | ||
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | @RequestMapping(value = "/checkJsy",method = RequestMethod.GET) | 216 | @RequestMapping(value = "/checkJsy",method = RequestMethod.GET) |
src/main/java/com/bsth/controller/oil/YlxxbController.java
| 1 | package com.bsth.controller.oil; | 1 | package com.bsth.controller.oil; |
| 2 | 2 | ||
| 3 | import java.util.HashMap; | 3 | import java.util.HashMap; |
| 4 | +import java.util.List; | ||
| 4 | import java.util.Map; | 5 | import java.util.Map; |
| 5 | 6 | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -28,6 +29,12 @@ public class YlxxbController extends BaseController<Ylxxb, Integer>{ | @@ -28,6 +29,12 @@ public class YlxxbController extends BaseController<Ylxxb, Integer>{ | ||
| 28 | return pagequery; | 29 | return pagequery; |
| 29 | } | 30 | } |
| 30 | 31 | ||
| 32 | + @RequestMapping(value = "/listNbbm",method = RequestMethod.GET) | ||
| 33 | + public List<Ylxxb> listNbbm(@RequestParam Map<String, Object> map){ | ||
| 34 | + List<Ylxxb> list=service.Pagequery_nbbm(map); | ||
| 35 | + return list; | ||
| 36 | + } | ||
| 37 | + | ||
| 31 | 38 | ||
| 32 | /** | 39 | /** |
| 33 | * 核对油量(有加油没里程) | 40 | * 核对油量(有加油没里程) |
| @@ -45,4 +52,17 @@ public class YlxxbController extends BaseController<Ylxxb, Integer>{ | @@ -45,4 +52,17 @@ public class YlxxbController extends BaseController<Ylxxb, Integer>{ | ||
| 45 | } | 52 | } |
| 46 | return list; | 53 | return list; |
| 47 | } | 54 | } |
| 55 | + | ||
| 56 | + @RequestMapping(value = "/checkNbbm",method = RequestMethod.POST) | ||
| 57 | + public Map<String, Object> checkNbbm(@RequestParam Map<String, Object> map){ | ||
| 58 | + Map<String, Object> list=new HashMap<>(); | ||
| 59 | + try { | ||
| 60 | + list = service.checkNbbm(map); | ||
| 61 | + } catch (Exception e) { | ||
| 62 | + // TODO Auto-generated catch block | ||
| 63 | + e.printStackTrace(); | ||
| 64 | + } | ||
| 65 | + return list; | ||
| 66 | + } | ||
| 67 | + | ||
| 48 | } | 68 | } |
src/main/java/com/bsth/controller/realcontrol/BasicDataController.java
| @@ -131,7 +131,7 @@ public class BasicDataController { | @@ -131,7 +131,7 @@ public class BasicDataController { | ||
| 131 | */ | 131 | */ |
| 132 | @RequestMapping("/nbbm2PlateNo") | 132 | @RequestMapping("/nbbm2PlateNo") |
| 133 | public Map<String, String> nbbm2PlateNo(){ | 133 | public Map<String, String> nbbm2PlateNo(){ |
| 134 | - return basicData.getNbbm2PlateNo(); | 134 | + return basicData.nbbmCompanyPlateMap; |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | 137 |
src/main/java/com/bsth/data/BasicData.java
| @@ -12,7 +12,6 @@ import org.apache.commons.lang3.StringUtils; | @@ -12,7 +12,6 @@ import org.apache.commons.lang3.StringUtils; | ||
| 12 | import org.slf4j.Logger; | 12 | import org.slf4j.Logger; |
| 13 | import org.slf4j.LoggerFactory; | 13 | import org.slf4j.LoggerFactory; |
| 14 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 15 | -import org.springframework.jdbc.core.JdbcTemplate; | ||
| 16 | import org.springframework.stereotype.Component; | 15 | import org.springframework.stereotype.Component; |
| 17 | 16 | ||
| 18 | import java.util.*; | 17 | import java.util.*; |
| @@ -82,7 +81,7 @@ public class BasicData { | @@ -82,7 +81,7 @@ public class BasicData { | ||
| 82 | return name != null? name: stationCode2NameMap.get(prefix + code); | 81 | return name != null? name: stationCode2NameMap.get(prefix + code); |
| 83 | } | 82 | } |
| 84 | 83 | ||
| 85 | - @Autowired | 84 | +/* @Autowired |
| 86 | JdbcTemplate jdbcTemplate; | 85 | JdbcTemplate jdbcTemplate; |
| 87 | public Map<String, String> getNbbm2PlateNo(){ | 86 | public Map<String, String> getNbbm2PlateNo(){ |
| 88 | List<Map<String, Object>> list = jdbcTemplate.queryForList("select CAR_CODE,CAR_PLATE from bsth_c_cars where CAR_CODE is not null and CAR_PLATE is not null"); | 87 | List<Map<String, Object>> list = jdbcTemplate.queryForList("select CAR_CODE,CAR_PLATE from bsth_c_cars where CAR_CODE is not null and CAR_PLATE is not null"); |
| @@ -92,7 +91,7 @@ public class BasicData { | @@ -92,7 +91,7 @@ public class BasicData { | ||
| 92 | rs.put(map.get("CAR_CODE").toString(), map.get("CAR_PLATE").toString()); | 91 | rs.put(map.get("CAR_CODE").toString(), map.get("CAR_PLATE").toString()); |
| 93 | } | 92 | } |
| 94 | return rs; | 93 | return rs; |
| 95 | - } | 94 | + }*/ |
| 96 | 95 | ||
| 97 | @Component | 96 | @Component |
| 98 | public static class BasicDataLoader extends Thread { | 97 | public static class BasicDataLoader extends Thread { |
| @@ -258,7 +257,7 @@ public class BasicData { | @@ -258,7 +257,7 @@ public class BasicData { | ||
| 258 | * @Description: TODO(加载线路相关信息) | 257 | * @Description: TODO(加载线路相关信息) |
| 259 | */ | 258 | */ |
| 260 | public void loadLineInfo() { | 259 | public void loadLineInfo() { |
| 261 | - Iterator<Line> iterator = lineRepository.findAll().iterator(); | 260 | + Iterator<Line> iterator = lineRepository.findAllService().iterator(); |
| 262 | 261 | ||
| 263 | Line line; | 262 | Line line; |
| 264 | BiMap<Integer, String> biMap = HashBiMap.create(); | 263 | BiMap<Integer, String> biMap = HashBiMap.create(); |
src/main/java/com/bsth/data/gpsdata/arrival/entity/TimedEnableStationRoute.java
| 1 | -package com.bsth.data.gpsdata.arrival.entity; | ||
| 2 | - | ||
| 3 | -/** | ||
| 4 | - * 定时启用站点路由 | ||
| 5 | - * Created by panzhao on 2017/8/28. | ||
| 6 | - */ | ||
| 7 | -public class TimedEnableStationRoute { | ||
| 8 | - | ||
| 9 | - private String lineCode; | ||
| 10 | - | ||
| 11 | - private Long enableTime; | ||
| 12 | - | ||
| 13 | - public String getLineCode() { | ||
| 14 | - return lineCode; | ||
| 15 | - } | ||
| 16 | - | ||
| 17 | - public void setLineCode(String lineCode) { | ||
| 18 | - this.lineCode = lineCode; | ||
| 19 | - } | ||
| 20 | - | ||
| 21 | - public Long getEnableTime() { | ||
| 22 | - return enableTime; | ||
| 23 | - } | ||
| 24 | - | ||
| 25 | - public void setEnableTime(Long enableTime) { | ||
| 26 | - this.enableTime = enableTime; | ||
| 27 | - } | ||
| 28 | -} | 1 | +package com.bsth.data.gpsdata.arrival.entity; |
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 定时启用站点路由 | ||
| 5 | + * Created by panzhao on 2017/8/28. | ||
| 6 | + */ | ||
| 7 | +public class TimedEnableStationRoute { | ||
| 8 | + | ||
| 9 | + private String lineCode; | ||
| 10 | + | ||
| 11 | + private Long enableTime; | ||
| 12 | + | ||
| 13 | + public String getLineCode() { | ||
| 14 | + return lineCode; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + public void setLineCode(String lineCode) { | ||
| 18 | + this.lineCode = lineCode; | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + public Long getEnableTime() { | ||
| 22 | + return enableTime; | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + public void setEnableTime(Long enableTime) { | ||
| 26 | + this.enableTime = enableTime; | ||
| 27 | + } | ||
| 28 | +} |
src/main/java/com/bsth/data/gpsdata/arrival/handlers/InOutStationSignalHandle.java
| @@ -164,6 +164,9 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -164,6 +164,9 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 164 | //实发时间 | 164 | //实发时间 |
| 165 | sch.setFcsjActualAll(rsT); | 165 | sch.setFcsjActualAll(rsT); |
| 166 | sch.setSiginCompate(1); | 166 | sch.setSiginCompate(1); |
| 167 | + | ||
| 168 | + //出站既出场 | ||
| 169 | + outStationAndOutPark(sch); | ||
| 167 | //通知客户端 | 170 | //通知客户端 |
| 168 | sendUtils.sendFcsj(sch); | 171 | sendUtils.sendFcsj(sch); |
| 169 | //持久化 | 172 | //持久化 |
| @@ -172,12 +175,11 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -172,12 +175,11 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 172 | //清理应发未发标记 | 175 | //清理应发未发标记 |
| 173 | LateAdjustHandle.remove(sch); | 176 | LateAdjustHandle.remove(sch); |
| 174 | 177 | ||
| 175 | - if(!gps.isService()){ | 178 | + if(!gps.isService() && !dayOfSchedule.emptyService(sch)){ |
| 176 | //切换成营运状态 | 179 | //切换成营运状态 |
| 177 | gpsStatusManager.changeServiceState(sch.getClZbh(), sch.getXlDir(), 0, "发车@系统"); | 180 | gpsStatusManager.changeServiceState(sch.getClZbh(), sch.getXlDir(), 0, "发车@系统"); |
| 178 | } | 181 | } |
| 179 | - //出站既出场 | ||
| 180 | - outStationAndOutPark(sch); | 182 | + |
| 181 | logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); | 183 | logger.info("车辆:" + sch.getClZbh() + " 班次:" + sch.getDfsj() + "发车, 时间:" + sch.getFcsjActual()); |
| 182 | } | 184 | } |
| 183 | else if(isOutSch(sch)){ | 185 | else if(isOutSch(sch)){ |
| @@ -206,8 +208,8 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -206,8 +208,8 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 206 | } | 208 | } |
| 207 | if(next != null && prev.getStopNo().equals(next.getQdzCode())){ | 209 | if(next != null && prev.getStopNo().equals(next.getQdzCode())){ |
| 208 | //发下一个班次 | 210 | //发下一个班次 |
| 209 | - dayOfSchedule.addExecPlan(next); | ||
| 210 | - outStation(gps, prev); | 211 | + if(dayOfSchedule.addExecPlan(next)) |
| 212 | + outStation(gps, prev); | ||
| 211 | } | 213 | } |
| 212 | } | 214 | } |
| 213 | //当前班次是区间 | 215 | //当前班次是区间 |
| @@ -219,8 +221,8 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -219,8 +221,8 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 219 | //是环线 | 221 | //是环线 |
| 220 | if(prev.getStopNo().equals(next.getQdzCode())){ | 222 | if(prev.getStopNo().equals(next.getQdzCode())){ |
| 221 | //发下一个班次 | 223 | //发下一个班次 |
| 222 | - dayOfSchedule.addExecPlan(next); | ||
| 223 | - outStation(gps, prev); | 224 | + if(dayOfSchedule.addExecPlan(next)) |
| 225 | + outStation(gps, prev); | ||
| 224 | } | 226 | } |
| 225 | } | 227 | } |
| 226 | } | 228 | } |
| @@ -252,31 +254,29 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -252,31 +254,29 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 252 | 254 | ||
| 253 | 255 | ||
| 254 | private void outStationAndOutPark(ScheduleRealInfo sch){ | 256 | private void outStationAndOutPark(ScheduleRealInfo sch){ |
| 255 | - LineConfig config = lineConfigData.get(sch.getXlBm()); | ||
| 256 | - //限定出站既出场的停车场 | ||
| 257 | - String park = config.getTwinsPark(); | ||
| 258 | - boolean limitPark = StringUtils.isNotEmpty(park); | ||
| 259 | - | ||
| 260 | - if (config != null && config.getOutConfig() == 2) { | ||
| 261 | - //出站既出场 | ||
| 262 | - ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); | ||
| 263 | - if (schPrev != null && schPrev.getBcType().equals("out") && (schPrev.getBcsj()==0 || schPrev.getJhlcOrig().equals(0)) | ||
| 264 | - && (!limitPark || park.equals(schPrev.getQdzCode()))) { | ||
| 265 | - | ||
| 266 | - schPrev.setFcsjActualAll(sch.getFcsjActualTime()); | ||
| 267 | - schPrev.setZdsjActualAll(sch.getFcsjActualTime()); | ||
| 268 | - | ||
| 269 | - sendUtils.refreshSch(schPrev); | ||
| 270 | - dayOfSchedule.save(schPrev); | ||
| 271 | - | ||
| 272 | - /*if(schPrev.getBcType().equals("out")){ | ||
| 273 | - //出场时,切换成营运状态 | ||
| 274 | - String deviceId = BasicData.deviceId2NbbmMap.inverse().get(sch.getClZbh()); | ||
| 275 | - gpsStatusManager.changeServiceState(deviceId, schPrev.getXlDir(), 0, "出场@系统"); | ||
| 276 | - //DirectivePushQueue.put6003(schPrev.getClZbh(), 0, Integer.parseInt(schPrev.getXlDir()), "出场@系统"); | ||
| 277 | - //directiveService.send60Operation(schPrev.getClZbh(), 0, Integer.parseInt(schPrev.getXlDir()), null, "出场@系统"); | ||
| 278 | - }*/ | 257 | + try{ |
| 258 | + LineConfig config = lineConfigData.get(sch.getXlBm()); | ||
| 259 | + //限定出站既出场的停车场 | ||
| 260 | + String park = config.getTwinsPark(); | ||
| 261 | + boolean limitPark = StringUtils.isNotEmpty(park); | ||
| 262 | + | ||
| 263 | + if (config != null && config.getOutConfig() == 2) { | ||
| 264 | + //出站既出场 | ||
| 265 | + ScheduleRealInfo schPrev = dayOfSchedule.prev(sch); | ||
| 266 | + if (schPrev != null && schPrev.getBcType().equals("out") && (schPrev.getBcsj()==0 || schPrev.getJhlcOrig().intValue()==0) | ||
| 267 | + && (!limitPark || park.equals(schPrev.getQdzCode()))) { | ||
| 268 | + | ||
| 269 | + schPrev.setFcsjActualAll(sch.getFcsjActualTime()); | ||
| 270 | + schPrev.setZdsjActualAll(sch.getFcsjActualTime()); | ||
| 271 | + //起点实到 | ||
| 272 | + sch.setQdzArrDatesj(schPrev.getZdsjActual()); | ||
| 273 | + | ||
| 274 | + sendUtils.refreshSch(schPrev); | ||
| 275 | + dayOfSchedule.save(schPrev); | ||
| 276 | + } | ||
| 279 | } | 277 | } |
| 278 | + }catch (Exception e){ | ||
| 279 | + logger.error("", e); | ||
| 280 | } | 280 | } |
| 281 | } | 281 | } |
| 282 | 282 | ||
| @@ -343,9 +343,6 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -343,9 +343,6 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 343 | if(lpNext != null){ | 343 | if(lpNext != null){ |
| 344 | lpNext.setQdzArrDatesj(sch.getZdsjActual()); | 344 | lpNext.setQdzArrDatesj(sch.getZdsjActual()); |
| 345 | } | 345 | } |
| 346 | - else{ | ||
| 347 | - logger.info(sch.getClZbh() + " 到终点,无下一班"); | ||
| 348 | - } | ||
| 349 | 346 | ||
| 350 | //通知客户端 | 347 | //通知客户端 |
| 351 | sendUtils.sendZdsj(sch, lpNext, doneSum); | 348 | sendUtils.sendZdsj(sch, lpNext, doneSum); |
| @@ -361,11 +358,12 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -361,11 +358,12 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 361 | if(!next.getXlBm().equals(sch.getXlBm())){ | 358 | if(!next.getXlBm().equals(sch.getXlBm())){ |
| 362 | gpsStatusManager.changeLine(next.getClZbh(), next.getXlBm(), "套跑@系统"); | 359 | gpsStatusManager.changeLine(next.getClZbh(), next.getXlBm(), "套跑@系统"); |
| 363 | } | 360 | } |
| 364 | - } | ||
| 365 | - else if(sch.getBcType().equals("in")){ | ||
| 366 | - //进场,切换成非营运状态 | ||
| 367 | - gpsStatusManager.changeServiceState(sch.getClZbh(), sch.getXlDir(), 1, "进场@系统"); | ||
| 368 | - } | 361 | + |
| 362 | + //下一个班次是空驶班次 | ||
| 363 | + if(dayOfSchedule.emptyService(next)) | ||
| 364 | + nonService(sch, "空驶@系统"); | ||
| 365 | + } else | ||
| 366 | + nonService(sch, "结束@系统"); | ||
| 369 | } | 367 | } |
| 370 | else { | 368 | else { |
| 371 | /*if(sch.getFcsjActual() == null){ | 369 | /*if(sch.getFcsjActual() == null){ |
| @@ -402,9 +400,8 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -402,9 +400,8 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 402 | 400 | ||
| 403 | if(nearSch != null){ | 401 | if(nearSch != null){ |
| 404 | //直接跳到这个班次 | 402 | //直接跳到这个班次 |
| 405 | - dayOfSchedule.addExecPlan(nearSch); | ||
| 406 | - //重新进站 | ||
| 407 | - inStation(gps, prev); | 403 | + if(dayOfSchedule.addExecPlan(nearSch)) |
| 404 | + inStation(gps, prev);//重新进站 | ||
| 408 | } | 405 | } |
| 409 | } | 406 | } |
| 410 | } | 407 | } |
| @@ -429,7 +426,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -429,7 +426,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 429 | String stopId = gps.getStopNo(); | 426 | String stopId = gps.getStopNo(); |
| 430 | for(int i = 0; i < halfList.size(); i ++){ | 427 | for(int i = 0; i < halfList.size(); i ++){ |
| 431 | sch = halfList.get(i); | 428 | sch = halfList.get(i); |
| 432 | - if(!sch.getZdzCode().equals(stopId)) | 429 | + if(!sch.getZdzCode().equals(stopId) || sch.getStatus()==2) |
| 433 | continue; | 430 | continue; |
| 434 | 431 | ||
| 435 | if(sch.getZdsjT() < gps.getTimestamp()) | 432 | if(sch.getZdsjT() < gps.getTimestamp()) |
| @@ -467,7 +464,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -467,7 +464,7 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 467 | dayOfSchedule.addExecPlan(next); | 464 | dayOfSchedule.addExecPlan(next); |
| 468 | 465 | ||
| 469 | //进场,切换成非营运状态 | 466 | //进场,切换成非营运状态 |
| 470 | - gpsStatusManager.changeServiceState(sch.getClZbh(), sch.getXlDir(), 1, "进场@系统"); | 467 | + nonService(sch, "进场@系统"); |
| 471 | } | 468 | } |
| 472 | } | 469 | } |
| 473 | 470 | ||
| @@ -523,4 +520,13 @@ public class InOutStationSignalHandle extends SignalHandle{ | @@ -523,4 +520,13 @@ public class InOutStationSignalHandle extends SignalHandle{ | ||
| 523 | private boolean isInSch(ScheduleRealInfo sch){ | 520 | private boolean isInSch(ScheduleRealInfo sch){ |
| 524 | return sch.getBcType().equals("in") || GeoCacheData.tccMap.keySet().contains(sch.getZdzCode()); | 521 | return sch.getBcType().equals("in") || GeoCacheData.tccMap.keySet().contains(sch.getZdzCode()); |
| 525 | } | 522 | } |
| 523 | + | ||
| 524 | + /** | ||
| 525 | + * 切换为非营运状态 | ||
| 526 | + * @param sch | ||
| 527 | + * @param sender | ||
| 528 | + */ | ||
| 529 | + private void nonService(ScheduleRealInfo sch, String sender){ | ||
| 530 | + gpsStatusManager.changeServiceState(sch.getClZbh(), sch.getXlDir(), 1, sender); | ||
| 531 | + } | ||
| 526 | } | 532 | } |
| 527 | \ No newline at end of file | 533 | \ No newline at end of file |
src/main/java/com/bsth/data/gpsdata/arrival/utils/SignalSchPlanMatcher.java
| @@ -69,8 +69,8 @@ public class SignalSchPlanMatcher { | @@ -69,8 +69,8 @@ public class SignalSchPlanMatcher { | ||
| 69 | double s = (int) (next.getDfsjT() - sch.getDfsjT()); | 69 | double s = (int) (next.getDfsjT() - sch.getDfsjT()); |
| 70 | double r = (int) (t - sch.getDfsjT()); | 70 | double r = (int) (t - sch.getDfsjT()); |
| 71 | if(r / s > 0.7){ | 71 | if(r / s > 0.7){ |
| 72 | - dayOfSchedule.addExecPlan(next); | ||
| 73 | - outMatch(outSigal, next); | 72 | + if(dayOfSchedule.addExecPlan(next)) |
| 73 | + outMatch(outSigal, next); | ||
| 74 | } | 74 | } |
| 75 | } | 75 | } |
| 76 | 76 |
src/main/java/com/bsth/data/gpsdata/recovery/GpsDataRecovery.java
| @@ -60,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -60,7 +60,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 60 | for (String nbbm : keys) { | 60 | for (String nbbm : keys) { |
| 61 | Collections.sort(listMap.get(nbbm), comp); | 61 | Collections.sort(listMap.get(nbbm), comp); |
| 62 | threadPool.execute(new RecoveryThread(listMap.get(nbbm), count)); | 62 | threadPool.execute(new RecoveryThread(listMap.get(nbbm), count)); |
| 63 | - /*if(nbbm.equals("W09-164")) | 63 | + /*if(nbbm.equals("S0K-004")) |
| 64 | new RecoveryThread(listMap.get(nbbm), count).run();*/ | 64 | new RecoveryThread(listMap.get(nbbm), count).run();*/ |
| 65 | /*if(lineId.equals("60028")) | 65 | /*if(lineId.equals("60028")) |
| 66 | new RecoveryThread(listMap.get(lineId), count).run();*/ | 66 | new RecoveryThread(listMap.get(lineId), count).run();*/ |
| @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -84,7 +84,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 84 | Calendar calendar = Calendar.getInstance(); | 84 | Calendar calendar = Calendar.getInstance(); |
| 85 | int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); | 85 | int dayOfYear = calendar.get(Calendar.DAY_OF_YEAR); |
| 86 | 86 | ||
| 87 | - String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=241";// + dayOfYear; | 87 | + String sql = "select DEVICE_ID,LAT,LON,TS,SPEED_GPS,LINE_ID,SERVICE_STATE from bsth_c_gps_info where days_year=246";// + dayOfYear; |
| 88 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); | 88 | JdbcTemplate jdbcTemplate = new JdbcTemplate(DBUtils_MS.getDataSource()); |
| 89 | 89 | ||
| 90 | List<GpsEntity> list = | 90 | List<GpsEntity> list = |
| @@ -153,7 +153,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | @@ -153,7 +153,7 @@ public class GpsDataRecovery implements ApplicationContextAware { | ||
| 153 | boolean task; | 153 | boolean task; |
| 154 | for (GpsEntity gps : list) { | 154 | for (GpsEntity gps : list) { |
| 155 | try { | 155 | try { |
| 156 | - /*if(gps.getTimestamp() >= 1503960000000L){ | 156 | + /*if(gps.getTimestamp() >= 1504298280000L){ |
| 157 | System.out.println("debugger..."); | 157 | System.out.println("debugger..."); |
| 158 | }*/ | 158 | }*/ |
| 159 | //是否有任务 | 159 | //是否有任务 |
src/main/java/com/bsth/data/schedule/DayOfSchedule.java
| @@ -592,7 +592,7 @@ public class DayOfSchedule { | @@ -592,7 +592,7 @@ public class DayOfSchedule { | ||
| 592 | * @param sch 当前班次 | 592 | * @param sch 当前班次 |
| 593 | * @return | 593 | * @return |
| 594 | */ | 594 | */ |
| 595 | - private ScheduleRealInfo next2(Collection<ScheduleRealInfo> list, ScheduleRealInfo sch) { | 595 | + private ScheduleRealInfo next2_lp(Collection<ScheduleRealInfo> list, ScheduleRealInfo sch) { |
| 596 | int outConfig = -1; | 596 | int outConfig = -1; |
| 597 | LineConfig config = lineConfigData.get(sch.getXlBm()); | 597 | LineConfig config = lineConfigData.get(sch.getXlBm()); |
| 598 | if (config != null) | 598 | if (config != null) |
| @@ -605,8 +605,35 @@ public class DayOfSchedule { | @@ -605,8 +605,35 @@ public class DayOfSchedule { | ||
| 605 | flag = true; | 605 | flag = true; |
| 606 | continue; | 606 | continue; |
| 607 | } | 607 | } |
| 608 | - //忽略烂班 | ||
| 609 | - if (temp.isDestroy()) | 608 | + |
| 609 | + if (flag) { | ||
| 610 | + next = temp; | ||
| 611 | + break; | ||
| 612 | + } | ||
| 613 | + } | ||
| 614 | + return next; | ||
| 615 | + } | ||
| 616 | + | ||
| 617 | + private ScheduleRealInfo next3_lp(Collection<ScheduleRealInfo> list, ScheduleRealInfo sch) { | ||
| 618 | + int outConfig = -1; | ||
| 619 | + LineConfig config = lineConfigData.get(sch.getXlBm()); | ||
| 620 | + if (config != null) | ||
| 621 | + outConfig = config.getOutConfig(); | ||
| 622 | + | ||
| 623 | + //限定出站既出场的停车场 | ||
| 624 | + String park = config.getTwinsPark(); | ||
| 625 | + boolean limitPark = StringUtils.isNotEmpty(park); | ||
| 626 | + boolean flag = false; | ||
| 627 | + ScheduleRealInfo next = null; | ||
| 628 | + for (ScheduleRealInfo temp : list) { | ||
| 629 | + if (temp.getId() == sch.getId()) { | ||
| 630 | + flag = true; | ||
| 631 | + continue; | ||
| 632 | + } | ||
| 633 | + | ||
| 634 | + //出站既出场,忽略出场班次 | ||
| 635 | + if (outConfig == 2 && temp.getBcType().equals("out") && (temp.getBcsj()==0 || temp.getJhlcOrig().equals(0)) | ||
| 636 | + && (!limitPark || park.equals(temp.getQdzCode()))) | ||
| 610 | continue; | 637 | continue; |
| 611 | 638 | ||
| 612 | if (flag) { | 639 | if (flag) { |
| @@ -885,7 +912,8 @@ public class DayOfSchedule { | @@ -885,7 +912,8 @@ public class DayOfSchedule { | ||
| 885 | return nbbmScheduleMap.values(); | 912 | return nbbmScheduleMap.values(); |
| 886 | } | 913 | } |
| 887 | 914 | ||
| 888 | - public void addExecPlan(ScheduleRealInfo sch) { | 915 | + public boolean addExecPlan(ScheduleRealInfo sch) { |
| 916 | + ScheduleRealInfo oldExec = executeCurr(sch.getClZbh()); | ||
| 889 | if (sch != null){ | 917 | if (sch != null){ |
| 890 | if(sch.getStatus()==2) | 918 | if(sch.getStatus()==2) |
| 891 | reCalcExecPlan(sch.getClZbh()); | 919 | reCalcExecPlan(sch.getClZbh()); |
| @@ -894,6 +922,8 @@ public class DayOfSchedule { | @@ -894,6 +922,8 @@ public class DayOfSchedule { | ||
| 894 | } | 922 | } |
| 895 | else | 923 | else |
| 896 | carExecutePlanMap.remove(sch.getClZbh()); | 924 | carExecutePlanMap.remove(sch.getClZbh()); |
| 925 | + | ||
| 926 | + return executeCurr(sch.getClZbh()) != oldExec; | ||
| 897 | } | 927 | } |
| 898 | 928 | ||
| 899 | public void removeExecPlan(String clzbh) { | 929 | public void removeExecPlan(String clzbh) { |
| @@ -950,6 +980,7 @@ public class DayOfSchedule { | @@ -950,6 +980,7 @@ public class DayOfSchedule { | ||
| 950 | } | 980 | } |
| 951 | 981 | ||
| 952 | public void reCalcExecPlan(String nbbm) { | 982 | public void reCalcExecPlan(String nbbm) { |
| 983 | + logger.info("reCalcExecPlan...: " + nbbm); | ||
| 953 | List<ScheduleRealInfo> list = nbbmScheduleMap.get(nbbm); | 984 | List<ScheduleRealInfo> list = nbbmScheduleMap.get(nbbm); |
| 954 | Collections.sort(list, schFCSJComparator); | 985 | Collections.sort(list, schFCSJComparator); |
| 955 | 986 | ||
| @@ -1121,7 +1152,7 @@ public class DayOfSchedule { | @@ -1121,7 +1152,7 @@ public class DayOfSchedule { | ||
| 1121 | public ScheduleRealInfo nextByLp(ScheduleRealInfo sch) { | 1152 | public ScheduleRealInfo nextByLp(ScheduleRealInfo sch) { |
| 1122 | List<ScheduleRealInfo> list = lpScheduleMap.get(sch.getXlBm() + "_" + sch.getLpName()); | 1153 | List<ScheduleRealInfo> list = lpScheduleMap.get(sch.getXlBm() + "_" + sch.getLpName()); |
| 1123 | Collections.sort(list, schFCSJComparator); | 1154 | Collections.sort(list, schFCSJComparator); |
| 1124 | - return next(list, sch); | 1155 | + return next3_lp(list, sch); |
| 1125 | } | 1156 | } |
| 1126 | 1157 | ||
| 1127 | /** | 1158 | /** |
| @@ -1133,7 +1164,7 @@ public class DayOfSchedule { | @@ -1133,7 +1164,7 @@ public class DayOfSchedule { | ||
| 1133 | public ScheduleRealInfo nextByLp2(ScheduleRealInfo sch) { | 1164 | public ScheduleRealInfo nextByLp2(ScheduleRealInfo sch) { |
| 1134 | List<ScheduleRealInfo> list = lpScheduleMap.get(sch.getXlBm() + "_" + sch.getLpName()); | 1165 | List<ScheduleRealInfo> list = lpScheduleMap.get(sch.getXlBm() + "_" + sch.getLpName()); |
| 1135 | Collections.sort(list, schFCSJComparator); | 1166 | Collections.sort(list, schFCSJComparator); |
| 1136 | - return next2(list, sch); | 1167 | + return next2_lp(list, sch); |
| 1137 | } | 1168 | } |
| 1138 | 1169 | ||
| 1139 | public ArrayListMultimap<String, ScheduleRealInfo> getLpScheduleMap() { | 1170 | public ArrayListMultimap<String, ScheduleRealInfo> getLpScheduleMap() { |
src/main/java/com/bsth/data/schedule/thread/ScheduleRefreshThread.java
| @@ -49,25 +49,34 @@ public class ScheduleRefreshThread extends Thread{ | @@ -49,25 +49,34 @@ public class ScheduleRefreshThread extends Thread{ | ||
| 49 | Collection<LineConfig> confs = lineConfs.getAll(); | 49 | Collection<LineConfig> confs = lineConfs.getAll(); |
| 50 | 50 | ||
| 51 | String currSchDate, oldSchDate; | 51 | String currSchDate, oldSchDate; |
| 52 | - String lineCode; | 52 | + String lineCode = null; |
| 53 | for(LineConfig conf : confs){ | 53 | for(LineConfig conf : confs){ |
| 54 | - lineCode = conf.getLine().getLineCode(); | ||
| 55 | - oldSchDate = dayOfSchedule.getCurrSchDate().get(lineCode); | ||
| 56 | - currSchDate = dayOfSchedule.calcSchDate(lineCode); | ||
| 57 | - | ||
| 58 | - if(oldSchDate == null || !oldSchDate.equals(currSchDate)){ | 54 | + try{ |
| 55 | + lineCode = conf.getLine().getLineCode(); | ||
| 56 | + oldSchDate = dayOfSchedule.getCurrSchDate().get(lineCode); | ||
| 57 | + currSchDate = dayOfSchedule.calcSchDate(lineCode); | ||
| 59 | 58 | ||
| 60 | - logger.info(lineCode + "开始翻班, " + currSchDate); | ||
| 61 | - //清除指令数据 | ||
| 62 | - Set<String> cars = dayOfSchedule.findCarByLineCode(lineCode); | ||
| 63 | - for(String car : cars) | ||
| 64 | - dayOfDirectives.clear(BasicData.deviceId2NbbmMap.inverse().get(car)); | ||
| 65 | - //清除驾驶员上报数据 | ||
| 66 | - pilotReport.clear(lineCode); | ||
| 67 | - | ||
| 68 | - //重载排班数据 | ||
| 69 | - dayOfSchedule.reloadSch(lineCode, currSchDate, false); | ||
| 70 | - logger.info(lineCode + "翻班完成, " + currSchDate + " -班次数量:" + dayOfSchedule.findByLineCode(lineCode).size()); | 59 | + if(oldSchDate == null || !oldSchDate.equals(currSchDate)){ |
| 60 | + | ||
| 61 | + logger.info(lineCode + "开始翻班, " + currSchDate); | ||
| 62 | + | ||
| 63 | + try{ | ||
| 64 | + //清除指令数据 | ||
| 65 | + Set<String> cars = dayOfSchedule.findCarByLineCode(lineCode); | ||
| 66 | + for(String car : cars) | ||
| 67 | + dayOfDirectives.clear(BasicData.deviceId2NbbmMap.inverse().get(car)); | ||
| 68 | + //清除驾驶员上报数据 | ||
| 69 | + pilotReport.clear(lineCode); | ||
| 70 | + }catch (Exception e){ | ||
| 71 | + logger.error("清理 60 和 80出现问题", e); | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + //重载排班数据 | ||
| 75 | + dayOfSchedule.reloadSch(lineCode, currSchDate, false); | ||
| 76 | + logger.info(lineCode + "翻班完成, " + currSchDate + " -班次数量:" + dayOfSchedule.findByLineCode(lineCode).size()); | ||
| 77 | + } | ||
| 78 | + }catch (Exception e){ | ||
| 79 | + logger.error("班次更新失败!! -" + lineCode, e); | ||
| 71 | } | 80 | } |
| 72 | } | 81 | } |
| 73 | 82 |
src/main/java/com/bsth/entity/oil/Ylxxb.java
| @@ -38,7 +38,7 @@ public class Ylxxb { | @@ -38,7 +38,7 @@ public class Ylxxb { | ||
| 38 | private Integer nylx; | 38 | private Integer nylx; |
| 39 | @Transient | 39 | @Transient |
| 40 | private String ldgh; | 40 | private String ldgh; |
| 41 | - //0为接口数据,1为手工输入 | 41 | + //0为接口数据,1为手工输入,2为改变车号,3为改变驾驶员 |
| 42 | private Integer jylx=0; | 42 | private Integer jylx=0; |
| 43 | @Transient | 43 | @Transient |
| 44 | private String gsname; | 44 | private String gsname; |
src/main/java/com/bsth/entity/oil/YlxxbUpdate.java
0 → 100644
| 1 | +package com.bsth.entity.oil; | ||
| 2 | + | ||
| 3 | +import java.util.Date; | ||
| 4 | + | ||
| 5 | +import javax.persistence.Entity; | ||
| 6 | +import javax.persistence.GeneratedValue; | ||
| 7 | +import javax.persistence.Id; | ||
| 8 | +import javax.persistence.Table; | ||
| 9 | +import javax.persistence.Transient; | ||
| 10 | + | ||
| 11 | +import org.springframework.format.annotation.DateTimeFormat; | ||
| 12 | + | ||
| 13 | +import com.bsth.data.BasicData; | ||
| 14 | + | ||
| 15 | +@Entity | ||
| 16 | +@Table(name = "bsth_c_ylxxb_update") | ||
| 17 | +public class YlxxbUpdate { | ||
| 18 | + @Id | ||
| 19 | + @GeneratedValue | ||
| 20 | + private Integer id; | ||
| 21 | + @DateTimeFormat(pattern="yyyy-MM-dd") | ||
| 22 | + private Date yyrq; | ||
| 23 | + private Date jlrq; | ||
| 24 | + private String nbbm; | ||
| 25 | + private String jsy; | ||
| 26 | + private Double jzl; | ||
| 27 | + private String stationid; | ||
| 28 | + private Date createtime; | ||
| 29 | + private String gsdm; | ||
| 30 | + | ||
| 31 | + private Date xgrq; | ||
| 32 | + private String xgr; | ||
| 33 | + private String tj; | ||
| 34 | + public Integer getId() { | ||
| 35 | + return id; | ||
| 36 | + } | ||
| 37 | + public void setId(Integer id) { | ||
| 38 | + this.id = id; | ||
| 39 | + } | ||
| 40 | + public Date getYyrq() { | ||
| 41 | + return yyrq; | ||
| 42 | + } | ||
| 43 | + public void setYyrq(Date yyrq) { | ||
| 44 | + this.yyrq = yyrq; | ||
| 45 | + } | ||
| 46 | + public Date getJlrq() { | ||
| 47 | + return jlrq; | ||
| 48 | + } | ||
| 49 | + public void setJlrq(Date jlrq) { | ||
| 50 | + this.jlrq = jlrq; | ||
| 51 | + } | ||
| 52 | + public String getNbbm() { | ||
| 53 | + return nbbm; | ||
| 54 | + } | ||
| 55 | + public void setNbbm(String nbbm) { | ||
| 56 | + this.nbbm = nbbm; | ||
| 57 | + } | ||
| 58 | + public String getJsy() { | ||
| 59 | + return jsy; | ||
| 60 | + } | ||
| 61 | + public void setJsy(String jsy) { | ||
| 62 | + this.jsy = jsy; | ||
| 63 | + } | ||
| 64 | + public Double getJzl() { | ||
| 65 | + return jzl; | ||
| 66 | + } | ||
| 67 | + public void setJzl(Double jzl) { | ||
| 68 | + this.jzl = jzl; | ||
| 69 | + } | ||
| 70 | + public String getStationid() { | ||
| 71 | + return stationid; | ||
| 72 | + } | ||
| 73 | + public void setStationid(String stationid) { | ||
| 74 | + this.stationid = stationid; | ||
| 75 | + } | ||
| 76 | + public Date getCreatetime() { | ||
| 77 | + return createtime; | ||
| 78 | + } | ||
| 79 | + public void setCreatetime(Date createtime) { | ||
| 80 | + this.createtime = createtime; | ||
| 81 | + } | ||
| 82 | + public String getGsdm() { | ||
| 83 | + return gsdm; | ||
| 84 | + } | ||
| 85 | + public void setGsdm(String gsdm) { | ||
| 86 | + this.gsdm = gsdm; | ||
| 87 | + } | ||
| 88 | + public Date getXgrq() { | ||
| 89 | + return xgrq; | ||
| 90 | + } | ||
| 91 | + public void setXgrq(Date xgrq) { | ||
| 92 | + this.xgrq = xgrq; | ||
| 93 | + } | ||
| 94 | + public String getXgr() { | ||
| 95 | + return xgr; | ||
| 96 | + } | ||
| 97 | + public void setXgr(String xgr) { | ||
| 98 | + this.xgr = xgr; | ||
| 99 | + } | ||
| 100 | + public String getTj() { | ||
| 101 | + return tj; | ||
| 102 | + } | ||
| 103 | + public void setTj(String tj) { | ||
| 104 | + this.tj = tj; | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + | ||
| 108 | + | ||
| 109 | + | ||
| 110 | +} |
src/main/java/com/bsth/entity/realcontrol/ScheduleRealInfo.java
| @@ -217,6 +217,14 @@ public class ScheduleRealInfo { | @@ -217,6 +217,14 @@ public class ScheduleRealInfo { | ||
| 217 | /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/ | 217 | /** 是否需要补充GPS信号 (网关提交至运管处动态数据用) 1: 能发车, 2:能到达 3: 补发过*/ |
| 218 | private int siginCompate; | 218 | private int siginCompate; |
| 219 | 219 | ||
| 220 | + /** | ||
| 221 | + * 漂移状态 | ||
| 222 | + * 1: 发车漂移 | ||
| 223 | + * 2:到站漂移 | ||
| 224 | + * 3:中途漂移 | ||
| 225 | + */ | ||
| 226 | + private Integer driftStatus = 0; | ||
| 227 | + | ||
| 220 | public boolean isDfAuto() { | 228 | public boolean isDfAuto() { |
| 221 | return dfAuto; | 229 | return dfAuto; |
| 222 | } | 230 | } |
| @@ -933,4 +941,12 @@ public class ScheduleRealInfo { | @@ -933,4 +941,12 @@ public class ScheduleRealInfo { | ||
| 933 | public void setSiginCompate(int siginCompate) { | 941 | public void setSiginCompate(int siginCompate) { |
| 934 | this.siginCompate = siginCompate; | 942 | this.siginCompate = siginCompate; |
| 935 | } | 943 | } |
| 944 | + | ||
| 945 | + public Integer getDriftStatus() { | ||
| 946 | + return driftStatus; | ||
| 947 | + } | ||
| 948 | + | ||
| 949 | + public void setDriftStatus(Integer driftStatus) { | ||
| 950 | + this.driftStatus = driftStatus; | ||
| 951 | + } | ||
| 936 | } | 952 | } |
src/main/java/com/bsth/repository/LineRepository.java
| @@ -41,4 +41,7 @@ public interface LineRepository extends BaseRepository<Line, Integer> { | @@ -41,4 +41,7 @@ public interface LineRepository extends BaseRepository<Line, Integer> { | ||
| 41 | 41 | ||
| 42 | @Query(value = " SELECT l FROM Line l where l.company like %?1% and l.brancheCompany like %?2% and l.lineCode like ?3") | 42 | @Query(value = " SELECT l FROM Line l where l.company like %?1% and l.brancheCompany like %?2% and l.lineCode like ?3") |
| 43 | public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); | 43 | public List<Line> findLineBygsBm(String gsBm, String fgsBm, String line); |
| 44 | + | ||
| 45 | + @Query("SELECT L FROM Line L where L.destroy=0") | ||
| 46 | + List<Line> findAllService(); | ||
| 44 | } | 47 | } |
src/main/java/com/bsth/repository/oil/YlxxbUpdateRepository.java
0 → 100644
| 1 | +package com.bsth.repository.oil; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import org.springframework.stereotype.Repository; | ||
| 5 | +import com.bsth.entity.oil.YlxxbUpdate; | ||
| 6 | +import com.bsth.repository.BaseRepository; | ||
| 7 | + | ||
| 8 | +@Repository | ||
| 9 | +public interface YlxxbUpdateRepository extends BaseRepository<YlxxbUpdate, Integer>{ | ||
| 10 | + | ||
| 11 | +} |
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
| @@ -146,6 +146,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | @@ -146,6 +146,11 @@ public interface ScheduleRealInfoRepository extends BaseRepository<ScheduleRealI | ||
| 146 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.lpName, s.realExecDate,s.fcsj") | 146 | @Query(value="select DISTINCT s from ScheduleRealInfo s where s.xlBm =?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 order by s.lpName, s.realExecDate,s.fcsj") |
| 147 | List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date); | 147 | List<ScheduleRealInfo> scheduleByDateAndLineQp(String line,String date); |
| 148 | 148 | ||
| 149 | + | ||
| 150 | + @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | ||
| 151 | + @Query(value="select DISTINCT s from ScheduleRealInfo s where gsBm like %?1% and fgsBm like %?2% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?3 order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") | ||
| 152 | + List<ScheduleRealInfo> scheduleByDateAndLineByGs_(String gsdm,String fgsdm,String date); | ||
| 153 | + | ||
| 149 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) | 154 | @EntityGraph(value = "scheduleRealInfo_cTasks", type = EntityGraph.EntityGraphType.FETCH) |
| 150 | @Query(value="select DISTINCT s from ScheduleRealInfo s where gsBm like %?1% and fgsBm like %?2% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?3 and s.bcType not in ('in','out','ldks') order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") | 155 | @Query(value="select DISTINCT s from ScheduleRealInfo s where gsBm like %?1% and fgsBm like %?2% and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?3 and s.bcType not in ('in','out','ldks') order by s.xlDir,s.realExecDate,s.fcsj, s.lpName") |
| 151 | List<ScheduleRealInfo> scheduleByDateAndLineByGs(String gsdm,String fgsdm,String date); | 156 | List<ScheduleRealInfo> scheduleByDateAndLineByGs(String gsdm,String fgsdm,String date); |
src/main/java/com/bsth/service/forms/FormsService.java
| @@ -30,6 +30,7 @@ public interface FormsService { | @@ -30,6 +30,7 @@ public interface FormsService { | ||
| 30 | public List<Shifday> shifday(Map<String, Object> map); | 30 | public List<Shifday> shifday(Map<String, Object> map); |
| 31 | 31 | ||
| 32 | public List<Singledata> singledata(Map<String, Object> map); | 32 | public List<Singledata> singledata(Map<String, Object> map); |
| 33 | + public List<Singledata> singledatanew(Map<String, Object> map); | ||
| 33 | 34 | ||
| 34 | public List<Vehicleloading> vehicleloading(String line,String data); | 35 | public List<Vehicleloading> vehicleloading(String line,String data); |
| 35 | 36 |
src/main/java/com/bsth/service/forms/impl/FormsServiceImpl.java
| @@ -8,6 +8,8 @@ import java.text.NumberFormat; | @@ -8,6 +8,8 @@ import java.text.NumberFormat; | ||
| 8 | import java.text.ParseException; | 8 | import java.text.ParseException; |
| 9 | import java.text.SimpleDateFormat; | 9 | import java.text.SimpleDateFormat; |
| 10 | import java.util.ArrayList; | 10 | import java.util.ArrayList; |
| 11 | +import java.util.Collections; | ||
| 12 | +import java.util.Comparator; | ||
| 11 | import java.util.Date; | 13 | import java.util.Date; |
| 12 | import java.util.HashMap; | 14 | import java.util.HashMap; |
| 13 | import java.util.HashSet; | 15 | import java.util.HashSet; |
| @@ -598,7 +600,7 @@ public class FormsServiceImpl implements FormsService { | @@ -598,7 +600,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 598 | 600 | ||
| 599 | // 路单数据 | 601 | // 路单数据 |
| 600 | @Override | 602 | @Override |
| 601 | - public List<Singledata> singledata(Map<String, Object> map) { | 603 | + public List<Singledata> singledatanew(Map<String, Object> map) { |
| 602 | 604 | ||
| 603 | String gsdm=""; | 605 | String gsdm=""; |
| 604 | if(map.get("gsdmSing")!=null){ | 606 | if(map.get("gsdmSing")!=null){ |
| @@ -651,7 +653,7 @@ public class FormsServiceImpl implements FormsService { | @@ -651,7 +653,7 @@ public class FormsServiceImpl implements FormsService { | ||
| 651 | sql += " and r.xl_bm = '"+xlbm+"'"; | 653 | sql += " and r.xl_bm = '"+xlbm+"'"; |
| 652 | } | 654 | } |
| 653 | sql += " group by r.s_gh,r.s_name," | 655 | sql += " group by r.s_gh,r.s_name," |
| 654 | - + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm order by r.xl_bm"; | 656 | + + " r.xl_bm,r.cl_zbh,r.j_gh,r.j_name,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; |
| 655 | 657 | ||
| 656 | List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | 658 | List<Singledata> list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { |
| 657 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | 659 | //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| @@ -735,6 +737,199 @@ public class FormsServiceImpl implements FormsService { | @@ -735,6 +737,199 @@ public class FormsServiceImpl implements FormsService { | ||
| 735 | return list; | 737 | return list; |
| 736 | } | 738 | } |
| 737 | 739 | ||
| 740 | + | ||
| 741 | + // 路单数据 | ||
| 742 | + @Override | ||
| 743 | + public List<Singledata> singledata(Map<String, Object> map) { | ||
| 744 | + | ||
| 745 | + String gsdm=""; | ||
| 746 | + if(map.get("gsdmSing")!=null){ | ||
| 747 | + gsdm=map.get("gsdmSing").toString(); | ||
| 748 | + } | ||
| 749 | + String fgsdm=""; | ||
| 750 | + if(map.get("fgsdmSing")!=null){ | ||
| 751 | + fgsdm=map.get("fgsdmSing").toString(); | ||
| 752 | + } | ||
| 753 | + | ||
| 754 | + String tjtype=map.get("tjtype").toString(); | ||
| 755 | + String xlbm=map.get("line").toString().trim(); | ||
| 756 | + startDate = map.get("startDate").toString(); | ||
| 757 | + | ||
| 758 | + List<ScheduleRealInfo> listReal=new ArrayList<ScheduleRealInfo>(); | ||
| 759 | + if(xlbm.equals("")){ | ||
| 760 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineByGs_(gsdm, fgsdm, startDate); | ||
| 761 | + }else{ | ||
| 762 | + listReal=scheduleRealInfoRepository.scheduleByDateAndLineQp(xlbm, startDate); | ||
| 763 | + } | ||
| 764 | + List<Singledata> list=new ArrayList<Singledata>(); | ||
| 765 | + List<Singledata> listY=new ArrayList<Singledata>(); | ||
| 766 | + List<Singledata> listD=new ArrayList<Singledata>(); | ||
| 767 | + | ||
| 768 | + if(tjtype.equals("jsy")){ | ||
| 769 | + DecimalFormat df = new DecimalFormat("0.00"); | ||
| 770 | + List<Ylb> listYlb= ylbRepository.obtainYl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | ||
| 771 | + for (int i = 0; i < listYlb.size(); i++) { | ||
| 772 | + Ylb y=listYlb.get(i); | ||
| 773 | + String jsy=y.getJsy(); | ||
| 774 | + String line=y.getXlbm(); | ||
| 775 | + String clzbh=y.getNbbm(); | ||
| 776 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 777 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 778 | + ScheduleRealInfo s=listReal.get(j); | ||
| 779 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 780 | + &&s.getXlBm().equals(line)){ | ||
| 781 | + newList.add(s); | ||
| 782 | + } | ||
| 783 | + } | ||
| 784 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 785 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 786 | + double yygl=culateMileageService.culateSjgl(newList); | ||
| 787 | + double ljgl=culateMileageService.culateLjgl(newList); | ||
| 788 | + double ksgl=culateMileageService.culateKsgl(newList); | ||
| 789 | + double jcgl=culateMileageService.culateJccgl(newList); | ||
| 790 | + | ||
| 791 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 792 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 793 | + | ||
| 794 | + Singledata sin=new Singledata(); | ||
| 795 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 796 | + | ||
| 797 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 798 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 799 | + sin.setxL(BasicData.lineCode2NameMap.get(y.getXlbm())); | ||
| 800 | + sin.setClzbh(clzbh); | ||
| 801 | + sin.setJsy(jsy); | ||
| 802 | + sin.setrQ(startDate); | ||
| 803 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | ||
| 804 | + sin.setSgh(""); | ||
| 805 | + sin.setsName(""); | ||
| 806 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 807 | + sin.setHyl(df.format(y.getYh())); | ||
| 808 | + sin.setJzl(df.format(y.getJzl())); | ||
| 809 | + sin.setUnyyyl(df.format(y.getSh())); | ||
| 810 | + listY.add(sin); | ||
| 811 | + } | ||
| 812 | + | ||
| 813 | + List<Dlb> listDlb= dlbRepository.obtainDl(startDate, gsdm, fgsdm, xlbm, "", "xlbm"); | ||
| 814 | + for (int i = 0; i < listDlb.size(); i++) { | ||
| 815 | + | ||
| 816 | + Dlb y=listDlb.get(i); | ||
| 817 | + String jsy=y.getJsy(); | ||
| 818 | + String line=y.getXlbm(); | ||
| 819 | + String clzbh=y.getNbbm(); | ||
| 820 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 821 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 822 | + ScheduleRealInfo s=listReal.get(j); | ||
| 823 | + if(s.getjGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 824 | + &&s.getXlBm().equals(line)){ | ||
| 825 | + newList.add(s); | ||
| 826 | + } | ||
| 827 | + } | ||
| 828 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 829 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 830 | + double yygl=culateMileageService.culateSjgl(newList); | ||
| 831 | + double ljgl=culateMileageService.culateLjgl(newList); | ||
| 832 | + double ksgl=culateMileageService.culateKsgl(newList); | ||
| 833 | + double jcgl=culateMileageService.culateJccgl(newList); | ||
| 834 | + | ||
| 835 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 836 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 837 | + | ||
| 838 | + Singledata sin=new Singledata(); | ||
| 839 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 840 | + | ||
| 841 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 842 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 843 | + sin.setxL(BasicData.lineCode2NameMap.get(y.getXlbm())); | ||
| 844 | + sin.setClzbh(clzbh); | ||
| 845 | + sin.setJsy(jsy); | ||
| 846 | + sin.setrQ(startDate); | ||
| 847 | + sin.setjName(BasicData.allPerson.get(gsdm+"-"+jsy)); | ||
| 848 | + sin.setSgh(""); | ||
| 849 | + sin.setsName(""); | ||
| 850 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 851 | + sin.setHyl(df.format(y.getHd())); | ||
| 852 | + sin.setJzl(df.format(y.getCdl())); | ||
| 853 | + sin.setUnyyyl(df.format(y.getSh())); | ||
| 854 | + listD.add(sin); | ||
| 855 | + } | ||
| 856 | + | ||
| 857 | + Collections.sort(listY,new SingledataByXlbm()); | ||
| 858 | + Collections.sort(listD,new SingledataByXlbm()); | ||
| 859 | + list.addAll(listY); | ||
| 860 | + list.addAll(listD); | ||
| 861 | + }else{ | ||
| 862 | + String sql="select r.s_gh,r.s_name, " | ||
| 863 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm" | ||
| 864 | + + " from bsth_c_s_sp_info_real r where " | ||
| 865 | + + " r.schedule_date_str = '"+startDate+"'" | ||
| 866 | + + " and r.s_gh !='' and r.s_gh is not null "; | ||
| 867 | + if(xlbm.equals("")){ | ||
| 868 | + sql +="and r.gs_bm='"+gsdm+"' " | ||
| 869 | + + " and r.fgs_bm='"+fgsdm+"'"; | ||
| 870 | + }else{ | ||
| 871 | + sql += " and r.xl_bm = '"+xlbm+"'"; | ||
| 872 | + } | ||
| 873 | + sql += " group by r.s_gh,r.s_name," | ||
| 874 | + + " r.xl_bm,r.cl_zbh,r.gs_bm,r.fgs_bm order by r.xl_bm,r.cl_zbh"; | ||
| 875 | + | ||
| 876 | + list = jdbcTemplate.query(sql, new RowMapper<Singledata>() { | ||
| 877 | + //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); | ||
| 878 | + @Override | ||
| 879 | + public Singledata mapRow(ResultSet arg0, int arg1) throws SQLException { | ||
| 880 | + Singledata sin = new Singledata(); | ||
| 881 | + sin.setrQ(startDate); | ||
| 882 | + sin.setxL(arg0.getString("xl_bm")); | ||
| 883 | + sin.setClzbh(arg0.getString("cl_zbh")); | ||
| 884 | + sin.setSgh(arg0.getString("s_gh")); | ||
| 885 | + sin.setsName(arg0.getString("s_name")); | ||
| 886 | + return sin; | ||
| 887 | + } | ||
| 888 | + }); | ||
| 889 | + | ||
| 890 | + for (int i = 0; i < list.size(); i++) { | ||
| 891 | + Singledata sin=list.get(i); | ||
| 892 | + String jsy=sin.getSgh(); | ||
| 893 | + String line=sin.getxL(); | ||
| 894 | + String clzbh=sin.getClzbh(); | ||
| 895 | + List<ScheduleRealInfo> newList=new ArrayList<ScheduleRealInfo>(); | ||
| 896 | + for (int j = 0; j < listReal.size(); j++) { | ||
| 897 | + ScheduleRealInfo s=listReal.get(j); | ||
| 898 | + if(s.getsGh().equals(jsy) && s.getClZbh().equals(clzbh) | ||
| 899 | + &&s.getXlBm().equals(line)){ | ||
| 900 | + newList.add(s); | ||
| 901 | + } | ||
| 902 | + } | ||
| 903 | + double jhgl=culateMileageService.culateJhgl(newList); | ||
| 904 | + double jhjcc=culateMileageService.culateJhJccgl(newList); | ||
| 905 | + double yygl=culateMileageService.culateSjgl(newList); | ||
| 906 | + double ljgl=culateMileageService.culateLjgl(newList); | ||
| 907 | + double ksgl=culateMileageService.culateKsgl(newList); | ||
| 908 | + double jcgl=culateMileageService.culateJccgl(newList); | ||
| 909 | + | ||
| 910 | + double zyygl=Arith.add(yygl, ljgl); | ||
| 911 | + double zksgl=Arith.add(ksgl, jcgl); | ||
| 912 | + | ||
| 913 | + sin.setJhlc(String.valueOf(Arith.add(zyygl,zksgl))); | ||
| 914 | + | ||
| 915 | + sin.setEmptMileage(String.valueOf(zksgl)); | ||
| 916 | + sin.setJhjl(String.valueOf(Arith.add(jhgl,jhjcc))); | ||
| 917 | + sin.setxL(BasicData.lineCode2NameMap.get(line)); | ||
| 918 | + sin.setClzbh(clzbh); | ||
| 919 | + sin.setJsy(""); | ||
| 920 | + sin.setjName(""); | ||
| 921 | + sin.setgS(BasicData.businessFgsCodeNameMap.get(fgsdm+"_"+gsdm)); | ||
| 922 | + sin.setHyl(""); | ||
| 923 | + sin.setJzl(""); | ||
| 924 | + sin.setUnyyyl(""); | ||
| 925 | + } | ||
| 926 | + Collections.sort(list,new SingledataByXlbm()); | ||
| 927 | + } | ||
| 928 | + | ||
| 929 | + return list; | ||
| 930 | + | ||
| 931 | + } | ||
| 932 | + | ||
| 738 | // 运营服务阶段报表 | 933 | // 运营服务阶段报表 |
| 739 | @Override | 934 | @Override |
| 740 | public List<Operationservice> operationservice(Map<String, Object> map) { | 935 | public List<Operationservice> operationservice(Map<String, Object> map) { |
| @@ -1398,4 +1593,12 @@ public class FormsServiceImpl implements FormsService { | @@ -1398,4 +1593,12 @@ public class FormsServiceImpl implements FormsService { | ||
| 1398 | } | 1593 | } |
| 1399 | return list; | 1594 | return list; |
| 1400 | } | 1595 | } |
| 1596 | + | ||
| 1597 | + class SingledataByXlbm implements Comparator<Singledata>{ | ||
| 1598 | + @Override | ||
| 1599 | + public int compare(Singledata o1, Singledata o2) { | ||
| 1600 | + // TODO Auto-generated method stub | ||
| 1601 | + return o2.getxL().compareTo(o1.getxL()); | ||
| 1602 | + } | ||
| 1603 | + } | ||
| 1401 | } | 1604 | } |
src/main/java/com/bsth/service/gps/GpsServiceImpl.java
| @@ -16,8 +16,6 @@ import com.bsth.repository.StationRepository; | @@ -16,8 +16,6 @@ import com.bsth.repository.StationRepository; | ||
| 16 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; | 16 | import com.bsth.repository.realcontrol.ScheduleRealInfoRepository; |
| 17 | import com.bsth.service.gps.entity.*; | 17 | import com.bsth.service.gps.entity.*; |
| 18 | import com.bsth.util.DateUtils; | 18 | import com.bsth.util.DateUtils; |
| 19 | -import com.bsth.util.PageHelper; | ||
| 20 | -import com.bsth.util.PageObject; | ||
| 21 | import com.bsth.util.TransGPS; | 19 | import com.bsth.util.TransGPS; |
| 22 | import com.bsth.util.TransGPS.Location; | 20 | import com.bsth.util.TransGPS.Location; |
| 23 | import com.bsth.util.db.DBUtils_MS; | 21 | import com.bsth.util.db.DBUtils_MS; |
| @@ -985,11 +983,18 @@ public class GpsServiceImpl implements GpsService { | @@ -985,11 +983,18 @@ public class GpsServiceImpl implements GpsService { | ||
| 985 | 983 | ||
| 986 | public boolean fieldEquals(List<Field> fs, Object obj, Map<String, Object> map) { | 984 | public boolean fieldEquals(List<Field> fs, Object obj, Map<String, Object> map) { |
| 987 | try { | 985 | try { |
| 986 | + String fv, v; | ||
| 988 | for (Field f : fs) { | 987 | for (Field f : fs) { |
| 989 | if (StringUtils.isEmpty(map.get(f.getName()).toString())) | 988 | if (StringUtils.isEmpty(map.get(f.getName()).toString())) |
| 990 | continue; | 989 | continue; |
| 991 | 990 | ||
| 992 | - if (f.get(obj) == null || f.get(obj).toString().indexOf(map.get(f.getName()).toString()) == -1) | 991 | + if(f.get(obj) == null) |
| 992 | + return false; | ||
| 993 | + | ||
| 994 | + fv = f.get(obj).toString(); | ||
| 995 | + v = map.get(f.getName()).toString(); | ||
| 996 | + | ||
| 997 | + if(!fv.startsWith(v) && !fv.endsWith(v)) | ||
| 993 | return false; | 998 | return false; |
| 994 | } | 999 | } |
| 995 | } catch (Exception e) { | 1000 | } catch (Exception e) { |
src/main/java/com/bsth/service/oil/DlbService.java
| @@ -20,4 +20,12 @@ public interface DlbService extends BaseService<Dlb, Integer>{ | @@ -20,4 +20,12 @@ public interface DlbService extends BaseService<Dlb, Integer>{ | ||
| 20 | Map<String, Object> saveDlbList(Map<String, Object> map) throws Exception; | 20 | Map<String, Object> saveDlbList(Map<String, Object> map) throws Exception; |
| 21 | 21 | ||
| 22 | String obtainDsq() throws Exception; | 22 | String obtainDsq() throws Exception; |
| 23 | + | ||
| 24 | + String checkJsy(Map<String, Object> map); | ||
| 25 | + | ||
| 26 | + Map<String, Object> saveDlb(Dlb t); | ||
| 27 | + | ||
| 28 | + Map<String, Object> deleteIds(Map<String, Object> map) throws Exception; | ||
| 29 | + | ||
| 30 | + | ||
| 23 | } | 31 | } |
src/main/java/com/bsth/service/oil/YlbService.java
| @@ -19,7 +19,7 @@ public interface YlbService extends BaseService<Ylb, Integer>{ | @@ -19,7 +19,7 @@ public interface YlbService extends BaseService<Ylb, Integer>{ | ||
| 19 | 19 | ||
| 20 | Map<String, Object> sumYlb(Map<String, Object> map); | 20 | Map<String, Object> sumYlb(Map<String, Object> map); |
| 21 | String checkJsy(Map<String, Object> map); | 21 | String checkJsy(Map<String, Object> map); |
| 22 | - List<Ylb> oilListMonth(String line,String date,String type); | 22 | + List<Ylb> oilListMonth(Map<String, Object> map); |
| 23 | List<Ylb> listYlb(Map<String, Object> map); | 23 | List<Ylb> listYlb(Map<String, Object> map); |
| 24 | StringBuffer checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int lx); | 24 | StringBuffer checkNbmmNum(String rq, String gsbm,String fgsbm,String xlbm,String nbbm,int lx); |
| 25 | 25 |
src/main/java/com/bsth/service/oil/YlxxbService.java
| 1 | package com.bsth.service.oil; | 1 | package com.bsth.service.oil; |
| 2 | 2 | ||
| 3 | +import java.util.List; | ||
| 3 | import java.util.Map; | 4 | import java.util.Map; |
| 4 | 5 | ||
| 5 | import com.bsth.entity.oil.Ylxxb; | 6 | import com.bsth.entity.oil.Ylxxb; |
| @@ -9,6 +10,9 @@ import com.bsth.util.PageObject; | @@ -9,6 +10,9 @@ import com.bsth.util.PageObject; | ||
| 9 | public interface YlxxbService extends BaseService<Ylxxb, Integer>{ | 10 | public interface YlxxbService extends BaseService<Ylxxb, Integer>{ |
| 10 | PageObject<Ylxxb> Pagequery(Map<String, Object> map) ; | 11 | PageObject<Ylxxb> Pagequery(Map<String, Object> map) ; |
| 11 | 12 | ||
| 13 | + List<Ylxxb> Pagequery_nbbm(Map<String, Object> map) ; | ||
| 14 | + | ||
| 12 | Map<String, Object> checkJsy(Map<String, Object> map) throws Exception; | 15 | Map<String, Object> checkJsy(Map<String, Object> map) throws Exception; |
| 16 | + Map<String, Object> checkNbbm(Map<String, Object> map) throws Exception; | ||
| 13 | 17 | ||
| 14 | } | 18 | } |
src/main/java/com/bsth/service/oil/impl/CwjyServiceImpl.java
src/main/java/com/bsth/service/oil/impl/DlbServiceImpl.java
| @@ -1032,6 +1032,87 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | @@ -1032,6 +1032,87 @@ public class DlbServiceImpl extends BaseServiceImpl<Dlb,Integer> implements DlbS | ||
| 1032 | 1032 | ||
| 1033 | return lists; | 1033 | return lists; |
| 1034 | } | 1034 | } |
| 1035 | + | ||
| 1036 | + | ||
| 1037 | + @Override | ||
| 1038 | + public String checkJsy(Map<String, Object> map) { | ||
| 1039 | + // TODO Auto-generated method stub | ||
| 1040 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1041 | + String rq=map.get("date").toString(); | ||
| 1042 | + String nbbm=map.get("nbbm").toString(); | ||
| 1043 | + String jsy =map.get("jsy").toString(); | ||
| 1044 | + String xlbm=map.get("xlbm").toString(); | ||
| 1045 | + List<Dlb> list= repository.queryListDlb(rq, nbbm, jsy, xlbm); | ||
| 1046 | + String type="1"; | ||
| 1047 | + if(list.size()>0){ | ||
| 1048 | + type="0"; | ||
| 1049 | + } | ||
| 1050 | + return type; | ||
| 1051 | + } | ||
| 1052 | + | ||
| 1053 | + @Override | ||
| 1054 | + public Map<String, Object> saveDlb(Dlb t) { | ||
| 1055 | + // TODO Auto-generated method stub | ||
| 1056 | + Map<String, Object> map = new HashMap<>(); | ||
| 1057 | + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); | ||
| 1058 | + String rq=sdf.format(t.getRq()); | ||
| 1059 | + String gsdm=t.getSsgsdm(); | ||
| 1060 | + String fgsdm=t.getFgsdm(); | ||
| 1061 | + String xlbm=t.getXlbm(); | ||
| 1062 | + String jhsj=t.getJhsj(); | ||
| 1063 | + String jsy=t.getJsy(); | ||
| 1064 | + String nbbm=t.getNbbm(); | ||
| 1065 | + int sfkt=t.getSfkt(); | ||
| 1066 | + t.setCreatetime(new Date()); | ||
| 1067 | + String[] jhsjStr = jhsj.split(":"); | ||
| 1068 | + long fcsjL= Long.parseLong(jhsjStr[0])*60+Long.parseLong(jhsjStr[1]); | ||
| 1069 | + List<Dlb> list=this.listOrderBy(rq, gsdm, fgsdm, xlbm, nbbm, "jhsj"); | ||
| 1070 | +// repository.obtainYl(rq, gsdm, fgsdm, xlbm, nbbm, "jhsj"); | ||
| 1071 | + int jcsx=1; | ||
| 1072 | + if(list.size()>0){ | ||
| 1073 | + for (int i = 0; i < list.size(); i++) { | ||
| 1074 | + Dlb y=list.get(i); | ||
| 1075 | + String[] fcsjStr = y.getJhsj().split(":"); | ||
| 1076 | + long fcsj=Long.parseLong(fcsjStr[0])*60+Long.parseLong(fcsjStr[1]); | ||
| 1077 | + if(fcsjL>fcsj){ | ||
| 1078 | + jcsx=jcsx+y.getJcsx(); | ||
| 1079 | + }else{ | ||
| 1080 | + y.setJcsx(y.getJcsx()+1); | ||
| 1081 | + repository.save(y); | ||
| 1082 | + } | ||
| 1083 | + } | ||
| 1084 | + | ||
| 1085 | + } | ||
| 1086 | + t.setJcsx(jcsx); | ||
| 1087 | + repository.save(t); | ||
| 1088 | + map.put("status", ResponseCode.SUCCESS); | ||
| 1089 | + map.put("t", t); | ||
| 1090 | + return map; | ||
| 1091 | + } | ||
| 1092 | + | ||
| 1093 | + @Transactional | ||
| 1094 | + @Override | ||
| 1095 | + public Map<String, Object> deleteIds(Map<String, Object> map) throws Exception{ | ||
| 1096 | + // TODO Auto-generated method stub | ||
| 1097 | + Map<String, Object> maps = new HashMap<>(); | ||
| 1098 | + try{ | ||
| 1099 | + String json =StringEscapeUtils.unescapeHtml4(map.get("ids").toString()); | ||
| 1100 | + JSONArray jsonArray=JSONArray.parseArray(json); | ||
| 1101 | + JSONObject jsonObject; | ||
| 1102 | + for (int x = 0; x < jsonArray.size(); x++) { | ||
| 1103 | + jsonObject=jsonArray.getJSONObject(x); | ||
| 1104 | + Integer id =jsonObject.getInteger("id"); | ||
| 1105 | + repository.delete(id); | ||
| 1106 | + } | ||
| 1107 | + maps.put("status", ResponseCode.SUCCESS); | ||
| 1108 | + } catch (Exception e) { | ||
| 1109 | + maps.put("status", ResponseCode.ERROR); | ||
| 1110 | + logger.error("save erro.", e); | ||
| 1111 | + throw e; | ||
| 1112 | + } | ||
| 1113 | + return maps; | ||
| 1114 | + } | ||
| 1115 | + | ||
| 1035 | } | 1116 | } |
| 1036 | 1117 | ||
| 1037 | class NbbmJcsxMap implements Comparator<Map<String, Object>>{ | 1118 | class NbbmJcsxMap implements Comparator<Map<String, Object>>{ |
src/main/java/com/bsth/service/oil/impl/YlbServiceImpl.java
| @@ -977,17 +977,24 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | @@ -977,17 +977,24 @@ public class YlbServiceImpl extends BaseServiceImpl<Ylb,Integer> implements YlbS | ||
| 977 | 977 | ||
| 978 | 978 | ||
| 979 | @Override | 979 | @Override |
| 980 | - public List<Ylb> oilListMonth(String line, String date, String type) { | 980 | + public List<Ylb> oilListMonth(Map<String, Object> map) { |
| 981 | + String type=map.get("type").toString(); | ||
| 982 | + String date=map.get("date").toString().trim(); | ||
| 983 | + String gsdm=map.get("gsdm").toString(); | ||
| 984 | + String fgsdm=map.get("fgsdm").toString(); | ||
| 981 | String date2=date.substring(0, 8)+"01"; | 985 | String date2=date.substring(0, 8)+"01"; |
| 982 | String lineStr=""; | 986 | String lineStr=""; |
| 987 | + String line =map.get("line").toString().trim(); | ||
| 983 | if(line !=null && !line.equals("")){ | 988 | if(line !=null && !line.equals("")){ |
| 984 | lineStr =" and xlbm= '"+ line +"'"; | 989 | lineStr =" and xlbm= '"+ line +"'"; |
| 990 | + }else{ | ||
| 991 | + lineStr =" and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"' "; | ||
| 985 | } | 992 | } |
| 986 | String sql="select a.nbbm,a.rq,a.jzyl from (" + | 993 | String sql="select a.nbbm,a.rq,a.jzyl from (" + |
| 987 | " select x.nbbm,max(x.rq) as rq,max(x.jcsx) as jcsx from " | 994 | " select x.nbbm,max(x.rq) as rq,max(x.jcsx) as jcsx from " |
| 988 | + "(select nbbm,rq,max(jcsx) as jcsx from bsth_c_ylb where rq between '" | 995 | + "(select nbbm,rq,max(jcsx) as jcsx from bsth_c_ylb where rq between '" |
| 989 | + date2 +"' and '" + date+"' "+lineStr | 996 | + date2 +"' and '" + date+"' "+lineStr |
| 990 | - + "group by nbbm,rq) x group by x.nbbm ) b" | 997 | + + " group by nbbm,rq) x group by x.nbbm ) b" |
| 991 | + " left join (select nbbm,rq,jzyl,jcsx FROM bsth_c_ylb " | 998 | + " left join (select nbbm,rq,jzyl,jcsx FROM bsth_c_ylb " |
| 992 | + " where rq between '" | 999 | + " where rq between '" |
| 993 | + date2 +"' and '" + date+"' "+lineStr | 1000 | + date2 +"' and '" + date+"' "+lineStr |
src/main/java/com/bsth/service/oil/impl/YlxxbServiceImpl.java
| @@ -5,6 +5,7 @@ import java.sql.SQLException; | @@ -5,6 +5,7 @@ import java.sql.SQLException; | ||
| 5 | import java.text.ParseException; | 5 | import java.text.ParseException; |
| 6 | import java.text.SimpleDateFormat; | 6 | import java.text.SimpleDateFormat; |
| 7 | import java.util.ArrayList; | 7 | import java.util.ArrayList; |
| 8 | +import java.util.Date; | ||
| 8 | import java.util.HashMap; | 9 | import java.util.HashMap; |
| 9 | import java.util.List; | 10 | import java.util.List; |
| 10 | import java.util.Map; | 11 | import java.util.Map; |
| @@ -25,9 +26,11 @@ import com.bsth.common.ResponseCode; | @@ -25,9 +26,11 @@ import com.bsth.common.ResponseCode; | ||
| 25 | import com.bsth.entity.excep.Offline; | 26 | import com.bsth.entity.excep.Offline; |
| 26 | import com.bsth.entity.oil.Ylb; | 27 | import com.bsth.entity.oil.Ylb; |
| 27 | import com.bsth.entity.oil.Ylxxb; | 28 | import com.bsth.entity.oil.Ylxxb; |
| 29 | +import com.bsth.entity.oil.YlxxbUpdate; | ||
| 28 | import com.bsth.entity.search.CustomerSpecs; | 30 | import com.bsth.entity.search.CustomerSpecs; |
| 29 | import com.bsth.repository.oil.YlbRepository; | 31 | import com.bsth.repository.oil.YlbRepository; |
| 30 | import com.bsth.repository.oil.YlxxbRepository; | 32 | import com.bsth.repository.oil.YlxxbRepository; |
| 33 | +import com.bsth.repository.oil.YlxxbUpdateRepository; | ||
| 31 | import com.bsth.service.impl.BaseServiceImpl; | 34 | import com.bsth.service.impl.BaseServiceImpl; |
| 32 | import com.bsth.service.oil.YlxxbService; | 35 | import com.bsth.service.oil.YlxxbService; |
| 33 | import com.bsth.util.PageHelper; | 36 | import com.bsth.util.PageHelper; |
| @@ -40,6 +43,8 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | @@ -40,6 +43,8 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | ||
| 40 | @Autowired | 43 | @Autowired |
| 41 | YlxxbRepository repository; | 44 | YlxxbRepository repository; |
| 42 | @Autowired | 45 | @Autowired |
| 46 | + YlxxbUpdateRepository updateRepository; | ||
| 47 | + @Autowired | ||
| 43 | YlbRepository ylbRepository; | 48 | YlbRepository ylbRepository; |
| 44 | @Autowired | 49 | @Autowired |
| 45 | JdbcTemplate jdbcTemplate; | 50 | JdbcTemplate jdbcTemplate; |
| @@ -53,7 +58,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | @@ -53,7 +58,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | ||
| 53 | String sql=" select * from (" | 58 | String sql=" select * from (" |
| 54 | + "select *,CONCAT(nbbm,jsy) as nj " | 59 | + "select *,CONCAT(nbbm,jsy) as nj " |
| 55 | + " from bsth_c_ylxxb where yyrq='"+rq+"' " | 60 | + " from bsth_c_ylxxb where yyrq='"+rq+"' " |
| 56 | - + " and gsdm ='"+gsdm+"' and jylx ='0') x where x.nj not in (" | 61 | + + " and gsdm ='"+gsdm+"' and jylx !='1') x where x.nj not in (" |
| 57 | + " select CONCAT(nbbm,jsy) from bsth_c_ylb " | 62 | + " select CONCAT(nbbm,jsy) from bsth_c_ylb " |
| 58 | + " where rq='"+rq+"'" | 63 | + " where rq='"+rq+"'" |
| 59 | + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"')" | 64 | + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"')" |
| @@ -61,7 +66,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | @@ -61,7 +66,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | ||
| 61 | + " where rq='"+rq+"'" | 66 | + " where rq='"+rq+"'" |
| 62 | + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"') " | 67 | + " and ssgsdm='"+gsdm+"' and fgsdm ='"+fgsdm+"') " |
| 63 | + " and x.nbbm not in (select nbbm from bsth_c_ylxxb" | 68 | + " and x.nbbm not in (select nbbm from bsth_c_ylxxb" |
| 64 | - + " where yyrq='"+rq+"' and gsdm ='"+gsdm+"' AND jylx ='1')"; | 69 | + + " where yyrq='"+rq+"' and gsdm ='"+gsdm+"' AND jylx !='0')"; |
| 65 | 70 | ||
| 66 | 71 | ||
| 67 | /*String sql= "select v.*,u.jsy as ldgh from " | 72 | /*String sql= "select v.*,u.jsy as ldgh from " |
| @@ -179,7 +184,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | @@ -179,7 +184,7 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | ||
| 179 | Ylxxb ylxxb=repository.findOne(id); | 184 | Ylxxb ylxxb=repository.findOne(id); |
| 180 | if(!ylxxb.getJsy().equals(jsy)){ | 185 | if(!ylxxb.getJsy().equals(jsy)){ |
| 181 | ylxxb.setJsy(jsy); | 186 | ylxxb.setJsy(jsy); |
| 182 | - ylxxb.setJylx(1); | 187 | + ylxxb.setJylx(3); |
| 183 | repository.save(ylxxb); | 188 | repository.save(ylxxb); |
| 184 | } | 189 | } |
| 185 | } | 190 | } |
| @@ -191,5 +196,87 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | @@ -191,5 +196,87 @@ public class YlxxbServiceImpl extends BaseServiceImpl<Ylxxb,Integer> implements | ||
| 191 | } | 196 | } |
| 192 | return newMap; | 197 | return newMap; |
| 193 | } | 198 | } |
| 199 | + @Override | ||
| 200 | + public List<Ylxxb> Pagequery_nbbm(Map<String, Object> map) { | ||
| 201 | + // TODO Auto-generated method stub | ||
| 202 | + String rq=map.get("yyrq").toString(); | ||
| 203 | + String gsdm=map.get("gsdm_like").toString(); | ||
| 204 | + String nbbm=map.get("nbbm").toString(); | ||
| 205 | + | ||
| 206 | + String sql="select * from (select *,CONCAT(t.nbbm,'_',t.jsy,'_',t.jzl) as tj " | ||
| 207 | + + " from bsth_c_ylxxb t where t.yyrq='"+rq+"' and t.gsdm='"+gsdm+"' and " | ||
| 208 | + + " t.nylx=0 and t.jylx=0 and t.nbbm like '%"+nbbm+"%') y " | ||
| 209 | + + " where y.nbbm not in (select c.inside_code from bsth_c_cars c " | ||
| 210 | + + " where c.business_code ='05' and c.sfdc=0) and y.tj not in (" | ||
| 211 | + + " select x.tj from bsth_c_ylxxb_update x)"; | ||
| 212 | + | ||
| 213 | + //根具条件查询指定日期Ylb的数据 | ||
| 214 | +// List<Ylb> ylbIterator=ylbRepository.checkYl(rq,gsdm,fgsdm); | ||
| 215 | + List<Ylxxb> list=jdbcTemplate.query(sql, | ||
| 216 | + new RowMapper<Ylxxb>(){ | ||
| 217 | + @Override | ||
| 218 | + public Ylxxb mapRow(ResultSet rs, int rowNum) throws SQLException { | ||
| 219 | + Ylxxb s = new Ylxxb(); | ||
| 220 | + s.setId(rs.getInt("id")); | ||
| 221 | + s.setYyrq(rs.getDate("yyrq")); | ||
| 222 | + s.setNbbm(rs.getString("nbbm")); | ||
| 223 | + s.setGsdm(rs.getString("gsdm")); | ||
| 224 | + s.setJsy(rs.getString("jsy")); | ||
| 225 | + s.setJzl(rs.getDouble("jzl")); | ||
| 226 | + s.setStationid(rs.getString("stationid")); | ||
| 227 | + s.setNylx(rs.getInt("nylx")); | ||
| 228 | + s.setJyggh(rs.getString("jyggh")); | ||
| 229 | + s.setYj(rs.getDouble("yj")); | ||
| 230 | +// s.setLdgh(rs.getString("ldgh")); | ||
| 231 | + s.setBz(rs.getString("bz")); | ||
| 232 | + return s; | ||
| 233 | + } | ||
| 234 | + }); | ||
| 235 | + return list; | ||
| 236 | + } | ||
| 194 | 237 | ||
| 195 | -} | ||
| 196 | \ No newline at end of file | 238 | \ No newline at end of file |
| 239 | + | ||
| 240 | + @Transactional | ||
| 241 | + @Override | ||
| 242 | + public Map<String, Object> checkNbbm(Map<String, Object> map) throws Exception{ | ||
| 243 | + Map<String, Object> newMap=new HashMap<String,Object>(); | ||
| 244 | + // TODO Auto-generated method stub | ||
| 245 | + try { | ||
| 246 | +// int id=Integer.parseInt(map.get("id").toString()); | ||
| 247 | +// String jsy=map.get("jsy").toString(); | ||
| 248 | +// Ylxxb ylxxb=repository.findOne(id); | ||
| 249 | +// ylxxb.setJsy(jsy); | ||
| 250 | +// repository.save(ylxxb); | ||
| 251 | + String json =StringEscapeUtils.unescapeHtml4(map.get("ylbList").toString()); | ||
| 252 | + JSONArray jsonArray=JSONArray.parseArray(json); | ||
| 253 | + JSONObject jsonObject; | ||
| 254 | + for (int x = 0; x < jsonArray.size(); x++) { | ||
| 255 | + jsonObject=jsonArray.getJSONObject(x); | ||
| 256 | + Integer id =jsonObject.getInteger("id"); | ||
| 257 | + String nbbm =jsonObject.getString("nbbm").trim(); | ||
| 258 | + Ylxxb ylxxb=repository.findOne(id); | ||
| 259 | + if(!ylxxb.getNbbm().equals(nbbm)){ | ||
| 260 | + ylxxb.setNbbm(nbbm); | ||
| 261 | + ylxxb.setJylx(2); | ||
| 262 | + repository.save(ylxxb); | ||
| 263 | + YlxxbUpdate ylxxbUpdate=new YlxxbUpdate(); | ||
| 264 | + ylxxbUpdate.setGsdm(ylxxb.getGsdm()); | ||
| 265 | + ylxxbUpdate.setJsy(ylxxb.getJsy()); | ||
| 266 | + ylxxbUpdate.setJzl(ylxxb.getJzl()); | ||
| 267 | + ylxxbUpdate.setJlrq(ylxxb.getJlrq()); | ||
| 268 | + ylxxbUpdate.setNbbm(ylxxb.getNbbm()); | ||
| 269 | + ylxxbUpdate.setYyrq(ylxxb.getYyrq()); | ||
| 270 | + ylxxbUpdate.setCreatetime(new Date()); | ||
| 271 | + ylxxbUpdate.setTj(nbbm+"_"+ylxxb.getJsy()+"_"+ylxxb.getJzl()); | ||
| 272 | + updateRepository.save(ylxxbUpdate); | ||
| 273 | + } | ||
| 274 | + } | ||
| 275 | + newMap.put("status", ResponseCode.SUCCESS); | ||
| 276 | + }catch(Exception e){ | ||
| 277 | + newMap.put("status", ResponseCode.ERROR); | ||
| 278 | + logger.error("save erro.", e); | ||
| 279 | + throw e; | ||
| 280 | + } | ||
| 281 | + return newMap; | ||
| 282 | + } | ||
| 283 | +} |
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
| @@ -2775,25 +2775,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2775,25 +2775,24 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2775 | } | 2775 | } |
| 2776 | for (int i = 0; i < newList.size(); i++) { | 2776 | for (int i = 0; i < newList.size(); i++) { |
| 2777 | ScheduleRealInfo t1 = newList.get(i); | 2777 | ScheduleRealInfo t1 = newList.get(i); |
| 2778 | - String reamrks1=t1.getRemarks()==null?"":t1.getRemarks(); | ||
| 2779 | - if(reamrks1.length()>5){ | ||
| 2780 | - t1.setRemarks(reamrks1.substring(0, 5)); | ||
| 2781 | - t1.setRemark(reamrks1); | ||
| 2782 | - } | ||
| 2783 | for (int j = 0; j < list.size(); j++) { | 2778 | for (int j = 0; j < list.size(); j++) { |
| 2784 | ScheduleRealInfo t2 = list.get(j); | 2779 | ScheduleRealInfo t2 = list.get(j); |
| 2785 | - String reamrks2=t2.getRemarks()==null?"":t2.getRemarks(); | ||
| 2786 | - if(reamrks2.length()>5){ | ||
| 2787 | - t2.setRemarks(reamrks2.substring(0, 5)); | ||
| 2788 | - t2.setRemark(reamrks2); | ||
| 2789 | - }else{ | ||
| 2790 | - t2.setRemark(reamrks2); | ||
| 2791 | - } | ||
| 2792 | if (t1.getId() == t2.getId()) { | 2780 | if (t1.getId() == t2.getId()) { |
| 2793 | t1 = t2; | 2781 | t1 = t2; |
| 2794 | } | 2782 | } |
| 2795 | } | 2783 | } |
| 2796 | } | 2784 | } |
| 2785 | + | ||
| 2786 | + for (int i = 0; i < newList.size(); i++) { | ||
| 2787 | + ScheduleRealInfo t1=newList.get(i); | ||
| 2788 | + String reamrks1=t1.getRemarks()==null?"":t1.getRemarks(); | ||
| 2789 | + if(reamrks1.length()>4){ | ||
| 2790 | + t1.setRemarks(reamrks1.substring(0,4)); | ||
| 2791 | + t1.setRemark(reamrks1); | ||
| 2792 | + }else{ | ||
| 2793 | + t1.setRemark(reamrks1); | ||
| 2794 | + } | ||
| 2795 | + } | ||
| 2797 | return newList; | 2796 | return newList; |
| 2798 | } | 2797 | } |
| 2799 | 2798 | ||
| @@ -2973,28 +2972,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | @@ -2973,28 +2972,28 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl<ScheduleRealInf | ||
| 2973 | yesterdayDataList.get(x).put("totalKilometers", zlc); | 2972 | yesterdayDataList.get(x).put("totalKilometers", zlc); |
| 2974 | 2973 | ||
| 2975 | } | 2974 | } |
| 2976 | - List<Map<String, Object>> yesterdayDataLists = new ArrayList<Map<String, Object>>(); | 2975 | + /* List<Map<String, Object>> yesterdayDataLists = new ArrayList<Map<String, Object>>(); |
| 2977 | 2976 | ||
| 2978 | for (int i = 0; i < yesterdayDataList.size(); i++) { | 2977 | for (int i = 0; i < yesterdayDataList.size(); i++) { |
| 2979 | Map<String, Object> map=yesterdayDataList.get(i); | 2978 | Map<String, Object> map=yesterdayDataList.get(i); |
| 2980 | Double zlc=map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString()); | 2979 | Double zlc=map.get("totalKilometers")==null?0.0:Double.parseDouble(map.get("totalKilometers").toString()); |
| 2981 | - if(zlc>0){ | 2980 | +// if(zlc>0){ |
| 2982 | yesterdayDataLists.add(map); | 2981 | yesterdayDataLists.add(map); |
| 2983 | - } | ||
| 2984 | - } | 2982 | +// } |
| 2983 | + }*/ | ||
| 2985 | //增加顺序号 | 2984 | //增加顺序号 |
| 2986 | - for (int i = 0; i < yesterdayDataLists.size(); i++) { | 2985 | + for (int i = 0; i < yesterdayDataList.size(); i++) { |
| 2987 | if (i == 0) { | 2986 | if (i == 0) { |
| 2988 | - yesterdayDataLists.get(i).put("seqNumber", 1); | 2987 | + yesterdayDataList.get(i).put("seqNumber", 1); |
| 2989 | } else { | 2988 | } else { |
| 2990 | - if (yesterdayDataLists.get(i - 1).get("clZbh").equals(yesterdayDataLists.get(i).get("clZbh"))) { | ||
| 2991 | - yesterdayDataLists.get(i).put("seqNumber", 1 + (int) yesterdayDataLists.get(i - 1).get("seqNumber")); | 2989 | + if (yesterdayDataList.get(i - 1).get("clZbh").equals(yesterdayDataList.get(i).get("clZbh"))) { |
| 2990 | + yesterdayDataList.get(i).put("seqNumber", 1 + (int) yesterdayDataList.get(i - 1).get("seqNumber")); | ||
| 2992 | } else { | 2991 | } else { |
| 2993 | - yesterdayDataLists.get(i).put("seqNumber", 1); | 2992 | + yesterdayDataList.get(i).put("seqNumber", 1); |
| 2994 | } | 2993 | } |
| 2995 | } | 2994 | } |
| 2996 | } | 2995 | } |
| 2997 | - return yesterdayDataLists; | 2996 | + return yesterdayDataList; |
| 2998 | } | 2997 | } |
| 2999 | 2998 | ||
| 3000 | /** | 2999 | /** |
src/main/java/com/bsth/service/schedule/rules/validate/ValidWholeRerunBcFunction.java
| 1 | -package com.bsth.service.schedule.rules.validate; | ||
| 2 | - | ||
| 3 | -import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 4 | -import org.kie.api.runtime.rule.AccumulateFunction; | ||
| 5 | - | ||
| 6 | -import java.io.*; | ||
| 7 | -import java.text.SimpleDateFormat; | ||
| 8 | -import java.util.ArrayList; | ||
| 9 | -import java.util.HashMap; | ||
| 10 | -import java.util.List; | ||
| 11 | -import java.util.Map; | ||
| 12 | - | ||
| 13 | -/** | ||
| 14 | - * 验证完全套跑路牌班次正确性。 | ||
| 15 | - * 完全套跑路牌班次指此路牌下的所有班次由其他线路完成。 | ||
| 16 | - * 记录漏掉的班次,并给出警告信息。 | ||
| 17 | - */ | ||
| 18 | -public class ValidWholeRerunBcFunction implements AccumulateFunction { | ||
| 19 | - @Override | ||
| 20 | - public void writeExternal(ObjectOutput out) throws IOException { | ||
| 21 | - } | ||
| 22 | - | ||
| 23 | - @Override | ||
| 24 | - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { | ||
| 25 | - | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - protected static class RerunBcInfo implements Externalizable { | ||
| 29 | - /** 错误描述 */ | ||
| 30 | - public List<ValidateResults_output.ValidInfo> validInfoList = new ArrayList<>(); | ||
| 31 | - /** 内部计数Map,key:{路牌Id}_{发车时间},value:个数 */ | ||
| 32 | - public Map<String, Integer> lpBcFcsjCount = new HashMap<>(); | ||
| 33 | - | ||
| 34 | - public RerunBcInfo() { | ||
| 35 | - } | ||
| 36 | - | ||
| 37 | - @Override | ||
| 38 | - public void writeExternal(ObjectOutput out) throws IOException { | ||
| 39 | - out.writeObject(validInfoList); | ||
| 40 | - } | ||
| 41 | - | ||
| 42 | - @Override | ||
| 43 | - public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { | ||
| 44 | - validInfoList = (List<ValidateResults_output.ValidInfo>) in.readObject(); | ||
| 45 | - } | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - @Override | ||
| 49 | - public Serializable createContext() { | ||
| 50 | -// System.out.println("create"); | ||
| 51 | - return new RerunBcInfo(); | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - @Override | ||
| 55 | - public void init(Serializable serializable) throws Exception { | ||
| 56 | - // TODO: | ||
| 57 | -// System.out.println("init"); | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - @Override | ||
| 61 | - public void accumulate(Serializable context, Object o) { | ||
| 62 | - RerunBcInfo rerunBcInfo = (RerunBcInfo) context; | ||
| 63 | - SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o; | ||
| 64 | - | ||
| 65 | - String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj(); | ||
| 66 | - SimpleDateFormat sf = new SimpleDateFormat("yyyy年MM月dd日"); | ||
| 67 | - String infoformat = "日期(%s),路牌(%s)完全套跑,班次(%s),在套跑规则中未指定"; | ||
| 68 | - | ||
| 69 | - if (schedulePlanInfo.getCl() == null) { | ||
| 70 | - rerunBcInfo.lpBcFcsjCount.put(key, 1); | ||
| 71 | - | ||
| 72 | - ValidateResults_output.ValidInfo validInfo = new ValidateResults_output.ValidInfo(); | ||
| 73 | - validInfo.setSd(schedulePlanInfo.getScheduleDate()); | ||
| 74 | - validInfo.setDesc(String.format( | ||
| 75 | - infoformat, | ||
| 76 | - sf.format(schedulePlanInfo.getScheduleDate()), | ||
| 77 | - schedulePlanInfo.getLpName(), | ||
| 78 | - schedulePlanInfo.getFcsj(), | ||
| 79 | - 1)); | ||
| 80 | - | ||
| 81 | - rerunBcInfo.validInfoList.add(validInfo); | ||
| 82 | - } | ||
| 83 | - } | ||
| 84 | - | ||
| 85 | - @Override | ||
| 86 | - public boolean supportsReverse() { | ||
| 87 | - return true; | ||
| 88 | - } | ||
| 89 | - | ||
| 90 | - @Override | ||
| 91 | - public void reverse(Serializable context, Object o) throws Exception { | ||
| 92 | - RerunBcInfo rerunBcInfo = (RerunBcInfo) context; | ||
| 93 | - SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o; | ||
| 94 | - | ||
| 95 | - String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj(); | ||
| 96 | - rerunBcInfo.lpBcFcsjCount.remove(key); | ||
| 97 | - | ||
| 98 | - if (!rerunBcInfo.validInfoList.isEmpty()) { // 全部清空 | ||
| 99 | - rerunBcInfo.validInfoList.clear(); | ||
| 100 | - } | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | - @Override | ||
| 104 | - public Class<?> getResultType() { | ||
| 105 | - return List.class; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - @Override | ||
| 109 | - public Object getResult(Serializable context) throws Exception { | ||
| 110 | - RerunBcInfo rerunBcInfo = (RerunBcInfo) context; | ||
| 111 | - return rerunBcInfo.validInfoList; | ||
| 112 | - } | ||
| 113 | -} | 1 | +package com.bsth.service.schedule.rules.validate; |
| 2 | + | ||
| 3 | +import com.bsth.entity.schedule.SchedulePlanInfo; | ||
| 4 | +import org.kie.api.runtime.rule.AccumulateFunction; | ||
| 5 | + | ||
| 6 | +import java.io.*; | ||
| 7 | +import java.text.SimpleDateFormat; | ||
| 8 | +import java.util.ArrayList; | ||
| 9 | +import java.util.HashMap; | ||
| 10 | +import java.util.List; | ||
| 11 | +import java.util.Map; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 验证完全套跑路牌班次正确性。 | ||
| 15 | + * 完全套跑路牌班次指此路牌下的所有班次由其他线路完成。 | ||
| 16 | + * 记录漏掉的班次,并给出警告信息。 | ||
| 17 | + */ | ||
| 18 | +public class ValidWholeRerunBcFunction implements AccumulateFunction { | ||
| 19 | + @Override | ||
| 20 | + public void writeExternal(ObjectOutput out) throws IOException { | ||
| 21 | + } | ||
| 22 | + | ||
| 23 | + @Override | ||
| 24 | + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { | ||
| 25 | + | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + protected static class RerunBcInfo implements Externalizable { | ||
| 29 | + /** 错误描述 */ | ||
| 30 | + public List<ValidateResults_output.ValidInfo> validInfoList = new ArrayList<>(); | ||
| 31 | + /** 内部计数Map,key:{路牌Id}_{发车时间},value:个数 */ | ||
| 32 | + public Map<String, Integer> lpBcFcsjCount = new HashMap<>(); | ||
| 33 | + | ||
| 34 | + public RerunBcInfo() { | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + @Override | ||
| 38 | + public void writeExternal(ObjectOutput out) throws IOException { | ||
| 39 | + out.writeObject(validInfoList); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + @Override | ||
| 43 | + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { | ||
| 44 | + validInfoList = (List<ValidateResults_output.ValidInfo>) in.readObject(); | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + @Override | ||
| 49 | + public Serializable createContext() { | ||
| 50 | +// System.out.println("create"); | ||
| 51 | + return new RerunBcInfo(); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + @Override | ||
| 55 | + public void init(Serializable serializable) throws Exception { | ||
| 56 | + // TODO: | ||
| 57 | +// System.out.println("init"); | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + @Override | ||
| 61 | + public void accumulate(Serializable context, Object o) { | ||
| 62 | + RerunBcInfo rerunBcInfo = (RerunBcInfo) context; | ||
| 63 | + SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o; | ||
| 64 | + | ||
| 65 | + String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj(); | ||
| 66 | + SimpleDateFormat sf = new SimpleDateFormat("yyyy年MM月dd日"); | ||
| 67 | + String infoformat = "日期(%s),路牌(%s)完全套跑,班次(%s),在套跑规则中未指定"; | ||
| 68 | + | ||
| 69 | + if (schedulePlanInfo.getCl() == null) { | ||
| 70 | + rerunBcInfo.lpBcFcsjCount.put(key, 1); | ||
| 71 | + | ||
| 72 | + ValidateResults_output.ValidInfo validInfo = new ValidateResults_output.ValidInfo(); | ||
| 73 | + validInfo.setSd(schedulePlanInfo.getScheduleDate()); | ||
| 74 | + validInfo.setDesc(String.format( | ||
| 75 | + infoformat, | ||
| 76 | + sf.format(schedulePlanInfo.getScheduleDate()), | ||
| 77 | + schedulePlanInfo.getLpName(), | ||
| 78 | + schedulePlanInfo.getFcsj(), | ||
| 79 | + 1)); | ||
| 80 | + | ||
| 81 | + rerunBcInfo.validInfoList.add(validInfo); | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + @Override | ||
| 86 | + public boolean supportsReverse() { | ||
| 87 | + return true; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + @Override | ||
| 91 | + public void reverse(Serializable context, Object o) throws Exception { | ||
| 92 | + RerunBcInfo rerunBcInfo = (RerunBcInfo) context; | ||
| 93 | + SchedulePlanInfo schedulePlanInfo = (SchedulePlanInfo) o; | ||
| 94 | + | ||
| 95 | + String key = schedulePlanInfo.getLp() + "_" + schedulePlanInfo.getFcsj(); | ||
| 96 | + rerunBcInfo.lpBcFcsjCount.remove(key); | ||
| 97 | + | ||
| 98 | + if (!rerunBcInfo.validInfoList.isEmpty()) { // 全部清空 | ||
| 99 | + rerunBcInfo.validInfoList.clear(); | ||
| 100 | + } | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + @Override | ||
| 104 | + public Class<?> getResultType() { | ||
| 105 | + return List.class; | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + @Override | ||
| 109 | + public Object getResult(Serializable context) throws Exception { | ||
| 110 | + RerunBcInfo rerunBcInfo = (RerunBcInfo) context; | ||
| 111 | + return rerunBcInfo.validInfoList; | ||
| 112 | + } | ||
| 113 | +} |
src/main/java/com/bsth/service/traffic/impl/YgcBasicDataServiceImpl.java
| @@ -81,6 +81,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ | @@ -81,6 +81,7 @@ public class YgcBasicDataServiceImpl implements YgcBasicDataService{ | ||
| 81 | flag = "success"; | 81 | flag = "success"; |
| 82 | }catch (Exception e){ | 82 | }catch (Exception e){ |
| 83 | e.printStackTrace(); | 83 | e.printStackTrace(); |
| 84 | + logger.error("updateYgcBasicData:",e); | ||
| 84 | } | 85 | } |
| 85 | finally { | 86 | finally { |
| 86 | // 删除文件 | 87 | // 删除文件 |
src/main/java/com/bsth/websocket/handler/SendUtils.java
| @@ -36,8 +36,6 @@ public class SendUtils{ | @@ -36,8 +36,6 @@ public class SendUtils{ | ||
| 36 | * TODO(推送发车信息) | 36 | * TODO(推送发车信息) |
| 37 | */ | 37 | */ |
| 38 | public void sendFcsj(ScheduleRealInfo sch) { | 38 | public void sendFcsj(ScheduleRealInfo sch) { |
| 39 | - //处理出站即出场的班次 | ||
| 40 | - //connectOutSchTime(sch); | ||
| 41 | 39 | ||
| 42 | Map<String, Object> map = new HashMap<>(); | 40 | Map<String, Object> map = new HashMap<>(); |
| 43 | map.put("fn", "faChe"); | 41 | map.put("fn", "faChe"); |
src/main/resources/application-prod.properties
| @@ -2,7 +2,7 @@ server.port=9088 | @@ -2,7 +2,7 @@ server.port=9088 | ||
| 2 | management.port= 9001 | 2 | management.port= 9001 |
| 3 | management.address= 127.0.0.1 | 3 | management.address= 127.0.0.1 |
| 4 | 4 | ||
| 5 | -spring.jpa.hibernate.ddl-auto= update | 5 | +spring.jpa.hibernate.ddl-auto= none |
| 6 | spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy | 6 | spring.jpa.hibernate.naming_strategy= org.hibernate.cfg.ImprovedNamingStrategy |
| 7 | #DATABASE | 7 | #DATABASE |
| 8 | spring.jpa.database= MYSQL | 8 | spring.jpa.database= MYSQL |