|
|
|
|
package testpage
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
|
|
"gin_server_admin/global"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
//企业微信架构
|
|
|
|
|
|
|
|
|
|
// 分厂于工段
|
|
|
|
|
// 分厂
|
|
|
|
|
type BranchFactory struct {
|
|
|
|
|
Id int64 `json:"id" gorm:"column:bf_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"`
|
|
|
|
|
Name string `json:"name" gorm:"column:bf_name;type:varchar(30);not null;comment:分厂名称"` //'分厂名称',
|
|
|
|
|
Set int8 `json:"state" gorm:"column:bf_set;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` //'状态(1:启用;2:禁用;3:删除)',
|
|
|
|
|
Uid int64 `json:"uid" gorm:"column:bf_uid;type:bigint(20) unsigned;default:0;not null;comment:创建人"` //'创建人',
|
|
|
|
|
Time int64 `json:"time" gorm:"column:bf_time;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` //'0',
|
|
|
|
|
Attribute int64 `json:"attribute" gorm:"column:bf_attribute;type:tinyint(1) unsigned;default:1;not null;comment:属性(1:私有;2:共享)"` //'属性(1:私有;2:共享)',
|
|
|
|
|
Group int64 `json:"group" gorm:"column:bf_group;type:bigint(20) unsigned;default:0;not null;comment:集团公司"` //'集团公司',
|
|
|
|
|
WechatId int `json:"wechatid" gorm:"column:bf_wechat_id;type:int(4) unsigned;default:0;not null;comment:对照微信id"` //'对照微信id',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 分厂关联
|
|
|
|
|
type BranchFactoryHasMany struct {
|
|
|
|
|
Id int64 `json:"id" gorm:"column:bf_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"`
|
|
|
|
|
Name string `json:"name" gorm:"column:bf_name;type:varchar(30);not null;comment:分厂名称"` //'分厂名称',
|
|
|
|
|
Set int8 `json:"state" gorm:"column:bf_set;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` //'状态(1:启用;2:禁用;3:删除)',
|
|
|
|
|
Uid int64 `json:"uid" gorm:"column:bf_uid;type:bigint(20) unsigned;default:0;not null;comment:创建人"` //'创建人',
|
|
|
|
|
Time int64 `json:"time" gorm:"column:bf_time;type:bigint(20) unsigned;default:0;not null;comment:添加时间"` //'0',
|
|
|
|
|
Attribute int8 `json:"attribute" gorm:"column:bf_attribute;type:tinyint(1) unsigned;default:1;not null;comment:属性(1:私有;2:共享)"` //'属性(1:私有;2:共享)',
|
|
|
|
|
Group int64 `json:"group" gorm:"column:bf_group;type:bigint(20) unsigned;default:0;not null;comment:集团公司"` //'集团公司',
|
|
|
|
|
WechatId int64 `json:"wechatid" gorm:"column:bf_wechat_id;type:int(4) unsigned;default:0;not null;comment:对照微信id"` //'对照微信id',
|
|
|
|
|
WorkshopSectionStruct []WorkShopsection `gorm:"foreignKey:ws_bf_id";references:"bf_id"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 工段
|
|
|
|
|
type WorkShopsection struct {
|
|
|
|
|
Id int64 `json:"id" gorm:"column:ws_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"`
|
|
|
|
|
Name string `json:"name" gorm:"column:ws_name;type:varchar(50);not null;comment:工段名称"` //'工段名称',
|
|
|
|
|
Set int8 `json:"state" gorm:"column:ws_set;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` //'状态(1:启用;2:禁用;3:删除)',
|
|
|
|
|
DepartmentId int64 `json:"departmentid" gorm:"column:ws_bf_id;type:bigint(20) unsigned;default:0;not null;comment:归属分厂"` //'归属分厂',
|
|
|
|
|
Time int64 `json:"time" gorm:"column:ws_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` //'创建时间',
|
|
|
|
|
SysUid int64 `json:"sysuid" gorm:"column:ws_sys_uid;type:bigint(50) unsigned;default:0;not null;comment:创建人"` //'创建人',
|
|
|
|
|
EiteTime int64 `json:"eitetime" gorm:"column:ws_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` // '修改时间',
|
|
|
|
|
Group int64 `json:"group" gorm:"column:ws_group;type:bigint(10) unsigned;default:0;not null;comment:归属集团"` //'归属集团',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (BranchFactory *BranchFactory) TableName() string {
|
|
|
|
|
return "branch_factory"
|
|
|
|
|
}
|
|
|
|
|
func (cont *BranchFactory) GetCont(whereMap map[string]interface{}, field ...string) (err error) {
|
|
|
|
|
gormDb := global.GVA_DB_Master.Model(&cont)
|
|
|
|
|
if len(field) > 0 {
|
|
|
|
|
fieldStr := strings.Join(field, ",")
|
|
|
|
|
gormDb = gormDb.Select(fieldStr)
|
|
|
|
|
}
|
|
|
|
|
gormDb = gormDb.Where(whereMap)
|
|
|
|
|
err = gormDb.First(&cont).Error
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (BranchFactoryHasMany *BranchFactoryHasMany) TableName() string {
|
|
|
|
|
return "branch_factory"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (WorkShopsection *WorkShopsection) TableName() string {
|
|
|
|
|
return "work_shopsection"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (cont *WorkShopsection) GetCont(whereMap map[string]interface{}, field ...string) (err error) {
|
|
|
|
|
gormDb := global.GVA_DB_Master.Model(&cont)
|
|
|
|
|
if len(field) > 0 {
|
|
|
|
|
fieldStr := strings.Join(field, ",")
|
|
|
|
|
gormDb = gormDb.Select(fieldStr)
|
|
|
|
|
}
|
|
|
|
|
gormDb = gormDb.Where(whereMap)
|
|
|
|
|
err = gormDb.First(&cont).Error
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 职务
|
|
|
|
|
type Position struct {
|
|
|
|
|
Id int64 `json:"id" gorm:"column:ps_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"`
|
|
|
|
|
Name string `json:"name" gorm:"column:ps_name;type:varchar(50);not null;comment:工段名称"` //工段名称
|
|
|
|
|
Set int8 `json:"state" gorm:"column:ps_set;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` //'状态(1:启用;2:禁用;3:删除)
|
|
|
|
|
WorkId int64 `json:"workid" gorm:"column:ps_ws_id;type:bigint(20) unsigned;default:0;not null;comment:所属工段"` //'所属工段',
|
|
|
|
|
BranchFactoryID int64 `json:"branchFactoryID" gorm:"column:ps_bf_id;type:bigint(20) unsigned;default:0;not null;comment:所属分厂"` //'所属分厂',
|
|
|
|
|
Time int64 `json:"time" gorm:"column:ps_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"` //创建时间
|
|
|
|
|
EiteTime int64 `json:"eitetime" gorm:"column:ps_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"` //'修改时间',
|
|
|
|
|
Sysuid int64 `json:"sysuid" gorm:"column:ps_sys_uid;type:bigint(20) unsigned;default:0;not null;comment:添加人"` //'添加人',
|
|
|
|
|
Weight int64 `json:"weight" gorm:"column:ps_weight;type:smallint(4) unsigned;default:0;not null;comment:权重"`
|
|
|
|
|
Genexa int64 `json:"genexa" gorm:"column:ps_gen_exa;type:tinyint(1) unsigned;default:0;not null;comment:统考(1:是;2:否)"`
|
|
|
|
|
Group int64 `json:"group" gorm:"column:ps_group;type:int(10) unsigned;default:0;not null;comment:归属集团"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (Position *Position) TableName() string {
|
|
|
|
|
return "position"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 班组
|
|
|
|
|
type Teaming struct {
|
|
|
|
|
Id int64 `json:"id" gorm:"column:tm_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"`
|
|
|
|
|
Name string `json:"name" gorm:"column:tm_name;type:varchar(50);not null;comment:班组名称"`
|
|
|
|
|
Time int64 `json:"time" gorm:"column:tm_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
|
|
|
|
|
Set int8 `json:"state" gorm:"column:tm_set;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"`
|
|
|
|
|
Long int64 `json:"long" gorm:"column:tm_long;type:tinyint(1) unsigned;default:0;not null;comment:倒班人员(1:是;2:否)"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (Teaming *Teaming) TableName() string {
|
|
|
|
|
return "teaming"
|
|
|
|
|
}
|