Browse Source

Complete creating order feature

pull/49/head
gdlcf88 6 years ago
parent
commit
1ca244953d
  1. 19
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/Authorization/OrdersPermissionDefinitionProvider.cs
  2. 14
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/Authorization/OrdersPermissions.cs
  3. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp.EShop.Orders.Application.Contracts.csproj
  4. 27
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Authorization/OrdersPermissionDefinitionProvider.cs
  5. 25
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Authorization/OrdersPermissions.cs
  6. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/EShopOrdersApplicationContractsModule.cs
  7. 34
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderDto.cs
  8. 18
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderLineDto.cs
  9. 12
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/GetOrderListDto.cs
  10. 41
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDto.cs
  11. 32
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs
  12. 18
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/IOrderAppService.cs
  13. 3
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj
  14. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/EShopOrdersApplicationModule.cs
  15. 13
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs
  16. 107
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs
  17. 141
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs
  18. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersAppService.cs
  19. 8
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs
  20. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj
  21. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/EShopOrdersDomainSharedModule.cs
  22. 28
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/cs.json
  23. 29
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json
  24. 28
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pl.json
  25. 28
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pt-BR.json
  26. 29
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/sl.json
  27. 29
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/tr.json
  28. 28
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/vi.json
  29. 29
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json
  30. 29
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json
  31. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/OrdersResource.cs
  32. 39
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderEto.cs
  33. 34
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs
  34. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderStatus.cs
  35. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/OrdersErrorCodes.cs
  36. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/cs.json
  37. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/en.json
  38. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/pl.json
  39. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/pt-BR.json
  40. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/sl.json
  41. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/tr.json
  42. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/vi.json
  43. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/zh-Hans.json
  44. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/zh-Hant.json
  45. 14
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EShopOrdersDomainModule.cs
  46. 4
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj
  47. 33
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/EShopOrdersDomainModule.cs
  48. 11
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountManager.cs
  49. 10
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs
  50. 10
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderProductInventoryReductionEventHandler.cs
  51. 9
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderRepository.cs
  52. 96
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs
  53. 20
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderDiscountManager.cs
  54. 33
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs
  55. 43
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderProductInventoryReductionEventHandler.cs
  56. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/OrdersDbProperties.cs
  57. 17
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/OrdersDomainAutoMapperProfile.cs
  58. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Settings/OrdersSettingDefinitionProvider.cs
  59. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Settings/OrdersSettings.cs
  60. 45
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/Orders/Order.cs
  61. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp.EShop.Orders.EntityFrameworkCore.csproj
  62. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/EShopOrdersEntityFrameworkCoreModule.cs
  63. 7
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/IOrdersDbContext.cs
  64. 5
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContext.cs
  65. 20
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs
  66. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersModelBuilderConfigurationOptions.cs
  67. 14
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/Orders/OrderRepository.cs
  68. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi.Client/EasyAbp.EShop.Orders.HttpApi.Client.csproj
  69. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi.Client/EasyAbp/EShop/Orders/EShopOrdersHttpApiClientModule.cs
  70. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp.EShop.Orders.HttpApi.csproj
  71. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp/EShop/Orders/EShopOrdersHttpApiModule.cs
  72. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp/EShop/Orders/OrdersController.cs
  73. 6
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp.EShop.Orders.MongoDB.csproj
  74. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp/EShop/Orders/MongoDB/EShopOrdersMongoDbModule.cs
  75. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp/EShop/Orders/MongoDB/IOrdersMongoDbContext.cs
  76. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp/EShop/Orders/MongoDB/OrdersMongoDbContext.cs
  77. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp/EShop/Orders/MongoDB/OrdersMongoDbContextExtensions.cs
  78. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp/EShop/Orders/MongoDB/OrdersMongoModelBuilderConfigurationOptions.cs
  79. 1
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EasyAbp.EShop.Orders.Web.csproj
  80. 38
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersMenuContributor.cs
  81. 7
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs
  82. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Index.cshtml
  83. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Index.cshtml.cs
  84. 54
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml
  85. 40
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml.cs
  86. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/index.css
  87. 48
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/index.js
  88. 0
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/_ViewImports.cshtml
  89. 2
      modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/OrdersPage.cs
  90. 2
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/EasyAbp.EShop.Orders.Application.Tests.csproj
  91. 26
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs
  92. 2
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/EasyAbp.EShop.Orders.Domain.Tests.csproj
  93. 23
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/OrderDomainTests.cs
  94. 2
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests.csproj
  95. 31
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests/EntityFrameworkCore/Orders/OrderRepositoryTests.cs
  96. 2
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj
  97. 2
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.MongoDB.Tests/EasyAbp.EShop.Orders.MongoDB.Tests.csproj
  98. 2
      modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj
  99. 4
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs
  100. 12
      modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductInventoryReductionAfterOrderPlacedResultEto.cs

19
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/Authorization/OrdersPermissionDefinitionProvider.cs

@ -1,19 +0,0 @@
using EasyAbp.EShop.Orders.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace EasyAbp.EShop.Orders.Authorization
{
public class OrdersPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
//var moduleGroup = context.AddGroup(OrdersPermissions.GroupName, L("Permission:Orders"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<OrdersResource>(name);
}
}
}

14
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/Authorization/OrdersPermissions.cs

@ -1,14 +0,0 @@
using Volo.Abp.Reflection;
namespace EasyAbp.EShop.Orders.Authorization
{
public class OrdersPermissions
{
public const string GroupName = "EasyAbp.EShop.Orders";
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(OrdersPermissions));
}
}
}

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

27
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Authorization/OrdersPermissionDefinitionProvider.cs

@ -0,0 +1,27 @@
using EasyAbp.EShop.Orders.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;
namespace EasyAbp.EShop.Orders.Authorization
{
public class OrdersPermissionDefinitionProvider : PermissionDefinitionProvider
{
public override void Define(IPermissionDefinitionContext context)
{
var moduleGroup = context.AddGroup(OrdersPermissions.GroupName, L("Permission:Orders"));
var order = moduleGroup.AddPermission(OrdersPermissions.Orders.Default, L("Permission:Product"));
order.AddChild(OrdersPermissions.Orders.Manage, L("Permission:Manage"));
order.AddChild(OrdersPermissions.Orders.CrossStore, L("Permission:CrossStore"));
order.AddChild(OrdersPermissions.Orders.Create, L("Permission:Create"));
order.AddChild(OrdersPermissions.Orders.ConfirmReceipt, L("Permission:ConfirmReceipt"));
order.AddChild(OrdersPermissions.Orders.RequestCancellation, L("Permission:RequestCancellation"));
order.AddChild(OrdersPermissions.Orders.Cancel, L("Permission:Cancel"));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<OrdersResource>(name);
}
}
}

25
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Authorization/OrdersPermissions.cs

@ -0,0 +1,25 @@
using Volo.Abp.Reflection;
namespace EasyAbp.EShop.Orders.Authorization
{
public class OrdersPermissions
{
public const string GroupName = "EasyAbp.EShop.Orders";
public class Orders
{
public const string Default = GroupName + ".Order";
public const string Manage = Default + ".Manage";
public const string CrossStore = Default + ".CrossStore";
public const string Create = Default + ".Create";
public const string ConfirmReceipt = Default + ".ConfirmReceipt";
public const string RequestCancellation = Default + ".RequestCancellation";
public const string Cancel = Default + ".Cancel";
}
public static string[] GetAll()
{
return ReflectionHelper.GetPublicConstantsRecursively(typeof(OrdersPermissions));
}
}
}

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EShopOrdersApplicationContractsModule.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/EShopOrdersApplicationContractsModule.cs

34
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderDto.cs

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace EasyAbp.EShop.Orders.Orders.Dtos
{
public class CreateOrderDto : IValidatableObject
{
[DisplayName("OrderStoreId")]
public Guid StoreId { get; set; }
[DisplayName("OrderCustomerRemark")]
public string CustomerRemark { get; set; }
[DisplayName("OrderLine")]
public List<CreateOrderLineDto> OrderLines { get; set; }
[DisplayName("OrderExtraProperties")]
public Dictionary<string, object> ExtraProperties { get; set; }
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (OrderLines.Select(orderLine => orderLine.Quantity).Sum() <= 0)
{
yield return new ValidationResult(
"Total quantity should be greater than 0.",
new[] { "OrderLines" }
);
}
}
}
}

18
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderLineDto.cs

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace EasyAbp.EShop.Orders.Orders.Dtos
{
public class CreateOrderLineDto
{
[DisplayName("OrderLineProductId")]
public Guid ProductId { get; set; }
[DisplayName("OrderLineProductSkuId")]
public Guid ProductSkuId { get; set; }
[DisplayName("OrderLineQuantity")]
public int Quantity { get; set; }
}
}

12
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/GetOrderListDto.cs

@ -0,0 +1,12 @@
using System;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Orders.Orders.Dtos
{
public class GetOrderListDto : PagedAndSortedResultRequestDto
{
public Guid? StoreId { get; set; }
public Guid? CustomerUserId { get; set; }
}
}

41
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDto.cs

@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Orders.Orders.Dtos
{
public class OrderDto : ExtensibleFullAuditedEntityDto<Guid>
{
public Guid StoreId { get; set; }
public Guid CustomerUserId { get; set; }
public OrderStatus OrderStatus { get; set; }
public string Currency { get; set; }
public decimal ProductTotalPrice { get; set; }
public decimal TotalDiscount { get; set; }
public decimal TotalPrice { get; set; }
public decimal RefundedAmount { get; set; }
public string CustomerRemark { get; set; }
public string StaffRemark { get; set; }
public DateTime? PaidTime { get; set; }
public DateTime? CompletionTime { get; set; }
public DateTime? CancelledTime { get; set; }
public DateTime? ReducedInventoryAfterPlacingTime { get; set; }
public DateTime? ReducedInventoryAfterPaymentTime { get; set; }
public List<OrderLineDto> OrderLines { get; set; }
}
}

32
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs

@ -0,0 +1,32 @@
using System;
using Volo.Abp.Application.Dtos;
namespace EasyAbp.EShop.Orders.Orders.Dtos
{
public class OrderLineDto : FullAuditedEntityDto<Guid>
{
public Guid ProductId { get; set; }
public Guid ProductSkuId { get; set; }
public DateTime ProductModificationTime { get; set; }
public DateTime ProductDetailModificationTime { get; set; }
public string ProductName { get; set; }
public string SkuDescription { get; set; }
public string MediaResources { get; set; }
public string Currency { get; set; }
public decimal UnitPrice { get; set; }
public decimal TotalPrice { get; set; }
public decimal TotalDiscount { get; set; }
public int Quantity { get; set; }
}
}

18
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/IOrderAppService.cs

@ -0,0 +1,18 @@
using System;
using EasyAbp.EShop.Orders.Orders.Dtos;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderAppService :
ICrudAppService<
OrderDto,
Guid,
GetOrderListDto,
CreateOrderDto,
CreateOrderDto>
{
}
}

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

@ -4,12 +4,13 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.5.0" />
<PackageReference Include="Volo.Abp.Ddd.Application" Version="2.5.0" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Products\src\EasyAbp.EShop.Products.Application.Contracts\EasyAbp.EShop.Products.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>

4
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EShopOrdersApplicationModule.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/EShopOrdersApplicationModule.cs

@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using EasyAbp.EShop.Products;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.Application;
@ -8,6 +9,7 @@ namespace EasyAbp.EShop.Orders
[DependsOn(
typeof(EShopOrdersDomainModule),
typeof(EShopOrdersApplicationContractsModule),
typeof(EShopProductsApplicationContractsModule),
typeof(AbpDddApplicationModule),
typeof(AbpAutoMapperModule)
)]

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

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyAbp.EShop.Orders.Orders.Dtos;
using EasyAbp.EShop.Products.Products.Dtos;
namespace EasyAbp.EShop.Orders.Orders
{
public interface INewOrderGenerator
{
Task<Order> GenerateAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict);
}
}

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

@ -0,0 +1,107 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Orders.Orders.Dtos;
using EasyAbp.EShop.Products.Products.Dtos;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.Json;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Users;
namespace EasyAbp.EShop.Orders.Orders
{
public class NewOrderGenerator : INewOrderGenerator, ITransientDependency
{
private readonly IGuidGenerator _guidGenerator;
private readonly ICurrentTenant _currentTenant;
private readonly ICurrentUser _currentUser;
private readonly IJsonSerializer _jsonSerializer;
public NewOrderGenerator(
IGuidGenerator guidGenerator,
ICurrentTenant currentTenant,
ICurrentUser currentUser,
IJsonSerializer jsonSerializer)
{
_guidGenerator = guidGenerator;
_currentTenant = currentTenant;
_currentUser = currentUser;
_jsonSerializer = jsonSerializer;
}
public virtual async Task<Order> GenerateAsync(CreateOrderDto input, Dictionary<Guid, ProductDto> productDict)
{
var orderLines = new List<OrderLine>();
foreach (var orderLine in input.OrderLines)
{
orderLines.Add(await GenerateNewOrderLineAsync(orderLine, productDict));
}
var productTotalPrice = orderLines.Select(x => x.TotalPrice).Sum();
var order = new Order(
id: _guidGenerator.Create(),
tenantId: _currentTenant.Id,
storeId: input.StoreId,
customerUserId: _currentUser.GetId(),
currency: await GetStoreCurrencyAsync(input.StoreId),
productTotalPrice: productTotalPrice,
totalDiscount: orderLines.Select(x => x.TotalDiscount).Sum(),
totalPrice: productTotalPrice,
refundedAmount: 0,
customerRemark: input.CustomerRemark);
order.SetOrderLines(orderLines);
return order;
}
protected virtual async Task<OrderLine> GenerateNewOrderLineAsync(CreateOrderLineDto input, Dictionary<Guid, ProductDto> productDict)
{
var product = productDict[input.ProductId];
var productSku = product.ProductSkus.Single(x => x.Id == input.ProductSkuId);
return new OrderLine(
id: _guidGenerator.Create(),
productId: product.Id,
productSkuId: productSku.Id,
productModificationTime: product.LastModificationTime ?? product.CreationTime,
productDetailModificationTime: productSku.LastModificationTime ?? productSku.CreationTime,
productName: product.DisplayName,
skuDescription: await GenerateSkuDescriptionAsync(product, productSku),
mediaResources: product.MediaResources,
currency: productSku.Currency,
unitPrice: productSku.Price,
totalPrice: productSku.Price * input.Quantity,
totalDiscount: 0,
quantity: input.Quantity
);
}
protected virtual Task<string> GenerateSkuDescriptionAsync(ProductDto product, ProductSkuDto productSku)
{
var attributeOptionIds = _jsonSerializer.Deserialize<Guid[]>(productSku.SerializedAttributeOptionIds);
var names = new Collection<string[]>();
foreach (var attributeOptionId in attributeOptionIds)
{
names.Add(product.ProductAttributes.SelectMany(
attribute => attribute.ProductAttributeOptions.Where(option => option.Id == attributeOptionId),
(attribute, option) => new [] {attribute.DisplayName, option.DisplayName}).Single());
}
return Task.FromResult(_jsonSerializer.Serialize(names));
}
protected virtual Task<string> GetStoreCurrencyAsync(Guid storeId)
{
// Todo: Get real store currency configuration.
return Task.FromResult("CNY");
}
}
}

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

@ -0,0 +1,141 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Threading.Tasks;
using EasyAbp.EShop.Orders.Authorization;
using EasyAbp.EShop.Orders.Orders.Dtos;
using EasyAbp.EShop.Products.Products;
using EasyAbp.EShop.Products.Products.Dtos;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Json;
using Volo.Abp.Users;
namespace EasyAbp.EShop.Orders.Orders
{
[Authorize]
public class OrderAppService : CrudAppService<Order, OrderDto, Guid, GetOrderListDto, CreateOrderDto, CreateOrderDto>,
IOrderAppService
{
protected override string CreatePolicyName { get; set; } = OrdersPermissions.Orders.Create;
protected override string GetPolicyName { get; set; } = OrdersPermissions.Orders.Default;
protected override string GetListPolicyName { get; set; } = OrdersPermissions.Orders.Default;
private readonly INewOrderGenerator _newOrderGenerator;
private readonly IProductAppService _productAppService;
private readonly IOrderDiscountManager _orderDiscountManager;
private readonly IOrderRepository _repository;
public OrderAppService(
INewOrderGenerator newOrderGenerator,
IProductAppService productAppService,
IOrderDiscountManager orderDiscountManager,
IOrderRepository repository) : base(repository)
{
_newOrderGenerator = newOrderGenerator;
_productAppService = productAppService;
_orderDiscountManager = orderDiscountManager;
_repository = repository;
}
protected override IQueryable<Order> CreateFilteredQuery(GetOrderListDto input)
{
var query = base.CreateFilteredQuery(input);
if (input.StoreId.HasValue)
{
query = query.Where(x => x.StoreId == input.StoreId.Value);
}
if (input.CustomerUserId.HasValue)
{
query = query.Where(x => x.CustomerUserId == input.CustomerUserId.Value);
}
return query;
}
public override async Task<PagedResultDto<OrderDto>> GetListAsync(GetOrderListDto input)
{
if (input.CustomerUserId != CurrentUser.GetId())
{
await AuthorizationService.IsGrantedAsync(OrdersPermissions.Orders.Manage);
if (input.StoreId.HasValue)
{
// Todo: Check if current user is an admin of the store.
}
else
{
await AuthorizationService.IsGrantedAsync(OrdersPermissions.Orders.CrossStore);
}
}
return await base.GetListAsync(input);
}
public override async Task<OrderDto> GetAsync(Guid id)
{
await CheckGetPolicyAsync();
var order = await GetEntityByIdAsync(id);
if (order.CustomerUserId != CurrentUser.GetId())
{
await AuthorizationService.IsGrantedAsync(OrdersPermissions.Orders.Manage);
// Todo: Check if current user is an admin of the store.
}
return MapToGetOutputDto(order);
}
public override async Task<OrderDto> CreateAsync(CreateOrderDto input)
{
await CheckCreatePolicyAsync();
// Todo: Check if the store is open.
var productDict = await GetProductDictionaryAsync(input.OrderLines.Select(dto => dto.ProductId).ToList(),
input.StoreId);
// Todo: Check if the product is purchasable.
var order = await _newOrderGenerator.GenerateAsync(input, productDict);
await _orderDiscountManager.DiscountAsync(order, input.ExtraProperties);
await Repository.InsertAsync(order, autoSave: true);
return MapToGetOutputDto(order);
}
protected virtual async Task<Dictionary<Guid, ProductDto>> GetProductDictionaryAsync(
IEnumerable<Guid> productIds, Guid storeId)
{
var dict = new Dictionary<Guid, ProductDto>();
foreach (var productId in productIds)
{
dict.Add(productId, await _productAppService.GetAsync(productId, storeId));
}
return dict;
}
[RemoteService(false)]
public override Task<OrderDto> UpdateAsync(Guid id, CreateOrderDto input)
{
throw new NotSupportedException();
}
[RemoteService(false)]
public override Task DeleteAsync(Guid id)
{
throw new NotSupportedException();
}
}
}

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/OrdersAppService.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersAppService.cs

8
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/OrdersApplicationAutoMapperProfile.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs

@ -1,4 +1,6 @@
using AutoMapper;
using EasyAbp.EShop.Orders.Orders;
using EasyAbp.EShop.Orders.Orders.Dtos;
using AutoMapper;
namespace EasyAbp.EShop.Orders
{
@ -9,6 +11,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<OrderLine, OrderLineDto>();
}
}
}
}

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
@ -12,8 +12,8 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\Orders\*.json" />
<Content Remove="Localization\Orders\*.json" />
<EmbeddedResource Include="EasyAbp\EShop\Orders\Localization\Orders\*.json" />
<Content Remove="EasyAbp\EShop\Orders\Localization\Orders\*.json" />
</ItemGroup>
</Project>

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EShopOrdersDomainSharedModule.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/EShopOrdersDomainSharedModule.cs

@ -17,7 +17,7 @@ namespace EasyAbp.EShop.Orders
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<EShopOrdersDomainSharedModule>("EasyAbp.EShop.Orders");
options.FileSets.AddEmbedded<EShopOrdersDomainSharedModule>();
});
Configure<AbpLocalizationOptions>(options =>
@ -25,12 +25,12 @@ namespace EasyAbp.EShop.Orders
options.Resources
.Add<OrdersResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/Orders");
.AddVirtualJson("EasyAbp/EShop/Orders/Localization/Orders");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("Orders", typeof(OrdersResource));
options.MapCodeNamespace("EasyAbp.EShop.Orders", typeof(OrdersResource));
});
}
}

28
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/cs.json

@ -0,0 +1,28 @@
{
"culture": "cs",
"texts": {
"Menu:Order": "MenuOrder",
"Order": "Order",
"OrderStoreId": "OrderStoreId",
"OrderCustomerUserId": "OrderCustomerUserId",
"OrderOrderStatus": "OrderOrderStatus",
"OrderCurrency": "OrderCurrency",
"OrderProductTotalPrice": "OrderProductTotalPrice",
"OrderTotalDiscount": "OrderTotalDiscount",
"OrderTotalPrice": "OrderTotalPrice",
"OrderRefundedAmount": "OrderRefundedAmount",
"OrderCustomerRemark": "OrderCustomerRemark",
"OrderStaffRemark": "OrderStaffRemark",
"OrderPaidTime": "OrderPaidTime",
"OrderCompletionTime": "OrderCompletionTime",
"OrderCancelledTime": "OrderCancelledTime",
"OrderLine": "OrderLine",
"OrderLineProductId": "OrderLineProductId",
"OrderLineProductSkuId": "OrderLineProductSkuId",
"OrderLineQuantity": "OrderLineQuantity",
"CreateOrder": "CreateOrder",
"EditOrder": "EditOrder",
"OrderDeletionConfirmationMessage": "Are you sure to delete the order {0}?",
"SuccessfullyDeleted": "Successfully deleted"
}
}

29
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json

@ -0,0 +1,29 @@
{
"culture": "en",
"texts": {
"ManageYourProfile": "Manage your profile",
"Menu:Order": "MenuOrder",
"Order": "Order",
"OrderStoreId": "OrderStoreId",
"OrderCustomerUserId": "OrderCustomerUserId",
"OrderOrderStatus": "OrderOrderStatus",
"OrderCurrency": "OrderCurrency",
"OrderProductTotalPrice": "OrderProductTotalPrice",
"OrderTotalDiscount": "OrderTotalDiscount",
"OrderTotalPrice": "OrderTotalPrice",
"OrderRefundedAmount": "OrderRefundedAmount",
"OrderCustomerRemark": "OrderCustomerRemark",
"OrderStaffRemark": "OrderStaffRemark",
"OrderPaidTime": "OrderPaidTime",
"OrderCompletionTime": "OrderCompletionTime",
"OrderCancelledTime": "OrderCancelledTime",
"OrderLine": "OrderLine",
"OrderLineProductId": "OrderLineProductId",
"OrderLineProductSkuId": "OrderLineProductSkuId",
"OrderLineQuantity": "OrderLineQuantity",
"CreateOrder": "CreateOrder",
"EditOrder": "EditOrder",
"OrderDeletionConfirmationMessage": "Are you sure to delete the order {0}?",
"SuccessfullyDeleted": "Successfully deleted"
}
}

28
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pl.json

@ -0,0 +1,28 @@
{
"culture": "pl",
"texts": {
"Menu:Order": "MenuOrder",
"Order": "Order",
"OrderStoreId": "OrderStoreId",
"OrderCustomerUserId": "OrderCustomerUserId",
"OrderOrderStatus": "OrderOrderStatus",
"OrderCurrency": "OrderCurrency",
"OrderProductTotalPrice": "OrderProductTotalPrice",
"OrderTotalDiscount": "OrderTotalDiscount",
"OrderTotalPrice": "OrderTotalPrice",
"OrderRefundedAmount": "OrderRefundedAmount",
"OrderCustomerRemark": "OrderCustomerRemark",
"OrderStaffRemark": "OrderStaffRemark",
"OrderPaidTime": "OrderPaidTime",
"OrderCompletionTime": "OrderCompletionTime",
"OrderCancelledTime": "OrderCancelledTime",
"OrderLine": "OrderLine",
"OrderLineProductId": "OrderLineProductId",
"OrderLineProductSkuId": "OrderLineProductSkuId",
"OrderLineQuantity": "OrderLineQuantity",
"CreateOrder": "CreateOrder",
"EditOrder": "EditOrder",
"OrderDeletionConfirmationMessage": "Are you sure to delete the order {0}?",
"SuccessfullyDeleted": "Successfully deleted"
}
}

28
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pt-BR.json

@ -0,0 +1,28 @@
{
"culture": "pt-BR",
"texts": {
"Menu:Order": "MenuOrder",
"Order": "Order",
"OrderStoreId": "OrderStoreId",
"OrderCustomerUserId": "OrderCustomerUserId",
"OrderOrderStatus": "OrderOrderStatus",
"OrderCurrency": "OrderCurrency",
"OrderProductTotalPrice": "OrderProductTotalPrice",
"OrderTotalDiscount": "OrderTotalDiscount",
"OrderTotalPrice": "OrderTotalPrice",
"OrderRefundedAmount": "OrderRefundedAmount",
"OrderCustomerRemark": "OrderCustomerRemark",
"OrderStaffRemark": "OrderStaffRemark",
"OrderPaidTime": "OrderPaidTime",
"OrderCompletionTime": "OrderCompletionTime",
"OrderCancelledTime": "OrderCancelledTime",
"OrderLine": "OrderLine",
"OrderLineProductId": "OrderLineProductId",
"OrderLineProductSkuId": "OrderLineProductSkuId",
"OrderLineQuantity": "OrderLineQuantity",
"CreateOrder": "CreateOrder",
"EditOrder": "EditOrder",
"OrderDeletionConfirmationMessage": "Are you sure to delete the order {0}?",
"SuccessfullyDeleted": "Successfully deleted"
}
}

29
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/sl.json

@ -0,0 +1,29 @@
{
"culture": "sl",
"texts": {
"ManageYourProfile": "Upravljajte svojim profilom",
"Menu:Order": "MenuOrder",
"Order": "Order",
"OrderStoreId": "OrderStoreId",
"OrderCustomerUserId": "OrderCustomerUserId",
"OrderOrderStatus": "OrderOrderStatus",
"OrderCurrency": "OrderCurrency",
"OrderProductTotalPrice": "OrderProductTotalPrice",
"OrderTotalDiscount": "OrderTotalDiscount",
"OrderTotalPrice": "OrderTotalPrice",
"OrderRefundedAmount": "OrderRefundedAmount",
"OrderCustomerRemark": "OrderCustomerRemark",
"OrderStaffRemark": "OrderStaffRemark",
"OrderPaidTime": "OrderPaidTime",
"OrderCompletionTime": "OrderCompletionTime",
"OrderCancelledTime": "OrderCancelledTime",
"OrderLine": "OrderLine",
"OrderLineProductId": "OrderLineProductId",
"OrderLineProductSkuId": "OrderLineProductSkuId",
"OrderLineQuantity": "OrderLineQuantity",
"CreateOrder": "CreateOrder",
"EditOrder": "EditOrder",
"OrderDeletionConfirmationMessage": "Are you sure to delete the order {0}?",
"SuccessfullyDeleted": "Successfully deleted"
}
}

29
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/tr.json

@ -0,0 +1,29 @@
{
"culture": "tr",
"texts": {
"ManageYourProfile": "Profil y�netimi",
"Menu:Order": "MenuOrder",
"Order": "Order",
"OrderStoreId": "OrderStoreId",
"OrderCustomerUserId": "OrderCustomerUserId",
"OrderOrderStatus": "OrderOrderStatus",
"OrderCurrency": "OrderCurrency",
"OrderProductTotalPrice": "OrderProductTotalPrice",
"OrderTotalDiscount": "OrderTotalDiscount",
"OrderTotalPrice": "OrderTotalPrice",
"OrderRefundedAmount": "OrderRefundedAmount",
"OrderCustomerRemark": "OrderCustomerRemark",
"OrderStaffRemark": "OrderStaffRemark",
"OrderPaidTime": "OrderPaidTime",
"OrderCompletionTime": "OrderCompletionTime",
"OrderCancelledTime": "OrderCancelledTime",
"OrderLine": "OrderLine",
"OrderLineProductId": "OrderLineProductId",
"OrderLineProductSkuId": "OrderLineProductSkuId",
"OrderLineQuantity": "OrderLineQuantity",
"CreateOrder": "CreateOrder",
"EditOrder": "EditOrder",
"OrderDeletionConfirmationMessage": "Are you sure to delete the order {0}?",
"SuccessfullyDeleted": "Successfully deleted"
}
}

28
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/vi.json

@ -0,0 +1,28 @@
{
"culture": "vi",
"texts": {
"Menu:Order": "MenuOrder",
"Order": "Order",
"OrderStoreId": "OrderStoreId",
"OrderCustomerUserId": "OrderCustomerUserId",
"OrderOrderStatus": "OrderOrderStatus",
"OrderCurrency": "OrderCurrency",
"OrderProductTotalPrice": "OrderProductTotalPrice",
"OrderTotalDiscount": "OrderTotalDiscount",
"OrderTotalPrice": "OrderTotalPrice",
"OrderRefundedAmount": "OrderRefundedAmount",
"OrderCustomerRemark": "OrderCustomerRemark",
"OrderStaffRemark": "OrderStaffRemark",
"OrderPaidTime": "OrderPaidTime",
"OrderCompletionTime": "OrderCompletionTime",
"OrderCancelledTime": "OrderCancelledTime",
"OrderLine": "OrderLine",
"OrderLineProductId": "OrderLineProductId",
"OrderLineProductSkuId": "OrderLineProductSkuId",
"OrderLineQuantity": "OrderLineQuantity",
"CreateOrder": "CreateOrder",
"EditOrder": "EditOrder",
"OrderDeletionConfirmationMessage": "Are you sure to delete the order {0}?",
"SuccessfullyDeleted": "Successfully deleted"
}
}

29
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json

@ -0,0 +1,29 @@
{
"culture": "zh-Hans",
"texts": {
"ManageYourProfile": "管理个人资料",
"Menu:Order": "MenuOrder",
"Order": "Order",
"OrderStoreId": "OrderStoreId",
"OrderCustomerUserId": "OrderCustomerUserId",
"OrderOrderStatus": "OrderOrderStatus",
"OrderCurrency": "OrderCurrency",
"OrderProductTotalPrice": "OrderProductTotalPrice",
"OrderTotalDiscount": "OrderTotalDiscount",
"OrderTotalPrice": "OrderTotalPrice",
"OrderRefundedAmount": "OrderRefundedAmount",
"OrderCustomerRemark": "OrderCustomerRemark",
"OrderStaffRemark": "OrderStaffRemark",
"OrderPaidTime": "OrderPaidTime",
"OrderCompletionTime": "OrderCompletionTime",
"OrderCancelledTime": "OrderCancelledTime",
"OrderLine": "OrderLine",
"OrderLineProductId": "OrderLineProductId",
"OrderLineProductSkuId": "OrderLineProductSkuId",
"OrderLineQuantity": "OrderLineQuantity",
"CreateOrder": "CreateOrder",
"EditOrder": "EditOrder",
"OrderDeletionConfirmationMessage": "Are you sure to delete the order {0}?",
"SuccessfullyDeleted": "Successfully deleted"
}
}

29
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json

@ -0,0 +1,29 @@
{
"culture": "zh-Hant",
"texts": {
"ManageYourProfile": "管理個人資料",
"Menu:Order": "MenuOrder",
"Order": "Order",
"OrderStoreId": "OrderStoreId",
"OrderCustomerUserId": "OrderCustomerUserId",
"OrderOrderStatus": "OrderOrderStatus",
"OrderCurrency": "OrderCurrency",
"OrderProductTotalPrice": "OrderProductTotalPrice",
"OrderTotalDiscount": "OrderTotalDiscount",
"OrderTotalPrice": "OrderTotalPrice",
"OrderRefundedAmount": "OrderRefundedAmount",
"OrderCustomerRemark": "OrderCustomerRemark",
"OrderStaffRemark": "OrderStaffRemark",
"OrderPaidTime": "OrderPaidTime",
"OrderCompletionTime": "OrderCompletionTime",
"OrderCancelledTime": "OrderCancelledTime",
"OrderLine": "OrderLine",
"OrderLineProductId": "OrderLineProductId",
"OrderLineProductSkuId": "OrderLineProductSkuId",
"OrderLineQuantity": "OrderLineQuantity",
"CreateOrder": "CreateOrder",
"EditOrder": "EditOrder",
"OrderDeletionConfirmationMessage": "Are you sure to delete the order {0}?",
"SuccessfullyDeleted": "Successfully deleted"
}
}

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/OrdersResource.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/OrdersResource.cs

39
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderEto.cs

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
namespace EasyAbp.EShop.Orders.Orders
{
[Serializable]
public class OrderEto
{
public Guid Id { get; set; }
public Guid StoreId { get; set; }
public Guid CustomerUserId { get; set; }
public OrderStatus OrderStatus { get; set; }
public string Currency { get; set; }
public decimal ProductTotalPrice { get; set; }
public decimal TotalDiscount { get; set; }
public decimal TotalPrice { get; set; }
public decimal RefundedAmount { get; set; }
public string CustomerRemark { get; set; }
public string StaffRemark { get; set; }
public DateTime? PaidTime { get; set; }
public DateTime? CompletionTime { get; set; }
public DateTime? CancelledTime { get; set; }
public List<OrderLineEto> OrderLines { get; set; }
}
}

34
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs

@ -0,0 +1,34 @@
using System;
namespace EasyAbp.EShop.Orders.Orders
{
[Serializable]
public class OrderLineEto
{
public Guid Id { get; set; }
public Guid ProductId { get; set; }
public Guid ProductSkuId { get; set; }
public DateTime ProductModificationTime { get; set; }
public DateTime ProductDetailModificationTime { get; set; }
public string ProductName { get; set; }
public string SkuDescription { get; set; }
public string MediaResources { get; set; }
public string Currency { get; set; }
public decimal UnitPrice { get; set; }
public decimal TotalPrice { get; set; }
public decimal TotalDiscount { get; set; }
public int Quantity { get; set; }
}
}

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Orders/OrderStatus.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderStatus.cs

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/OrdersErrorCodes.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/OrdersErrorCodes.cs

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/cs.json

@ -1,6 +0,0 @@
{
"culture": "cs",
"texts": {
}
}

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/en.json

@ -1,6 +0,0 @@
{
"culture": "en",
"texts": {
"ManageYourProfile": "Manage your profile"
}
}

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/pl.json

@ -1,6 +0,0 @@
{
"culture": "pl",
"texts": {
}
}

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/pt-BR.json

@ -1,6 +0,0 @@
{
"culture": "pt-BR",
"texts": {
}
}

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/sl.json

@ -1,6 +0,0 @@
{
"culture": "sl",
"texts": {
"ManageYourProfile": "Upravljajte svojim profilom"
}
}

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/tr.json

@ -1,6 +0,0 @@
{
"culture": "tr",
"texts": {
"ManageYourProfile": "Profil yönetimi"
}
}

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/vi.json

@ -1,6 +0,0 @@
{
"culture": "vi",
"texts": {
}
}

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/zh-Hans.json

@ -1,6 +0,0 @@
{
"culture": "zh-Hans",
"texts": {
"ManageYourProfile": "管理个人资料"
}
}

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/Localization/Orders/zh-Hant.json

@ -1,6 +0,0 @@
{
"culture": "zh-Hant",
"texts": {
"ManageYourProfile": "管理個人資料"
}
}

14
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EShopOrdersDomainModule.cs

@ -1,14 +0,0 @@
using EasyAbp.EShop.Stores;
using Volo.Abp.Modularity;
namespace EasyAbp.EShop.Orders
{
[DependsOn(
typeof(EShopOrdersDomainSharedModule),
typeof(EShopStoresDomainSharedModule)
)]
public class EShopOrdersDomainModule : AbpModule
{
}
}

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

@ -4,11 +4,13 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" Version="2.5.0" />
<PackageReference Include="Volo.Abp.Ddd.Domain" Version="2.5.0" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Products\src\EasyAbp.EShop.Products.Domain.Shared\EasyAbp.EShop.Products.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Domain.Shared\EasyAbp.EShop.Stores.Domain.Shared.csproj" />
<ProjectReference Include="..\EasyAbp.EShop.Orders.Domain.Shared\EasyAbp.EShop.Orders.Domain.Shared.csproj" />
</ItemGroup>

33
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/EShopOrdersDomainModule.cs

@ -0,0 +1,33 @@
using EasyAbp.EShop.Orders.Orders;
using EasyAbp.EShop.Stores;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AutoMapper;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Modularity;
namespace EasyAbp.EShop.Orders
{
[DependsOn(
typeof(AbpAutoMapperModule),
typeof(EShopOrdersDomainSharedModule),
typeof(EShopStoresDomainSharedModule)
)]
public class EShopOrdersDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAutoMapperObjectMapper<EShopOrdersDomainModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<OrdersDomainAutoMapperProfile>(validate: true);
});
Configure<AbpDistributedEventBusOptions>(options =>
{
options.EtoMappings.Add<Order, OrderEto>(typeof(EShopOrdersDomainModule));
options.EtoMappings.Add<OrderLine, OrderLineEto>(typeof(EShopOrdersDomainModule));
});
}
}
}

11
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountManager.cs

@ -0,0 +1,11 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Domain.Services;
namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderDiscountManager : IDomainService
{
Task<Order> DiscountAsync(Order order, Dictionary<string, object> inputExtraProperties);
}
}

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

@ -0,0 +1,10 @@
using System.Collections.Generic;
using System.Threading.Tasks;
namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderDiscountProvider
{
Task<Order> DiscountAsync(Order order, Dictionary<string, object> inputExtraProperties);
}
}

10
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderProductInventoryReductionEventHandler.cs

@ -0,0 +1,10 @@
using EasyAbp.EShop.Products.Products;
using Volo.Abp.EventBus.Distributed;
namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderProductInventoryReductionEventHandler : IDistributedEventHandler<ProductInventoryReductionAfterOrderPlacedResultEto>
{
}
}

9
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderRepository.cs

@ -0,0 +1,9 @@
using System;
using Volo.Abp.Domain.Repositories;
namespace EasyAbp.EShop.Orders.Orders
{
public interface IOrderRepository : IRepository<Order, Guid>
{
}
}

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

@ -0,0 +1,96 @@
using System;
using System.Collections.Generic;
using EasyAbp.EShop.Stores.Stores;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace EasyAbp.EShop.Orders.Orders
{
public class Order : FullAuditedAggregateRoot<Guid>, IMultiTenant, IMultiStore
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid CustomerUserId { get; protected set; }
public virtual OrderStatus OrderStatus { get; protected set; }
[NotNull]
public virtual string Currency { get; protected set; }
public virtual decimal ProductTotalPrice { get; protected set; }
public virtual decimal TotalDiscount { get; protected set; }
public virtual decimal TotalPrice { get; protected set; }
public virtual decimal RefundedAmount { get; protected set; }
[CanBeNull]
public virtual string CustomerRemark { get; protected set; }
[CanBeNull]
public virtual string StaffRemark { get; protected set; }
public virtual DateTime? PaidTime { get; protected set; }
public virtual DateTime? CompletionTime { get; protected set; }
public virtual DateTime? CancelledTime { get; protected set; }
public virtual DateTime? ReducedInventoryAfterPlacingTime { get; protected set; }
public virtual DateTime? ReducedInventoryAfterPaymentTime { get; protected set; }
public virtual List<OrderLine> OrderLines { get; protected set; }
protected Order()
{
OrderLines = new List<OrderLine>();
}
public Order(
Guid id,
Guid? tenantId,
Guid storeId,
Guid customerUserId,
string currency,
decimal productTotalPrice,
decimal totalDiscount,
decimal totalPrice,
decimal refundedAmount,
[CanBeNull] string customerRemark
) : base(id)
{
TenantId = tenantId;
StoreId = storeId;
CustomerUserId = customerUserId;
Currency = currency;
ProductTotalPrice = productTotalPrice;
TotalDiscount = totalDiscount;
TotalPrice = totalPrice;
RefundedAmount = refundedAmount;
CustomerRemark = customerRemark;
OrderStatus = OrderStatus.Pending;
OrderLines = new List<OrderLine>();
}
public void SetOrderLines(List<OrderLine> orderLines)
{
OrderLines = orderLines;
}
public void SetReducedInventoryAfterPlacingTime(DateTime? time)
{
ReducedInventoryAfterPlacingTime = time;
}
public void SetReducedInventoryAfterPaymentTime(DateTime? time)
{
ReducedInventoryAfterPaymentTime = time;
}
}
}

20
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderDiscountManager.cs

@ -0,0 +1,20 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Domain.Services;
namespace EasyAbp.EShop.Orders.Orders
{
public class OrderDiscountManager : DomainService, IOrderDiscountManager
{
public async Task<Order> DiscountAsync(Order order, Dictionary<string, object> inputExtraProperties)
{
foreach (var provider in ServiceProvider.GetServices<IOrderDiscountProvider>())
{
await provider.DiscountAsync(order, inputExtraProperties);
}
return order;
}
}
}

33
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/Orders/OrderLine.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs

@ -6,8 +6,6 @@ namespace EasyAbp.EShop.Orders.Orders
{
public class OrderLine : FullAuditedEntity<Guid>
{
public virtual Guid OrderId { get; protected set; }
public virtual Guid ProductId { get; protected set; }
public virtual Guid ProductSkuId { get; protected set; }
@ -35,5 +33,36 @@ namespace EasyAbp.EShop.Orders.Orders
public virtual decimal TotalDiscount { get; protected set; }
public virtual int Quantity { get; protected set; }
protected OrderLine() {}
public OrderLine(
Guid id,
Guid productId,
Guid productSkuId,
DateTime productModificationTime,
DateTime productDetailModificationTime,
[NotNull] string productName,
[CanBeNull] string skuDescription,
[CanBeNull] string mediaResources,
[NotNull] string currency,
decimal unitPrice,
decimal totalPrice,
decimal totalDiscount,
int quantity) : base(id)
{
ProductId = productId;
ProductSkuId = productSkuId;
ProductModificationTime = productModificationTime;
ProductDetailModificationTime = productDetailModificationTime;
ProductName = productName;
SkuDescription = skuDescription;
MediaResources = mediaResources;
Currency = currency;
UnitPrice = unitPrice;
TotalPrice = totalPrice;
TotalDiscount = totalDiscount;
Quantity = quantity;
}
}
}

43
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderProductInventoryReductionEventHandler.cs

@ -0,0 +1,43 @@
using System.Threading.Tasks;
using EasyAbp.EShop.Products.Products;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Timing;
using Volo.Abp.Uow;
namespace EasyAbp.EShop.Orders.Orders
{
public class OrderProductInventoryReductionEventHandler : IOrderProductInventoryReductionEventHandler, ITransientDependency
{
private readonly IClock _clock;
private readonly IOrderRepository _orderRepository;
public OrderProductInventoryReductionEventHandler(
IClock clock,
IOrderRepository orderRepository)
{
_clock = clock;
_orderRepository = orderRepository;
}
[UnitOfWork(true)]
public virtual async Task HandleEventAsync(ProductInventoryReductionAfterOrderPlacedResultEto eventData)
{
var order = await _orderRepository.GetAsync(eventData.OrderId);
if (order.OrderStatus != OrderStatus.Pending || order.ReducedInventoryAfterPlacingTime.HasValue)
{
return;
}
if (!eventData.IsSuccess)
{
// Todo: Cancel order.
return;
}
order.SetReducedInventoryAfterPaymentTime(_clock.Now);
await _orderRepository.UpdateAsync(order, true);
}
}
}

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/OrdersDbProperties.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/OrdersDbProperties.cs

17
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/OrdersDomainAutoMapperProfile.cs

@ -0,0 +1,17 @@
using EasyAbp.EShop.Orders.Orders;
using AutoMapper;
namespace EasyAbp.EShop.Orders
{
public class OrdersDomainAutoMapperProfile : Profile
{
public OrdersDomainAutoMapperProfile()
{
/* 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, OrderEto>();
CreateMap<OrderLine, OrderLineEto>();
}
}
}

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/Settings/OrdersSettingDefinitionProvider.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Settings/OrdersSettingDefinitionProvider.cs

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/Settings/OrdersSettings.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Settings/OrdersSettings.cs

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

@ -1,45 +0,0 @@
using System;
using System.Collections.Generic;
using EasyAbp.EShop.Stores.Stores;
using JetBrains.Annotations;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.MultiTenancy;
namespace EasyAbp.EShop.Orders.Orders
{
public class Order : FullAuditedAggregateRoot<Guid>, IMultiTenant, IMultiStore
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid CustomerUserId { get; protected set; }
public virtual OrderStatus OrderStatus { get; protected set; }
[NotNull]
public virtual string Currency { get; protected set; }
public virtual decimal ProductTotalPrice { get; protected set; }
public virtual decimal TotalDiscount { get; protected set; }
public virtual decimal TotalPrice { get; protected set; }
public virtual decimal RefundedAmount { get; protected set; }
[CanBeNull]
public virtual string CustomerRemark { get; protected set; }
[CanBeNull]
public virtual string StaffRemark { get; protected set; }
public virtual DateTime? PaidTime { get; protected set; }
public virtual DateTime? CompletionTime { get; protected set; }
public virtual DateTime? CancelledTime { get; protected set; }
public virtual List<OrderLine> OrderLines { get; protected set; }
}
}

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
@ -12,4 +12,8 @@
<ProjectReference Include="..\EasyAbp.EShop.Orders.Domain\EasyAbp.EShop.Orders.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="EasyAbp\EShop\Orders" />
</ItemGroup>
</Project>

6
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EntityFrameworkCore/EShopOrdersEntityFrameworkCoreModule.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/EShopOrdersEntityFrameworkCoreModule.cs

@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using EasyAbp.EShop.Orders.Orders;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Modularity;
@ -17,7 +18,8 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore
/* Add custom repositories here. Example:
* options.AddRepository<Question, EfCoreQuestionRepository>();
*/
options.AddRepository<Order, OrderRepository>();
});
}
}
}
}

7
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EntityFrameworkCore/IOrdersDbContext.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/IOrdersDbContext.cs

@ -1,5 +1,7 @@
using Volo.Abp.Data;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using EasyAbp.EShop.Orders.Orders;
namespace EasyAbp.EShop.Orders.EntityFrameworkCore
{
@ -9,5 +11,6 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore
/* Add DbSet for each Aggregate Root here. Example:
* DbSet<Question> Questions { get; }
*/
DbSet<Order> Orders { get; set; }
}
}
}

5
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EntityFrameworkCore/OrdersDbContext.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContext.cs

@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;
using EasyAbp.EShop.Orders.Orders;
namespace EasyAbp.EShop.Orders.EntityFrameworkCore
{
@ -10,6 +11,8 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore
/* Add DbSet for each Aggregate Root here. Example:
* public DbSet<Question> Questions { get; set; }
*/
public DbSet<Order> Orders { get; set; }
public DbSet<OrderLine> OrderLines { get; set; }
public OrdersDbContext(DbContextOptions<OrdersDbContext> options)
: base(options)
@ -24,4 +27,4 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore
builder.ConfigureOrders();
}
}
}
}

20
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs

@ -1,6 +1,8 @@
using System;
using EasyAbp.EShop.Orders.Orders;
using System;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.EntityFrameworkCore.Modeling;
namespace EasyAbp.EShop.Orders.EntityFrameworkCore
{
@ -38,6 +40,20 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore
b.HasIndex(q => q.CreationTime);
});
*/
builder.Entity<Order>(b =>
{
b.ToTable(options.TablePrefix + "Orders", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
});
builder.Entity<OrderLine>(b =>
{
b.ToTable(options.TablePrefix + "OrderLines", options.Schema);
b.ConfigureByConvention();
/* Configure more properties here */
});
}
}
}
}

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EntityFrameworkCore/OrdersModelBuilderConfigurationOptions.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersModelBuilderConfigurationOptions.cs

14
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/Orders/OrderRepository.cs

@ -0,0 +1,14 @@
using System;
using EasyAbp.EShop.Orders.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
namespace EasyAbp.EShop.Orders.Orders
{
public class OrderRepository : EfCoreRepository<OrdersDbContext, Order, Guid>, IOrderRepository
{
public OrderRepository(IDbContextProvider<OrdersDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}
}

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi.Client/EShopOrdersHttpApiClientModule.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi.Client/EasyAbp/EShop/Orders/EShopOrdersHttpApiClientModule.cs

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EShopOrdersHttpApiModule.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp/EShop/Orders/EShopOrdersHttpApiModule.cs

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/OrdersController.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp/EShop/Orders/OrdersController.cs

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
@ -12,4 +12,8 @@
<ProjectReference Include="..\EasyAbp.EShop.Orders.Domain\EasyAbp.EShop.Orders.Domain.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="EasyAbp\EShop\Orders" />
</ItemGroup>
</Project>

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/MongoDB/EShopOrdersMongoDbModule.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp/EShop/Orders/MongoDB/EShopOrdersMongoDbModule.cs

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/MongoDB/IOrdersMongoDbContext.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp/EShop/Orders/MongoDB/IOrdersMongoDbContext.cs

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/MongoDB/OrdersMongoDbContext.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp/EShop/Orders/MongoDB/OrdersMongoDbContext.cs

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/MongoDB/OrdersMongoDbContextExtensions.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp/EShop/Orders/MongoDB/OrdersMongoDbContextExtensions.cs

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/MongoDB/OrdersMongoModelBuilderConfigurationOptions.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp/EShop/Orders/MongoDB/OrdersMongoModelBuilderConfigurationOptions.cs

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

@ -17,6 +17,7 @@
<ItemGroup>
<ProjectReference Include="..\EasyAbp.EShop.Orders.HttpApi\EasyAbp.EShop.Orders.HttpApi.csproj" />
<ProjectReference Include="..\..\..\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Application.Contracts\EasyAbp.EShop.Stores.Application.Contracts.csproj" />
</ItemGroup>
<ItemGroup>

38
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersMenuContributor.cs

@ -1,4 +1,11 @@
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Threading.Tasks;
using EasyAbp.EShop.Orders.Authorization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using EasyAbp.EShop.Orders.Localization;
using EasyAbp.EShop.Stores.Stores;
using Microsoft.AspNetCore.Authorization;
using Volo.Abp.UI.Navigation;
namespace EasyAbp.EShop.Orders.Web
@ -13,11 +20,32 @@ namespace EasyAbp.EShop.Orders.Web
}
}
private Task ConfigureMainMenu(MenuConfigurationContext context)
private async Task ConfigureMainMenu(MenuConfigurationContext context)
{
//Add main menu items.
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<OrdersResource>>(); //Add main menu items.
return Task.CompletedTask;
var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>();
var orderManagementMenuItem = new ApplicationMenuItem("OrderManagement", l["Menu:OrderManagement"]);
if (await authorizationService.IsGrantedAsync(OrdersPermissions.Orders.Manage))
{
var storeAppService = context.ServiceProvider.GetRequiredService<IStoreAppService>();
var defaultStore = (await storeAppService.GetDefaultAsync())?.Id;
orderManagementMenuItem.AddItem(
new ApplicationMenuItem("Order", l["Menu:Order"], "/EShop/Orders/Orders/Order?storeId=" + defaultStore)
);
}
if (!orderManagementMenuItem.Items.IsNullOrEmpty())
{
var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == "EasyAbpEShop",
() => new ApplicationMenuItem("EasyAbpEShop", l["Menu:EasyAbpEShop"]));
eShopMenuItem.Items.Add(orderManagementMenuItem);
}
}
}
}
}

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

@ -1,4 +1,5 @@
using AutoMapper;
using EasyAbp.EShop.Orders.Orders.Dtos;
using AutoMapper;
namespace EasyAbp.EShop.Orders.Web
{
@ -9,6 +10,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<OrderLineDto, CreateOrderLineDto>();
}
}
}
}

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/Orders/Index.cshtml → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Index.cshtml

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/Orders/Index.cshtml.cs → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Index.cshtml.cs

@ -1,4 +1,4 @@
namespace EasyAbp.EShop.Orders.Web.Pages.Orders
namespace EasyAbp.EShop.Orders.Web.Pages.EShop.Orders
{
public class IndexModel : OrdersPageModel
{

54
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml

@ -0,0 +1,54 @@
@page
@using EasyAbp.EShop.Orders.Web.Pages.EShop.Orders.Orders.Order
@using Volo.Abp.AspNetCore.Mvc.UI.Layout
@inherits EasyAbp.EShop.Orders.Web.Pages.OrdersPage
@model IndexModel
@inject IPageLayout PageLayout
@{
PageLayout.Content.Title = L["Order"].Value;
PageLayout.Content.BreadCrumb.Add(L["Menu:Order"].Value);
PageLayout.Content.MenuItemName = "Order";
var cardTitle = @L["Order"].Value;
if (Model.StoreName != null)
{
cardTitle += $" - {Model.StoreName}";
}
if (Model.CustomerUserName != null)
{
cardTitle += $" - {Model.CustomerUserName}";
}
}
@section scripts
{
<abp-script src="/Pages/EShop/Orders/Orders/Order/index.js" />
}
@section styles
{
<abp-style src="/Pages/EShop/Orders/Orders/Order/index.css"/>
}
<abp-card>
<abp-card-header>
<abp-row>
<abp-column size-md="_6">
<abp-card-title>@cardTitle</abp-card-title>
</abp-column>
</abp-row>
</abp-card-header>
<abp-card-body>
<abp-table striped-rows="true" id="OrderTable" class="nowrap">
<thead>
<tr>
<th>@L["Actions"]</th>
<th>@L["OrderCustomerUserId"]</th>
<th>@L["OrderOrderStatus"]</th>
<th>@L["OrderTotalPrice"]</th>
</tr>
</thead>
</abp-table>
</abp-card-body>
</abp-card>

40
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml.cs

@ -0,0 +1,40 @@
using System;
using System.Threading.Tasks;
using EasyAbp.EShop.Stores.Stores;
using Microsoft.AspNetCore.Mvc;
namespace EasyAbp.EShop.Orders.Web.Pages.EShop.Orders.Orders.Order
{
public class IndexModel : OrdersPageModel
{
private readonly IStoreAppService _storeAppService;
[BindProperty(SupportsGet = true)]
public Guid? StoreId { get; set; }
[BindProperty(SupportsGet = true)]
public Guid? CustomerUserId { get; set; }
public string StoreName { get; set; }
public string CustomerUserName { get; set; }
public IndexModel(IStoreAppService storeAppService)
{
_storeAppService = storeAppService;
}
public virtual async Task OnGetAsync()
{
if (StoreId.HasValue)
{
StoreName = (await _storeAppService.GetAsync(StoreId.Value)).Name;
}
if (CustomerUserId.HasValue)
{
// Todo: get username
}
}
}
}

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/index.css

48
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/index.js

@ -0,0 +1,48 @@
$(function () {
var l = abp.localization.getResource('Orders');
var service = easyAbp.eShop.orders.orders.order;
var dataTable = $('#OrderTable').DataTable(abp.libs.datatables.normalizeConfiguration({
processing: true,
serverSide: true,
paging: true,
searching: false,
autoWidth: false,
scrollCollapse: true,
order: [[1, "asc"]],
ajax: abp.libs.datatables.createAjax(service.getList),
columnDefs: [
{
rowAction: {
items:
[
{
text: l('Detail'),
action: function (data) {
editModal.open({ id: data.record.id });
}
}
]
}
},
{ data: "customerUserId" },
{ data: "orderStatus" },
{ data: "totalPrice" },
]
}));
createModal.onResult(function () {
dataTable.ajax.reload();
});
editModal.onResult(function () {
dataTable.ajax.reload();
});
$('#NewOrderButton').click(function (e) {
e.preventDefault();
createModal.open();
});
});

0
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/Orders/_ViewImports.cshtml → modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/_ViewImports.cshtml

2
modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/OrdersPage.cs

@ -6,7 +6,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.RazorPages;
namespace EasyAbp.EShop.Orders.Web.Pages
{
/* Inherit your UI Pages from this class. To do that, add this line to your Pages (.cshtml files under the Page folder):
* @inherits EasyAbp.EShop.Orders.Web.Pages.OrdersPage
* @inherits EasyAbp.EShop.Orders.Web.Pages.EShop.Orders.OrdersPage
*/
public abstract class OrdersPage : AbpPage
{

2
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/EasyAbp.EShop.Orders.Application.Tests.csproj

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

26
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Application.Tests/Orders/OrderAppServiceTests.cs

@ -0,0 +1,26 @@
using Shouldly;
using System.Threading.Tasks;
using Xunit;
namespace EasyAbp.EShop.Orders.Orders
{
public class OrderAppServiceTests : OrdersApplicationTestBase
{
private readonly IOrderAppService _orderAppService;
public OrderAppServiceTests()
{
_orderAppService = GetRequiredService<IOrderAppService>();
}
[Fact]
public async Task Test1()
{
// Arrange
// Act
// Assert
}
}
}

2
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/EasyAbp.EShop.Orders.Domain.Tests.csproj

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

23
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.Domain.Tests/Orders/OrderDomainTests.cs

@ -0,0 +1,23 @@
using System.Threading.Tasks;
using Shouldly;
using Xunit;
namespace EasyAbp.EShop.Orders.Orders
{
public class OrderDomainTests : OrdersDomainTestBase
{
public OrderDomainTests()
{
}
[Fact]
public async Task Test1()
{
// Arrange
// Assert
// Assert
}
}
}

2
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests.csproj

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

31
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.EntityFrameworkCore.Tests/EntityFrameworkCore/Orders/OrderRepositoryTests.cs

@ -0,0 +1,31 @@
using System;
using System.Threading.Tasks;
using EasyAbp.EShop.Orders.Orders;
using Volo.Abp.Domain.Repositories;
using Xunit;
namespace EasyAbp.EShop.Orders.EntityFrameworkCore.Orders
{
public class OrderRepositoryTests : OrdersEntityFrameworkCoreTestBase
{
private readonly IRepository<Order, Guid> _orderRepository;
public OrderRepositoryTests()
{
_orderRepository = GetRequiredService<IRepository<Order, Guid>>();
}
[Fact]
public async Task Test1()
{
await WithUnitOfWorkAsync(async () =>
{
// Arrange
// Act
//Assert
});
}
}
}

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

@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

2
modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.MongoDB.Tests/EasyAbp.EShop.Orders.MongoDB.Tests.csproj

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

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

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>EasyAbp.EShop.Orders</RootNamespace>
<RootNamespace />
</PropertyGroup>
<ItemGroup>

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

@ -217,6 +217,8 @@ namespace EasyAbp.EShop.Products.Products
{
await CheckStoreIsProductOwnerAsync(id, storeId);
}
// Todo: get real inventory.
dto.CategoryIds = (await _productCategoryRepository.GetListByProductIdAsync(dto.Id))
.Select(x => x.CategoryId).ToList();
@ -250,6 +252,8 @@ namespace EasyAbp.EShop.Products.Products
var entities = await AsyncQueryableExecuter.ToListAsync(query);
// Todo: get real inventory.
return new PagedResultDto<ProductDto>(
totalCount,
entities.Select(MapToGetListOutputDto).ToList()

12
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductInventoryReductionAfterOrderPlacedResultEto.cs

@ -0,0 +1,12 @@
using System;
namespace EasyAbp.EShop.Products.Products
{
[Serializable]
public class ProductInventoryReductionAfterOrderPlacedResultEto
{
public Guid OrderId { get; set; }
public bool IsSuccess { get; set; }
}
}

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

Loading…
Cancel
Save