package com.cool.store.vo.Preparation;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * @Author suzhuhong
 * @Date 2024/4/26 17:38
 * @Version 1.0
 */
@Data
public class PreparationScheduleDetailVO {

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

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

    private Integer joinStatus;

    private Long shopId;

    private String shopCode;

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

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

    @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 Date planCompletionTime;

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

    @ApiModelProperty("招商经理手机号")
    private String investmentManagerMobile;

    @ApiModelProperty("扩展经理名称")
    private String developmentManagerName;

    @ApiModelProperty("扩展经理手机号")
    private String developmentManagerMobile;

    public void setDays() {
        if (this.planOpenTime==null|| this.ContractCompletionTime==null){
            return;
        }
        long between = ChronoUnit.SECONDS.between(this.ContractCompletionTime.toInstant(), this.planOpenTime.toInstant());
        double days = (double) between / (24*60*60);
        this.days = String.format("%.1f", days);
    }





}
