袁野 7 months ago
parent 7bfdcb2e74
commit fe357559ad
  1. 36
      hai-schedule/src/main/java/com/hai/schedule/EtcSchedule.java
  2. 3
      hai-service/src/main/java/com/hai/etc/impl/EtcCarMsgServiceImpl.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<String , Object> map = new HashMap<>();
map.put("status" , "11,12,13,15");
List<EtcCarMsg> 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<String , Object> 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);

@ -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<EtcCarMsg> list = etcCarMsgMapper.selectByExample(example);

Loading…
Cancel
Save