云
16 小时以前 d6b144421f86bcaaef5f21ddda193ab6f58b0d57
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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);
    }
}