Browse Source

Make storeId required. close #7

pull/49/head
gdlcf88 6 years ago
parent
commit
f1a00bacfa
  1. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/Orders/Order.cs
  2. 2
      modules/EasyAbp.EShop.Payment/src/EasyAbp.EShop.Payment.Domain/PaymentRecordOrders/PaymentRecordOrder.cs
  3. 2
      modules/EasyAbp.EShop.Payment/src/EasyAbp.EShop.Payment.Domain/RefundRecords/RefundRecord.cs
  4. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductCategories/Dtos/CreateUpdateProductCategoryDto.cs
  5. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductCategories/Dtos/ProductCategoryDto.cs
  6. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/CreateUpdateProductDto.cs
  7. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/GetProductListDto.cs
  8. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs
  9. 8
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs
  10. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductCategories/IProductCategoryRepository.cs
  11. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductCategories/ProductCategory.cs
  12. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs
  13. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductCategories/ProductCategoryRepository.cs
  14. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs
  15. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateUpdateProductViewModel.cs
  16. 2
      modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/Stores/IMultiStore.cs

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/Orders/Order.cs

@ -10,7 +10,7 @@ namespace EasyAbp.EShop.Orders.Orders
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid CustomerUserId { get; protected set; }

2
modules/EasyAbp.EShop.Payment/src/EasyAbp.EShop.Payment.Domain/PaymentRecordOrders/PaymentRecordOrder.cs

@ -10,7 +10,7 @@ namespace EasyAbp.EShop.Payment.PaymentRecordOrders
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid OrderId { get; protected set; }

2
modules/EasyAbp.EShop.Payment/src/EasyAbp.EShop.Payment.Domain/RefundRecords/RefundRecord.cs

@ -10,7 +10,7 @@ namespace EasyAbp.EShop.Payment.RefundRecords
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid OrderId { get; protected set; }

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductCategories/Dtos/CreateUpdateProductCategoryDto.cs

@ -7,7 +7,7 @@ namespace EasyAbp.EShop.Products.ProductCategories.Dtos
public class CreateUpdateProductCategoryDto
{
[DisplayName("ProductCategoryStoreId")]
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
[Required]
[DisplayName("ProductCategoryCategoryId")]

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductCategories/Dtos/ProductCategoryDto.cs

@ -5,7 +5,7 @@ namespace EasyAbp.EShop.Products.ProductCategories.Dtos
{
public class ProductCategoryDto : AuditedEntityDto<Guid>
{
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
public Guid CategoryId { get; set; }

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/CreateUpdateProductDto.cs

@ -9,7 +9,7 @@ namespace EasyAbp.EShop.Products.Products.Dtos
public class CreateUpdateProductDto : IValidatableObject
{
[DisplayName("ProductStoreId")]
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
[Required]
[DisplayName("ProductProductTypeId")]

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/GetProductListDto.cs

@ -5,7 +5,7 @@ namespace EasyAbp.EShop.Products.Products.Dtos
{
public class GetProductListDto : PagedAndSortedResultRequestDto
{
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
public Guid? CategoryId { get; set; }
}

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs

@ -6,7 +6,7 @@ namespace EasyAbp.EShop.Products.Products.Dtos
{
public class ProductDto : FullAuditedEntityDto<Guid>
{
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
public Guid ProductTypeId { get; set; }

8
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs

@ -43,10 +43,8 @@ namespace EasyAbp.EShop.Products.Products
query = query.Where(p => productIds.Contains(p.Id));
}
else if (input.StoreId.HasValue)
{
query = query.Where(p => p.StoreId == input.StoreId);
}
query = query.Where(p => p.StoreId == input.StoreId);
return query;
}
@ -141,7 +139,7 @@ namespace EasyAbp.EShop.Products.Products
return dto;
}
protected virtual async Task UpdateProductCategoriesAsync(Guid productId, Guid? storeId, IEnumerable<Guid> categoryIds)
protected virtual async Task UpdateProductCategoriesAsync(Guid productId, Guid storeId, IEnumerable<Guid> categoryIds)
{
await _productCategoryRepository.DeleteAsync(x => x.ProductId.Equals(productId));

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductCategories/IProductCategoryRepository.cs

@ -8,8 +8,8 @@ namespace EasyAbp.EShop.Products.ProductCategories
{
public interface IProductCategoryRepository : IRepository<ProductCategory, Guid>
{
Task<List<ProductCategory>> GetListByCategoryId(Guid categoryId, Guid? storeId, CancellationToken cancellationToken = default);
Task<List<ProductCategory>> GetListByCategoryId(Guid categoryId, Guid storeId, CancellationToken cancellationToken = default);
Task<List<ProductCategory>> GetListByProductId(Guid productId, Guid? storeId, CancellationToken cancellationToken = default);
Task<List<ProductCategory>> GetListByProductId(Guid productId, Guid storeId, CancellationToken cancellationToken = default);
}
}

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductCategories/ProductCategory.cs

@ -9,7 +9,7 @@ namespace EasyAbp.EShop.Products.ProductCategories
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid CategoryId { get; protected set; }
@ -24,7 +24,7 @@ namespace EasyAbp.EShop.Products.ProductCategories
public ProductCategory(
Guid id,
Guid? tenantId,
Guid? storeId,
Guid storeId,
Guid categoryId,
Guid productId,
int displayOrder = 0

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs

@ -11,7 +11,7 @@ namespace EasyAbp.EShop.Products.Products
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid ProductTypeId { get; protected set; }
@ -42,7 +42,7 @@ namespace EasyAbp.EShop.Products.Products
public Product(
Guid id,
Guid? tenantId,
Guid? storeId,
Guid storeId,
Guid productTypeId,
string displayName,
InventoryStrategy inventoryStrategy,

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductCategories/ProductCategoryRepository.cs

@ -16,14 +16,14 @@ namespace EasyAbp.EShop.Products.ProductCategories
{
}
public virtual async Task<List<ProductCategory>> GetListByCategoryId(Guid categoryId, Guid? storeId,
public virtual async Task<List<ProductCategory>> GetListByCategoryId(Guid categoryId, Guid storeId,
CancellationToken cancellationToken = default)
{
return await GetQueryable().Where(pc => pc.CategoryId == categoryId && pc.StoreId == storeId)
.ToListAsync(cancellationToken);
}
public virtual async Task<List<ProductCategory>> GetListByProductId(Guid productId, Guid? storeId,
public virtual async Task<List<ProductCategory>> GetListByProductId(Guid productId, Guid storeId,
CancellationToken cancellationToken = default)
{
return await GetQueryable().Where(pc => pc.ProductId == productId && pc.StoreId == storeId)

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs

@ -37,7 +37,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
_service = service;
}
public async Task OnGetAsync(Guid? storeId)
public async Task OnGetAsync(Guid storeId)
{
ProductTypes =
(await _productTypeAppService.GetListAsync(new PagedAndSortedResultRequestDto

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateUpdateProductViewModel.cs

@ -13,7 +13,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewM
{
[HiddenInput]
[Display(Name = "ProductStore")]
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
[Required]
[SelectItems("ProductTypes")]

2
modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/Stores/IMultiStore.cs

@ -4,6 +4,6 @@ namespace EasyAbp.EShop.Stores.Stores
{
public interface IMultiStore
{
Guid? StoreId { get; }
Guid StoreId { get; }
}
}
Loading…
Cancel
Save