feat:完善项目

This commit is contained in:
henry
2021-11-03 17:55:27 +08:00
parent 62c2dda714
commit af976f83c1
14 changed files with 376 additions and 27 deletions

View File

@ -42,14 +42,13 @@ func initModel() {
return &model.SysUser{Account: "admin", Name: "超级管理员", Mobile: "13888888888", Password: "123456",
IsAdmin: model.SysUserAdministratorForAdmin, Remark: "超级管理员"}
}},
&synchronized{iModel: model.NewSysUserTenant()},
&synchronized{iModel: model.NewSysDepartment()},
&synchronized{iModel: model.NewSysRole()}, &synchronized{iModel: model.NewSysRoleMenu()}, &synchronized{iModel: model.NewSysRoleAuth()},
&synchronized{iModel: model.NewSysUserRole()},
// 日志管理
&synchronized{iModel: model.NewSysLog()}, &synchronized{iModel: model.NewSysUserLoginLog()},
// 功能信息
&synchronized{iModel: model.NewManageSupplier()},
&synchronized{iModel: model.NewManageMaterial()}, &synchronized{iModel: model.NewManageMaterialPurchase()},
)
}
func initCacheMode() {

View File

@ -4,6 +4,7 @@ package model
type ManageEquipment struct {
Model
ModelTenant
Code string `gorm:"column:code;type:varchar(35);default:null;comment:编号" json:"code"`
Title string `gorm:"column:title;type:varchar(100);default:null;comment:名称" json:"title"`
Image
Config string `gorm:"column:config;type:varchar(255);default:null;comment:配置" json:"config"`

View File

@ -4,15 +4,26 @@ package model
type ManageMaterial struct {
Model
ModelTenant
SupplierID uint64 `gorm:"column:supplier_id;type:int;default:0;comment:供应商ID" json:"supplier_id"`
SupplierID uint64 `gorm:"column:supplier_id;type:int;default:0;comment:供应商ID" json:""`
Code string `gorm:"column:code;type:varchar(35);default:null;comment:编号" json:"code"`
Title string `gorm:"column:title;type:varchar(100);default:null;comment:名称" json:"title"`
Image
Unit int `gorm:"column:unit;type:tinyint(1);default:0;comment:单位" json:"unit"`
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注" json:"remark"`
Stock int `gorm:"column:stock;type:int(8);default:0;comment:库存数" json:"stock"`
FrozenStock int `gorm:"column:frozen_stock;type:int(8);default:0;comment:冻结的库存数" json:"-"`
Unit ManageMaterialUnit `gorm:"column:unit;type:tinyint(1);default:0;comment:单位" json:"unit"`
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注" json:"remark"`
ModelDeleted
ModelAt
}
// ManageMaterialUnit 单位类型
type ManageMaterialUnit int
const (
// ManageMaterialUnitForIndividual 个
ManageMaterialUnitForIndividual ManageMaterialUnit = iota + 1
)
func (m *ManageMaterial) TableName() string {
return "manage_material"
}

View File

@ -3,10 +3,11 @@ package model
// ManageMaterialPurchase 维修器材采购数据明细
type ManageMaterialPurchase struct {
Model
OrderNo string `gorm:"column:order_no;type:varchar(20);default:null;comment:采购单号" json:"order_no"`
MaterialID uint64 `gorm:"column:material_id;type:int(6);default:0;comment:器材ID" json:"material_id"`
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
OrderNo string `gorm:"column:order_no;type:varchar(30);default:null;comment:采购单号" json:"order_no"`
MaterialID uint64 `gorm:"column:material_id;type:int(6);default:0;comment:器材ID" json:"-"`
Price float64 `gorm:"column:price;type:decimal(10,2);default:0;comment:采购单价" json:"price"`
Number int `gorm:"column:number;type:int(6);default:0;comment:采购数量" json:"number"`
Number int `gorm:"column:number;type:int(8);default:0;comment:采购数量" json:"number"`
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:采购备注" json:"remark"`
ModelDeleted
ModelAt

View File

@ -3,9 +3,10 @@ package model
// ManageMaterialWarehouse 维修器材采购入库明细
type ManageMaterialWarehouse struct {
Model
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
OrderNo string `gorm:"column:order_no;type:varchar(20);default:null;comment:采购单号" json:"order_no"`
MaterialPurchaseID uint64 `gorm:"column:material_purchase_id;type:int(11);default:0;comment:器材采购ID" json:"material_purchase_id"`
Number int `gorm:"column:number;type:int(6);default:0;comment:入库数量" json:"number"`
Number int `gorm:"column:number;type:int(8);default:0;comment:入库数量" json:"number"`
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:入库备注" json:"remark"`
ModelDeleted
ModelAt

View File

@ -1,7 +1,11 @@
package model
// ManageMaterialWork 维修器材工单明细
type ManageMaterialWork struct {
Model
WorkID uint64 `gorm:"column:work_id;type:int(11);default:0;comment:工单ID" json:"work_id"`
MaterialPurchaseID uint64 `gorm:"column:material_purchase_id;type:int(11);default:0;comment:器材采购ID" json:"material_purchase_id"`
Number int `json:"number"`
ModelDeleted
ModelAt
}