- jdapi.UpdateStoreInfo4Open2
This commit is contained in:
@@ -143,13 +143,15 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
|
|||||||
storeParams.DeliveryRangeRadius = int(utils.Str2Int64WithDefault(store.DeliveryRange, 0))
|
storeParams.DeliveryRangeRadius = int(utils.Str2Int64WithDefault(store.DeliveryRange, 0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
modifyCloseStatus := false
|
||||||
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagDeletedMask|model.SyncFlagStoreStatus) != 0 {
|
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagDeletedMask|model.SyncFlagStoreStatus) != 0 {
|
||||||
|
modifyCloseStatus = true
|
||||||
_, storeParams.CloseStatus = JxStoreStatus2JdStatus(jxutils.MergeStoreStatus(store.Status, store.JdStoreStatus))
|
_, storeParams.CloseStatus = JxStoreStatus2JdStatus(jxutils.MergeStoreStatus(store.Status, store.JdStoreStatus))
|
||||||
}
|
}
|
||||||
fillOpTimeParams(storeParams, store.GetOpTimeList())
|
fillOpTimeParams(storeParams, store.GetOpTimeList())
|
||||||
globals.SugarLogger.Debug(utils.Format4Output(storeParams, false))
|
globals.SugarLogger.Debug(utils.Format4Output(storeParams, false))
|
||||||
if globals.EnableJdStoreWrite {
|
if globals.EnableJdStoreWrite {
|
||||||
if err = getAPI("").UpdateStoreInfo4Open2(storeParams); err != nil {
|
if err = getAPI("").UpdateStoreInfo4Open2(storeParams, modifyCloseStatus); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -208,7 +210,7 @@ func (p *PurchaseHandler) RefreshAllStoresID(ctx *jxcontext.Context, parentTask
|
|||||||
storeParams.OutSystemID = store.VendorStoreID
|
storeParams.OutSystemID = store.VendorStoreID
|
||||||
}
|
}
|
||||||
if globals.EnableJdStoreWrite {
|
if globals.EnableJdStoreWrite {
|
||||||
err = getAPI("").UpdateStoreInfo4Open2(storeParams)
|
err = getAPI("").UpdateStoreInfo4Open2(storeParams, false)
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}, stores)
|
}, stores)
|
||||||
@@ -300,7 +302,7 @@ func (c *PurchaseHandler) UpdateStoreStatus(ctx *jxcontext.Context, storeID int,
|
|||||||
StationNo: vendorStoreID,
|
StationNo: vendorStoreID,
|
||||||
Operator: ctx.GetUserName(),
|
Operator: ctx.GetUserName(),
|
||||||
CloseStatus: closeStatus,
|
CloseStatus: closeStatus,
|
||||||
})
|
}, true)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -335,7 +337,7 @@ func (c *PurchaseHandler) UpdateStoreOpTime(ctx *jxcontext.Context, storeID int,
|
|||||||
}
|
}
|
||||||
fillOpTimeParams(params, opTimeList)
|
fillOpTimeParams(params, opTimeList)
|
||||||
if globals.EnableJdStoreWrite {
|
if globals.EnableJdStoreWrite {
|
||||||
err = getAPI("").UpdateStoreInfo4Open2(params)
|
err = getAPI("").UpdateStoreInfo4Open2(params, false)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -457,7 +459,7 @@ func (c *PurchaseHandler) UpdateStoreCustomID(ctx *jxcontext.Context, vendorStor
|
|||||||
StationNo: vendorStoreID,
|
StationNo: vendorStoreID,
|
||||||
Operator: ctx.GetUserName(),
|
Operator: ctx.GetUserName(),
|
||||||
OutSystemID: utils.Int2Str(int(storeID)),
|
OutSystemID: utils.Int2Str(int(storeID)),
|
||||||
})
|
}, false)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user