diff --git a/hai-schedule/src/main/java/com/hai/schedule/EtcSchedule.java b/hai-schedule/src/main/java/com/hai/schedule/EtcSchedule.java index f0be1ad2..3f47b9ea 100644 --- a/hai-schedule/src/main/java/com/hai/schedule/EtcSchedule.java +++ b/hai-schedule/src/main/java/com/hai/schedule/EtcSchedule.java @@ -36,41 +36,7 @@ public class EtcSchedule { private EtcCarMsgService etcCarMsgService; - /** - * @return void - * @Author Sum1Dream - * @name cancelOrder.java - * @Description // 定时发起 - * @Date 14:18 2022/5/31 - * @Param [] - */ @Scheduled(cron = "0 0/10 * * * ?") //每10分钟执行一次 - public void getEtcCarList() { - try { - - Map map = new HashMap<>(); - map.put("status" , "11,12,13,15"); - - List list = etcCarMsgService.getEtcCarList(map); - - for (EtcCarMsg carMsg : list) { - JSONObject object = EtcService.getVehStatus(carMsg); - - if (Objects.equals(object.getString("errCode"), "0") && object.getJSONObject("result") != null) { - carMsg.setVehStatus(object.getJSONObject("result").getInteger("vehStatus")); - carMsg.setUpdateTime(object.getJSONObject("result").getDate("activeTime")); - } - etcCarMsgService.updateEtcCar(carMsg); - - } - - } catch (Exception e) { - log.error("HighUserController --> findByUserId() error!", e); - } - } - - - @Scheduled(cron = "0 0/60 * * * ?") //每60分钟执行一次 public void etcCarMsg() { try { @@ -82,10 +48,12 @@ public class EtcSchedule { Map map = new HashMap<>(); map.put("vehPlateNo" , jsonArray.getJSONObject(i).getString("vehPlateNo")); map.put("vehPlateColor" , CarTypeEnum.getNameByName(jsonArray.getJSONObject(i).getString("vehPlateColor"))); + map.put("vehStatus" , 20); EtcCarMsg carMsg = etcCarMsgService.findEtcCarByMap(map); carMsg.setCardNo(jsonArray.getJSONObject(i).getString("cardNo")); carMsg.setObuNo(jsonArray.getJSONObject(i).getString("obuNo")); + carMsg.setUpdateTime(jsonArray.getJSONObject(i).getDate("activeTime")); etcCarMsgService.updateEtcCar(carMsg); diff --git a/hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java b/hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java index f31496d7..cac5ca6f 100644 --- a/hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java +++ b/hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.java @@ -128,6 +128,9 @@ public class EtcCarMsgServiceImpl implements EtcCarMsgService { if (MapUtils.getString(map , "vehId") != null) { criteria.andVehIdEqualTo(MapUtils.getString(map , "vehId")); } + if (MapUtils.getInteger(map , "vehStatus") != null) { + criteria.andVehStatusNotEqualTo(MapUtils.getInteger(map , "vehStatus")); + } List list = etcCarMsgMapper.selectByExample(example);