Merge remote-tracking branch 'origin/jdshop' into jxact
This commit is contained in:
@@ -1297,8 +1297,12 @@ func RefreshJdShopOrdersEarningPrice(ctx *jxcontext.Context, orderStartTime, ord
|
||||
order := &model.GoodsOrder{}
|
||||
order.VendorOrderID = utils.Int64ToStr(v.OrderID)
|
||||
dao.GetEntity(db, order, "VendorOrderID")
|
||||
storeDeatil, _ := dao.GetStoreDetail(db, jxutils.GetSaleStoreIDFromOrder(order), order.VendorID)
|
||||
order.TotalShopMoney = utils.Float64TwoInt64(v.DueAmount * 100)
|
||||
dao.UpdateEntity(db, order, "TotalShopMoney")
|
||||
if order.NewEarningPrice == 0 {
|
||||
jxutils.RefreshOrderEarningPrice2(order, storeDeatil.PayPercentage)
|
||||
}
|
||||
dao.UpdateEntity(db, order, "TotalShopMoney", "NewEarningPrice")
|
||||
}
|
||||
}
|
||||
return err
|
||||
|
||||
@@ -1159,6 +1159,10 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
|
||||
} else {
|
||||
err = ErrCanNotFindVendor
|
||||
}
|
||||
storeDetail, _ := dao.GetStoreDetailByVendorStoreID(db, storeMap.VendorStoreID, storeMap.VendorID)
|
||||
if storeDetail != nil {
|
||||
return nil, fmt.Errorf("此平台门店ID已在京西有绑定,请先解除绑定,平台门店ID :[%v]", storeMap.VendorStoreID)
|
||||
}
|
||||
} else if vendorID == model.VendorIDJX {
|
||||
ReCalculateJxPriceLight(db, ctx, storeID)
|
||||
} else if vendorID == model.VendorIDYB {
|
||||
|
||||
@@ -4644,18 +4644,21 @@ func doStoreSkuAudit(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*Sto
|
||||
// return false, err
|
||||
// }
|
||||
if ctx.GetLoginType() != weixin.AuthTypeMP && ctx.GetLoginType() != weixin.AuthTypeMini {
|
||||
if len(storeAudits) > 0 {
|
||||
storeAudits[0].DeletedAt = time.Now()
|
||||
dao.UpdateEntity(db, storeAudits[0], "DeletedAt")
|
||||
// if globals.IsProductEnv() {
|
||||
// skuAndNames, err := dao.GetSkus(db, nil, []int{skuBindInfo.NameID}, nil, nil, nil)
|
||||
// if len(skuAndNames) > 0 && err == nil {
|
||||
// weixinmsg.NotifyStoreOpRequestStatus(true, storeID, skuBindInfo.NameID, jxutils.ComposeSpuName(skuAndNames[0].Prefix, skuAndNames[0].Name, 0), storeAudits[0].OriginUnitPrice, skuBindInfo.UnitPrice, "")
|
||||
// }
|
||||
// }
|
||||
authInfo, err := ctx.GetV2AuthInfo()
|
||||
if err == nil && authInfo != nil {
|
||||
if len(storeAudits) > 0 {
|
||||
storeAudits[0].DeletedAt = time.Now()
|
||||
dao.UpdateEntity(db, storeAudits[0], "DeletedAt")
|
||||
// if globals.IsProductEnv() {
|
||||
// skuAndNames, err := dao.GetSkus(db, nil, []int{skuBindInfo.NameID}, nil, nil, nil)
|
||||
// if len(skuAndNames) > 0 && err == nil {
|
||||
// weixinmsg.NotifyStoreOpRequestStatus(true, storeID, skuBindInfo.NameID, jxutils.ComposeSpuName(skuAndNames[0].Prefix, skuAndNames[0].Name, 0), storeAudits[0].OriginUnitPrice, skuBindInfo.UnitPrice, "")
|
||||
// }
|
||||
// }
|
||||
}
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit return3 storeID : %v nameID: %v", storeID, skuBindInfo.NameID)
|
||||
return false, err
|
||||
}
|
||||
globals.SugarLogger.Debugf("doStoreSkuAudit return3 storeID : %v nameID: %v", storeID, skuBindInfo.NameID)
|
||||
return false, err
|
||||
}
|
||||
storeSkuAudit := &model.StoreSkuAudit{
|
||||
StoreID: storeID,
|
||||
|
||||
@@ -660,7 +660,7 @@ func buildCreateWareParam(storeSku *dao.StoreSkuSyncInfo) (createSkuParamWare *j
|
||||
}
|
||||
attrBzq := &jdshopapi.CreateSkuParamAttrs{
|
||||
AttrID: utils.Int2Str(attrIDs["保质期"]),
|
||||
AttrValues: []string{"5天"},
|
||||
AttrValues: []string{"5"},
|
||||
}
|
||||
attrsProp = append(attrsProp, attrZctj)
|
||||
attrsProp = append(attrsProp, attrJhl)
|
||||
|
||||
@@ -267,8 +267,6 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
foodData["min_order_count"] = 1
|
||||
}
|
||||
foodData["unit"] = storeSku.Unit
|
||||
foodData["ladder_box_num"] = storeSku.LadderBoxNum
|
||||
foodData["ladder_box_price"] = jxutils.IntPrice2Standard(int64(storeSku.LadderBoxPrice))
|
||||
attr := switchAttr(storeSku.VendorVendorCatID)
|
||||
if attr != "" {
|
||||
foodData["common_attr_value"] = attr
|
||||
@@ -310,6 +308,8 @@ func (p *PurchaseHandler) createOrUpdateStoreSkus(ctx *jxcontext.Context, storeI
|
||||
if storeSku.Upc != "" {
|
||||
skus[0]["upc"] = storeSku.Upc
|
||||
}
|
||||
skus[0]["ladder_box_num"] = storeSku.LadderBoxNum
|
||||
skus[0]["ladder_box_price"] = jxutils.IntPrice2Standard(int64(storeSku.LadderBoxPrice))
|
||||
if foodData["tag_id"] != nil {
|
||||
skus[0]["weight"] = storeSku.Weight // weight字段仅限服饰鞋帽、美妆、日用品、母婴、生鲜果蔬、生活超市下的便利店/超市门店品类的商家使用
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user