This commit is contained in:
邹宗楠
2024-02-27 10:58:13 +08:00
parent 0c8c6b9d3e
commit c067af71b6
5 changed files with 3 additions and 19 deletions

View File

@@ -337,7 +337,6 @@ func (p *PurchaseHandler) GetStoreStatus(ctx *jxcontext.Context, vendorOrgCode s
// 当前京东的storeCrud消息不会在门店状态改变时发送所以意义不大先放在这里
func (c *PurchaseHandler) OnStoreMsg(vendorOrgCode string, msg *jdapi.CallbackOrderMsg) (response *jdapi.CallbackResponse) {
globals.SugarLogger.Debugf("OnStoreMsg========= %s", utils.Format4Output(msg, false))
var err error
if msg.StatusID == jdapi.StatusIDUpdateStore {
var storeStatus int

View File

@@ -141,11 +141,6 @@ func cancelOneShopAct(act *model.Act2, vendorStoreID string, actStoreSku []*mode
if list := storeSku2ActData4Delete(actStoreSku, nil /*model.IsSyncStatusNeedDelete*/); len(list) > 0 {
if globals.EnableMtwmStoreWrite {
failedList2, err2 := api.MtwmAPI.RetailDiscountDelete2(vendorStoreID, jxActType2Mtwm(act.Type), list)
globals.SugarLogger.Debugf("==============failedList2 := %s", utils.Format4Output(failedList2, false))
globals.SugarLogger.Debugf("==============err2 := %v", err2)
globals.SugarLogger.Debugf("==============vendorStoreID := %s", utils.Format4Output(vendorStoreID, false))
globals.SugarLogger.Debugf("============== jxActType2Mtwm(act.Type) := %s", utils.Format4Output(jxActType2Mtwm(act.Type), false))
globals.SugarLogger.Debugf("==============list := %s", utils.Format4Output(list, false))
actStoreSkuMap := make(map[string]*model.ActStoreSku2)
for _, v := range actStoreSku {
actStoreSkuMap[v.VendorActID] = v
@@ -233,26 +228,21 @@ func (c *PurchaseHandler) SyncAct(ctx *jxcontext.Context, parentTask tasksch.ITa
}
}
}
globals.SugarLogger.Debugf("=========actStoreSkuList4Create := %s", utils.Format4Output(actStoreSkuList4Create, false))
err = func() (err error) {
globals.SugarLogger.Debugf("=========act := %s", utils.Format4Output(act, false))
if model.IsSyncStatusDelete(act.SyncStatus) {
globals.SugarLogger.Debugf("=========act := %s", "delete")
canceledList, err2 := cancelSkuAct(ctx, nil, act, actStoreSkuList)
updateItems = append(updateItems, partner.ActStoreSku2Update(ctx, canceledList, model.SyncFlagModifiedMask)...)
if err = err2; err == nil {
updateItems = append(updateItems, partner.Act2Update(ctx, act, model.SyncFlagModifiedMask))
}
} else if model.IsSyncStatusNew(act.SyncStatus) {
globals.SugarLogger.Debugf("=========act := %s", "create")
createdList, err2 := createSkuAct(ctx, nil, act, actStoreSkuList4Create)
updateItems = append(updateItems, partner.ActStoreSku2Update(ctx, createdList, model.SyncFlagNewMask)...)
if err = err2; err == nil {
updateItems = append(updateItems, partner.Act2Update(ctx, act, model.SyncFlagNewMask))
}
} else if model.IsSyncStatusUpdate(act.SyncStatus) {
globals.SugarLogger.Debugf("=========act := %s", "update")
if len(actStoreSkuList4Create) > 0 {
addedList, err2 := createSkuAct(ctx, nil, act, actStoreSkuList4Create)
updateItems = append(updateItems, partner.ActStoreSku2Update(ctx, addedList, model.SyncFlagNewMask)...)