mark商品审核先不改
This commit is contained in:
@@ -4669,22 +4669,22 @@ func doStoreSkuAudit(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*Sto
|
|||||||
return true, err
|
return true, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func StoreSkuPriceAudit(ctx *jxcontext.Context, storeSkuAudits []*model.StoreSkuAudit, status int, isAsync, isContinueWhenError bool) (storeSkuAudits2 []*model.StoreSkuAudit, hint string, err error) {
|
func StoreSkuPriceAudit(ctx *jxcontext.Context, storeSkuAudits []*model.StoreSkuAudit, status int, isAsync, isContinueWhenError bool) (hint string, err error) {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
if status == model.StoreAuditStatusOnline {
|
if status == model.StoreAuditStatusOnline {
|
||||||
return nil, "", fmt.Errorf("审核标志不正确!")
|
return "", fmt.Errorf("审核标志不正确!")
|
||||||
}
|
|
||||||
for _, v := range storeSkuAudits {
|
|
||||||
skuList, _ := dao.GetStoreSkusByNameIDs(db, []int{v.StoreID}, v.NameID)
|
|
||||||
if len(skuList) > 0 {
|
|
||||||
if int64(v.AuditPrice) > skuList[0].UnitPrice*2 {
|
|
||||||
storeSkuAudits2 = append(storeSkuAudits2, v)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(storeSkuAudits2) > 0 {
|
|
||||||
return storeSkuAudits2, "", err
|
|
||||||
}
|
}
|
||||||
|
// for _, v := range storeSkuAudits {
|
||||||
|
// skuList, _ := dao.GetStoreSkusByNameIDs(db, []int{v.StoreID}, v.NameID)
|
||||||
|
// if len(skuList) > 0 {
|
||||||
|
// if int64(v.AuditPrice) > skuList[0].UnitPrice*2 {
|
||||||
|
// storeSkuAudits2 = append(storeSkuAudits2, v)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if len(storeSkuAudits2) > 0 {
|
||||||
|
// return storeSkuAudits2, "", err
|
||||||
|
// }
|
||||||
task := tasksch.NewParallelTask("StoreSkuPriceAudit", tasksch.NewParallelConfig().SetParallelCount(5).SetIsContinueWhenError(isContinueWhenError), ctx,
|
task := tasksch.NewParallelTask("StoreSkuPriceAudit", tasksch.NewParallelConfig().SetParallelCount(5).SetIsContinueWhenError(isContinueWhenError), ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
storeAudit := batchItemList[0].(*model.StoreSkuAudit)
|
storeAudit := batchItemList[0].(*model.StoreSkuAudit)
|
||||||
@@ -4762,5 +4762,5 @@ func StoreSkuPriceAudit(ctx *jxcontext.Context, storeSkuAudits []*model.StoreSku
|
|||||||
_, err = task.GetResult(0)
|
_, err = task.GetResult(0)
|
||||||
hint = "1"
|
hint = "1"
|
||||||
}
|
}
|
||||||
return nil, hint, err
|
return hint, err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -888,11 +888,7 @@ func (c *StoreSkuController) StoreSkuPriceAudit() {
|
|||||||
if err = jxutils.Strings2Objs(params.Payload, &storeSkuAudits); err != nil {
|
if err = jxutils.Strings2Objs(params.Payload, &storeSkuAudits); err != nil {
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
}
|
}
|
||||||
retVal, hint, err := cms.StoreSkuPriceAudit(params.Ctx, storeSkuAudits, params.Status, params.IsAsync, params.IsContinueWhenError)
|
retVal, err = cms.StoreSkuPriceAudit(params.Ctx, storeSkuAudits, params.Status, params.IsAsync, params.IsContinueWhenError)
|
||||||
if hint != "" {
|
|
||||||
return hint, "", err
|
|
||||||
} else {
|
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user