package base

/******************************************************************************
 *
 * @Struct Name              : WeekModelLstInsertReq
 *-----------------------------------------------------------------------------
 *
 * @Description              : WeekModelLstInsertReq weekModelLst 批量插入请求体映射
 *
 * @Author                   : 张鑫
 *
 * @Date                     : 2021-04-15
 *
 ******************************************************************************/
type WeekModelLstInsertReq struct {
	WeekModelNr int            `json:"weekModelNr"`
	Records     []WeekModelLst `json:"records"`
}

/******************************************************************************
 *
 * @Struct Name              : WorkCalendarLstInsertReq
 *-----------------------------------------------------------------------------
 *
 * @Description              : WorkCalendarLstInsertReq workCalendarLst 批量插入请求体映射
 *
 * @Author                   : 张鑫
 *
 * @Date                     : 2021-04-15
 *
 ******************************************************************************/
type WorkCalendarLstInsertReq struct {
	WorkCalendarNr int               `json:"workCalendarNr"`
	Records        []WorkCalendarLst `json:"records"`
}

/******************************************************************************
 *
 * @Struct Name              : WorkLineArr
 *-----------------------------------------------------------------------------
 *
 * @Description              : WorkCalendarLstInsertReq workCalendarLst 批量插入请求体映射
 *
 * @Author                   : 娄文智
 *
 * @Date                     : 2021-04-15
 *
 ******************************************************************************/
type WorkLineArr struct {
	PlantNr    int        `json:"WorkLine-PlantNr"`
	WorkLineid string     `json:"WorkLine-WorkLineid"`
	Descr      string     `json:"WorkLine-Descr"`
	LineType   string     `json:"WorkLine-LineType"`
	Disabled   bool       `json:"disabled"`
	Childrens  []WorkLine `json:"childrens"`
}

/******************************************************************************
 *
 * @Struct Name              : WorkLineArr
 *-----------------------------------------------------------------------------
 *
 * @Description              : WorkCalendarLstInsertReq workCalendarLst 批量插入请求体映射
 *
 * @Author                   : 娄文智
 *
 * @Date                     : 2021-04-15
 *
 ******************************************************************************/
type WorkLineData struct {
	StartDate  string `json:"startDate"`
	EndDate    string `json:"endDate"`
	WorkLineid string `json:"workLineId"`
}

/******************************************************************************
 *
 * @Struct Name              : ArtData
 *-----------------------------------------------------------------------------
 *
 * @Description              : 物料分配属性
 *
 * @Author                   : 娄文智
 *
 * @Date                     : 2021-05-26
 *
 ******************************************************************************/
type ArtData struct {
	Attribute       `xorm:"extends"`
	ArticleAtcodLst `xorm:"extends"`
}

/******************************************************************************
 *
 * @Struct Name              : ArtData
 *-----------------------------------------------------------------------------
 *
 * @Description              : 物料分配属性
 *
 * @Author                   : 娄文智
 *
 * @Date                     : 2021-05-26
 *
 ******************************************************************************/
type MeOperation struct {
	Operation       `xorm:"extends"`
	Process         `xorm:"extends"`
	ArticleAtcodLst `xorm:"extends"`
}

/******************************************************************************
 *
 * @Struct Name              : ArtData
 *-----------------------------------------------------------------------------
 *
 * @Description              : 物料分配属性
 *
 * @Author                   : 娄文智
 *
 * @Date                     : 2021-05-26
 *
 ******************************************************************************/
type OPCCommunicateData struct {
	OPCBasicComInfo `xorm:"extends"`
	OPCComRule      `xorm:"extends"`
}

/******************************************************************************
 *
 * @Struct Name              : ArtWithAttriValue
 *-----------------------------------------------------------------------------
 *
 * @Description              : ArticleAtcodLst和AttributeValst连表查询
 *
 * @Author                   : zhangxin
 *
 * @Date                     : 2021-08-02
 *
 ******************************************************************************/
type ArtWithAttriValue struct {
	AttributeValst  `xorm:"extends"`
	ArticleAtcodLst `xorm:"extends"`
}

var AccomplishWorkLineMap = map[string]interface{}{
	"G-Frame Assy": nil,
}

// 角色关联产线的前端传入绑定结构体
type RoleRelInsert struct {
	RoleId    int       `json:"roleId"`
	RoleRelLi []RoleRel `json:"roleRelLi"`
}

// ProcessDependOnData 批量插入工序依赖绑定结构体
type ProcessDependOnData struct {
	PO                string            `json:"po"`
	ProcessDependOnLi []ProcessDependOn `json:"processDependOnLi"`
}

// ProcessWorkPlaceData 批量插入工序工位关联关系绑定结构体
type ProcessWorkPlaceData struct {
	PO                    string                `json:"po"`
	ProcessWorkPlaceLstLi []ProcessWorkPlaceLst `json:"processWorkPlaceLstLi"`
}

// WorkLineProcessData 批量插入产线工序关联关系绑定结构体
type WorkLineProcessData struct {
	WorkLineId           string               `json:"workLineId"`
	WorkLineProcessLstLi []WorkLineProcessLst `json:"workLineProcessLstLi"`
}

// 扫码校验插入前端绑定结构体
type ScanRuleInfoData struct {
	OperationId    int            `json:"operationId"`
	ScanRuleInfoLi []ScanRuleInfo `json:"scanRuleInfoLi"`
}

// 指导操作插入前端绑定结构体
type GuideRuleInfoData struct {
	OperationId     int             `json:"operationId"`
	GuideRuleInfoLi []GuideRuleInfo `json:"guideRuleInfoLi"`
}

type ArticleWithAttrValue struct {
	ArticleAtcodLst `xorm:"extends"`
	AttributeValst  `xorm:"extends"`
}

// ArticleRelateAttribute 连表结构体
type ArticleRelateAttribute struct {
	ArticleAtcodLst `xorm:"extends"`
	Attribute       `xorm:"extends"`
}

// ArticleAttribute 连表结构体
type ArticleAttribute struct {
	ArticleAtcodLst `xorm:"extends"`
	Article       `xorm:"extends"`
}

// 物料和产线绑定关系前端传入结构体
type ArtWorkLineData struct {
	ArtID            string           `json:"artId"`
	ArtWorkLineLstLi []ArtWorkLineLst `json:"artWorkLineLstLi"`
}

// 单据打印规则前端传入绑定结构体
type PrintBasicRuleInfoData struct {
	OperationId          int                  `json:"operationId"`
	PrintBasicRuleInfoLi []PrintBasicRuleInfo `json:"printBaseRuleInfoLi"`
}

// 零件校验前端传入结构体
type ArtCheckRuleData struct {
	ArtId          string         `json:"artId"`
	ArtCheckRuleLi []ArtCheckRule `json:"artCheckRuleLi"`
}

// 零件校验前端传入结构体
type ArtQtyAllocateData struct {
	ArtId            string           `json:"artId"`
	ArtQtyAllocateLi []ArtQtyAllocate `json:"artQtyAllocateLi"`
}

/******************************************************************************
 *
 * @Struct Name              : UserViewInfo
 *-----------------------------------------------------------------------------
 *
 * @Description              : 用户信息
 *
 * @Author                   : 娄文智
 *
 * @Date                     : 2021-05-26
 *
 ******************************************************************************/
type UserViewInfo struct {
	PlantNr  int    `json:"User-PlantNr"`
	UserId   string `json:"User-UserId"`
	Name     string `json:"User-Name"`
	NickName string `json:"User-NickName"`
	Phone    string `json:"User-Phone"`
	Email    string `json:"User-Email"`
	Status   string `json:"User-Status"`
	Gender   string `json:"User-Gender"`
	RoleId   int    `json:"User-RoleId"`
	Role     string `json:"User-Role"`
	Remark   string `json:"User-Remark"`
}

type SysUserPwd struct {
	OldPassword string `json:"OldPassword"`
	NewPassword string `json:"NewPassword"`
}

type MenuLable struct {
	Id       int         `json:"id" xorm:"-"`
	Label    string      `json:"label" xorm:"-"`
	Children []MenuLable `json:"children" xorm:"-"`
}

// 工位产线关联关系前端传入绑定结构体
type WorkLineWorkPlaceData struct {
	WorkLineId    string `json:"workLineId"`
	WorkPlaceNrLi []int  `json:"workPlaceNrLi"`
}

type WorkLineWorkPlaceReturnData struct {
	WorkLineWorkPlaceLst
	WorkPlaceDescr string `json:"WorkLineWorkPlaceLst-WorkPlaceDescr"`
}

// PlantDataTree 工厂展示项目到产品的树形结构体
type PlantDataTree struct {
	ItemId   string          `json:"itemId"`
	ItemDesc string          `json:"itemDesc"`
	IsEnd    bool            `json:"isEnd"`
	Children []PlantDataTree `json:"children"`
}

// OperationDataTree 展示工序到工步的树形结构体
type OperationDataTree struct {
	ItemId        interface{}         `json:"itemId"`
	ItemDesc      string              `json:"itemDesc"`
	ItemData      interface{}         `json:"itemData"`
	IsEnd         bool                `json:"isEnd"`
	IsCopy        bool                `json:"isCopy"`
	OperationType string              `json:"operationType"`
	Children      []OperationDataTree `json:"children"`
}

// WorkLineOfPlant 工厂下的产线
type WorkLineOfPlant struct {
	ItemId   interface{}       `json:"itemId"`
	ItemDesc string            `json:"itemDesc"`
	IsEnd    bool              `json:"isEnd"`
	Children []WorkLineOfPlant `json:"children"`
}

// 标签打印
type LabelTemplateData struct {
	LabelTemplateHead   `xorm:"extends"`
	LabelTemplateDetail `xorm:"extends"`
}

// RelateWithWorkPlace 工位和工序连表
type RelateWithWorkPlace struct {
	WorkPlace           `xorm:"extends"`
	ProcessWorkPlaceLst `xorm:"extends"`
}

// PLC 写入plc请求体
type PLC struct {
	PLCType      string      `json:"PlcType"`
	PLCAddress   string      `json:"PlcAddress"`
	ValueAddress string      `json:"ValueAddress"`
	ValueType    string      `json:"ValueType"`
	ValueText    interface{} `json:"ValueText"`
	RetryCount   int         `json:"RetryCount"`
	ByteCount    int         `json:"ByteCount"`
}
