Merge remote-tracking branch 'origin/mark' into don
This commit is contained in:
@@ -399,8 +399,21 @@ func (c *OrderManager) updateOrderOtherInfo(order *model.GoodsOrder, db *dao.Dao
|
|||||||
payPercentage = storeDetail.PayPercentage
|
payPercentage = storeDetail.PayPercentage
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
order.JxStoreID = order.StoreID
|
||||||
payPercentage = 100
|
|
||||||
}
|
}
|
||||||
if err = c.updateOrderSkuOtherInfo(order, db, payPercentage); err == nil {
|
if err = c.updateOrderSkuOtherInfo(order, db, payPercentage); err == nil {
|
||||||
jxutils.RefreshOrderSkuRelated(order)
|
jxutils.RefreshOrderSkuRelated(order)
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ var (
|
|||||||
VendorIDELM: "饿了么",
|
VendorIDELM: "饿了么",
|
||||||
VendorIDEBAI: "饿百新零售",
|
VendorIDEBAI: "饿百新零售",
|
||||||
VendorIDWSC: "微盟微商城",
|
VendorIDWSC: "微盟微商城",
|
||||||
VendorIDJX: "京西自营",
|
VendorIDJX: "京西商城",
|
||||||
|
|
||||||
VendorIDDada: "达达众包",
|
VendorIDDada: "达达众包",
|
||||||
VendorIDMTPS: "美团配送",
|
VendorIDMTPS: "美团配送",
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
useGetRowsWhenGetRow = true
|
useGetRowsWhenGetRow = true
|
||||||
transactionWarningSeconds = 5 * 60 // 5分钟
|
transactionWarningSeconds = 2 * 60 // 5分钟
|
||||||
)
|
)
|
||||||
|
|
||||||
type DaoDB struct {
|
type DaoDB struct {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
for _, sku := range order.Skus {
|
for _, sku := range order.Skus {
|
||||||
orderFmt += `%s<BR>`
|
orderFmt += `%s<BR>`
|
||||||
orderFmt += `%8s%10s%10s<BR>`
|
orderFmt += `%8s%10s%10s<BR>`
|
||||||
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 += `<BR>
|
orderFmt += `<BR>
|
||||||
<BOLD>共%d种%d件商品</BOLD>
|
<BOLD>共%d种%d件商品</BOLD>
|
||||||
@@ -154,7 +154,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
|
|||||||
for _, sku := range order.Skus {
|
for _, sku := range order.Skus {
|
||||||
orderFmt += `<B>%s<BR></B>`
|
orderFmt += `<B>%s<BR></B>`
|
||||||
orderFmt += `<B>%s %s %s<BR><BR></B>`
|
orderFmt += `<B>%s %s %s<BR><BR></B>`
|
||||||
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 += `<BR>
|
orderFmt += `<BR>
|
||||||
<B><BOLD>共%d种%d件商品</BOLD></B>
|
<B><BOLD>共%d种%d件商品</BOLD></B>
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
for _, sku := range order.Skus {
|
for _, sku := range order.Skus {
|
||||||
orderFmt += `%s*`
|
orderFmt += `%s*`
|
||||||
orderFmt += `%8s%10s%10s*`
|
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 += `
|
orderFmt += `
|
||||||
*
|
*
|
||||||
@@ -156,7 +156,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
|
|||||||
for _, sku := range order.Skus {
|
for _, sku := range order.Skus {
|
||||||
orderFmt += `<big>%s*`
|
orderFmt += `<big>%s*`
|
||||||
orderFmt += `<big>%s %s %s*`
|
orderFmt += `<big>%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 += `
|
orderFmt += `
|
||||||
<big>共%d种%d件商品*
|
<big>共%d种%d件商品*
|
||||||
@@ -232,7 +232,7 @@ func (c *PrinterHandler) getOrderContent2(order *model.GoodsOrder, storeTel stri
|
|||||||
for _, sku := range order.Skus {
|
for _, sku := range order.Skus {
|
||||||
orderFmt += `|5%s`
|
orderFmt += `|5%s`
|
||||||
orderFmt += `|5%8s%10s%10s`
|
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 += `
|
orderFmt += `
|
||||||
|5
|
|5
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
for _, sku := range order.Skus {
|
for _, sku := range order.Skus {
|
||||||
orderFmt += `%s\n`
|
orderFmt += `%s\n`
|
||||||
orderFmt += `%8s%10s%10s\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
|
orderFmt += `\n
|
||||||
<FB>共%d种%d件商品</FB>
|
<FB>共%d种%d件商品</FB>
|
||||||
@@ -146,7 +146,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
|
|||||||
for _, sku := range order.Skus {
|
for _, sku := range order.Skus {
|
||||||
orderFmt += `<FS2>%s\n</FS2>`
|
orderFmt += `<FS2>%s\n</FS2>`
|
||||||
orderFmt += `<FS2>%s %s %s\n\n</FS2>`
|
orderFmt += `<FS2>%s %s %s\n\n</FS2>`
|
||||||
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
|
orderFmt += `\n
|
||||||
<FS2><FB>共%d种%d件商品</FB></FS2>
|
<FS2><FB>共%d种%d件商品</FB></FS2>
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ func (c *PrinterHandler) getOrderContent(order *model.GoodsOrder, storeTel strin
|
|||||||
for _, sku := range order.Skus {
|
for _, sku := range order.Skus {
|
||||||
orderFmt += `%s<RN>`
|
orderFmt += `%s<RN>`
|
||||||
orderFmt += `%8s%10s%10s<RN>`
|
orderFmt += `%8s%10s%10s<RN>`
|
||||||
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 += `<RN>
|
orderFmt += `<RN>
|
||||||
<B1>共%d种%d件商品</B1>
|
<B1>共%d种%d件商品</B1>
|
||||||
@@ -147,7 +147,7 @@ func (c *PrinterHandler) getOrderContentBig(order *model.GoodsOrder, storeTel st
|
|||||||
for _, sku := range order.Skus {
|
for _, sku := range order.Skus {
|
||||||
orderFmt += `<S2>%s<RN></S2>`
|
orderFmt += `<S2>%s<RN></S2>`
|
||||||
orderFmt += `<S2>%s %s %s<RN><RN></S2>`
|
orderFmt += `<S2>%s %s %s<RN><RN></S2>`
|
||||||
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 += `<RN>
|
orderFmt += `<RN>
|
||||||
<S2><B1>共%d种%d件商品</B1></S2>
|
<S2><B1>共%d种%d件商品</B1></S2>
|
||||||
|
|||||||
Reference in New Issue
Block a user