protected virtual async Task UpdateStorePostionAsync(CreateOrUpdateStorePostionInput input) { Debug.Assert(input.StorePostion.Id != null, "input.StorePostion.Id should be set."); var storePostion = input.StorePostion.MapTo<BaseStorePostionInfo>(); storePostion.LastModifierUserId = AbpSession.UserId; storePostion.LastModifierUserName = GetCurrentUser().RealName; storePostion.LastModificationTime = Clock.Now; await _storePostionRepository.UpdateAsync(storePostion); cacheHandler.Remove(CacheCategoryStorePostion, "GetStorePostionList"); }
protected virtual async Task CreateStorePostionAsync(CreateOrUpdateStorePostionInput input) { var storePostion = input.StorePostion.MapTo<BaseStorePostionInfo>(); storePostion.Id = GuidHelper.NewGuid(); storePostion.OrgId = AbpSession.OrgId; storePostion.CreatorUserId = AbpSession.UserId; storePostion.CreatorUserName = GetCurrentUser().RealName; storePostion.CreationTime = Clock.Now; await _storePostionRepository.InsertAsync(storePostion); cacheHandler.Remove(CacheCategoryStorePostion, "GetStorePostionList"); }
/// <summary> /// 添加修改实体 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task CreateOrUpdateStorePostion(CreateOrUpdateStorePostionInput input) { if (input.StorePostion.Id != null && input.StorePostion.Id != Guid.Empty) { await UpdateStorePostionAsync(input); } else { await CreateStorePostionAsync(input); } }