修改配送费修改
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package orderman
|
||||
|
||||
import (
|
||||
"crypto/md5"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
@@ -1755,7 +1756,7 @@ func UpdateWaybillDesiredFee(ctx *jxcontext.Context, vendorOrderID string, desir
|
||||
waybill := &model.Waybill{
|
||||
VendorOrderID: order.VendorOrderID,
|
||||
OrderVendorID: order.VendorID,
|
||||
VendorWaybillID: "-1",
|
||||
VendorWaybillID: GenOrderNo(ctx),
|
||||
WaybillVendorID: -1,
|
||||
Status: model.WaybillStatusDelivered,
|
||||
WaybillCreatedAt: time.Now(),
|
||||
@@ -1765,7 +1766,7 @@ func UpdateWaybillDesiredFee(ctx *jxcontext.Context, vendorOrderID string, desir
|
||||
DesiredFee: int64(desiredFee),
|
||||
}
|
||||
dao.CreateEntity(db, waybill)
|
||||
order.VendorWaybillID = "-1"
|
||||
order.VendorWaybillID = waybill.VendorWaybillID
|
||||
dao.UpdateEntity(db, order, "VendorWaybillID")
|
||||
} else {
|
||||
bill.DesiredFee = int64(desiredFee)
|
||||
@@ -1779,3 +1780,19 @@ func AcceptOrRefuseOrder(ctx *jxcontext.Context, vendorOrderID string, vendorID
|
||||
handler := partner.GetPurchaseOrderHandlerFromVendorID(vendorID)
|
||||
return handler.AcceptOrRefuseOrder(order, isAccept, ctx.GetUserName())
|
||||
}
|
||||
|
||||
func GenOrderNo(ctx *jxcontext.Context) (orderNo int64) {
|
||||
const prefix = 88
|
||||
const randPartNum = 1000
|
||||
orderNo = time.Now().Unix() - orderNoBeginTimestamp
|
||||
// fmt.Println(orderNo)
|
||||
orderNo = orderNo * randPartNum
|
||||
md5Bytes := md5.Sum([]byte(utils.GetUUID()))
|
||||
randPart := 0
|
||||
for k, v := range md5Bytes {
|
||||
randPart += int(v) << ((k % 3) * 8)
|
||||
}
|
||||
orderNo += int64(randPart % randPartNum)
|
||||
orderNo += int64(math.Pow10(int(math.Log10(float64(orderNo)))+1)) * prefix
|
||||
return orderNo
|
||||
}
|
||||
|
||||
@@ -437,18 +437,12 @@ func syncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, causeFlag
|
||||
}
|
||||
skus = skus2
|
||||
}
|
||||
if storeID == 667481 {
|
||||
fmt.Println("gggggggggggggggggggggg1", len(skus))
|
||||
}
|
||||
formalizeStoreSkuList(skus)
|
||||
//京东商城的商品名规则不同
|
||||
// name,空格,comment,约xxg
|
||||
// if vendorID == model.VendorIDJDShop {
|
||||
// formalizeStoreSkuListForJds(skus)
|
||||
// }
|
||||
if storeID == 667481 {
|
||||
fmt.Println("gggggggggggggggggggggg2", len(skus))
|
||||
}
|
||||
singleStoreHandler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.ISingleStoreStoreSkuHandler)
|
||||
storeSkuHandler := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IPurchasePlatformStoreSkuHandler)
|
||||
reorderHandler, _ := partner.GetPurchasePlatformFromVendorID(vendorID).(partner.IStoreSkuSorter)
|
||||
|
||||
Reference in New Issue
Block a user