1.修复缺陷;
2.新增系统生成串码接口;
This commit is contained in:
parent
82639e2076
commit
55b2ddd8ef
|
@ -13,35 +13,17 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
type CommodityCreateRequest struct {
|
|
||||||
Name string `json:"name" binding:"required"` // 商品名称
|
|
||||||
ErpCategoryId uint32 `json:"erp_category_id" binding:"required"` // 商品分类id
|
|
||||||
IsIMEI uint32 `json:"is_imei" binding:"required"` // 是否串码:1-串码类 2-非串码
|
|
||||||
ErpBarcode string `json:"erp_barcode"` // 商品条码
|
|
||||||
IMEIType uint32 `json:"imei_type"` // 系统生成串码:2-是(系统生成) 3-否(手动添加)
|
|
||||||
ErpSupplierId uint32 `json:"erp_supplier_id" binding:"required"` // 主供应商
|
|
||||||
RetailPrice float64 `json:"retail_price"` // 指导零售价
|
|
||||||
MinRetailPrice float64 `json:"min_retail_price"` // 最低零售价
|
|
||||||
StaffCostPrice float64 `json:"staff_cost_price"` // 员工成本价加价
|
|
||||||
WholesalePrice float64 `json:"wholesale_price"` // 指导采购价
|
|
||||||
Brokerage1 float64 `json:"brokerage_1"` // 销售毛利提成
|
|
||||||
Brokerage2 float64 `json:"brokerage_2"` // 员工毛利提成
|
|
||||||
MemberDiscount float64 `json:"member_discount"` // 会员优惠
|
|
||||||
Origin string `json:"origin"` // 产地
|
|
||||||
Remark string `json:"remark" gorm:"type:varchar(512)"` // 备注
|
|
||||||
}
|
|
||||||
|
|
||||||
// CommodityCreate 新增商品
|
// CommodityCreate 新增商品
|
||||||
// @Summary 新增商品
|
// @Summary 新增商品
|
||||||
// @Tags 商品资料
|
// @Tags 商品资料
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body CommodityCreateRequest true "商品新增模型"
|
// @Param request body models.CommodityCreateRequest true "商品新增模型"
|
||||||
// @Success 200 {object} models.ErpCommodity
|
// @Success 200 {object} models.ErpCommodity
|
||||||
// @Router /api/v1/commodity/create [post]
|
// @Router /api/v1/commodity/create [post]
|
||||||
// 规则:商品名称/商品编号相同则为同一商品,创建的时候由于商品编号不重复,无需判断
|
// 规则:商品名称/商品编号相同则为同一商品,创建的时候由于商品编号不重复,无需判断
|
||||||
func CommodityCreate(c *gin.Context) {
|
func CommodityCreate(c *gin.Context) {
|
||||||
var req = new(CommodityCreateRequest)
|
var req = new(models.CommodityCreateRequest)
|
||||||
|
|
||||||
err := c.ShouldBindJSON(&req)
|
err := c.ShouldBindJSON(&req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -175,21 +157,16 @@ func CommodityList(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type CommodityDetailRequest struct {
|
|
||||||
ErpCommodityId uint32 `json:"erp_commodity_id"` // 商品id
|
|
||||||
SerialNumber string `json:"serial_number"` // 商品编号
|
|
||||||
}
|
|
||||||
|
|
||||||
// CommodityDetail 商品详情
|
// CommodityDetail 商品详情
|
||||||
// @Summary 商品详情
|
// @Summary 商品详情
|
||||||
// @Tags 商品资料
|
// @Tags 商品资料
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body CommodityDetailRequest true "商品详情模型"
|
// @Param request body models.CommodityDetailRequest true "商品详情模型"
|
||||||
// @Success 200 {object} models.ErpCommodity
|
// @Success 200 {object} models.ErpCommodity
|
||||||
// @Router /api/v1/commodity/detail [post]
|
// @Router /api/v1/commodity/detail [post]
|
||||||
func CommodityDetail(c *gin.Context) {
|
func CommodityDetail(c *gin.Context) {
|
||||||
var req = new(CommodityDetailRequest)
|
var req = new(models.CommodityDetailRequest)
|
||||||
|
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
//logger.Error(err)
|
//logger.Error(err)
|
||||||
|
@ -232,35 +209,16 @@ func CommodityDetail(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type CommodityEditRequest struct {
|
|
||||||
Id uint32 `json:"id" binding:"required"` // 商品id
|
|
||||||
Name string `json:"name" binding:"required"` // 商品名称
|
|
||||||
ErpCategoryId uint32 `json:"erp_category_id" binding:"required"` // 商品分类id
|
|
||||||
ErpBarcode string `json:"erp_barcode"` // 商品条码
|
|
||||||
IsIMEI uint32 `json:"is_imei" binding:"required"` // 是否串码:1-串码类 2-非串码
|
|
||||||
IMEIType uint32 `json:"imei_type" binding:"required"` // 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
|
||||||
ErpSupplierId uint32 `json:"erp_supplier_id" binding:"required"` // 主供应商id
|
|
||||||
RetailPrice float64 `json:"retail_price"` // 指导零售价
|
|
||||||
MinRetailPrice float64 `json:"min_retail_price"` // 最低零售价
|
|
||||||
StaffCostPrice float64 `json:"staff_cost_price"` // 员工成本价加价
|
|
||||||
WholesalePrice float64 `json:"wholesale_price"` // 指导采购价
|
|
||||||
Brokerage1 float64 `json:"brokerage_1"` // 销售毛利提成
|
|
||||||
Brokerage2 float64 `json:"brokerage_2"` // 员工毛利提成
|
|
||||||
MemberDiscount float64 `json:"member_discount"` // 会员优惠
|
|
||||||
Origin string `json:"origin"` // 产地
|
|
||||||
Remark string `json:"remark" gorm:"type:varchar(512)"` // 备注
|
|
||||||
}
|
|
||||||
|
|
||||||
// CommodityEdit 编辑商品
|
// CommodityEdit 编辑商品
|
||||||
// @Summary 编辑商品
|
// @Summary 编辑商品
|
||||||
// @Tags 商品资料
|
// @Tags 商品资料
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body CommodityEditRequest true "编辑商品模型"
|
// @Param request body models.CommodityEditRequest true "编辑商品模型"
|
||||||
// @Success 200 {object} models.ErpCommodity
|
// @Success 200 {object} models.ErpCommodity
|
||||||
// @Router /api/v1/commodity/edit [post]
|
// @Router /api/v1/commodity/edit [post]
|
||||||
func CommodityEdit(c *gin.Context) {
|
func CommodityEdit(c *gin.Context) {
|
||||||
var req = new(CommodityEditRequest)
|
var req = new(models.CommodityEditRequest)
|
||||||
|
|
||||||
err := c.ShouldBindJSON(&req)
|
err := c.ShouldBindJSON(&req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -378,7 +336,7 @@ func CommodityEdit(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 同步更新库存表和库存商品表的"指导零售价"和"最低零售价"、"分类id"、"分类名称";库存商品表的"商品条码"
|
// 同步更新库存表和库存商品表的"指导零售价"和"最低零售价"、"分类id"、"分类名称";库存商品表的"商品条码"
|
||||||
err = models.UpdateErpStockAmountInfo(begin, req.Id, req.RetailPrice, req.MinRetailPrice, barCode, commodity.ErpCategory)
|
err = models.UpdateErpStockAmountInfo(begin, req, barCode, commodity.ErpCategory)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
begin.Rollback()
|
begin.Rollback()
|
||||||
logger.Error("UpdateErpStockAmountInfo err:", logger.Field("err", err))
|
logger.Error("UpdateErpStockAmountInfo err:", logger.Field("err", err))
|
||||||
|
@ -398,20 +356,16 @@ func CommodityEdit(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type CommodityDelRequest struct {
|
|
||||||
ErpCommodityId uint32 `json:"erp_commodity_id" binding:"required"` // 商品id
|
|
||||||
}
|
|
||||||
|
|
||||||
// CommodityDel 删除商品
|
// CommodityDel 删除商品
|
||||||
// @Summary 删除商品
|
// @Summary 删除商品
|
||||||
// @Tags 商品资料
|
// @Tags 商品资料
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param request body CommodityDelRequest true "删除商品模型"
|
// @Param request body models.CommodityDelRequest true "删除商品模型"
|
||||||
// @Success 200 {object} app.Response
|
// @Success 200 {object} app.Response
|
||||||
// @Router /api/v1/commodity/delete [post]
|
// @Router /api/v1/commodity/delete [post]
|
||||||
func CommodityDel(c *gin.Context) {
|
func CommodityDel(c *gin.Context) {
|
||||||
var req = new(CommodityDelRequest)
|
var req = new(models.CommodityDelRequest)
|
||||||
|
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
//logger.Error(err)
|
//logger.Error(err)
|
||||||
|
|
|
@ -214,7 +214,7 @@ func ErpOrderAudit(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新库存
|
// 更新库存
|
||||||
err = model.UpdateStock(begin, erpOrder, stockState)
|
err = model.UpdateStock(begin, erpOrder, stockState, req.State)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
begin.Rollback()
|
begin.Rollback()
|
||||||
logger.Error("UpdateStock err:", logger.Field("err", err))
|
logger.Error("UpdateStock err:", logger.Field("err", err))
|
||||||
|
|
|
@ -98,7 +98,7 @@ func ProductInventoryAudit(c *gin.Context) {
|
||||||
req := &models.ProductInventoryAuditReq{}
|
req := &models.ProductInventoryAuditReq{}
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
//logger.Error(err)
|
//logger.Error(err)
|
||||||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误:"+err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,8 +130,7 @@ func ProductInventoryAudit(c *gin.Context) {
|
||||||
func ProductInventoryDelete(c *gin.Context) {
|
func ProductInventoryDelete(c *gin.Context) {
|
||||||
req := &models.ProductInventoryDeleteReq{}
|
req := &models.ProductInventoryDeleteReq{}
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
//logger.Error(err)
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误:"+err.Error())
|
||||||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,8 +215,7 @@ func ProductInventoryDelete(c *gin.Context) {
|
||||||
func ProductInventoryList(c *gin.Context) {
|
func ProductInventoryList(c *gin.Context) {
|
||||||
req := &models.ProductInventoryListReq{}
|
req := &models.ProductInventoryListReq{}
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
//logger.Error(err)
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误:"+err.Error())
|
||||||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,8 +240,7 @@ func ProductInventoryList(c *gin.Context) {
|
||||||
func ProductInventoryDetail(c *gin.Context) {
|
func ProductInventoryDetail(c *gin.Context) {
|
||||||
req := &models.ProductInventoryDetailReq{}
|
req := &models.ProductInventoryDetailReq{}
|
||||||
if err := c.ShouldBindJSON(&req); err != nil {
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
//logger.Error(err)
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误:"+err.Error())
|
||||||
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -281,3 +278,53 @@ func ProductInventoryDetail(c *gin.Context) {
|
||||||
app.OK(c, productOrder, "查询成功")
|
app.OK(c, productOrder, "查询成功")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProductInventoryGetIMEI 系统生成串码
|
||||||
|
// @Summary 系统生成串码
|
||||||
|
// @Tags 产品入库,V1.4.0
|
||||||
|
// @Produce json
|
||||||
|
// @Accept json
|
||||||
|
// @Param request body models.ProductInventoryGetIMEIReq true "系统生成串码模型"
|
||||||
|
// @Success 200 {object} models.ProductInventoryGetIMEIResp
|
||||||
|
// @Router /api/v1/inventory/product/getIMEI [post]
|
||||||
|
func ProductInventoryGetIMEI(c *gin.Context) {
|
||||||
|
req := &models.ProductInventoryGetIMEIReq{}
|
||||||
|
if err := c.ShouldBindJSON(&req); err != nil {
|
||||||
|
app.Error(c, http.StatusBadRequest, errors.New("para err"), "参数错误:"+err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err := tools.Validate(req) //必填参数校验
|
||||||
|
if err != nil {
|
||||||
|
app.Error(c, http.StatusBadRequest, err, err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查商品是否为串码商品,如果是,则判断是否为系统自动生成串码
|
||||||
|
commodity, err := models.GetCommodity(req.CommodityId)
|
||||||
|
if err != nil {
|
||||||
|
app.Error(c, http.StatusBadRequest, err, "获取失败")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if commodity.ID == 0 {
|
||||||
|
app.Error(c, http.StatusBadRequest, err, "获取失败:商品id有误,未查询到商品信息")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if commodity.IMEIType == models.NoIMEICommodity { // 非串码商品
|
||||||
|
app.Error(c, http.StatusBadRequest, errors.New("获取失败:该商品是非串码商品"), "获取失败:该商品是非串码商品")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
imei, err := models.GenerateSerialCode(commodity.ErpCategoryId)
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("GenerateIMEI err:", logger.Field("err", err))
|
||||||
|
app.Error(c, http.StatusBadRequest, err, "获取失败")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var resp models.ProductInventoryGetIMEIResp
|
||||||
|
resp.IMEI = imei
|
||||||
|
|
||||||
|
app.OK(c, resp, "获取成功")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
|
@ -41,10 +41,10 @@ func RecycleCardOrderList(c *gin.Context) {
|
||||||
req.CooperativeBusinessId = sysUser.CooperativeBusinessId
|
req.CooperativeBusinessId = sysUser.CooperativeBusinessId
|
||||||
|
|
||||||
//uc = &auth.UserClaims{Uid: 8588420}
|
//uc = &auth.UserClaims{Uid: 8588420}
|
||||||
rsp, err := req.List()
|
rsp, err := req.List(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("game cassette err", err)
|
logger.Error("game cassette err", err)
|
||||||
app.Error(c, http.StatusInternalServerError, err, "查询失败")
|
app.Error(c, http.StatusInternalServerError, err, "查询失败"+err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -684,7 +684,7 @@ func (m *StockImporter) ImportStockData(colsMap []map[string]interface{}) error
|
||||||
return fmt.Errorf("指导采购价转换有误:[%v]", err)
|
return fmt.Errorf("指导采购价转换有误:[%v]", err)
|
||||||
}
|
}
|
||||||
if nStaffCostPrice < nWholesalePrice {
|
if nStaffCostPrice < nWholesalePrice {
|
||||||
return fmt.Errorf("导入价格有误,员工成本价低于指导采购价")
|
return fmt.Errorf("导入价格有误,员工成本价低于采购价")
|
||||||
}
|
}
|
||||||
|
|
||||||
nCount, err := strconv.ParseUint(list[i].Count, 10, 32)
|
nCount, err := strconv.ParseUint(list[i].Count, 10, 32)
|
||||||
|
@ -1865,7 +1865,7 @@ type ErpStockCommodityListReq struct {
|
||||||
StoreId uint32 `json:"store_id"` // 门店编号
|
StoreId uint32 `json:"store_id"` // 门店编号
|
||||||
SupplierId uint32 `json:"supplier_id"` // 供应商id
|
SupplierId uint32 `json:"supplier_id"` // 供应商id
|
||||||
State uint32 `json:"state"` // 库存状态:1-在库 2-已售 3-采购退货 4-调拨中 5-出库(前端只看1,4)
|
State uint32 `json:"state"` // 库存状态:1-在库 2-已售 3-采购退货 4-调拨中 5-出库(前端只看1,4)
|
||||||
Sn string `json:"sn"` // 首次入库订单编号
|
OriginalSn string `json:"original_sn"` // 首次入库订单编号
|
||||||
StorageType uint32 `json:"storage_type"` // 首次入库方式:1-系统入库 2-采购入库
|
StorageType uint32 `json:"storage_type"` // 首次入库方式:1-系统入库 2-采购入库
|
||||||
StockTimeStart string `json:"stock_time_start"` // 最近入库开始时间
|
StockTimeStart string `json:"stock_time_start"` // 最近入库开始时间
|
||||||
StockTimeEnd string `json:"stock_time_end"` // 最近入库结束时间
|
StockTimeEnd string `json:"stock_time_end"` // 最近入库结束时间
|
||||||
|
@ -1874,6 +1874,7 @@ type ErpStockCommodityListReq struct {
|
||||||
PageIndex int `json:"pageIndex"` // 页码
|
PageIndex int `json:"pageIndex"` // 页码
|
||||||
PageSize int `json:"pageSize"` // 每页展示数据条数
|
PageSize int `json:"pageSize"` // 每页展示数据条数
|
||||||
IsExport uint32 `json:"is_export"` // 是否导出excel:1-导出
|
IsExport uint32 `json:"is_export"` // 是否导出excel:1-导出
|
||||||
|
//Sn string `json:"sn"` // 首次入库订单编号
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErpStockCommodityListResp 库存详情接口响应参数
|
// ErpStockCommodityListResp 库存详情接口响应参数
|
||||||
|
@ -2083,7 +2084,8 @@ func (m *ErpStockCommodityListReq) buildQueryConditions(qs *gorm.DB) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.CommodityName != "" { //商品名称
|
if m.CommodityName != "" { //商品名称
|
||||||
qs = qs.Where("erp_commodity_name LIKE ?", "%"+m.CommodityName+"%")
|
//qs = qs.Where("erp_commodity_name LIKE ?", "%"+m.CommodityName+"%")
|
||||||
|
qs = qs.Where("erp_commodity_name = ?", m.CommodityName)
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.ErpCategoryId != 0 { //商品分类id
|
if m.ErpCategoryId != 0 { //商品分类id
|
||||||
|
@ -2109,8 +2111,8 @@ func (m *ErpStockCommodityListReq) buildQueryConditions(qs *gorm.DB) {
|
||||||
qs = qs.Where("state IN (?)", defaultStates)
|
qs = qs.Where("state IN (?)", defaultStates)
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.Sn != "" { //首次入库订单编号
|
if m.OriginalSn != "" { //首次入库订单编号
|
||||||
qs = qs.Where("original_sn=?", m.Sn)
|
qs = qs.Where("original_sn=?", m.OriginalSn)
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.StorageType != 0 { //首次入库方式
|
if m.StorageType != 0 { //首次入库方式
|
||||||
|
@ -2498,3 +2500,49 @@ func GetErpCommodityMap(ids []uint32) (map[uint32]ErpCommodity, error) {
|
||||||
|
|
||||||
return commodityMap, nil
|
return commodityMap, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CommodityCreateRequest struct {
|
||||||
|
Name string `json:"name" binding:"required"` // 商品名称
|
||||||
|
ErpCategoryId uint32 `json:"erp_category_id" binding:"required"` // 商品分类id
|
||||||
|
IsIMEI uint32 `json:"is_imei" binding:"required"` // 是否串码:1-串码类 2-非串码
|
||||||
|
ErpBarcode string `json:"erp_barcode"` // 商品条码
|
||||||
|
IMEIType uint32 `json:"imei_type"` // 系统生成串码:2-是(系统生成) 3-否(手动添加)
|
||||||
|
ErpSupplierId uint32 `json:"erp_supplier_id" binding:"required"` // 主供应商
|
||||||
|
RetailPrice float64 `json:"retail_price"` // 指导零售价
|
||||||
|
MinRetailPrice float64 `json:"min_retail_price"` // 最低零售价
|
||||||
|
StaffCostPrice float64 `json:"staff_cost_price"` // 员工成本价加价
|
||||||
|
WholesalePrice float64 `json:"wholesale_price"` // 指导采购价
|
||||||
|
Brokerage1 float64 `json:"brokerage_1"` // 销售毛利提成
|
||||||
|
Brokerage2 float64 `json:"brokerage_2"` // 员工毛利提成
|
||||||
|
MemberDiscount float64 `json:"member_discount"` // 会员优惠
|
||||||
|
Origin string `json:"origin"` // 产地
|
||||||
|
Remark string `json:"remark" gorm:"type:varchar(512)"` // 备注
|
||||||
|
}
|
||||||
|
|
||||||
|
type CommodityEditRequest struct {
|
||||||
|
Id uint32 `json:"id" binding:"required"` // 商品id
|
||||||
|
Name string `json:"name" binding:"required"` // 商品名称
|
||||||
|
ErpCategoryId uint32 `json:"erp_category_id" binding:"required"` // 商品分类id
|
||||||
|
ErpBarcode string `json:"erp_barcode"` // 商品条码
|
||||||
|
IsIMEI uint32 `json:"is_imei" binding:"required"` // 是否串码:1-串码类 2-非串码
|
||||||
|
IMEIType uint32 `json:"imei_type" binding:"required"` // 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||||
|
ErpSupplierId uint32 `json:"erp_supplier_id" binding:"required"` // 主供应商id
|
||||||
|
RetailPrice float64 `json:"retail_price"` // 指导零售价
|
||||||
|
MinRetailPrice float64 `json:"min_retail_price"` // 最低零售价
|
||||||
|
StaffCostPrice float64 `json:"staff_cost_price"` // 员工成本价加价
|
||||||
|
WholesalePrice float64 `json:"wholesale_price"` // 指导采购价
|
||||||
|
Brokerage1 float64 `json:"brokerage_1"` // 销售毛利提成
|
||||||
|
Brokerage2 float64 `json:"brokerage_2"` // 员工毛利提成
|
||||||
|
MemberDiscount float64 `json:"member_discount"` // 会员优惠
|
||||||
|
Origin string `json:"origin"` // 产地
|
||||||
|
Remark string `json:"remark" gorm:"type:varchar(512)"` // 备注
|
||||||
|
}
|
||||||
|
|
||||||
|
type CommodityDetailRequest struct {
|
||||||
|
ErpCommodityId uint32 `json:"erp_commodity_id"` // 商品id
|
||||||
|
SerialNumber string `json:"serial_number"` // 商品编号
|
||||||
|
}
|
||||||
|
|
||||||
|
type CommodityDelRequest struct {
|
||||||
|
ErpCommodityId uint32 `json:"erp_commodity_id" binding:"required"` // 商品id
|
||||||
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"math"
|
"math"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -249,6 +250,7 @@ type ErpOrderStoreManageDataReq struct {
|
||||||
PageIndex int `json:"pageIndex"` // 页码
|
PageIndex int `json:"pageIndex"` // 页码
|
||||||
PageSize int `json:"pageSize"` // 页面条数
|
PageSize int `json:"pageSize"` // 页面条数
|
||||||
IsExport uint32 `json:"is_export"` // 1-导出
|
IsExport uint32 `json:"is_export"` // 1-导出
|
||||||
|
SortType string `json:"sort_type"` // 排序类型:desc 降序、asc 升序
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErpOrderStoreManageDataResp 查询门店经营出参
|
// ErpOrderStoreManageDataResp 查询门店经营出参
|
||||||
|
@ -806,7 +808,7 @@ func findRightErpStockCommodityId(idList map[uint32][]uint32, commodityId uint32
|
||||||
// 有串码,通过串码查找库存详情表,然后更改对应库存的状态为"在库";
|
// 有串码,通过串码查找库存详情表,然后更改对应库存的状态为"在库";
|
||||||
// 非串码,通过门店id、商品id、商品名称查找库存详情表,找到状态为"已售"且时间最近的单,将其状态改为"在库"
|
// 非串码,通过门店id、商品id、商品名称查找库存详情表,找到状态为"已售"且时间最近的单,将其状态改为"在库"
|
||||||
// 同时扣减库存表对应的数量,+1
|
// 同时扣减库存表对应的数量,+1
|
||||||
func UpdateStock(gdb *gorm.DB, erpOrder ErpOrder, state int) error {
|
func UpdateStock(gdb *gorm.DB, erpOrder ErpOrder, state, auditState int) error {
|
||||||
var commodities []ErpOrderCommodity
|
var commodities []ErpOrderCommodity
|
||||||
err := orm.Eloquent.Table("erp_order_commodity").Where("erp_order_id = ?", erpOrder.ID).
|
err := orm.Eloquent.Table("erp_order_commodity").Where("erp_order_id = ?", erpOrder.ID).
|
||||||
Find(&commodities).Error
|
Find(&commodities).Error
|
||||||
|
@ -975,7 +977,12 @@ func UpdateStock(gdb *gorm.DB, erpOrder ErpOrder, state int) error {
|
||||||
var vmCount int
|
var vmCount int
|
||||||
var describe, event string
|
var describe, event string
|
||||||
if erpOrder.RetailType == RetailTypeSale && state == SoldOut { // 零售订单,而且订单已支付,更新用户积分
|
if erpOrder.RetailType == RetailTypeSale && state == SoldOut { // 零售订单,而且订单已支付,更新用户积分
|
||||||
describe = "零售销售获得积分"
|
if auditState == 2 {
|
||||||
|
describe = "零售退货反审核获得积分"
|
||||||
|
} else {
|
||||||
|
describe = "零售销售获得积分"
|
||||||
|
}
|
||||||
|
|
||||||
event = VmEventErpOrderSale
|
event = VmEventErpOrderSale
|
||||||
vmCount = tools.RoundFloat64(erpOrder.TotalAmount)
|
vmCount = tools.RoundFloat64(erpOrder.TotalAmount)
|
||||||
} else if erpOrder.RetailType == RetailTypeRejected { // 退货订单,扣减用户积分
|
} else if erpOrder.RetailType == RetailTypeRejected { // 退货订单,扣减用户积分
|
||||||
|
@ -1175,11 +1182,11 @@ func (m *ErpOrder) SetOrderSalesman() error {
|
||||||
item.Name = userInfo.NickName
|
item.Name = userInfo.NickName
|
||||||
item.SalesmanPer = staffProfit * userInfo.SalesCommRate / float64(len(salesmanInfo))
|
item.SalesmanPer = staffProfit * userInfo.SalesCommRate / float64(len(salesmanInfo))
|
||||||
|
|
||||||
if m.RetailType == RetailTypeRejected {
|
//if m.RetailType == RetailTypeRejected {
|
||||||
item.SalesProfitPer = -item.SalesProfitPer
|
// item.SalesProfitPer = -item.SalesProfitPer
|
||||||
item.StaffProfitPer = -item.StaffProfitPer
|
// item.StaffProfitPer = -item.StaffProfitPer
|
||||||
item.SalesmanPer = -item.SalesmanPer
|
// item.SalesmanPer = -item.SalesmanPer
|
||||||
}
|
//}
|
||||||
|
|
||||||
salesmanList = append(salesmanList, item)
|
salesmanList = append(salesmanList, item)
|
||||||
}
|
}
|
||||||
|
@ -1750,7 +1757,7 @@ func updateErpStockCommodity(gdb *gorm.DB, billSn string) error {
|
||||||
return errors.New("未查询到订单")
|
return errors.New("未查询到订单")
|
||||||
}
|
}
|
||||||
|
|
||||||
err = UpdateStock(gdb, erpOrderInfo[0], SoldOut)
|
err = UpdateStock(gdb, erpOrderInfo[0], SoldOut, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
gdb.Rollback()
|
gdb.Rollback()
|
||||||
logger.Error("updateErpStockCommodity UpdateStock err:", logger.Field("err", err))
|
logger.Error("updateErpStockCommodity UpdateStock err:", logger.Field("err", err))
|
||||||
|
@ -1844,12 +1851,21 @@ func QueryStoreManageData(req *ErpOrderStoreManageDataReq, c *gin.Context) (*Erp
|
||||||
qs = qs.Where("maker_time IS NOT NULL")
|
qs = qs.Where("maker_time IS NOT NULL")
|
||||||
|
|
||||||
// 查询数据
|
// 查询数据
|
||||||
err = qs.Select("DATE_FORMAT(maker_time, '%Y-%m-%d') AS date, SUM(total_amount) AS total_sales_amount, " +
|
if req.SortType == "asc" {
|
||||||
"(SUM(total_retail_price) - SUM(total_amount)) AS promotion_fee, " +
|
err = qs.Select("DATE_FORMAT(maker_time, '%Y-%m-%d') AS date, SUM(total_amount) AS total_sales_amount, " +
|
||||||
"SUM(total_sales_profit) AS sales_profit, SUM(total_staff_profit) AS staff_profit, SUM(total_count) AS count").
|
"(SUM(total_retail_price) - SUM(total_amount)) AS promotion_fee, " +
|
||||||
Group("date").
|
"SUM(total_sales_profit) AS sales_profit, SUM(total_staff_profit) AS staff_profit, SUM(total_count) AS count").
|
||||||
Order("date DESC").
|
Group("date").
|
||||||
Find(&storeManageDataList).Error
|
Order("date ASC").
|
||||||
|
Find(&storeManageDataList).Error
|
||||||
|
} else {
|
||||||
|
err = qs.Select("DATE_FORMAT(maker_time, '%Y-%m-%d') AS date, SUM(total_amount) AS total_sales_amount, " +
|
||||||
|
"(SUM(total_retail_price) - SUM(total_amount)) AS promotion_fee, " +
|
||||||
|
"SUM(total_sales_profit) AS sales_profit, SUM(total_staff_profit) AS staff_profit, SUM(total_count) AS count").
|
||||||
|
Group("date").
|
||||||
|
Order("date DESC").
|
||||||
|
Find(&storeManageDataList).Error
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("QueryStoreManageData err:", logger.Field("err", err))
|
logger.Error("QueryStoreManageData err:", logger.Field("err", err))
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -1912,7 +1928,23 @@ func constructFinalStoreManageDataList(storeManageDataList []StoreManageData, re
|
||||||
return storeManageDataList
|
return storeManageDataList
|
||||||
}
|
}
|
||||||
|
|
||||||
for d := startDate; d.Before(endDate) || d.Equal(endDate); d = d.AddDate(0, 0, 1) {
|
//for d := startDate; d.Before(endDate) || d.Equal(endDate); d = d.AddDate(0, 0, 1) {
|
||||||
|
// dateStr := d.Format("2006-01-02")
|
||||||
|
// data, found := storeDataMap[dateStr]
|
||||||
|
// if !found {
|
||||||
|
// data = StoreManageData{
|
||||||
|
// Date: dateStr,
|
||||||
|
// TotalSalesAmount: 0,
|
||||||
|
// PromotionFee: 0,
|
||||||
|
// SalesProfit: 0,
|
||||||
|
// StaffProfit: 0,
|
||||||
|
// Count: 0,
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// finalStoreManageDataList = append(finalStoreManageDataList, data)
|
||||||
|
//}
|
||||||
|
|
||||||
|
for d := endDate; d.After(startDate) || d.Equal(startDate); d = d.AddDate(0, 0, -1) {
|
||||||
dateStr := d.Format("2006-01-02")
|
dateStr := d.Format("2006-01-02")
|
||||||
data, found := storeDataMap[dateStr]
|
data, found := storeDataMap[dateStr]
|
||||||
if !found {
|
if !found {
|
||||||
|
@ -2146,7 +2178,15 @@ func QueryRetailMargin(req *ErpOrderRetailMarginReq, c *gin.Context) (*ErpOrderR
|
||||||
qs.Where("erp_order.pay_status = ? or (erp_order.retail_type = ? and erp_order.state != ?)",
|
qs.Where("erp_order.pay_status = ? or (erp_order.retail_type = ? and erp_order.state != ?)",
|
||||||
HavePaid, RetailTypeRejected, ErpOrderStateUnAudit)
|
HavePaid, RetailTypeRejected, ErpOrderStateUnAudit)
|
||||||
// 添加排序规则
|
// 添加排序规则
|
||||||
qs = qs.Order("erp_order_commodity.erp_commodity_id ASC, erp_order.store_id ASC, erp_order.retail_type ASC")
|
//qs = qs.Order("erp_order_commodity.erp_commodity_id ASC, erp_order.store_id ASC, erp_order.retail_type ASC")
|
||||||
|
qs = qs.Order(`
|
||||||
|
erp_order_commodity.erp_commodity_id ASC,
|
||||||
|
erp_order.store_id ASC,
|
||||||
|
CASE erp_order.retail_type
|
||||||
|
WHEN 'sale' THEN 0
|
||||||
|
WHEN 'rejected' THEN 1
|
||||||
|
ELSE 2
|
||||||
|
END ASC`)
|
||||||
|
|
||||||
if req.IsExport == 1 { //导出excel
|
if req.IsExport == 1 { //导出excel
|
||||||
err := qs.Find(&result).Error
|
err := qs.Find(&result).Error
|
||||||
|
@ -2265,6 +2305,21 @@ func QueryRetailMargin(req *ErpOrderRetailMarginReq, c *gin.Context) (*ErpOrderR
|
||||||
resp.TotalSalesMargin += data.SalesMargin
|
resp.TotalSalesMargin += data.SalesMargin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 对列表按照您想要的顺序进行排序
|
||||||
|
sort.Slice(list, func(i, j int) bool {
|
||||||
|
// 按照 StoreId 升序排列
|
||||||
|
if list[i].StoreId != list[j].StoreId {
|
||||||
|
return list[i].StoreId < list[j].StoreId
|
||||||
|
}
|
||||||
|
// 按照 ErpCommodityId 升序排列
|
||||||
|
if list[i].ErpCommodityId != list[j].ErpCommodityId {
|
||||||
|
return list[i].ErpCommodityId < list[j].ErpCommodityId
|
||||||
|
}
|
||||||
|
// 按照 RetailType 的顺序进行排序
|
||||||
|
retailTypeOrder := map[string]int{"sale": 0, "rejected": 1}
|
||||||
|
return retailTypeOrder[list[i].RetailType] < retailTypeOrder[list[j].RetailType]
|
||||||
|
})
|
||||||
|
|
||||||
// 将结果赋值给 resp.List
|
// 将结果赋值给 resp.List
|
||||||
resp.List = list
|
resp.List = list
|
||||||
|
|
||||||
|
|
|
@ -1208,52 +1208,55 @@ func GenerateSerialNumber(categoryId uint32) (string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateErpStockAmountInfo 更新库存和库存商品表的金额:指导零售价、最低零售价
|
// UpdateErpStockAmountInfo 更新库存和库存商品表的金额:指导零售价、最低零售价
|
||||||
func UpdateErpStockAmountInfo(begin *gorm.DB, commodityId uint32, retailPrice, minRetailPrice float64, barCode string,
|
func UpdateErpStockAmountInfo(begin *gorm.DB, req *CommodityEditRequest, barCode string, category *ErpCategory) error {
|
||||||
category *ErpCategory) error {
|
|
||||||
if category != nil && category.ID != 0 { // 分类信息有值
|
if category != nil && category.ID != 0 { // 分类信息有值
|
||||||
// 更新库存表
|
// 更新库存表
|
||||||
err := begin.Table("erp_stock").Where("erp_commodity_id=?", commodityId).
|
err := begin.Table("erp_stock").Where("erp_commodity_id=?", req.Id).
|
||||||
Updates(map[string]interface{}{
|
Updates(map[string]interface{}{
|
||||||
"retail_price": retailPrice,
|
"retail_price": req.RetailPrice,
|
||||||
"min_retail_price": minRetailPrice,
|
"min_retail_price": req.MinRetailPrice,
|
||||||
"erp_category_id": category.ID,
|
"erp_category_id": category.ID,
|
||||||
"erp_category_name": category.Name,
|
"erp_category_name": category.Name,
|
||||||
|
"erp_commodity_name": req.Name,
|
||||||
}).Error
|
}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新库存商品表
|
// 更新库存商品表
|
||||||
err = begin.Table("erp_stock_commodity").Where("erp_commodity_id=? and state not in (2,5)", commodityId).
|
err = begin.Table("erp_stock_commodity").Where("erp_commodity_id=? and state not in (2,5)", req.Id).
|
||||||
Updates(map[string]interface{}{
|
Updates(map[string]interface{}{
|
||||||
"retail_price": retailPrice,
|
"retail_price": req.RetailPrice,
|
||||||
"min_retail_price": minRetailPrice,
|
"min_retail_price": req.MinRetailPrice,
|
||||||
//"staff_cost_price": staffCostPrice,
|
//"staff_cost_price": staffCostPrice,
|
||||||
"erp_barcode": barCode,
|
"erp_barcode": barCode,
|
||||||
"erp_category_id": category.ID,
|
"erp_category_id": category.ID,
|
||||||
"erp_category_name": category.Name,
|
"erp_category_name": category.Name,
|
||||||
|
"erp_commodity_name": req.Name,
|
||||||
}).Error
|
}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 更新库存表
|
// 更新库存表
|
||||||
err := begin.Table("erp_stock").Where("erp_commodity_id=?", commodityId).
|
err := begin.Table("erp_stock").Where("erp_commodity_id=?", req.Id).
|
||||||
Updates(map[string]interface{}{
|
Updates(map[string]interface{}{
|
||||||
"retail_price": retailPrice,
|
"retail_price": req.RetailPrice,
|
||||||
"min_retail_price": minRetailPrice,
|
"min_retail_price": req.MinRetailPrice,
|
||||||
|
"erp_commodity_name": req.Name,
|
||||||
}).Error
|
}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新库存商品表
|
// 更新库存商品表
|
||||||
err = begin.Table("erp_stock_commodity").Where("erp_commodity_id=? and state not in (2,5)", commodityId).
|
err = begin.Table("erp_stock_commodity").Where("erp_commodity_id=? and state not in (2,5)", req.Id).
|
||||||
Updates(map[string]interface{}{
|
Updates(map[string]interface{}{
|
||||||
"retail_price": retailPrice,
|
"retail_price": req.RetailPrice,
|
||||||
"min_retail_price": minRetailPrice,
|
"min_retail_price": req.MinRetailPrice,
|
||||||
//"staff_cost_price": staffCostPrice,
|
//"staff_cost_price": staffCostPrice,
|
||||||
"erp_barcode": barCode,
|
"erp_barcode": barCode,
|
||||||
|
"erp_commodity_name": req.Name,
|
||||||
}).Error
|
}).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -745,3 +745,13 @@ func (m *ProductInventoryListReq) List() (*ProductInventoryListResp, error) {
|
||||||
resp.List = orders
|
resp.List = orders
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ProductInventoryGetIMEIReq 系统生成串码入参
|
||||||
|
type ProductInventoryGetIMEIReq struct {
|
||||||
|
CommodityId uint32 `json:"commodity_id" binding:"required"` // 商品id
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProductInventoryGetIMEIResp 系统生成串码出参
|
||||||
|
type ProductInventoryGetIMEIResp struct {
|
||||||
|
IMEI string `json:"imei"` // 商品串码
|
||||||
|
}
|
||||||
|
|
|
@ -1557,7 +1557,7 @@ func ExecuteErpPurchase(req *ErpPurchaseExecuteReq, c *gin.Context) (*ErpPurchas
|
||||||
imei := "" // 默认退货单执行时不需要串码
|
imei := "" // 默认退货单执行时不需要串码
|
||||||
if inventory.PurchaseType == ErpProcureOrder && commodityInfo.IMEIType == 2 { // 采购单
|
if inventory.PurchaseType == ErpProcureOrder && commodityInfo.IMEIType == 2 { // 采购单
|
||||||
// 调用函数B生成商品串码
|
// 调用函数B生成商品串码
|
||||||
imei, err = generateIMEI(inventory.ErpCommodityId)
|
imei, err = GenerateIMEI(inventory.ErpCommodityId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -1596,8 +1596,8 @@ func ExecuteErpPurchase(req *ErpPurchaseExecuteReq, c *gin.Context) (*ErpPurchas
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// 生成串码
|
// GenerateIMEI 生成串码
|
||||||
func generateIMEI(commodityId uint32) (string, error) {
|
func GenerateIMEI(commodityId uint32) (string, error) {
|
||||||
commodity, err := GetCommodity(commodityId)
|
commodity, err := GetCommodity(commodityId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
@ -5151,6 +5151,7 @@ func GetReportDetail(req *ErpPurchaseReportDetailReq, c *gin.Context) (*ErpPurch
|
||||||
resp.List[i].Price = -price
|
resp.List[i].Price = -price
|
||||||
resp.List[i].DifferencePrice = -resp.List[i].DifferencePrice
|
resp.List[i].DifferencePrice = -resp.List[i].DifferencePrice
|
||||||
resp.List[i].RejectPrice = -resp.List[i].RejectPrice
|
resp.List[i].RejectPrice = -resp.List[i].RejectPrice
|
||||||
|
resp.List[i].EmployeePrice = -resp.List[i].EmployeePrice
|
||||||
|
|
||||||
resp.List[i].DifferencePrice = resp.List[i].Price - resp.List[i].RejectPrice
|
resp.List[i].DifferencePrice = resp.List[i].Price - resp.List[i].RejectPrice
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,13 @@ package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/xuri/excelize/v2"
|
"github.com/xuri/excelize/v2"
|
||||||
orm "go-admin/common/global"
|
orm "go-admin/common/global"
|
||||||
"go-admin/logger"
|
"go-admin/logger"
|
||||||
|
"go-admin/tools"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -74,7 +77,7 @@ type RecycleCardOrderListRsp struct {
|
||||||
Url string `json:"url"`
|
Url string `json:"url"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *RecycleCardOrderListReq) List() (RecycleCardOrderListRsp, error) {
|
func (m *RecycleCardOrderListReq) List(c *gin.Context) (RecycleCardOrderListRsp, error) {
|
||||||
rsp := RecycleCardOrderListRsp{
|
rsp := RecycleCardOrderListRsp{
|
||||||
PageIndex: m.PageIdx,
|
PageIndex: m.PageIdx,
|
||||||
}
|
}
|
||||||
|
@ -89,6 +92,46 @@ func (m *RecycleCardOrderListReq) List() (RecycleCardOrderListRsp, error) {
|
||||||
|
|
||||||
var list []RecycleCardOrder
|
var list []RecycleCardOrder
|
||||||
qs := orm.Eloquent.Table("recycle_card_order")
|
qs := orm.Eloquent.Table("recycle_card_order")
|
||||||
|
|
||||||
|
// 非管理员才判断所属门店
|
||||||
|
if !(tools.GetRoleName(c) == "admin" || tools.GetRoleName(c) == "系统管理员") {
|
||||||
|
sysUser, err := GetSysUserByCtx(c)
|
||||||
|
if err != nil {
|
||||||
|
return RecycleCardOrderListRsp{}, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回sysUser未过期的门店id列表
|
||||||
|
storeList := GetValidStoreIDs(sysUser.StoreData)
|
||||||
|
if m.StoreId != 0 {
|
||||||
|
if !Contains(storeList, m.StoreId) {
|
||||||
|
return RecycleCardOrderListRsp{}, errors.New("您没有该门店权限")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if len(storeList) > 0 {
|
||||||
|
qs = qs.Where("store_id IN (?)", storeList)
|
||||||
|
} else {
|
||||||
|
return RecycleCardOrderListRsp{}, errors.New("用户未绑定门店")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if m.CooperativeBusinessId != 0 {
|
||||||
|
var stores []Store
|
||||||
|
err := orm.Eloquent.Table("store").Where("cooperative_business_id=?", m.CooperativeBusinessId).
|
||||||
|
Find(&stores).Error
|
||||||
|
if err != nil {
|
||||||
|
logger.Error("stores err:", logger.Field("err", err))
|
||||||
|
return rsp, err
|
||||||
|
}
|
||||||
|
storeIds := make([]uint32, 0, len(stores))
|
||||||
|
for i, _ := range stores {
|
||||||
|
storeIds = append(storeIds, stores[i].ID)
|
||||||
|
}
|
||||||
|
if len(storeIds) > 0 && m.StoreId == 0 {
|
||||||
|
qs = qs.Where("store_id IN (?)", storeIds)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if m.Uid != 0 {
|
if m.Uid != 0 {
|
||||||
qs = qs.Where("uid=?", m.Uid)
|
qs = qs.Where("uid=?", m.Uid)
|
||||||
}
|
}
|
||||||
|
@ -138,22 +181,7 @@ func (m *RecycleCardOrderListReq) List() (RecycleCardOrderListRsp, error) {
|
||||||
parse = parse.AddDate(0, 0, 1)
|
parse = parse.AddDate(0, 0, 1)
|
||||||
qs = qs.Where("check_time < ?", parse)
|
qs = qs.Where("check_time < ?", parse)
|
||||||
}
|
}
|
||||||
if m.CooperativeBusinessId != 0 {
|
|
||||||
var stores []Store
|
|
||||||
err := orm.Eloquent.Table("store").Where("cooperative_business_id=?", m.CooperativeBusinessId).
|
|
||||||
Find(&stores).Error
|
|
||||||
if err != nil {
|
|
||||||
logger.Error("stores err:", logger.Field("err", err))
|
|
||||||
return rsp, err
|
|
||||||
}
|
|
||||||
storeIds := make([]uint32, 0, len(stores))
|
|
||||||
for i, _ := range stores {
|
|
||||||
storeIds = append(storeIds, stores[i].ID)
|
|
||||||
}
|
|
||||||
if len(storeIds) > 0 && m.StoreId == 0 {
|
|
||||||
qs = qs.Where("store_id IN (?)", storeIds)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//qs := NewRecycleCardOrderQuerySet(DB).UidEq(m.Uid)
|
//qs := NewRecycleCardOrderQuerySet(DB).UidEq(m.Uid)
|
||||||
var count int64
|
var count int64
|
||||||
err := qs.Count(&count).Error
|
err := qs.Count(&count).Error
|
||||||
|
|
|
@ -2883,6 +2883,9 @@ func (m *AssistantInviteMemberReportReq) List() (*AssistantInviteMemberReportLis
|
||||||
//}
|
//}
|
||||||
if m.InviteName != "" {
|
if m.InviteName != "" {
|
||||||
m.Uid = uids[m.InviteName]
|
m.Uid = uids[m.InviteName]
|
||||||
|
if m.Uid == 0 {
|
||||||
|
qs = qs.Where("uid=?", m.Uid)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if m.Uid != 0 {
|
if m.Uid != 0 {
|
||||||
qs = qs.Where("uid=?", m.Uid)
|
qs = qs.Where("uid=?", m.Uid)
|
||||||
|
|
|
@ -19,12 +19,13 @@ func registerInventoryManageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJ
|
||||||
|
|
||||||
// 产品入库
|
// 产品入库
|
||||||
r1 := v1.Group("/inventory/product").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
|
r1 := v1.Group("/inventory/product").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
|
||||||
r1.POST("add", inventorymanage.ProductInventoryAdd) // 新增
|
r1.POST("add", inventorymanage.ProductInventoryAdd) // 新增
|
||||||
r1.POST("edit", inventorymanage.ProductInventoryEdit) // 编辑
|
r1.POST("edit", inventorymanage.ProductInventoryEdit) // 编辑
|
||||||
r1.POST("audit", inventorymanage.ProductInventoryAudit) // 审核
|
r1.POST("audit", inventorymanage.ProductInventoryAudit) // 审核
|
||||||
r1.POST("delete", inventorymanage.ProductInventoryDelete) // 删除
|
r1.POST("delete", inventorymanage.ProductInventoryDelete) // 删除
|
||||||
r1.POST("list", inventorymanage.ProductInventoryList) // 列表
|
r1.POST("list", inventorymanage.ProductInventoryList) // 列表
|
||||||
r1.POST("detail", inventorymanage.ProductInventoryDetail) // 详情
|
r1.POST("detail", inventorymanage.ProductInventoryDetail) // 详情
|
||||||
|
r1.POST("getIMEI", inventorymanage.ProductInventoryGetIMEI) // 系统生成串码
|
||||||
|
|
||||||
// 库存调拨
|
// 库存调拨
|
||||||
r3 := v1.Group("/inventory/allot").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
|
r3 := v1.Group("/inventory/allot").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole())
|
||||||
|
|
412
docs/docs.go
412
docs/docs.go
|
@ -427,7 +427,7 @@ const docTemplate = `{
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/basic.CommodityCreateRequest"
|
"$ref": "#/definitions/models.CommodityCreateRequest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -460,7 +460,7 @@ const docTemplate = `{
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/basic.CommodityDelRequest"
|
"$ref": "#/definitions/models.CommodityDelRequest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -493,7 +493,7 @@ const docTemplate = `{
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/basic.CommodityDetailRequest"
|
"$ref": "#/definitions/models.CommodityDetailRequest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -526,7 +526,7 @@ const docTemplate = `{
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/basic.CommodityEditRequest"
|
"$ref": "#/definitions/models.CommodityEditRequest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -3578,6 +3578,39 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api/v1/inventory/product/getIMEI": {
|
||||||
|
"post": {
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"产品入库,V1.4.0"
|
||||||
|
],
|
||||||
|
"summary": "系统生成串码",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "系统生成串码模型",
|
||||||
|
"name": "request",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.ProductInventoryGetIMEIReq"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.ProductInventoryGetIMEIResp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/api/v1/inventory/product/list": {
|
"/api/v1/inventory/product/list": {
|
||||||
"post": {
|
"post": {
|
||||||
"consumes": [
|
"consumes": [
|
||||||
|
@ -6011,179 +6044,6 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"basic.CommodityCreateRequest": {
|
|
||||||
"type": "object",
|
|
||||||
"required": [
|
|
||||||
"erp_category_id",
|
|
||||||
"erp_supplier_id",
|
|
||||||
"is_imei",
|
|
||||||
"name"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"brokerage_1": {
|
|
||||||
"description": "销售毛利提成",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"brokerage_2": {
|
|
||||||
"description": "员工毛利提成",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"erp_barcode": {
|
|
||||||
"description": "商品条码",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"erp_category_id": {
|
|
||||||
"description": "商品分类id",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"erp_supplier_id": {
|
|
||||||
"description": "主供应商",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"imei_type": {
|
|
||||||
"description": "系统生成串码:2-是(系统生成) 3-否(手动添加)",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"is_imei": {
|
|
||||||
"description": "是否串码:1-串码类 2-非串码",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"member_discount": {
|
|
||||||
"description": "会员优惠",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"min_retail_price": {
|
|
||||||
"description": "最低零售价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"description": "商品名称",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"origin": {
|
|
||||||
"description": "产地",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"remark": {
|
|
||||||
"description": "备注",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"retail_price": {
|
|
||||||
"description": "指导零售价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"staff_cost_price": {
|
|
||||||
"description": "员工成本价加价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"wholesale_price": {
|
|
||||||
"description": "指导采购价",
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"basic.CommodityDelRequest": {
|
|
||||||
"type": "object",
|
|
||||||
"required": [
|
|
||||||
"erp_commodity_id"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"erp_commodity_id": {
|
|
||||||
"description": "商品id",
|
|
||||||
"type": "integer"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"basic.CommodityDetailRequest": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"erp_commodity_id": {
|
|
||||||
"description": "商品id",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"serial_number": {
|
|
||||||
"description": "商品编号",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"basic.CommodityEditRequest": {
|
|
||||||
"type": "object",
|
|
||||||
"required": [
|
|
||||||
"erp_category_id",
|
|
||||||
"erp_supplier_id",
|
|
||||||
"id",
|
|
||||||
"imei_type",
|
|
||||||
"is_imei",
|
|
||||||
"name"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"brokerage_1": {
|
|
||||||
"description": "销售毛利提成",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"brokerage_2": {
|
|
||||||
"description": "员工毛利提成",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"erp_barcode": {
|
|
||||||
"description": "商品条码",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"erp_category_id": {
|
|
||||||
"description": "商品分类id",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"erp_supplier_id": {
|
|
||||||
"description": "主供应商id",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"id": {
|
|
||||||
"description": "商品id",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"imei_type": {
|
|
||||||
"description": "1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"is_imei": {
|
|
||||||
"description": "是否串码:1-串码类 2-非串码",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"member_discount": {
|
|
||||||
"description": "会员优惠",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"min_retail_price": {
|
|
||||||
"description": "最低零售价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"description": "商品名称",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"origin": {
|
|
||||||
"description": "产地",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"remark": {
|
|
||||||
"description": "备注",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"retail_price": {
|
|
||||||
"description": "指导零售价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"staff_cost_price": {
|
|
||||||
"description": "员工成本价加价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"wholesale_price": {
|
|
||||||
"description": "指导采购价",
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"basic.CreateCategoryRequest": {
|
"basic.CreateCategoryRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -6640,6 +6500,179 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.CommodityCreateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"erp_category_id",
|
||||||
|
"erp_supplier_id",
|
||||||
|
"is_imei",
|
||||||
|
"name"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"brokerage_1": {
|
||||||
|
"description": "销售毛利提成",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"brokerage_2": {
|
||||||
|
"description": "员工毛利提成",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"erp_barcode": {
|
||||||
|
"description": "商品条码",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"erp_category_id": {
|
||||||
|
"description": "商品分类id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"erp_supplier_id": {
|
||||||
|
"description": "主供应商",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"imei_type": {
|
||||||
|
"description": "系统生成串码:2-是(系统生成) 3-否(手动添加)",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"is_imei": {
|
||||||
|
"description": "是否串码:1-串码类 2-非串码",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"member_discount": {
|
||||||
|
"description": "会员优惠",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"min_retail_price": {
|
||||||
|
"description": "最低零售价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"description": "商品名称",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"description": "产地",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"remark": {
|
||||||
|
"description": "备注",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"retail_price": {
|
||||||
|
"description": "指导零售价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"staff_cost_price": {
|
||||||
|
"description": "员工成本价加价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"wholesale_price": {
|
||||||
|
"description": "指导采购价",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.CommodityDelRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"erp_commodity_id"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"erp_commodity_id": {
|
||||||
|
"description": "商品id",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.CommodityDetailRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"erp_commodity_id": {
|
||||||
|
"description": "商品id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"serial_number": {
|
||||||
|
"description": "商品编号",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.CommodityEditRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"erp_category_id",
|
||||||
|
"erp_supplier_id",
|
||||||
|
"id",
|
||||||
|
"imei_type",
|
||||||
|
"is_imei",
|
||||||
|
"name"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"brokerage_1": {
|
||||||
|
"description": "销售毛利提成",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"brokerage_2": {
|
||||||
|
"description": "员工毛利提成",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"erp_barcode": {
|
||||||
|
"description": "商品条码",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"erp_category_id": {
|
||||||
|
"description": "商品分类id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"erp_supplier_id": {
|
||||||
|
"description": "主供应商id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"description": "商品id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"imei_type": {
|
||||||
|
"description": "1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"is_imei": {
|
||||||
|
"description": "是否串码:1-串码类 2-非串码",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"member_discount": {
|
||||||
|
"description": "会员优惠",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"min_retail_price": {
|
||||||
|
"description": "最低零售价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"description": "商品名称",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"description": "产地",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"remark": {
|
||||||
|
"description": "备注",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"retail_price": {
|
||||||
|
"description": "指导零售价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"staff_cost_price": {
|
||||||
|
"description": "员工成本价加价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"wholesale_price": {
|
||||||
|
"description": "指导采购价",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"models.CommodityExcel": {
|
"models.CommodityExcel": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -9232,6 +9265,10 @@ const docTemplate = `{
|
||||||
"description": "页面条数",
|
"description": "页面条数",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"sort_type": {
|
||||||
|
"description": "排序类型:desc 降序、asc 升序",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"start_time": {
|
"start_time": {
|
||||||
"description": "开始时间",
|
"description": "开始时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -13232,6 +13269,27 @@ const docTemplate = `{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.ProductInventoryGetIMEIReq": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"commodity_id"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"commodity_id": {
|
||||||
|
"description": "商品id",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.ProductInventoryGetIMEIResp": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"imei": {
|
||||||
|
"description": "商品串码",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"models.ProductInventoryListReq": {
|
"models.ProductInventoryListReq": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
@ -416,7 +416,7 @@
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/basic.CommodityCreateRequest"
|
"$ref": "#/definitions/models.CommodityCreateRequest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -449,7 +449,7 @@
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/basic.CommodityDelRequest"
|
"$ref": "#/definitions/models.CommodityDelRequest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -482,7 +482,7 @@
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/basic.CommodityDetailRequest"
|
"$ref": "#/definitions/models.CommodityDetailRequest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -515,7 +515,7 @@
|
||||||
"in": "body",
|
"in": "body",
|
||||||
"required": true,
|
"required": true,
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/definitions/basic.CommodityEditRequest"
|
"$ref": "#/definitions/models.CommodityEditRequest"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -3567,6 +3567,39 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/api/v1/inventory/product/getIMEI": {
|
||||||
|
"post": {
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"产品入库,V1.4.0"
|
||||||
|
],
|
||||||
|
"summary": "系统生成串码",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "系统生成串码模型",
|
||||||
|
"name": "request",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.ProductInventoryGetIMEIReq"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/models.ProductInventoryGetIMEIResp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"/api/v1/inventory/product/list": {
|
"/api/v1/inventory/product/list": {
|
||||||
"post": {
|
"post": {
|
||||||
"consumes": [
|
"consumes": [
|
||||||
|
@ -6000,179 +6033,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"basic.CommodityCreateRequest": {
|
|
||||||
"type": "object",
|
|
||||||
"required": [
|
|
||||||
"erp_category_id",
|
|
||||||
"erp_supplier_id",
|
|
||||||
"is_imei",
|
|
||||||
"name"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"brokerage_1": {
|
|
||||||
"description": "销售毛利提成",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"brokerage_2": {
|
|
||||||
"description": "员工毛利提成",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"erp_barcode": {
|
|
||||||
"description": "商品条码",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"erp_category_id": {
|
|
||||||
"description": "商品分类id",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"erp_supplier_id": {
|
|
||||||
"description": "主供应商",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"imei_type": {
|
|
||||||
"description": "系统生成串码:2-是(系统生成) 3-否(手动添加)",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"is_imei": {
|
|
||||||
"description": "是否串码:1-串码类 2-非串码",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"member_discount": {
|
|
||||||
"description": "会员优惠",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"min_retail_price": {
|
|
||||||
"description": "最低零售价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"description": "商品名称",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"origin": {
|
|
||||||
"description": "产地",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"remark": {
|
|
||||||
"description": "备注",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"retail_price": {
|
|
||||||
"description": "指导零售价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"staff_cost_price": {
|
|
||||||
"description": "员工成本价加价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"wholesale_price": {
|
|
||||||
"description": "指导采购价",
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"basic.CommodityDelRequest": {
|
|
||||||
"type": "object",
|
|
||||||
"required": [
|
|
||||||
"erp_commodity_id"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"erp_commodity_id": {
|
|
||||||
"description": "商品id",
|
|
||||||
"type": "integer"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"basic.CommodityDetailRequest": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"erp_commodity_id": {
|
|
||||||
"description": "商品id",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"serial_number": {
|
|
||||||
"description": "商品编号",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"basic.CommodityEditRequest": {
|
|
||||||
"type": "object",
|
|
||||||
"required": [
|
|
||||||
"erp_category_id",
|
|
||||||
"erp_supplier_id",
|
|
||||||
"id",
|
|
||||||
"imei_type",
|
|
||||||
"is_imei",
|
|
||||||
"name"
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"brokerage_1": {
|
|
||||||
"description": "销售毛利提成",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"brokerage_2": {
|
|
||||||
"description": "员工毛利提成",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"erp_barcode": {
|
|
||||||
"description": "商品条码",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"erp_category_id": {
|
|
||||||
"description": "商品分类id",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"erp_supplier_id": {
|
|
||||||
"description": "主供应商id",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"id": {
|
|
||||||
"description": "商品id",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"imei_type": {
|
|
||||||
"description": "1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"is_imei": {
|
|
||||||
"description": "是否串码:1-串码类 2-非串码",
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"member_discount": {
|
|
||||||
"description": "会员优惠",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"min_retail_price": {
|
|
||||||
"description": "最低零售价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"description": "商品名称",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"origin": {
|
|
||||||
"description": "产地",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"remark": {
|
|
||||||
"description": "备注",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"retail_price": {
|
|
||||||
"description": "指导零售价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"staff_cost_price": {
|
|
||||||
"description": "员工成本价加价",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"wholesale_price": {
|
|
||||||
"description": "指导采购价",
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"basic.CreateCategoryRequest": {
|
"basic.CreateCategoryRequest": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -6629,6 +6489,179 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.CommodityCreateRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"erp_category_id",
|
||||||
|
"erp_supplier_id",
|
||||||
|
"is_imei",
|
||||||
|
"name"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"brokerage_1": {
|
||||||
|
"description": "销售毛利提成",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"brokerage_2": {
|
||||||
|
"description": "员工毛利提成",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"erp_barcode": {
|
||||||
|
"description": "商品条码",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"erp_category_id": {
|
||||||
|
"description": "商品分类id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"erp_supplier_id": {
|
||||||
|
"description": "主供应商",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"imei_type": {
|
||||||
|
"description": "系统生成串码:2-是(系统生成) 3-否(手动添加)",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"is_imei": {
|
||||||
|
"description": "是否串码:1-串码类 2-非串码",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"member_discount": {
|
||||||
|
"description": "会员优惠",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"min_retail_price": {
|
||||||
|
"description": "最低零售价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"description": "商品名称",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"description": "产地",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"remark": {
|
||||||
|
"description": "备注",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"retail_price": {
|
||||||
|
"description": "指导零售价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"staff_cost_price": {
|
||||||
|
"description": "员工成本价加价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"wholesale_price": {
|
||||||
|
"description": "指导采购价",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.CommodityDelRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"erp_commodity_id"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"erp_commodity_id": {
|
||||||
|
"description": "商品id",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.CommodityDetailRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"erp_commodity_id": {
|
||||||
|
"description": "商品id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"serial_number": {
|
||||||
|
"description": "商品编号",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.CommodityEditRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"erp_category_id",
|
||||||
|
"erp_supplier_id",
|
||||||
|
"id",
|
||||||
|
"imei_type",
|
||||||
|
"is_imei",
|
||||||
|
"name"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"brokerage_1": {
|
||||||
|
"description": "销售毛利提成",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"brokerage_2": {
|
||||||
|
"description": "员工毛利提成",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"erp_barcode": {
|
||||||
|
"description": "商品条码",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"erp_category_id": {
|
||||||
|
"description": "商品分类id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"erp_supplier_id": {
|
||||||
|
"description": "主供应商id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"description": "商品id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"imei_type": {
|
||||||
|
"description": "1-无串码 2-串码(系统生成) 3-串码(手动添加)",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"is_imei": {
|
||||||
|
"description": "是否串码:1-串码类 2-非串码",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"member_discount": {
|
||||||
|
"description": "会员优惠",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"min_retail_price": {
|
||||||
|
"description": "最低零售价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"description": "商品名称",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"origin": {
|
||||||
|
"description": "产地",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"remark": {
|
||||||
|
"description": "备注",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"retail_price": {
|
||||||
|
"description": "指导零售价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"staff_cost_price": {
|
||||||
|
"description": "员工成本价加价",
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"wholesale_price": {
|
||||||
|
"description": "指导采购价",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"models.CommodityExcel": {
|
"models.CommodityExcel": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -9221,6 +9254,10 @@
|
||||||
"description": "页面条数",
|
"description": "页面条数",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
|
"sort_type": {
|
||||||
|
"description": "排序类型:desc 降序、asc 升序",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"start_time": {
|
"start_time": {
|
||||||
"description": "开始时间",
|
"description": "开始时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -13221,6 +13258,27 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"models.ProductInventoryGetIMEIReq": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"commodity_id"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"commodity_id": {
|
||||||
|
"description": "商品id",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"models.ProductInventoryGetIMEIResp": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"imei": {
|
||||||
|
"description": "商品串码",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"models.ProductInventoryListReq": {
|
"models.ProductInventoryListReq": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|
|
@ -103,134 +103,6 @@ definitions:
|
||||||
description: 是否展示全部
|
description: 是否展示全部
|
||||||
type: boolean
|
type: boolean
|
||||||
type: object
|
type: object
|
||||||
basic.CommodityCreateRequest:
|
|
||||||
properties:
|
|
||||||
brokerage_1:
|
|
||||||
description: 销售毛利提成
|
|
||||||
type: number
|
|
||||||
brokerage_2:
|
|
||||||
description: 员工毛利提成
|
|
||||||
type: number
|
|
||||||
erp_barcode:
|
|
||||||
description: 商品条码
|
|
||||||
type: string
|
|
||||||
erp_category_id:
|
|
||||||
description: 商品分类id
|
|
||||||
type: integer
|
|
||||||
erp_supplier_id:
|
|
||||||
description: 主供应商
|
|
||||||
type: integer
|
|
||||||
imei_type:
|
|
||||||
description: 系统生成串码:2-是(系统生成) 3-否(手动添加)
|
|
||||||
type: integer
|
|
||||||
is_imei:
|
|
||||||
description: 是否串码:1-串码类 2-非串码
|
|
||||||
type: integer
|
|
||||||
member_discount:
|
|
||||||
description: 会员优惠
|
|
||||||
type: number
|
|
||||||
min_retail_price:
|
|
||||||
description: 最低零售价
|
|
||||||
type: number
|
|
||||||
name:
|
|
||||||
description: 商品名称
|
|
||||||
type: string
|
|
||||||
origin:
|
|
||||||
description: 产地
|
|
||||||
type: string
|
|
||||||
remark:
|
|
||||||
description: 备注
|
|
||||||
type: string
|
|
||||||
retail_price:
|
|
||||||
description: 指导零售价
|
|
||||||
type: number
|
|
||||||
staff_cost_price:
|
|
||||||
description: 员工成本价加价
|
|
||||||
type: number
|
|
||||||
wholesale_price:
|
|
||||||
description: 指导采购价
|
|
||||||
type: number
|
|
||||||
required:
|
|
||||||
- erp_category_id
|
|
||||||
- erp_supplier_id
|
|
||||||
- is_imei
|
|
||||||
- name
|
|
||||||
type: object
|
|
||||||
basic.CommodityDelRequest:
|
|
||||||
properties:
|
|
||||||
erp_commodity_id:
|
|
||||||
description: 商品id
|
|
||||||
type: integer
|
|
||||||
required:
|
|
||||||
- erp_commodity_id
|
|
||||||
type: object
|
|
||||||
basic.CommodityDetailRequest:
|
|
||||||
properties:
|
|
||||||
erp_commodity_id:
|
|
||||||
description: 商品id
|
|
||||||
type: integer
|
|
||||||
serial_number:
|
|
||||||
description: 商品编号
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
basic.CommodityEditRequest:
|
|
||||||
properties:
|
|
||||||
brokerage_1:
|
|
||||||
description: 销售毛利提成
|
|
||||||
type: number
|
|
||||||
brokerage_2:
|
|
||||||
description: 员工毛利提成
|
|
||||||
type: number
|
|
||||||
erp_barcode:
|
|
||||||
description: 商品条码
|
|
||||||
type: string
|
|
||||||
erp_category_id:
|
|
||||||
description: 商品分类id
|
|
||||||
type: integer
|
|
||||||
erp_supplier_id:
|
|
||||||
description: 主供应商id
|
|
||||||
type: integer
|
|
||||||
id:
|
|
||||||
description: 商品id
|
|
||||||
type: integer
|
|
||||||
imei_type:
|
|
||||||
description: 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
|
||||||
type: integer
|
|
||||||
is_imei:
|
|
||||||
description: 是否串码:1-串码类 2-非串码
|
|
||||||
type: integer
|
|
||||||
member_discount:
|
|
||||||
description: 会员优惠
|
|
||||||
type: number
|
|
||||||
min_retail_price:
|
|
||||||
description: 最低零售价
|
|
||||||
type: number
|
|
||||||
name:
|
|
||||||
description: 商品名称
|
|
||||||
type: string
|
|
||||||
origin:
|
|
||||||
description: 产地
|
|
||||||
type: string
|
|
||||||
remark:
|
|
||||||
description: 备注
|
|
||||||
type: string
|
|
||||||
retail_price:
|
|
||||||
description: 指导零售价
|
|
||||||
type: number
|
|
||||||
staff_cost_price:
|
|
||||||
description: 员工成本价加价
|
|
||||||
type: number
|
|
||||||
wholesale_price:
|
|
||||||
description: 指导采购价
|
|
||||||
type: number
|
|
||||||
required:
|
|
||||||
- erp_category_id
|
|
||||||
- erp_supplier_id
|
|
||||||
- id
|
|
||||||
- imei_type
|
|
||||||
- is_imei
|
|
||||||
- name
|
|
||||||
type: object
|
|
||||||
basic.CreateCategoryRequest:
|
basic.CreateCategoryRequest:
|
||||||
properties:
|
properties:
|
||||||
name:
|
name:
|
||||||
|
@ -562,6 +434,134 @@ definitions:
|
||||||
$ref: '#/definitions/models.CategoryModel'
|
$ref: '#/definitions/models.CategoryModel'
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
|
models.CommodityCreateRequest:
|
||||||
|
properties:
|
||||||
|
brokerage_1:
|
||||||
|
description: 销售毛利提成
|
||||||
|
type: number
|
||||||
|
brokerage_2:
|
||||||
|
description: 员工毛利提成
|
||||||
|
type: number
|
||||||
|
erp_barcode:
|
||||||
|
description: 商品条码
|
||||||
|
type: string
|
||||||
|
erp_category_id:
|
||||||
|
description: 商品分类id
|
||||||
|
type: integer
|
||||||
|
erp_supplier_id:
|
||||||
|
description: 主供应商
|
||||||
|
type: integer
|
||||||
|
imei_type:
|
||||||
|
description: 系统生成串码:2-是(系统生成) 3-否(手动添加)
|
||||||
|
type: integer
|
||||||
|
is_imei:
|
||||||
|
description: 是否串码:1-串码类 2-非串码
|
||||||
|
type: integer
|
||||||
|
member_discount:
|
||||||
|
description: 会员优惠
|
||||||
|
type: number
|
||||||
|
min_retail_price:
|
||||||
|
description: 最低零售价
|
||||||
|
type: number
|
||||||
|
name:
|
||||||
|
description: 商品名称
|
||||||
|
type: string
|
||||||
|
origin:
|
||||||
|
description: 产地
|
||||||
|
type: string
|
||||||
|
remark:
|
||||||
|
description: 备注
|
||||||
|
type: string
|
||||||
|
retail_price:
|
||||||
|
description: 指导零售价
|
||||||
|
type: number
|
||||||
|
staff_cost_price:
|
||||||
|
description: 员工成本价加价
|
||||||
|
type: number
|
||||||
|
wholesale_price:
|
||||||
|
description: 指导采购价
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- erp_category_id
|
||||||
|
- erp_supplier_id
|
||||||
|
- is_imei
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
|
models.CommodityDelRequest:
|
||||||
|
properties:
|
||||||
|
erp_commodity_id:
|
||||||
|
description: 商品id
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- erp_commodity_id
|
||||||
|
type: object
|
||||||
|
models.CommodityDetailRequest:
|
||||||
|
properties:
|
||||||
|
erp_commodity_id:
|
||||||
|
description: 商品id
|
||||||
|
type: integer
|
||||||
|
serial_number:
|
||||||
|
description: 商品编号
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
models.CommodityEditRequest:
|
||||||
|
properties:
|
||||||
|
brokerage_1:
|
||||||
|
description: 销售毛利提成
|
||||||
|
type: number
|
||||||
|
brokerage_2:
|
||||||
|
description: 员工毛利提成
|
||||||
|
type: number
|
||||||
|
erp_barcode:
|
||||||
|
description: 商品条码
|
||||||
|
type: string
|
||||||
|
erp_category_id:
|
||||||
|
description: 商品分类id
|
||||||
|
type: integer
|
||||||
|
erp_supplier_id:
|
||||||
|
description: 主供应商id
|
||||||
|
type: integer
|
||||||
|
id:
|
||||||
|
description: 商品id
|
||||||
|
type: integer
|
||||||
|
imei_type:
|
||||||
|
description: 1-无串码 2-串码(系统生成) 3-串码(手动添加)
|
||||||
|
type: integer
|
||||||
|
is_imei:
|
||||||
|
description: 是否串码:1-串码类 2-非串码
|
||||||
|
type: integer
|
||||||
|
member_discount:
|
||||||
|
description: 会员优惠
|
||||||
|
type: number
|
||||||
|
min_retail_price:
|
||||||
|
description: 最低零售价
|
||||||
|
type: number
|
||||||
|
name:
|
||||||
|
description: 商品名称
|
||||||
|
type: string
|
||||||
|
origin:
|
||||||
|
description: 产地
|
||||||
|
type: string
|
||||||
|
remark:
|
||||||
|
description: 备注
|
||||||
|
type: string
|
||||||
|
retail_price:
|
||||||
|
description: 指导零售价
|
||||||
|
type: number
|
||||||
|
staff_cost_price:
|
||||||
|
description: 员工成本价加价
|
||||||
|
type: number
|
||||||
|
wholesale_price:
|
||||||
|
description: 指导采购价
|
||||||
|
type: number
|
||||||
|
required:
|
||||||
|
- erp_category_id
|
||||||
|
- erp_supplier_id
|
||||||
|
- id
|
||||||
|
- imei_type
|
||||||
|
- is_imei
|
||||||
|
- name
|
||||||
|
type: object
|
||||||
models.CommodityExcel:
|
models.CommodityExcel:
|
||||||
properties:
|
properties:
|
||||||
category:
|
category:
|
||||||
|
@ -2455,6 +2455,9 @@ definitions:
|
||||||
pageSize:
|
pageSize:
|
||||||
description: 页面条数
|
description: 页面条数
|
||||||
type: integer
|
type: integer
|
||||||
|
sort_type:
|
||||||
|
description: 排序类型:desc 降序、asc 升序
|
||||||
|
type: string
|
||||||
start_time:
|
start_time:
|
||||||
description: 开始时间
|
description: 开始时间
|
||||||
type: string
|
type: string
|
||||||
|
@ -5348,6 +5351,20 @@ definitions:
|
||||||
- store_id
|
- store_id
|
||||||
- store_name
|
- store_name
|
||||||
type: object
|
type: object
|
||||||
|
models.ProductInventoryGetIMEIReq:
|
||||||
|
properties:
|
||||||
|
commodity_id:
|
||||||
|
description: 商品id
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- commodity_id
|
||||||
|
type: object
|
||||||
|
models.ProductInventoryGetIMEIResp:
|
||||||
|
properties:
|
||||||
|
imei:
|
||||||
|
description: 商品串码
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
models.ProductInventoryListReq:
|
models.ProductInventoryListReq:
|
||||||
properties:
|
properties:
|
||||||
audit_time_end:
|
audit_time_end:
|
||||||
|
@ -7357,7 +7374,7 @@ paths:
|
||||||
name: request
|
name: request
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/basic.CommodityCreateRequest'
|
$ref: '#/definitions/models.CommodityCreateRequest'
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
|
@ -7378,7 +7395,7 @@ paths:
|
||||||
name: request
|
name: request
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/basic.CommodityDelRequest'
|
$ref: '#/definitions/models.CommodityDelRequest'
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
|
@ -7399,7 +7416,7 @@ paths:
|
||||||
name: request
|
name: request
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/basic.CommodityDetailRequest'
|
$ref: '#/definitions/models.CommodityDetailRequest'
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
|
@ -7420,7 +7437,7 @@ paths:
|
||||||
name: request
|
name: request
|
||||||
required: true
|
required: true
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/definitions/basic.CommodityEditRequest'
|
$ref: '#/definitions/models.CommodityEditRequest'
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
responses:
|
responses:
|
||||||
|
@ -9366,6 +9383,27 @@ paths:
|
||||||
summary: 编辑
|
summary: 编辑
|
||||||
tags:
|
tags:
|
||||||
- 产品入库,V1.4.0
|
- 产品入库,V1.4.0
|
||||||
|
/api/v1/inventory/product/getIMEI:
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
parameters:
|
||||||
|
- description: 系统生成串码模型
|
||||||
|
in: body
|
||||||
|
name: request
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/models.ProductInventoryGetIMEIReq'
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/models.ProductInventoryGetIMEIResp'
|
||||||
|
summary: 系统生成串码
|
||||||
|
tags:
|
||||||
|
- 产品入库,V1.4.0
|
||||||
/api/v1/inventory/product/list:
|
/api/v1/inventory/product/list:
|
||||||
post:
|
post:
|
||||||
consumes:
|
consumes:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user