Browse Source

修改路况信息入库时间

develop
王兴琳 4 months ago
parent
commit
976dba7183
  1. 16
      zc-business/src/main/java/com/zc/business/controller/DcTimingOfTrafficConditionsController.java

16
zc-business/src/main/java/com/zc/business/controller/DcTimingOfTrafficConditionsController.java

@ -35,25 +35,9 @@ public class DcTimingOfTrafficConditionsController {
//插入 数据库
DcRoadConditionInformation dcRoadConditionInformation =new DcRoadConditionInformation();
dcRoadConditionInformation.setOtherConfig(jsonArray.toJSONString());
List<DcRoadConditionInformation> dcRoadConditionInformations = dcRoadConditionInformationService.selectlistTime();
if (dcRoadConditionInformations.size()==UniversalEnum.ZERO.getNumber()){
dcRoadConditionInformationService.insertDcRoadConditionInformation(dcRoadConditionInformation);
}else {
DcRoadConditionInformation dcRoadConditionInformation1 = dcRoadConditionInformations.get(UniversalEnum.ZERO.getNumber());
Date createTime = dcRoadConditionInformation1.getCreateTime();
Calendar createTimeCalendar = Calendar.getInstance();
createTimeCalendar.setTime(createTime);
// 获取 createTime 的分钟
int createMinute = createTimeCalendar.get(Calendar.MINUTE);// 获取当前时间的小时
Calendar currentCalendar = Calendar.getInstance();
int currentMinute = currentCalendar.get(Calendar.MINUTE);
if (createMinute != currentMinute) {
dcRoadConditionInformationService.insertDcRoadConditionInformation(dcRoadConditionInformation);
}
}
}
// 将获取到的交通指标数据封装为成功的结果并返回
}

Loading…
Cancel
Save