修改配送费修改

This commit is contained in:
苏尹岚
2020-09-10 08:56:51 +08:00
parent e17383807a
commit 1f9c3ae763
2 changed files with 19 additions and 8 deletions

View File

@@ -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
}

View File

@@ -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)