Browse Source

1.添加setPeriodType方法导致@Data注解不添加默认setPeriodType导致数据查询数据无法映射的问题

2.获取历史交通截面数据请求参数开始时间和结束时间添加  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")注解以支持对应字符串时间格式
3.获取历史交通截面数据请求参数过滤为null的数据
develop
xiepufeng 8 months ago
parent
commit
20fa685dd1
  1. 6
      zc-business/src/main/java/com/zc/business/domain/DcTrafficSectionData.java
  2. 3
      zc-business/src/main/java/com/zc/business/request/DcTrafficSectionDataRequest.java
  3. 15
      zc-business/src/main/java/com/zc/business/service/impl/DcTrafficStatisticsServiceImpl.java

6
zc-business/src/main/java/com/zc/business/domain/DcTrafficSectionData.java

@ -47,12 +47,14 @@ public class DcTrafficSectionData {
/**
* 统计时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date statisticalDate;
/**
* 上报时间
*/
@TableField(exist = false)
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date reportTime;
/**
@ -87,6 +89,10 @@ public class DcTrafficSectionData {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date updateTime;
public void setPeriodType(Byte periodType) {
this.periodType = periodType;
}
/**
* 设置交通数据的统计周期类型
* @param periodType 统计周期类型的枚举值

3
zc-business/src/main/java/com/zc/business/request/DcTrafficSectionDataRequest.java

@ -1,6 +1,7 @@
package com.zc.business.request;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@ -25,11 +26,13 @@ public class DcTrafficSectionDataRequest {
/**
* 开始时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/**
* 结束时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/**

15
zc-business/src/main/java/com/zc/business/service/impl/DcTrafficStatisticsServiceImpl.java

@ -123,9 +123,18 @@ public class DcTrafficStatisticsServiceImpl
LambdaQueryWrapper<DcTrafficSectionData> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.between(DcTrafficSectionData::getStatisticalDate, request.getStartTime(), request.getEndTime());
queryWrapper.eq(DcTrafficSectionData::getPeriodType, request.getPeriodType());
queryWrapper.eq(DcTrafficSectionData::getDirection, request.getDirection());
queryWrapper.eq(DcTrafficSectionData::getDeviceType, request.getDeviceType());
queryWrapper.eq(DcTrafficSectionData::getDeviceId, request.getDeviceId());
if (request.getDirection() != null) {
queryWrapper.eq(DcTrafficSectionData::getDirection, request.getDirection());
}
if (request.getDeviceType() != null) {
queryWrapper.eq(DcTrafficSectionData::getDeviceType, request.getDeviceType());
}
if (request.getDeviceId() != null) {
queryWrapper.eq(DcTrafficSectionData::getDeviceId, request.getDeviceId());
}
return list(queryWrapper);
}

Loading…
Cancel
Save