刷新调价包

This commit is contained in:
苏尹岚
2019-12-11 10:49:29 +08:00
parent 90edf2a581
commit 3cac9bfa32
4 changed files with 107 additions and 55 deletions

View File

@@ -1051,6 +1051,8 @@ func AddStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, vendorID int, vend
} else {
err = ErrCanNotFindVendor
}
} else {
ReCalculateJxPrice(ctx, []int{storeID})
}
dao.WrapAddIDCULDEntity(storeMap, userName)
if err == nil {
@@ -1148,6 +1150,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
}
err = nil // todo 忽略读不到DeliveryType的错误
}
if err == nil {
// globals.SugarLogger.Debug(utils.Format4Output(valid, false))
if len(valid) > 0 {
@@ -1168,6 +1171,9 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor
}
if err == nil && num > 0 {
if valid["pricePercentage"] != nil || valid["pricePercentagePack"] != nil {
if vendorID == model.VendorIDJX {
ReCalculateJxPrice(ctx, []int{storeID})
}
storeSkuBind := &model.StoreSkuBind{}
if num, err = dao.UpdateEntityLogicallyAndUpdateSyncStatus(db, storeSkuBind, nil, userName, map[string]interface{}{
model.FieldStoreID: storeID,