Browse Source

update abp to 3.0.5.

add product tag plugin and store approval plugin.
add store owner and store owner permission check.
pull/81/head
RayMMond 6 years ago
parent
commit
467f317ec4
  1. 2
      common.props
  2. 4
      integration/EasyAbp.EShop/src/EasyAbp.EShop.Application.Contracts/EasyAbp.EShop.Application.Contracts.csproj
  3. 4
      integration/EasyAbp.EShop/src/EasyAbp.EShop.Application/EasyAbp.EShop.Application.csproj
  4. 2
      integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain.Shared/EasyAbp.EShop.Domain.Shared.csproj
  5. 2
      integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain/EasyAbp.EShop.Domain.csproj
  6. 2
      integration/EasyAbp.EShop/src/EasyAbp.EShop.EntityFrameworkCore/EasyAbp.EShop.EntityFrameworkCore.csproj
  7. 2
      integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi.Client/EasyAbp.EShop.HttpApi.Client.csproj
  8. 2
      integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi/EasyAbp.EShop.HttpApi.csproj
  9. 2
      integration/EasyAbp.EShop/src/EasyAbp.EShop.MongoDB/EasyAbp.EShop.MongoDB.csproj
  10. 4
      integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EasyAbp.EShop.Web.csproj
  11. 2
      integration/EasyAbp.EShop/test/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp.csproj
  12. 6
      integration/EasyAbp.EShop/test/EasyAbp.EShop.TestBase/EasyAbp.EShop.TestBase.csproj
  13. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp.EShop.Orders.Application.Contracts.csproj
  14. 5
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj
  15. 3
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicPurchasableCheckProvider.cs
  16. 3
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs
  17. 3
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs
  18. 3
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs
  19. 8
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs
  20. 33
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs
  21. 5
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/PurchasableChecker.cs
  22. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs
  23. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj
  24. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj
  25. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs
  26. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs
  27. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs
  28. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp.EShop.Orders.EntityFrameworkCore.csproj
  29. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi.Client/EasyAbp.EShop.Orders.HttpApi.Client.csproj
  30. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp.EShop.Orders.HttpApi.csproj
  31. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp.EShop.Orders.MongoDB.csproj
  32. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EasyAbp.EShop.Orders.Web.csproj
  33. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs
  34. 2
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj
  35. 6
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj
  36. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj
  37. 5
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj
  38. 40
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs
  39. 28
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs
  40. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj
  41. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj
  42. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj
  43. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj
  44. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj
  45. 2
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj
  46. 4
      modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj
  47. 2
      modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp.csproj
  48. 6
      modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.TestBase/EasyAbp.EShop.Payments.TestBase.csproj
  49. 4
      modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application.Contracts/EasyAbp.EShop.Plugins.Application.Contracts.csproj
  50. 4
      modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application/EasyAbp.EShop.Plugins.Application.csproj
  51. 2
      modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain.Shared/EasyAbp.EShop.Plugins.Domain.Shared.csproj
  52. 2
      modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain/EasyAbp.EShop.Plugins.Domain.csproj
  53. 2
      modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.EntityFrameworkCore/EasyAbp.EShop.Plugins.EntityFrameworkCore.csproj
  54. 2
      modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi.Client/EasyAbp.EShop.Plugins.HttpApi.Client.csproj
  55. 2
      modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi/EasyAbp.EShop.Plugins.HttpApi.csproj
  56. 2
      modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.MongoDB/EasyAbp.EShop.Plugins.MongoDB.csproj
  57. 4
      modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/EasyAbp.EShop.Plugins.Web.csproj
  58. 2
      modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp.csproj
  59. 6
      modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.TestBase/EasyAbp.EShop.Plugins.TestBase.csproj
  60. 6
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp.EShop.Products.Application.Contracts.csproj
  61. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissionDefinitionProvider.cs
  62. 1
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissions.cs
  63. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/GetProductListDto.cs
  64. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs
  65. 0
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs
  66. 0
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs
  67. 0
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs
  68. 0
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs
  69. 0
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/StoreIsNotProductOwnerException.cs
  70. 7
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp.EShop.Products.Application.csproj
  71. 5
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs
  72. 5
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductCategories/ProductCategoryAppService.cs
  73. 13
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs
  74. 107
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs
  75. 18
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs
  76. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp.EShop.Products.Domain.Shared.csproj
  77. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json
  78. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSku.cs
  79. 6
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp.EShop.Products.Domain.csproj
  80. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductStores/IProductStoreRepository.cs
  81. 11
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/IProductRepository.cs
  82. 3
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs
  83. 23
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs
  84. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp.EShop.Products.EntityFrameworkCore.csproj
  85. 11
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductStores/ProductStoreRepository.cs
  86. 36
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/Products/ProductRepository.cs
  87. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi.Client/EasyAbp.EShop.Products.HttpApi.Client.csproj
  88. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp.EShop.Products.HttpApi.csproj
  89. 7
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs
  90. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.MongoDB/EasyAbp.EShop.Products.MongoDB.csproj
  91. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/EasyAbp.EShop.Products.Web.csproj
  92. 15
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs
  93. 2
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs
  94. 37
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs
  95. 14
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs
  96. 1
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml
  97. 44
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs
  98. 6
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs
  99. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js
  100. 7
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsWebAutoMapperProfile.cs

2
common.props

@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="ConfigureAwait.Fody" Version="3.3.1" PrivateAssets="All" />
<PackageReference Include="Fody" Version="6.2.0">
<PackageReference Include="Fody" Version="6.2.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

4
integration/EasyAbp.EShop/src/EasyAbp.EShop.Application.Contracts/EasyAbp.EShop.Application.Contracts.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.5" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Application.Contracts\EasyAbp.EShop.Orders.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Application.Contracts\EasyAbp.EShop.Payments.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Plugins\src\EasyAbp.EShop.Plugins.Application.Contracts\EasyAbp.EShop.Plugins.Application.Contracts.csproj" />

4
integration/EasyAbp.EShop/src/EasyAbp.EShop.Application/EasyAbp.EShop.Application.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.0.5" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Application\EasyAbp.EShop.Orders.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Application\EasyAbp.EShop.Payments.Application.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Plugins\src\EasyAbp.EShop.Plugins.Application\EasyAbp.EShop.Plugins.Application.csproj" />

2
integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain.Shared/EasyAbp.EShop.Domain.Shared.csproj

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Validation" Version="3.0.5" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Domain.Shared\EasyAbp.EShop.Orders.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Plugins\src\EasyAbp.EShop.Plugins.Domain.Shared\EasyAbp.EShop.Plugins.Domain.Shared.csproj" />

2
integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain/EasyAbp.EShop.Domain.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.5" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Domain\EasyAbp.EShop.Orders.Domain.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Plugins\src\EasyAbp.EShop.Plugins.Domain\EasyAbp.EShop.Plugins.Domain.csproj" />

2
integration/EasyAbp.EShop/src/EasyAbp.EShop.EntityFrameworkCore/EasyAbp.EShop.EntityFrameworkCore.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="3.0.4" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="3.0.5" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.EntityFrameworkCore\EasyAbp.EShop.Orders.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.EntityFrameworkCore\EasyAbp.EShop.Payments.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Plugins\src\EasyAbp.EShop.Plugins.EntityFrameworkCore\EasyAbp.EShop.Plugins.EntityFrameworkCore.csproj" />

2
integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi.Client/EasyAbp.EShop.HttpApi.Client.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Http.Client" Version="3.0.5" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.HttpApi.Client\EasyAbp.EShop.Orders.HttpApi.Client.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.HttpApi.Client\EasyAbp.EShop.Payments.HttpApi.Client.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Plugins\src\EasyAbp.EShop.Plugins.HttpApi.Client\EasyAbp.EShop.Plugins.HttpApi.Client.csproj" />

2
integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi/EasyAbp.EShop.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.0.5" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.HttpApi\EasyAbp.EShop.Orders.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.HttpApi\EasyAbp.EShop.Payments.HttpApi.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Plugins\src\EasyAbp.EShop.Plugins.HttpApi\EasyAbp.EShop.Plugins.HttpApi.csproj" />

2
integration/EasyAbp.EShop/src/EasyAbp.EShop.MongoDB/EasyAbp.EShop.MongoDB.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.MongoDB" Version="3.0.4" />
<PackageReference Include="Volo.Abp.MongoDB" Version="3.0.5" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.MongoDB\EasyAbp.EShop.Orders.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.MongoDB\EasyAbp.EShop.Payments.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Plugins\src\EasyAbp.EShop.Plugins.MongoDB\EasyAbp.EShop.Plugins.MongoDB.csproj" />

4
integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EasyAbp.EShop.Web.csproj

@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="3.0.5" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Web\EasyAbp.EShop.Orders.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Web\EasyAbp.EShop.Payments.Web.csproj" />
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Plugins\src\EasyAbp.EShop.Plugins.Web\EasyAbp.EShop.Plugins.Web.csproj" />

2
integration/EasyAbp.EShop/test/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp.csproj

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="3.0.5" />
<ProjectReference Include="..\..\src\EasyAbp.EShop.HttpApi.Client\EasyAbp.EShop.HttpApi.Client.csproj" />
</ItemGroup>

6
integration/EasyAbp.EShop/test/EasyAbp.EShop.TestBase/EasyAbp.EShop.TestBase.csproj

@ -14,9 +14,9 @@
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Volo.Abp.Autofac" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.4" />
<PackageReference Include="Volo.Abp.TestBase" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Autofac" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.5" />
<PackageReference Include="Volo.Abp.TestBase" Version="3.0.5" />
<ProjectReference Include="..\..\src\EasyAbp.EShop.Domain\EasyAbp.EShop.Domain.csproj" />
</ItemGroup>

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp.EShop.Orders.Application.Contracts.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Domain.Shared\EasyAbp.EShop.Orders.Domain.Shared.csproj" />
</ItemGroup>

5
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj

@ -8,9 +8,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.0.5" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Products\src\EasyAbp.EShop.Products.Application.Contracts\EasyAbp.EShop.Products.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Application.Contracts\EasyAbp.EShop.Stores.Application.Contracts.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Application.Contracts\EasyAbp.EShop.Orders.Application.Contracts.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Domain\EasyAbp.EShop.Orders.Domain.csproj" />
</ItemGroup>

3
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicPurchasableCheckProvider.cs

@ -11,8 +11,7 @@ namespace EasyAbp.EShop.Orders.Orders
{
public class BasicPurchasableCheckProvider : IPurchasableCheckProvider, ITransientDependency
{
public virtual async Task CheckAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict,
Dictionary<string, object> orderExtraProperties)
public virtual async Task CheckAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict)
{
await CheckProductsPublishedAsync(input, productDict);

3
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs

@ -8,7 +8,6 @@ namespace EasyAbp.EShop.Orders.Orders
{
public interface INewOrderGenerator
{
Task<Order> GenerateAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict,
Dictionary<string, object> orderExtraProperties);
Task<Order> GenerateAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict);
}
}

3
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs

@ -8,7 +8,6 @@ namespace EasyAbp.EShop.Orders.Orders
{
public interface IPurchasableCheckProvider
{
Task CheckAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict,
Dictionary<string, object> orderExtraProperties);
Task CheckAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict);
}
}

3
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs

@ -8,7 +8,6 @@ namespace EasyAbp.EShop.Orders.Orders
{
public interface IPurchasableChecker
{
Task CheckAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict,
Dictionary<string, object> orderExtraProperties);
Task CheckAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict);
}
}

8
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs

@ -12,6 +12,7 @@ using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.Json;
using Volo.Abp.MultiTenancy;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Users;
namespace EasyAbp.EShop.Orders.Orders
@ -38,7 +39,7 @@ namespace EasyAbp.EShop.Orders.Orders
_productSkuDescriptionProvider = productSkuDescriptionProvider;
}
public virtual async Task<Order> GenerateAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict, Dictionary<string, object> orderExtraProperties)
public virtual async Task<Order> GenerateAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict)
{
var orderLines = new List<OrderLine>();
@ -61,10 +62,7 @@ namespace EasyAbp.EShop.Orders.Orders
refundedAmount: 0,
customerRemark: input.CustomerRemark);
foreach (var orderExtraProperty in orderExtraProperties)
{
order.SetProperty(orderExtraProperty.Key, orderExtraProperty.Value);
}
input.MapExtraPropertiesTo(order, MappingPropertyDefinitionChecks.Both);
order.SetOrderLines(orderLines);

33
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs

@ -6,6 +6,7 @@ using EasyAbp.EShop.Orders.Authorization;
using EasyAbp.EShop.Orders.Orders.Dtos;
using EasyAbp.EShop.Products.Products;
using EasyAbp.EShop.Products.Products.Dtos;
using EasyAbp.EShop.Stores.Permissions;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
@ -67,7 +68,8 @@ namespace EasyAbp.EShop.Orders.Orders
if (input.StoreId.HasValue)
{
// Todo: Check if current user is an admin of the store.
await AuthorizationService.IsStoreOwnerGrantedAsync(input.StoreId.Value,
OrdersPermissions.Orders.Manage);
}
else
{
@ -86,11 +88,10 @@ namespace EasyAbp.EShop.Orders.Orders
if (order.CustomerUserId != CurrentUser.GetId())
{
await AuthorizationService.CheckAsync(OrdersPermissions.Orders.Manage);
// Todo: Check if current user is an admin of the store.
await AuthorizationService.CheckStoreOwnerAsync(order.StoreId,
OrdersPermissions.Orders.Manage);
}
return MapToGetOutputDto(order);
}
@ -103,13 +104,11 @@ namespace EasyAbp.EShop.Orders.Orders
var productDict = await GetProductDictionaryAsync(input.OrderLines.Select(dto => dto.ProductId).ToList(),
input.StoreId);
var orderExtraProperties = new Dictionary<string, object>();
await _purchasableChecker.CheckAsync(input, productDict);
await _purchasableChecker.CheckAsync(input, productDict, orderExtraProperties);
var order = await _newOrderGenerator.GenerateAsync(input, productDict, orderExtraProperties);
var order = await _newOrderGenerator.GenerateAsync(input, productDict);
await _orderManager.DiscountAsync(order, input.ExtraProperties);
await _orderManager.DiscountAsync(order);
await Repository.InsertAsync(order, autoSave: true);
@ -134,7 +133,7 @@ namespace EasyAbp.EShop.Orders.Orders
{
throw new NotSupportedException();
}
[RemoteService(false)]
public override Task DeleteAsync(Guid id)
{
@ -149,11 +148,9 @@ namespace EasyAbp.EShop.Orders.Orders
if (order.CustomerUserId != CurrentUser.GetId())
{
await AuthorizationService.CheckAsync(OrdersPermissions.Orders.Manage);
// Todo: Check if current user is an admin of the store.
await AuthorizationService.CheckStoreOwnerAsync(order.StoreId, OrdersPermissions.Orders.Manage);
}
return MapToGetOutputDto(order);
}
@ -161,12 +158,10 @@ namespace EasyAbp.EShop.Orders.Orders
public virtual async Task<OrderDto> CompleteAsync(CompleteOrderInput input)
{
var order = await GetEntityByIdAsync(input.OrderId);
if (order.CustomerUserId != CurrentUser.GetId())
{
await AuthorizationService.CheckAsync(OrdersPermissions.Orders.Manage);
// Todo: Check if current user is an admin of the store.
await AuthorizationService.CheckStoreOwnerAsync(order.StoreId, OrdersPermissions.Orders.Manage);
}
order = await _orderManager.CompleteAsync(order);

5
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/PurchasableChecker.cs

@ -17,14 +17,13 @@ namespace EasyAbp.EShop.Orders.Orders
_serviceProvider = serviceProvider;
}
public virtual async Task CheckAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict,
Dictionary<string, object> orderExtraProperties)
public virtual async Task CheckAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict)
{
var providers = _serviceProvider.GetServices<IPurchasableCheckProvider>();
foreach (var provider in providers)
{
await provider.CheckAsync(input, productDict, orderExtraProperties);
await provider.CheckAsync(input, productDict);
}
}
}

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs

@ -1,6 +1,7 @@
using EasyAbp.EShop.Orders.Orders;
using EasyAbp.EShop.Orders.Orders.Dtos;
using AutoMapper;
using Volo.Abp.ObjectExtending;
namespace EasyAbp.EShop.Orders
{
@ -11,7 +12,8 @@ namespace EasyAbp.EShop.Orders
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<Order, OrderDto>();
CreateMap<Order, OrderDto>()
.MapExtraProperties(MappingPropertyDefinitionChecks.Both);
CreateMap<OrderLine, OrderLineDto>();
}
}

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Validation" Version="3.0.5" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Domain.Shared\EasyAbp.EShop.Stores.Domain.Shared.csproj" />
</ItemGroup>

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj

@ -9,8 +9,8 @@
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.6.2" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.5" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Products\src\EasyAbp.EShop.Products.Domain.Shared\EasyAbp.EShop.Products.Domain.Shared.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Domain.Shared\EasyAbp.EShop.Orders.Domain.Shared.csproj" />

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

@ -5,6 +5,6 @@ namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderDiscountProvider
{
Task<Order> DiscountAsync(Order order, Dictionary<string, object> inputExtraProperties);
Task<Order> DiscountAsync(Order order);
}
}

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

@ -6,7 +6,7 @@ namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderManager : IDomainService
{
Task<Order> DiscountAsync(Order order, Dictionary<string, object> inputExtraProperties);
Task<Order> DiscountAsync(Order order);
Task<Order> CompleteAsync(Order order);
}

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs

@ -19,11 +19,11 @@ namespace EasyAbp.EShop.Orders.Orders
_orderRepository = orderRepository;
}
public virtual async Task<Order> DiscountAsync(Order order, Dictionary<string, object> inputExtraProperties)
public virtual async Task<Order> DiscountAsync(Order order)
{
foreach (var provider in ServiceProvider.GetServices<IOrderDiscountProvider>())
{
await provider.DiscountAsync(order, inputExtraProperties);
await provider.DiscountAsync(order);
}
return order;

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp.EShop.Orders.EntityFrameworkCore.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="3.0.4" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Domain\EasyAbp.EShop.Orders.Domain.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi.Client/EasyAbp.EShop.Orders.HttpApi.Client.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Http.Client" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Application.Contracts\EasyAbp.EShop.Orders.Application.Contracts.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp.EShop.Orders.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Application.Contracts\EasyAbp.EShop.Orders.Application.Contracts.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp.EShop.Orders.MongoDB.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.MongoDB" Version="3.0.4" />
<PackageReference Include="Volo.Abp.MongoDB" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Domain\EasyAbp.EShop.Orders.Domain.csproj" />
</ItemGroup>

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EasyAbp.EShop.Orders.Web.csproj

@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="3.0.5" />
</ItemGroup>
<ItemGroup>

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs

@ -1,5 +1,6 @@
using EasyAbp.EShop.Orders.Orders.Dtos;
using AutoMapper;
using Volo.Abp.ObjectExtending;
namespace EasyAbp.EShop.Orders.Web
{
@ -10,7 +11,8 @@ namespace EasyAbp.EShop.Orders.Web
/* You can configure your AutoMapper mapping configuration here.
* Alternatively, you can split your mapping configurations
* into multiple profile classes for a better organization. */
CreateMap<OrderDto, CreateOrderDto>();
CreateMap<OrderDto, CreateOrderDto>()
.MapExtraProperties(MappingPropertyDefinitionChecks.Both);
CreateMap<OrderLineDto, CreateOrderLineDto>();
}
}

2
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="3.0.5" />
<ProjectReference Include="..\..\src\EasyAbp.EShop.Orders.HttpApi.Client\EasyAbp.EShop.Orders.HttpApi.Client.csproj" />
</ItemGroup>

6
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj

@ -14,9 +14,9 @@
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Volo.Abp.Autofac" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.4" />
<PackageReference Include="Volo.Abp.TestBase" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Autofac" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.5" />
<PackageReference Include="Volo.Abp.TestBase" Version="3.0.5" />
<ProjectReference Include="..\..\src\EasyAbp.EShop.Orders.Domain\EasyAbp.EShop.Orders.Domain.csproj" />
</ItemGroup>

4
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />
</ItemGroup>

5
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj

@ -8,9 +8,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.0.5" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Application.Contracts\EasyAbp.EShop.Orders.Application.Contracts.csproj" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Application.Contracts\EasyAbp.EShop.Stores.Application.Contracts.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Application.Contracts\EasyAbp.EShop.Payments.Application.Contracts.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>

40
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs

@ -1,15 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Orders.Orders;
using EasyAbp.EShop.Orders.Orders.Dtos;
using EasyAbp.EShop.Payments.Authorization;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Payments.Dtos;
using EasyAbp.EShop.Stores.Permissions;
using EasyAbp.PaymentService.Payments;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.EventBus.Distributed;
@ -27,8 +26,7 @@ namespace EasyAbp.EShop.Payments.Payments
private readonly IPayableChecker _payableChecker;
private readonly IDistributedEventBus _distributedEventBus;
private readonly IOrderAppService _orderAppService;
private readonly IPaymentRepository _repository;
public PaymentAppService(
IPayableChecker payableChecker,
IDistributedEventBus distributedEventBus,
@ -38,7 +36,6 @@ namespace EasyAbp.EShop.Payments.Payments
_payableChecker = payableChecker;
_distributedEventBus = distributedEventBus;
_orderAppService = orderAppService;
_repository = repository;
}
public override async Task<PaymentDto> GetAsync(Guid id)
@ -47,14 +44,20 @@ namespace EasyAbp.EShop.Payments.Payments
if (payment.UserId != CurrentUser.GetId())
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage);
// Todo: Check if current user is an admin of the store.
if (payment.StoreId.HasValue)
{
await AuthorizationService.CheckStoreOwnerAsync(payment.StoreId.Value,
PaymentsPermissions.Payments.Manage);
}
else
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage);
}
}
return payment;
}
protected override IQueryable<Payment> CreateFilteredQuery(GetPaymentListDto input)
{
var query = base.CreateFilteredQuery(input);
@ -75,7 +78,8 @@ namespace EasyAbp.EShop.Payments.Payments
if (input.StoreId.HasValue)
{
// Todo: Check if current user is an admin of the store.
await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value,
PaymentsPermissions.Payments.Manage);
}
else
{
@ -85,23 +89,23 @@ namespace EasyAbp.EShop.Payments.Payments
return await base.GetListAsync(input);
}
[Authorize(PaymentsPermissions.Payments.Create)]
public virtual async Task CreateAsync(CreatePaymentDto input)
{
var orders = new List<OrderDto>();
foreach (var orderId in input.OrderIds)
{
orders.Add(await _orderAppService.GetAsync(orderId));
}
var extraProperties = new Dictionary<string, object> {{"StoreId", orders.First().StoreId}};
var extraProperties = new Dictionary<string, object> { { "StoreId", orders.First().StoreId } };
await _payableChecker.CheckAsync(input, orders, extraProperties);
// Todo: should avoid duplicate creations.
await _distributedEventBus.PublishAsync(new CreatePaymentEto
{
TenantId = CurrentTenant.Id,

28
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs

@ -1,11 +1,11 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Payments.Authorization;
using EasyAbp.EShop.Payments.Payments;
using EasyAbp.EShop.Payments.Refunds.Dtos;
using EasyAbp.EShop.Stores.Permissions;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp;
using System;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Users;
@ -21,7 +21,7 @@ namespace EasyAbp.EShop.Payments.Refunds
private readonly IPaymentRepository _paymentRepository;
private readonly IRefundRepository _repository;
public RefundAppService(
IPaymentRepository paymentRepository,
IRefundRepository repository) : base(repository)
@ -35,17 +35,22 @@ namespace EasyAbp.EShop.Payments.Refunds
var refund = await base.GetAsync(id);
var payment = await _paymentRepository.GetAsync(refund.PaymentId);
if (payment.UserId != CurrentUser.GetId())
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage);
// Todo: Check if current user is an admin of the store.
if (payment.StoreId.HasValue)
{
await AuthorizationService.CheckStoreOwnerAsync(payment.StoreId.Value, PaymentsPermissions.Refunds.Manage);
}
else
{
await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage);
}
}
return refund;
}
protected override IQueryable<Refund> CreateFilteredQuery(GetRefundListDto input)
{
var query = input.UserId.HasValue ? _repository.GetQueryableByUserId(input.UserId.Value) : _repository;
@ -66,7 +71,8 @@ namespace EasyAbp.EShop.Payments.Refunds
if (input.StoreId.HasValue)
{
// Todo: Check if current user is an admin of the store.
await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value,
PaymentsPermissions.Refunds.Manage);
}
else
{

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Validation" Version="3.0.5" />
</ItemGroup>
<ItemGroup>

4
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj

@ -9,8 +9,8 @@
<ItemGroup>
<PackageReference Include="EasyAbp.PaymentService.Domain.Shared" Version="0.6.2" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.5" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Domain.Shared\EasyAbp.EShop.Stores.Domain.Shared.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain.Shared\EasyAbp.EShop.Payments.Domain.Shared.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="3.0.4" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Http.Client" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Application.Contracts\EasyAbp.EShop.Payments.Application.Contracts.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Application.Contracts\EasyAbp.EShop.Payments.Application.Contracts.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.MongoDB" Version="3.0.4" />
<PackageReference Include="Volo.Abp.MongoDB" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>

4
modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj

@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="3.0.5" />
</ItemGroup>
<ItemGroup>

2
modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp.csproj

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="3.0.5" />
<ProjectReference Include="..\..\src\EasyAbp.EShop.Payments.HttpApi.Client\EasyAbp.EShop.Payments.HttpApi.Client.csproj" />
</ItemGroup>

6
modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.TestBase/EasyAbp.EShop.Payments.TestBase.csproj

@ -14,9 +14,9 @@
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Volo.Abp.Autofac" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.4" />
<PackageReference Include="Volo.Abp.TestBase" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Autofac" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.5" />
<PackageReference Include="Volo.Abp.TestBase" Version="3.0.5" />
<ProjectReference Include="..\..\src\EasyAbp.EShop.Payments.Domain\EasyAbp.EShop.Payments.Domain.csproj" />
</ItemGroup>

4
modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application.Contracts/EasyAbp.EShop.Plugins.Application.Contracts.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Domain.Shared\EasyAbp.EShop.Plugins.Domain.Shared.csproj" />
</ItemGroup>

4
modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application/EasyAbp.EShop.Plugins.Application.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Application.Contracts\EasyAbp.EShop.Plugins.Application.Contracts.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Domain\EasyAbp.EShop.Plugins.Domain.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain.Shared/EasyAbp.EShop.Plugins.Domain.Shared.csproj

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Validation" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Validation" Version="3.0.5" />
</ItemGroup>
<ItemGroup>

2
modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain/EasyAbp.EShop.Plugins.Domain.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Domain.Shared\EasyAbp.EShop.Plugins.Domain.Shared.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.EntityFrameworkCore/EasyAbp.EShop.Plugins.EntityFrameworkCore.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="3.0.4" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Domain\EasyAbp.EShop.Plugins.Domain.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi.Client/EasyAbp.EShop.Plugins.HttpApi.Client.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Http.Client" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Application.Contracts\EasyAbp.EShop.Plugins.Application.Contracts.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi/EasyAbp.EShop.Plugins.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Application.Contracts\EasyAbp.EShop.Plugins.Application.Contracts.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.MongoDB/EasyAbp.EShop.Plugins.MongoDB.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.MongoDB" Version="3.0.4" />
<PackageReference Include="Volo.Abp.MongoDB" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Domain\EasyAbp.EShop.Plugins.Domain.csproj" />
</ItemGroup>

4
modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/EasyAbp.EShop.Plugins.Web.csproj

@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="3.0.5" />
</ItemGroup>
<ItemGroup>

2
modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp.csproj

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="3.0.5" />
<ProjectReference Include="..\..\src\EasyAbp.EShop.Plugins.HttpApi.Client\EasyAbp.EShop.Plugins.HttpApi.Client.csproj" />
</ItemGroup>

6
modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.TestBase/EasyAbp.EShop.Plugins.TestBase.csproj

@ -14,9 +14,9 @@
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Volo.Abp.Autofac" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.4" />
<PackageReference Include="Volo.Abp.TestBase" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Autofac" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.5" />
<PackageReference Include="Volo.Abp.TestBase" Version="3.0.5" />
<ProjectReference Include="..\..\src\EasyAbp.EShop.Plugins.Domain\EasyAbp.EShop.Plugins.Domain.csproj" />
</ItemGroup>

6
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp.EShop.Products.Application.Contracts.csproj

@ -8,9 +8,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.Abp.Trees.Application.Contracts" Version="0.290.4" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.4" />
<PackageReference Include="EasyAbp.Abp.Trees.Application.Contracts" Version="1.0.0" />
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Authorization" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Products.Domain.Shared\EasyAbp.EShop.Products.Domain.Shared.csproj" />
</ItemGroup>

3
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissionDefinitionProvider.cs

@ -18,7 +18,8 @@ namespace EasyAbp.EShop.Products.Permissions
categories.AddChild(ProductsPermissions.Categories.Create, L("Permission:Create"));
categories.AddChild(ProductsPermissions.Categories.Update, L("Permission:Update"));
categories.AddChild(ProductsPermissions.Categories.Delete, L("Permission:Delete"));
categories.AddChild(ProductsPermissions.Categories.ShowHidden, L("Permission:ShowHidden"));
var product = moduleGroup.AddPermission(ProductsPermissions.Products.Default, L("Permission:Product"));
product.AddChild(ProductsPermissions.Products.CrossStore, L("Permission:CrossStore"));
product.AddChild(ProductsPermissions.Products.Create, L("Permission:Create"));

1
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissions.cs

@ -18,6 +18,7 @@ namespace EasyAbp.EShop.Products.Permissions
public const string Delete = Default + ".Delete";
public const string Update = Default + ".Update";
public const string Create = Default + ".Create";
public const string ShowHidden = Default + ".ShowHidden";
}
public class Products

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

@ -1,10 +1,12 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Products.Products.Dtos
{
public class GetProductListDto : PagedAndSortedResultRequestDto
{
[Required]
public Guid StoreId { get; set; }
public Guid? CategoryId { get; set; }

3
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs

@ -1,7 +1,6 @@
using EasyAbp.EShop.Products.Products.Dtos;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyAbp.EShop.Products.Products.Dtos;
using Volo.Abp.Application.Services;
namespace EasyAbp.EShop.Products.Products

0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs

0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs

0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs

0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs

0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/StoreIsNotProductOwnerException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/StoreIsNotProductOwnerException.cs

7
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp.EShop.Products.Application.csproj

@ -8,9 +8,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.Abp.Trees.Application" Version="0.290.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.0.4" />
<PackageReference Include="EasyAbp.Abp.Trees.Application" Version="1.0.0" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.0.5" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Application.Contracts\EasyAbp.EShop.Stores.Application.Contracts.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Products.Application.Contracts\EasyAbp.EShop.Products.Application.Contracts.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Products.Domain\EasyAbp.EShop.Products.Domain.csproj" />
</ItemGroup>

5
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs

@ -34,10 +34,7 @@ namespace EasyAbp.EShop.Products.Categories
public override async Task<PagedResultDto<CategoryDto>> GetListAsync(GetCategoryListDto input)
{
// Todo: Check if current user is an admin of the store.
var isCurrentUserStoreAdmin = true && await AuthorizationService.IsGrantedAsync(ProductsPermissions.Categories.Default);
if (input.ShowHidden && !isCurrentUserStoreAdmin)
if (input.ShowHidden && !await AuthorizationService.IsGrantedAsync(ProductsPermissions.Categories.ShowHidden))
{
throw new NotAllowedToGetCategoryListWithShowHiddenException();
}

5
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductCategories/ProductCategoryAppService.cs

@ -1,10 +1,9 @@
using EasyAbp.EShop.Products.Permissions;
using EasyAbp.EShop.Products.ProductCategories.Dtos;
using System;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Products.Permissions;
using EasyAbp.EShop.Products.ProductCategories.Dtos;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace EasyAbp.EShop.Products.ProductCategories

13
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs

@ -1,10 +1,11 @@
using System;
using System.Threading.Tasks;
using EasyAbp.EShop.Products.Permissions;
using EasyAbp.EShop.Products.ProductInventories.Dtos;
using EasyAbp.EShop.Products.Products;
using EasyAbp.EShop.Products.ProductStores;
using EasyAbp.EShop.Stores.Permissions;
using Microsoft.AspNetCore.Authorization;
using System;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Validation;
@ -50,9 +51,9 @@ namespace EasyAbp.EShop.Products.ProductInventories
{
throw new AbpValidationException("StoreId should not be null.");
}
// Todo: Check if current user is an admin of the store.
await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value, ProductsPermissions.ProductInventory.Update);
await _productStoreRepository.GetAsync(input.ProductId, input.StoreId.Value);
}
@ -65,7 +66,7 @@ namespace EasyAbp.EShop.Products.ProductInventories
await _repository.InsertAsync(productInventory, true);
}
await ChangeInventoryAsync(productInventory, input.ChangedInventory);
return ObjectMapper.Map<ProductInventory, ProductInventoryDto>(productInventory);

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

@ -1,12 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Products.Permissions;
using EasyAbp.EShop.Products.Products.Dtos;
using EasyAbp.EShop.Products.ProductStores;
using EasyAbp.EShop.Products.ProductTypes;
using Microsoft.AspNetCore.Authorization;
using EasyAbp.EShop.Stores.Permissions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
@ -48,9 +48,7 @@ namespace EasyAbp.EShop.Products.Products
protected override IQueryable<Product> CreateFilteredQuery(GetProductListDto input)
{
var query = input.CategoryId.HasValue
? _repository.WithDetails(input.StoreId, input.CategoryId.Value)
: _repository.WithDetails(input.StoreId);
var query = _repository.WithDetails(input.StoreId, input.CategoryId);
return input.ShowHidden ? query : query.Where(x => !x.IsHidden);
}
@ -65,30 +63,30 @@ namespace EasyAbp.EShop.Products.Products
public override async Task<ProductDto> CreateAsync(CreateUpdateProductDto input)
{
await CheckCreatePolicyAsync();
var product = MapToEntity(input);
TryToSetTenantId(product);
await UpdateProductAttributesAsync(product, input);
await _productManager.CreateAsync(product, input.StoreId, input.CategoryIds);
return MapToGetOutputDto(product);
}
public override async Task<ProductDto> UpdateAsync(Guid id, CreateUpdateProductDto input)
{
await CheckUpdatePolicyAsync();
await CheckStoreIsProductOwnerAsync(id, input.StoreId);
var product = await GetEntityByIdAsync(id);
CheckProductIsNotStatic(product);
MapToEntity(input, product);
await UpdateProductAttributesAsync(product, input);
await _productManager.UpdateAsync(product, input.CategoryIds);
@ -111,7 +109,7 @@ namespace EasyAbp.EShop.Products.Products
var isProductSkusEmpty = product.ProductSkus.IsNullOrEmpty();
var usedAttributeOptionIds = new HashSet<Guid>();
foreach (var serializedAttributeOptionIds in product.ProductSkus.Select(sku => sku.SerializedAttributeOptionIds))
{
foreach (var attributeOptionId in await _attributeOptionIdsSerializer.DeserializeAsync(serializedAttributeOptionIds))
@ -119,21 +117,21 @@ namespace EasyAbp.EShop.Products.Products
usedAttributeOptionIds.Add(attributeOptionId);
}
}
foreach (var attributeDto in input.ProductAttributes)
{
var attribute = product.ProductAttributes.FirstOrDefault(a => a.DisplayName == attributeDto.DisplayName);
if (attribute == null)
{
if (!isProductSkusEmpty)
{
throw new ProductAttributesModificationFailedException();
}
attribute = new ProductAttribute(GuidGenerator.Create(),
attributeDto.DisplayName, attributeDto.Description);
product.ProductAttributes.Add(attribute);
}
@ -145,7 +143,7 @@ namespace EasyAbp.EShop.Products.Products
{
option = new ProductAttributeOption(GuidGenerator.Create(),
optionDto.DisplayName, optionDto.Description);
attribute.ProductAttributeOptions.Add(option);
}
}
@ -171,7 +169,7 @@ namespace EasyAbp.EShop.Products.Products
{
throw new ProductAttributesModificationFailedException();
}
product.ProductAttributes.RemoveAll(a => removedAttributeNames.Contains(a.DisplayName));
}
@ -188,24 +186,24 @@ namespace EasyAbp.EShop.Products.Products
{
throw new NotSupportedException();
}
public virtual async Task<ProductDto> GetAsync(Guid id, Guid storeId)
{
await CheckGetPolicyAsync();
var product = await GetEntityByIdAsync(id);
if (!product.IsPublished)
{
await CheckStoreIsProductOwnerAsync(product.Id, storeId);
}
var dto = MapToGetOutputDto(product);
await LoadDtoInventoryDataAsync(product, dto, storeId);
await LoadDtoPriceAsync(product, dto, storeId);
await LoadDtosProductTypeUniqueNameAsync(new[] {dto});
await LoadDtosProductTypeUniqueNameAsync(new[] { dto });
return dto;
}
@ -225,16 +223,16 @@ namespace EasyAbp.EShop.Products.Products
await CheckGetPolicyAsync();
var product = await _repository.GetAsync(x => x.UniqueName == code);
if (!product.IsPublished)
{
await CheckStoreIsProductOwnerAsync(product.Id, storeId);
}
var dto = MapToGetOutputDto(product);
await LoadDtoInventoryDataAsync(product, dto, storeId);
return dto;
}
@ -242,9 +240,8 @@ namespace EasyAbp.EShop.Products.Products
{
await CheckGetListPolicyAsync();
// Todo: Check if current user is an admin of the store.
var isCurrentUserStoreAdmin = true && await AuthorizationService.IsGrantedAsync(ProductsPermissions.Products.Default);
var isCurrentUserStoreAdmin = await AuthorizationService.IsStoreOwnerGrantedAsync(input.StoreId, ProductsPermissions.Products.Default);
if (input.ShowHidden && !isCurrentUserStoreAdmin)
{
throw new NotAllowedToGetProductListWithShowHiddenException();
@ -252,7 +249,7 @@ namespace EasyAbp.EShop.Products.Products
// Todo: Products cache.
var query = CreateFilteredQuery(input);
if (!isCurrentUserStoreAdmin)
{
query = query.Where(x => x.IsPublished);
@ -266,32 +263,32 @@ namespace EasyAbp.EShop.Products.Products
var products = await AsyncExecuter.ToListAsync(query);
var items = new List<ProductDto>();
foreach (var product in products)
{
var productDto = MapToGetListOutputDto(product);
await LoadDtoInventoryDataAsync(product, productDto, input.StoreId);
await LoadDtoPriceAsync(product, productDto, input.StoreId);
items.Add(productDto);
}
await LoadDtosProductTypeUniqueNameAsync(items);
return new PagedResultDto<ProductDto>(totalCount, items);
}
protected virtual async Task<ProductDto> LoadDtoInventoryDataAsync(Product product, ProductDto productDto, Guid storeId)
{
var inventoryDataDict = await _productInventoryProvider.GetInventoryDataDictionaryAsync(product, storeId);
productDto.Sold = 0;
foreach (var productSkuDto in productDto.ProductSkus)
{
var inventoryData = inventoryDataDict[productSkuDto.Id];
productSkuDto.Inventory = inventoryData.Inventory;
productSkuDto.Sold = inventoryData.Sold;
productDto.Sold += productSkuDto.Sold;
@ -322,7 +319,7 @@ namespace EasyAbp.EShop.Products.Products
await CheckDeletePolicyAsync();
var product = await GetEntityByIdAsync(id);
CheckProductIsNotStatic(product);
await CheckStoreIsProductOwnerAsync(id, storeId);
@ -341,28 +338,28 @@ namespace EasyAbp.EShop.Products.Products
public async Task<ProductDto> CreateSkuAsync(Guid productId, Guid storeId, CreateProductSkuDto input)
{
await CheckUpdatePolicyAsync();
await CheckStoreIsProductOwnerAsync(productId, storeId);
var product = await GetEntityByIdAsync(productId);
CheckProductIsNotStatic(product);
var sku = ObjectMapper.Map<CreateProductSkuDto, ProductSku>(input);
EntityHelper.TrySetId(sku, GuidGenerator.Create);
await _productManager.CreateSkuAsync(product, sku);
return ObjectMapper.Map<Product, ProductDto>(product);
}
public async Task<ProductDto> UpdateSkuAsync(Guid productId, Guid productSkuId, Guid storeId, UpdateProductSkuDto input)
{
await CheckUpdatePolicyAsync();
await CheckStoreIsProductOwnerAsync(productId, storeId);
var product = await GetEntityByIdAsync(productId);
CheckProductIsNotStatic(product);
@ -372,18 +369,18 @@ namespace EasyAbp.EShop.Products.Products
ObjectMapper.Map(input, sku);
await _productManager.UpdateSkuAsync(product, sku);
return ObjectMapper.Map<Product, ProductDto>(product);
}
public async Task<ProductDto> DeleteSkuAsync(Guid productId, Guid productSkuId, Guid storeId)
{
await CheckUpdatePolicyAsync();
await CheckStoreIsProductOwnerAsync(productId, storeId);
var product = await GetEntityByIdAsync(productId);
CheckProductIsNotStatic(product);
var sku = product.ProductSkus.Single(x => x.Id == productSkuId);

18
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs

@ -1,22 +1,22 @@
using System.Linq;
using EasyAbp.EShop.Products.Products;
using EasyAbp.EShop.Products.Products.Dtos;
using AutoMapper;
using EasyAbp.EShop.Products.Categories;
using EasyAbp.EShop.Products.Categories.Dtos;
using EasyAbp.EShop.Products.ProductTypes;
using EasyAbp.EShop.Products.ProductTypes.Dtos;
using EasyAbp.EShop.Products.ProductCategories;
using EasyAbp.EShop.Products.ProductCategories.Dtos;
using AutoMapper;
using EasyAbp.EShop.Products.ProductDetails;
using EasyAbp.EShop.Products.ProductDetails.Dtos;
using EasyAbp.EShop.Products.ProductDetailHistories;
using EasyAbp.EShop.Products.ProductDetailHistories.Dtos;
using EasyAbp.EShop.Products.ProductDetails;
using EasyAbp.EShop.Products.ProductDetails.Dtos;
using EasyAbp.EShop.Products.ProductHistories;
using EasyAbp.EShop.Products.ProductHistories.Dtos;
using Volo.Abp.AutoMapper;
using EasyAbp.EShop.Products.ProductInventories;
using EasyAbp.EShop.Products.ProductInventories.Dtos;
using EasyAbp.EShop.Products.Products;
using EasyAbp.EShop.Products.Products.Dtos;
using EasyAbp.EShop.Products.ProductTypes;
using EasyAbp.EShop.Products.ProductTypes.Dtos;
using System.Linq;
using Volo.Abp.AutoMapper;
using Volo.Abp.DependencyInjection;
namespace EasyAbp.EShop.Products

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp.EShop.Products.Domain.Shared.csproj

@ -9,8 +9,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.Abp.Trees.Domain.Shared" Version="0.290.4" />
<PackageReference Include="Volo.Abp.Validation" Version="3.0.4" />
<PackageReference Include="EasyAbp.Abp.Trees.Domain.Shared" Version="1.0.0" />
<PackageReference Include="Volo.Abp.Validation" Version="3.0.5" />
</ItemGroup>
<ItemGroup>

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json

@ -70,7 +70,7 @@
"ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide",
"CreateProductType": "CreateProductType",
"EditProductType": "EditProductType",
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?",
"ProductTypeDeletionConfirmationMessage": "Are you sure to delete the product type {0}?",
"Menu:ProductCategory": "MenuProductCategory",
"ProductCategory": "ProductCategory",
"ProductCategoryTenantId": "ProductCategoryTenantId",
@ -79,7 +79,7 @@
"ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder",
"CreateProductCategory": "CreateProductCategory",
"EditProductCategory": "EditProductCategory",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?",
"ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the product category {0}?",
"Permission:ProductInventory": "ProductInventory",
"Permission:Create": "Create",
"Permission:Update": "Update",

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSku.cs

@ -20,6 +20,6 @@ namespace EasyAbp.EShop.Products.Products
string MediaResources { get; }
public Guid? ProductDetailId { get; }
Guid? ProductDetailId { get; }
}
}

6
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp.EShop.Products.Domain.csproj

@ -8,9 +8,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.Abp.Trees.Domain" Version="0.290.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.4" />
<PackageReference Include="EasyAbp.Abp.Trees.Domain" Version="1.0.0" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="3.0.5" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Domain.Shared\EasyAbp.EShop.Orders.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Domain.Shared\EasyAbp.EShop.Stores.Domain.Shared.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Products.Domain.Shared\EasyAbp.EShop.Products.Domain.Shared.csproj" />

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductStores/IProductStoreRepository.cs

@ -7,6 +7,6 @@ namespace EasyAbp.EShop.Products.ProductStores
{
public interface IProductStoreRepository : IRepository<ProductStore, Guid>
{
Task<ProductStore> GetAsync(Guid productId, Guid storeId, CancellationToken cancellationToken = default);
Task<ProductStore> GetAsync(Guid productId, Guid storeId, bool includeDetails = true, CancellationToken cancellationToken = default);
}
}

11
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/IProductRepository.cs

@ -6,13 +6,8 @@ namespace EasyAbp.EShop.Products.Products
{
public interface IProductRepository : IRepository<Product, Guid>
{
IQueryable<Product> GetQueryable(Guid storeId, Guid categoryId);
IQueryable<Product> GetQueryable(Guid storeId);
IQueryable<Product> WithDetails(Guid storeId, Guid categoryId);
IQueryable<Product> WithDetails(Guid storeId);
IQueryable<Product> GetQueryable(Guid storeId, Guid? categoryId = null);
IQueryable<Product> WithDetails(Guid storeId, Guid? categoryId = null);
}
}

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

@ -1,7 +1,6 @@
using JetBrains.Annotations;
using System;
using System.Collections.Generic;
using EasyAbp.EShop.Products.ProductDetails;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace EasyAbp.EShop.Products.Products

23
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs

@ -1,10 +1,10 @@
using System;
using EasyAbp.EShop.Products.ProductCategories;
using EasyAbp.EShop.Products.ProductStores;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Products.ProductCategories;
using EasyAbp.EShop.Products.ProductStores;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Domain.Services;
namespace EasyAbp.EShop.Products.Products
@ -51,7 +51,8 @@ namespace EasyAbp.EShop.Products.Products
return product;
}
public virtual async Task<Product> UpdateAsync(Product product, IEnumerable<Guid> categoryIds = null)
public virtual async Task<Product> UpdateAsync(Product product,
IEnumerable<Guid> categoryIds = null)
{
await CheckProductCodeUniqueAsync(product);
@ -168,14 +169,16 @@ namespace EasyAbp.EShop.Products.Products
protected virtual async Task UpdateProductCategoriesAsync(Guid productId, IEnumerable<Guid> categoryIds)
{
await _productCategoryRepository.DeleteAsync(x => x.ProductId.Equals(productId));
categoryIds ??= new List<Guid>();
if (categoryIds == null)
var productCategories = await _productCategoryRepository.GetListByProductIdAsync(productId);
foreach (var productCategory in productCategories.Where(x => !categoryIds.Contains(x.CategoryId)))
{
return;
await _productCategoryRepository.DeleteAsync(productCategory, true);
}
foreach (var categoryId in categoryIds)
foreach (var categoryId in categoryIds.Except(productCategories.Select(x => x.CategoryId)))
{
await _productCategoryRepository.InsertAsync(
new ProductCategory(GuidGenerator.Create(), CurrentTenant.Id, categoryId, productId), true);

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp.EShop.Products.EntityFrameworkCore.csproj

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="EasyAbp.Abp.Trees.EntityFrameworkCore" Version="0.290.4" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="3.0.4" />
<PackageReference Include="EasyAbp.Abp.Trees.EntityFrameworkCore" Version="1.0.0" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Products.Domain\EasyAbp.EShop.Products.Domain.csproj" />
</ItemGroup>

11
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductStores/ProductStoreRepository.cs

@ -1,9 +1,7 @@
using EasyAbp.EShop.Products.EntityFrameworkCore;
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using EasyAbp.EShop.Products.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
@ -16,14 +14,13 @@ namespace EasyAbp.EShop.Products.ProductStores
{
}
public virtual async Task<ProductStore> GetAsync(Guid productId, Guid storeId, CancellationToken cancellationToken = default)
public virtual async Task<ProductStore> GetAsync(Guid productId, Guid storeId, bool includeDetails = true, CancellationToken cancellationToken = default)
{
var entity = await GetQueryable().Where(x => x.ProductId == productId && x.StoreId == storeId)
.FirstOrDefaultAsync(cancellationToken);
var entity = await FindAsync(x => x.ProductId == productId && x.StoreId == storeId, includeDetails, cancellationToken);
if (entity == null)
{
throw new EntityNotFoundException(typeof(ProductStore), new {ProductId = productId, StoreId = storeId});
throw new EntityNotFoundException(typeof(ProductStore), new { ProductId = productId, StoreId = storeId });
}
return entity;

36
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/Products/ProductRepository.cs

@ -20,22 +20,36 @@ namespace EasyAbp.EShop.Products.Products
.Include(x => x.ProductSkus);
}
public IQueryable<Product> GetQueryable(Guid storeId, Guid categoryId)
public IQueryable<Product> GetQueryable(Guid storeId, Guid? categoryId = null)
{
return JoinProductCategories(GetQueryable(storeId), categoryId);
var queryable = GetStoreQueryable(storeId);
if (categoryId.HasValue)
{
queryable = JoinProductCategories(queryable, categoryId.Value);
}
return queryable;
}
public IQueryable<Product> GetQueryable(Guid storeId)
public IQueryable<Product> WithDetails(Guid storeId, Guid? categoryId = null)
{
return JoinProductStores(GetQueryable(), storeId);
var queryable = WithStoreDetails(storeId);
if (categoryId.HasValue)
{
queryable = JoinProductCategories(queryable, categoryId.Value);
}
return queryable;
}
public IQueryable<Product> WithDetails(Guid storeId, Guid categoryId)
protected virtual IQueryable<Product> GetStoreQueryable(Guid storeId)
{
return JoinProductCategories(WithDetails(storeId), categoryId);
return JoinProductStores(GetQueryable(), storeId);
}
public IQueryable<Product> WithDetails(Guid storeId)
protected virtual IQueryable<Product> WithStoreDetails(Guid storeId)
{
return JoinProductStores(WithDetails(), storeId);
}
@ -49,7 +63,7 @@ namespace EasyAbp.EShop.Products.Products
(product, productStore) => product
);
}
protected virtual IQueryable<Product> JoinProductCategories(IQueryable<Product> queryable, Guid categoryId)
{
return queryable.Join(

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi.Client/EasyAbp.EShop.Products.HttpApi.Client.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Http.Client" Version="3.0.4" />
<PackageReference Include="Volo.Abp.Http.Client" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Products.Application.Contracts\EasyAbp.EShop.Products.Application.Contracts.csproj" />
</ItemGroup>

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp.EShop.Products.HttpApi.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Products.Application.Contracts\EasyAbp.EShop.Products.Application.Contracts.csproj" />
</ItemGroup>

7
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs

@ -18,9 +18,9 @@ namespace EasyAbp.EShop.Products.Products
_service = service;
}
[HttpGet]
[Route("{id}/abandoned")]
[Route("{id}")]
[RemoteService(false)]
[NonAction]
public Task<ProductDto> GetAsync(Guid id)
{
return _service.GetAsync(id);
@ -45,8 +45,7 @@ namespace EasyAbp.EShop.Products.Products
return _service.UpdateAsync(id, input);
}
[HttpDelete]
[Route("{id}/abandoned")]
[NonAction]
[RemoteService(false)]
public Task DeleteAsync(Guid id)
{

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.MongoDB/EasyAbp.EShop.Products.MongoDB.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.MongoDB" Version="3.0.4" />
<PackageReference Include="Volo.Abp.MongoDB" Version="3.0.5" />
<ProjectReference Include="..\EasyAbp.EShop.Products.Domain\EasyAbp.EShop.Products.Domain.csproj" />
</ItemGroup>

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/EasyAbp.EShop.Products.Web.csproj

@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="3.0.4" />
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.0.5" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="3.0.5" />
</ItemGroup>
<ItemGroup>

15
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs

@ -1,10 +1,7 @@
using System.Collections.Generic;
using EasyAbp.EShop.Products.Localization;
using EasyAbp.EShop.Products.Permissions;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyAbp.EShop.Products.Localization;
using EasyAbp.EShop.Stores.Stores;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.UI.Navigation;
namespace EasyAbp.EShop.Products.Web.Menus
@ -21,7 +18,9 @@ namespace EasyAbp.EShop.Products.Web.Menus
private async Task ConfigureMainMenu(MenuConfigurationContext context)
{
var l = context.GetLocalizer<ProductsResource>(); //Add main menu items.
var l = context.GetLocalizer<ProductsResource>();
//Add main menu items.
var productManagementMenuItem = new ApplicationMenuItem(ProductsMenus.Prefix, l["Menu:ProductManagement"]);
@ -41,12 +40,8 @@ namespace EasyAbp.EShop.Products.Web.Menus
if (await context.IsGrantedAsync(ProductsPermissions.Products.Default))
{
var storeAppService = context.ServiceProvider.GetRequiredService<IStoreAppService>();
var defaultStore = (await storeAppService.GetDefaultAsync())?.Id;
productManagementMenuItem.AddItem(
new ApplicationMenuItem(ProductsMenus.Product, l["Menu:Product"], "/EShop/Products/Products/Product?storeId=" + defaultStore)
new ApplicationMenuItem(ProductsMenus.Product, l["Menu:Product"], "/EShop/Products/Products/Product")
);
}

2
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs

@ -9,7 +9,7 @@
public const string ProductType = Prefix + ".ProductType";
public const string Category = Prefix + ".Category";
public const string Product = Prefix + ".Product";
//Add your menu items here...

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

@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Products.Categories;
using EasyAbp.EShop.Products.Categories.Dtos;
using EasyAbp.EShop.Products.ProductDetails;
@ -12,6 +8,10 @@ using EasyAbp.EShop.Products.ProductTypes;
using EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewModels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
@ -20,14 +20,16 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
{
[BindProperty(SupportsGet = true)]
public Guid StoreId { get; set; }
[BindProperty]
public CreateEditProductViewModel Product { get; set; }
public ICollection<SelectListItem> ProductTypes { get; set; }
public ICollection<SelectListItem> Categories { get; set; }
public ICollection<SelectListItem> Tags { get; set; }
private readonly IProductTypeAppService _productTypeAppService;
private readonly ICategoryAppService _categoryAppService;
private readonly IProductDetailAppService _productDetailAppService;
@ -45,18 +47,18 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
_service = service;
}
public virtual async Task OnGetAsync(Guid? categoryId)
public virtual async Task OnGetAsync(Guid? categoryId, Guid? tagId)
{
ProductTypes =
(await _productTypeAppService.GetListAsync(new PagedAndSortedResultRequestDto
{MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount})).Items
{ MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount })).Items
.Select(dto => new SelectListItem(dto.DisplayName, dto.Id.ToString())).ToList();
Categories =
(await _categoryAppService.GetListAsync(new GetCategoryListDto
{MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount}))?.Items
{ MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount }))?.Items
.Select(dto => new SelectListItem(dto.DisplayName, dto.Id.ToString())).ToList();
Product = new CreateEditProductViewModel
{
StoreId = StoreId,
@ -68,10 +70,15 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
if (categoryId.HasValue)
{
Product.CategoryIds = new List<Guid>(new[] {categoryId.Value});
Product.CategoryIds = new List<Guid>(new[] { categoryId.Value });
}
if (tagId.HasValue)
{
Product.TagIds = new List<Guid>(new[] { tagId.Value });
}
}
public virtual async Task<IActionResult> OnPostAsync()
{
var detail = await _productDetailAppService.CreateAsync(
@ -81,7 +88,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
var createDto = ObjectMapper.Map<CreateEditProductViewModel, CreateUpdateProductDto>(Product);
createDto.ProductDetailId = detail.Id;
var product = await _service.CreateAsync(createDto);
return NoContent();

14
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs

@ -1,19 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Products.Categories;
using EasyAbp.EShop.Products.Categories.Dtos;
using EasyAbp.EShop.Products.ProductCategories;
using EasyAbp.EShop.Products.ProductCategories.Dtos;
using EasyAbp.EShop.Products.ProductDetails;
using EasyAbp.EShop.Products.ProductDetails.Dtos;
using Microsoft.AspNetCore.Mvc;
using EasyAbp.EShop.Products.Products;
using EasyAbp.EShop.Products.Products.Dtos;
using EasyAbp.EShop.Products.ProductTypes;
using EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewModels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
@ -31,6 +31,8 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
public ICollection<SelectListItem> Categories { get; set; }
public ICollection<SelectListItem> Tags { get; set; }
private readonly IProductTypeAppService _productTypeAppService;
private readonly ICategoryAppService _categoryAppService;
private readonly IProductDetailAppService _productDetailAppService;
@ -74,7 +76,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
ProductId = productDto.Id,
MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount
})).Items.Select(x => x.CategoryId).ToList();
Product.ProductDetail = new CreateEditProductDetailViewModel
{
StoreId = storeId,

1
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml

@ -24,6 +24,7 @@
<script>
let storeId = '@Model.StoreId';
let categoryId = '@Model.CategoryId';
let tagId = '@Model.TagId';
</script>
<abp-card>

44
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs

@ -1,30 +1,56 @@
using System;
using System.Threading.Tasks;
using EasyAbp.EShop.Stores.StoreOwners;
using EasyAbp.EShop.Stores.StoreOwners.Dtos;
using EasyAbp.EShop.Stores.Stores;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
using System.Threading.Tasks;
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
{
public class IndexModel : ProductsPageModel
{
private readonly IStoreAppService _storeAppService;
private readonly IStoreOwnerAppService _storeOwnerAppService;
[BindProperty(SupportsGet = true)]
public Guid StoreId { get; set; }
public Guid? StoreId { get; set; }
[BindProperty(SupportsGet = true)]
public Guid? CategoryId { get; set; }
[BindProperty(SupportsGet = true)]
public Guid? TagId { get; set; }
public string StoreName { get; set; }
public IndexModel(IStoreAppService storeAppService)
public IndexModel(IStoreAppService storeAppService,
IStoreOwnerAppService storeOwnerAppService)
{
_storeAppService = storeAppService;
_storeOwnerAppService = storeOwnerAppService;
}
public virtual async Task OnGetAsync()
{
StoreName = (await _storeAppService.GetAsync(StoreId)).Name;
//TODO: Need to handle: when StoreId is empty, and current user owns multiple store
if (!StoreId.HasValue && CurrentUser.Id.HasValue)
{
var storeOwners = await _storeOwnerAppService.GetListAsync(new GetStoreOwnerListDto
{
OwnerId = CurrentUser.Id.Value,
});
StoreId = storeOwners.Items.FirstOrDefault()?.StoreId;
}
if (!StoreId.HasValue)
{
var defaultStore = await _storeAppService.GetDefaultAsync();
StoreId = defaultStore.Id;
}
StoreName = (await _storeAppService.GetAsync(StoreId.Value)).Name;
}
}
}

6
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs

@ -23,7 +23,11 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewM
[SelectItems("Categories")]
[Display(Name = "ProductCategory")]
public List<Guid> CategoryIds { get; set; }
[SelectItems("Tags")]
[Display(Name = "ProductTag")]
public List<Guid> TagIds { get; set; }
[Display(Name = "ProductUniqueName")]
public string UniqueName { get; set; }

4
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js

@ -15,7 +15,7 @@ $(function () {
scrollCollapse: true,
order: [[1, "asc"]],
ajax: abp.libs.datatables.createAjax(service.getList, function () {
return { storeId: storeId, categoryId: categoryId, showHidden: true }
return { storeId: storeId, categoryId: categoryId, tagId: tagId, showHidden: true }
}),
columnDefs: [
{
@ -69,6 +69,6 @@ $(function () {
$('#NewProductButton').click(function (e) {
e.preventDefault();
createModal.open({ storeId: storeId, categoryId: categoryId });
createModal.open({ storeId: storeId, categoryId: categoryId, tagId: tagId });
});
});

7
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsWebAutoMapperProfile.cs

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using EasyAbp.EShop.Products.Products.Dtos;
@ -20,6 +20,7 @@ namespace EasyAbp.EShop.Products.Web
* into multiple profile classes for a better organization. */
CreateMap<ProductDto, CreateEditProductViewModel>()
.Ignore(model => model.CategoryIds)
.Ignore(model => model.TagIds)
.Ignore(model => model.ProductDetail)
.Ignore(model => model.StoreId)
.ForSourceMember(dto => dto.Sold, opt => opt.DoNotValidate())
@ -41,11 +42,11 @@ namespace EasyAbp.EShop.Products.Web
x.ProductAttributeNames.Split(",", StringSplitOptions.RemoveEmptyEntries).Select((s, i) =>
new CreateUpdateProductAttributeDto
{
DisplayName = s,
DisplayName = s.Trim(),
ProductAttributeOptions = new List<CreateUpdateProductAttributeOptionDto>(
x.ProductAttributeOptionNames.SplitToLines(StringSplitOptions.RemoveEmptyEntries)[i]
.Split(",", StringSplitOptions.RemoveEmptyEntries).Select(o =>
new CreateUpdateProductAttributeOptionDto {DisplayName = o}))
new CreateUpdateProductAttributeOptionDto {DisplayName = o.Trim()}))
})));
CreateMap<ProductDetailDto, CreateEditProductDetailViewModel>()
.Ignore(model => model.StoreId);

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save