1、优化零售订单、零售报表相关接口,增加线上订单类型;
This commit is contained in:
parent
e3a25ff558
commit
6fffe30280
|
@ -175,8 +175,19 @@ func CommodityCreate(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// (3) 提交事务
|
// (3) 更新 Goods.ErpCommodityId
|
||||||
if err := tx.Commit().Error; err != nil {
|
if req.IsSyncedToMall == 1 {
|
||||||
|
if err = tx.Model(&models.Goods{}).
|
||||||
|
Where("goods_id = ?", goodsId).
|
||||||
|
Update("erp_commodity_id", commodity.ID).Error; err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
app.Error(c, http.StatusInternalServerError, err, "更新商城商品编号失败")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// (4) 提交事务
|
||||||
|
if err = tx.Commit().Error; err != nil {
|
||||||
app.Error(c, http.StatusInternalServerError, err, "提交事务失败")
|
app.Error(c, http.StatusInternalServerError, err, "提交事务失败")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -779,6 +790,15 @@ func CommodityEdit(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
commodity.GoodsId = goodsId
|
commodity.GoodsId = goodsId
|
||||||
|
|
||||||
|
//更新 Goods.ErpCommodityId
|
||||||
|
if err = begin.Model(&models.Goods{}).
|
||||||
|
Where("goods_id = ?", goodsId).
|
||||||
|
Update("erp_commodity_id", commodity.ID).Error; err != nil {
|
||||||
|
begin.Rollback()
|
||||||
|
app.Error(c, http.StatusInternalServerError, err, "更新商城商品编号失败")
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else { // 未同步到小程序商城
|
} else { // 未同步到小程序商城
|
||||||
if catCommodity.GoodsId != 0 { // 之前同步了,现在不同步;则删除
|
if catCommodity.GoodsId != 0 { // 之前同步了,现在不同步;则删除
|
||||||
|
@ -809,7 +829,6 @@ func CommodityEdit(c *gin.Context) {
|
||||||
|
|
||||||
err = begin.Commit().Error
|
err = begin.Commit().Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
begin.Rollback()
|
|
||||||
logger.Error("commit err:", logger.Field("err", err))
|
logger.Error("commit err:", logger.Field("err", err))
|
||||||
app.Error(c, http.StatusInternalServerError, err, "操作失败")
|
app.Error(c, http.StatusInternalServerError, err, "操作失败")
|
||||||
return
|
return
|
||||||
|
@ -877,7 +896,6 @@ func CommodityDel(c *gin.Context) {
|
||||||
|
|
||||||
err = begin.Commit().Error
|
err = begin.Commit().Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
begin.Rollback()
|
|
||||||
logger.Error("delete err:", logger.Field("err", err))
|
logger.Error("delete err:", logger.Field("err", err))
|
||||||
app.Error(c, http.StatusInternalServerError, err, "操作失败")
|
app.Error(c, http.StatusInternalServerError, err, "操作失败")
|
||||||
return
|
return
|
||||||
|
@ -1074,7 +1092,6 @@ func CommodityBatchSaleStatus(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := tx.Commit().Error; err != nil {
|
if err := tx.Commit().Error; err != nil {
|
||||||
tx.Rollback()
|
|
||||||
app.Error(c, http.StatusInternalServerError, err, "提交失败")
|
app.Error(c, http.StatusInternalServerError, err, "提交失败")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,10 @@ const (
|
||||||
ErpOrderMemberTypeGeneral = "general" // 普通
|
ErpOrderMemberTypeGeneral = "general" // 普通
|
||||||
ErpOrderMemberTypeMember = "member" // 会员
|
ErpOrderMemberTypeMember = "member" // 会员
|
||||||
|
|
||||||
RetailTypeSale = "sale" // 零售订单
|
RetailTypeSale = "sale" // 零售订单
|
||||||
RetailTypeRejected = "rejected" // 零售退货订单
|
RetailTypeSaleOnline = "sale_online" // 零售订单(线上)
|
||||||
|
RetailTypeRejected = "rejected" // 零售退货订单
|
||||||
|
RetailTypeRejectedOnline = "rejected_online" // 零售退货订单(线上)
|
||||||
|
|
||||||
NoCreatePayOrder = 0 // 未创建
|
NoCreatePayOrder = 0 // 未创建
|
||||||
WaitForPaying = 1 // 待支付
|
WaitForPaying = 1 // 待支付
|
||||||
|
@ -54,7 +56,8 @@ type ErpOrder struct {
|
||||||
Model
|
Model
|
||||||
|
|
||||||
BillSn string `json:"bill_sn" gorm:"index"` // 单据编号
|
BillSn string `json:"bill_sn" gorm:"index"` // 单据编号
|
||||||
RetailType string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货
|
RetailType string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
|
GoodsOrderId uint32 `json:"goods_order_id" gorm:"index"` // 小程序商城订单id
|
||||||
Uid int `json:"uid"` // 用户id
|
Uid int `json:"uid"` // 用户id
|
||||||
UserType int `json:"user_type"` // 会员类别:1-普通会员 2-黄金会员 4-白金会员 5-黑金会员 6-尊享会员 7-黄金&尊享 8-白金&尊享 9-黑金&尊享
|
UserType int `json:"user_type"` // 会员类别:1-普通会员 2-黄金会员 4-白金会员 5-黑金会员 6-尊享会员 7-黄金&尊享 8-白金&尊享 9-黑金&尊享
|
||||||
Tel string `json:"tel" gorm:"index"` // 客户手机号
|
Tel string `json:"tel" gorm:"index"` // 客户手机号
|
||||||
|
@ -199,9 +202,10 @@ type ErpOrderCreateReq struct {
|
||||||
type ErpOrderListReq struct {
|
type ErpOrderListReq struct {
|
||||||
ScanCode string `json:"scan_code"` // 扫码枪扫码数据:串码
|
ScanCode string `json:"scan_code"` // 扫码枪扫码数据:串码
|
||||||
BillSn string `json:"bill_sn"` // 单据编号
|
BillSn string `json:"bill_sn"` // 单据编号
|
||||||
RetailType string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货
|
RetailType string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
CommodityName string `json:"commodity_name"` // 商品名称
|
CommodityName string `json:"commodity_name"` // 商品名称
|
||||||
Uid int `json:"uid"` // 用户ID
|
Uid int `json:"uid"` // 用户ID
|
||||||
|
GoodsOrderId uint32 `json:"goods_order_id"` // 小程序商城订单id
|
||||||
Tel string `json:"tel"` // 客户手机号
|
Tel string `json:"tel"` // 客户手机号
|
||||||
Salesman uint32 `json:"salesman"` // 销售人员ID
|
Salesman uint32 `json:"salesman"` // 销售人员ID
|
||||||
StoreId uint32 `json:"store_id"` // 门店ID
|
StoreId uint32 `json:"store_id"` // 门店ID
|
||||||
|
@ -292,7 +296,7 @@ type StoreManageData struct {
|
||||||
// ErpOrderRetailMarginReq 查询商品零售毛利汇总入参
|
// ErpOrderRetailMarginReq 查询商品零售毛利汇总入参
|
||||||
type ErpOrderRetailMarginReq struct {
|
type ErpOrderRetailMarginReq struct {
|
||||||
StoreId []uint32 `json:"store_id"` // 门店ID
|
StoreId []uint32 `json:"store_id"` // 门店ID
|
||||||
RetailType []string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货
|
RetailType []string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
ErpCommodityName []string `json:"erp_commodity_name"` // 商品名称
|
ErpCommodityName []string `json:"erp_commodity_name"` // 商品名称
|
||||||
ErpCategoryId []uint32 `json:"erp_category_id" gorm:"index"` // 分类id
|
ErpCategoryId []uint32 `json:"erp_category_id" gorm:"index"` // 分类id
|
||||||
StartTime string `json:"start_time"` // 开始时间
|
StartTime string `json:"start_time"` // 开始时间
|
||||||
|
@ -323,7 +327,7 @@ type ErpOrderRetailMarginResp struct {
|
||||||
type RetailMarginData struct {
|
type RetailMarginData struct {
|
||||||
StoreId uint32 `json:"store_id" gorm:"index"` // 门店id
|
StoreId uint32 `json:"store_id" gorm:"index"` // 门店id
|
||||||
StoreName string `json:"store_name"` // 门店名称
|
StoreName string `json:"store_name"` // 门店名称
|
||||||
RetailType string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货
|
RetailType string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
ErpCommodityId uint32 `json:"erp_commodity_id" gorm:"index"` // 商品id
|
ErpCommodityId uint32 `json:"erp_commodity_id" gorm:"index"` // 商品id
|
||||||
ErpCommodityName string `json:"erp_commodity_name"` // 商品名称
|
ErpCommodityName string `json:"erp_commodity_name"` // 商品名称
|
||||||
ErpCategoryId uint32 `json:"erp_category_id" gorm:"index"` // 分类id
|
ErpCategoryId uint32 `json:"erp_category_id" gorm:"index"` // 分类id
|
||||||
|
@ -341,7 +345,7 @@ type RetailMarginData struct {
|
||||||
// ErpOrderRetailDetailReq 零售明细汇总入参
|
// ErpOrderRetailDetailReq 零售明细汇总入参
|
||||||
type ErpOrderRetailDetailReq struct {
|
type ErpOrderRetailDetailReq struct {
|
||||||
BillSn string `json:"bill_sn"` // 单据编号
|
BillSn string `json:"bill_sn"` // 单据编号
|
||||||
RetailType string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货
|
RetailType string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
Uid int `json:"uid"` // 用户ID
|
Uid int `json:"uid"` // 用户ID
|
||||||
Tel string `json:"tel"` // 客户手机号
|
Tel string `json:"tel"` // 客户手机号
|
||||||
StoreId []uint32 `json:"store_id"` // 门店ID
|
StoreId []uint32 `json:"store_id"` // 门店ID
|
||||||
|
@ -558,9 +562,23 @@ func (m *ErpOrderListReq) List(c *gin.Context) (*ErpOrderListResp, error) {
|
||||||
}
|
}
|
||||||
if m.BillSn != "" {
|
if m.BillSn != "" {
|
||||||
qs = qs.Where("bill_sn=?", m.BillSn)
|
qs = qs.Where("bill_sn=?", m.BillSn)
|
||||||
|
} else if m.GoodsOrderId != 0 {
|
||||||
|
qs = qs.Where("goods_order_id=?", m.GoodsOrderId)
|
||||||
} else {
|
} else {
|
||||||
if m.RetailType != "" {
|
if m.RetailType != "" {
|
||||||
qs = qs.Where("retail_type=?", m.RetailType)
|
switch m.RetailType {
|
||||||
|
case RetailTypeSaleOnline:
|
||||||
|
// 线上销售 → 实际查线下销售 + 有订单号
|
||||||
|
qs = qs.Where("retail_type = ? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
|
||||||
|
case RetailTypeRejectedOnline:
|
||||||
|
// 线上退货 → 实际查线下退货 + 有订单号
|
||||||
|
qs = qs.Where("retail_type = ? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
|
||||||
|
default:
|
||||||
|
// 其他类型 → 按原值匹配
|
||||||
|
qs = qs.Where("retail_type = ?", m.RetailType)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if m.Uid != 0 {
|
if m.Uid != 0 {
|
||||||
qs = qs.Where("uid=?", m.Uid)
|
qs = qs.Where("uid=?", m.Uid)
|
||||||
|
@ -1440,6 +1458,16 @@ func (m *ErpOrder) SetBankTrxNo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
m.BankTrxNo = orderPayWay.BankTrxNo
|
m.BankTrxNo = orderPayWay.BankTrxNo
|
||||||
|
switch m.RetailType { // 转换订单类型,增加线上类型
|
||||||
|
case RetailTypeSale:
|
||||||
|
if m.GoodsOrderId != 0 {
|
||||||
|
m.RetailType = RetailTypeSaleOnline
|
||||||
|
}
|
||||||
|
case RetailTypeRejected:
|
||||||
|
if m.GoodsOrderId != 0 {
|
||||||
|
m.RetailType = RetailTypeRejectedOnline
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErpOrderRetailDetailSetCommodity 添加零售明细中订单的商品信息
|
// ErpOrderRetailDetailSetCommodity 添加零售明细中订单的商品信息
|
||||||
|
@ -3335,7 +3363,29 @@ func QueryRetailMargin(req *ErpOrderRetailMarginReq, c *gin.Context) (*ErpOrderR
|
||||||
qs.Where("erp_order.store_id in ?", req.StoreId)
|
qs.Where("erp_order.store_id in ?", req.StoreId)
|
||||||
}
|
}
|
||||||
if len(req.RetailType) != 0 {
|
if len(req.RetailType) != 0 {
|
||||||
qs.Where("erp_order.retail_type in ?", req.RetailType)
|
//qs.Where("erp_order.retail_type in ?", req.RetailType)
|
||||||
|
if len(req.RetailType) != 0 {
|
||||||
|
var conditions []string
|
||||||
|
var args []interface{}
|
||||||
|
|
||||||
|
for _, rt := range req.RetailType {
|
||||||
|
switch rt {
|
||||||
|
case RetailTypeSaleOnline:
|
||||||
|
conditions = append(conditions, "(erp_order.retail_type = ? AND goods_order_id != 0)")
|
||||||
|
args = append(args, RetailTypeSale)
|
||||||
|
|
||||||
|
case RetailTypeRejectedOnline:
|
||||||
|
conditions = append(conditions, "(erp_order.retail_type = ? AND goods_order_id != 0)")
|
||||||
|
args = append(args, RetailTypeRejected)
|
||||||
|
|
||||||
|
default:
|
||||||
|
conditions = append(conditions, "erp_order.retail_type = ?")
|
||||||
|
args = append(args, rt)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
qs = qs.Where(strings.Join(conditions, " OR "), args...)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if len(req.ErpCommodityName) != 0 {
|
if len(req.ErpCommodityName) != 0 {
|
||||||
qs.Where("erp_order_commodity.erp_commodity_name in ?", req.ErpCommodityName)
|
qs.Where("erp_order_commodity.erp_commodity_name in ?", req.ErpCommodityName)
|
||||||
|
@ -4747,10 +4797,32 @@ func queryRetailDetailByJoin(req *ErpOrderRetailDetailReq, c *gin.Context) (*Erp
|
||||||
rejectedOrderSumQs = rejectedOrderSumQs.Where("oc.erp_commodity_name = ?", req.ErpCommodityName)
|
rejectedOrderSumQs = rejectedOrderSumQs.Where("oc.erp_commodity_name = ?", req.ErpCommodityName)
|
||||||
}
|
}
|
||||||
if req.RetailType != "" { // 销售类型
|
if req.RetailType != "" { // 销售类型
|
||||||
qs = qs.Where("erp_order.retail_type=?", req.RetailType)
|
//qs = qs.Where("erp_order.retail_type=?", req.RetailType)
|
||||||
es = es.Where("erp_order.retail_type=?", req.RetailType)
|
//es = es.Where("erp_order.retail_type=?", req.RetailType)
|
||||||
orderSumQs = orderSumQs.Where("eo.retail_type=?", req.RetailType)
|
//orderSumQs = orderSumQs.Where("eo.retail_type=?", req.RetailType)
|
||||||
rejectedOrderSumQs = rejectedOrderSumQs.Where("eo.retail_type=?", req.RetailType)
|
//rejectedOrderSumQs = rejectedOrderSumQs.Where("eo.retail_type=?", req.RetailType)
|
||||||
|
if req.RetailType != "" {
|
||||||
|
switch req.RetailType {
|
||||||
|
case RetailTypeSaleOnline:
|
||||||
|
// 线上销售 → 实际查线下销售 + 有订单号
|
||||||
|
qs = qs.Where("erp_order.retail_type = ? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
es = es.Where("erp_order.retail_type = ? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
orderSumQs = orderSumQs.Where("eo.retail_type=? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
rejectedOrderSumQs = rejectedOrderSumQs.Where("eo.retail_type=? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
case RetailTypeRejectedOnline:
|
||||||
|
// 线上退货 → 实际查线下退货 + 有订单号
|
||||||
|
qs = qs.Where("erp_order.retail_type = ? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
es = es.Where("erp_order.retail_type = ? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
orderSumQs = orderSumQs.Where("eo.retail_type=? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
rejectedOrderSumQs = rejectedOrderSumQs.Where("eo.retail_type=? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
default:
|
||||||
|
// 其他类型 → 按原值匹配
|
||||||
|
qs = qs.Where("erp_order.retail_type = ?", req.RetailType)
|
||||||
|
es = es.Where("erp_order.retail_type=?", req.RetailType)
|
||||||
|
orderSumQs = orderSumQs.Where("eo.retail_type=?", req.RetailType)
|
||||||
|
rejectedOrderSumQs = rejectedOrderSumQs.Where("eo.retail_type=?", req.RetailType)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if req.Uid != 0 { // 用户ID
|
if req.Uid != 0 { // 用户ID
|
||||||
qs = qs.Where("erp_order.uid=?", req.Uid)
|
qs = qs.Where("erp_order.uid=?", req.Uid)
|
||||||
|
@ -5242,8 +5314,27 @@ func queryRetailDetailCommon(req *ErpOrderRetailDetailReq, c *gin.Context) (*Erp
|
||||||
totalPerQs = totalPerQs.Where("bill_sn=?", req.BillSn)
|
totalPerQs = totalPerQs.Where("bill_sn=?", req.BillSn)
|
||||||
} else {
|
} else {
|
||||||
if req.RetailType != "" { // 销售类型
|
if req.RetailType != "" { // 销售类型
|
||||||
qs = qs.Where("retail_type=?", req.RetailType)
|
//qs = qs.Where("retail_type=?", req.RetailType)
|
||||||
totalPerQs = totalPerQs.Where("retail_type=?", req.RetailType)
|
//totalPerQs = totalPerQs.Where("retail_type=?", req.RetailType)
|
||||||
|
|
||||||
|
if req.RetailType != "" {
|
||||||
|
switch req.RetailType {
|
||||||
|
case RetailTypeSaleOnline:
|
||||||
|
// 线上销售 → 实际查线下销售 + 有订单号
|
||||||
|
qs = qs.Where("retail_type = ? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
totalPerQs = totalPerQs.Where("retail_type = ? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
|
||||||
|
case RetailTypeRejectedOnline:
|
||||||
|
// 线上退货 → 实际查线下退货 + 有订单号
|
||||||
|
qs = qs.Where("retail_type = ? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
totalPerQs = totalPerQs.Where("retail_type = ? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
|
||||||
|
default:
|
||||||
|
// 其他类型 → 按原值匹配
|
||||||
|
qs = qs.Where("retail_type = ?", req.RetailType)
|
||||||
|
totalPerQs = totalPerQs.Where("retail_type=?", req.RetailType)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if req.Uid != 0 { // 用户ID
|
if req.Uid != 0 { // 用户ID
|
||||||
qs = qs.Where("erp_order.uid=?", req.Uid)
|
qs = qs.Where("erp_order.uid=?", req.Uid)
|
||||||
|
@ -7512,7 +7603,7 @@ func containsCategorySalesData(categoryDataList []CategorySalesData, categoryId
|
||||||
// ErpOrderSaleDetailReq 销售明细汇总入参
|
// ErpOrderSaleDetailReq 销售明细汇总入参
|
||||||
type ErpOrderSaleDetailReq struct {
|
type ErpOrderSaleDetailReq struct {
|
||||||
BillSn string `json:"bill_sn"` // 单据编号
|
BillSn string `json:"bill_sn"` // 单据编号
|
||||||
RetailType string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货
|
RetailType string `json:"retail_type"` // 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
UserType []uint32 `json:"user_type"` // 会员类别:0-未注册 1-普通会员 2-黄金会员 4-白金会员 5-黑金会员 6-尊享会员 7-黄金&尊享 8-白金&尊享 9-黑金&尊享
|
UserType []uint32 `json:"user_type"` // 会员类别:0-未注册 1-普通会员 2-黄金会员 4-白金会员 5-黑金会员 6-尊享会员 7-黄金&尊享 8-白金&尊享 9-黑金&尊享
|
||||||
Uid int `json:"uid"` // 用户ID
|
Uid int `json:"uid"` // 用户ID
|
||||||
Tel string `json:"tel"` // 客户手机号
|
Tel string `json:"tel"` // 客户手机号
|
||||||
|
@ -7613,10 +7704,32 @@ func querySaleDetailByJoin(req *ErpOrderSaleDetailReq, c *gin.Context) (*ErpOrde
|
||||||
rejectedOrderSumQs = rejectedOrderSumQs.Where("oc.erp_commodity_name = ?", req.ErpCommodityName)
|
rejectedOrderSumQs = rejectedOrderSumQs.Where("oc.erp_commodity_name = ?", req.ErpCommodityName)
|
||||||
}
|
}
|
||||||
if req.RetailType != "" { // 销售类型
|
if req.RetailType != "" { // 销售类型
|
||||||
qs = qs.Where("erp_order.retail_type=?", req.RetailType)
|
//qs = qs.Where("erp_order.retail_type=?", req.RetailType)
|
||||||
es = es.Where("erp_order.retail_type=?", req.RetailType)
|
//es = es.Where("erp_order.retail_type=?", req.RetailType)
|
||||||
orderSumQs = orderSumQs.Where("eo.retail_type=?", req.RetailType)
|
//orderSumQs = orderSumQs.Where("eo.retail_type=?", req.RetailType)
|
||||||
rejectedOrderSumQs = rejectedOrderSumQs.Where("eo.retail_type=?", req.RetailType)
|
//rejectedOrderSumQs = rejectedOrderSumQs.Where("eo.retail_type=?", req.RetailType)
|
||||||
|
if req.RetailType != "" {
|
||||||
|
switch req.RetailType {
|
||||||
|
case RetailTypeSaleOnline:
|
||||||
|
// 线上销售 → 实际查线下销售 + 有订单号
|
||||||
|
qs = qs.Where("erp_order.retail_type = ? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
es = es.Where("erp_order.retail_type = ? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
orderSumQs = orderSumQs.Where("eo.retail_type=? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
rejectedOrderSumQs = rejectedOrderSumQs.Where("eo.retail_type=? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
case RetailTypeRejectedOnline:
|
||||||
|
// 线上退货 → 实际查线下退货 + 有订单号
|
||||||
|
qs = qs.Where("erp_order.retail_type = ? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
es = es.Where("erp_order.retail_type = ? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
orderSumQs = orderSumQs.Where("eo.retail_type=? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
rejectedOrderSumQs = rejectedOrderSumQs.Where("eo.retail_type=? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
default:
|
||||||
|
// 其他类型 → 按原值匹配
|
||||||
|
qs = qs.Where("erp_order.retail_type = ?", req.RetailType)
|
||||||
|
es = es.Where("erp_order.retail_type=?", req.RetailType)
|
||||||
|
orderSumQs = orderSumQs.Where("eo.retail_type=?", req.RetailType)
|
||||||
|
rejectedOrderSumQs = rejectedOrderSumQs.Where("eo.retail_type=?", req.RetailType)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if req.Uid != 0 { // 用户ID
|
if req.Uid != 0 { // 用户ID
|
||||||
qs = qs.Where("erp_order.uid=?", req.Uid)
|
qs = qs.Where("erp_order.uid=?", req.Uid)
|
||||||
|
@ -7858,8 +7971,26 @@ func querySaleDetailCommon(req *ErpOrderSaleDetailReq, c *gin.Context) (*ErpOrde
|
||||||
totalPerQs = totalPerQs.Where("bill_sn=?", req.BillSn)
|
totalPerQs = totalPerQs.Where("bill_sn=?", req.BillSn)
|
||||||
} else {
|
} else {
|
||||||
if req.RetailType != "" { // 销售类型
|
if req.RetailType != "" { // 销售类型
|
||||||
qs = qs.Where("retail_type=?", req.RetailType)
|
//qs = qs.Where("retail_type=?", req.RetailType)
|
||||||
totalPerQs = totalPerQs.Where("retail_type=?", req.RetailType)
|
//totalPerQs = totalPerQs.Where("retail_type=?", req.RetailType)
|
||||||
|
if req.RetailType != "" {
|
||||||
|
switch req.RetailType {
|
||||||
|
case RetailTypeSaleOnline:
|
||||||
|
// 线上销售 → 实际查线下销售 + 有订单号
|
||||||
|
qs = qs.Where("retail_type = ? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
totalPerQs = totalPerQs.Where("retail_type = ? AND goods_order_id != 0", RetailTypeSale)
|
||||||
|
|
||||||
|
case RetailTypeRejectedOnline:
|
||||||
|
// 线上退货 → 实际查线下退货 + 有订单号
|
||||||
|
qs = qs.Where("retail_type = ? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
totalPerQs = totalPerQs.Where("retail_type = ? AND goods_order_id != 0", RetailTypeRejected)
|
||||||
|
|
||||||
|
default:
|
||||||
|
// 其他类型 → 按原值匹配
|
||||||
|
qs = qs.Where("retail_type = ?", req.RetailType)
|
||||||
|
totalPerQs = totalPerQs.Where("retail_type=?", req.RetailType)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if req.Uid != 0 { // 用户ID
|
if req.Uid != 0 { // 用户ID
|
||||||
qs = qs.Where("erp_order.uid=?", req.Uid)
|
qs = qs.Where("erp_order.uid=?", req.Uid)
|
||||||
|
|
|
@ -47,34 +47,31 @@ const (
|
||||||
type Goods struct {
|
type Goods struct {
|
||||||
Model
|
Model
|
||||||
|
|
||||||
GoodsId uint32 `json:"goods_id" gorm:"unique_index"`
|
GoodsId uint32 `json:"goods_id" gorm:"unique_index"`
|
||||||
SerialNo string `json:"serial_no" gorm:"unique_index"` // 序列号
|
ErpCommodityId uint32 `json:"erp_commodity_id" gorm:"index"` // ERP商品id
|
||||||
CatId uint32 `json:"cat_id" gorm:"index"` // 分类
|
SerialNo string `json:"serial_no" gorm:"unique_index"` // 序列号
|
||||||
Name string `json:"name"` // 名称
|
CatId uint32 `json:"cat_id" gorm:"index"` // 分类
|
||||||
Title string `json:"title"` // 标题
|
Name string `json:"name"` // 名称
|
||||||
MainImage string `json:"main_image"` // 主图
|
Title string `json:"title"` // 标题
|
||||||
Images string `json:"images"` // 图片列表,用,隔开
|
MainImage string `json:"main_image"` // 主图
|
||||||
Detail string `json:"detail" gorm:"type:text;"` // 详情, 富文本
|
Images string `json:"images"` // 图片列表,用,隔开
|
||||||
|
Detail string `json:"detail" gorm:"type:text;"` // 详情, 富文本
|
||||||
SoldCount uint32 `json:"sold_count"` // 已销售数量
|
SoldCount uint32 `json:"sold_count"` // 已销售数量
|
||||||
SaleStatus uint32 `json:"sale_status"` // 在售状态 1-在售 2-下架
|
SaleStatus uint32 `json:"sale_status"` // 在售状态 1-在售 2-下架
|
||||||
CatSort uint32 `json:"cat_sort"` // 分类排序
|
CatSort uint32 `json:"cat_sort"` // 分类排序
|
||||||
Sort uint32 `json:"sort"` // 商品排序
|
Sort uint32 `json:"sort"` // 商品排序
|
||||||
|
SpecList string `json:"spec_list" gorm:"type:text;"` // 属性json数据
|
||||||
SpecList string `json:"spec_list" gorm:"type:text;"` // 属性json数据
|
DiscountList string `json:"discount_list" gorm:"type:text;"` // 折扣
|
||||||
DiscountList string `json:"discount_list" gorm:"type:text;"` // 折扣
|
SpecIndex string `json:"spec_index" gorm:"index"` // 1,3
|
||||||
SpecIndex string `json:"spec_index" gorm:"index"` // 1,3
|
PriceOriginal uint32 `json:"price_original"` // 市场价
|
||||||
|
DeliveryFee uint32 `json:"delivery_fee"` // 邮费
|
||||||
PriceOriginal uint32 `json:"price_original"` // 市场价
|
DealType uint32 `json:"deal_type"` // 1-积分兑换 2-购买 3-抵扣
|
||||||
DeliveryFee uint32 `json:"delivery_fee"` // 邮费
|
VersionId uint64 `json:"version_id"` // 乐观锁
|
||||||
DealType uint32 `json:"deal_type"` // 1-积分兑换 2-购买 3-抵扣
|
PriceVm uint32 `json:"price_vm"` // 积分价格
|
||||||
VersionId uint64 `json:"version_id"` // 乐观锁
|
PriceRm uint32 `json:"price_rm"` // 人民币价格
|
||||||
|
ShowDiscount int8 `json:"show_discount"` // 是否展示折扣价
|
||||||
PriceVm uint32 `json:"price_vm"` // 积分价格
|
GoodsAccountNum uint32 `json:"goods_account_num"` // 收款账户编号 1 明慧;2 迪为
|
||||||
PriceRm uint32 `json:"price_rm"` // 人民币价格
|
|
||||||
//Stock uint32 `json:"stock"` // 库存
|
//Stock uint32 `json:"stock"` // 库存
|
||||||
ShowDiscount int8 `json:"show_discount"` // 是否展示折扣价
|
|
||||||
GoodsAccountNum uint32 `json:"goods_account_num"` // 收款账户编号 1 明慧;2 迪为
|
|
||||||
|
|
||||||
GoodsCat *GoodsCat `json:"goods_cat" gorm:"-"`
|
GoodsCat *GoodsCat `json:"goods_cat" gorm:"-"`
|
||||||
GoodsDiscount *GoodsDiscount `json:"goods_discount" gorm:"-"`
|
GoodsDiscount *GoodsDiscount `json:"goods_discount" gorm:"-"`
|
||||||
|
|
26
docs/docs.go
26
docs/docs.go
|
@ -12937,6 +12937,10 @@ const docTemplate = `{
|
||||||
"description": "创建时间",
|
"description": "创建时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"goods_order_id": {
|
||||||
|
"description": "小程序商城订单id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"description": "数据库记录编号",
|
"description": "数据库记录编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -12986,7 +12990,7 @@ const docTemplate = `{
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"sale_order_id": {
|
"sale_order_id": {
|
||||||
|
@ -13458,6 +13462,10 @@ const docTemplate = `{
|
||||||
"description": "商品名称",
|
"description": "商品名称",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"goods_order_id": {
|
||||||
|
"description": "小程序商城订单id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"make_time_end": {
|
"make_time_end": {
|
||||||
"description": "制单结束时间",
|
"description": "制单结束时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -13479,7 +13487,7 @@ const docTemplate = `{
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"salesman": {
|
"salesman": {
|
||||||
|
@ -13705,7 +13713,7 @@ const docTemplate = `{
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"salesman": {
|
"salesman": {
|
||||||
|
@ -13803,7 +13811,7 @@ const docTemplate = `{
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -13923,7 +13931,7 @@ const docTemplate = `{
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"salesman": {
|
"salesman": {
|
||||||
|
@ -17346,6 +17354,10 @@ const docTemplate = `{
|
||||||
"description": "折扣",
|
"description": "折扣",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"erp_commodity_id": {
|
||||||
|
"description": "ERP商品id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"goods_account_num": {
|
"goods_account_num": {
|
||||||
"description": "收款账户编号 1 明慧;2 迪为",
|
"description": "收款账户编号 1 明慧;2 迪为",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -17396,7 +17408,7 @@ const docTemplate = `{
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"show_discount": {
|
"show_discount": {
|
||||||
"description": "Stock uint32 ` + "`" + `json:\"stock\"` + "`" + ` // 库存",
|
"description": "是否展示折扣价",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"sold_count": {
|
"sold_count": {
|
||||||
|
@ -22586,7 +22598,7 @@ const docTemplate = `{
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"sales_amount": {
|
"sales_amount": {
|
||||||
|
|
|
@ -12926,6 +12926,10 @@
|
||||||
"description": "创建时间",
|
"description": "创建时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"goods_order_id": {
|
||||||
|
"description": "小程序商城订单id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"id": {
|
"id": {
|
||||||
"description": "数据库记录编号",
|
"description": "数据库记录编号",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -12975,7 +12979,7 @@
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"sale_order_id": {
|
"sale_order_id": {
|
||||||
|
@ -13447,6 +13451,10 @@
|
||||||
"description": "商品名称",
|
"description": "商品名称",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"goods_order_id": {
|
||||||
|
"description": "小程序商城订单id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"make_time_end": {
|
"make_time_end": {
|
||||||
"description": "制单结束时间",
|
"description": "制单结束时间",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -13468,7 +13476,7 @@
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"salesman": {
|
"salesman": {
|
||||||
|
@ -13694,7 +13702,7 @@
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"salesman": {
|
"salesman": {
|
||||||
|
@ -13792,7 +13800,7 @@
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
@ -13912,7 +13920,7 @@
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"salesman": {
|
"salesman": {
|
||||||
|
@ -17335,6 +17343,10 @@
|
||||||
"description": "折扣",
|
"description": "折扣",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"erp_commodity_id": {
|
||||||
|
"description": "ERP商品id",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"goods_account_num": {
|
"goods_account_num": {
|
||||||
"description": "收款账户编号 1 明慧;2 迪为",
|
"description": "收款账户编号 1 明慧;2 迪为",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
|
@ -17385,7 +17397,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"show_discount": {
|
"show_discount": {
|
||||||
"description": "Stock uint32 `json:\"stock\"` // 库存",
|
"description": "是否展示折扣价",
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
"sold_count": {
|
"sold_count": {
|
||||||
|
@ -22575,7 +22587,7 @@
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"retail_type": {
|
"retail_type": {
|
||||||
"description": "销售类型:sale 零售销售; rejected 零售退货",
|
"description": "销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"sales_amount": {
|
"sales_amount": {
|
||||||
|
|
|
@ -3022,6 +3022,9 @@ definitions:
|
||||||
createdAt:
|
createdAt:
|
||||||
description: 创建时间
|
description: 创建时间
|
||||||
type: string
|
type: string
|
||||||
|
goods_order_id:
|
||||||
|
description: 小程序商城订单id
|
||||||
|
type: integer
|
||||||
id:
|
id:
|
||||||
description: 数据库记录编号
|
description: 数据库记录编号
|
||||||
type: integer
|
type: integer
|
||||||
|
@ -3059,7 +3062,7 @@ definitions:
|
||||||
description: 订单总退货数量
|
description: 订单总退货数量
|
||||||
type: integer
|
type: integer
|
||||||
retail_type:
|
retail_type:
|
||||||
description: 销售类型:sale 零售销售; rejected 零售退货
|
description: 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
type: string
|
type: string
|
||||||
sale_order_id:
|
sale_order_id:
|
||||||
description: 销售订单id
|
description: 销售订单id
|
||||||
|
@ -3405,6 +3408,9 @@ definitions:
|
||||||
commodity_name:
|
commodity_name:
|
||||||
description: 商品名称
|
description: 商品名称
|
||||||
type: string
|
type: string
|
||||||
|
goods_order_id:
|
||||||
|
description: 小程序商城订单id
|
||||||
|
type: integer
|
||||||
make_time_end:
|
make_time_end:
|
||||||
description: 制单结束时间
|
description: 制单结束时间
|
||||||
type: string
|
type: string
|
||||||
|
@ -3421,7 +3427,7 @@ definitions:
|
||||||
description: 支付状态 0-未创建 ;1-待支付; 2-已支付
|
description: 支付状态 0-未创建 ;1-待支付; 2-已支付
|
||||||
type: integer
|
type: integer
|
||||||
retail_type:
|
retail_type:
|
||||||
description: 销售类型:sale 零售销售; rejected 零售退货
|
description: 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
type: string
|
type: string
|
||||||
salesman:
|
salesman:
|
||||||
description: 销售人员ID
|
description: 销售人员ID
|
||||||
|
@ -3585,7 +3591,7 @@ definitions:
|
||||||
description: 页面条数
|
description: 页面条数
|
||||||
type: integer
|
type: integer
|
||||||
retail_type:
|
retail_type:
|
||||||
description: 销售类型:sale 零售销售; rejected 零售退货
|
description: 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
type: string
|
type: string
|
||||||
salesman:
|
salesman:
|
||||||
description: 销售人员ID
|
description: 销售人员ID
|
||||||
|
@ -3654,7 +3660,7 @@ definitions:
|
||||||
description: 页面条数
|
description: 页面条数
|
||||||
type: integer
|
type: integer
|
||||||
retail_type:
|
retail_type:
|
||||||
description: 销售类型:sale 零售销售; rejected 零售退货
|
description: 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
|
@ -3741,7 +3747,7 @@ definitions:
|
||||||
description: 页面条数
|
description: 页面条数
|
||||||
type: integer
|
type: integer
|
||||||
retail_type:
|
retail_type:
|
||||||
description: 销售类型:sale 零售销售; rejected 零售退货
|
description: 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
type: string
|
type: string
|
||||||
salesman:
|
salesman:
|
||||||
description: 销售人员ID
|
description: 销售人员ID
|
||||||
|
@ -6211,6 +6217,9 @@ definitions:
|
||||||
discount_list:
|
discount_list:
|
||||||
description: 折扣
|
description: 折扣
|
||||||
type: string
|
type: string
|
||||||
|
erp_commodity_id:
|
||||||
|
description: ERP商品id
|
||||||
|
type: integer
|
||||||
goods_account_num:
|
goods_account_num:
|
||||||
description: 收款账户编号 1 明慧;2 迪为
|
description: 收款账户编号 1 明慧;2 迪为
|
||||||
type: integer
|
type: integer
|
||||||
|
@ -6248,7 +6257,7 @@ definitions:
|
||||||
description: 序列号
|
description: 序列号
|
||||||
type: string
|
type: string
|
||||||
show_discount:
|
show_discount:
|
||||||
description: Stock uint32 `json:"stock"` // 库存
|
description: 是否展示折扣价
|
||||||
type: integer
|
type: integer
|
||||||
sold_count:
|
sold_count:
|
||||||
description: 已销售数量
|
description: 已销售数量
|
||||||
|
@ -10000,7 +10009,7 @@ definitions:
|
||||||
description: 销售毛利率:销售毛利/销售/退货金额
|
description: 销售毛利率:销售毛利/销售/退货金额
|
||||||
type: string
|
type: string
|
||||||
retail_type:
|
retail_type:
|
||||||
description: 销售类型:sale 零售销售; rejected 零售退货
|
description: 销售类型:sale 零售销售; rejected 零售退货;sale_online 零售销售(线上);rejected_online零售退货(线上)
|
||||||
type: string
|
type: string
|
||||||
sales_amount:
|
sales_amount:
|
||||||
description: 销售/退货金额
|
description: 销售/退货金额
|
||||||
|
|
Loading…
Reference in New Issue
Block a user