- rf.
This commit is contained in:
@@ -306,11 +306,3 @@ func UpdateStoreVendorMap(db *dao.DaoDB, storeID, vendorID int, payload map[stri
|
||||
}
|
||||
return num, err
|
||||
}
|
||||
|
||||
// 合并得到最终的门店状态
|
||||
func mergeStoreStatus(status int, vendorStatus int) int {
|
||||
if status < vendorStatus {
|
||||
return status
|
||||
}
|
||||
return vendorStatus
|
||||
}
|
||||
|
||||
@@ -52,11 +52,9 @@ func (v *VendorSync) SyncStore(db *dao.DaoDB, vendorID int, store *model.Store,
|
||||
}
|
||||
storeMapList, err := v.GetStoreMapInfo(db, store.ID)
|
||||
if err == nil {
|
||||
copiedStore := *store
|
||||
for _, storeMap := range storeMapList {
|
||||
if (vendorID == -1 || vendorID == storeMap.VendorID) && (isForce || storeMap.SyncStatus != 0) { // 对于门店,当前只有修改标记
|
||||
copiedStore.Status = mergeStoreStatus(store.Status, storeMap.Status)
|
||||
if err = GetPurchaseHandler(storeMap.VendorID).UpdateStore(storeMap.VendorStoreID, &copiedStore, userName); err == nil {
|
||||
if err = GetPurchaseHandler(storeMap.VendorID).UpdateStore(store.ID); err == nil {
|
||||
storeMap.SyncStatus = 0
|
||||
dao.UpdateEntity(db, storeMap, model.FieldSyncStatus)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user