upd: 修改订单与家政人员接口
This commit is contained in:
@ -1025,3 +1025,141 @@ System.InvalidOperationException: An exception has been raised that is likely du
|
||||
--- End of stack trace from previous location ---
|
||||
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
|
||||
2025-10-03 18:04:14.530 +08:00 [INF] Request finished HTTP/2 GET https://localhost:44354/favicon.ico - 500 null text/plain; charset=utf-8 2509.1194ms
|
||||
2025-10-26 10:37:00.036 +08:00 [INF] Starting KonSoft.Admin.HttpApi.Host.
|
||||
2025-10-26 10:39:17.756 +08:00 [INF] Starting KonSoft.Admin.HttpApi.Host.
|
||||
2025-10-26 10:39:21.029 +08:00 [INF] Loaded ABP modules:
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Admin.AdminHttpApiHostModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Admin.AdminHttpApiModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Admin.AdminApplicationContractsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Admin.AdminDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Validation.AbpValidationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Validation.AbpValidationAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Localization.AbpLocalizationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Settings.AbpSettingsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Localization.AbpLocalizationAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Security.AbpSecurityModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Data.AbpDataModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.ObjectExtending.AbpObjectExtendingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Uow.AbpUnitOfWorkModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.EventBus.Abstractions.AbpEventBusAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Threading.AbpThreadingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.FeatureManagement.AbpFeatureManagementDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Json.SystemTextJson.AbpJsonSystemTextJsonModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Json.AbpJsonAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Timing.AbpTimingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Identity.AbpIdentityDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Users.AbpUsersDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Features.AbpFeaturesModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.MultiTenancy.AbpMultiTenancyModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.MultiTenancy.AbpMultiTenancyAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.OpenIddict.AbpOpenIddictDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.TenantManagement.AbpTenantManagementDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Account.AbpAccountApplicationContractsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Identity.AbpIdentityApplicationContractsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Users.AbpUsersAbstractionModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.EventBus.AbpEventBusModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Json.AbpJsonModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Guids.AbpGuidsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.BackgroundWorkers.AbpBackgroundWorkersModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.DistributedLocking.AbpDistributedLockingAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Authorization.AbpAuthorizationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementApplicationContractsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Application.AbpDddApplicationContractsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Auditing.AbpAuditingContractsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.FeatureManagement.AbpFeatureManagementApplicationContractsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementApplicationContractsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.TenantManagement.AbpTenantManagementApplicationContractsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Account.AbpAccountHttpApiModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Identity.AbpIdentityHttpApiModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.AbpAspNetCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Auditing.AbpAuditingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Http.AbpHttpModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Http.AbpHttpAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Minify.AbpMinifyModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.ExceptionHandling.AbpExceptionHandlingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.AbpAspNetCoreAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.ApiVersioning.AbpApiVersioningAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcContractsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.UI.Navigation.AbpUiNavigationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.UI.AbpUiModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.GlobalFeatures.AbpGlobalFeaturesModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Application.AbpDddApplicationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Domain.AbpDddDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.ObjectMapping.AbpObjectMappingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Specifications.AbpSpecificationsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Caching.AbpCachingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Serialization.AbpSerializationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Domain.AbpDddDomainSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.PermissionManagement.HttpApi.AbpPermissionManagementHttpApiModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.TenantManagement.AbpTenantManagementHttpApiModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.FeatureManagement.AbpFeatureManagementHttpApiModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementHttpApiModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Admin.AdminApplicationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Admin.AdminDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AuditLogging.AbpAuditLoggingDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.BackgroundJobs.AbpBackgroundJobsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.BackgroundJobs.AbpBackgroundJobsAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AutoMapper.AbpAutoMapperModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.FeatureManagement.AbpFeatureManagementDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Identity.AbpIdentityDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Users.AbpUsersDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.OpenIddict.AbpOpenIddictDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.PermissionManagement.OpenIddict.AbpPermissionManagementDomainOpenIddictModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.PermissionManagement.Identity.AbpPermissionManagementDomainIdentityModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.TenantManagement.AbpTenantManagementDomainModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Emailing.AbpEmailingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.TextTemplating.AbpTextTemplatingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.TextTemplating.Scriban.AbpTextTemplatingScribanModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.TextTemplating.AbpTextTemplatingCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Account.AbpAccountApplicationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Identity.AbpIdentityApplicationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.PermissionManagement.AbpPermissionManagementApplicationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.TenantManagement.AbpTenantManagementApplicationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.FeatureManagement.AbpFeatureManagementApplicationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.SettingManagement.AbpSettingManagementApplicationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Admin.EntityFrameworkCore.AdminEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Users.EntityFrameworkCore.AbpUsersEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.OpenIddict.EntityFrameworkCore.AbpOpenIddictEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.PermissionManagement.EntityFrameworkCore.AbpPermissionManagementEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.SettingManagement.EntityFrameworkCore.AbpSettingManagementEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.EntityFrameworkCore.PostgreSql.AbpEntityFrameworkCorePostgreSqlModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.BackgroundJobs.EntityFrameworkCore.AbpBackgroundJobsEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.TenantManagement.EntityFrameworkCore.AbpTenantManagementEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.FeatureManagement.EntityFrameworkCore.AbpFeatureManagementEntityFrameworkCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Shared.Hosting.Microservices.KonSoftSharedHostingMicroservicesModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Shared.Hosting.AspNetCore.KonSoftSharedHostingAspNetCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Shared.Localization.KonSoftSharedLocalizationModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Shared.Hosting.KonSoftSharedHostingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Autofac.AbpAutofacModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Castle.AbpCastleCoreModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Serilog.AbpAspNetCoreSerilogModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Swashbuckle.AbpSwashbuckleModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.BackgroundJobs.RabbitMQ.AbpBackgroundJobsRabbitMqModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.RabbitMQ.AbpRabbitMqModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Authentication.JwtBearer.AbpAspNetCoreAuthenticationJwtBearerModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.EventBus.RabbitMq.AbpEventBusRabbitMqModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.Caching.StackExchangeRedis.AbpCachingStackExchangeRedisModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.DistributedLocking.AbpDistributedLockingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.AbpAspNetCoreMvcUiMultiTenancyModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.AbpAspNetCoreMvcUiThemeSharedModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.AbpAspNetCoreMvcUiBootstrapModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.AbpAspNetCoreMvcUiModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Packages.AbpAspNetCoreMvcUiPackagesModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Bundling.AbpAspNetCoreMvcUiBundlingAbstractionsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Widgets.AbpAspNetCoreMvcUiWidgetsModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.Mvc.UI.Bundling.AbpAspNetCoreMvcUiBundlingModule
|
||||
2025-10-26 10:39:21.030 +08:00 [INF] - Volo.Abp.AspNetCore.MultiTenancy.AbpAspNetCoreMultiTenancyModule
|
||||
2025-10-26 10:39:21.367 +08:00 [DBG] Started background worker: Volo.Abp.OpenIddict.Tokens.TokenCleanupBackgroundWorker
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
using KonSoft.Admin.Enums;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
|
||||
namespace KonSoft.Admin.Dtos
|
||||
{
|
||||
public class OrderPagedResultRequestDto : PagedResultRequestDto
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单状态
|
||||
/// </summary>
|
||||
public OrderStatus Status { get; set; } = OrderStatus.Created;
|
||||
|
||||
/// <summary>
|
||||
/// 服务时间
|
||||
/// </summary>
|
||||
public DateTime? ServiceTime { get; set; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KonSoft.Admin.Dtos
|
||||
{
|
||||
public class WorkerRegisterDto
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
using KonSoft.Admin.Dtos;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp.Application.Services;
|
||||
|
||||
namespace KonSoft.Admin.IApplicationServices;
|
||||
|
||||
public interface IHouseholdWorkerAppService : IApplicationService
|
||||
{
|
||||
/// <summary>
|
||||
/// 家政人员注册
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task RegisterAsync(WorkerRegisterDto input);
|
||||
|
||||
/// <summary>
|
||||
/// 家政人员接单
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
Task AcceptOrderAsync(Guid orderId);
|
||||
|
||||
/// <summary>
|
||||
/// 家政人员退单
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
Task RejectOrderAsync(Guid orderId);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 已到达(开始服务)
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
Task StartServiceAsync(Guid orderId);
|
||||
|
||||
/// <summary>
|
||||
/// 完成服务
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
Task CompleteServiceAsync(Guid orderId);
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前分配给家政人员的订单列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<OrderDto>> GetAssignedOrdersAsync(OrderPagedResultRequestDto requestDto);
|
||||
|
||||
/// <summary>
|
||||
/// 获取待接单订单
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<OrderDto>> GetCreatedOrdersAsync(OrderPagedResultRequestDto requestDto);
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -15,14 +15,37 @@ public interface IOrderAppService : IApplicationService
|
||||
/// <returns></returns>
|
||||
Task<OrderDto> CreateAsync(CreateOrderDto input);
|
||||
|
||||
Task<OrderDto> PayAsync(Guid orderId, PayOrderDto input);
|
||||
Task AssignAsync(Guid orderId, Guid workerId);
|
||||
Task StartServiceAsync(Guid orderId);
|
||||
Task CompleteServiceAsync(Guid orderId);
|
||||
Task ConfirmAsync(Guid orderId);
|
||||
/// <summary>
|
||||
/// 支付上门费
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task PayServiceCallFeeAsync(Guid orderId, PayOrderDto input);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 支付
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task PayAsync(Guid orderId, PayOrderDto input);
|
||||
|
||||
/// <summary>
|
||||
/// 取消订单
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <param name="reason"></param>
|
||||
/// <returns></returns>
|
||||
Task CancelAsync(Guid orderId, string reason);
|
||||
Task DeleteAsync(params Guid[] ids);
|
||||
/// <summary>
|
||||
/// 修改订单
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task EditAsync(OrderDto input);
|
||||
Task<OrderDto> GetAsync(Guid id);
|
||||
Task<PagedResultDto<OrderDto>> GetListAsync(PagedResultRequestDto input);
|
||||
Task<PagedResultDto<OrderDto>> GetListAsync(OrderPagedResultRequestDto input);
|
||||
}
|
||||
@ -1,7 +0,0 @@
|
||||
using Volo.Abp.Application.Services;
|
||||
|
||||
namespace KonSoft.Admin.IApplicationServices;
|
||||
|
||||
public interface IWorkerAppService : IApplicationService
|
||||
{
|
||||
}
|
||||
@ -0,0 +1,126 @@
|
||||
using KonSoft.Admin.Dtos;
|
||||
using KonSoft.Admin.Entities;
|
||||
using KonSoft.Admin.IApplicationServices;
|
||||
using KonSoft.Admin.IRepositories;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.Application.Services;
|
||||
using Volo.Abp.Domain.Repositories;
|
||||
using Volo.Abp.ObjectMapping;
|
||||
|
||||
namespace KonSoft.Admin.ApplicationServices
|
||||
{
|
||||
public class HouseholdWorkerAppService : ApplicationService, IHouseholdWorkerAppService
|
||||
{
|
||||
public IOrderRepository _orderRepository { get; set; }
|
||||
|
||||
public HouseholdWorkerAppService(IOrderRepository orderRepository)
|
||||
{
|
||||
_orderRepository = orderRepository;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 家政人员接单
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task AcceptOrderAsync(Guid orderId)
|
||||
{
|
||||
var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId);
|
||||
if (order == null) throw new BusinessException("未找到订单");
|
||||
|
||||
order.AssignWorker(CurrentUser.Id!.Value);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取已接单任务
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task<List<OrderDto>> GetAssignedOrdersAsync(OrderPagedResultRequestDto requestDto)
|
||||
{
|
||||
//TODO 默认根据角色筛选对应订单,整合到一个接口中
|
||||
var query = await _orderRepository.GetQueryableAsync();
|
||||
var orders = query.Where(o => o.HouseholdWorkerId == CurrentUser.Id)
|
||||
.PageBy(requestDto).ToList(); ;
|
||||
|
||||
return ObjectMapper.Map<List<Order>, List<OrderDto>>(orders);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取待接单任务
|
||||
/// </summary>
|
||||
/// <param name="requestDto"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<List<OrderDto>> GetCreatedOrdersAsync(OrderPagedResultRequestDto requestDto)
|
||||
{
|
||||
//TODO 默认根据角色筛选对应订单,整合到一个接口中
|
||||
var query = await _orderRepository.GetQueryableAsync();
|
||||
var orders = query.Where(o => o.Status == Enums.OrderStatus.Created)
|
||||
.PageBy(requestDto).ToList(); ;
|
||||
|
||||
return ObjectMapper.Map<List<Order>, List<OrderDto>>(orders);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 家政人员注册
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public Task RegisterAsync(WorkerRegisterDto input)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
/// <summary>
|
||||
/// 退单
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
/// <exasception cref="NotImplementedException"></exception>
|
||||
public async Task RejectOrderAsync(Guid orderId)
|
||||
{
|
||||
var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId);
|
||||
if (order == null) throw new BusinessException("未找到订单");
|
||||
|
||||
order.RejectOrder(CurrentUser.Id!.Value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 开始服务
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task StartServiceAsync(Guid orderId)
|
||||
{
|
||||
var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId);
|
||||
if (order == null) throw new BusinessException("未找到订单");
|
||||
|
||||
order.StartService();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 服务完成
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task CompleteServiceAsync(Guid orderId)
|
||||
{
|
||||
var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId);
|
||||
if (order == null) throw new BusinessException("未找到订单");
|
||||
|
||||
order.CompleteService();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -18,18 +18,6 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ
|
||||
{
|
||||
private readonly IOrderRepository _orderRepository = orderRepository;
|
||||
|
||||
/// <summary>
|
||||
/// 分配师傅
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <param name="workerId"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task AssignAsync(Guid orderId, Guid workerId)
|
||||
{
|
||||
var order = await _orderRepository.GetAsync(o => o.Id == orderId);
|
||||
order.AssignWorker(workerId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取消订单
|
||||
@ -44,29 +32,6 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ
|
||||
order.Cancel(reason);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 完成订单
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task CompleteServiceAsync(Guid orderId)
|
||||
{
|
||||
var order = await _orderRepository.GetAsync(o => o.Id == orderId);
|
||||
order.CompleteService();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 确认订单
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task ConfirmAsync(Guid orderId)
|
||||
{
|
||||
var order = await _orderRepository.GetAsync(o => o.Id == orderId);
|
||||
order.ConfirmCompletion();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建订单
|
||||
@ -97,10 +62,9 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改订单信息
|
||||
/// 修改订单信息
|
||||
/// </summary>
|
||||
/// <param name="input">订单DTO对象</param>
|
||||
/// s
|
||||
public async Task EditAsync(OrderDto input)
|
||||
{
|
||||
// 根据ID查询订单,如果不存在则抛出异常【修改前端必然看到了,数据若查不到提示自定义异常信息】
|
||||
@ -111,35 +75,37 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ
|
||||
ObjectMapper.Map(input, order);
|
||||
|
||||
// 更新订单
|
||||
await _orderRepository.UpdateAsync(order);
|
||||
//await _orderRepository.UpdateAsync(order);
|
||||
}
|
||||
|
||||
public async Task PayServiceCallFeeAsync(Guid orderId, PayOrderDto input)
|
||||
{
|
||||
var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId);
|
||||
if (order == null) throw new BusinessException("未找到订单");
|
||||
|
||||
order.PayServiceCallFee();
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 支付
|
||||
/// 支付
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public Task<OrderDto> PayAsync(Guid orderId, PayOrderDto input)
|
||||
public async Task PayAsync(Guid orderId, PayOrderDto input)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId);
|
||||
if (order == null) throw new BusinessException("未找到订单");
|
||||
|
||||
order.Pay();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 开始订单
|
||||
/// </summary>
|
||||
/// <param name="orderId"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public async Task StartServiceAsync(Guid orderId)
|
||||
{
|
||||
var order = await _orderRepository.GetAsync(o => o.Id == orderId);
|
||||
order.StartService();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据订单ID获取单个订单
|
||||
/// 根据订单ID获取单个订单
|
||||
/// </summary>
|
||||
public async Task<OrderDto> GetAsync(Guid id)
|
||||
{
|
||||
@ -151,12 +117,13 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有订单列表
|
||||
/// 获取订单列表
|
||||
/// </summary>
|
||||
public async Task<PagedResultDto<OrderDto>> GetListAsync(PagedResultRequestDto input)
|
||||
public async Task<PagedResultDto<OrderDto>> GetListAsync(OrderPagedResultRequestDto input)
|
||||
{
|
||||
// 查询所有订单
|
||||
var orders = await _orderRepository.GetPagedListAsync(input.SkipCount, input.MaxResultCount, "Id");
|
||||
//TODO 默认根据角色筛选对应订单,整合到一个接口中
|
||||
var query = await _orderRepository.GetQueryableAsync();
|
||||
var orders = query.PageBy(input).OrderBy(o => o.Id).ToList();
|
||||
|
||||
var totalCount = await _orderRepository.CountAsync();
|
||||
|
||||
@ -164,4 +131,8 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ
|
||||
|
||||
return new PagedResultDto<OrderDto>(totalCount, orderDtos);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -2,13 +2,13 @@
|
||||
|
||||
public enum OrderStatus
|
||||
{
|
||||
PendingPayment, // 待支付
|
||||
PaidWaitingAssign, // 已支付待派单
|
||||
AssignedWaitingService, // 已派单待服务
|
||||
InService, // 服务中
|
||||
WaitingConfirm, // 待用户确认
|
||||
Completed, // 已完成
|
||||
Canceled, // 已取消
|
||||
Refunding, // 退款中
|
||||
Refunded // 已退款
|
||||
Created = 1, //用户创建订单
|
||||
Assigned, //家政人员已接单
|
||||
ServiceCallPaymentComplete, //上门费支付完成
|
||||
ServiceStarted, //服务开始
|
||||
ServiceCompleted, //服务已完成
|
||||
PaymentPending, //用户支付订单
|
||||
PaymentComplete, //用户支付完成
|
||||
Cancelled, //订单取消
|
||||
Refunded, //订单退款
|
||||
}
|
||||
@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using KonSoft.Admin.Enums;
|
||||
using KonSoft.Admin.Enums;
|
||||
using KonSoft.Admin.ValueObjects;
|
||||
using System;
|
||||
using Volo.Abp;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
using Volo.Abp.Identity;
|
||||
|
||||
namespace KonSoft.Admin.Entities;
|
||||
|
||||
@ -21,18 +23,20 @@ public class Order : FullAuditedAggregateRoot<Guid>
|
||||
Amount = amount;
|
||||
Address = address;
|
||||
Remark = remark;
|
||||
Status = OrderStatus.PendingPayment;
|
||||
Status = OrderStatus.Created;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户ID
|
||||
/// </summary>
|
||||
public Guid CustomerId { get; private set; }
|
||||
public virtual IdentityUser Customer { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 家政人员ID
|
||||
/// </summary>
|
||||
public Guid? WorkerId { get; private set; }
|
||||
public Guid? HouseholdWorkerId { get; private set; }
|
||||
public IdentityUser? HouseholdWorker { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 服务项目ID
|
||||
@ -80,79 +84,105 @@ public class Order : FullAuditedAggregateRoot<Guid>
|
||||
public string? CancelReason { get; private set; }
|
||||
|
||||
|
||||
public void MarkPaid(decimal paidAmount, string method)
|
||||
{
|
||||
if (Status != OrderStatus.PendingPayment)
|
||||
{
|
||||
throw new InvalidOperationException("订单不在待付款状态");
|
||||
}
|
||||
//public void MarkPaid(decimal paidAmount, string method)
|
||||
//{
|
||||
// if (Status != OrderStatus.PendingPayment)
|
||||
// {
|
||||
// throw new InvalidOperationException("订单不在待付款状态");
|
||||
// }
|
||||
|
||||
|
||||
PaidAmount = paidAmount;
|
||||
PaymentMethod = method;
|
||||
Status = OrderStatus.PaidWaitingAssign;
|
||||
}
|
||||
// PaidAmount = paidAmount;
|
||||
// PaymentMethod = method;
|
||||
// Status = OrderStatus.PaidWaitingAssign;
|
||||
//}
|
||||
|
||||
|
||||
public void AssignWorker(Guid workerId)
|
||||
{
|
||||
if (Status != OrderStatus.PaidWaitingAssign)
|
||||
if (Status != OrderStatus.Created)
|
||||
{
|
||||
throw new InvalidOperationException("订单无法分配师傅");
|
||||
throw new BusinessException("订单无法分配师傅");
|
||||
}
|
||||
|
||||
|
||||
WorkerId = workerId;
|
||||
Status = OrderStatus.AssignedWaitingService;
|
||||
HouseholdWorkerId = workerId;
|
||||
Status = OrderStatus.Assigned;
|
||||
}
|
||||
|
||||
public void RejectOrder(Guid workerId)
|
||||
{
|
||||
if (Status != OrderStatus.Created)
|
||||
{
|
||||
throw new BusinessException("订单无法分配师傅");
|
||||
}
|
||||
if (HouseholdWorkerId != workerId)
|
||||
{
|
||||
throw new BusinessException("订单不属于你,无法退单");
|
||||
}
|
||||
|
||||
|
||||
Status = OrderStatus.Created;
|
||||
}
|
||||
|
||||
|
||||
public void PayServiceCallFee()
|
||||
{
|
||||
if (Status != OrderStatus.Assigned)
|
||||
{
|
||||
throw new BusinessException("订单无法支付上门费");
|
||||
}
|
||||
|
||||
|
||||
Status = OrderStatus.ServiceCallPaymentComplete;
|
||||
}
|
||||
|
||||
|
||||
public void Pay()
|
||||
{
|
||||
if (Status != OrderStatus.ServiceCompleted)
|
||||
{
|
||||
throw new BusinessException("订单服务未完成无法支付");
|
||||
}
|
||||
|
||||
Status = OrderStatus.PaymentPending;
|
||||
}
|
||||
|
||||
|
||||
public void StartService()
|
||||
{
|
||||
if (Status != OrderStatus.AssignedWaitingService)
|
||||
if (Status != OrderStatus.ServiceCallPaymentComplete)
|
||||
{
|
||||
throw new InvalidOperationException("订单无法开始");
|
||||
throw new BusinessException("订单未支付上门费无法开始");
|
||||
}
|
||||
|
||||
|
||||
Status = OrderStatus.InService;
|
||||
Status = OrderStatus.ServiceStarted;
|
||||
}
|
||||
|
||||
|
||||
public void CompleteService()
|
||||
{
|
||||
if (Status != OrderStatus.InService)
|
||||
if (Status != OrderStatus.ServiceStarted)
|
||||
{
|
||||
throw new InvalidOperationException("订单未开始服务,无法完成");
|
||||
throw new BusinessException("订单未开始,无法完成");
|
||||
}
|
||||
|
||||
|
||||
Status = OrderStatus.WaitingConfirm;
|
||||
Status = OrderStatus.ServiceCompleted;
|
||||
}
|
||||
|
||||
|
||||
public void ConfirmCompletion()
|
||||
{
|
||||
if (Status != OrderStatus.WaitingConfirm)
|
||||
{
|
||||
throw new InvalidOperationException("订单无法确认");
|
||||
}
|
||||
|
||||
|
||||
Status = OrderStatus.Completed;
|
||||
}
|
||||
|
||||
|
||||
public void Cancel(string reason)
|
||||
{
|
||||
// 若已完成或退款中则不可取消
|
||||
if (Status == OrderStatus.Completed || Status == OrderStatus.Refunding || Status == OrderStatus.Refunded)
|
||||
if (Status == OrderStatus.ServiceCompleted || Status == OrderStatus.Cancelled || Status == OrderStatus.Refunded)
|
||||
{
|
||||
throw new InvalidOperationException("订单无法被取消");
|
||||
throw new BusinessException("订单无法被取消");
|
||||
}
|
||||
|
||||
|
||||
CancelReason = reason;
|
||||
Status = OrderStatus.Canceled;
|
||||
Status = OrderStatus.Cancelled;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user