不用补改价

This commit is contained in:
苏尹岚
2020-06-05 09:48:16 +08:00
parent dd60689009
commit eb71787c70
5 changed files with 72 additions and 4 deletions

View File

@@ -863,6 +863,18 @@ func UpdateStoresSkus(ctx *jxcontext.Context, causeFlag int, storeIDs []int, sku
return hint, err
}
func UpdateStoresSkusWithoutSync(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*StoreSkuBindInfo) (err error) {
db := dao.GetDB()
if len(storeIDs) == 0 {
stores, _ := dao.GetStoreList(db, nil, nil, nil, nil, "")
for _, v := range stores {
storeIDs = append(storeIDs, v.ID)
}
}
updateStoresSkusWithoutSync(ctx, db, storeIDs, skuBindInfos, false)
return err
}
func UpdateStoresSkusByBind(ctx *jxcontext.Context, parentTask tasksch.ITask, skuBindInfos []*StoreSkuBindInfo, isAsync, isContinueWhenError, isFos bool) (hint string, err error) {
// if len(skuBindInfos) > maxStoreNameBind {
// return "", fmt.Errorf("门店商品信息大于%d", maxStoreNameBind)

View File

@@ -1630,6 +1630,7 @@ func RefreshJXPriceChange(ctx *jxcontext.Context, storeID int) (hint string, err
SELECT *
FROM store
WHERE deleted_at = ? AND status <> ?
AND id <> 100118 AND id <> 100274 AND id <> 100205
`
sqlParams := []interface{}{utils.DefaultTimeValue, model.StoreStatusDisabled}
if storeID != 0 {
@@ -1668,13 +1669,14 @@ func RefreshJXPriceChange(ctx *jxcontext.Context, storeID int) (hint string, err
for _, v := range storeSkus {
skuAndName, _ := dao.GetSkus(db, []int{v.SkuID}, nil, nil, nil, nil)
skuBindInfo := &cms.StoreSkuBindInfo{
StoreID: store.ID,
// StoreID: store.ID,
NameID: skuAndName[0].NameID,
UnitPrice: v.UnitPrice * store.PayPercentage / 100,
}
skuBindInfos = append(skuBindInfos, skuBindInfo)
}
cms.UpdateStoresSkusByBind(ctx, task, skuBindInfos, isAsync, isContinueWhenError, false)
// cms.UpdateStoresSkusByBind(ctx, task, skuBindInfos, isAsync, isContinueWhenError, false)
cms.UpdateStoresSkusWithoutSync(ctx, []int{store.ID}, skuBindInfos)
store.PayPercentage = 100
dao.UpdateEntity(db, store, "PayPercentage")
return retVal, err