From 61a5f9f040a44bc0e8e82ab09ecf0031ffdf1afe Mon Sep 17 00:00:00 2001 From: gazebo Date: Thu, 19 Sep 2019 17:26:38 +0800 Subject: [PATCH] - jdapi.UpdateStoreInfo4Open2 --- business/partner/purchase/jd/store.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/business/partner/purchase/jd/store.go b/business/partner/purchase/jd/store.go index 7cf04dcad..86de5ca96 100644 --- a/business/partner/purchase/jd/store.go +++ b/business/partner/purchase/jd/store.go @@ -143,13 +143,15 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin storeParams.DeliveryRangeRadius = int(utils.Str2Int64WithDefault(store.DeliveryRange, 0)) } } + modifyCloseStatus := false if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagDeletedMask|model.SyncFlagStoreStatus) != 0 { + modifyCloseStatus = true _, storeParams.CloseStatus = JxStoreStatus2JdStatus(jxutils.MergeStoreStatus(store.Status, store.JdStoreStatus)) } fillOpTimeParams(storeParams, store.GetOpTimeList()) globals.SugarLogger.Debug(utils.Format4Output(storeParams, false)) if globals.EnableJdStoreWrite { - if err = getAPI("").UpdateStoreInfo4Open2(storeParams); err != nil { + if err = getAPI("").UpdateStoreInfo4Open2(storeParams, modifyCloseStatus); err != nil { return err } } @@ -208,7 +210,7 @@ func (p *PurchaseHandler) RefreshAllStoresID(ctx *jxcontext.Context, parentTask storeParams.OutSystemID = store.VendorStoreID } if globals.EnableJdStoreWrite { - err = getAPI("").UpdateStoreInfo4Open2(storeParams) + err = getAPI("").UpdateStoreInfo4Open2(storeParams, false) } return nil, err }, stores) @@ -300,7 +302,7 @@ func (c *PurchaseHandler) UpdateStoreStatus(ctx *jxcontext.Context, storeID int, StationNo: vendorStoreID, Operator: ctx.GetUserName(), CloseStatus: closeStatus, - }) + }, true) } return err } @@ -335,7 +337,7 @@ func (c *PurchaseHandler) UpdateStoreOpTime(ctx *jxcontext.Context, storeID int, } fillOpTimeParams(params, opTimeList) if globals.EnableJdStoreWrite { - err = getAPI("").UpdateStoreInfo4Open2(params) + err = getAPI("").UpdateStoreInfo4Open2(params, false) } return err } @@ -457,7 +459,7 @@ func (c *PurchaseHandler) UpdateStoreCustomID(ctx *jxcontext.Context, vendorStor StationNo: vendorStoreID, Operator: ctx.GetUserName(), OutSystemID: utils.Int2Str(int(storeID)), - }) + }, false) } return err }