package log

import "LAPP_LF_MOM_BACKEND/grmi"

/******************************************************************************
 *
 * @Struct Name              : ArtDemandLstResponseItem
 *-----------------------------------------------------------------------------
 *
 * @Description              : ArtDemandLst列表页返回前端结构体
 *
 * @Author                   : 张鑫
 *
 * @Date                     : 2021-03-30
 *
 ******************************************************************************/
type ArtDemandLstResponseItem struct {
	*ArtDemandLst
	ArtDesc       string `json:"LOG_ArtDemandLst-ArtDesc"`       // 物料描述
	UrgencyDegree int    `json:"LOG_ArtDemandLst-UrgencyDegree"` // 紧急程度
	SurplusDays   int64  `json:"LOG_ArtDemandLst-SurplusDays"`   // 距离交付天数
}

/******************************************************************************
 *
 * @Struct Name              : ArtDemandHeadResponseItem
 *-----------------------------------------------------------------------------
 *
 * @Description              : ArtDemandHead列表页返回前端结构体
 *
 * @Author                   : 张鑫
 *
 * @Date                     : 2021-04-29
 *
 ******************************************************************************/
type ArtDemandHeadResponseItem struct {
	*ArtDemandHead
	ArtDesc       string `json:"LOG_ArtDemandHead-ArtDesc"`       // 物料描述
	UrgencyDegree int    `json:"LOG_ArtDemandHead-UrgencyDegree"` // 紧急程度
	SurplusDays   int64  `json:"LOG_ArtDemandHead-SurplusDays"`   // 距离交付天数
}




//TODO 临时结构体 待解决
type ArtDemandLstResponseItemTemp struct {
	PlantNr            int           `xorm:"pk int 'PlantNr'" json:"LOG_ArtDemandLst-PlantNr"`
	ArtId              string        `xorm:"nvarchar(40) 'ArtId' not null" json:"LOG_ArtDemandLst-ArtId"`
	DemandCtrlPara3    string        `xorm:"nvarchar(100) 'DemandCtrlPara3' not null" json:"LOG_ArtDemandLst-DemandCtrlPara3"`
	DemandId           string        `xorm:"pk nvarchar(40) 'DemandId'" json:"LOG_ArtDemandLst-DemandId"`
	DemandTime         grmi.DateTime `xorm:"datetime2(7) 'DemandTime' not null" json:"LOG_ArtDemandLst-DemandTime"`
	DemandYear         int           `xorm:"int 'DemandYear' not null" json:"LOG_ArtDemandLst-DemandYear"`
	DemandMonth        int           `xorm:"int 'DemandMonth' not null" json:"LOG_ArtDemandLst-DemandMonth"`
	DemandWeek         int           `xorm:"int 'DemandWeek' not null" json:"LOG_ArtDemandLst-DemandWeek"`
	DemandDate         grmi.Date     `xorm:"date 'DemandDate' not null" json:"LOG_ArtDemandLst-DemandDate"`
	DemandHour         int           `xorm:"int 'DemandHour' not null" json:"LOG_ArtDemandLst-DemandHour"`
	DemandQty          float64       `xorm:"float 'DemandQty' not null" json:"LOG_ArtDemandLst-DemandQty"`
	UnproducedQty      float64       `xorm:"float 'UnproducedQty' not null" json:"LOG_ArtDemandLst-UnproducedQty"`
	QtyUomId           string        `xorm:"nvarchar(40) 'QtyUomId' not null" json:"LOG_ArtDemandLst-QtyUomId"`
	DemandObjId        string        `xorm:"nvarchar(40) 'DemandObjId' not null" json:"LOG_ArtDemandLst-DemandObjId"`
	DemandType         string        `xorm:"nvarchar(40) 'DemandType' not null" json:"LOG_ArtDemandLst-DemandType"`
	Status             string           `xorm:"int 'Status' not null" json:"LOG_ArtDemandLst-Status"`
	DemandSendTime     grmi.DateTime `xorm:"datetime 'DemandSendTime'" json:"LOG_ArtDemandLst-DemandSendTime"`
	DemandRecieveTime  grmi.DateTime `xorm:"datetime 'DemandRecieveTime'" json:"LOG_ArtDemandLst-DemandRecieveTime"`
	DemandConfirmTime  grmi.DateTime `xorm:"datetime 'DemandConfirmTime'" json:"LOG_ArtDemandLst-DemandConfirmTime"`
	DemandCloseTime    grmi.DateTime `xorm:"datetime 'DemandCloseTime'" json:"LOG_ArtDemandLst-DemandCloseTime"`
	DemandDeliveredQty float64       `xorm:"float 'DemandDeliveredQty' not null" json:"LOG_ArtDemandLst-DemandDeliveredQty"`
	DemandCtrlPara1    int           `xorm:"int 'DemandCtrlPara1' not null" json:"LOG_ArtDemandLst-DemandCtrlPara1"`
	DemandCtrlPara2    int           `xorm:"int 'DemandCtrlPara2' not null" json:"LOG_ArtDemandLst-DemandCtrlPara2"`
	Pos                int           `xorm:"pk int 'Pos'" json:"LOG_ArtDemandLst-Pos"`
	OrderStatus        string           `xorm:"int 'OrderStatus' not null" json:"LOG_ArtDemandLst-OrderStatus"`
	OrderType          string        `xorm:"nvarchar(20) 'OrderType' not null" json:"LOG_ArtDemandLst-OrderType"`
	ProjectId          string        `xorm:"nvarchar(40) 'ProjectId' not null" json:"LOG_ArtDemandLst-ProjectId"`
	DemandStatus       string           `xorm:"int 'DemandStatus' not null" json:"LOG_ArtDemandLst-DemandStatus"`
	PlanResourceId     string        `xorm:"nvarchar(40) 'PlanResourceId'" json:"LOG_ArtDemandLst-PlanResourceId"`
	UrgencyDegree      string        `json:"LOG_ArtDemandLst-UrgencyDegree"` // 紧急程度
	SurplusDays        int64         `json:"LOG_ArtDemandLst-SurplusDays"`   // 距离交付天数
	LastModify         grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"LOG_ArtDemandLst-LastModify"`
	LastUser           string        `xorm:"nvarchar(20) 'LastUser' not null" json:"LOG_ArtDemandLst-LastUser"`
	CreateTime         grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"LOG_ArtDemandLst-CreateTime"`
}

//TODO 临时结构体 待解决
type ArtDemandHeadResponseItemTemp struct {
	PlantNr            int           `xorm:"pk int 'PlantNr'" json:"LOG_ArtDemandHead-PlantNr"`
	ArtId              string        `xorm:"pk nvarchar(40) 'ArtId'" json:"LOG_ArtDemandHead-ArtId"`
	DemandCtrlPara3    string        `xorm:"nvarchar(100) 'DemandCtrlPara3' not null" json:"LOG_ArtDemandHead-DemandCtrlPara3"`
	DemandId           string        `xorm:"pk nvarchar(40) 'DemandId'" json:"LOG_ArtDemandHead-DemandId"`
	DemandType         string        `xorm:"nvarchar(40) 'DemandType' not null" json:"LOG_ArtDemandHead-DemandType"`
	DemandYear         int           `xorm:"int 'DemandYear' not null" json:"LOG_ArtDemandHead-DemandYear"`
	DemandMonth        int           `xorm:"int 'DemandMonth' not null" json:"LOG_ArtDemandHead-DemandMonth"`
	DemandWeek         int           `xorm:"int 'DemandWeek' not null" json:"LOG_ArtDemandHead-DemandWeek"`
	DemandDate         grmi.Date     `xorm:"date 'DemandDate' not null" json:"LOG_ArtDemandHead-DemandDate"`
	DemandHour         int           `xorm:"int 'DemandHour' not null" json:"LOG_ArtDemandHead-DemandHour"`
	DemandTime         grmi.DateTime `xorm:"datetime 'DemandTime'" json:"LOG_ArtDemandHead-DemandTime"`
	DemandQty          float64       `xorm:"float 'DemandQty' not null" json:"LOG_ArtDemandHead-DemandQty"`
	UnproducedQty      float64       `xorm:"float 'UnproducedQty' not null" json:"LOG_ArtDemandHead-UnproducedQty"`
	CancelQty          float64       `xorm:"float 'CancelQty' not null" json:"LOG_ArtDemandHead-CancelQty"`
	QtyUomId           string        `xorm:"nvarchar(40) 'QtyUomId' not null" json:"LOG_ArtDemandHead-QtyUomId"`
	Status             string        `xorm:"int 'Status' not null" json:"LOG_ArtDemandHead-Status"`
	DemandSendTime     grmi.DateTime `xorm:"datetime 'DemandSendTime'" json:"LOG_ArtDemandHead-DemandSendTime"`
	DemandRecieveTime  grmi.DateTime `xorm:"datetime 'DemandRecieveTime'" json:"LOG_ArtDemandHead-DemandRecieveTime"`
	DemandConfirmTime  grmi.DateTime `xorm:"datetime 'DemandConfirmTime'" json:"LOG_ArtDemandHead-DemandConfirmTime"`
	DemandCloseTime    grmi.DateTime `xorm:"datetime 'DemandCloseTime'" json:"LOG_ArtDemandHead-DemandCloseTime"`
	DemandDeliveredQty float64       `xorm:"float 'DemandDeliveredQty' not null" json:"LOG_ArtDemandHead-DemandDeliveredQty"`
	ChangeStatus       string           `xorm:"int 'ChangeStatus' not null" json:"LOG_ArtDemandHead-ChangeStatus"`
	DemandCtrlPara4    string        `xorm:"nvarchar(100) 'DemandCtrlPara4' not null" json:"LOG_ArtDemandHead-DemandCtrlPara4"`
	OrderStatus        string        `xorm:"int 'OrderStatus' not null" json:"LOG_ArtDemandHead-OrderStatus"`
	OrderType          string        `xorm:"nvarchar(20) 'OrderType' not null" json:"LOG_ArtDemandHead-OrderType"`
	WorkOrderId        string        `xorm:"nvarchar(40) 'WorkOrderId' not null" json:"LOG_ArtDemandHead-WorkOrderId"`
	ProjectId          string        `xorm:"nvarchar(40) 'ProjectId' not null" json:"LOG_ArtDemandHead-ProjectId"`
	DemandStatus       string           `xorm:"int 'DemandStatus' not null" json:"LOG_ArtDemandHead-DemandStatus"`
	PlanResourceId     string        `xorm:"nvarchar(40) 'PlanResourceId'" json:"LOG_ArtDemandHead-PlanResourceId"`
	UrgencyDegree      string        `json:"LOG_ArtDemandHead-UrgencyDegree"` // 紧急程度
	SurplusDays        int64         `json:"LOG_ArtDemandHead-SurplusDays"`   // 距离交付天数
	LastModify         grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"LOG_ArtDemandHead-LastModify"`
	LastUser           string        `xorm:"nvarchar(20) 'LastUser' not null" json:"LOG_ArtDemandHead-LastUser"`
	CreateTime         grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"LOG_ArtDemandHead-CreateTime"`
}

// ArtDemandHeadCache导出excel结构体
type ArtDemandHeadCacheExport struct {
	PlantNr         int           `xorm:"pk int 'PlantNr'" json:"LOG_ArtDemandHeadCache-PlantNr"`
	ArtId           string        `xorm:"pk nvarchar(40) 'ArtId'" json:"LOG_ArtDemandHeadCache-ArtId"`
	DemandCtrlPara3 string        `xorm:"nvarchar(100) 'DemandCtrlPara3' not null" json:"LOG_ArtDemandHeadCache-DemandCtrlPara3"`
	DemandId        string        `xorm:"pk nvarchar(40) 'DemandId'" json:"LOG_ArtDemandHeadCache-DemandId"`
	DemandType      string        `xorm:"nvarchar(40) 'DemandType' not null" json:"LOG_ArtDemandHeadCache-DemandType"`
	DemandYear      int           `xorm:"int 'DemandYear' not null" json:"LOG_ArtDemandHeadCache-DemandYear"`
	DemandMonth     int           `xorm:"int 'DemandMonth' not null" json:"LOG_ArtDemandHeadCache-DemandMonth"`
	DemandWeek      int           `xorm:"int 'DemandWeek' not null" json:"LOG_ArtDemandHeadCache-DemandWeek"`
	DemandDate      grmi.Date     `xorm:"date 'DemandDate' not null" json:"LOG_ArtDemandHeadCache-DemandDate"`
	DemandHour      int           `xorm:"int 'DemandHour' not null" json:"LOG_ArtDemandHeadCache-DemandHour"`
	DemandTime      grmi.DateTime `xorm:"datetime 'DemandTime'" json:"LOG_ArtDemandHeadCache-DemandTime"`
	DemandQty       float64       `xorm:"float 'DemandQty' not null" json:"LOG_ArtDemandHeadCache-DemandQty"`
	UnproducedQty   float64       `xorm:"float 'UnproducedQty' not null" json:"LOG_ArtDemandHeadCache-UnproducedQty"`
	CancelQty       float64       `xorm:"float 'CancelQty' not null" json:"LOG_ArtDemandHeadCache-CancelQty"`
	QtyUomId        string        `xorm:"nvarchar(40) 'QtyUomId' not null" json:"LOG_ArtDemandHeadCache-QtyUomId"`
	OrderStatus     string        `xorm:"int 'OrderStatus' not null" json:"LOG_ArtDemandHeadCache-OrderStatus"`
	OrderType       string        `xorm:"nvarchar(20) 'OrderType' not null" json:"LOG_ArtDemandHeadCache-OrderType"`
	WorkOrderId     string        `xorm:"nvarchar(40) 'WorkOrderId'" json:"LOG_ArtDemandHeadCache-WorkOrderId"`
	ProjectId       string        `xorm:"nvarchar(40) 'ProjectId' not null" json:"LOG_ArtDemandHeadCache-ProjectId"`
	PlanResourceId  string        `xorm:"nvarchar(40) 'PlanResourceId'" json:"LOG_ArtDemandHeadCache-PlanResourceId"`
	DemandStatus    string        `xorm:"int 'DemandStatus' not null" json:"LOG_ArtDemandHeadCache-DemandStatus"`
	LastModify      grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"LOG_ArtDemandHeadCache-LastModify"`
	LastUser        string        `xorm:"nvarchar(20) 'LastUser' not null" json:"LOG_ArtDemandHeadCache-LastUser"`
	CreateTime      grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"LOG_ArtDemandHeadCache-CreateTime"`
}


type ArtDemandLstCacheExport struct {
	PlantNr         int           `xorm:"pk int 'PlantNr'" json:"LOG_ArtDemandLstCache-PlantNr"`
	ArtId           string        `xorm:"nvarchar(40) 'ArtId' not null" json:"LOG_ArtDemandLstCache-ArtId"`
	DemandCtrlPara3 string        `xorm:"nvarchar(100) 'DemandCtrlPara3' not null" json:"LOG_ArtDemandLstCache-DemandCtrlPara3"`
	DemandTime      grmi.DateTime `xorm:"datetime2(7) 'DemandTime' not null" json:"LOG_ArtDemandLstCache-DemandTime"`
	DemandId        string        `xorm:"pk nvarchar(40) 'DemandId'" json:"LOG_ArtDemandLstCache-DemandId"`
	DemandYear      int           `xorm:"int 'DemandYear' not null" json:"LOG_ArtDemandLstCache-DemandYear"`
	DemandMonth     int           `xorm:"int 'DemandMonth' not null" json:"LOG_ArtDemandLstCache-DemandMonth"`
	DemandWeek      int           `xorm:"int 'DemandWeek' not null" json:"LOG_ArtDemandLstCache-DemandWeek"`
	DemandDate      grmi.Date     `xorm:"date 'DemandDate' not null" json:"LOG_ArtDemandLstCache-DemandDate"`
	DemandHour      int           `xorm:"int 'DemandHour' not null" json:"LOG_ArtDemandLstCache-DemandHour"`
	DemandQty       float64       `xorm:"float 'DemandQty' not null" json:"LOG_ArtDemandLstCache-DemandQty"`
	QtyUomId        string        `xorm:"nvarchar(40) 'QtyUomId' not null" json:"LOG_ArtDemandLstCache-QtyUomId"`
	UnproducedQty   float64       `xorm:"float 'UnproducedQty' not null" json:"LOG_ArtDemandLstCache-UnproducedQty"`
	DemandType      string        `xorm:"nvarchar(40) 'DemandType' not null" json:"LOG_ArtDemandLstCache-DemandType"`
	DemandCtrlPara1 int           `xorm:"int 'DemandCtrlPara1' not null" json:"LOG_ArtDemandLstCache-DemandCtrlPara1"`
	DemandCtrlPara2 int           `xorm:"int 'DemandCtrlPara2' not null" json:"LOG_ArtDemandLstCache-DemandCtrlPara2"`
	Pos             int           `xorm:"pk int 'Pos'" json:"LOG_ArtDemandLstCache-Pos"`
	OrderStatus     string           `xorm:"int 'OrderStatus' not null" json:"LOG_ArtDemandLstCache-OrderStatus"`
	OrderType       string        `xorm:"nvarchar(20) 'OrderType' not null" json:"LOG_ArtDemandLstCache-OrderType"`
	ProjectId       string        `xorm:"nvarchar(40) 'ProjectId' not null" json:"LOG_ArtDemandLstCache-ProjectId"`
	DemandStatus    string        `xorm:"int 'DemandStatus' not null" json:"LOG_ArtDemandLstCache-DemandStatus"`
	PlanResourceId  string        `xorm:"nvarchar(40) 'PlanResourceId'" json:"LOG_ArtDemandLstCache-PlanResourceId"`
	LastModify      grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"LOG_ArtDemandLstCache-LastModify"`
	LastUser        string        `xorm:"nvarchar(20) 'LastUser' not null" json:"LOG_ArtDemandLstCache-LastUser"`
	CreateTime      grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"LOG_ArtDemandLstCache-CreateTime"`
}

// UrgencyDegree状态值
const (
	UrgencyNot     int = iota // 0 不紧急 绿色
	UrgencyNormal             // 1 紧急 黄色
	UrgencySerious            // 2 延误 红色
)
