package pln

import "time"

// CustOrderWithStatus 客户订单和状态联查
type CustOrderWithStatus struct {
	CustOrder       `xorm:"extends"`
	CustOrderStatus `xorm:"extends"`
}

// CustOrderData  客户订单和状态、数量的联查
type CustOrderData struct {
	CustOrder       `xorm:"extends"`
	CustOrderStatus `xorm:"extends"`
	CustOrderQty    `xorm:"extends"`
}

// ListElement 链表的节点
type ListElement struct {
	Start    time.Time
	End      time.Time
	Duration time.Duration
}

type FailedStatistic struct {
	Date string `json:"date"`
	Qty  int    `json:"qty"`
}

// DefectItem 看板缺陷统计每日数据
type DefectItem struct {
	Date   string `json:"DefectItem-Date"`
	Number int64  `json:"DefectItem-Number"`
}

// TargetItem 目标数据
type TargetItem struct {
	Target  int `json:"TargetItem-Target"`
	Current int `json:"TargetItem-Current"`
}

type DashboardData struct {
	Date  string
	Lable int
	Val   float64
}

type PerDashboardData struct {
	DashboardData1 []DashboardData
	DashboardData2 []DashboardData
}

type ProductFamilyProduce struct {
	ProductFamilyId string   `json:"productFamilyId"`
	PercentLi       []string `json:"percentLi"`
}

type CutLine1 struct {
	TimeLi             []string  `json:"timeLi"`
	Standard           float64   `json:"standard"`
	ProductFamilyMeter int       `json:"productFamilyMeter"`
	ProduceData        []float64 `json:"produceData"`
}

// 派生每个小时产量map
type HourProductData struct {
	ProductFamilyId string
	LastDoneTime    time.Time
	Qty             int
}

//Dashboard数据展示
type DashboardPic struct {
	DashboardDataPic1   CutLine1        //图例1
	DashboardDataPic2   []DefectItem     //图例2
	DashboardDataPic3   PerDashboardData //图例3
	DashboardDataPic4   TargetItem       //目标数据
	DashboardDataStatus int              //状态
	CurrentTempo        float64          //当前节拍
	TeamTemPo           float64          //当班节拍
	PerHourTemPo        float64          //当班平均每小时单人产出
	TemPoPerson         int              //当前上班人数
	DateTimeNow         string           //当前日期
	IppmTarge           int              //IPPM
}
