13 changed files with 16701 additions and 13 deletions
-
19src/Shentun.WebPeis.Application.Contracts/AppointScheduleExcludeCustomerOrgs/CreateAppointScheduleExcludeCustomerOrgInputDto.cs
-
13src/Shentun.WebPeis.Application.Contracts/AppointSchedules/GetAppointScheduleDateListInputDto.cs
-
66src/Shentun.WebPeis.Application/AppointScheduleExcludeCustomerOrgs/AppointScheduleExcludeCustomerOrgAppService.cs
-
79src/Shentun.WebPeis.Application/AppointSchedules/AppointScheduleAppService.cs
-
39src/Shentun.WebPeis.Domain/Models/AppointScheduleTemplateExcludeCustomerOrg.cs
-
26src/Shentun.WebPeis.EntityFrameworkCore/Configures/AppointScheduleExcludeCustomerOrgConfigure.cs
-
2src/Shentun.WebPeis.EntityFrameworkCore/EntityFrameworkCore/WebPeisDbContext.cs
-
8161src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241121015657_add_appoint_schedule_template_exclude_customer_org.Designer.cs
-
40src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241121015657_add_appoint_schedule_template_exclude_customer_org.cs
-
8161src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241121042932_update_appoint_schedule_exclude_customer_org.Designer.cs
-
61src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241121042932_update_appoint_schedule_exclude_customer_org.cs
-
45src/Shentun.WebPeis.EntityFrameworkCore/Migrations/WebPeisDbContextModelSnapshot.cs
-
2test/Shentun.WebPeis.Application.Tests/AppointScheduleAppServiceTest.cs
@ -0,0 +1,19 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.WebPeis.AppointScheduleExcludeCustomerOrgs |
|||
{ |
|||
public class CreateAppointScheduleExcludeCustomerOrgInputDto |
|||
{ |
|||
/// <summary>
|
|||
/// 预约计划Id
|
|||
/// </summary>
|
|||
public Guid AppointScheduleId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 单位ID
|
|||
/// </summary>
|
|||
public List<Guid> CustomerOrgIds { get; set; } = new List<Guid>(); |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.WebPeis.AppointSchedules |
|||
{ |
|||
public class GetAppointScheduleDateListInputDto |
|||
{ |
|||
public Guid? MedicalCenterId { get; set; } |
|||
|
|||
public Guid? CustomerOrgId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,66 @@ |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Shentun.WebPeis.Models; |
|||
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; |
|||
|
|||
namespace Shentun.WebPeis.AppointScheduleExcludeCustomerOrgs |
|||
{ |
|||
/// <summary>
|
|||
/// 设置预约日期的禁止单位
|
|||
/// </summary>
|
|||
[ApiExplorerSettings(GroupName = "Work")] |
|||
[Authorize] |
|||
public class AppointScheduleExcludeCustomerOrgAppService : ApplicationService |
|||
{ |
|||
private readonly IRepository<AppointScheduleExcludeCustomerOrg> _appointScheduleExcludeCustomerOrgRepository; |
|||
public AppointScheduleExcludeCustomerOrgAppService( |
|||
IRepository<AppointScheduleExcludeCustomerOrg> appointScheduleExcludeCustomerOrgRepository |
|||
) |
|||
{ |
|||
_appointScheduleExcludeCustomerOrgRepository = appointScheduleExcludeCustomerOrgRepository; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 添加、修改、删除
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/AppointScheduleExcludeCustomerOrg/Create")] |
|||
public async Task CreateAppointScheduleExcludeCustomerOrgAsync(CreateAppointScheduleExcludeCustomerOrgInputDto input) |
|||
{ |
|||
if (input.AppointScheduleId == Guid.Empty) |
|||
{ |
|||
throw new UserFriendlyException("预约计划ID不能为空"); |
|||
} |
|||
//删除
|
|||
await _appointScheduleExcludeCustomerOrgRepository.DeleteAsync(d => d.AppointScheduleId == input.AppointScheduleId); |
|||
|
|||
if (input.CustomerOrgIds.Any()) |
|||
{ |
|||
List<AppointScheduleExcludeCustomerOrg> appointScheduleExcludeCustomerOrgs = new List<AppointScheduleExcludeCustomerOrg>(); |
|||
|
|||
foreach (var customerOrgId in input.CustomerOrgIds) |
|||
{ |
|||
if (appointScheduleExcludeCustomerOrgs.FirstOrDefault(f => f.CustomerOrgId == customerOrgId) == null) |
|||
{ |
|||
appointScheduleExcludeCustomerOrgs.Add(new AppointScheduleExcludeCustomerOrg |
|||
{ |
|||
AppointScheduleExcludeCustomerOrgId = GuidGenerator.Create(), |
|||
CustomerOrgId = customerOrgId, |
|||
AppointScheduleId = input.AppointScheduleId |
|||
}); |
|||
} |
|||
} |
|||
|
|||
await _appointScheduleExcludeCustomerOrgRepository.InsertManyAsync(appointScheduleExcludeCustomerOrgs); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Entities.Auditing; |
|||
using Volo.Abp.Domain.Entities; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Shentun.WebPeis.Models |
|||
{ |
|||
/// <summary>
|
|||
/// 预约计划模板排除的单位
|
|||
/// </summary>
|
|||
public class AppointScheduleExcludeCustomerOrg : AuditedEntity, IHasConcurrencyStamp |
|||
{ |
|||
/// <summary>
|
|||
/// 主键
|
|||
/// </summary>
|
|||
public Guid AppointScheduleExcludeCustomerOrgId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 预约计划Id
|
|||
/// </summary>
|
|||
public Guid AppointScheduleId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 单位ID
|
|||
/// </summary>
|
|||
public Guid CustomerOrgId { get; set; } |
|||
|
|||
[StringLength(40)] |
|||
public string ConcurrencyStamp { get; set; } |
|||
public override object?[] GetKeys() |
|||
{ |
|||
return [AppointScheduleExcludeCustomerOrgId]; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
using Microsoft.EntityFrameworkCore.Metadata.Builders; |
|||
using Microsoft.EntityFrameworkCore; |
|||
using Shentun.WebPeis.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Shentun.WebPeis.Configures |
|||
{ |
|||
internal class AppointScheduleExcludeCustomerOrgConfigure : IEntityTypeConfiguration<AppointScheduleExcludeCustomerOrg> |
|||
{ |
|||
public void Configure(EntityTypeBuilder<AppointScheduleExcludeCustomerOrg> entity) |
|||
{ |
|||
entity.HasKey(e => e.AppointScheduleExcludeCustomerOrgId).HasName("appoint_schedule_exclude_customer_org_pkey"); |
|||
|
|||
entity.ToTable("appoint_schedule_exclude_customer_org"); |
|||
|
|||
|
|||
entity.Property(e => e.AppointScheduleId).HasComment("预约计划Id"); |
|||
|
|||
entity.Property(e => e.CustomerOrgId).HasComment("单位ID"); |
|||
} |
|||
} |
|||
} |
|||
8161
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241121015657_add_appoint_schedule_template_exclude_customer_org.Designer.cs
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,40 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.WebPeis.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class add_appoint_schedule_template_exclude_customer_org : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.CreateTable( |
|||
name: "appoint_schedule_template_exclude_customer_org", |
|||
columns: table => new |
|||
{ |
|||
appoint_schedule_template_exclude_customer_org_id = table.Column<Guid>(type: "uuid", nullable: false), |
|||
appoint_schedule_template_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "预约计划模板Id"), |
|||
customer_org_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "单位ID"), |
|||
concurrency_stamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false), |
|||
creation_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
|||
creator_id = table.Column<Guid>(type: "uuid", nullable: true), |
|||
last_modification_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), |
|||
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("appoint_schedule_template_exclude_customer_org_pkey", x => x.appoint_schedule_template_exclude_customer_org_id); |
|||
}); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "appoint_schedule_template_exclude_customer_org"); |
|||
} |
|||
} |
|||
} |
|||
8161
src/Shentun.WebPeis.EntityFrameworkCore/Migrations/20241121042932_update_appoint_schedule_exclude_customer_org.Designer.cs
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,61 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.WebPeis.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class update_appoint_schedule_exclude_customer_org : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "appoint_schedule_template_exclude_customer_org"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "appoint_schedule_exclude_customer_org", |
|||
columns: table => new |
|||
{ |
|||
appoint_schedule_exclude_customer_org_id = table.Column<Guid>(type: "uuid", nullable: false), |
|||
appoint_schedule_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "预约计划Id"), |
|||
customer_org_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "单位ID"), |
|||
concurrency_stamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false), |
|||
creation_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
|||
creator_id = table.Column<Guid>(type: "uuid", nullable: true), |
|||
last_modification_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), |
|||
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("appoint_schedule_exclude_customer_org_pkey", x => x.appoint_schedule_exclude_customer_org_id); |
|||
}); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "appoint_schedule_exclude_customer_org"); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "appoint_schedule_template_exclude_customer_org", |
|||
columns: table => new |
|||
{ |
|||
appoint_schedule_template_exclude_customer_org_id = table.Column<Guid>(type: "uuid", nullable: false), |
|||
appoint_schedule_template_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "预约计划模板Id"), |
|||
concurrency_stamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false), |
|||
creation_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
|||
creator_id = table.Column<Guid>(type: "uuid", nullable: true), |
|||
customer_org_id = table.Column<Guid>(type: "uuid", nullable: false, comment: "单位ID"), |
|||
last_modification_time = table.Column<DateTime>(type: "timestamp with time zone", nullable: true), |
|||
last_modifier_id = table.Column<Guid>(type: "uuid", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("appoint_schedule_template_exclude_customer_org_pkey", x => x.appoint_schedule_template_exclude_customer_org_id); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue