package com.ssj.service.kmt.arrange.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 日历一天的数据明细
 * 2019年8月8日14:9:48
 * @author wuen
 *
 */
public class ArrangeDetailDto implements Serializable {

    private static final long serialVersionUID = 1L;
    
    private String arrangeDate;
    
    private Integer week;
    
    private Integer isOpen=1;
    
    private Integer maxNum=0;
    
    private Integer miniNum=0;
    
    private Integer haveNum=0;
    
    private List<ArrangeIntervalDto> intervalList=new ArrayList<ArrangeIntervalDto>();

	public String getArrangeDate() {
		return arrangeDate;
	}

	public void setArrangeDate(String arrangeDate) {
		this.arrangeDate = arrangeDate;
	}

	public Integer getWeek() {
		return week;
	}

	public void setWeek(Integer week) {
		this.week = week;
	}

	public Integer getIsOpen() {
		return isOpen;
	}

	public void setIsOpen(Integer isOpen) {
		this.isOpen = isOpen;
	}
	public Integer getMaxNum() {
		return maxNum;
	}

	public void setMaxNum(Integer maxNum) {
		this.maxNum = maxNum;
	}

	public Integer getMiniNum() {
		return miniNum;
	}

	public void setMiniNum(Integer miniNum) {
		this.miniNum = miniNum;
	}

	public Integer getHaveNum() {
		return haveNum;
	}

	public void setHaveNum(Integer haveNum) {
		this.haveNum = haveNum;
	}

	public List<ArrangeIntervalDto> getIntervalList() {
		return intervalList;
	}

	public void setIntervalList(List<ArrangeIntervalDto> intervalList) {
		this.intervalList = intervalList;
	}

	//是否全部时段都会放，如果有一个时段没开放的，全天都标志为未开放
	//更新各属性总数
	public void updateNumAndOpen(){
		this.maxNum=0;
		this.miniNum=0;
		this.haveNum=0;
		for (ArrangeIntervalDto arrangeIntervalDto : this.intervalList) {
			if(arrangeIntervalDto.getIsOpen()==0){
				this.isOpen=0;
			}
			this.maxNum=this.maxNum+arrangeIntervalDto.getMaxNum();
			this.miniNum=this.miniNum+arrangeIntervalDto.getMiniNum();
			this.haveNum=this.haveNum+arrangeIntervalDto.getHaveNum();
		}
	
	}

}
