diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index f6eadb525..b35815a84 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -399,8 +399,21 @@ func (c *OrderManager) updateOrderOtherInfo(order *model.GoodsOrder, db *dao.Dao payPercentage = storeDetail.PayPercentage } } else { + store := &model.Store{} + store.ID = order.StoreID + if err = dao.GetEntity(dao.GetDB(), store); err != nil { + if !dao.IsNoRowsError(err) { + globals.SugarLogger.Warnf("updateOrderOtherInfo GetEntity orderID:%s, VendorStoreID:%s, error:%v", order.VendorOrderID, order.VendorStoreID, err) + return err + } + if time.Now().Sub(order.OrderCreatedAt) < 1*time.Hour { + globals.SugarLogger.Infof("updateOrderOtherInfo b, [运营]订单在京西与平台都找不到京西门店信息,订单:%s,平台门店ID:%s,平台:%s", order.VendorOrderID, order.VendorStoreID, model.VendorChineseNames[order.VendorID]) + } + err = nil + } else { + payPercentage = store.PayPercentage + } order.JxStoreID = order.StoreID - payPercentage = 100 } if err = c.updateOrderSkuOtherInfo(order, db, payPercentage); err == nil { jxutils.RefreshOrderSkuRelated(order) diff --git a/business/model/api_config.go b/business/model/api_config.go index 3ec830c3e..f5d16debd 100644 --- a/business/model/api_config.go +++ b/business/model/api_config.go @@ -89,7 +89,7 @@ var ( VendorIDELM: "饿了么", VendorIDEBAI: "饿百新零售", VendorIDWSC: "微盟微商城", - VendorIDJX: "京西自营", + VendorIDJX: "京西商城", VendorIDDada: "达达众包", VendorIDMTPS: "美团配送", diff --git a/business/model/dao/dao.go b/business/model/dao/dao.go index 24fcbbd2c..45f76a448 100644 --- a/business/model/dao/dao.go +++ b/business/model/dao/dao.go @@ -13,7 +13,7 @@ import ( const ( useGetRowsWhenGetRow = true - transactionWarningSeconds = 5 * 60 // 5分钟 + transactionWarningSeconds = 2 * 60 // 5分钟 ) type DaoDB struct { diff --git a/business/partner/printer/feie/feie.go b/business/partner/printer/feie/feie.go index c0e22bb27..af0bc73b5 100644 --- a/business/partner/printer/feie/feie.go +++ b/business/partner/printer/feie/feie.go @@ -80,7 +80,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin for _, sku := range order.Skus { orderFmt += `%s
` orderFmt += `%8s%10s%10s
` - orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count))) + orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) } orderFmt += `
共%d种%d件商品 @@ -154,7 +154,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st for _, sku := range order.Skus { orderFmt += `%s
` orderFmt += `%s %s %s

` - orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count))) + orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) } orderFmt += `
共%d种%d件商品 diff --git a/business/partner/printer/xiaowm/xiaowm.go b/business/partner/printer/xiaowm/xiaowm.go index cc6ef46fb..179c3828f 100644 --- a/business/partner/printer/xiaowm/xiaowm.go +++ b/business/partner/printer/xiaowm/xiaowm.go @@ -81,7 +81,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin for _, sku := range order.Skus { orderFmt += `%s*` orderFmt += `%8s%10s%10s*` - orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count))) + orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) } orderFmt += ` * @@ -156,7 +156,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st for _, sku := range order.Skus { orderFmt += `%s*` orderFmt += `%s %s %s*` - orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count))) + orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) } orderFmt += ` 共%d种%d件商品* @@ -232,7 +232,7 @@ func (c *PrinterHandler) getOrderContent2(order *model.GoodsOrder, storeTel stri for _, sku := range order.Skus { orderFmt += `|5%s` orderFmt += `|5%8s%10s%10s` - orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count))) + orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) } orderFmt += ` |5 diff --git a/business/partner/printer/yilianyun/yilianyun.go b/business/partner/printer/yilianyun/yilianyun.go index 68c45292b..2f4009abd 100644 --- a/business/partner/printer/yilianyun/yilianyun.go +++ b/business/partner/printer/yilianyun/yilianyun.go @@ -78,7 +78,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin for _, sku := range order.Skus { orderFmt += `%s\n` orderFmt += `%8s%10s%10s\n` - orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count))) + orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) } orderFmt += `\n 共%d种%d件商品 @@ -146,7 +146,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st for _, sku := range order.Skus { orderFmt += `%s\n` orderFmt += `%s %s %s\n\n` - orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count))) + orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) } orderFmt += `\n 共%d种%d件商品 diff --git a/business/partner/printer/zhongwu/zhongwu.go b/business/partner/printer/zhongwu/zhongwu.go index f8adc7115..c434f0739 100644 --- a/business/partner/printer/zhongwu/zhongwu.go +++ b/business/partner/printer/zhongwu/zhongwu.go @@ -79,7 +79,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin for _, sku := range order.Skus { orderFmt += `%s` orderFmt += `%8s%10s%10s` - orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count))) + orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) } orderFmt += ` 共%d种%d件商品 @@ -147,7 +147,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st for _, sku := range order.Skus { orderFmt += `%s` orderFmt += `%s %s %s` - orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice), jxutils.IntPrice2StandardCurrencyString(sku.VendorPrice*int64(sku.Count))) + orderParams = append(orderParams, sku.SkuName, "x"+utils.Int2Str(sku.Count), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice), jxutils.IntPrice2StandardCurrencyString(sku.SalePrice*int64(sku.Count))) } orderFmt += ` 共%d种%d件商品