Documentation
¶
Index ¶
- func CreateCommodity(commodity *Commodity) error
- func CreateUser(user *User) error
- func DeleteCommodity(commodityID string) error
- func DeleteCustormerOrder(orderID string) error
- func DeletePurchaseOrder(orderID string) error
- func DeleteUser(userID string) error
- func DisableUserRole(userID string, role RoleType) error
- func EnableUserRole(userID string, role RoleType) error
- func GetUserRole(userID string) ([]string, error)
- func HaveCommodity(id string) bool
- func HaveTel(tel string) bool
- func HaveUser(userID string) bool
- func Init(info *DBInfo)
- func QueryYearFinance(year int) (profit []float32, turnover []float32, orderQuantity []int, err error)
- func UpdateCommodity(commodityID string, commodity *Commodity) error
- func UpdatePassword(userID string, newPassword string) error
- func UpdateUser(userID string, newName, newTel, newPassword, newPosition string) error
- type Commodity
- type CustormerGoods
- type CustormerOrder
- type CustormerOrderInfo
- type DBInfo
- type PurchaseGoods
- type PurchaseOrder
- type PurchaseOrderInfo
- type Role
- type RoleType
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteCustormerOrder ¶
DeleteCustormerOrder 删除客户订单
func DeletePurchaseOrder ¶
DeletePurchaseOrder 删除采购订单
func DisableUserRole ¶
DisableUserRole 更新角色用户权限
func EnableUserRole ¶
EnableUserRole 更新角色用户权限
func QueryYearFinance ¶
func QueryYearFinance(year int) (profit []float32, turnover []float32, orderQuantity []int, err error)
QueryYearFinance 查询年利润,营业额
func UpdateCommodity ¶
UpdateCommodity 更新商品信息
func UpdatePassword ¶
UpdatePassword 更新密码
func UpdateUser ¶
UpdateUser 更新用户信息
Types ¶
type Commodity ¶
type Commodity struct {
ID string `gorm:"primary_key"`
Name string
Colour string
Size string
Brand string
Number uint
PresaleNumber uint
SalesVolume uint
Price float32
PurchasePrice float32
}
Commodity 商品表
func GetCommodities ¶
GetCommodities 获取所有商品信息
func GetCommoditiesWithPurchasePrice ¶
GetCommoditiesWithPurchasePrice 获取所有商品信息(包含进价)
type CustormerGoods ¶
CustormerGoods 客户订单详细商品表
type CustormerOrder ¶
type CustormerOrder struct {
gorm.Model
Operator string `gorm:"size:255"`
Name string
Tel string
DeliveryAddress string
DeliveryTime string
Amount float32
Deposit float32
Remarks string
State string `gorm:"default:'未完成'"`
Freight float32
}
CustormerOrder 客户订单表
type CustormerOrderInfo ¶
type CustormerOrderInfo struct {
CustormerOrder
Goods []Commodity
}
CustormerOrderInfo 与客户端通信的订单信息
func ConfirmCustormerOrder ¶
func ConfirmCustormerOrder(orderID string, freight float32) (*CustormerOrderInfo, error)
ConfirmCustormerOrder 确认订单
func CreateCustormerOrder ¶
func CreateCustormerOrder(order *CustormerOrder, goods []CustormerGoods) (*CustormerOrderInfo, error)
CreateCustormerOrder 创建客户订单
func ListCustormerOrders ¶
func ListCustormerOrders() (orders []CustormerOrderInfo, err error)
ListCustormerOrders 获取所有客户订单
type DBInfo ¶
type DBInfo struct {
Name string `json:"name"`
Password string `json:"password"`
DBname string `json:"DBname"`
Addr string `json:"addr"`
}
DBInfo 数据库连接信息
type PurchaseGoods ¶
PurchaseGoods 采购订单详细产品表
type PurchaseOrder ¶
type PurchaseOrder struct {
gorm.Model
Operator string `gorm:"size:255"`
Remarks string
Amount float32
Freight float32
State string `gorm:"default:'未完成'"`
}
PurchaseOrder 采购订单表
type PurchaseOrderInfo ¶
type PurchaseOrderInfo struct {
PurchaseOrder
Goods []Commodity
}
PurchaseOrderInfo 订单信息
func ConfirmPurchaseOrder ¶
func ConfirmPurchaseOrder(orderID string, freight float32) (*PurchaseOrderInfo, error)
ConfirmPurchaseOrder 确认订单
func CreatePurchaseOrder ¶
func CreatePurchaseOrder(order *PurchaseOrder, goods []PurchaseGoods) (*PurchaseOrderInfo, error)
CreatePurchaseOrder 创建采购订单
func ListPurchaseOrders ¶
func ListPurchaseOrders() (orders []PurchaseOrderInfo, err error)
ListPurchaseOrders 所有订单
Click to show internal directories.
Click to hide internal directories.