|
|
@ -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); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 将获取到的交通指标数据封装为成功的结果并返回
|
|
|
|
|
|
|
|
} |
|
|
|