商品添加多视图
This commit is contained in:
parent
0f1f05a655
commit
4f6b68b58f
@ -7,43 +7,44 @@ import (
|
|||||||
|
|
||||||
// ProductBook 商品书籍分表(按ISBN后两位分表 product_book_00 ~ product_book_99)
|
// ProductBook 商品书籍分表(按ISBN后两位分表 product_book_00 ~ product_book_99)
|
||||||
type ProductBook struct {
|
type ProductBook struct {
|
||||||
ID int64 `json:"id" gorm:"primarykey;comment:自增ID"`
|
ID int64 `json:"id" gorm:"primarykey;comment:自增ID"` // 自增ID
|
||||||
SelfID int64 `json:"self_id" gorm:"not null;default:0;comment:再分库商品表中的商品ID"`
|
SelfID int64 `json:"self_id" gorm:"not null;default:0;comment:再分库商品表中的商品ID"` // 再分库商品表中的商品ID
|
||||||
CategoryID int64 `json:"category_id" gorm:"not null;default:0;comment:分类ID"`
|
CategoryID int64 `json:"category_id" gorm:"not null;default:0;comment:分类ID"` // 分类ID
|
||||||
AboutId int64 `json:"about_id" gorm:"not null;default:0;index;comment:关联ID"`
|
AboutId int64 `json:"about_id" gorm:"not null;default:0;index;comment:关联ID"` // 关联ID
|
||||||
WarehouseID int64 `json:"warehouse_id" gorm:"not null;default:0;index;comment:仓库ID"`
|
WarehouseID int64 `json:"warehouse_id" gorm:"not null;default:0;index;comment:仓库ID"` // 仓库ID
|
||||||
WarehouseName string `json:"warehouse_name" gorm:"size:100;not null;default:'';comment:仓库名称"`
|
WarehouseName string `json:"warehouse_name" gorm:"size:100;not null;default:'';comment:仓库名称"` // 仓库名称
|
||||||
LocationID int64 `json:"location_id" gorm:"not null;default:0;index;comment:货位ID"`
|
LocationID int64 `json:"location_id" gorm:"not null;default:0;index;comment:货位ID"` // 货位ID
|
||||||
LocationName string `json:"location_name" gorm:"size:50;not null;default:'';comment:货位名称"`
|
LocationName string `json:"location_name" gorm:"size:50;not null;default:'';comment:货位名称"` // 货位名称
|
||||||
StandardProductID int64 `json:"standard_product_id" gorm:"not null;default:0;index;comment:关联标品ID"`
|
StandardProductID int64 `json:"standard_product_id" gorm:"not null;default:0;index;comment:关联标品ID"` // 关联标品ID
|
||||||
Fid int64 `json:"fid" gorm:"not null;default:0;comment:父级ID"`
|
Fid int64 `json:"fid" gorm:"not null;default:0;comment:父级ID"` // 父级ID
|
||||||
Type int8 `json:"type" gorm:"not null;default:0;comment:类型 1正常 2套装书 3一号多书 4无书号"`
|
Type int8 `json:"type" gorm:"not null;default:0;comment:类型 1正常 2套装书 3一号多书 4无书号"` // 类型
|
||||||
ISBN string `json:"isbn" gorm:"size:20;not null;default:'';index:idx_isbn;comment:ISBN"`
|
ISBN string `json:"isbn" gorm:"size:20;not null;default:'';index:idx_isbn;comment:ISBN"` // ISBN
|
||||||
FISBN string `json:"f_isbn" gorm:"size:20;not null;default:'';comment:FISBN"`
|
FISBN string `json:"f_isbn" gorm:"size:20;not null;default:'';comment:FISBN"` // FISBN
|
||||||
BookName string `json:"book_name" gorm:"size:100;not null;default:'';comment:书名"`
|
BookName string `json:"book_name" gorm:"size:100;not null;default:'';comment:书名"` // 书名
|
||||||
FBookName string `json:"f_book_name" gorm:"size:100;not null;default:'';comment:副书名"`
|
FBookName string `json:"f_book_name" gorm:"size:100;not null;default:'';comment:副书名"` // 副书名
|
||||||
Author string `json:"author" gorm:"size:100;not null;default:'';comment:作者"`
|
Author string `json:"author" gorm:"size:100;not null;default:'';comment:作者"` // 作者
|
||||||
Publishing string `json:"publishing" gorm:"size:50;not null;default:'';comment:出版社"`
|
Publishing string `json:"publishing" gorm:"size:50;not null;default:'';comment:出版社"` // 出版社
|
||||||
PublicationTime int64 `json:"publication_time" gorm:"type:bigint;not null;default:0;comment:出版日期时间戳"`
|
PublicationTime int64 `json:"publication_time" gorm:"type:bigint;not null;default:0;comment:出版日期时间戳"` // 出版日期时间戳
|
||||||
Binding string `json:"binding" gorm:"size:10;not null;default:'';comment:装帧"`
|
Binding string `json:"binding" gorm:"size:10;not null;default:'';comment:装帧"` // 装帧
|
||||||
PagesCount int64 `json:"pages_count" gorm:"not null;default:0;comment:页数"`
|
PagesCount int64 `json:"pages_count" gorm:"not null;default:0;comment:页数"` // 页数
|
||||||
WordsCount int64 `json:"words_count" gorm:"not null;default:0;comment:字数"`
|
WordsCount int64 `json:"words_count" gorm:"not null;default:0;comment:字数"` // 字数
|
||||||
Format int64 `json:"format" gorm:"not null;default:0;comment:开本"`
|
Format int64 `json:"format" gorm:"not null;default:0;comment:开本"` // 开本
|
||||||
CatID datatypes.JSON `json:"cat_id" gorm:"type:json;not null;comment:类目json"`
|
CatID datatypes.JSON `json:"cat_id" gorm:"type:json;not null;comment:类目json"` // 类目json
|
||||||
Name string `json:"name" gorm:"size:255;not null;default:'';comment:商品名称"`
|
Name string `json:"name" gorm:"size:255;not null;default:'';comment:商品名称"` // 商品名称
|
||||||
Appearance int64 `json:"appearance" gorm:"not null;default:0;comment:品相"`
|
Appearance int64 `json:"appearance" gorm:"not null;default:0;comment:品相"` // 品相
|
||||||
Barcode string `json:"barcode" gorm:"size:100;not null;default:'';index;comment:条码"`
|
Barcode string `json:"barcode" gorm:"size:100;not null;default:'';index;comment:条码"` // 条码
|
||||||
Price int64 `json:"price" gorm:"not null;default:0;comment:价格"`
|
Price int64 `json:"price" gorm:"not null;default:0;comment:价格"` // 价格
|
||||||
SalePrice int64 `json:"sale_price" gorm:"not null;default:0;comment:书价"`
|
SalePrice int64 `json:"sale_price" gorm:"not null;default:0;comment:书价"` // 书价
|
||||||
Cost int64 `json:"cost" gorm:"not null;default:0;comment:最低运费"`
|
Cost int64 `json:"cost" gorm:"not null;default:0;comment:最低运费"` // 最低运费
|
||||||
Stock int64 `json:"stock" gorm:"not null;default:0;comment:库存"`
|
Stock int64 `json:"stock" gorm:"not null;default:0;comment:库存"` // 库存
|
||||||
LiveImage datatypes.JSON `json:"live_image" gorm:"type:json;not null;comment:实拍图json"`
|
|
||||||
IsBatchManaged int8 `json:"is_batch_managed" gorm:"type:tinyint(1);not null;default:0;comment:是否批次管理(0:否,1:是)"`
|
LiveImage datatypes.JSON `json:"live_image" gorm:"type:json;not null;comment:实拍图json"` // 实拍图json
|
||||||
IsShelfLifeManaged int8 `json:"is_shelf_life_managed" gorm:"type:tinyint(1);not null;default:0;comment:是否效期管理(0:否,1:是)"`
|
IsBatchManaged int8 `json:"is_batch_managed" gorm:"type:tinyint(1);not null;default:0;comment:是否批次管理(0:否,1:是)"` // 是否批次管理(0:否,1:是)
|
||||||
Status int8 `json:"status" gorm:"type:tinyint(1);not null;default:1;comment:状态(0:禁用,1:启用)"`
|
IsShelfLifeManaged int8 `json:"is_shelf_life_managed" gorm:"type:tinyint(1);not null;default:0;comment:是否效期管理(0:否,1:是)"` // 是否效期管理(0:否,1:是)
|
||||||
CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;comment:创建时间戳"`
|
Status int8 `json:"status" gorm:"type:tinyint(1);not null;default:1;comment:状态(0:禁用,1:启用)"` // 状态(0:禁用,1:启用)
|
||||||
UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;not null;default:0;comment:更新时间戳"`
|
CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;comment:创建时间戳"` // 创建时间戳
|
||||||
IsDel int8 `json:"is_del" gorm:"not null;default:0;comment:逻辑删除"`
|
UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;not null;default:0;comment:更新时间戳"` // 更新时间戳
|
||||||
|
IsDel int8 `json:"is_del" gorm:"not null;default:0;comment:逻辑删除"` // 逻辑删除
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ProductBook) TableName() string {
|
func (ProductBook) TableName() string {
|
||||||
|
|||||||
@ -2,45 +2,45 @@ package request
|
|||||||
|
|
||||||
// QueryAllLocationRequest 查询所有库位请求(仓库ID可选)
|
// QueryAllLocationRequest 查询所有库位请求(仓库ID可选)
|
||||||
type QueryAllLocationRequest struct {
|
type QueryAllLocationRequest struct {
|
||||||
WarehouseID *int64 `json:"warehouse_id" form:"warehouse_id"`
|
WarehouseID *int64 `json:"warehouse_id" form:"warehouse_id"` // 仓库ID
|
||||||
Code string `json:"code" form:"code"`
|
Code string `json:"code" form:"code"` // 编码
|
||||||
Type *int8 `json:"type" form:"type"`
|
Type *int8 `json:"type" form:"type"` // 类型
|
||||||
Status *int8 `json:"status" form:"status"`
|
Status *int8 `json:"status" form:"status"` // 状态
|
||||||
Page int `json:"page" form:"page,default=1"`
|
Page int `json:"page" form:"page,default=1"` // 页码
|
||||||
PageSize int `json:"page_size" form:"page_size,default=10"`
|
PageSize int `json:"page_size" form:"page_size,default=10"` // 每页数量
|
||||||
}
|
}
|
||||||
|
|
||||||
type QueryLocationRequest struct {
|
type QueryLocationRequest struct {
|
||||||
WarehouseID int64 `json:"warehouse_id" form:"warehouse_id" binding:"required"`
|
WarehouseID int64 `json:"warehouse_id" form:"warehouse_id" binding:"required"` // 仓库ID
|
||||||
Code string `json:"code" form:"code"`
|
Code string `json:"code" form:"code"` // 编码
|
||||||
Type *int8 `json:"type" form:"type"`
|
Type *int8 `json:"type" form:"type"` // 类型
|
||||||
Status *int8 `json:"status" form:"status"`
|
Status *int8 `json:"status" form:"status"` // 状态
|
||||||
Page int `json:"page" form:"page,default=1"`
|
Page int `json:"page" form:"page,default=1"` // 页码
|
||||||
PageSize int `json:"page_size" form:"page_size,default=10"`
|
PageSize int `json:"page_size" form:"page_size,default=10"` // 每页数量
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateLocationRequest struct {
|
type CreateLocationRequest struct {
|
||||||
WarehouseID int64 `form:"warehouse_id" binding:"required"`
|
WarehouseID int64 `form:"warehouse_id" binding:"required"` // 仓库ID
|
||||||
Code string `form:"code" binding:"required,max=50"`
|
Code string `form:"code" binding:"required,max=50"` // 编码
|
||||||
Type int8 `form:"type" binding:"required"`
|
Type int8 `form:"type" binding:"required"` // 类型
|
||||||
Capacity int64 `form:"capacity" binding:"required"`
|
Capacity int64 `form:"capacity" binding:"required"` // 容量
|
||||||
Status int8 `form:"status" binding:"required"`
|
Status int8 `form:"status" binding:"required"` // 状态
|
||||||
}
|
}
|
||||||
|
|
||||||
type BatchGenerateLocationRequest struct {
|
type BatchGenerateLocationRequest struct {
|
||||||
WarehouseID int64 `form:"warehouse_id" binding:"required"`
|
WarehouseID int64 `form:"warehouse_id" binding:"required"` // 仓库ID
|
||||||
Groups []GroupConfig `form:"groups[]"`
|
Groups []GroupConfig `form:"groups[]"` // 分组
|
||||||
Type int8 `form:"type"`
|
Type int8 `form:"type"` // 类型
|
||||||
Capacity int64 `form:"capacity"`
|
Capacity int64 `form:"capacity"` // 容量
|
||||||
Status int8 `form:"status"`
|
Status int8 `form:"status"` // 状态
|
||||||
}
|
}
|
||||||
|
|
||||||
type GroupConfig struct {
|
type GroupConfig struct {
|
||||||
FormatType int `form:"format_type" binding:"required,oneof=1 2 3 4"`
|
FormatType int `form:"format_type" binding:"required,oneof=1 2 3 4"` // 格式类型
|
||||||
StartValue string `form:"start_value" binding:"required"`
|
StartValue string `form:"start_value" binding:"required"` // 起始值
|
||||||
EndValue string `form:"end_value" binding:"required"`
|
EndValue string `form:"end_value" binding:"required"` // 结束值
|
||||||
PaddingLen int `form:"padding_len"`
|
PaddingLen int `form:"padding_len"` // 填充长度
|
||||||
Separator string `form:"separator" binding:"max=5"`
|
Separator string `form:"separator" binding:"max=5"` // 分隔符
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateLocationRequest struct {
|
type UpdateLocationRequest struct {
|
||||||
@ -54,72 +54,72 @@ type UpdateLocationRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type DeleteLocationRequest struct {
|
type DeleteLocationRequest struct {
|
||||||
IDs []int64 `form:"ids[]"`
|
IDs []int64 `form:"ids[]"` // 库位ID
|
||||||
}
|
}
|
||||||
type GetLocationIdRequest struct {
|
type GetLocationIdRequest struct {
|
||||||
Code string `form:"code"`
|
Code string `form:"code"` // 库位编码
|
||||||
WarehouseCode string `form:"warehouse_code"`
|
WarehouseCode string `form:"warehouse_code"` // 仓库编码
|
||||||
}
|
}
|
||||||
|
|
||||||
type SyncLocationRequest struct {
|
type SyncLocationRequest struct {
|
||||||
UserID int64 `json:"user_id" binding:"required"`
|
UserID int64 `json:"user_id" binding:"required"` // 用户ID
|
||||||
Data []SyncLocationAreaRequest `json:"data" binding:"required"`
|
Data []SyncLocationAreaRequest `json:"data" binding:"required"` // 库位数据
|
||||||
}
|
}
|
||||||
|
|
||||||
type SyncLocationAreaRequest struct {
|
type SyncLocationAreaRequest struct {
|
||||||
Code string `json:"code" binding:"required"`
|
Code string `json:"code" binding:"required"` // 库位编码
|
||||||
Name string `json:"name" binding:"required"`
|
Name string `json:"name" binding:"required"` // 库位名称
|
||||||
TemplateId int64 `json:"templateId" binding:"required"`
|
TemplateId int64 `json:"templateId" binding:"required"` // 模板ID
|
||||||
Status string `json:"status" binding:"required"`
|
Status string `json:"status" binding:"required"` // 状态
|
||||||
Logistics SyncLogisticsRequest `json:"logistics" binding:"required"`
|
Logistics SyncLogisticsRequest `json:"logistics" binding:"required"` // 物流信息
|
||||||
Data []SyncLocationItemRequest `json:"data" binding:"required"`
|
Data []SyncLocationItemRequest `json:"data" binding:"required"` // 库位数据
|
||||||
}
|
}
|
||||||
|
|
||||||
type SyncLogisticsRequest struct {
|
type SyncLogisticsRequest struct {
|
||||||
Id int64 `json:"id"`
|
Id int64 `json:"id"` // 物流ID
|
||||||
TemplateName string `json:"templateName" binding:"required"`
|
TemplateName string `json:"templateName" binding:"required"` // 模板名称
|
||||||
DeliveryProvince string `json:"deliveryProvince" binding:"required"`
|
DeliveryProvince string `json:"deliveryProvince" binding:"required"` // 发货省
|
||||||
DeliveryCity string `json:"deliveryCity" binding:"required"`
|
DeliveryCity string `json:"deliveryCity" binding:"required"` // 发货市
|
||||||
DeliveryArea string `json:"deliveryArea" binding:"required"`
|
DeliveryArea string `json:"deliveryArea" binding:"required"` // 发货区
|
||||||
DeliveryAddress string `json:"deliveryAddress" binding:"required"`
|
DeliveryAddress string `json:"deliveryAddress" binding:"required"` // 发货地址
|
||||||
PricingMethod string `json:"pricingMethod" binding:"required"`
|
PricingMethod string `json:"pricingMethod" binding:"required"` // 计费方式
|
||||||
Shipping string `json:"shipping" binding:"required"`
|
Shipping string `json:"shipping" binding:"required"` // 配送方式
|
||||||
FirWbv float64 `json:"firWbv"`
|
FirWbv float64 `json:"firWbv"` // 首重
|
||||||
FirPrice float64 `json:"firPrice"`
|
FirPrice float64 `json:"firPrice"` // 首费
|
||||||
ContinueWbv float64 `json:"continueWbv"`
|
ContinueWbv float64 `json:"continueWbv"` // 续重
|
||||||
ContinuePrice float64 `json:"continuePrice"`
|
ContinuePrice float64 `json:"continuePrice"` // 续费
|
||||||
CreateBy int64 `json:"createBy"`
|
CreateBy int64 `json:"createBy"` // 创建人
|
||||||
CreateTime string `json:"createTime"`
|
CreateTime string `json:"createTime"` // 创建时间
|
||||||
UpdateBy int64 `json:"updateBy"`
|
UpdateBy int64 `json:"updateBy"` // 更新人
|
||||||
UpdateTime string `json:"updateTime"`
|
UpdateTime string `json:"updateTime"` // 更新时间
|
||||||
Status string `json:"status"`
|
Status string `json:"status"` // 状态
|
||||||
DelFlag string `json:"delFlag"`
|
DelFlag string `json:"delFlag"` // 删除标记
|
||||||
TenantId string `json:"tenantId"`
|
TenantId string `json:"tenantId"` // 租户ID
|
||||||
CreateDept int64 `json:"createDept"`
|
CreateDept int64 `json:"createDept"` // 创建部门
|
||||||
ShippingRange string `json:"shippingRange"`
|
ShippingRange string `json:"shippingRange"` // 配送范围
|
||||||
WarehouseId int64 `json:"warehouseId"`
|
WarehouseId int64 `json:"warehouseId"` // 仓库
|
||||||
Remark string `json:"remark"`
|
Remark string `json:"remark"` // 备注
|
||||||
PhoneNumber int64 `json:"phoneNumber"`
|
PhoneNumber int64 `json:"phoneNumber"` // 手机号
|
||||||
Contact string `json:"contact"`
|
Contact string `json:"contact"` // 联系人
|
||||||
FullAddress string `json:"fullAddress"`
|
FullAddress string `json:"fullAddress"` // 全地址
|
||||||
}
|
}
|
||||||
|
|
||||||
type SyncLocationItemRequest struct {
|
type SyncLocationItemRequest struct {
|
||||||
Code string `json:"code" binding:"required"`
|
Code string `json:"code" binding:"required"` // 编码
|
||||||
SheQuantityMax int64 `json:"sheQuantityMax" binding:"required"`
|
SheQuantityMax int64 `json:"sheQuantityMax" binding:"required"` // 最大数量
|
||||||
}
|
}
|
||||||
|
|
||||||
type SyncGoodsRequest struct {
|
type SyncGoodsRequest struct {
|
||||||
UserID int64 `json:"user_id" binding:"required"`
|
UserID int64 `json:"user_id" binding:"required"` // 用户ID
|
||||||
Data []SyncGoodsItem `json:"data" binding:"required"`
|
Data []SyncGoodsItem `json:"data" binding:"required"` // 商品数据
|
||||||
}
|
}
|
||||||
|
|
||||||
type SyncGoodsItem struct {
|
type SyncGoodsItem struct {
|
||||||
GoodsName string `json:"goods_name" binding:"required"`
|
GoodsName string `json:"goods_name" binding:"required"` // 商品名称
|
||||||
ISBN string `json:"isbn" binding:"required"`
|
ISBN string `json:"isbn" binding:"required"` // ISBN
|
||||||
Price int64 `json:"price" binding:"required"`
|
Price int64 `json:"price" binding:"required"` // 价格
|
||||||
Appearance string `json:"appearance" binding:"required"`
|
Appearance string `json:"appearance" binding:"required"` // 外观
|
||||||
LiveImage []string `json:"live_image" binding:"required"`
|
LiveImage []string `json:"live_image" binding:"required"` // 图片
|
||||||
LocationCode string `json:"location_code" binding:"required"`
|
LocationCode string `json:"location_code" binding:"required"` // 库位编码
|
||||||
Inventory int64 `json:"inventory" binding:"required"`
|
Inventory int64 `json:"inventory" binding:"required"` // 库存
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,9 +28,9 @@ type WaveRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type WaveItemRequest struct {
|
type WaveItemRequest struct {
|
||||||
ProductID int64 `form:"product_id" binding:"required"`
|
ProductID int64 `form:"product_id" binding:"required"` // 商品ID
|
||||||
Quantity int64 `form:"quantity" binding:"required,gt=0"`
|
Quantity int64 `form:"quantity" binding:"required,gt=0"` // 数量
|
||||||
UnitPrice int64 `form:"unit_price" binding:"required,gt=0"`
|
UnitPrice int64 `form:"unit_price" binding:"required,gt=0"` // 单价
|
||||||
}
|
}
|
||||||
|
|
||||||
type BindWaveRequest struct {
|
type BindWaveRequest struct {
|
||||||
@ -41,7 +41,7 @@ type BindWaveRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type GetIdRequest struct {
|
type GetIdRequest struct {
|
||||||
ID int64 `form:"id" binding:"required"`
|
ID int64 `form:"id" binding:"required"` // ID
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReceivingSubmitRequest struct {
|
type ReceivingSubmitRequest struct {
|
||||||
@ -52,72 +52,72 @@ type ReceivingSubmitRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ReceivingItemRequest struct {
|
type ReceivingItemRequest struct {
|
||||||
ProductID int64 `form:"product_id" binding:"required"`
|
ProductID int64 `form:"product_id" binding:"required"` // 商品ID
|
||||||
LocationID int64 `form:"location_id" binding:"required"`
|
LocationID int64 `form:"location_id" binding:"required"` // 仓库ID
|
||||||
BatchNo string `form:"batch_no" binding:"required"`
|
BatchNo string `form:"batch_no" binding:"required"` // 批次号
|
||||||
ProductionDate int64 `form:"production_date"`
|
ProductionDate int64 `form:"production_date"` // 生产日期
|
||||||
ExpiryDate int64 `form:"expiry_date"`
|
ExpiryDate int64 `form:"expiry_date"` // 到期日期
|
||||||
Quantity int64 `form:"quantity" binding:"required,gt=0"`
|
Quantity int64 `form:"quantity" binding:"required,gt=0"` // 数量
|
||||||
//SerialNumbers []string `form:"serial_numbers"`
|
//SerialNumbers []string `form:"serial_numbers"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SalesOrderCreateRequest struct {
|
type SalesOrderCreateRequest struct {
|
||||||
AboutId int64 `form:"about_id"`
|
AboutId int64 `form:"about_id"` // 关联ID
|
||||||
AssociationOrderID int64 `form:"association_order_id" binding:"required"`
|
AssociationOrderID int64 `form:"association_order_id" binding:"required"` // 关联订单ID
|
||||||
AssociationOrderNo string `form:"association_order_no" binding:"required"`
|
AssociationOrderNo string `form:"association_order_no" binding:"required"` // 关联订单号
|
||||||
FromType int8 `form:"from_type"`
|
FromType int8 `form:"from_type"` // 来源类型
|
||||||
ShopType int8 `form:"shop_type"`
|
ShopType int8 `form:"shop_type"` // 店铺类型
|
||||||
CustomerID int64 `form:"customer_id"`
|
CustomerID int64 `form:"customer_id"` // 客户ID
|
||||||
RequiredDeliveryDate int64 `form:"required_delivery_date"`
|
RequiredDeliveryDate int64 `form:"required_delivery_date"` // 要求发货时间
|
||||||
Remark string `form:"remark"`
|
Remark string `form:"remark"` // 备注
|
||||||
SalesPerson string `form:"sales_person"`
|
SalesPerson string `form:"sales_person"` // 销售人员
|
||||||
SalesPersonID int64 `form:"sales_person_id"`
|
SalesPersonID int64 `form:"sales_person_id"` // 销售人员ID
|
||||||
ReceiverName string `form:"receiver_name"`
|
ReceiverName string `form:"receiver_name"` // 收货人
|
||||||
ReceiverPhone string `form:"receiver_phone"`
|
ReceiverPhone string `form:"receiver_phone"` // 收货人电话
|
||||||
ReceiverAddress string `form:"receiver_address"`
|
ReceiverAddress string `form:"receiver_address"` // 收货地址
|
||||||
IsDistribution int8 `form:"is_distribution"`
|
IsDistribution int8 `form:"is_distribution"` // 是否分销
|
||||||
Items []SalesOrderItemRequest `form:"items[]"`
|
Items []SalesOrderItemRequest `form:"items[]"` // 销售订单项
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateOutboundOrderRequest 基于销售订单创建出库单请求
|
// CreateOutboundOrderRequest 基于销售订单创建出库单请求
|
||||||
type CreateOutboundOrderRequest struct {
|
type CreateOutboundOrderRequest struct {
|
||||||
SalesOrderIDs []int64 `form:"order_ids[]"`
|
SalesOrderIDs []int64 `form:"order_ids[]"` // 销售订单ID
|
||||||
Total int `form:"total"`
|
Total int `form:"total"` // 销售订单数量
|
||||||
Remark string `form:"remark"`
|
Remark string `form:"remark"` // 备注
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateOutboundWaveRequest struct {
|
type CreateOutboundWaveRequest struct {
|
||||||
OutboundOrderID int64 `form:"outbound_order_id" binding:"required"`
|
OutboundOrderID int64 `form:"outbound_order_id" binding:"required"` // 出库单ID
|
||||||
}
|
}
|
||||||
|
|
||||||
type SalesOrderItemRequest struct {
|
type SalesOrderItemRequest struct {
|
||||||
ProductID int64 `form:"product_id" binding:"required"`
|
ProductID int64 `form:"product_id" binding:"required"` // 商品ID
|
||||||
Quantity int64 `form:"quantity" binding:"required,gt=0"`
|
Quantity int64 `form:"quantity" binding:"required,gt=0"` // 数量
|
||||||
UnitPrice int64 `form:"unit_price" binding:"required,gt=0"`
|
UnitPrice int64 `form:"unit_price" binding:"required,gt=0"` // 单价
|
||||||
}
|
}
|
||||||
|
|
||||||
type OutboundSubmitRequest struct {
|
type OutboundSubmitRequest struct {
|
||||||
OutboundOrderID int64 `form:"outbound_order_id" binding:"required"`
|
OutboundOrderID int64 `form:"outbound_order_id" binding:"required"` // 出库单ID
|
||||||
WaveTaskID int64 `form:"wave_task_id" binding:"required"`
|
WaveTaskID int64 `form:"wave_task_id" binding:"required"` // 波次ID
|
||||||
Force int8 `form:"force"`
|
Force int8 `form:"force"` // 强制
|
||||||
Items []OutboundItemRequest `form:"items[]"`
|
Items []OutboundItemRequest `form:"items[]"` // 出库单项
|
||||||
}
|
}
|
||||||
|
|
||||||
type OutboundItemRequest struct {
|
type OutboundItemRequest struct {
|
||||||
ProductID int64 `form:"product_id" binding:"required"`
|
ProductID int64 `form:"product_id" binding:"required"` // 商品ID
|
||||||
LocationID int64 `form:"location_id" binding:"required"`
|
LocationID int64 `form:"location_id" binding:"required"` // 仓库ID
|
||||||
BatchNo string `form:"batch_no"`
|
BatchNo string `form:"batch_no"` // 批次号
|
||||||
ProductionDate int64 `form:"production_date"`
|
ProductionDate int64 `form:"production_date"` // 生产日期
|
||||||
ExpiryDate int64 `form:"expiry_date"`
|
ExpiryDate int64 `form:"expiry_date"` // 到期日期
|
||||||
Quantity int64 `form:"quantity" binding:"required,gt=0"`
|
Quantity int64 `form:"quantity" binding:"required,gt=0"` // 数量
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateShippingOrderRequest 基于出库单创建发货单请求
|
// CreateShippingOrderRequest 基于出库单创建发货单请求
|
||||||
type CreateShippingOrderRequest struct {
|
type CreateShippingOrderRequest struct {
|
||||||
OutboundOrderIDs []int64 `form:"order_ids[]"`
|
OutboundOrderIDs []int64 `form:"order_ids[]"` // 出库单ID
|
||||||
Total int `form:"total"`
|
Total int `form:"total"` // 出库单数量
|
||||||
ExpectedArriveTime *int64 `form:"expected_arrive_time"`
|
ExpectedArriveTime *int64 `form:"expected_arrive_time"` // 预计到达时间
|
||||||
Remark string `form:"remark"`
|
Remark string `form:"remark"` // 备注
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateShippingLogisticsRequest 更新发货单物流信息请求
|
// UpdateShippingLogisticsRequest 更新发货单物流信息请求
|
||||||
@ -130,11 +130,11 @@ type UpdateShippingLogisticsRequest struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CancelSalesOrderRequest struct {
|
type CancelSalesOrderRequest struct {
|
||||||
OrderID int64 `form:"order_id" binding:"required"`
|
OrderID int64 `form:"order_id" binding:"required"` // 订单ID
|
||||||
}
|
}
|
||||||
|
|
||||||
type CancelOutboundWaveRequest struct {
|
type CancelOutboundWaveRequest struct {
|
||||||
WaveID int64 `form:"wave_id" binding:"required"`
|
WaveID int64 `form:"wave_id" binding:"required"` // 波次ID
|
||||||
}
|
}
|
||||||
|
|
||||||
// StockCheckAdjustRequest 盘库调整请求(加库存/减库存)
|
// StockCheckAdjustRequest 盘库调整请求(加库存/减库存)
|
||||||
|
|||||||
@ -2,17 +2,21 @@ package request
|
|||||||
|
|
||||||
// ProductRequest 创建商品请求
|
// ProductRequest 创建商品请求
|
||||||
type ProductRequest struct {
|
type ProductRequest struct {
|
||||||
ID int64 `form:"id"` // 商品ID
|
ID int64 `form:"id"` // 商品ID
|
||||||
CategoryID int64 `form:"category_id"` // 分类ID
|
CategoryID int64 `form:"category_id"` // 分类ID
|
||||||
StandardProductID int64 `form:"standard_product_id"` // 标准商品ID
|
StandardProductID int64 `form:"standard_product_id"` // 标准商品ID
|
||||||
Name string `form:"name" binding:"required"` // 商品名称
|
Name string `form:"name" binding:"required"` // 商品名称
|
||||||
Appearance int64 `form:"appearance" binding:"required"` // 商品外观
|
Appearance int64 `form:"appearance" binding:"required"` // 商品外观
|
||||||
Barcode string `form:"barcode" binding:"required"` // 商品条码
|
Barcode string `form:"barcode" binding:"required"` // 商品条码
|
||||||
Price int64 `form:"price"` // 商品价格
|
Price int64 `form:"price"` // 商品价格
|
||||||
LiveImage []string `form:"live_image[]"` // 商品图片
|
|
||||||
IsBatchManaged int8 `form:"is_batch_managed"` // 批次管理
|
SalePrice int64 `form:"sale_price"` // 商品售价
|
||||||
IsShelfLifeManaged int8 `form:"is_shelf_life_managed"` // 保质期管理
|
Cost int64 `form:"cost"` // 运费
|
||||||
Status int8 `form:"status"` // 商品状态
|
|
||||||
|
LiveImage []string `form:"live_image[]"` // 商品图片
|
||||||
|
IsBatchManaged int8 `form:"is_batch_managed"` // 批次管理
|
||||||
|
IsShelfLifeManaged int8 `form:"is_shelf_life_managed"` // 保质期管理
|
||||||
|
Status int8 `form:"status"` // 商品状态
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetProductListRequest 获取商品列表请求
|
// GetProductListRequest 获取商品列表请求
|
||||||
|
|||||||
@ -31,65 +31,65 @@ type EmployeeLevelInfo struct {
|
|||||||
|
|
||||||
// EmployeeListResponse 员工列表响应
|
// EmployeeListResponse 员工列表响应
|
||||||
type EmployeeListResponse struct {
|
type EmployeeListResponse struct {
|
||||||
List []EmployeeItem `json:"list"`
|
List []EmployeeItem `json:"list"` // 员工列表
|
||||||
Total int64 `json:"total"`
|
Total int64 `json:"total"` // 总数
|
||||||
Page int `json:"page"`
|
Page int `json:"page"` // 当前页
|
||||||
PageSize int `json:"pageSize"`
|
PageSize int `json:"pageSize"` // 每页数量
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddEmployeeResponse 添加员工响应
|
// AddEmployeeResponse 添加员工响应
|
||||||
type AddEmployeeResponse struct {
|
type AddEmployeeResponse struct {
|
||||||
EmployeeID string `json:"employee_id"`
|
EmployeeID string `json:"employee_id"` // 工号
|
||||||
Username string `json:"username"`
|
Username string `json:"username"` // 用户名
|
||||||
Name string `json:"name"`
|
Name string `json:"name"` // 姓名
|
||||||
}
|
}
|
||||||
|
|
||||||
// EmployeeItem 员工列表项
|
// EmployeeItem 员工列表项
|
||||||
type EmployeeItem struct {
|
type EmployeeItem struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"` // 员工ID
|
||||||
EmployeeIDStr string `json:"employee_id"`
|
EmployeeIDStr string `json:"employee_id"` // 工号
|
||||||
Fid int64 `json:"fid"` // 父级ID
|
Fid int64 `json:"fid"` // 父级ID
|
||||||
AboutId int64 `json:"about_id"` // 租户ID
|
AboutId int64 `json:"about_id"` // 租户ID
|
||||||
Code string `json:"code"` // 机械码
|
Code string `json:"code"` // 机械码
|
||||||
Username string `json:"username"`
|
Username string `json:"username"` // 用户名
|
||||||
Name string `json:"name"`
|
Name string `json:"name"` // 姓名
|
||||||
Phone string `json:"phone"`
|
Phone string `json:"phone"` // 手机号
|
||||||
Role int64 `json:"role"`
|
Role int64 `json:"role"` // 角色
|
||||||
Score int64 `json:"score"`
|
Score int64 `json:"score"` // 积分
|
||||||
Status int8 `json:"status"`
|
Status int8 `json:"status"` // 状态
|
||||||
From string `json:"from"`
|
From string `json:"from"` // 来源
|
||||||
LastLoginAt int64 `json:"last_login_at"`
|
LastLoginAt int64 `json:"last_login_at"` // 最后登录时间
|
||||||
CreatedAt int64 `json:"created_at"`
|
CreatedAt int64 `json:"created_at"` // 创建时间
|
||||||
ExpireTime int64 `json:"expire_time"`
|
ExpireTime int64 `json:"expire_time"` // 到期时间
|
||||||
LevelInfo *EmployeeLevelInfo `json:"level_info"` // 等级信息
|
LevelInfo *EmployeeLevelInfo `json:"level_info"` // 等级信息
|
||||||
Settings models.EmployeeSettingsConfig `json:"settings"`
|
Settings models.EmployeeSettingsConfig `json:"settings"` // 员工设置
|
||||||
UserType *UserTypeInfo `json:"user_type"`
|
UserType *UserTypeInfo `json:"user_type"` // 用户类型
|
||||||
}
|
}
|
||||||
|
|
||||||
type UserTypeInfo struct {
|
type UserTypeInfo struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"` // 用户类型ID
|
||||||
Name string `json:"name"`
|
Name string `json:"name"` // 用户类型名称
|
||||||
Icon string `json:"icon"`
|
Icon string `json:"icon"` // 用户类型图标
|
||||||
}
|
}
|
||||||
|
|
||||||
// ConvertEmployeeToItem 将员工模型转换为响应项
|
// ConvertEmployeeToItem 将员工模型转换为响应项
|
||||||
func ConvertEmployeeToItem(emp models.Employee) EmployeeItem {
|
func ConvertEmployeeToItem(emp models.Employee) EmployeeItem {
|
||||||
return EmployeeItem{
|
return EmployeeItem{
|
||||||
ID: emp.ID,
|
ID: emp.ID, // 员工ID
|
||||||
EmployeeIDStr: emp.EmployeeIDStr,
|
EmployeeIDStr: emp.EmployeeIDStr, // 工号
|
||||||
Fid: emp.Fid,
|
Fid: emp.Fid, // 父级ID
|
||||||
AboutId: emp.AboutId,
|
AboutId: emp.AboutId, // 租户ID
|
||||||
Code: emp.Code,
|
Code: emp.Code, // 机械码
|
||||||
Username: emp.Username,
|
Username: emp.Username, // 用户名
|
||||||
Name: emp.Name,
|
Name: emp.Name, // 姓名
|
||||||
Phone: emp.Phone,
|
Phone: emp.Phone, // 手机号
|
||||||
Role: emp.Role,
|
Role: emp.Role, // 角色
|
||||||
Score: emp.Score,
|
Score: emp.Score, // 积分
|
||||||
From: emp.From,
|
From: emp.From, // 来源
|
||||||
Status: emp.Status,
|
Status: emp.Status, // 状态
|
||||||
LastLoginAt: emp.LastLoginAt,
|
LastLoginAt: emp.LastLoginAt, // 最后登录时间
|
||||||
CreatedAt: emp.CreatedAt,
|
CreatedAt: emp.CreatedAt, // 创建时间
|
||||||
ExpireTime: emp.ExpireTime,
|
ExpireTime: emp.ExpireTime, // 到期时间
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,13 +103,13 @@ type EmployeeLevelConfigResponse struct {
|
|||||||
|
|
||||||
// UserListItem 用户列表项
|
// UserListItem 用户列表项
|
||||||
type UserListItem struct {
|
type UserListItem struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"` // 用户ID
|
||||||
EmployeeIDStr string `json:"employee_id_str"`
|
EmployeeIDStr string `json:"employee_id_str"` // 工号
|
||||||
Username string `json:"username"`
|
Username string `json:"username"` // 用户名
|
||||||
Name string `json:"name"`
|
Name string `json:"name"` // 姓名
|
||||||
Role int64 `json:"role"`
|
Role int64 `json:"role"` // 角色
|
||||||
Status int8 `json:"status"`
|
Status int8 `json:"status"` // 状态
|
||||||
SplitAccountConfigId int64 `json:"split_account_config_id"`
|
SplitAccountConfigId int64 `json:"split_account_config_id"` // 分账配置ID
|
||||||
SplitAccountConfig *SplitAccountConfigInfo `json:"split_account_config,omitempty"` // 分账配置详情
|
SplitAccountConfig *SplitAccountConfigInfo `json:"split_account_config,omitempty"` // 分账配置详情
|
||||||
AboutId int64 `json:"about_id"` // 租户ID
|
AboutId int64 `json:"about_id"` // 租户ID
|
||||||
Phone string `json:"phone"` // 手机号
|
Phone string `json:"phone"` // 手机号
|
||||||
@ -122,52 +122,52 @@ type UserListItem struct {
|
|||||||
|
|
||||||
// GetUserListResponse 用户列表响应
|
// GetUserListResponse 用户列表响应
|
||||||
type GetUserListResponse struct {
|
type GetUserListResponse struct {
|
||||||
List []UserListItem `json:"list"`
|
List []UserListItem `json:"list"` // 用户列表
|
||||||
Total int64 `json:"total"`
|
Total int64 `json:"total"` // 总数
|
||||||
Page int `json:"page"`
|
Page int `json:"page"` // 当前页
|
||||||
PageSize int `json:"page_size"`
|
PageSize int `json:"page_size"` // 每页数量
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateEmployeeSplitAccountConfigResponse 更新员工分账配置响应
|
// UpdateEmployeeSplitAccountConfigResponse 更新员工分账配置响应
|
||||||
type UpdateEmployeeSplitAccountConfigResponse struct {
|
type UpdateEmployeeSplitAccountConfigResponse struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"` // 员工分账配置ID
|
||||||
EmployeeIDStr string `json:"employee_id_str"`
|
EmployeeIDStr string `json:"employee_id_str"` // 工号
|
||||||
Username string `json:"username"`
|
Username string `json:"username"` // 用户名
|
||||||
Name string `json:"name"`
|
Name string `json:"name"` // 姓名
|
||||||
Phone string `json:"phone"`
|
Phone string `json:"phone"` // 手机号
|
||||||
AboutId int64 `json:"about_id"`
|
AboutId int64 `json:"about_id"` // 租户ID
|
||||||
SplitAccountConfigId int64 `json:"split_account_config_id"`
|
SplitAccountConfigId int64 `json:"split_account_config_id"` // 分账配置ID
|
||||||
Status int8 `json:"status"`
|
Status int8 `json:"status"` // 状态
|
||||||
UpdatedAt int64 `json:"updated_at"`
|
UpdatedAt int64 `json:"updated_at"` // 更新时间
|
||||||
}
|
}
|
||||||
|
|
||||||
// CurrentUserResponse 当前用户信息响应(包含分账配置)
|
// CurrentUserResponse 当前用户信息响应(包含分账配置)
|
||||||
type CurrentUserResponse struct {
|
type CurrentUserResponse struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"` // 员工ID
|
||||||
EmployeeIDStr string `json:"employee_id_str"`
|
EmployeeIDStr string `json:"employee_id_str"` // 工号
|
||||||
Username string `json:"username"`
|
Username string `json:"username"` // 用户名
|
||||||
Name string `json:"name"`
|
Name string `json:"name"` // 姓名
|
||||||
Phone string `json:"phone"`
|
Phone string `json:"phone"` // 手机号
|
||||||
Role int64 `json:"role"`
|
Role int64 `json:"role"` // 角色
|
||||||
Fid int64 `json:"fid"`
|
Fid int64 `json:"fid"` // 父级ID
|
||||||
AboutId int64 `json:"about_id"`
|
AboutId int64 `json:"about_id"` // 租户ID
|
||||||
Status int8 `json:"status"`
|
Status int8 `json:"status"` // 状态
|
||||||
Score int64 `json:"score"`
|
Score int64 `json:"score"` // 积分
|
||||||
SplitAccountConfigId int64 `json:"split_account_config_id"`
|
SplitAccountConfigId int64 `json:"split_account_config_id"` // 分账配置ID
|
||||||
SplitAccountConfig *SplitAccountConfigInfo `json:"split_account_config,omitempty"` // 分账配置详情
|
SplitAccountConfig *SplitAccountConfigInfo `json:"split_account_config,omitempty"` // 分账配置详情
|
||||||
CreatedAt int64 `json:"created_at"`
|
CreatedAt int64 `json:"created_at"` // 创建时间
|
||||||
UpdatedAt int64 `json:"updated_at"`
|
UpdatedAt int64 `json:"updated_at"` // 更新时间
|
||||||
}
|
}
|
||||||
|
|
||||||
// SplitAccountConfigInfo 分账配置信息
|
// SplitAccountConfigInfo 分账配置信息
|
||||||
type SplitAccountConfigInfo struct {
|
type SplitAccountConfigInfo struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"` // 分账配置ID
|
||||||
RuleName string `json:"rule_name"`
|
RuleName string `json:"rule_name"` // 规则名称
|
||||||
RuleValue json.RawMessage `json:"rule_value"`
|
RuleValue json.RawMessage `json:"rule_value"` // 规则值
|
||||||
Status int8 `json:"status"`
|
Status int8 `json:"status"` // 状态
|
||||||
Description string `json:"description"`
|
Description string `json:"description"` // 描述
|
||||||
CreatedBy string `json:"created_by"`
|
CreatedBy string `json:"created_by"` // 创建人
|
||||||
UpdatedBy string `json:"updated_by"`
|
UpdatedBy string `json:"updated_by"` // 更新人
|
||||||
CreatedAt int64 `json:"created_at"`
|
CreatedAt int64 `json:"created_at"` // 创建时间
|
||||||
UpdatedAt int64 `json:"updated_at"`
|
UpdatedAt int64 `json:"updated_at"` // 更新时间
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package response
|
package response
|
||||||
|
|
||||||
type OcrResponse struct {
|
type OcrResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"` // 是否成功
|
||||||
Texts []string `json:"texts"`
|
Texts []string `json:"texts"` // 识别结果
|
||||||
GuessBookInfo
|
GuessBookInfo
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,22 +2,22 @@ package models
|
|||||||
|
|
||||||
// SalesOrderItem 销售订单明细表
|
// SalesOrderItem 销售订单明细表
|
||||||
type SalesOrderItem struct {
|
type SalesOrderItem struct {
|
||||||
ID int64 `json:"id" gorm:"primarykey;comment:明细ID"`
|
ID int64 `json:"id" gorm:"primarykey;comment:明细ID"` // 明细ID
|
||||||
SalesOrderID int64 `json:"sales_order_id" gorm:"not null;default:0;index;comment:销售单ID"`
|
SalesOrderID int64 `json:"sales_order_id" gorm:"not null;default:0;index;comment:销售单ID"` // 销售单
|
||||||
ProductID int64 `json:"product_id" gorm:"not null;default:0;index;comment:商品ID"`
|
ProductID int64 `json:"product_id" gorm:"not null;default:0;index;comment:商品ID"` // 商品
|
||||||
Quantity int64 `json:"quantity" gorm:"not null;default:0;comment:订购数量(最小单位)"`
|
Quantity int64 `json:"quantity" gorm:"not null;default:0;comment:订购数量(最小单位)"` // 订购数量
|
||||||
AllocatedQuantity int64 `json:"allocated_quantity" gorm:"not null;default:0;comment:已分配数量"`
|
AllocatedQuantity int64 `json:"allocated_quantity" gorm:"not null;default:0;comment:已分配数量"` // 已分配数量
|
||||||
ShippedQuantity int64 `json:"shipped_quantity" gorm:"not null;default:0;comment:已发货数量"`
|
ShippedQuantity int64 `json:"shipped_quantity" gorm:"not null;default:0;comment:已发货数量"` // 已发货数量
|
||||||
UnitPrice int64 `json:"unit_price" gorm:"not null;default:0;comment:单价(分/基本单位)"`
|
UnitPrice int64 `json:"unit_price" gorm:"not null;default:0;comment:单价(分/基本单位)"` // 单价
|
||||||
Amount int64 `json:"amount" gorm:"->;comment:金额(分)"`
|
Amount int64 `json:"amount" gorm:"->;comment:金额(分)"` // 金额
|
||||||
ReceiverName string `json:"receiver_name" gorm:"size:100;not null;default:'';comment:收货人姓名"`
|
ReceiverName string `json:"receiver_name" gorm:"size:100;not null;default:'';comment:收货人姓名"` // 收货人姓名
|
||||||
ReceiverPhone string `json:"receiver_phone" gorm:"size:20;not null;default:'';comment:收货人电话"`
|
ReceiverPhone string `json:"receiver_phone" gorm:"size:20;not null;default:'';comment:收货人电话"` // 收货人电话
|
||||||
ReceiverAddress string `json:"receiver_address" gorm:"size:200;not null;default:'';comment:收货地址"`
|
ReceiverAddress string `json:"receiver_address" gorm:"size:200;not null;default:'';comment:收货地址"` // 收货地址
|
||||||
LogisticsCompany string `json:"logistics_company" gorm:"size:100;not null;default:'';comment:物流公司"`
|
LogisticsCompany string `json:"logistics_company" gorm:"size:100;not null;default:'';comment:物流公司"` // 物流公司
|
||||||
LogisticsNo string `json:"logistics_no" gorm:"size:100;not null;default:'';comment:物流运单号"`
|
LogisticsNo string `json:"logistics_no" gorm:"size:100;not null;default:'';comment:物流运单号"` // 物流运单号
|
||||||
CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;comment:创建时间戳(秒)"`
|
CreatedAt int64 `json:"created_at" gorm:"type:bigint;not null;default:0;comment:创建时间戳(秒)"` // 创建时间戳(秒)
|
||||||
UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;not null;default:0;comment:更新时间戳(秒)"`
|
UpdatedAt int64 `json:"updated_at" gorm:"type:bigint;not null;default:0;comment:更新时间戳(秒)"` // 更新时间戳(秒)
|
||||||
IsDel int8 `json:"is_del" gorm:"type:tinyint(1);not null;default:0;comment:逻辑删除标记(0:未删除,1:已删除)"`
|
IsDel int8 `json:"is_del" gorm:"type:tinyint(1);not null;default:0;comment:逻辑删除标记(0:未删除,1:已删除)"` // 逻辑删除标记(0:未删除,1:已删除)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (SalesOrderItem) TableName() string {
|
func (SalesOrderItem) TableName() string {
|
||||||
|
|||||||
@ -88,6 +88,12 @@ func initRouter() (r *gin.Engine) {
|
|||||||
public.GET("/product_book/del", productBookApi.Del) // 删除商品反射
|
public.GET("/product_book/del", productBookApi.Del) // 删除商品反射
|
||||||
public.GET("/product/full_info", productApi.GetProductFullInfo) // 没有签名认证获取商品完整信息
|
public.GET("/product/full_info", productApi.GetProductFullInfo) // 没有签名认证获取商品完整信息
|
||||||
|
|
||||||
|
public.GET("/split-account-deduction-log/list", splitAccountDeductionLogApi.GetSplitAccountDeductionLogList) // 获取分账扣钱日志列表
|
||||||
|
public.GET("/split-account-deduction-log/detail/:id", splitAccountDeductionLogApi.GetSplitAccountDeductionLogDetail) // 获取分账扣钱日志详情
|
||||||
|
public.POST("/split-account-deduction-log/create", splitAccountDeductionLogApi.CreateSplitAccountDeductionLog) // 创建分账
|
||||||
|
public.PUT("/split-account-deduction-log/update", splitAccountDeductionLogApi.UpdateSplitAccountDeductionLog) // 更新分账
|
||||||
|
public.DELETE("/split-account-deduction-log/delete", splitAccountDeductionLogApi.DeleteSplitAccountDeductionLog) // 删除分账
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sign := api.Group("")
|
sign := api.Group("")
|
||||||
@ -242,11 +248,11 @@ func initRouter() (r *gin.Engine) {
|
|||||||
auth.PUT("/split-account-config/update", splitAccountConfigApi.UpdateSplitAccountConfig) // 更新分账配置
|
auth.PUT("/split-account-config/update", splitAccountConfigApi.UpdateSplitAccountConfig) // 更新分账配置
|
||||||
auth.DELETE("/split-account-config/delete", splitAccountConfigApi.DeleteSplitAccountConfig) // 删除分账配置
|
auth.DELETE("/split-account-config/delete", splitAccountConfigApi.DeleteSplitAccountConfig) // 删除分账配置
|
||||||
// 分账扣钱日志管理
|
// 分账扣钱日志管理
|
||||||
auth.GET("/split-account-deduction-log/list", splitAccountDeductionLogApi.GetSplitAccountDeductionLogList) // 获取分账扣钱日志列表
|
/*auth.GET("/split-account-deduction-log/list", splitAccountDeductionLogApi.GetSplitAccountDeductionLogList) // 获取分账扣钱日志列表
|
||||||
auth.GET("/split-account-deduction-log/detail/:id", splitAccountDeductionLogApi.GetSplitAccountDeductionLogDetail) // 获取分账扣钱日志详情
|
auth.GET("/split-account-deduction-log/detail/:id", splitAccountDeductionLogApi.GetSplitAccountDeductionLogDetail) // 获取分账扣钱日志详情
|
||||||
auth.POST("/split-account-deduction-log/create", splitAccountDeductionLogApi.CreateSplitAccountDeductionLog) // 创建分账
|
auth.POST("/split-account-deduction-log/create", splitAccountDeductionLogApi.CreateSplitAccountDeductionLog) // 创建分账
|
||||||
auth.PUT("/split-account-deduction-log/update", splitAccountDeductionLogApi.UpdateSplitAccountDeductionLog) // 更新分账
|
auth.PUT("/split-account-deduction-log/update", splitAccountDeductionLogApi.UpdateSplitAccountDeductionLog) // 更新分账
|
||||||
auth.DELETE("/split-account-deduction-log/delete", splitAccountDeductionLogApi.DeleteSplitAccountDeductionLog) // 删除分账
|
auth.DELETE("/split-account-deduction-log/delete", splitAccountDeductionLogApi.DeleteSplitAccountDeductionLog) // 删除分账*/
|
||||||
// 产品日志管理
|
// 产品日志管理
|
||||||
auth.GET("/product_log/list", productApi.GetProductLogList) // 获取产品日志列表
|
auth.GET("/product_log/list", productApi.GetProductLogList) // 获取产品日志列表
|
||||||
auth.POST("/product_log/save", productApi.SaveProductLog) // 保存产品日志
|
auth.POST("/product_log/save", productApi.SaveProductLog) // 保存产品日志
|
||||||
|
|||||||
@ -19,7 +19,7 @@ type EmployeeService struct{}
|
|||||||
// Login 管理员登录
|
// Login 管理员登录
|
||||||
func (s *EmployeeService) Login(req systemReq.LoginRequest, userType string, c *gin.Context) (*systemRes.LoginResponse, error) {
|
func (s *EmployeeService) Login(req systemReq.LoginRequest, userType string, c *gin.Context) (*systemRes.LoginResponse, error) {
|
||||||
var employee models.Employee
|
var employee models.Employee
|
||||||
|
//
|
||||||
result := database.DB.Where("username = ? AND deleted_at = ?", req.Username, 0).First(&employee)
|
result := database.DB.Where("username = ? AND deleted_at = ?", req.Username, 0).First(&employee)
|
||||||
if result.Error != nil {
|
if result.Error != nil {
|
||||||
return nil, utils.NewError("用户不存在")
|
return nil, utils.NewError("用户不存在")
|
||||||
@ -39,7 +39,7 @@ func (s *EmployeeService) Login(req systemReq.LoginRequest, userType string, c *
|
|||||||
return nil, utils.NewError("子账号已过期,无法登录")
|
return nil, utils.NewError("子账号已过期,无法登录")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 检查账号类型
|
||||||
if req.Type == 1 {
|
if req.Type == 1 {
|
||||||
expectedRole := 255
|
expectedRole := 255
|
||||||
if userType == "128" {
|
if userType == "128" {
|
||||||
@ -95,26 +95,26 @@ func (s *EmployeeService) Login(req systemReq.LoginRequest, userType string, c *
|
|||||||
levelResult := database.DB.Where("emp_id = ? AND is_del = ?", employee.ID, 0).First(&employeeLevel)
|
levelResult := database.DB.Where("emp_id = ? AND is_del = ?", employee.ID, 0).First(&employeeLevel)
|
||||||
if levelResult.Error == nil {
|
if levelResult.Error == nil {
|
||||||
levelInfo = &systemRes.EmployeeLevelInfo{
|
levelInfo = &systemRes.EmployeeLevelInfo{
|
||||||
Level: employeeLevel.Level,
|
Level: employeeLevel.Level, // 等级
|
||||||
MaxNum: employeeLevel.MaxNum,
|
MaxNum: employeeLevel.MaxNum, // 最大数量
|
||||||
ExpireTime: employeeLevel.ExpireTime,
|
ExpireTime: employeeLevel.ExpireTime, // 到期时间
|
||||||
PayTime: employeeLevel.PayTime,
|
PayTime: employeeLevel.PayTime, // 支付时间
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return &systemRes.LoginResponse{
|
return &systemRes.LoginResponse{
|
||||||
ID: employee.ID,
|
ID: employee.ID, // 员工ID
|
||||||
EmployeeID: employee.EmployeeIDStr,
|
EmployeeID: employee.EmployeeIDStr, // 员工ID
|
||||||
Fid: employee.Fid,
|
Fid: employee.Fid, // 父级ID
|
||||||
AboutId: strconv.FormatInt(employee.AboutId, 10),
|
AboutId: strconv.FormatInt(employee.AboutId, 10), // 租户ID
|
||||||
Username: employee.Username,
|
Username: employee.Username, // 用户名
|
||||||
Name: employee.Name,
|
Name: employee.Name, // 姓名
|
||||||
Role: employee.Role,
|
Role: employee.Role, // 角色
|
||||||
Score: employee.Score,
|
Score: employee.Score, // 积分
|
||||||
From: employee.From,
|
From: employee.From, // 来源
|
||||||
Token: token,
|
Token: token, // 令牌
|
||||||
ExpireIn: config.AppConfig.JWT.ExpireHours,
|
ExpireIn: config.AppConfig.JWT.ExpireHours, // 令牌有效期
|
||||||
LevelInfo: levelInfo,
|
LevelInfo: levelInfo, // 等级信息
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,15 +141,15 @@ func (s *EmployeeService) GetEmployeeList(req systemReq.GetEmployeeListRequest,
|
|||||||
|
|
||||||
type EmployeeWithRelations struct {
|
type EmployeeWithRelations struct {
|
||||||
models.Employee
|
models.Employee
|
||||||
Settings string `gorm:"column:settings"`
|
Settings string `gorm:"column:settings"` // 员工设置
|
||||||
LevelID int64 `gorm:"column:level_id"`
|
LevelID int64 `gorm:"column:level_id"` // 等级ID
|
||||||
LevelLevel int8 `gorm:"column:level_level"`
|
LevelLevel int8 `gorm:"column:level_level"` // 等级等级
|
||||||
MaxNum int64 `gorm:"column:max_num"`
|
MaxNum int64 `gorm:"column:max_num"` // 最大数量
|
||||||
LevelPayTime int64 `gorm:"column:level_pay_time"`
|
LevelPayTime int64 `gorm:"column:level_pay_time"` // 支付时间
|
||||||
LevelExpireTime int64 `gorm:"column:level_expire_time"`
|
LevelExpireTime int64 `gorm:"column:level_expire_time"` // 到期时间
|
||||||
UserTypeID int8 `gorm:"column:user_type_id"`
|
UserTypeID int8 `gorm:"column:user_type_id"` // 用户类型ID
|
||||||
UserTypeName string `gorm:"column:user_type_name"`
|
UserTypeName string `gorm:"column:user_type_name"` // 用户类型名称
|
||||||
UserTypeIcon string `gorm:"column:user_type_icon"`
|
UserTypeIcon string `gorm:"column:user_type_icon"` // 用户类型图标
|
||||||
}
|
}
|
||||||
query := database.DB.Table("employees").
|
query := database.DB.Table("employees").
|
||||||
Select("employees.*, employees_settings.settings, employees_level.id as level_id, employees_level.level as level_level, employees_level.max_num, employees_level.pay_time as level_pay_time, employees_level.expire_time as level_expire_time, user_type.id as user_type_id, user_type.name as user_type_name, user_type.icon as user_type_icon").
|
Select("employees.*, employees_settings.settings, employees_level.id as level_id, employees_level.level as level_level, employees_level.max_num, employees_level.pay_time as level_pay_time, employees_level.expire_time as level_expire_time, user_type.id as user_type_id, user_type.name as user_type_name, user_type.icon as user_type_icon").
|
||||||
@ -200,10 +200,10 @@ func (s *EmployeeService) GetEmployeeList(req systemReq.GetEmployeeListRequest,
|
|||||||
// 添加等级信息
|
// 添加等级信息
|
||||||
if emp.LevelID > 0 {
|
if emp.LevelID > 0 {
|
||||||
item.LevelInfo = &systemRes.EmployeeLevelInfo{
|
item.LevelInfo = &systemRes.EmployeeLevelInfo{
|
||||||
Level: emp.LevelLevel,
|
Level: emp.LevelLevel, // 等级
|
||||||
MaxNum: emp.MaxNum,
|
MaxNum: emp.MaxNum, // 最大数量
|
||||||
ExpireTime: emp.LevelExpireTime,
|
ExpireTime: emp.LevelExpireTime, // 到期时间
|
||||||
PayTime: emp.LevelPayTime,
|
PayTime: emp.LevelPayTime, // 支付时间
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,8 +211,8 @@ func (s *EmployeeService) GetEmployeeList(req systemReq.GetEmployeeListRequest,
|
|||||||
if emp.UserTypeID > 0 {
|
if emp.UserTypeID > 0 {
|
||||||
item.UserType = &systemRes.UserTypeInfo{
|
item.UserType = &systemRes.UserTypeInfo{
|
||||||
ID: int64(emp.UserTypeID),
|
ID: int64(emp.UserTypeID),
|
||||||
Name: emp.UserTypeName,
|
Name: emp.UserTypeName, // 用户类型名称
|
||||||
Icon: emp.UserTypeIcon,
|
Icon: emp.UserTypeIcon, // 用户类型图标
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,10 +220,10 @@ func (s *EmployeeService) GetEmployeeList(req systemReq.GetEmployeeListRequest,
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &systemRes.EmployeeListResponse{
|
return &systemRes.EmployeeListResponse{
|
||||||
List: employeeItems,
|
List: employeeItems, // 员工列表
|
||||||
Total: total,
|
Total: total, // 总数
|
||||||
Page: req.Page,
|
Page: req.Page, // 当前页码
|
||||||
PageSize: req.PageSize,
|
PageSize: req.PageSize, // 每页数量
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,21 +310,21 @@ func (s *EmployeeService) AddEmployee(req systemReq.AddEmployeeRequest) (*system
|
|||||||
|
|
||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
employee := models.Employee{
|
employee := models.Employee{
|
||||||
EmployeeIDStr: newEmployeeID,
|
EmployeeIDStr: newEmployeeID, // 员工编号
|
||||||
Username: utils.Ternary(req.UserName == "", username, req.UserName),
|
Username: utils.Ternary(req.UserName == "", username, req.UserName), // 用户名
|
||||||
Password: hashedPassword,
|
Password: hashedPassword, // 密码
|
||||||
Name: req.Name,
|
Name: req.Name, // 姓名
|
||||||
Phone: req.Phone,
|
Phone: req.Phone, // 手机号
|
||||||
Role: int64(utils.Ternary(req.Fid == 0, 255, 128)),
|
Role: int64(utils.Ternary(req.Fid == 0, 255, 128)), // 角色
|
||||||
Fid: req.Fid,
|
Fid: req.Fid, // 上级ID
|
||||||
AboutId: req.AboutId,
|
AboutId: req.AboutId, // 关联id
|
||||||
Score: 0,
|
Score: 0, // 积分
|
||||||
Status: 1,
|
Status: 1, // 状态
|
||||||
From: utils.Ternary(req.From == "", "system", req.From),
|
From: utils.Ternary(req.From == "", "system", req.From), // 来源
|
||||||
CreatedAt: now,
|
CreatedAt: now, // 创建时间
|
||||||
UpdatedAt: now,
|
UpdatedAt: now, // 更新时间
|
||||||
DeletedAt: 0,
|
DeletedAt: 0, // 删除时间
|
||||||
ExpireTime: req.ExpireTime,
|
ExpireTime: req.ExpireTime, // 到期时间
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := database.DB.Create(&employee).Error; err != nil {
|
if err := database.DB.Create(&employee).Error; err != nil {
|
||||||
@ -332,9 +332,9 @@ func (s *EmployeeService) AddEmployee(req systemReq.AddEmployeeRequest) (*system
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &systemRes.AddEmployeeResponse{
|
return &systemRes.AddEmployeeResponse{
|
||||||
EmployeeID: employee.EmployeeIDStr,
|
EmployeeID: employee.EmployeeIDStr, // 员工编号
|
||||||
Username: employee.Username,
|
Username: employee.Username, // 用户名
|
||||||
Name: employee.Name,
|
Name: employee.Name, // 姓名
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -491,37 +491,37 @@ func (s *EmployeeService) ClearCodeEmployee(req systemReq.ClearCodeEmployeeReque
|
|||||||
func GetLevelConfig(level int8) interface{} {
|
func GetLevelConfig(level int8) interface{} {
|
||||||
configs := map[int8]systemRes.EmployeeLevelConfigResponse{
|
configs := map[int8]systemRes.EmployeeLevelConfigResponse{
|
||||||
1: {
|
1: {
|
||||||
Level: 1,
|
Level: 1, // 等级
|
||||||
MaxNum: 5,
|
MaxNum: 5, // 最大数量
|
||||||
Price: 9800,
|
Price: 9800, // 价格
|
||||||
LevelName: "基础版(5个子账号,98元/30天)",
|
LevelName: "基础版(5个子账号,98元/30天)", // 等级名称
|
||||||
},
|
},
|
||||||
2: {
|
2: {
|
||||||
Level: 2,
|
Level: 2, // 等级
|
||||||
MaxNum: 10,
|
MaxNum: 10, // 最大数量
|
||||||
Price: 15600,
|
Price: 15600, // 价格
|
||||||
LevelName: "专业版(10个子账号,156元/30天)",
|
LevelName: "专业版(10个子账号,156元/30天)", // 等级名称
|
||||||
},
|
},
|
||||||
3: {
|
3: {
|
||||||
Level: 3,
|
Level: 3, // 等级
|
||||||
MaxNum: 15,
|
MaxNum: 15, // 最大数量
|
||||||
Price: 20500,
|
Price: 20500, // 价格
|
||||||
LevelName: "企业版(15个子账号,205元/30天)",
|
LevelName: "企业版(15个子账号,205元/30天)", // 等级名称
|
||||||
},
|
},
|
||||||
4: {
|
4: {
|
||||||
Level: 4,
|
Level: 4, // 等级
|
||||||
MaxNum: 20,
|
MaxNum: 20, // 最大数量
|
||||||
Price: 23500,
|
Price: 23500, // 价格
|
||||||
LevelName: "旗舰版(20个子账号,235元/30天)",
|
LevelName: "旗舰版(20个子账号,235元/30天)", // 等级名称
|
||||||
},
|
},
|
||||||
5: {
|
5: {
|
||||||
Level: 5,
|
Level: 5, // 等级
|
||||||
MaxNum: 25,
|
MaxNum: 25, // 最大数量
|
||||||
Price: 24500,
|
Price: 24500, // 价格
|
||||||
LevelName: "至尊版(25个子账号,245元/30天)",
|
LevelName: "至尊版(25个子账号,245元/30天)", // 等级名称
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
// 获取所有等级配置
|
||||||
if level == 0 {
|
if level == 0 {
|
||||||
var allConfigs []systemRes.EmployeeLevelConfigResponse
|
var allConfigs []systemRes.EmployeeLevelConfigResponse
|
||||||
for i := int8(1); i <= 5; i++ {
|
for i := int8(1); i <= 5; i++ {
|
||||||
@ -748,8 +748,8 @@ func (s *EmployeeService) SaveEmployeeSettings(req systemReq.SaveEmployeeSetting
|
|||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
|
|
||||||
config := models.EmployeeSettingsConfig{
|
config := models.EmployeeSettingsConfig{
|
||||||
ShowPrice: req.ShowPrice,
|
ShowPrice: req.ShowPrice, // 是否显示价格
|
||||||
ShowCategory: req.ShowCategory,
|
ShowCategory: req.ShowCategory, // 是否显示分类
|
||||||
ShowCache: req.ShowCache,
|
ShowCache: req.ShowCache,
|
||||||
CompareCount: req.CompareCount,
|
CompareCount: req.CompareCount,
|
||||||
CompareCountEditable: req.CompareCountEditable,
|
CompareCountEditable: req.CompareCountEditable,
|
||||||
@ -1050,12 +1050,12 @@ func (s *EmployeeService) GetUserList(req systemReq.GetUserListRequest) (*system
|
|||||||
Status: emp.Status,
|
Status: emp.Status,
|
||||||
SplitAccountConfigId: emp.SplitAccountConfigId,
|
SplitAccountConfigId: emp.SplitAccountConfigId,
|
||||||
AboutId: emp.AboutId,
|
AboutId: emp.AboutId,
|
||||||
Phone: emp.Phone,
|
Phone: emp.Phone, // emp.Phone,
|
||||||
From: emp.From,
|
From: emp.From, // emp.From,
|
||||||
LastLoginIp: emp.LastLoginIp,
|
LastLoginIp: emp.LastLoginIp, // emp.LastLoginIp,
|
||||||
LastLoginAt: emp.LastLoginAt,
|
LastLoginAt: emp.LastLoginAt, // emp.LastLoginAt,
|
||||||
Code: emp.Code,
|
Code: emp.Code, // emp.Code,
|
||||||
ExpireTime: emp.ExpireTime,
|
ExpireTime: emp.ExpireTime, // emp.ExpireTime,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果有关联的分账配置,添加详情
|
// 如果有关联的分账配置,添加详情
|
||||||
@ -1069,10 +1069,10 @@ func (s *EmployeeService) GetUserList(req systemReq.GetUserListRequest) (*system
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &systemRes.GetUserListResponse{
|
return &systemRes.GetUserListResponse{
|
||||||
List: items,
|
List: items, // items,
|
||||||
Total: total,
|
Total: total, // total,
|
||||||
Page: req.Page,
|
Page: req.Page, // req.Page,
|
||||||
PageSize: req.PageSize,
|
PageSize: req.PageSize, // req.PageSize,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1099,15 +1099,15 @@ func (s *EmployeeService) UpdateEmployeeSplitAccountConfigByAboutId(req systemRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &systemRes.UpdateEmployeeSplitAccountConfigResponse{
|
return &systemRes.UpdateEmployeeSplitAccountConfigResponse{
|
||||||
ID: employee.ID,
|
ID: employee.ID, // 员工ID
|
||||||
EmployeeIDStr: employee.EmployeeIDStr,
|
EmployeeIDStr: employee.EmployeeIDStr, // 员工ID
|
||||||
Username: employee.Username,
|
Username: employee.Username, // 员工用户名
|
||||||
Name: employee.Name,
|
Name: employee.Name, // 员工姓名
|
||||||
Phone: employee.Phone,
|
Phone: employee.Phone, // 员工手机号
|
||||||
AboutId: employee.AboutId,
|
AboutId: employee.AboutId, // 员工所属商户ID
|
||||||
SplitAccountConfigId: employee.SplitAccountConfigId,
|
SplitAccountConfigId: employee.SplitAccountConfigId, // 员工分账配置ID
|
||||||
Status: employee.Status,
|
Status: employee.Status, // 员工状态
|
||||||
UpdatedAt: employee.UpdatedAt,
|
UpdatedAt: employee.UpdatedAt, // 员工更新时间
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,12 +17,12 @@ import (
|
|||||||
type OcrService struct{}
|
type OcrService struct{}
|
||||||
|
|
||||||
type ocrServiceRequest struct {
|
type ocrServiceRequest struct {
|
||||||
ImageBase64 string `json:"image_base64"`
|
ImageBase64 string `json:"image_base64"` // 图片的base64编码
|
||||||
}
|
}
|
||||||
|
|
||||||
type ocrServiceResponse struct {
|
type ocrServiceResponse struct {
|
||||||
Error string `json:"error,omitempty"`
|
Error string `json:"error,omitempty"` // 错误信息
|
||||||
Texts []string `json:"texts,omitempty"`
|
Texts []string `json:"texts,omitempty"` // 识别的文本列表
|
||||||
}
|
}
|
||||||
|
|
||||||
// RecognizeText 调用OCR服务进行文字识别
|
// RecognizeText 调用OCR服务进行文字识别
|
||||||
@ -30,7 +30,7 @@ func (s *OcrService) RecognizeText(imageData []byte) (systemRes.OcrResponse, err
|
|||||||
base64Data := base64.StdEncoding.EncodeToString(imageData)
|
base64Data := base64.StdEncoding.EncodeToString(imageData)
|
||||||
|
|
||||||
reqBody := ocrServiceRequest{
|
reqBody := ocrServiceRequest{
|
||||||
ImageBase64: base64Data,
|
ImageBase64: base64Data, // 图片的base64编码
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonData, err := json.Marshal(reqBody)
|
jsonData, err := json.Marshal(reqBody)
|
||||||
@ -61,16 +61,16 @@ func (s *OcrService) RecognizeText(imageData []byte) (systemRes.OcrResponse, err
|
|||||||
}
|
}
|
||||||
guessedInfo := s.analyzeBookInfo(ocrResp.Texts)
|
guessedInfo := s.analyzeBookInfo(ocrResp.Texts)
|
||||||
return systemRes.OcrResponse{
|
return systemRes.OcrResponse{
|
||||||
Success: true,
|
Success: true, // 是否成功
|
||||||
Texts: ocrResp.Texts,
|
Texts: ocrResp.Texts, // 识别的文本列表
|
||||||
GuessBookInfo: guessedInfo,
|
GuessBookInfo: guessedInfo, // 图书信息
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type candidate struct {
|
type candidate struct {
|
||||||
text string
|
text string // 文本内容
|
||||||
priority int
|
priority int // 优先级
|
||||||
index int
|
index int // 文本在列表中的索引
|
||||||
}
|
}
|
||||||
|
|
||||||
// analyzeBookInfo 分析识别结果
|
// analyzeBookInfo 分析识别结果
|
||||||
|
|||||||
@ -89,28 +89,28 @@ func (s *ProcessService) CreatePurchaseOrderWithWave(req systemReq.PurchaseOrder
|
|||||||
return 0, 0, fmt.Errorf("生成波次号失败: %v", err)
|
return 0, 0, fmt.Errorf("生成波次号失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var totalAmount int64
|
var totalAmount int64 // 采购金额
|
||||||
for _, item := range req.Items {
|
for _, item := range req.Items {
|
||||||
totalAmount += item.Quantity * item.UnitPrice
|
totalAmount += item.Quantity * item.UnitPrice
|
||||||
}
|
}
|
||||||
|
|
||||||
var purchaseOrderID int64
|
var purchaseOrderID int64 // 采购订单ID
|
||||||
var waveID int64
|
var waveID int64 // 入库波次ID
|
||||||
err = executeInTransactionWithDB(databaseConn, func(tx *gorm.DB) error {
|
err = executeInTransactionWithDB(databaseConn, func(tx *gorm.DB) error {
|
||||||
purchaseOrder := models.PurchaseOrder{
|
purchaseOrder := models.PurchaseOrder{
|
||||||
PoNo: poNo,
|
PoNo: poNo, //采购订单号
|
||||||
SupplierID: req.SupplierID,
|
SupplierID: req.SupplierID, //供应商ID
|
||||||
WarehouseID: req.WarehouseID,
|
WarehouseID: req.WarehouseID, //仓库ID
|
||||||
OrderDate: now,
|
OrderDate: now, //订单日期
|
||||||
ExpectedArrivalDate: req.ExpectedArrivalDate,
|
ExpectedArrivalDate: req.ExpectedArrivalDate, //预计到货日期
|
||||||
TotalAmount: totalAmount,
|
TotalAmount: totalAmount, //采购金额
|
||||||
Status: constant.PurchaseStatusSubmitted,
|
Status: constant.PurchaseStatusSubmitted, //订单状态
|
||||||
Creator: creator,
|
Creator: creator, //创建人
|
||||||
CreatorID: creatorID,
|
CreatorID: creatorID, //创建人ID
|
||||||
Remark: req.Remark,
|
Remark: req.Remark, //备注
|
||||||
CreatedAt: now,
|
CreatedAt: now, //创建时间戳
|
||||||
UpdatedAt: now,
|
UpdatedAt: now, //更新时间戳
|
||||||
IsDel: 0,
|
IsDel: 0, //逻辑删除标记
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := tx.Create(&purchaseOrder).Error; err != nil {
|
if err := tx.Create(&purchaseOrder).Error; err != nil {
|
||||||
@ -142,8 +142,8 @@ func (s *ProcessService) ReleaseWave(req systemReq.WaveRequest, carCapacity int6
|
|||||||
|
|
||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
|
|
||||||
var waveID int64
|
var waveID int64 // 波次ID
|
||||||
var waveNo string
|
var waveNo string // 波次号
|
||||||
|
|
||||||
err := executeInTransactionWithDB(databaseConn, func(tx *gorm.DB) error {
|
err := executeInTransactionWithDB(databaseConn, func(tx *gorm.DB) error {
|
||||||
var waveHeader models.WaveHeader
|
var waveHeader models.WaveHeader
|
||||||
@ -219,22 +219,22 @@ func (s *ProcessService) ReleaseWave(req systemReq.WaveRequest, carCapacity int6
|
|||||||
newItemsTotalQuantity += itemReq.Quantity
|
newItemsTotalQuantity += itemReq.Quantity
|
||||||
|
|
||||||
items = append(items, WaveItemData{
|
items = append(items, WaveItemData{
|
||||||
ProductID: itemReq.ProductID,
|
ProductID: itemReq.ProductID, // 产品ID
|
||||||
Quantity: itemReq.Quantity,
|
Quantity: itemReq.Quantity, // 数量
|
||||||
UnitPrice: itemReq.UnitPrice,
|
UnitPrice: itemReq.UnitPrice, // 单价
|
||||||
LocationID: 0,
|
LocationID: 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
purchaseOrderItems = append(purchaseOrderItems, models.PurchaseOrderItem{
|
purchaseOrderItems = append(purchaseOrderItems, models.PurchaseOrderItem{
|
||||||
PurchaseOrderID: req.RelatedOrderID,
|
PurchaseOrderID: req.RelatedOrderID, //采购单ID
|
||||||
ProductID: itemReq.ProductID,
|
ProductID: itemReq.ProductID, //产品ID
|
||||||
Quantity: itemReq.Quantity,
|
Quantity: itemReq.Quantity, // 数量
|
||||||
ReceivedQuantity: 0,
|
ReceivedQuantity: 0, //已入库数量
|
||||||
UnitPrice: itemReq.UnitPrice,
|
UnitPrice: itemReq.UnitPrice, //单价
|
||||||
Amount: amount,
|
Amount: amount, //金额
|
||||||
CreatedAt: now,
|
CreatedAt: now, //创建时间戳
|
||||||
UpdatedAt: now,
|
UpdatedAt: now, //更新时间戳
|
||||||
IsDel: 0,
|
IsDel: 0, //逻辑删除标记
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,9 +303,9 @@ func (s *ProcessService) BindWave(req systemReq.BindWaveRequest, db ...*gorm.DB)
|
|||||||
databaseConn := database.OptionalDB(db...)
|
databaseConn := database.OptionalDB(db...)
|
||||||
|
|
||||||
now := time.Now().Unix()
|
now := time.Now().Unix()
|
||||||
var receivingOrderID int64
|
var receivingOrderID int64 //入库单ID
|
||||||
var waveTaskID int64
|
var waveTaskID int64 //入库任务ID
|
||||||
var waveTaskBatchNo string
|
var waveTaskBatchNo string //入库任务批次号
|
||||||
|
|
||||||
err := executeInTransactionWithDB(databaseConn, func(tx *gorm.DB) error {
|
err := executeInTransactionWithDB(databaseConn, func(tx *gorm.DB) error {
|
||||||
var waveHeader models.WaveHeader
|
var waveHeader models.WaveHeader
|
||||||
@ -336,19 +336,19 @@ func (s *ProcessService) BindWave(req systemReq.BindWaveRequest, db ...*gorm.DB)
|
|||||||
receivingNo := utils.GenerateReceivingNo()
|
receivingNo := utils.GenerateReceivingNo()
|
||||||
|
|
||||||
receivingOrder := models.ReceivingOrder{
|
receivingOrder := models.ReceivingOrder{
|
||||||
ReceivingNo: receivingNo,
|
ReceivingNo: receivingNo, //入库单号
|
||||||
PurchaseOrderID: purchaseOrder.ID,
|
PurchaseOrderID: purchaseOrder.ID, //采购订单ID
|
||||||
WaveTaskID: waveTaskID,
|
WaveTaskID: waveTaskID, //入库任务ID
|
||||||
WarehouseID: purchaseOrder.WarehouseID,
|
WarehouseID: purchaseOrder.WarehouseID, //仓库ID
|
||||||
SupplierID: purchaseOrder.SupplierID,
|
SupplierID: purchaseOrder.SupplierID, //供应商ID
|
||||||
ReceivingDate: now,
|
ReceivingDate: now, //入库日期时间戳(秒)
|
||||||
Status: constant.ReceivingStatusPending,
|
Status: constant.ReceivingStatusPending, //状态(1:待收货/pending, )
|
||||||
Operator: req.Operator,
|
Operator: req.Operator, //操作人
|
||||||
OperatorID: req.OperatorID,
|
OperatorID: req.OperatorID, //操作人ID
|
||||||
Remark: req.Remark,
|
Remark: req.Remark, //备注
|
||||||
CreatedAt: now,
|
CreatedAt: now, //创建时间戳(秒)
|
||||||
UpdatedAt: now,
|
UpdatedAt: now, //更新时间戳(秒)
|
||||||
IsDel: 0,
|
IsDel: 0, //逻辑删除标记
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := tx.Create(&receivingOrder).Error; err != nil {
|
if err := tx.Create(&receivingOrder).Error; err != nil {
|
||||||
@ -374,16 +374,16 @@ func (s *ProcessService) BindWave(req systemReq.BindWaveRequest, db ...*gorm.DB)
|
|||||||
receivingItems := make([]models.ReceivingOrderItem, 0, len(waveTaskDetails))
|
receivingItems := make([]models.ReceivingOrderItem, 0, len(waveTaskDetails))
|
||||||
for _, detail := range waveTaskDetails {
|
for _, detail := range waveTaskDetails {
|
||||||
receivingItems = append(receivingItems, models.ReceivingOrderItem{
|
receivingItems = append(receivingItems, models.ReceivingOrderItem{
|
||||||
ReceivingOrderID: receivingOrder.ID,
|
ReceivingOrderID: receivingOrder.ID, //入库单ID
|
||||||
ProductID: detail.ProductID,
|
ProductID: detail.ProductID, //商品ID
|
||||||
LocationID: 0,
|
LocationID: 0, //库位ID
|
||||||
BatchNo: detail.BatchNo,
|
BatchNo: detail.BatchNo, //批次号
|
||||||
ProductionDate: 0,
|
ProductionDate: 0, //生产日期时间戳(秒)
|
||||||
ExpiryDate: 0,
|
ExpiryDate: 0, //失效日期时间戳(秒)
|
||||||
Quantity: 0,
|
Quantity: 0, //入库数量(最小单位)
|
||||||
CreatedAt: now,
|
CreatedAt: now, //创建时间戳(秒)
|
||||||
UpdatedAt: now,
|
UpdatedAt: now, //更新时间戳(秒)
|
||||||
IsDel: 0,
|
IsDel: 0, //逻辑删除标记
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,11 +465,11 @@ func (s *ProcessService) GetWaveTaskInfo(waveTaskID int64, db ...*gorm.DB) (inte
|
|||||||
}
|
}
|
||||||
|
|
||||||
item := map[string]interface{}{
|
item := map[string]interface{}{
|
||||||
"product_id": detail.ProductID,
|
"product_id": detail.ProductID, //商品ID
|
||||||
"product_name": product.Name,
|
"product_name": product.Name, //商品名称
|
||||||
"product_code": product.Barcode,
|
"product_code": product.Barcode, //商品编码
|
||||||
"planned_quantity": detail.PlannedQuantity,
|
"planned_quantity": detail.PlannedQuantity, //计划数量(最小单位)
|
||||||
"actual_quantity": detail.ActualQuantity,
|
"actual_quantity": detail.ActualQuantity, //实际
|
||||||
}
|
}
|
||||||
|
|
||||||
if detail.LocationID > 0 {
|
if detail.LocationID > 0 {
|
||||||
@ -483,14 +483,14 @@ func (s *ProcessService) GetWaveTaskInfo(waveTaskID int64, db ...*gorm.DB) (inte
|
|||||||
}
|
}
|
||||||
|
|
||||||
result := map[string]interface{}{
|
result := map[string]interface{}{
|
||||||
"wave_task_id": waveTask.ID,
|
"wave_task_id": waveTask.ID, //波次任务ID
|
||||||
"task_no": waveTask.TaskNo,
|
"task_no": waveTask.TaskNo, //波次任务号
|
||||||
"type": waveTask.Type,
|
"type": waveTask.Type, //波次任务类型(1:入库,2:出)
|
||||||
"status": waveTask.Status,
|
"status": waveTask.Status, //波次任务状态(1:待处理,2:处理中)
|
||||||
"assignee": waveTask.Assignee,
|
"assignee": waveTask.Assignee, //指定处理人
|
||||||
"direction": waveHeader.Direction,
|
"direction": waveHeader.Direction, //方向(1:出库,2:入库)
|
||||||
"warehouse_id": waveHeader.WarehouseID,
|
"warehouse_id": waveHeader.WarehouseID, //仓库ID
|
||||||
"items": items,
|
"items": items, //波次任务明细
|
||||||
}
|
}
|
||||||
|
|
||||||
return result, nil
|
return result, nil
|
||||||
@ -501,12 +501,12 @@ func (s *ProcessService) SubmitReceiving(req systemReq.ReceivingSubmitRequest, o
|
|||||||
items := make([]orderItemInfo, 0, len(req.Items))
|
items := make([]orderItemInfo, 0, len(req.Items))
|
||||||
for _, item := range req.Items {
|
for _, item := range req.Items {
|
||||||
items = append(items, orderItemInfo{
|
items = append(items, orderItemInfo{
|
||||||
productID: item.ProductID,
|
productID: item.ProductID, //商品ID
|
||||||
locationID: item.LocationID,
|
locationID: item.LocationID, //库位ID
|
||||||
batchNo: item.BatchNo,
|
batchNo: item.BatchNo, //批次号
|
||||||
productionDate: item.ProductionDate,
|
productionDate: item.ProductionDate, //生产日期时间戳(秒)
|
||||||
expiryDate: item.ExpiryDate,
|
expiryDate: item.ExpiryDate, //失效日期时间戳(秒)
|
||||||
quantity: item.Quantity,
|
quantity: item.Quantity, //入库数量(最小单位)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -525,12 +525,12 @@ func (s *ProcessService) SubmitOutbound(req systemReq.OutboundSubmitRequest, ope
|
|||||||
items := make([]orderItemInfo, 0, len(req.Items))
|
items := make([]orderItemInfo, 0, len(req.Items))
|
||||||
for _, item := range req.Items {
|
for _, item := range req.Items {
|
||||||
items = append(items, orderItemInfo{
|
items = append(items, orderItemInfo{
|
||||||
productID: item.ProductID,
|
productID: item.ProductID, //商品ID
|
||||||
locationID: item.LocationID,
|
locationID: item.LocationID, //库位ID
|
||||||
batchNo: item.BatchNo,
|
batchNo: item.BatchNo, //批次号
|
||||||
productionDate: item.ProductionDate,
|
productionDate: item.ProductionDate, //生产日期时间戳(秒)
|
||||||
expiryDate: item.ExpiryDate,
|
expiryDate: item.ExpiryDate, //失效日期时间戳(秒)
|
||||||
quantity: item.Quantity,
|
quantity: item.Quantity, //出库数量(最小单位)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -675,10 +675,10 @@ func (s *ProcessService) validateAndGetOrderInfo(tx *gorm.DB, orderID, waveTaskI
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &orderInfo{
|
return &orderInfo{
|
||||||
orderID: receivingOrder.ID,
|
orderID: receivingOrder.ID, //入库单ID
|
||||||
orderNo: receivingOrder.ReceivingNo,
|
orderNo: receivingOrder.ReceivingNo, //入库单号
|
||||||
warehouseID: receivingOrder.WarehouseID,
|
warehouseID: receivingOrder.WarehouseID, //仓库ID
|
||||||
status: int(receivingOrder.Status),
|
status: int(receivingOrder.Status), //订单状态
|
||||||
}, nil
|
}, nil
|
||||||
} else {
|
} else {
|
||||||
var outboundOrder models.OutboundOrder
|
var outboundOrder models.OutboundOrder
|
||||||
@ -699,10 +699,10 @@ func (s *ProcessService) validateAndGetOrderInfo(tx *gorm.DB, orderID, waveTaskI
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &orderInfo{
|
return &orderInfo{
|
||||||
orderID: outboundOrder.ID,
|
orderID: outboundOrder.ID, //出库单ID
|
||||||
orderNo: outboundOrder.OutNo,
|
orderNo: outboundOrder.OutNo, //出库单号
|
||||||
warehouseID: outboundOrder.WarehouseID,
|
warehouseID: outboundOrder.WarehouseID, //仓库ID
|
||||||
status: int(outboundOrder.Status),
|
status: int(outboundOrder.Status), //订单状态
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -814,13 +814,13 @@ func (s *ProcessService) processOrderItems(tx *gorm.DB, items []orderItemInfo, o
|
|||||||
}
|
}
|
||||||
|
|
||||||
if orderItem, exists := orderItemMap[itemReq.productID]; exists {
|
if orderItem, exists := orderItemMap[itemReq.productID]; exists {
|
||||||
receivingItem := orderItem.(*models.ReceivingOrderItem)
|
receivingItem := orderItem.(*models.ReceivingOrderItem) // 类型断言
|
||||||
receivingItem.LocationID = itemReq.locationID
|
receivingItem.LocationID = itemReq.locationID //入库库位ID
|
||||||
receivingItem.BatchNo = itemReq.batchNo
|
receivingItem.BatchNo = itemReq.batchNo //批次号
|
||||||
receivingItem.ProductionDate = itemReq.productionDate
|
receivingItem.ProductionDate = itemReq.productionDate //生产日期
|
||||||
receivingItem.ExpiryDate = itemReq.expiryDate
|
receivingItem.ExpiryDate = itemReq.expiryDate //到期日期
|
||||||
receivingItem.Quantity += itemReq.quantity
|
receivingItem.Quantity += itemReq.quantity // 数量
|
||||||
receivingItem.UpdatedAt = now
|
receivingItem.UpdatedAt = now //更新时间戳(秒)
|
||||||
} else {
|
} else {
|
||||||
return nil, nil, fmt.Errorf("订单中不存在该商品: %d", itemReq.productID)
|
return nil, nil, fmt.Errorf("订单中不存在该商品: %d", itemReq.productID)
|
||||||
}
|
}
|
||||||
@ -830,21 +830,21 @@ func (s *ProcessService) processOrderItems(tx *gorm.DB, items []orderItemInfo, o
|
|||||||
return nil, nil, fmt.Errorf("波次任务明细不存在: %d", itemReq.productID)
|
return nil, nil, fmt.Errorf("波次任务明细不存在: %d", itemReq.productID)
|
||||||
}
|
}
|
||||||
|
|
||||||
waveTaskDetail.ActualQuantity += itemReq.quantity
|
waveTaskDetail.ActualQuantity += itemReq.quantity // 数量
|
||||||
waveTaskDetail.LocationID = itemReq.locationID
|
waveTaskDetail.LocationID = itemReq.locationID //入库库位ID
|
||||||
waveTaskDetail.BatchNo = itemReq.batchNo
|
waveTaskDetail.BatchNo = itemReq.batchNo //批次号
|
||||||
waveTaskDetail.UpdatedAt = now
|
waveTaskDetail.UpdatedAt = now //更新时间戳(秒)
|
||||||
|
|
||||||
if waveTaskDetail.ActualQuantity >= waveTaskDetail.PlannedQuantity {
|
if waveTaskDetail.ActualQuantity >= waveTaskDetail.PlannedQuantity {
|
||||||
waveTaskDetail.Status = constant.WaveStatusReleased
|
waveTaskDetail.Status = constant.WaveStatusReleased
|
||||||
}
|
}
|
||||||
|
|
||||||
key := inventoryKey{
|
key := inventoryKey{
|
||||||
warehouseID: orderInfo.warehouseID,
|
warehouseID: orderInfo.warehouseID, //仓库ID
|
||||||
productID: itemReq.productID,
|
productID: itemReq.productID, //商品ID
|
||||||
batchNo: itemReq.batchNo,
|
batchNo: itemReq.batchNo, //批次号
|
||||||
productionDate: itemReq.productionDate,
|
productionDate: itemReq.productionDate, //生产日期
|
||||||
expiryDate: itemReq.expiryDate,
|
expiryDate: itemReq.expiryDate, //到期日期
|
||||||
}
|
}
|
||||||
|
|
||||||
if op, exists := inventoryOpMap[key]; exists {
|
if op, exists := inventoryOpMap[key]; exists {
|
||||||
@ -927,11 +927,11 @@ func (s *ProcessService) processOrderItems(tx *gorm.DB, items []orderItemInfo, o
|
|||||||
productUsedIndex[itemReq.productID] = foundIdx + 1
|
productUsedIndex[itemReq.productID] = foundIdx + 1
|
||||||
|
|
||||||
// 更新找到的出库单明细
|
// 更新找到的出库单明细
|
||||||
outboundItem.LocationID = itemReq.locationID
|
outboundItem.LocationID = itemReq.locationID //出库库位ID
|
||||||
outboundItem.BatchNo = itemReq.batchNo
|
outboundItem.BatchNo = itemReq.batchNo //批次号
|
||||||
outboundItem.ProductionDate = itemReq.productionDate
|
outboundItem.ProductionDate = itemReq.productionDate //生产日期
|
||||||
outboundItem.ExpiryDate = itemReq.expiryDate
|
outboundItem.ExpiryDate = itemReq.expiryDate //到期日期
|
||||||
outboundItem.Quantity = itemReq.quantity
|
outboundItem.Quantity = itemReq.quantity // 数量
|
||||||
outboundItem.UpdatedAt = now
|
outboundItem.UpdatedAt = now
|
||||||
|
|
||||||
// 获取该商品ID对应的波次任务明细列表
|
// 获取该商品ID对应的波次任务明细列表
|
||||||
|
|||||||
@ -112,14 +112,14 @@ func (s *ProductService) GetProductList(req systemReq.GetProductListRequest, db
|
|||||||
var productItems []systemRes.ProductItem
|
var productItems []systemRes.ProductItem
|
||||||
for _, product := range products {
|
for _, product := range products {
|
||||||
item := systemRes.ConvertProductWithInfoToItem(product)
|
item := systemRes.ConvertProductWithInfoToItem(product)
|
||||||
|
|
||||||
if outTaskInfo, exists := outTaskInfoMap[product.ID]; exists {
|
if outTaskInfo, exists := outTaskInfoMap[product.ID]; exists {
|
||||||
item.ShopList = outTaskInfo.ShopList
|
item.ShopList = outTaskInfo.ShopList
|
||||||
}
|
}
|
||||||
// item.LiveImage[0] 按照 , 分割数组
|
|
||||||
liveImage := strings.Split(item.LiveImage[0], ",")
|
|
||||||
item.LiveImage[0] = liveImage[0]
|
|
||||||
productItems = append(productItems, item)
|
productItems = append(productItems, item)
|
||||||
|
/* // item.LiveImage[0] 按照 , 分割数组
|
||||||
|
liveImage := strings.Split(item.LiveImage[0], ",")
|
||||||
|
item.LiveImage[0] = liveImage[0]
|
||||||
|
productItems = append(productItems, item)*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return &systemRes.ProductListResponse{
|
return &systemRes.ProductListResponse{
|
||||||
@ -230,7 +230,9 @@ func (s *ProductService) GetDistributionProductList(req systemReq.GetDistributio
|
|||||||
var productItems []systemRes.ProductItem
|
var productItems []systemRes.ProductItem
|
||||||
for _, product := range products {
|
for _, product := range products {
|
||||||
item := systemRes.ConvertProductWithInfoToItem(product)
|
item := systemRes.ConvertProductWithInfoToItem(product)
|
||||||
|
/*if outTaskInfo, exists := outTaskInfoMap[product.ID]; exists {
|
||||||
|
item.ShopList = outTaskInfo.ShopList
|
||||||
|
}*/
|
||||||
productItems = append(productItems, item)
|
productItems = append(productItems, item)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -678,6 +680,8 @@ func (s *ProductService) createProduct(req systemReq.ProductRequest, now int64,
|
|||||||
Appearance: req.Appearance,
|
Appearance: req.Appearance,
|
||||||
Barcode: req.Barcode,
|
Barcode: req.Barcode,
|
||||||
Price: req.Price,
|
Price: req.Price,
|
||||||
|
SalePrice: req.SalePrice,
|
||||||
|
Cost: req.Cost,
|
||||||
LiveImage: liveImage,
|
LiveImage: liveImage,
|
||||||
IsBatchManaged: req.IsBatchManaged,
|
IsBatchManaged: req.IsBatchManaged,
|
||||||
IsShelfLifeManaged: req.IsShelfLifeManaged,
|
IsShelfLifeManaged: req.IsShelfLifeManaged,
|
||||||
@ -716,6 +720,8 @@ func (s *ProductService) updateProduct(req systemReq.ProductRequest, now int64,
|
|||||||
"appearance": req.Appearance,
|
"appearance": req.Appearance,
|
||||||
"barcode": req.Barcode,
|
"barcode": req.Barcode,
|
||||||
"price": req.Price,
|
"price": req.Price,
|
||||||
|
"sale_price": req.SalePrice,
|
||||||
|
"cost": req.Cost,
|
||||||
"live_image": liveImage,
|
"live_image": liveImage,
|
||||||
"is_batch_managed": req.IsBatchManaged,
|
"is_batch_managed": req.IsBatchManaged,
|
||||||
"is_shelf_life_managed": req.IsShelfLifeManaged,
|
"is_shelf_life_managed": req.IsShelfLifeManaged,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user