1213
This commit is contained in:
@@ -501,6 +501,7 @@ type StoreAcctOrder struct {
|
|||||||
VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"`
|
VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"`
|
||||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||||||
StoreID int `orm:"column(store_id)" json:"storeID"` // 外部系统里记录的 jxstoreid
|
StoreID int `orm:"column(store_id)" json:"storeID"` // 外部系统里记录的 jxstoreid
|
||||||
|
BrandID int `orm:"column(brand_id)" json:"brandID"`
|
||||||
ActualPayPrice int `json:"actualPayPrice"` // 单位为分 顾客实际支付
|
ActualPayPrice int `json:"actualPayPrice"` // 单位为分 顾客实际支付
|
||||||
UserID string `orm:"column(user_id);size(48);index" json:"userID"`
|
UserID string `orm:"column(user_id);size(48);index" json:"userID"`
|
||||||
OrderType int `json:"orderType"`
|
OrderType int `json:"orderType"`
|
||||||
|
|||||||
@@ -915,6 +915,7 @@ type StoreAcct struct {
|
|||||||
|
|
||||||
StoreID int `orm:"column(store_id)" json:"storeID"` //门店ID
|
StoreID int `orm:"column(store_id)" json:"storeID"` //门店ID
|
||||||
AccountBalance int `json:"accountBalance"` //账户余额
|
AccountBalance int `json:"accountBalance"` //账户余额
|
||||||
|
BrandID int `orm:"column(brand_id)" json:"brandID"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v *StoreAcct) TableUnique() [][]string {
|
func (v *StoreAcct) TableUnique() [][]string {
|
||||||
|
|||||||
@@ -580,14 +580,11 @@ func OnPayFinished(orderPay *model.OrderPay) (err error) {
|
|||||||
storeOrder := &model.StoreAcctOrder{
|
storeOrder := &model.StoreAcctOrder{
|
||||||
VendorOrderID: orderPay.VendorOrderID,
|
VendorOrderID: orderPay.VendorOrderID,
|
||||||
}
|
}
|
||||||
Storebrand := &model.BrandOrder{
|
|
||||||
VendorOrderID: orderPay.VendorOrderID,
|
|
||||||
}
|
|
||||||
if err = dao.GetEntity(dao.GetDB(), storeOrder, "VendorOrderID"); err == nil && storeOrder.ID != 0 {
|
if err = dao.GetEntity(dao.GetDB(), storeOrder, "VendorOrderID"); err == nil && storeOrder.ID != 0 {
|
||||||
storeOrder.OrderFinishedAt = time.Now()
|
storeOrder.OrderFinishedAt = time.Now()
|
||||||
storeOrder.Status = model.OrderStatusFinished
|
storeOrder.Status = model.OrderStatusFinished
|
||||||
if _, err = dao.UpdateEntity(dao.GetDB(), storeOrder, "OrderFinishedAt", "Status"); err == nil {
|
if _, err = dao.UpdateEntity(dao.GetDB(), storeOrder, "OrderFinishedAt", "Status"); err == nil {
|
||||||
partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, Storebrand.BrandID, storeOrder.ActualPayPrice, 1, 1, "")
|
partner.CurStoreAcctManager.InsertBrandBill(jxcontext.AdminCtx, storeOrder.BrandID, storeOrder.ActualPayPrice, 1, 1, "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case model.PayTypeTL_BrandBillCharge:
|
case model.PayTypeTL_BrandBillCharge:
|
||||||
@@ -2488,11 +2485,12 @@ func RefreshCouponsStatus(ctx *jxcontext.Context) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateStoreAcctOrder(ctx *jxcontext.Context, orderType, storeID, price int, goodsVendorOrderID string) (vendorOrderID string, err error) {
|
func CreateStoreAcctOrder(ctx *jxcontext.Context, orderType, storeID, price int, goodsVendorOrderID string, brandID int) (vendorOrderID string, err error) {
|
||||||
var (
|
var (
|
||||||
db = dao.GetDB()
|
db = dao.GetDB()
|
||||||
storeAcct = &model.StoreAcct{
|
storeAcct = &model.StoreAcct{
|
||||||
StoreID: storeID,
|
StoreID: storeID,
|
||||||
|
BrandID: brandID,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
if err = dao.GetEntity(db, storeAcct, "StoreID"); err != nil && dao.IsNoRowsError(err) {
|
if err = dao.GetEntity(db, storeAcct, "StoreID"); err != nil && dao.IsNoRowsError(err) {
|
||||||
@@ -2505,6 +2503,7 @@ func CreateStoreAcctOrder(ctx *jxcontext.Context, orderType, storeID, price int,
|
|||||||
VendorOrderID: utils.Int64ToStr(jxutils.GenOrderNo()),
|
VendorOrderID: utils.Int64ToStr(jxutils.GenOrderNo()),
|
||||||
UserID: ctx.GetUserID(),
|
UserID: ctx.GetUserID(),
|
||||||
StoreID: storeID,
|
StoreID: storeID,
|
||||||
|
BrandID: brandID,
|
||||||
OrderType: orderType,
|
OrderType: orderType,
|
||||||
Status: model.OrderStatusWait4Pay,
|
Status: model.OrderStatusWait4Pay,
|
||||||
ActualPayPrice: price,
|
ActualPayPrice: price,
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ func (c *JxOrderController) ReceiveCoupons() {
|
|||||||
// @router /CreateStoreAcctOrder [post]
|
// @router /CreateStoreAcctOrder [post]
|
||||||
func (c *JxOrderController) CreateStoreAcctOrder() {
|
func (c *JxOrderController) CreateStoreAcctOrder() {
|
||||||
c.callCreateStoreAcctOrder(func(params *tJxorderCreateStoreAcctOrderParams) (retVal interface{}, errCode string, err error) {
|
c.callCreateStoreAcctOrder(func(params *tJxorderCreateStoreAcctOrderParams) (retVal interface{}, errCode string, err error) {
|
||||||
retVal, err = localjx.CreateStoreAcctOrder(params.Ctx, params.OrderType, params.StoreID, params.Price, params.VendorOrderID)
|
retVal, err = localjx.CreateStoreAcctOrder(params.Ctx, params.OrderType, params.StoreID, params.Price, params.VendorOrderID, params.brandID)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user