1
This commit is contained in:
@@ -1903,8 +1903,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
// if len(storeIDs)*len(skuBindInfos) > maxStoreNameBind2 {
|
||||
// return nil, fmt.Errorf("门店商品信息大于%d", maxStoreNameBind2)
|
||||
// }
|
||||
globals.SugarLogger.Debugf("skuBindInfos--------:= %s", utils.Format4Output(skuBindInfos, false))
|
||||
|
||||
storeIDs = uniqueStoreIDs(storeIDs)
|
||||
skuBindInfos = uniqueStoreNameBind(skuBindInfos)
|
||||
|
||||
@@ -2029,7 +2027,6 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
}
|
||||
}
|
||||
unitPrice = int(math.Floor(float64(unitPrice)*scaleFactor/10+0.5)) * 10 //四舍五入 价格为100倍 角分为十位个位 除以10 + 0.5对分位向下取整(完成四舍五入的方法)
|
||||
globals.SugarLogger.Debugf("allBinds--------:= %s", utils.Format4Output(allBinds, false))
|
||||
for _, v := range allBinds {
|
||||
if v.Stock == 0 {
|
||||
v.Stock = model.MaxStoreSkuStockQty
|
||||
@@ -2077,14 +2074,12 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
||||
setStoreSkuBindStatus(skuBind, model.SyncFlagNewMask)
|
||||
dao.WrapAddIDCULDEntity(skuBind, userName)
|
||||
if deletedSku := dao.GetDeletedStoreSkuBind(db, skuBind.StoreID, skuBind.SkuID); deletedSku == nil {
|
||||
globals.SugarLogger.Debugf("deletedSku--------1:= %s", utils.Format4Output(deletedSku, false))
|
||||
if err = dao.CreateEntity(db, skuBind); err != nil {
|
||||
dao.Rollback(db, txDB)
|
||||
return nil, err
|
||||
}
|
||||
num = 1
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("deletedSku--------2:= %s", utils.Format4Output(deletedSku, false))
|
||||
// 需要处理,在删除某个门店商品,同步失败的情况下,又把商品重新关注。
|
||||
// 所以统一处理成恢复删除的记录,这样避免问题
|
||||
skuBind.ID = deletedSku.ID
|
||||
|
||||
@@ -546,21 +546,13 @@ func (c *PurchaseHandler) PickupGoods(order *model.GoodsOrder, isSelfDelivery bo
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
api := getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), "")
|
||||
for i := 0; i < 3; i++ {
|
||||
err2 := api.DeliveryFinish(param)
|
||||
if err2 != nil {
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
err = err2
|
||||
continue
|
||||
}
|
||||
if err2 == nil {
|
||||
c.postFakeMsg(order.VendorOrderID, tao_vegetable.OrderStatusPickedUp, tao_vegetable.OrderStatusPickedUp)
|
||||
return nil
|
||||
}
|
||||
err = getAPI(order.VendorOrgCode, jxutils.GetSaleStoreIDFromOrder(order), "").DeliveryFinish(param)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
c.postFakeMsg(order.VendorOrderID, tao_vegetable.OrderStatusPickedUp, tao_vegetable.OrderStatusPickedUp)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ func (c *MtwmController) onCallbackMsg(msgType string) {
|
||||
vendorStoreId = finishedPickup.AppPoiCode
|
||||
}
|
||||
if vendorStoreId != "" {
|
||||
globals.SugarLogger.Debugf("-----饿百订单非菜市消息推送-%s", utils.Format4Output(msg, false))
|
||||
globals.SugarLogger.Debugf("-----美团订单非菜市消息推送-%s", utils.Format4Output(msg, false))
|
||||
storeDetail, _ := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreId, model.VendorIDMTWM, "")
|
||||
if storeDetail == nil {
|
||||
switch web.BConfig.RunMode {
|
||||
|
||||
Reference in New Issue
Block a user