Commit b78d683d by 毛树良

<fix>:优化日志

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