test
This commit is contained in:
@@ -5315,6 +5315,7 @@ func doStoreSkuAuditForGy(ctx *jxcontext.Context, storeIDs []int, skuBindInfos [
|
|||||||
|
|
||||||
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) (storeSkuAudits2 []*model.StoreSkuAudit, hint string, err error) {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
|
multiFlag := false
|
||||||
if status == model.StoreAuditStatusOnline {
|
if status == model.StoreAuditStatusOnline {
|
||||||
return nil, "", fmt.Errorf("审核标志不正确!")
|
return nil, "", fmt.Errorf("审核标志不正确!")
|
||||||
}
|
}
|
||||||
@@ -5330,10 +5331,23 @@ func StoreSkuPriceAudit(ctx *jxcontext.Context, storeSkuAudits []*model.StoreSku
|
|||||||
}
|
}
|
||||||
return storeSkuAudits2, "", err
|
return storeSkuAudits2, "", err
|
||||||
}
|
}
|
||||||
|
//批量的时候如果有改超出两倍价格或者在做活动的商品就滤掉
|
||||||
|
if len(storeSkuAudits) > 1 {
|
||||||
|
multiFlag = true
|
||||||
|
}
|
||||||
deletedDuplicateWaitAuditData(ctx, db)
|
deletedDuplicateWaitAuditData(ctx, db)
|
||||||
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)
|
||||||
|
if multiFlag {
|
||||||
|
skuList, _ := dao.GetStoreSkusByNameIDs(db, []int{storeAudit.StoreID}, storeAudit.NameID)
|
||||||
|
if len(skuList) > 0 {
|
||||||
|
if int64(storeAudit.AuditPrice) > skuList[0].UnitPrice*2 {
|
||||||
|
return nil, fmt.Errorf("修改的价格超出原价格两倍,请单个审核!门店ID:[%v],商品nameID:[%v],商品名:[%v]", storeAudit.StoreID, storeAudit.NameID, skuList[0].Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//dao.QueryActs(db, 0, 0, 10, -1, "", -1, []int{model.ActStatusCreated}, []int{model.ActSkuDirectDown, model.ActSkuSecKill, model.ActSkuDiscount})
|
||||||
|
}
|
||||||
storeAudits, err := dao.GetStoreSkuAuditLight(db, []int{storeAudit.StoreID}, []int{storeAudit.NameID}, model.StoreAuditStatusOnline)
|
storeAudits, err := dao.GetStoreSkuAuditLight(db, []int{storeAudit.StoreID}, []int{storeAudit.NameID}, model.StoreAuditStatusOnline)
|
||||||
if len(storeAudits) == 0 || err != nil {
|
if len(storeAudits) == 0 || err != nil {
|
||||||
return retVal, err
|
return retVal, err
|
||||||
|
|||||||
@@ -1923,6 +1923,16 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
// dao.UpdateEntity(db, v, "ConsigneeMobile2")
|
// dao.UpdateEntity(db, v, "ConsigneeMobile2")
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
order, _ := partner.CurOrderManager.LoadOrder("2113480902000652", model.VendorIDJD)
|
||||||
|
handler := partner.GetPurchaseOrderHandlerFromVendorID(model.VendorIDJD)
|
||||||
|
order2, _ := handler.GetOrder(order.VendorOrgCode, order.VendorOrderID, "")
|
||||||
|
if len(order.Skus) == 0 {
|
||||||
|
if len(order2.Skus) > 0 {
|
||||||
|
for _, v := range order2.Skus {
|
||||||
|
dao.CreateEntity(dao.GetDB(), v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user