package com.cool.store.vo.Preparation;

import com.cool.store.vo.BaseInfoVO;
import com.lowagie.text.alignment.HorizontalAlignment;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.temporal.ChronoUnit;
import java.util.Date;

/**
 * @Author suzhuhong
 * @Date 2024/4/26 15:00
 * @Version 1.0
 */
@Data
public class PreparationScheduleVO {

    @ApiModelProperty("加盟商名称")
    private String username;

    @ApiModelProperty("加盟手机号")
    private String mobile;

    private Long shopId;

    @ApiModelProperty("门店名称")
    private String shopName;

    @ApiModelProperty("门店代码")
    private String shopCode;

    @ApiModelProperty("门店编码")
    private String storeNum;

    @ApiModelProperty("开店负责人")
    private String shopManagerUserName;

    @ApiModelProperty("总项数")
    private Integer totalColumn;

    @ApiModelProperty("完成项")
    private Integer completionColumn;

    @ApiModelProperty("计划开店时间")
    private Date planOpenTime;

    @ApiModelProperty("合同完成时间")
    private Date ContractCompletionTime;

    @ApiModelProperty("开店时长")
    private String days;

    @ApiModelProperty("所属站区")
    private String regionNodeName;

    @ApiModelProperty("招商经理名称")
    private String investmentManagerName;

    private Long lineId;

    @ApiModelProperty("督导")
    private String supervisionName;

    @ApiModelProperty("开业活动完成时间")
    private Date openingActivityEndTime;
    @ApiModelProperty("门店创建时间")
    private Date shopCreateTime;
    public void setDays() {
        if (this.openingActivityEndTime==null){
            long between = ChronoUnit.SECONDS.between(this.shopCreateTime.toInstant(), new Date().toInstant());
            double days = (double) between / (24*60*60);
            this.days=String.format("%.1f", days);
        }else{
            long between = ChronoUnit.SECONDS.between(this.shopCreateTime.toInstant(), this.openingActivityEndTime.toInstant());
            double days = (double) between / (24*60*60);
            this.days = String.format("%.1f", days);
        }

    }
}
