Merge remote-tracking branch 'origin/develop' into develop

develop
hanrenchun 9 months ago
commit c3087b89ef

@ -103,19 +103,20 @@ public class PeopleVehicleHourFlowTask {
//构造查询条件
QueryWrapper<TStrhEntityInfoKs> queryWrapper = new QueryWrapper<>();
//减去i小时
LocalDateTime targetHour = startOfDay.minusHours(i);
LocalDateTime time = Hour.minusHours(i);
LocalDateTime targetHour = startOfDay.plusHours(i);
LocalDateTime time = Hour.plusHours(i + 1);
//将日期部分格式化为数据库存储格式
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
String formattedDate = targetHour.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
String format = time.format(formatter1);
queryWrapper.between("capturetime", formattedDate, targetHour.plusHours(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
queryWrapper.between("capturetime", formattedDate, targetHour.plusHours(i+1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
int count = tStrhEntityInfoKsService.count(queryWrapper);
PeopleVehicleHourFlow peopleVehicleHourFlow = new PeopleVehicleHourFlow();
peopleVehicleHourFlow.setStatistic_count(String.valueOf(count));
peopleVehicleHourFlow.setStatistic_type(1);
peopleVehicleHourFlow.setStatistic_time(time.toString());
PeopleVehicleHourFlow one = peopleVehicleHourFlowService.lambdaQuery().eq(PeopleVehicleHourFlow::getStatistic_time, time.toString())
peopleVehicleHourFlow.setStatistic_time(format);
PeopleVehicleHourFlow one = peopleVehicleHourFlowService.lambdaQuery().eq(PeopleVehicleHourFlow::getStatistic_time, time)
.eq(PeopleVehicleHourFlow::getStatistic_type, 1).one();
if (one == null) {
boolean save = peopleVehicleHourFlowService.save(peopleVehicleHourFlow);

Loading…
Cancel
Save