1
This commit is contained in:
@@ -1020,7 +1020,6 @@ func CancelAct(ctx *jxcontext.Context, actID int) (err error) {
|
|||||||
|
|
||||||
// actStoreSkuParam为空,不会删除act_store_sku,但会删除act_store_sku_map
|
// actStoreSkuParam为空,不会删除act_store_sku,但会删除act_store_sku_map
|
||||||
func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, actStoreSkuParam []*ActStoreSkuParam) (originSyncStatus int8, err error) {
|
func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, actStoreSkuParam []*ActStoreSkuParam) (originSyncStatus int8, err error) {
|
||||||
globals.SugarLogger.Debugf("-----actStoreSkuParam- := %s", utils.Format4Output(actStoreSkuParam, false))
|
|
||||||
actMap, err := dao.GetActVendorInfo(db, actID, nil)
|
actMap, err := dao.GetActVendorInfo(db, actID, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@@ -1074,7 +1073,6 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
isNeedCancelAct := true
|
isNeedCancelAct := true
|
||||||
globals.SugarLogger.Debugf("-----actStoreSkuParamMap- := %s", utils.Format4Output(actStoreSkuParamMap, false))
|
|
||||||
for vendorID, act := range actMap {
|
for vendorID, act := range actMap {
|
||||||
originSyncStatus |= act.SyncStatus
|
originSyncStatus |= act.SyncStatus
|
||||||
isDeleteAll := true
|
isDeleteAll := true
|
||||||
@@ -1083,9 +1081,7 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act
|
|||||||
actStoreSkuMap := partner.SplitActStoreSku(actStoreSkuMap[vendorID])
|
actStoreSkuMap := partner.SplitActStoreSku(actStoreSkuMap[vendorID])
|
||||||
for storeID := range actStoreSkuMap {
|
for storeID := range actStoreSkuMap {
|
||||||
for _, actStoreSku := range actStoreSkuMap[storeID] {
|
for _, actStoreSku := range actStoreSkuMap[storeID] {
|
||||||
globals.SugarLogger.Debugf("---------bool := %v", actStoreSkuParam == nil || actStoreSkuParamMap[jxutils.Combine2Int(actStoreSku.StoreID, actStoreSku.SkuID)] != nil)
|
|
||||||
if actStoreSkuParam == nil || actStoreSkuParamMap[jxutils.Combine2Int(actStoreSku.StoreID, actStoreSku.SkuID)] != nil {
|
if actStoreSkuParam == nil || actStoreSkuParamMap[jxutils.Combine2Int(actStoreSku.StoreID, actStoreSku.SkuID)] != nil {
|
||||||
globals.SugarLogger.Debugf("---------act Type:= %d", act.Type)
|
|
||||||
if act.Type == model.ActSkuFake {
|
if act.Type == model.ActSkuFake {
|
||||||
_, err = dao.DeleteEntityLogically(db, &model.ActStoreSkuMap{}, nil, ctx.GetUserName(),
|
_, err = dao.DeleteEntityLogically(db, &model.ActStoreSkuMap{}, nil, ctx.GetUserName(),
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
@@ -1113,8 +1109,6 @@ func DeleteActStoreSkuBind(ctx *jxcontext.Context, db *dao.DaoDB, actID int, act
|
|||||||
isDeleteAll = true
|
isDeleteAll = true
|
||||||
isDeleteAtLeastOne = true
|
isDeleteAtLeastOne = true
|
||||||
}
|
}
|
||||||
globals.SugarLogger.Debugf("---------act isDeleteAll:= %v", isDeleteAtLeastOne)
|
|
||||||
globals.SugarLogger.Debugf("---------act isDeleteAtLeastOne:= %v", isDeleteAtLeastOne)
|
|
||||||
if isDeleteAll || isDeleteAtLeastOne {
|
if isDeleteAll || isDeleteAtLeastOne {
|
||||||
syncStatus := int8(model.SyncFlagModifiedMask)
|
syncStatus := int8(model.SyncFlagModifiedMask)
|
||||||
if isDeleteAll {
|
if isDeleteAll {
|
||||||
|
|||||||
@@ -93,7 +93,6 @@ func createOneShopAct(act *model.Act2, vendorStoreID string, actStoreSku []*mode
|
|||||||
|
|
||||||
//5873
|
//5873
|
||||||
if err2 != nil && strings.Contains(err2.Error(), "未获取有效门店id") {
|
if err2 != nil && strings.Contains(err2.Error(), "未获取有效门店id") {
|
||||||
|
|
||||||
temp, err := dao.GetStoreDetailForDD(dao.GetDB(), 0, model.VendorIDMTWM, vendorStoreID, "")
|
temp, err := dao.GetStoreDetailForDD(dao.GetDB(), 0, model.VendorIDMTWM, vendorStoreID, "")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
actResult, faileInfoList, err2 = getAPI(temp.VendorOrgCode, 0, vendorStoreID).RetailDiscountBatchSave2(vendorStoreID, jxActType2Mtwm(act.Type), actData)
|
actResult, faileInfoList, err2 = getAPI(temp.VendorOrgCode, 0, vendorStoreID).RetailDiscountBatchSave2(vendorStoreID, jxActType2Mtwm(act.Type), actData)
|
||||||
@@ -141,10 +140,9 @@ func createOneShopAct(act *model.Act2, vendorStoreID string, actStoreSku []*mode
|
|||||||
func cancelOneShopAct(act *model.Act2, vendorStoreID string, actStoreSku []*model.ActStoreSku2) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
func cancelOneShopAct(act *model.Act2, vendorStoreID string, actStoreSku []*model.ActStoreSku2) (failedList []*partner.StoreSkuInfoWithErr, err error) {
|
||||||
if list := storeSku2ActData4Delete(actStoreSku, nil /*model.IsSyncStatusNeedDelete*/); len(list) > 0 {
|
if list := storeSku2ActData4Delete(actStoreSku, nil /*model.IsSyncStatusNeedDelete*/); len(list) > 0 {
|
||||||
if globals.EnableMtwmStoreWrite {
|
if globals.EnableMtwmStoreWrite {
|
||||||
globals.SugarLogger.Debugf("----cancelOneShopAct--: %s", utils.Format4Output(list, false))
|
storeDetail, _ := dao.GetStoreDetailByVendorStoreID(dao.GetDB(), vendorStoreID, model.VendorIDMTWM, "")
|
||||||
failedList2, err2 := api.MtwmAPI.RetailDiscountDelete2(vendorStoreID, jxActType2Mtwm(act.Type), list)
|
apiObj := getAPI(storeDetail.VendorOrgCode, 0, vendorStoreID)
|
||||||
globals.SugarLogger.Debugf("failedList2---- %s", utils.Format4Output(failedList2, false))
|
failedList2, err2 := apiObj.RetailDiscountDelete2(vendorStoreID, jxActType2Mtwm(act.Type), list)
|
||||||
globals.SugarLogger.Debugf("err2---- %v", err2)
|
|
||||||
actStoreSkuMap := make(map[string]*model.ActStoreSku2)
|
actStoreSkuMap := make(map[string]*model.ActStoreSku2)
|
||||||
for _, v := range actStoreSku {
|
for _, v := range actStoreSku {
|
||||||
actStoreSkuMap[v.VendorActID] = v
|
actStoreSkuMap[v.VendorActID] = v
|
||||||
|
|||||||
Reference in New Issue
Block a user