From 01f91013989c60c498cba3344524f5f3621156cc Mon Sep 17 00:00:00 2001 From: wxd <123@qq.com> Date: Sun, 2 Jun 2024 23:50:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppointScheduleTemplateAppService.cs | 31 +++++++++++++++++++ .../Models/AppointSchedule.cs | 2 +- .../appsettings.json | 12 +++---- 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/Shentun.WebPeis.Application/AppointScheduleTemplates/AppointScheduleTemplateAppService.cs b/src/Shentun.WebPeis.Application/AppointScheduleTemplates/AppointScheduleTemplateAppService.cs index be49880..0f1a47a 100644 --- a/src/Shentun.WebPeis.Application/AppointScheduleTemplates/AppointScheduleTemplateAppService.cs +++ b/src/Shentun.WebPeis.Application/AppointScheduleTemplates/AppointScheduleTemplateAppService.cs @@ -1,14 +1,17 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; +using NPOI.DDF; 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; +using Volo.Abp.ObjectMapping; namespace Shentun.WebPeis.AppointScheduleTemplates { @@ -80,6 +83,34 @@ namespace Shentun.WebPeis.AppointScheduleTemplates return entListDto; } + /// + /// 保存预约计划模板 整合到一起 + /// + /// + /// + public async Task> CreateOrUpdateAppointScheduleTemplateAsync(List input) + { + List entListDto = new List(); + + var deleteList = await _appointScheduleTemplateRepository.GetListAsync(); + + await _appointScheduleTemplateRepository.DeleteManyAsync(deleteList,true); + + + List appointScheduleTemplateList = new List(); + foreach (var item in input) + { + var createEntity = ObjectMapper.Map(item); + createEntity.AppointScheduleTemplateId = GuidGenerator.Create(); + createEntity = await _appointScheduleTemplateManager.CreateAsync(createEntity); + + await _appointScheduleTemplateRepository.InsertAsync(createEntity,true); + } + + entListDto = await GetListAsync(); + + return entListDto; + } /// /// 创建预约计划模板 diff --git a/src/Shentun.WebPeis.Domain/Models/AppointSchedule.cs b/src/Shentun.WebPeis.Domain/Models/AppointSchedule.cs index 0d8a787..a350e5d 100644 --- a/src/Shentun.WebPeis.Domain/Models/AppointSchedule.cs +++ b/src/Shentun.WebPeis.Domain/Models/AppointSchedule.cs @@ -14,10 +14,10 @@ public partial class AppointSchedule : AuditedEntity, IHasConcurrencyStamp /// 预约日期 /// public DateTime? AppointDate { get; set; } + /// /// 上午数量限制 /// - public int AmNumberLimit { get; set; } /// /// 下午数量限制 diff --git a/src/Shentun.WebPeis.HttpApi.Host/appsettings.json b/src/Shentun.WebPeis.HttpApi.Host/appsettings.json index 173a183..a4d3f8b 100644 --- a/src/Shentun.WebPeis.HttpApi.Host/appsettings.json +++ b/src/Shentun.WebPeis.HttpApi.Host/appsettings.json @@ -2,10 +2,10 @@ "Kestrel": { "Endpoints": { //"Http": { - // "Url": "http://localhost:44382" + // "Url": "http://localhost:44322" //} "Https": { - "Url": "https://localhost:44382", + "Url": "https://localhost:44322", "Certificate": { "Path": "shentun.pfx", "Password": "Shentun2024" @@ -13,10 +13,10 @@ } } }, - //"urls": "https://10.1.12.140:44382", + //"urls": "https://10.1.12.140:44322", "AdminId": "3a12a8a6-beb9-fc29-b4e7-4acfb00d8370", "App": { - "SelfUrl": "https://localhost:44382", + "SelfUrl": "https://localhost:44322", "CorsOrigins": "https://*.WebPeis.com", "RedirectAllowedUrls": "" }, @@ -25,9 +25,9 @@ "Default": "Host=62.156.10.86;Port=5432;Database=WebPeis0520;User ID=postgres;Password=st123;" }, "AuthServer": { - "Authority": "https://localhost:44382", + "Authority": "https://localhost:44322", "RequireHttpsMetadata": false, - "SwaggerClientId": "WebPeis_Swagger", + "SwaggerClientId": "Localhost_Swagger", "SwaggerClientSecret": "", "WeChatClientId": "WeChatApp", "WeChatClientSecret": "1q2w3e*"