package cn.com.victorysoft.business.sys.param;

import cn.com.victorysoft.business.util.DateUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Calendar;
import java.util.Date;

@ApiModel("单位分钟参数")
@Data
public class UnitMinuteParam {

    @ApiModelProperty("单位代码")
    private String unitcode;

    @ApiModelProperty("日期分钟")
    private Date testdate;

    public UnitDateParam parseUnitData() {
        UnitDateParam unitDateParam = new UnitDateParam();
        unitDateParam.setUnitcode(unitcode);
        unitDateParam.setTestdate(DateUtils.truncate(testdate, Calendar.DATE));
        return unitDateParam;
    }

    public void setTestdate(Date testdate) {
        this.testdate = DateUtils.getDiagDate(testdate);
    }
}
