审计记录

sk-base-common/src/main/java/com/skua/modules/common/vo/DateVO.java 2.7 KB
康伟 committed
1 2
package com.skua.modules.common.vo;

3
import com.skua.tool.util.DateUtils;
康伟 committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class DateVO {

    @ApiModelProperty(value = "去年(yyyy)")
    private int lastYear;

    @ApiModelProperty(value = "去年(yyyy-MM)")
    private String lastYearMonth;
    @ApiModelProperty(value = "去年(yyyy-MM-dd)")
    private String lastYearStartDate;
    @ApiModelProperty(value = "去年(yyyy-MM-dd)")
    private String lastYearEndDate;
19 20 21 22
    @ApiModelProperty(value = "去年月开始时间(yyyy-MM-dd)")
    private String lastYearMonthStartTime;
    @ApiModelProperty(value = "上月结束时间(yyyy-MM-dd)")
    private String lastYearMonthEndTime;
康伟 committed
23 24 25 26 27 28


    @ApiModelProperty(value = "上月(yyyy-MM)")
    private String lastMonth;
    @ApiModelProperty(value = "上月(yyyy-MM-dd)")
    private String lastMonthDay;
29 30 31 32 33
    @ApiModelProperty(value = "上月开始时间(yyyy-MM-dd)")
    private String lastMonthStartTime;
    @ApiModelProperty(value = "上月结束时间(yyyy-MM-dd)")
    private String lastMonthEndTime;

康伟 committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60


    @ApiModelProperty(value = "昨天")
    private String yesterday;

    @ApiModelProperty(value = "当月(yyyy)")
    private int nowYear;

    @ApiModelProperty(value = "当月(yyyy-MM)")
    private String nowMonth;

    @ApiModelProperty(value = "当月(yyyy-MM-dd)")
    private String nowMonthStartDate;

    @ApiModelProperty(value = "当月(yyyy-MM-dd)")
    private String nowMonthEndDate;

    @ApiModelProperty(value = "当月(yyyy-MM-dd)")
    private String nowYearStartDate;
    @ApiModelProperty(value = "当月(yyyy-MM-dd)")
    private String nowYearEndDate;


    public DateVO(String currentDate) {
        this.nowMonth = DateUtils.dateformat(currentDate,"yyyy-MM");
        this.nowMonthStartDate = nowMonth+"-01";
        this.nowMonthEndDate = nowMonth+"-31";
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
        this.nowYearStartDate = nowYear + "-01-01";
        this.nowYearEndDate = nowYear + "-12-31";

        this.nowYear = Integer.parseInt(DateUtils.dateformat(currentDate,"yyyy"));
        //同比时间
        this.lastYear = nowYear  -1 ;//去年
        this.lastYearMonth = DateUtils.getHbMonth(currentDate);
        System.out.println(" lastYearMonth   "+lastYearMonth);
        this.lastYearMonthStartTime = lastYearMonth+"-01";
        this.lastYearMonthStartTime = lastYearMonth+"-31";
        this.lastYearStartDate = this.lastYear+"-01-01";
        this.lastYearEndDate = this.lastYear+"-12-31";

        //环比时间
        this.lastMonth = DateUtils.getHbMonth(currentDate);//
        this.lastMonthStartTime = lastMonth+"-01";
康伟 committed
77 78
        this.lastMonthEndTime = lastMonth+"-31";

79 80
        //this.lastYearStartTime = lastYear+"-01";
        // this.lastYearEndTime = lastYear +"-31";
康伟 committed
81 82
    }
}
83