package com.gic.haoban.manage.web.vo.chat;


import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;

/**
 * 
 * @ClassName: TabHaobanGroupChatPlan
 * @Description: TODO
 * @Author 徐高华
 * @Date 2022年11月25日 15:28:49
 * @Modify
 * @CopyRight 
 */
public class GroupChatPlanExcelVO extends Object implements Serializable{

    private static final long serialVersionUID = 21576537277600L;

    /**
     * 任务名称
     */
    private String name;
    /**
     * 任务状态
     */
    private String status;
    /**
     * 已完成任务的群主数量
     */
    private Integer sendCount;
    /**
     * 群主数量
     */
    private Integer staffCount;
    /**
     * 完成率
     */
    private String completionRate;
    /**
     * 已送达数的群数
     */
    private Integer successChatCount;
    /**
     * 任务开始时间
     */
    private Date startTime;
    /**
     * 任务结束时间
     */
    private Date endTime;
    /**
     * 创建人
     */
    private String creatorName;
    /**
     * 创建时间
     */
    private Date createTime;

    private int execType;

    // 执行方式 0企微1好办小程序
    private String execTypeExcel ;

    public int getExecType() {
		return execType;
	}

    public void setExecType(int execType) {
		this.execType = execType;
	}

    public String getExecTypeExcel() {
        if(execType==1) {
            return "好办小程序发送" ;
        }
		return "企微快捷键发送";
	}

    public void setExecTypeExcel(String execTypeExcel) {
		this.execTypeExcel = execTypeExcel;
	}

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStatus() {
        Date now = new Date();
        if (now.before(this.startTime)){
            status = "未开始";
        }else if (now.before(this.endTime)){
            status = "进行中";
        }else if (now.after(this.endTime)){
            status = "已结束";
        }
        return status;
    }



    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getSendCount() {
        return sendCount;
    }

    public void setSendCount(Integer sendCount) {
        this.sendCount = sendCount;
    }

    public Integer getStaffCount() {
        return staffCount;
    }

    public void setStaffCount(Integer staffCount) {
        this.staffCount = staffCount;
    }

    public String getCompletionRate() {
        if (null == this.staffCount || this.staffCount==0 || null == this.sendCount || 0==this.sendCount){
            completionRate = "0%";
            return completionRate;
        }
        Double i = 100.0 * this.sendCount / this.staffCount;
        BigDecimal bd = new BigDecimal(i);
        bd = bd.setScale(2, RoundingMode.HALF_UP);
        completionRate = bd +"%";
        return completionRate;
    }

    public void setCompletionRate(String completionRate) {
        this.completionRate = completionRate;
    }

    public Integer getSuccessChatCount() {
        return successChatCount;
    }

    public void setSuccessChatCount(Integer successChatCount) {
        this.successChatCount = successChatCount;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public String getCreatorName() {
        return creatorName;
    }

    public void setCreatorName(String creatorName) {
        this.creatorName = creatorName;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}