Commit b78d683d by 毛树良

<fix>:优化日志

1 parent 37dd53e2
......@@ -524,7 +524,7 @@ public class TrafficDataConvertHandler {
ResponseEntity<String> responseEntity = restTemplate.getForEntity(geturl, String.class);
if (responseEntity.getStatusCodeValue() == 200) {
String picget = responseEntity.getBody();
log.info("图片服务查询[{}],响应videoget={}", pic_unid, picget);
// log.info("图片服务查询[{}],响应videoget={}", pic_unid, picget);
if (StringUtils.isNotBlank(picget)) {
JSONObject picJson = JSONObject.parseObject(picget);
if (picJson != null && StringUtils.isNotBlank(picJson.getString("pic_url"))) {
......
......@@ -72,8 +72,9 @@ public class TrafficIllegalScheduled {
trafficQry.setEvent_dt__lt(event_dt__lt);
trafficQry.setLimit(limit);
trafficQry.setOffset(offset);
log.info("违法查询范围(lastTimeUtc,currentTimeUtc]=({},{}]。", lastTimeUtc, currentTimeUtc);
List<Object> trafficModels = trafficEventService.selectJsonDatas(trafficQry);
log.info("查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次待同步数据总{}条。", lastTimeUtc, currentTimeUtc, trafficModels.size());
log.info("违法查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次待同步违法数据总{}条。", lastTimeUtc, currentTimeUtc, trafficModels.size());
if (!CollectionUtils.isEmpty(trafficModels)) {
List<TrafficMongoModel> trafficMongoModels = new ArrayList<>();
for (Object model : trafficModels) {
......@@ -81,6 +82,7 @@ public class TrafficIllegalScheduled {
if (CheckUtil.checkDeviceId(trafficModel)) {
trafficMongoModels.add(trafficModel);
} else {
log.info("ill.update.record:{}-{}", trafficModel.getId(), trafficModel.getEvent_dt());
redisTemplate.opsForValue().set(RedisConstants.FANXING_TO_GB1400_LASTTIME, trafficModel.getEvent_dt());
}
}
......@@ -90,7 +92,9 @@ public class TrafficIllegalScheduled {
if (subscribeNotificationsObj != null) {
JsonMessage resultVo = gb1400Service.subscribeNotifications(subscribeNotificationsObj);
if (SystemConstants.APP_CODE_SUCCESS == resultVo.getCode()) {
redisTemplate.opsForValue().set(RedisConstants.FANXING_TO_GB1400_LASTTIME, trafficMongoModels.get(trafficMongoModels.size() - 1).getEvent_dt());
TrafficMongoModel last = trafficMongoModels.get(trafficMongoModels.size() - 1);
log.info("ill.update.record:{}-{}", last.getId(), last.getEvent_dt());
redisTemplate.opsForValue().set(RedisConstants.FANXING_TO_GB1400_LASTTIME, last.getEvent_dt());
}
} else {
log.error("trafficDataConvertHandler.trafficIllegalToSubscribeNotifications is null");
......
......@@ -60,7 +60,7 @@ public class TrafficVehicleScheduled {
}
int offset = 0;
int limit = 100;
int limit = 50;
//utc时间,当前时间减8小时
String event_dt__gte = lastTimeUtc;
String event_dt__lt = currentTimeUtc;
......@@ -72,8 +72,9 @@ public class TrafficVehicleScheduled {
trafficQry.setEvent_dt__lt(event_dt__lt);
trafficQry.setLimit(limit);
trafficQry.setOffset(offset);
log.info("过车查询范围(lastTimeUtc,currentTimeUtc]=({},{}]。", lastTimeUtc, currentTimeUtc);
List<Object> trafficModels = trafficEventService.selectJsonDatas(trafficQry);
log.info("查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次待同步过车数据总{}条。", lastTimeUtc, currentTimeUtc, trafficModels.size());
log.info("过车查询范围(lastTimeUtc,currentTimeUtc]=({},{}],本批次待同步过车数据总{}条。", lastTimeUtc, currentTimeUtc, trafficModels.size());
if (!CollectionUtils.isEmpty(trafficModels)) {
List<TrafficMongoModel> trafficMongoModels = new ArrayList<>();
for (Object model : trafficModels) {
......@@ -81,6 +82,7 @@ public class TrafficVehicleScheduled {
if (CheckUtil.checkDeviceId(trafficModel)) {
trafficMongoModels.add(trafficModel);
} else {
log.info("gc.update.record:{}-{}", trafficModel.getId(), trafficModel.getEvent_dt());
redisTemplate.opsForValue().set(RedisConstants.FANXING_TO_GB1400_VEHICLE_LASTTIME, trafficModel.getEvent_dt());
}
}
......@@ -90,7 +92,9 @@ public class TrafficVehicleScheduled {
if (subscribeNotificationsObj != null) {
JsonMessage resultVo = gb1400Service.subscribeNotifications(subscribeNotificationsObj);
if (SystemConstants.APP_CODE_SUCCESS == resultVo.getCode()) {
redisTemplate.opsForValue().set(RedisConstants.FANXING_TO_GB1400_VEHICLE_LASTTIME, trafficMongoModels.get(trafficMongoModels.size() - 1).getEvent_dt());
TrafficMongoModel last = trafficMongoModels.get(trafficMongoModels.size() - 1);
log.info("gc.update.record:{}-{}", last.getId(), last.getEvent_dt());
redisTemplate.opsForValue().set(RedisConstants.FANXING_TO_GB1400_VEHICLE_LASTTIME, last.getEvent_dt());
}
} else {
log.error("trafficDataConvertHandler.trafficVehicleToSubscribeNotifications is null");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!