package cn.iocoder.yudao.module.mes.controller.admin.energy.vo;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import jakarta.validation.constraints.AssertTrue;
|
import jakarta.validation.constraints.Pattern;
|
import lombok.Data;
|
import lombok.EqualsAndHashCode;
|
import org.springframework.format.annotation.DateTimeFormat;
|
import java.time.LocalDate;
|
|
@Data
|
@EqualsAndHashCode(callSuper = true)
|
public class EnergyRecordPageReqVO extends PageParam {
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
|
private LocalDate startDate;
|
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
|
private LocalDate endDate;
|
@Pattern(regexp = "WATER|ELECTRICITY|STEAM")
|
private String energyType;
|
private String usageArea;
|
private String productCategory;
|
|
@AssertTrue(message = "开始日期不能晚于结束日期")
|
public boolean isDateRangeValid() {
|
return startDate == null || endDate == null || !startDate.isAfter(endDate);
|
}
|
}
|